/**
 * 逐光圈 PC 端高级感样式
 * 设计理念：对标 Linear / Vercel Dashboard 的现代 SaaS 风格
 * 色调：深空蓝 + 青蓝渐变 + 银灰（冷色调）
 * 字体：Inter + Noto Sans SC
 */

/* ========================================
   1. 全局变量系统
   ======================================== */
:root {
    /* 侧边栏 - 白色毛玻璃 */
    --sidebar-bg: rgba(255, 255, 255, 0.85);
    --sidebar-hover: #f1f5f9;
    --sidebar-active: rgba(6, 182, 212, 0.1);
    --sidebar-border: rgba(226, 232, 240, 0.8);
    --sidebar-text: #64748b;
    --sidebar-text-active: #06b6d4;
    --sidebar-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);

    /* 强调色 - 青蓝（冷色调） */
    --accent: #06b6d4;
    --accent-hover: #0891b2;
    --accent-light: rgba(6, 182, 212, 0.1);
    --accent-glow: 0 0 20px rgba(6, 182, 212, 0.3);

    /* 辅助色 - 冷色调 */
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --warning: #6366f1;  /* 改为靛蓝（冷色） */
    --warning-light: rgba(99, 102, 241, 0.1);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --info: #06b6d4;
    --info-light: rgba(6, 182, 212, 0.1);

    /* 内容区背景 */
    --bg-primary: #f1f5f9;  /* 改为浅灰，与白色卡片形成对比 */
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8fafc;

    /* 文字色 */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* 边框 */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12);

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

    /* 动画 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ========================================
   2. 全局基础样式
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

body {
    font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ========================================
   3. 侧边栏导航系统
   ======================================== */
.premium-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--sidebar-border);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--sidebar-shadow);
}

.premium-sidebar::-webkit-scrollbar {
    width: 4px;
}

.premium-sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.sidebar-brand img {
    height: 36px;
    width: auto;
}

.sidebar-brand-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.sidebar-badge {
    font-size: 0.65rem;
    background: linear-gradient(135deg, var(--accent), #0891b2);
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.sidebar-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--sidebar-text);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 12px 12px 8px;
    margin-top: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    transition: all var(--transition-fast);
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
    font-weight: 600;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--sidebar-hover);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-user:hover {
    background: var(--sidebar-active);
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.7rem;
    color: var(--sidebar-text);
}

/* ========================================
   4. 主内容区布局
   ======================================== */
.premium-main {
    margin-left: 260px;
    min-height: 100vh;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
}

.premium-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.premium-header-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.premium-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.premium-content {
    padding: 32px;
    max-width: 1400px;
    flex: 1;
}

/* ========================================
   5. 数据卡片系统
   ======================================== */
.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--accent);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #0891b2);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.stat-card:hover::before {
    opacity: 1;
}

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

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card-icon.blue {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent);
}

.stat-card-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.stat-card-icon.purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.stat-card-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.stat-card-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

.stat-card-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 12px;
}

.stat-card-trend.up {
    color: #10b981;
}

.stat-card-trend.down {
    color: #ef4444;
}

/* ========================================
   6. 内容卡片
   ======================================== */
.premium-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.premium-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.premium-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.premium-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.premium-card-title i {
    color: var(--accent);
}

.premium-card-body {
    padding: 24px;
}

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

/* ========================================
   7. 表格样式
   ======================================== */
.premium-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.premium-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
}

.premium-table thead {
    background: var(--bg-tertiary);
}

.premium-table thead th {
    padding: 14px 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.premium-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

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

.premium-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.premium-table tbody td {
    padding: 16px 20px;
    font-size: 0.9rem;
    color: var(--text-primary);
    vertical-align: middle;
}

/* ========================================
   8. 按钮系统
   ======================================== */
.btn-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-premium-primary {
    background: linear-gradient(135deg, var(--accent), #0891b2);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25);
}

.btn-premium-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(6, 182, 212, 0.35);
}

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

.btn-premium-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-premium-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent);
}

.btn-premium-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* ========================================
   9. 表单输入框
   ======================================== */
.premium-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.premium-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

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

/* ========================================
   10. 徽章系统
   ======================================== */
.badge-premium {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
}

.badge-premium-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-premium-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-premium-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-premium-info {
    background: var(--info-light);
    color: var(--info);
}

/* ========================================
   11. 动画系统
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease;
}

.animate-slide-up {
    animation: slideUp 0.5s ease;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* ========================================
   12. 排行榜样式
   ======================================== */
.rank-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
}

.rank-badge.gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.rank-badge.silver {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: #ffffff;
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #ffffff;
}

.rank-badge.normal {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* ========================================
   13. 用户头像
   ======================================== */
.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.user-avatar-md {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.user-avatar-lg {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
}

/* ========================================
   14. 空状态
   ======================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--text-muted);
    opacity: 0.3;
    margin-bottom: 16px;
}

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

.empty-state-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ========================================
   15. 响应式适配
   ======================================== */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5); /* 深空蓝半透明，契合主题 */
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 1040; /* 低于侧边栏(1050)，高于主内容 */
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

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

@media (max-width: 1200px) {
    .premium-content {
        padding: 24px;
    }
}

@media (max-width: 991.98px) {
    /* 侧边栏变为固定定位抽屉 */
    .premium-sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-slow); /* 使用更平滑的贝塞尔曲线 */
        box-shadow: none; /* 关闭时无阴影 */
    }

    .premium-sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl); /* 打开时添加大阴影增强层次感 */
    }

    /* 主内容区取消左边距 */
    .premium-main {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* 内容区内边距缩小 */
    .premium-content {
        padding: 16px;
    }

    /* Header 内边距缩小 */
    .premium-header {
        padding: 12px 16px;
    }

    .premium-header-title {
        font-size: 1.2rem;
    }
}
@media (max-width: 1200px) {
    .premium-content {
        padding: 24px;
    }
}

@media (max-width: 992px) {
    .premium-sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
    }

    .premium-sidebar.open {
        transform: translateX(0);
    }

    .premium-main {
        margin-left: 0;
    }

    .premium-content {
        padding: 16px;
    }
}
