/* 九六数字 - 统一样式文件 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-tertiary: #edf2f7;
    --border-color: #e2e8f0;
    --success-color: #48bb78;
    --error-color: #f56565;
    --warning-color: #ed8936;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    background: var(--bg-secondary);
}

/* 导航栏 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.logo:hover {
    opacity: 0.8;
}

.nav {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 15px;
}

.nav a:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

/* 按钮 */
.btn {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

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

/* 卡片 */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 32px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

/* 统计卡片 */
.stat-card {
    background: white;
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-label {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-unit {
    font-size: 16px;
    color: var(--text-muted);
    margin-left: 4px;
    font-weight: 600;
}

/* 表单 */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

/* 提示框 */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: #f0fff4;
    color: #2f855a;
    border: 1px solid #9ae6b4;
}

.alert-error {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.alert-warning {
    background: #fffaf0;
    color: #c05621;
    border: 1px solid #fbd38d;
}

.alert-info {
    background: #ebf8ff;
    color: #2c5282;
    border: 1px solid #90cdf4;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #c6f6d5;
    color: #22543d;
}

.badge-danger {
    background: #fed7d7;
    color: #742a2a;
}

.badge-warning {
    background: #feebc8;
    color: #7c2d12;
}

.badge-info {
    background: #bee3f8;
    color: #2a4365;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: 40px;
    max-width: 540px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 14px 16px;
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--bg-tertiary);
    font-size: 14px;
    color: var(--text-primary);
}

.table tr:hover {
    background: var(--bg-secondary);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 56px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* 用户信息 */
.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.balance {
    background: var(--primary-gradient);
    color: white;
    padding: 10px 20px;
    border-radius: 24px;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* 响应式 */
@media (max-width: 768px) {
    .header {
        padding: 0 20px;
    }
    
    .header-content {
        height: 64px;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .nav {
        gap: 4px;
    }
    
    .nav a {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .card {
        padding: 20px;
    }
    
    .modal-content {
        padding: 24px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 0.8s linear infinite;
}

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

/* 渐变文字 */
.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: var(--text-primary);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 12px;
    white-space: nowrap;
    margin-bottom: 8px;
    box-shadow: var(--shadow-md);
}
