/* ==========================================================================
   StudyVault · 个人学习资料管理系统
   ========================================================================== */

:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --ink: #0f172a;
    --ink-2: #334155;
    --ink-3: #475569;
    --muted: #64748b;
    --line: #e7ebf3;
    --line-2: #eef2f8;
    --brand: #4f46e5;
    --brand-2: #7c3aed;
    --ok: #059669;
    --warn: #d97706;
    --bad: #e11d48;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 14px 32px -22px rgba(15, 23, 42, .28);
    --shadow-lg: 0 24px 60px -30px rgba(15, 23, 42, .35);
    --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }
.ico { flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.ellipsis { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 骨架 ---------------- */

.shell {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 22px 16px 18px;
    background:
        radial-gradient(520px 260px at 10% -5%, rgba(124, 58, 237, .35), transparent 60%),
        radial-gradient(420px 300px at 95% 105%, rgba(56, 189, 248, .16), transparent 60%),
        linear-gradient(180deg, #0d1424 0%, #111a2f 100%);
    color: #cbd5e1;
    z-index: 40;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 8px 22px;
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(145deg, #6366f1, #8b5cf6);
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: .4px;
    box-shadow: 0 8px 18px -8px rgba(99, 102, 241, .9);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { color: #fff; font-size: 15.5px; letter-spacing: .2px; }
.brand-text em { font-style: normal; font-size: 11.5px; color: #8fa0bd; letter-spacing: .6px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-label {
    padding: 6px 12px;
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #6b7a99;
}
.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 11px;
    color: #a9b7cf;
    font-weight: 500;
    transition: background .16s ease, color .16s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.is-active {
    color: #fff;
    background: linear-gradient(90deg, rgba(99, 102, 241, .38), rgba(99, 102, 241, .10));
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, .28);
}
.nav-item.is-active::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 50%;
    width: 3px;
    height: 20px;
    transform: translateY(-50%);
    border-radius: 0 4px 4px 0;
    background: #818cf8;
}

.side-card {
    margin-top: auto;
    padding: 14px;
    border-radius: 13px;
    border: 1px solid rgba(148, 163, 184, .16);
    background: rgba(255, 255, 255, .035);
}
.side-card-top {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #93a4c1;
}
.side-card-top strong { color: #e2e8f0; font-weight: 600; }
.meter {
    height: 6px;
    margin: 9px 0 7px;
    border-radius: 99px;
    background: rgba(148, 163, 184, .22);
    overflow: hidden;
}
.meter i {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, #6366f1, #a78bfa);
}
.side-card small { font-size: 11px; color: #7c8cab; }

.side-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 8px 2px;
    border-top: 1px solid rgba(148, 163, 184, .14);
}
.avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(145deg, #38bdf8, #6366f1);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
}
.side-user-info { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.side-user-info strong { color: #e8eefb; font-size: 13px; font-weight: 600; }
.side-user-info em { font-style: normal; font-size: 11px; color: #7f8ea9; }
.side-user .icon-btn { margin-left: auto; color: #8fa0bd; }
.side-user .icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .08); }

/* ---------------- 主区域 ---------------- */

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 28px;
    background: rgba(245, 247, 251, .82);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.page-head { min-width: 0; }
.page-head h1 { font-size: 19px; line-height: 1.3; }
.page-head p { font-size: 12.5px; color: var(--muted); margin-top: 1px; }

.search {
    position: relative;
    margin-left: auto;
    width: min(340px, 34vw);
}
.search input {
    width: 100%;
    height: 38px;
    padding: 0 14px 0 38px;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: #fff;
    color: var(--ink);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: #9aa8bd; }
.search input:focus { border-color: #c7cdf9; box-shadow: 0 0 0 4px rgba(99, 102, 241, .10); }
.search-ico {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.burger {
    display: none;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    color: var(--ink-2);
    place-items: center;
    cursor: pointer;
}

.content {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 22px 28px 48px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ---------------- 通用组件 ---------------- */

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line-2);
}
.card-head h3 { font-size: 14.5px; }
.card-sub { font-size: 12px; color: var(--muted); margin-left: auto; }
.card-head .card-sub { margin-left: auto; }
.card-link {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 12.5px;
    color: var(--brand);
    font-weight: 500;
}
.card-link:hover { color: var(--brand-2); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 15px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 550;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, box-shadow .15s, border-color .15s, transform .06s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: linear-gradient(135deg, var(--brand), #6366f1);
    color: #fff;
    box-shadow: 0 10px 20px -12px rgba(79, 70, 229, .9);
}
.btn-primary:hover { background: linear-gradient(135deg, #4338ca, #5b53ee); }
.btn-ghost {
    background: #fff;
    border-color: var(--line);
    color: var(--ink-2);
}
.btn-ghost:hover { border-color: #cfd7e6; background: #fbfcfe; }
.btn-ghost.is-fav { color: #b45309; border-color: #fde68a; background: #fffbeb; }
.btn-light { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .28); }
.btn-light:hover { background: rgba(255, 255, 255, .26); }
.btn-danger-ghost { background: #fff; border-color: #fecdd3; color: var(--bad); }
.btn-danger-ghost:hover { background: #fff1f2; }
.btn-block { width: 100%; }
.btn-danger { background: var(--bad); color: #fff; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background .14s, color .14s;
}
.icon-btn:hover { background: #f1f5f9; color: var(--ink); }
.icon-btn.danger:hover { background: #fff1f2; color: var(--bad); }

.inline { display: inline; }

.flash {
    padding: 11px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    border: 1px solid transparent;
}
.flash-ok { background: #ecfdf5; border-color: #a7f3d0; color: #046c4e; }
.flash-error { background: #fff1f2; border-color: #fecdd3; color: #b91c1c; }
.flash-warn { background: #fffbeb; border-color: #fde68a; color: #b45309; }

.alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 13px;
    border-radius: 10px;
    font-size: 13px;
}
.alert-error { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }

/* ---------------- 仪表盘 ---------------- */

.continue {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    border-radius: var(--radius);
    color: #fff;
    background:
        radial-gradient(500px 220px at 92% -30%, rgba(255, 255, 255, .28), transparent 70%),
        linear-gradient(120deg, #4338ca 0%, #6d28d9 55%, #7c3aed 100%);
    box-shadow: 0 20px 40px -26px rgba(67, 56, 202, .85);
}
.continue-main { min-width: 0; }
.continue-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    margin-bottom: 7px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .18);
    font-size: 11.5px;
    letter-spacing: .04em;
}
.continue h2 { font-size: 19px; }
.continue p { margin-top: 3px; font-size: 12.5px; color: rgba(255, 255, 255, .78); }
.continue .btn { margin-left: auto; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.stat {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 17px 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.stat-ico {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: var(--c);
    background: color-mix(in srgb, var(--c) 11%, #fff);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 16%, transparent);
}
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: 12.5px; color: var(--muted); }
.stat-body strong { font-size: 26px; line-height: 1.15; letter-spacing: -.02em; }
.stat-body em { font-style: normal; font-size: 11.5px; color: #8b9ab1; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-aside { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }

.donut-wrap { display: flex; align-items: center; gap: 26px; padding: 22px 24px; }
.donut {
    position: relative;
    display: grid;
    place-items: center;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    flex: none;
}
.donut-hole {
    display: grid;
    place-items: center;
    width: 116px;
    height: 116px;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--line-2);
}
.donut-hole strong { font-size: 26px; letter-spacing: -.02em; }
.donut-hole span { font-size: 11.5px; color: var(--muted); margin-top: -4px; }

.legend { display: flex; flex-direction: column; gap: 9px; flex: 1; }
.legend li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-3); }
.legend li strong { margin-left: auto; color: var(--ink); }
.dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.dot.st-todo { background: #cbd5e1; }
.dot.st-learning { background: var(--brand); }
.dot.st-done { background: var(--ok); }

.bars { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px; }
.bar-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.bar-top em { font-style: normal; font-size: 12px; color: var(--muted); }
.bar { height: 7px; border-radius: 99px; background: #eef2f8; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; }

.subj { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.subj i { width: 7px; height: 7px; border-radius: 2px; flex: none; }

/* ---------------- 表格 ---------------- */

.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table thead th {
    padding: 11px 16px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #8494ad;
    background: #fbfcfe;
    border-bottom: 1px solid var(--line-2);
    white-space: nowrap;
}
.table tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--line-2);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #fafbff; }
.t-right { text-align: right; }
.cell-main { min-width: 230px; }
.row-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 13.8px;
    color: var(--ink);
    line-height: 1.45;
}
.row-title:hover { color: var(--brand); }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; margin-top: 4px; font-size: 11.5px; color: #94a3b8; }
.meta-link { display: inline-flex; align-items: center; gap: 3px; color: #0f766e; }
.tag {
    padding: 1px 7px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 11px;
    line-height: 1.6;
}
.fav-dot { color: #f59e0b; display: inline-flex; }
.empty-row { padding: 40px 16px !important; text-align: center; color: var(--muted); font-size: 13px; }
.actions { white-space: nowrap; }
.actions form { display: inline; }
.actions .icon-btn { width: 30px; height: 30px; }

/* ---------------- 徽标 ---------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.st-todo { background: #f1f5f9; color: #52627a; }
.st-learning { background: #eef2ff; color: #4338ca; }
.st-done { background: #ecfdf5; color: #047857; }

.type-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 550;
    color: var(--tc);
    background: color-mix(in srgb, var(--tc) 9%, #fff);
    white-space: nowrap;
}

/* ---------------- 筛选 ---------------- */

.filter-card { padding: 13px 16px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.filter-search {
    position: relative;
    flex: 1 1 210px;
    min-width: 180px;
}
.filter-search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.filter-search input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 34px;
    border: 1px solid var(--line);
    border-radius: 9px;
    outline: none;
    background: #fff;
}
.filter-search input:focus { border-color: #c7cdf9; box-shadow: 0 0 0 3px rgba(99, 102, 241, .1); }
.filters select {
    height: 36px;
    padding: 0 30px 0 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
    color: var(--ink-2);
    outline: none;
    appearance: none;
    cursor: pointer;
}
.filters select:focus { border-color: #c7cdf9; box-shadow: 0 0 0 3px rgba(99, 102, 241, .1); }
.chip-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--ink-3);
    font-size: 12.5px;
    cursor: pointer;
}
.chip-toggle:hover { border-color: #d8dfec; }
.chip-toggle.is-on { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.filter-submit { display: none; }

/* ---------------- 分页 ---------------- */

.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 18px;
    border-top: 1px solid var(--line-2);
}
.pager-info { font-size: 12px; color: var(--muted); }
.pager-links { display: flex; gap: 5px; }
.page-btn {
    display: inline-grid;
    place-items: center;
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink-3);
    font-size: 12.5px;
}
.page-btn:hover { border-color: #cdd6e6; }
.page-btn.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------------- 表单 ---------------- */

.form-body { display: flex; flex-direction: column; gap: 15px; padding: 20px 22px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.field > span b { color: var(--bad); }
.field small { font-size: 11.5px; color: #94a3b8; }
.field input[type="text"],
.field input[type="url"],
.field input[type="password"],
.field input[type="search"],
.field select,
.field textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--ink);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.field select {
    height: 38px;
    padding: 0 30px 0 11px;
    appearance: none;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center;
    cursor: pointer;
}
.field textarea { resize: vertical; min-height: 110px; line-height: 1.65; }
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: #bfc6f7;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .1);
}
.field-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }

.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.form-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.form-side { display: flex; flex-direction: column; gap: 18px; }
.sticky { position: sticky; top: 84px; }
.sep { height: 1px; border: 0; background: var(--line-2); margin: 4px 0; width: 100%; }
.side-note { font-size: 12px; color: var(--muted); line-height: 1.7; }
.tip-card { background: linear-gradient(160deg, #fbfbff, #f5f7ff); border-color: #e9e9fb; }
.tip-card h4 { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #4338ca; margin-bottom: 6px; }
.tip-card p { font-size: 12.5px; color: #5b6b85; line-height: 1.7; }

.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 26px 18px;
    border: 1.5px dashed #d5dcea;
    border-radius: 12px;
    background: #fbfcff;
    text-align: center;
    cursor: pointer;
    transition: border-color .16s, background .16s;
}
.dropzone:hover, .dropzone.is-drag { border-color: #a5b4fc; background: #f5f6ff; }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-ico { color: #818cf8; }
.dropzone strong { font-size: 13px; color: var(--ink-2); }
.dropzone small { font-size: 11.5px; color: #94a3b8; }
.dropzone em { font-style: normal; font-size: 12px; color: var(--brand); margin-top: 4px; }

.current-file {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 9px;
    background: #f8fafc;
    border: 1px solid var(--line-2);
    font-size: 12.5px;
    color: var(--ink-3);
}
.current-file .check-inline { margin-left: auto; font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }

.input-inline { display: flex; gap: 8px; }

/* ---------------- 详情 ---------------- */

.detail-head { display: flex; align-items: center; gap: 10px; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.back:hover { color: var(--brand); }
.detail-actions { margin-left: auto; display: flex; gap: 8px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.detail-main, .detail-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.detail-hero { padding: 24px; }
.hero-ico {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    margin-bottom: 13px;
    color: var(--tc);
    background: color-mix(in srgb, var(--tc) 10%, #fff);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 15%, transparent);
}
.detail-hero h2 { font-size: 22px; line-height: 1.4; }
.hero-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 11px; }

.prose { padding: 20px 24px; color: var(--ink-2); font-size: 13.8px; line-height: 1.85; }

.attach-area { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
.attach {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 15px;
    border: 1px solid var(--line-2);
    border-radius: 12px;
    background: #fbfcff;
}
.attach-ico {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    color: var(--brand);
    background: #eef2ff;
    flex: none;
}
.attach-ico.link { color: #0f766e; background: #ecfdf5; }
.attach-info { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.attach-info strong { font-size: 13.5px; }
.attach-info em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.attach .btn { margin-left: auto; }
.pad { padding: 0; }

.meta-list { display: flex; flex-direction: column; padding: 6px 20px 14px; }
.meta-list > div { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line-2); }
.meta-list > div:last-child { border-bottom: 0; }
.meta-list dt { font-size: 12.5px; color: var(--muted); flex: none; }
.meta-list dd { margin-left: auto; font-size: 12.8px; color: var(--ink-2); text-align: right; min-width: 0; }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; padding: 8px 22px 18px; }
.meta-grid > div { display: flex; }

.related { display: flex; flex-direction: column; padding: 6px 0 10px; }
.related li { display: flex; flex-direction: column; gap: 3px; padding: 10px 20px; border-bottom: 1px solid var(--line-2); }
.related li:last-child { border-bottom: 0; }
.related a { font-size: 13px; font-weight: 550; }
.related a:hover { color: var(--brand); }
.related em { font-style: normal; display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }

/* ---------------- 科目 ---------------- */

.subject-list { display: flex; flex-direction: column; }
.subject-row {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--line-2);
}
.subject-row:last-child { border-bottom: 0; }
.subject-badge {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    flex: none;
}
.subject-body { flex: 1; min-width: 0; }
.subject-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.subject-top strong { font-size: 13.8px; }
.subject-count { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.subject-sub { margin-top: 6px; font-size: 11.5px; color: #94a3b8; }
.subject-actions { display: flex; gap: 2px; }
.uncat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 20px;
    border-top: 1px solid var(--line-2);
    background: #fbfcfe;
    font-size: 12.5px;
    color: var(--muted);
}
.uncat a { margin-left: auto; color: var(--brand); font-weight: 500; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch i {
    display: block;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--sw);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
    transition: transform .12s, box-shadow .12s;
}
.swatch:hover i { transform: scale(1.06); }
.swatch input:checked + i { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--sw); }

/* ---------------- 登录页 ---------------- */

.auth-body { background: #0b1120; }
.auth-shell { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }

.auth-hero {
    display: flex;
    flex-direction: column;
    padding: 44px 52px;
    color: #e2e8f0;
    background:
        radial-gradient(680px 380px at 12% 0%, rgba(124, 58, 237, .5), transparent 62%),
        radial-gradient(520px 420px at 100% 100%, rgba(14, 165, 233, .32), transparent 60%),
        linear-gradient(160deg, #0b1120 0%, #131c33 100%);
    position: relative;
    overflow: hidden;
}
.auth-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(70% 70% at 40% 40%, #000 40%, transparent 100%);
    pointer-events: none;
}
.auth-brand { display: flex; align-items: center; gap: 11px; position: relative; z-index: 1; }
.auth-brand .brand-text strong { color: #fff; font-size: 16px; }
.auth-brand .brand-text em { color: #93a4c1; }

.auth-copy { margin: auto 0; position: relative; z-index: 1; max-width: 460px; }
.auth-copy h1 { font-size: 34px; line-height: 1.35; letter-spacing: -.02em; color: #fff; }
.auth-copy > p { margin-top: 14px; font-size: 14px; color: #a9b7cf; line-height: 1.8; }
.auth-points { display: flex; flex-direction: column; gap: 11px; margin-top: 26px; }
.auth-points li { display: flex; align-items: center; gap: 10px; font-size: 13.2px; color: #cbd5e1; }
.auth-points .ico { color: #a5b4fc; }

.auth-foot {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    color: #6b7a99;
    position: relative;
    z-index: 1;
}

.auth-panel { display: grid; place-items: center; padding: 40px; background: #f6f8fc; }
.auth-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: min(400px, 100%);
    padding: 34px 32px;
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--line);
}
.auth-card h2 { font-size: 21px; }
.auth-sub { font-size: 12.8px; color: var(--muted); margin-top: -9px; }
.auth-card .field { gap: 5px; }
.auth-card .btn-block { margin-top: 4px; height: 42px; }
.demo-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f5f7ff;
    border: 1px dashed #c7d2fe;
    font-size: 12px;
    color: #4c5a75;
}
.demo-tip strong { color: #4338ca; font-size: 11.5px; letter-spacing: .04em; }
.demo-tip span { margin-left: auto; font-family: ui-monospace, Menlo, Consolas, monospace; color: #1e293b; }

/* ---------------- 空状态 / 404 ---------------- */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 80px 20px;
    text-align: center;
}
.empty-state h2 { font-size: 48px; color: #cbd5e1; letter-spacing: -.04em; }
.empty-state p { color: var(--muted); font-size: 13.5px; }
.empty-state .btn { margin-top: 8px; }

.scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 35;
    backdrop-filter: blur(2px);
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 1180px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-aside { grid-template-columns: minmax(0, 1fr); }
    .form-layout { grid-template-columns: minmax(0, 1fr); }
    .sticky { position: static; }
    .detail-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 960px) {
    .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .top-new span { display: none; }
    .top-new { padding: 0 12px; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
}

@media (max-width: 820px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: 252px;
        transform: translateX(-104%);
        transition: transform .22s ease;
        box-shadow: 30px 0 60px -40px rgba(2, 6, 23, .8);
    }
    .sidebar.is-open { transform: translateX(0); }
    .scrim.is-on { display: block; }
    .burger { display: grid; }
    .topbar { padding: 12px 16px; }
    .search { display: none; }
    .content { padding: 16px 16px 40px; gap: 14px; }
    .page-head h1 { font-size: 17px; }
    .page-head p { display: none; }
    .stat-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
    .stat { padding: 13px; gap: 10px; }
    .stat-body strong { font-size: 22px; }
    .stat-ico { width: 36px; height: 36px; border-radius: 10px; }
    .donut-wrap { flex-direction: column; gap: 18px; }
    .field-row { grid-template-columns: minmax(0, 1fr); }
    .continue { flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; }
    .continue .btn { margin-left: 0; }
    .detail-actions { flex-wrap: wrap; }
    .detail-head { flex-wrap: wrap; }
    .pager { flex-direction: column; align-items: flex-start; }
    .auth-panel { padding: 22px; }
    .auth-card { padding: 26px 22px; }
    .auth-copy h1 { font-size: 27px; }
}

@media (max-width: 560px) {
    .stat-grid { grid-template-columns: minmax(0, 1fr); }
    .filters { flex-direction: column; align-items: stretch; }
    .filters select, .chip-toggle { width: 100%; }
    .filter-submit { display: inline-flex; }
    .table thead { display: none; }
    .table tbody td { display: block; padding: 6px 16px; border: 0; }
    .table tbody tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
    .table tbody td.t-right { text-align: left; }
    .table tbody td:not(.cell-main):not(.t-right) { display: inline-block; }
    .meta-grid { grid-template-columns: 1fr; }
    .detail-hero h2 { font-size: 18px; }
}
