﻿/* ════════════════════════════════════════════════════
   Copilot Admin Panel — 现代毛玻璃主题 v5
   ════════════════════════════════════════════════════ */
:root {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, .68);
    --bg-input: rgba(240, 244, 248, .8);
    --border: rgba(0, 0, 0, .05);
    --border-strong: rgba(0, 0, 0, .10);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-light: rgba(99, 102, 241, .06);
    --accent-glow: rgba(99, 102, 241, .15);
    --success: #10b981;
    --success-light: rgba(16, 185, 129, .07);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, .07);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, .07);
    --info: #0ea5e9;
    --info-light: rgba(14, 165, 233, .06);
    --sidebar-width: 250px;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.04);
    --shadow: 0 2px 8px rgba(0,0,0,.06);
    --shadow-md: 0 4px 20px rgba(0,0,0,.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.12);
    --glass-bg: rgba(255, 255, 255, .60);
    --glass-border: rgba(255, 255, 255, .50);
    --glass-blur: 40px;
    --transition-fast: .15s cubic-bezier(.4,0,.2,1);
    --transition: .25s cubic-bezier(.4,0,.2,1);
    --card-bg: var(--bg-card);
    --input-bg: var(--bg-input);
    --text: var(--text-primary);
    --muted: var(--text-muted);
    --primary: var(--accent);
    --bg-color: var(--bg-primary);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99,102,241,.06) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(14,165,233,.04) 0%, transparent 60%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-hover); }
code {
    background: var(--bg-input);
    padding: 2px 7px;
    border-radius: 6px;
    font-size: .84em;
    color: var(--accent);
    font-family: "SF Mono", "JetBrains Mono", "Cascadia Code", "Fira Code", Consolas, monospace;
}

/* ─── 侧边栏 ─── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: rgba(255, 255, 255, .50);
    backdrop-filter: blur(48px) saturate(1.5);
    -webkit-backdrop-filter: blur(48px) saturate(1.5);
    border-right: 1px solid rgba(255,255,255,.6);
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: 1px 0 20px rgba(0,0,0,.03);
}
.sidebar-header {
    padding: 28px 20px 20px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}
.sidebar-header h2 {
    font-size: 1.15rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #0ea5e9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: .2px;
}
.user-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), #818cf8);
    color: #fff;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .3px;
    box-shadow: 0 2px 8px rgba(99,102,241,.2);
}
.nav-links {
    list-style: none;
    padding: 12px 8px;
    flex: 1;
    overflow-y: auto;
}
.nav-links::-webkit-scrollbar { width: 4px; }
.nav-links::-webkit-scrollbar-thumb { background: rgba(0,0,0,.1); border-radius: 4px; }
.nav-links li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin: 2px 0;
    color: var(--text-secondary);
    font-size: .86rem;
    font-weight: 500;
    transition: all var(--transition);
    border-radius: 10px;
    border-left: 3px solid transparent;
}
.nav-links li a:hover {
    background: var(--accent-light);
    color: var(--accent);
    transform: translateX(2px);
}
.nav-links li a.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
    border-left-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(99,102,241,.08);
}
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

/* ─── 主内容 ─── */
main {
    padding: 28px 36px;
    max-width: 1300px;
    margin: 0 auto;
    animation: fadeInUp .4s ease-out;
}
main.with-sidebar {
    margin-left: var(--sidebar-width);
}

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

/* ─── 页头 ─── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -.02em;
}

/* ─── 统计卡片 ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.stats-sm { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.stat-card {
    background: rgba(255,255,255,.60);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    border: 1px solid rgba(255,255,255,.55);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--border);
    border-radius: 16px 16px 0 0;
    transition: background var(--transition);
}
.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.stat-value { font-size: 1.65rem; font-weight: 800; color: var(--text-primary); letter-spacing: -.02em; }
.stat-label { font-size: .76rem; color: var(--text-muted); margin-top: 4px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; }
.stat-success .stat-value { color: var(--success); }
.stat-success::after { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-warning .stat-value { color: var(--warning); }
.stat-warning::after { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-danger .stat-value  { color: var(--danger); }
.stat-danger::after { background: linear-gradient(90deg, #ef4444, #f87171); }
.stat-info .stat-value    { color: var(--info); }
.stat-info::after { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }

/* ─── 卡片 ─── */
.card {
    background: rgba(255,255,255,.60);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    border: 1px solid rgba(255,255,255,.55);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.card:hover {
    box-shadow: var(--shadow);
}
.card h3 {
    margin-bottom: 16px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-header-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-header-flex h3 { margin-bottom: 0; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 24px; }

/* ─── 表格 ─── */
.table-responsive { overflow-x: auto; border-radius: var(--radius-sm); }
table, .table { width: 100%; border-collapse: separate; border-spacing: 0; }
table th, table td, .table th, .table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: .85rem;
}
table th, .table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .6px;
    background: rgba(248,250,252,.8);
    position: sticky;
    top: 0;
}
table th:first-child, .table th:first-child { border-radius: 8px 0 0 0; }
table th:last-child, .table th:last-child { border-radius: 0 8px 0 0; }
table tbody tr, .table tbody tr { transition: background var(--transition-fast); }
table tbody tr:hover, .table tbody tr:hover { background: rgba(99,102,241,.03); }
table tbody tr:last-child td, .table tbody tr:last-child td { border-bottom: none; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.actions { white-space: nowrap; }

/* ─── 徽章 ─── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .2px;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger  { background: var(--danger-light);  color: var(--danger); }
.badge-info    { background: var(--info-light);    color: var(--info); }
.badge-muted   { background: var(--bg-input);      color: var(--text-muted); }
.badge-primary { background: var(--accent-light);  color: var(--accent); }

/* ─── 标签 ─── */
.tag-list { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { padding: 4px 12px; border-radius: 6px; font-size: .82rem; }
.tag-success { background: var(--success-light); color: var(--success); }
.tag-danger  { background: var(--danger-light);  color: var(--danger); }

/* ─── 按钮 ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: .86rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    line-height: 1.5;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn-primary {
    background: linear-gradient(135deg, var(--accent), #818cf8);
    color: #fff;
    box-shadow: 0 2px 10px rgba(99,102,241,.25);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), #6366f1);
    box-shadow: 0 4px 16px rgba(99,102,241,.3);
}
.btn-secondary { background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border-strong); }
.btn-secondary:hover { background: #fff; border-color: var(--accent); color: var(--accent); }
.btn-success { background: linear-gradient(135deg, #10b981, #34d399); color: #fff; box-shadow: 0 2px 10px rgba(16,185,129,.2); }
.btn-warning { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #fff; box-shadow: 0 2px 10px rgba(245,158,11,.2); }
.btn-danger  { background: linear-gradient(135deg, #ef4444, #f87171); color: #fff; box-shadow: 0 2px 10px rgba(239,68,68,.2); }
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-strong);
    color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 6px 14px; font-size: .82rem; }
.btn-xs { padding: 4px 10px; font-size: .74rem; border-radius: 7px; }

/* ─── 表单 ─── */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: .84rem;
    color: var(--text-secondary);
    font-weight: 600;
}
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 10px 14px;
    background: #fff;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: .88rem;
    transition: all var(--transition);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.checkbox-label { display: flex !important; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: auto; accent-color: var(--accent); }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.detail-item label {
    font-size: .72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 600;
}

/* ─── 登录页 ─── */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99,102,241,.08) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(14,165,233,.06) 0%, transparent 60%),
        linear-gradient(135deg, #e8edf5 0%, #f0f2f5 40%, #eef6f0 100%);
    padding: 20px;
}
.login-card {
    background: rgba(255, 255, 255, .55);
    backdrop-filter: blur(48px) saturate(1.5);
    -webkit-backdrop-filter: blur(48px) saturate(1.5);
    border: 1px solid rgba(255,255,255,.6);
    border-radius: 24px;
    padding: 48px 40px;
    width: 420px;
    box-shadow: 0 8px 40px rgba(0,0,0,.08);
}
.login-header {
    text-align: center;
    margin-bottom: 32px;
}
.login-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #0ea5e9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}
.login-header p { color: var(--text-muted); font-size: .88rem; }

/* ─── 模态框 ─── */
.modal {
    display: none;
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15,23,42,.15);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 200;
    align-items: center; justify-content: center;
}
.modal.show { display: flex; }
.modal-content {
    background: rgba(255,255,255,.80);
    backdrop-filter: blur(48px) saturate(1.4);
    -webkit-backdrop-filter: blur(48px) saturate(1.4);
    border: 1px solid rgba(255,255,255,.6);
    border-radius: 20px;
    padding: 28px;
    width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn .25s ease-out;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(.96) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h2 { font-size: 1.1rem; font-weight: 700; }
.modal-close {
    background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer;
    width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
    transition: all var(--transition-fast);
}
.modal-close:hover { color: var(--text-primary); background: var(--bg-input); }

/* ─── Flash ─── */
.flash-container { margin-bottom: 20px; }
.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .88rem;
    font-weight: 500;
    animation: flashIn .3s ease-out;
}
@keyframes flashIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.flash-success { background: var(--success-light); border: 1px solid rgba(16,185,129,.15); color: var(--success); }
.flash-error   { background: var(--danger-light);  border: 1px solid rgba(239,68,68,.15);  color: var(--danger); }
.flash-info    { background: var(--info-light);    border: 1px solid rgba(99,102,241,.15);  color: var(--info); }
.flash-warning { background: var(--warning-light); border: 1px solid rgba(245,158,11,.15);  color: var(--warning); }
.flash-close { background: none; border: none; color: inherit; font-size: 1.2rem; cursor: pointer; opacity: .6; }
.flash-close:hover { opacity: 1; }

/* ─── 分页 ─── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }

/* ─── Toggle ─── */
.toggle-switch { position: relative; display: inline-block; width: 48px; height: 26px; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: #d1d5db; border-radius: 26px; transition: var(--transition);
}
.toggle-slider::before {
    content: ""; position: absolute; width: 20px; height: 20px;
    left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.toggle-switch input:checked + .toggle-slider { background: linear-gradient(135deg, #10b981, #34d399); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }

/* ─── 滚动条美化 ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.2); }

/* ─── 响应式 ─── */
@media (max-width: 768px) {
    .sidebar { display: none; }
    main.with-sidebar { margin-left: 0; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .modal-content { width: 95%; margin: 0 10px; }
    main { padding: 16px; }
    .page-header h1 { font-size: 1.2rem; }
}

::selection { background: rgba(99,102,241,.15); color: var(--accent-hover); }
