/* base.css */
:root {
    --primary-color: #4e54c8;
    --primary-hover: #3a3f9d;
    --secondary-color: #8f94fb;
    --text-color: #333;
    --light-text: #666;
    --lighter-text: #999;
    --border-color: #e0e0e0;
    --background: #f8f9fa;
    --card-background: #ffffff;
    --error-color: #e74c3c;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --header-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --footer-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* 深色模式变量 - 跟随系统设置 */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #6c7ce7;
        --primary-hover: #5a6fd8;
        --secondary-color: #a29bfe;
        --text-color: #e4e6ea;
        --light-text: #b0b3b8;
        --lighter-text: #8a8d91;
        --border-color: #3e4042;
        --background: #18191a;
        --card-background: #242526;
        --white: #242526;
        --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        --header-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        --footer-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--background);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    border: none;
    font-size: 14px;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    color: white;
}

.secondary-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.secondary-btn:hover {
    background-color: rgba(78, 84, 200, 0.05);
}

/* Header */
.header {
    background-color: var(--card-background);
    box-shadow: var(--header-shadow);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Main Content */
.main {
    flex: 1;
    padding: 30px 0;
}

/* Footer */
.footer {
    background-color: var(--card-background);
    box-shadow: var(--footer-shadow);
    padding: 10px 0;
    position: sticky;
    bottom: 0;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.footer-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--light-text);
    padding: 8px 0;
    width: 33.333%;
    transition: color 0.2s;
}

.nav-item:hover, .nav-item.active {
    color: var(--primary-color);
}

.nav-icon {
    font-size: 22px;
    margin-bottom: 4px;
}

.nav-text {
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header {
        padding: 12px 0;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .main {
        padding: 20px 0;
    }
}

/* Toast Messages */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    animation: slideIn 0.3s ease, fadeOut 0.5s ease 2.5s forwards;
    max-width: 300px;
}

.toast-success {
    background-color: var(--success-color);
    color: white;
}

.toast-error {
    background-color: var(--error-color);
    color: white;
}

.toast-warning {
    background-color: var(--warning-color);
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}

@media (prefers-color-scheme: dark) {
    .loading-overlay {
        background-color: rgba(24, 25, 26, 0.7);
    }
}

.loading-overlay.active {
    visibility: visible;
    opacity: 1;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
}

@media (max-width: 768px) {
    .header-right .btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}