/* 统一公共样式文件 - 所有页面通用 */

:root {
    /* 基础颜色变量 */
    --primary: #1aad19;
    --primary-dark: #179b16;
    --primary-light: #4cbf4c;
    --primary-bg: rgba(26, 173, 25, 0.1);
    --primary-bg-hover: rgba(26, 173, 25, 0.15);
    --primary-bg-active: rgba(26, 173, 25, 0.2);
    --primary-shadow: rgba(26, 173, 25, 0.3);
    
    --secondary: #6bb6ab;
    --secondary-dark: #5aa59a;
    --secondary-light: #8bc4ba;
    
    --accent: #07c160;
    --accent-dark: #06a855;
    
    /* 状态颜色 */
    --success: #28a745;
    --success-bg: #d4edda;
    --success-text: #155724;
    --success-border: #c3e6cb;
    
    --warning: #ffc107;
    --warning-bg: #fff3cd;
    --warning-text: #856404;
    --warning-border: #ffeaa7;
    
    --error: #dc3545;
    --error-bg: #f8d7da;
    --error-text: #721c24;
    --error-border: #f5c6cb;
    
    --info: #17a2b8;
    --info-bg: #d1ecf1;
    --info-text: #0c5460;
    --info-border: #bee5eb;
    
    /* 背景颜色 */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-tertiary: #fafafa;
    --bg-gray: #f8f9fa;
    --bg-overlay: rgba(0, 0, 0, 0.6);
    
    /* 文字颜色 */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --text-placeholder: #cccccc;
    --text-white: #ffffff;
    --text-dark: #495057;
    
    /* 边框颜色 */
    --border: #e5e5e5;
    --border-light: #f0f0f0;
    --border-ultra-light: #f8f8f8;
    --border-dark: #dee2e6;
    
    /* 圆角半径 */
    --radius-xs: 2px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 50px;
    
    /* 阴影 */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 25px rgba(0,0,0,0.2);
    --shadow-xl: 0 12px 35px rgba(0,0,0,0.25);
    --shadow-primary: 0 2px 8px rgba(26, 173, 25, 0.15);
    --shadow-primary-lg: 0 6px 20px rgba(26, 173, 25, 0.25);
    
    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    --spacing-2xl: 24px;
    --spacing-3xl: 32px;
    
    /* 过渡动画 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --line-height: 1.6;
    
    /* 渐变 */
    --gradient-primary: linear-gradient(135deg, #1aad19, #179b16);
    --gradient-secondary: linear-gradient(135deg, #6bb6ab, #5aa59a);
    
    /* 层级 */
    --z-navbar: 1000;
    --z-modal: 2000;
    --z-loading: 3000;
    
    /* 尺寸 */
    --navbar-height: 60px;
    --header-height: 50px;
    
    /* 兼容旧版本变量名 */
    --primary-color: var(--primary);
    --primary-hover: var(--primary-dark);
    --primary-light: var(--primary-bg);
    --secondary-color: var(--secondary);
    --secondary-hover: var(--secondary-dark);
    --accent-color: var(--accent);
    --border-color: var(--border);
    --border-radius: var(--radius-md);
    --border-radius-large: var(--radius-lg);
    --border-radius-small: var(--radius-sm);
    --shadow-light: var(--shadow-sm);
    --shadow-medium: var(--shadow-md);
    --shadow-heavy: var(--shadow-lg);
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        /* 暗色模式颜色变量 */
        --bg-primary: #1c1c1e;
        --bg-secondary: #000000;
        --bg-tertiary: #2c2c2e;
        --bg-overlay: rgba(255, 255, 255, 0.1);
        
        --text-primary: #ffffff;
        --text-secondary: #a1a1a6;
        --text-muted: #8e8e93;
        --text-white: #000000;
        
        --border-color: #38383a;
        --border-light: #2c2c2e;
        
        --shadow-light: 0 2px 8px rgba(0,0,0,0.3);
        --shadow-medium: 0 4px 12px rgba(0,0,0,0.4);
        --shadow-heavy: 0 8px 25px rgba(0,0,0,0.5);
    }
    
    /* 暗色模式下的特殊样式 */
    .card {
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
    }
    
    .btn-secondary {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        border: 1px solid var(--border-color);
    }
    
    .form-control {
        background: var(--bg-tertiary);
        border-color: var(--border-color);
        color: var(--text-primary);
    }
    
    .form-control::placeholder {
        color: var(--text-muted);
    }
    
    /* 滚动条暗色模式 */
    ::-webkit-scrollbar-track {
        background: var(--bg-tertiary);
    }
    
    ::-webkit-scrollbar-thumb {
        background: var(--border-color);
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: var(--text-muted);
    }
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: var(--line-height);
    padding-bottom: var(--navbar-height);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* 通用容器 */
.container {
    max-width: 100%;
    margin: 0 auto;
    background: var(--bg-primary);
}

.container-fluid {
    width: 100%;
    padding: 0 16px;
}

/* 统一头部样式 */
.app-header {
    background: var(--bg-primary);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-light);
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.header-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: var(--font-size-base);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius-small);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-btn:hover {
    background: var(--bg-secondary);
}

.header-btn.primary {
    background: var(--primary-color);
    color: var(--text-white);
}

.header-btn.primary:hover {
    background: var(--primary-hover);
}

/* 渐变头部样式 */
.gradient-header {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--text-white);
    padding: 20px 16px;
    position: relative;
    overflow: hidden;
}

.gradient-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.gradient-header-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gradient-header h1 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    text-align: center;
}

/* 统一底部导航栏 */
.bottom-navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    height: var(--navbar-height);
    display: flex;
    z-index: var(--z-navbar);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

.navbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    text-decoration: none;
    color: var(--text-muted);
    transition: all 0.3s ease;
    position: relative;
}

.navbar-item:hover {
    color: var(--primary-color);
    background: var(--primary-light);
}

.navbar-item.active {
    color: var(--primary-color);
}

.navbar-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
}

.navbar-icon {
    font-size: 20px;
    margin-bottom: 2px;
}

.navbar-label {
    font-size: var(--font-size-xs);
    font-weight: 500;
}

/* 主要内容区域 */
.main-content {
    min-height: calc(100vh - var(--navbar-height));
    padding: 16px;
}

/* 卡片样式 */
.card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    overflow: hidden;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.card-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    font-size: var(--font-size-base);
}

.card-body {
    padding: 16px;
}

.card-footer {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-light);
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    gap: 8px;
    min-height: 44px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-light);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary-color);
    color: var(--text-white);
}

.btn-sm {
    padding: 8px 16px;
    font-size: var(--font-size-sm);
    min-height: 36px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: var(--font-size-lg);
    min-height: 52px;
}

.btn-block {
    width: 100%;
}

/* 状态样式 */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-success {
    background: #d4edda;
    color: #155724;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
}

.status-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-loading);
    backdrop-filter: blur(4px);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-white);
    margin-top: 16px;
    font-size: var(--font-size-base);
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--border-radius-large);
    max-width: 90%;
    max-height: 80%;
    overflow: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* 消息提示 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: var(--text-white);
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: var(--primary-color);
}

.toast.error {
    background: #dc3545;
}

.toast.warning {
    background: #ffc107;
    color: var(--text-primary);
}

/* 工具类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-flex { display: flex; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.d-none { display: none; }

.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.p-0 { padding: 0; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

/* 响应式设计 */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0 12px;
    }
    
    .main-content {
        padding: 12px;
    }
    
    .card-body {
        padding: 12px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: var(--font-size-sm);
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
} 