/**
 * 光遇代练数据管理系统 - 全局样式
 * 包含毛玻璃效果、深浅模式自适应
 */

/* ==================== CSS变量定义 ==================== */
:root {
    /* 浅色模式变量 */
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.75);
    --bg-glass-strong: rgba(255, 255, 255, 0.9);
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-muted: #6b7280;
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    
    /* 主题色 */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* 统计颜色 */
    --stat-positive: #10b981;
    --stat-negative: #ef4444;
    --stat-neutral: #6b7280;
    
    /* 状态颜色 */
    --status-created: #f59e0b;
    --status-progress: #3b82f6;
    --status-completed: #10b981;
    
    /* 毛玻璃效果 */
    --blur-amount: 20px;
    --blur-strong: 30px;
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* 过渡 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* 深色模式变量 */
[data-theme="dark"] {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-glass: rgba(26, 26, 46, 0.75);
    --bg-glass-strong: rgba(26, 26, 46, 0.9);
    --text-primary: #f1f1f4;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b8a;
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.4);
}

/* 系统自动深色模式 */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #0f0f1a;
        --bg-secondary: #1a1a2e;
        --bg-glass: rgba(26, 26, 46, 0.75);
        --bg-glass-strong: rgba(26, 26, 46, 0.9);
        --text-primary: #f1f1f4;
        --text-secondary: #a0a0b8;
        --text-muted: #6b6b8a;
        --border-color: rgba(255, 255, 255, 0.08);
        --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
        --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.4);
    }
}

/* ==================== 基础重置 ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-light);
}

img {
    max-width: 100%;
    height: auto;
}

/* ==================== 背景图片容器 ==================== */
.bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity var(--transition-slow);
}

.bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 100%);
}

/* ==================== 毛玻璃卡片 ==================== */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
}

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

.glass-card-strong {
    background: var(--bg-glass-strong);
    backdrop-filter: blur(var(--blur-strong));
    -webkit-backdrop-filter: blur(var(--blur-strong));
}

/* ==================== 页面布局 ==================== */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-narrow {
    max-width: 600px;
}

.container-wide {
    max-width: 1400px;
}

/* ==================== 标题样式 ==================== */
.page-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* ==================== 表单样式 ==================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

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

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ==================== 按钮样式 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

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

.btn:active {
    transform: translateY(0);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, #db2777 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
}

.btn-info {
    background: linear-gradient(135deg, var(--info) 0%, #2563eb 100%);
}

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

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ==================== 查询框样式 ==================== */
.search-box {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.search-input {
    flex: 1;
    padding: 1rem 1.25rem;
    font-size: 1.125rem;
    text-align: center;
    letter-spacing: 0.05em;
}

.search-input::-webkit-outer-spin-button,
.search-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.search-input[type=number] {
    -moz-appearance: textfield;
}

/* ==================== 数据展示卡片 ==================== */
.data-card {
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.data-section {
    margin-bottom: 1.5rem;
}

.data-section:last-child {
    margin-bottom: 0;
}

.data-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.data-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.data-item-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.data-item-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ==================== 统计展示 ==================== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0.75rem;
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.stat-item:hover {
    transform: scale(1.02);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.stat-positive {
    color: var(--stat-positive);
}

.stat-negative {
    color: var(--stat-negative);
}

.stat-neutral {
    color: var(--stat-neutral);
}

/* ==================== 数据对比表格 ==================== */
.comparison-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.comparison-table thead {
    background: var(--bg-glass);
}

.comparison-table th {
    padding: 0.875rem 1rem;
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.comparison-table th:first-child {
    text-align: left;
}

.comparison-table td {
    padding: 0.875rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.comparison-table td:first-child {
    text-align: left;
    font-weight: 500;
    color: var(--text-secondary);
}

.comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.comparison-table tbody tr:hover {
    background: var(--bg-glass);
}

.comparison-table .diff {
    font-weight: 600;
}

.comparison-table .diff.positive {
    color: var(--stat-positive);
}

.comparison-table .diff.negative {
    color: var(--stat-negative);
}

.comparison-table .diff.neutral {
    color: var(--stat-neutral);
}

/* ==================== 燃料详情对比 ==================== */
.fuel-comparison {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.fuel-box {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.fuel-box-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.fuel-box-content {
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ==================== 状态标签 ==================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-created {
    background: rgba(245, 158, 11, 0.15);
    color: var(--status-created);
}

.status-progress {
    background: rgba(59, 130, 246, 0.15);
    color: var(--status-progress);
}

.status-completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--status-completed);
}

/* ==================== 信息展示 ==================== */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.info-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ==================== 提示信息 ==================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--info);
}

/* ==================== 加载动画 ==================== */
.loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== 主题切换按钮 ==================== */
.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    backdrop-filter: blur(var(--blur-amount));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 100;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
}

.theme-toggle svg {
    width: 22px;
    height: 22px;
    color: var(--text-primary);
}

/* ==================== 页脚 ==================== */
.page-footer {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-payment {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* ==================== 快捷链接区域 ==================== */
.quick-link-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* ==================== 支付信息区域 ==================== */
.payment-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.payment-section .section-title {
    color: var(--success);
}

.quick-link-box {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.quick-link-input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state-desc {
    color: var(--text-secondary);
}

/* ==================== 订单列表样式 ==================== */
.order-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order-list-item {
    display: flex;
    align-items: stretch;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.order-list-item:hover {
    background: var(--bg-glass-hover);
    border-color: var(--primary);
    transform: translateX(4px);
}

.order-list-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.order-list-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-glass-hover);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.order-list-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.order-list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.order-list-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.order-list-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.order-list-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 1rem;
    color: var(--text-muted);
}

.order-list-item:hover .order-list-arrow {
    color: var(--primary);
}

.text-success {
    color: var(--success) !important;
}

.text-warning {
    color: var(--warning) !important;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.5rem;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .data-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .glass-card {
        margin: 0 -0.5rem;
        border-radius: var(--radius-md);
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem 0.5rem;
    }
    
    .data-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== 动画效果 ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease forwards;
}

/* ==================== 打印样式 ==================== */
@media print {
    .theme-toggle,
    .btn,
    .page-footer {
        display: none !important;
    }
    
    .glass-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
