/* ==========================================================
   云松学堂 · 后台控制台样式 console.css
   依赖 theme.css 的主题变量（五套皮肤 + 字号缩放自动生效）
   ========================================================== */

/* ---------- 布局骨架 ---------- */
.app {
    display: grid;
    grid-template-columns: 268px 1fr;
    min-height: 100vh;
    background: var(--bg);
}

/* ---------- 侧栏 ---------- */
.side {
    background: var(--grad);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}
.side::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .14;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 20% 18%, #fff 0 2px, transparent 3px),
        radial-gradient(circle at 76% 54%, #fff 0 3px, transparent 4px),
        radial-gradient(circle at 40% 86%, #fff 0 2px, transparent 3px);
    background-size: 200px 200px, 300px 300px, 240px 240px;
}
.side-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 1.4rem 1.3rem 1.1rem;
    position: relative;
    z-index: 2;
    flex: none;
}
.side-brand .mark {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .34);
    flex: none;
}
.side-brand b { font-size: 1.28rem; font-weight: 800; letter-spacing: .03em; line-height: 1.3; }
.side-brand small { display: block; font-size: .78rem; opacity: .8; font-weight: 500; }

.side-menu {
    flex: 1;
    overflow-y: auto;
    padding: .4rem .8rem 1.2rem;
    position: relative;
    z-index: 2;
}
.side-menu::-webkit-scrollbar { width: 6px; }
.side-menu::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .3); border-radius: 3px; }

.menu-group {
    font-size: .76rem;
    letter-spacing: .14em;
    opacity: .62;
    padding: .9rem .7rem .35rem;
    font-weight: 700;
}
.menu-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .72rem .85rem;
    border-radius: 12px;
    color: rgba(255, 255, 255, .93);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
    border: 1px solid transparent;
    user-select: none;
}
.menu-item span.ico { font-size: 1.15rem; width: 1.5rem; text-align: center; flex: none; }
.menu-item:hover { background: rgba(255, 255, 255, .16); }
.menu-item.on {
    background: rgba(255, 255, 255, .24);
    border-color: rgba(255, 255, 255, .4);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
}
.menu-item .badge {
    margin-left: auto;
    background: var(--accent);
    color: #2a2200;
    border-radius: 999px;
    font-size: .74rem;
    padding: .05em .55em;
    font-weight: 800;
}

.side-foot {
    flex: none;
    padding: .9rem 1.1rem 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, .18);
    position: relative;
    z-index: 2;
}
.side-user { display: flex; align-items: center; gap: .65rem; }
.side-user .avatar {
    width: 2.4rem; height: 2.4rem; border-radius: 50%;
    display: grid; place-items: center; font-weight: 800; font-size: 1rem;
    background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .34);
    flex: none;
}
.side-user b { font-size: .98rem; display: block; line-height: 1.35; }
.side-user small { opacity: .78; font-size: .8rem; }
.side-user > div { min-width: 0; flex: 1; }
.side-user b, .side-user small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-logout {
    margin-top: .75rem; width: 100%;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .3);
    color: #fff; border-radius: 10px; padding: .5em 0;
    font-size: .92rem; font-weight: 600; cursor: pointer; font-family: inherit;
}
.side-logout:hover { background: rgba(255, 255, 255, .28); }

/* ---------- 主区 ---------- */
.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg);
}
.head {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: .95rem 1.8rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: var(--shadow-sm);
}
.head h1 { font-size: 1.42rem; font-weight: 800; color: var(--primary); letter-spacing: .02em; }
.head .sub { color: var(--text-muted); font-size: .9rem; }
.head-right { margin-left: auto; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.head-chip {
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: .3em .95em;
    font-size: .88rem;
    font-weight: 700;
    white-space: nowrap;
}
.head-chip.gold { background: var(--accent-soft); color: var(--accent); }

.menu-toggle {
    display: none;
    background: var(--primary-soft);
    border: 1px solid var(--border-strong);
    color: var(--primary);
    border-radius: 10px;
    font-size: 1.2rem;
    padding: .25em .6em;
    cursor: pointer;
}

.body { padding: 1.6rem 1.8rem 3.5rem; flex: 1; min-width: 0; }

/* ---------- 统计卡 ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1.1rem;
    margin-bottom: 1.5rem;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.3rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform .25s ease, box-shadow .25s ease;
}
.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.stat .ico {
    width: 3rem; height: 3rem; border-radius: 16px; display: grid; place-items: center;
    font-size: 1.5rem; background: var(--grad-soft); border: 1px solid var(--border-strong); flex: none;
}
.stat .val { font-size: 1.75rem; font-weight: 800; color: var(--primary); line-height: 1.2; }
.stat .lbl { color: var(--text-muted); font-size: .92rem; }

/* ---------- 面板 ---------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.4rem;
    overflow: hidden;
}
.panel-head {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: 1rem 1.3rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-soft);
}
.panel-head h3 { font-size: 1.1rem; font-weight: 800; color: var(--primary); }
.panel-head .sp { margin-left: auto; display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; }
.panel-body { padding: 1.2rem 1.3rem; }
.panel-body.tight { padding: .4rem 0; }

.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.3rem; }

/* ---------- 工具条 ---------- */
.toolbar {
    display: flex;
    gap: .6rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.1rem;
}
.toolbar .sp { margin-left: auto; }

.inp, .sel, .ta {
    font-family: inherit;
    font-size: .98rem;
    color: var(--text);
    background: var(--surface);
    border: 2px solid var(--border-strong);
    border-radius: 10px;
    padding: .5em .85em;
    outline: none;
    min-width: 0;
}
.inp:focus, .sel:focus, .ta:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.ta { resize: vertical; min-height: 5.5rem; line-height: 1.7; }
.sel { cursor: pointer; }

.btn-sm {
    padding: .5em 1.1em;
    font-size: .95rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    background: var(--grad);
    color: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, filter .18s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: .35em;
}
.btn-sm:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn-sm.ghost {
    background: var(--surface);
    color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: none;
}
.btn-sm.ghost:hover { background: var(--primary-soft); }
.btn-sm.soft {
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid var(--border-strong);
    box-shadow: none;
}
.btn-sm.danger { background: linear-gradient(135deg, #C62828, #8E1414); }
.btn-sm:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .97rem; }
table.tbl th {
    text-align: left;
    padding: .8rem .8rem;
    background: var(--surface-2);
    color: var(--primary);
    font-weight: 800;
    white-space: nowrap;
    border-bottom: 2px solid var(--border-strong);
    font-size: .92rem;
}
table.tbl td {
    padding: .75rem .8rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
table.tbl tbody tr:hover { background: var(--bg-soft); }
table.tbl td.num { font-variant-numeric: tabular-nums; font-weight: 700; }
table.tbl .row-act { display: flex; gap: .35rem; flex-wrap: wrap; }
.act {
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--primary);
    border-radius: 8px;
    padding: .28em .7em;
    font-size: .86rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}
.act:hover { background: var(--primary-soft); }
.act.d { color: #C62828; border-color: #E8B4B4; }
.act.d:hover { background: #FBEAE8; }

.empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-size: 1rem;
}
.empty .big { font-size: 2.6rem; display: block; margin-bottom: .6rem; }

/* ---------- 状态徽章 ---------- */
.st {
    display: inline-block;
    padding: .16em .7em;
    border-radius: 999px;
    font-size: .84rem;
    font-weight: 700;
    white-space: nowrap;
}
.st-ok { background: var(--primary-soft); color: var(--primary); }
.st-warn { background: var(--accent-soft); color: #8A6A00; }
.st-info { background: #E3F0FB; color: #01579B; }
.st-off { background: var(--surface-2); color: var(--text-muted); }
.st-danger { background: #FBEAE8; color: #B71C1C; }
[data-theme="night"] .st-info { background: #16324A; color: #7FC4F5; }
[data-theme="night"] .st-danger { background: #3A1A18; color: #FF9B93; }
[data-theme="night"] .st-warn { background: #3A331A; color: #FFD982; }

/* ---------- 分页 ---------- */
.pager {
    display: flex;
    align-items: center;
    gap: .6rem;
    justify-content: flex-end;
    padding: .9rem 1.3rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.pager .info { color: var(--text-muted); font-size: .9rem; margin-right: auto; }
.pager button {
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    border-radius: 8px;
    padding: .35em .85em;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
}
.pager button:hover:not(:disabled) { background: var(--primary-soft); color: var(--primary); }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.pager button.cur { background: var(--grad); color: #fff; border-color: transparent; }

/* ---------- 弹窗 ---------- */
.mask {
    position: fixed;
    inset: 0;
    background: rgba(16, 22, 32, .52);
    backdrop-filter: blur(3px);
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 1.2rem;
    overflow-y: auto;
}
.modal {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: min(640px, 96vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    animation: pop .22s ease;
}
.modal.wide { width: min(920px, 96vw); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head {
    display: flex;
    align-items: center;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-soft);
    border-radius: var(--radius) var(--radius) 0 0;
}
.modal-head h3 { font-size: 1.16rem; font-weight: 800; color: var(--primary); }
.modal-head .x {
    margin-left: auto;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 .3rem;
}
.modal-head .x:hover { color: #C62828; }
.modal-body { padding: 1.3rem 1.4rem; overflow-y: auto; }
.modal-foot {
    display: flex;
    gap: .7rem;
    justify-content: flex-end;
    padding: 1rem 1.4rem;
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.2rem; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .93rem; font-weight: 700; color: var(--text); }
.field label .req { color: #C62828; margin-left: .2em; }
.field .hint { font-size: .84rem; color: var(--text-muted); }

/* ---------- 提示条 ---------- */
.toast-wrap {
    position: fixed;
    top: 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    align-items: center;
    pointer-events: none;
}
.toast {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-left: 5px solid var(--primary);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: .8rem 1.3rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    animation: slideDown .25s ease;
    max-width: min(560px, 92vw);
}
.toast.err { border-left-color: #C62828; }
.toast.warn { border-left-color: var(--accent); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

/* ---------- 图表（纯 SVG，无外部依赖） ---------- */
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem; }
.bars { display: flex; flex-direction: column; gap: .8rem; }
.bar-item { display: flex; align-items: center; gap: .8rem; font-size: .95rem; }
.bar-item .nm { width: 6.5rem; flex: none; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 1.15rem; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bar-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--grad);
    transition: width .6s cubic-bezier(.22, .68, .32, 1);
    min-width: 4px;
}
.bar-item .vl { width: 3.4rem; text-align: right; font-weight: 800; color: var(--primary); flex: none; }

.donut-wrap { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.donut { flex: none; }
.legend { display: flex; flex-direction: column; gap: .5rem; font-size: .94rem; }
.legend div { display: flex; align-items: center; gap: .5rem; }
.legend i { width: .85rem; height: .85rem; border-radius: 3px; display: inline-block; flex: none; }

.trend { display: flex; align-items: flex-end; gap: .7rem; height: 12rem; padding-top: .5rem; }
.trend .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .45rem; height: 100%; justify-content: flex-end; min-width: 0; }
.trend .col .b {
    width: 100%;
    max-width: 3.4rem;
    background: var(--grad);
    border-radius: 10px 10px 0 0;
    transition: height .6s cubic-bezier(.22, .68, .32, 1);
    min-height: 5px;
    position: relative;
}
.trend .col .b span {
    position: absolute; top: -1.5rem; left: 50%; transform: translateX(-50%);
    font-size: .82rem; font-weight: 800; color: var(--primary); white-space: nowrap;
}
.trend .col small { color: var(--text-muted); font-size: .8rem; white-space: nowrap; }

/* ---------- 课程卡片（选课 / 我的课程） ---------- */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 1.2rem; }
.ccard {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: transform .28s ease, box-shadow .28s ease;
}
.ccard:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.ccard .cv {
    height: 7.2rem;
    display: grid;
    place-items: center;
    font-size: 2.6rem;
    color: #fff;
    background: var(--grad);
}
.ccard .bd { padding: 1rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.ccard .bd h4 { font-size: 1.14rem; color: var(--text); }
.ccard .bd p { color: var(--text-muted); font-size: .93rem; flex: 1; line-height: 1.7; }
.ccard .ft { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding-top: .7rem; border-top: 1px dashed var(--border); }

/* ---------- 课表 ---------- */
.tt-wrap { overflow-x: auto; }
table.tt { width: 100%; border-collapse: separate; border-spacing: .4rem; min-width: 780px; }
table.tt th {
    background: var(--surface-2);
    color: var(--primary);
    font-size: .92rem;
    font-weight: 800;
    padding: .55rem .4rem;
    border-radius: 10px;
    text-align: center;
}
table.tt td {
    background: var(--bg-soft);
    border: 1px dashed var(--border-strong);
    border-radius: 12px;
    padding: .45rem;
    vertical-align: top;
    height: 5.4rem;
    min-width: 6.4rem;
}
.lesson {
    background: var(--surface);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: .38rem .5rem;
    font-size: .84rem;
    line-height: 1.5;
    box-shadow: var(--shadow-sm);
    margin-bottom: .3rem;
}
.lesson b { display: block; color: var(--primary); font-size: .88rem; }
.lesson small { color: var(--text-muted); }

/* ---------- AI 助手 ---------- */
.ai-page { display: grid; grid-template-columns: 1fr 300px; gap: 1.3rem; align-items: start; }
.chat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 12rem);
    min-height: 26rem;
    overflow: hidden;
}
.chat-log { flex: 1; overflow-y: auto; padding: 1.2rem; display: flex; flex-direction: column; gap: .9rem; background: var(--bg-soft); }
.msg { max-width: 80%; padding: .85rem 1.1rem; border-radius: 18px; font-size: 1.01rem; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.msg.u { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 6px; }
.msg.a { align-self: flex-start; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.msg .meta { display: block; font-size: .76rem; opacity: .68; margin-top: .45rem; }
.chat-in { display: flex; gap: .6rem; padding: .9rem 1rem; border-top: 1px solid var(--border); background: var(--surface); }
.chat-in input {
    flex: 1;
    font-family: inherit;
    font-size: 1.02rem;
    padding: .7em 1em;
    border: 2px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    outline: none;
}
.chat-in input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips button {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text);
    border-radius: 999px;
    padding: .38em .95em;
    font-size: .9rem;
    cursor: pointer;
    font-family: inherit;
}
.chips button:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }

.typing i {
    display: inline-block;
    width: .45rem; height: .45rem;
    margin: 0 .12rem;
    border-radius: 50%;
    background: var(--primary);
    opacity: .35;
    animation: blink 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* ---------- 加载 ---------- */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-size: 1rem;
}
.spin {
    width: 1.4rem; height: 1.4rem;
    border: 3px solid var(--border-strong);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: sp .8s linear infinite;
}
@keyframes sp { to { transform: rotate(360deg); } }

/* ---------- 登录页 ---------- */
.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    background: var(--bg);
}
.login-art {
    background: var(--grad);
    color: #fff;
    padding: 3.4rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.login-art::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .18;
    background-image:
        radial-gradient(circle at 16% 24%, #fff 0 2px, transparent 3px),
        radial-gradient(circle at 74% 58%, #fff 0 3px, transparent 4px),
        radial-gradient(circle at 42% 88%, #fff 0 2px, transparent 3px);
    background-size: 220px 220px, 330px 330px, 260px 260px;
}
.login-art .inner { position: relative; z-index: 2; max-width: 30rem; }
.login-art .mark {
    width: 4.2rem; height: 4.2rem; border-radius: 22px; display: grid; place-items: center;
    font-size: 2.1rem; background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .34); margin-bottom: 1.3rem;
}
.login-art h1 { font-size: 2.7rem; font-weight: 900; letter-spacing: .03em; margin-bottom: .8rem; line-height: 1.3; }
.login-art .lead { font-size: 1.12rem; color: rgba(255, 255, 255, .93); margin-bottom: 2rem; }
.login-art ul { list-style: none; display: grid; gap: .7rem; }
.login-art li {
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 12px;
    padding: .7rem 1rem;
    font-size: 1rem;
    display: flex;
    gap: .6rem;
    align-items: center;
}
.login-side {
    display: grid;
    place-items: center;
    padding: 2.4rem 1.6rem;
}
.login-card {
    width: min(420px, 94vw);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 26px;
    box-shadow: var(--shadow-lg);
    padding: 2.3rem 2.1rem 1.9rem;
}
.login-card h2 { font-size: 1.7rem; font-weight: 800; color: var(--primary); margin-bottom: .4rem; }
.login-card .sub { color: var(--text-muted); font-size: .98rem; margin-bottom: 1.6rem; }
.login-card .field { margin-bottom: 1.05rem; }
.login-card .inp { font-size: 1.08rem; padding: .72em 1em; }
.login-btn {
    width: 100%;
    padding: .85em 0;
    font-size: 1.14rem;
    font-weight: 800;
    border: none;
    border-radius: 999px;
    background: var(--grad);
    color: #fff;
    cursor: pointer;
    box-shadow: var(--shadow);
    font-family: inherit;
    letter-spacing: .04em;
    transition: transform .2s ease, filter .2s ease;
}
.login-btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.login-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.login-err {
    background: #FBEAE8;
    color: #B71C1C;
    border: 1px solid #E8B4B4;
    border-radius: 10px;
    padding: .6rem .9rem;
    font-size: .95rem;
    margin-bottom: 1rem;
}
[data-theme="night"] .login-err { background: #3A1A18; color: #FF9B93; border-color: #5C2A26; }
.demo-box {
    margin-top: 1.4rem;
    padding-top: 1.3rem;
    border-top: 1px dashed var(--border-strong);
}
.demo-box h4 { font-size: .95rem; color: var(--text-muted); margin-bottom: .6rem; font-weight: 700; }
.demo-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.demo-row button {
    flex: 1;
    min-width: 8rem;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: .5em .6em;
    cursor: pointer;
    font-family: inherit;
    font-size: .9rem;
    color: var(--text);
    text-align: left;
    line-height: 1.5;
}
.demo-row button:hover { background: var(--primary-soft); border-color: var(--primary); }
.demo-row button b { display: block; color: var(--primary); font-size: .95rem; }
.demo-row button small { color: var(--text-muted); font-size: .82rem; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
    .cols-2, .cols-3, .chart-row, .ai-page { grid-template-columns: 1fr; }
    .login-page { grid-template-columns: 1fr; }
    .login-art { padding: 2.4rem 1.8rem; }
    .login-art h1 { font-size: 2rem; }
}
@media (max-width: 860px) {
    .app { grid-template-columns: 1fr; }
    .side {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        width: 272px;
        z-index: 120;
        transform: translateX(-100%);
        transition: transform .28s ease;
        box-shadow: var(--shadow-lg);
    }
    .side.open { transform: none; }
    .menu-toggle { display: block; }
    .body { padding: 1.1rem 1rem 3rem; }
    .head { padding: .8rem 1rem; }
    .head h1 { font-size: 1.16rem; }
    .form-grid { grid-template-columns: 1fr; }
    .scrim {
        position: fixed; inset: 0; background: rgba(16, 22, 32, .45); z-index: 110;
    }
}
@media (max-width: 560px) {
    .stat-grid { grid-template-columns: 1fr 1fr; gap: .8rem; }
    .stat { padding: .9rem; gap: .7rem; }
    .stat .val { font-size: 1.4rem; }
    .msg { max-width: 92%; }
}
