@font-face {
    font-family: 'Outfit';
    src: url('assets/fonts/Outfit-Variable.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    /* 核心色调 - 深海与高端质感 */
    --primary: #0a2342;
    /* 深海蓝 */
    --primary-light: #163e6e;
    --accent: #20c997;
    /* 绿松石/海洋绿 */
    --accent-glow: rgba(32, 201, 151, 0.4);
    --gold: #ffc107;
    /* 落日金 */

    /* 背景与卡片 - 玻璃拟态风格 */
    --bg-main: #050b14;
    --bg-card: rgba(255, 255, 255, 0.05);
    --border-card: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(12px);

    /* 文字 */
    --text-main: #f8f9fa;
    --text-muted: #adb5bd;

    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;

    /* 阴影 */
    --shadow-premium: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-accent: 0 0 20px var(--accent-glow);
}

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

body {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    background: radial-gradient(circle at 50% -20%, #163e6e 0%, #050b14 70%);
    min-height: 100vh;
}

/* 布局外层 */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 - 玻璃拟态 */
.sidebar {
    width: 260px;
    background: rgba(10, 35, 66, 0.7);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-card);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--primary-light));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-accent);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, var(--text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    flex: 1;
    list-style: none;
}

.nav-item {
    margin-bottom: var(--spacing-sm);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    text-decoration: none;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.nav-link.active {
    border-left: 4px solid var(--accent);
}

.nav-link i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: var(--spacing-xl);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
}

h1 {
    font-size: 2rem;
    font-weight: 600;
}

/* 卡片样式 */
.card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-premium);
}

/* 指标网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-trend {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-up {
    color: #51cf66;
}

.trend-down {
    color: #ff6b6b;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #12b886);
    color: white;
}

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

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

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    color: white;
}

/* 全局表单元素样式 */
input,
select,
textarea {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

/* 移除 Chrome, Safari, Edge, Opera 的数字输入框箭头 */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 移除 Firefox 的数字输入框箭头 */
input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* 全局复选框样式优化 */
input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-card);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-right: 8px;
}

input[type="checkbox"]:hover {
    border-color: var(--accent);
    background: rgba(32, 201, 151, 0.1);
    transform: scale(1.05);
}

input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--accent), #12b886);
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

input[type="checkbox"]:checked::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 11px;
    color: white;
    transform: scale(1);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 紧凑型输入框，适用于表格内部 */
.input-compact {
    padding: 5px 8px;
    font-size: 0.85rem;
    border-radius: 4px;
    text-align: center;
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: var(--spacing-sm);
    }

    .logo-text,
    .nav-link span {
        display: none;
    }

    .main-content {
        margin-left: 80px;
    }
}