/* ==========================================================================
   后台管理样式（依赖 app.css 的设计变量）
   ========================================================================== */

body.admin { background: #f4f5fa; }
body.blank-page { background: #eef1f8; }

.admin-layout { display: flex; min-height: 100vh; }

/* ---------------- 侧边栏 ---------------- */
.admin-sidebar {
    width: 232px; flex: none; color: #c7cee0;
    background: linear-gradient(180deg, #1b1f3b 0%, #141728 100%);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
    box-shadow: 1px 0 0 rgba(255,255,255,.04);
}
.admin-sidebar .sidebar-brand {
    display: flex; align-items: center; gap: 11px; padding: 19px 20px; color: #fff;
    font-weight: 700; font-size: 15.5px; border-bottom: 1px solid rgba(255,255,255,.07);
}
.admin-sidebar .sidebar-brand .logo {
    width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 13px; font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; box-shadow: 0 6px 16px rgba(99,102,241,.4);
}
.admin-sidebar .sidebar-brand small { display: block; font-size: 11px; font-weight: 400; color: #8189a8; }
.nav-group { padding: 12px 10px; overflow-y: auto; flex: 1; }
.nav-group .nav-label { font-size: 11px; color: #616a8c; padding: 12px 12px 6px; letter-spacing: .08em; }
.nav-group a {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
    color: #c7cee0; font-size: 14.2px; margin-bottom: 2px; transition: all .15s ease;
}
.nav-group a:hover { background: rgba(255,255,255,.07); color: #fff; transform: translateX(2px); }
.nav-group a.active { background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; font-weight: 600; box-shadow: 0 8px 20px rgba(79,70,229,.35); }
.nav-group a .ico { width: 18px; text-align: center; font-size: 15px; opacity: .95; }
.admin-sidebar .sidebar-footer { padding: 15px 18px; border-top: 1px solid rgba(255,255,255,.07); font-size: 12px; color: #616a8c; }

/* ---------------- 主区域 ---------------- */
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
    height: 62px; background: rgba(255,255,255,.9); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; padding: 0 22px; gap: 14px;
    position: sticky; top: 0; z-index: 20;
}
.admin-topbar .page-heading { font-weight: 700; font-size: 16px; }
.admin-topbar .right { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--text-light); }
.admin-topbar .right > a { padding: 6px 12px; border-radius: 999px; background: #f2f4fb; font-weight: 600; color: #374151; }
.admin-topbar .right > a:hover { background: var(--primary-light); color: var(--primary-dark); }
.admin-content { padding: 22px; flex: 1; }
.sidebar-toggle { display: none; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text); }

/* ---------------- 统计卡片 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
    position: relative; overflow: hidden; background: #fff; border-radius: 15px; padding: 18px 20px;
    box-shadow: var(--shadow); border: 1px solid rgba(230,232,240,.85);
    transition: transform .18s ease, box-shadow .18s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--gradient); opacity: .85; }
.stat-card .label { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; justify-content: space-between; }
.stat-card .value { font-size: 27px; font-weight: 800; margin-top: 6px; letter-spacing: -.03em; }
.stat-card .sub { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.stat-card.primary .value { color: var(--primary); }
.stat-card.success .value { color: var(--success); }
.stat-card.warning .value { color: var(--warning); }
.stat-card.danger .value { color: var(--danger); }
.stat-card.success::after { background: linear-gradient(180deg, #34d399, #059669); }
.stat-card.warning::after { background: linear-gradient(180deg, #fbbf24, #f59e0b); }
.stat-card.danger::after { background: linear-gradient(180deg, #f87171, #ef4444); }

/* ---------------- 面板 ---------------- */
.panel { background: #fff; border-radius: 15px; border: 1px solid rgba(230,232,240,.85); box-shadow: var(--shadow); }
.panel + .panel { margin-top: 18px; }
.panel-head { padding: 15px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { font-size: 15.5px; margin: 0; }
.panel-body { padding: 20px; }
.panel-body.p-0 { padding: 0; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.table th, table.table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #f1f2f7; vertical-align: middle; }
table.table th { background: #fafbfe; font-weight: 600; color: #4b5563; font-size: 13.2px; white-space: nowrap; }
table.table tbody tr { transition: background .14s ease; }
table.table tbody tr:hover { background: #fafbff; }
table.table tbody tr:last-child td { border-bottom: none; }
table.table td.nowrap { white-space: nowrap; }
table.table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

/* ---------------- 工具条 ---------------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filter-bar .form-group { margin-bottom: 0; min-width: 150px; }
.filter-bar .form-control { padding: 9px 12px; font-size: 14px; }

/* ---------------- 标签页 ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; flex-wrap: wrap; }
.tabs a { padding: 10px 16px; font-size: 14.5px; color: var(--text-light); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .15s ease; }
.tabs a:hover { color: var(--primary); }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ==========================================================================
   登录页（独立全屏，左右分栏）
   ========================================================================== */
.login-page {
    min-height: 100vh; display: grid; place-items: center; padding: 24px;
    background:
        radial-gradient(720px 420px at 12% 8%, rgba(99,102,241,.28), transparent 62%),
        radial-gradient(680px 400px at 88% 92%, rgba(168,85,247,.24), transparent 62%),
        #eef1f8;
}
.login-shell {
    width: 100%; max-width: 960px; display: grid; grid-template-columns: 1.05fr 1fr;
    background: #fff; border-radius: 26px; overflow: hidden;
    box-shadow: 0 30px 80px rgba(20, 24, 60, .22); border: 1px solid rgba(255,255,255,.7);
}
.login-aside {
    position: relative; overflow: hidden; color: #fff; padding: 46px 42px;
    display: flex; flex-direction: column; justify-content: space-between;
    background: linear-gradient(150deg, #312e81 0%, #4f46e5 45%, #7c3aed 100%);
}
.login-aside-glow {
    position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(360px 300px at 85% 12%, rgba(34,211,238,.35), transparent 65%),
        radial-gradient(300px 260px at 5% 95%, rgba(255,255,255,.22), transparent 62%);
}
.login-aside-inner { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 40px; }
.login-brand .logo-lg {
    width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none;
    background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.32);
    color: #fff; font-weight: 800; font-size: 17px; backdrop-filter: blur(6px);
}
.login-brand-text strong { display: block; font-size: 16px; letter-spacing: .02em; }
.login-brand-text small { font-size: 12px; color: rgba(255,255,255,.7); }
.login-aside h2 { font-size: 27px; line-height: 1.42; letter-spacing: -.01em; margin-bottom: 26px; font-weight: 700; }
.login-points { list-style: none; padding: 0; margin: 0; }
.login-points li { display: flex; align-items: center; gap: 11px; font-size: 14.2px; color: rgba(255,255,255,.9); margin-bottom: 14px; }
.login-points .ico {
    width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; font-size: 15px;
    background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2);
}
.login-aside-foot { margin-top: 40px; font-size: 12.5px; color: rgba(255,255,255,.62); }

.login-panel { display: flex; align-items: center; padding: 48px 44px; background: #fff; }
.login-panel-inner { width: 100%; }
.login-welcome { margin-bottom: 26px; }
.login-welcome h1 { font-size: 25px; margin-bottom: 6px; letter-spacing: -.02em; }
.login-welcome p { color: var(--text-light); font-size: 14px; margin: 0; }

.input-affix { position: relative; }
.input-affix .affix {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    display: grid; place-items: center; color: var(--text-muted);
    pointer-events: none; line-height: 1;
}
.input-affix .affix svg { width: 17px; height: 17px; display: block; }
.input-affix:focus-within .affix { color: var(--primary); }
.input-affix .form-control { padding-left: 42px; height: 46px; }
.login-panel .form-label { font-size: 13.5px; }
.login-panel .btn { margin-top: 6px; }
.login-foot { text-align: center; margin-top: 24px; font-size: 13.5px; color: var(--text-muted); }

/* ---------------- 题目选项编辑器 ---------------- */
.option-editor { display: grid; gap: 10px; margin-bottom: 12px; }
.option-row { display: grid; grid-template-columns: 30px 1fr 210px 34px; gap: 10px; align-items: center; }
.option-row .opt-key {
    width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
    background: var(--primary-light); color: var(--primary-dark); font-weight: 700; font-size: 13px;
}
.option-row .form-control { padding: 9px 12px; font-size: 14px; }
.option-row .option-remove { padding: 4px 10px; font-size: 16px; line-height: 1.2; }
@media (max-width: 720px) {
    .option-row { grid-template-columns: 26px 1fr; }
    .option-row .option-remove { grid-column: 2; justify-self: end; }
}
/* ---------------- 详情列表 ---------------- */
.detail-list { display: grid; gap: 0; }
.detail-row { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px dashed #f1f2f7; font-size: 14.3px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .k { flex: 0 0 120px; color: var(--text-muted); }
.detail-row .v { flex: 1; word-break: break-all; }

/* ---------------- 图表 ---------------- */
.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 130px; padding-top: 10px; }
.chart-bars .bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.chart-bars .bar { width: 100%; max-width: 42px; border-radius: 7px 7px 0 0; background: var(--gradient); min-height: 3px; transition: height .4s ease; }
.chart-bars .bar-label { font-size: 11.5px; color: var(--text-muted); }
.chart-bars .bar-value { font-size: 12px; color: var(--text-light); font-weight: 600; }

.dist-list { display: grid; gap: 9px; }
.dist-item { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.dist-item .code { width: 52px; font-weight: 700; color: var(--primary); }
.dist-item .bar-wrap { flex: 1; height: 10px; background: #eef0f6; border-radius: 999px; overflow: hidden; }
.dist-item .bar-wrap i { display: block; height: 100%; background: var(--gradient); border-radius: 999px; transition: width .4s ease; }
.dist-item .num { width: 46px; text-align: right; color: var(--text-light); }

.hint-box { background: #f8f9ff; border: 1px dashed #c7d2fe; border-radius: 13px; padding: 14px 16px; font-size: 13.5px; color: #4338ca; line-height: 1.85; }

/* 转化漏斗 */
.funnel { display: grid; gap: 12px; }
.funnel-step { display: grid; grid-template-columns: 110px 1fr 170px; align-items: center; gap: 14px; }
.funnel-label { font-size: 13.5px; font-weight: 600; color: #374151; }
.funnel-bar { height: 22px; border-radius: 999px; background: #eef0f7; overflow: hidden; }
.funnel-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6366f1, #a855f7); transition: width .5s ease; }
.funnel-value { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.funnel-value small { display: block; font-size: 12px; font-weight: 500; color: #9ca3af; }
.code-block { background: #0f1226; color: #a5f3fc; border-radius: 11px; padding: 16px; font-size: 12.5px; line-height: 1.7; overflow: auto; max-height: 420px; margin: 0; }
.code-block.is-light { background: #f6f7fc; color: #374151; }
@media (max-width: 640px) {
    .funnel-step { grid-template-columns: 1fr; gap: 4px; }
    .funnel-value small { display: inline; margin-left: 8px; }
}

@media (max-width: 900px) {
    .admin-sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; transform: translateX(-100%); transition: transform .22s ease; }
    .admin-sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: block; }
    .admin-content { padding: 16px; }
    .detail-row { flex-direction: column; gap: 4px; }
    .detail-row .k { flex: none; }
}

@media (max-width: 820px) {
    .login-page { padding: 16px; }
    .login-shell { grid-template-columns: 1fr; max-width: 440px; border-radius: 22px; }
    .login-aside { display: none; }
    .login-panel { padding: 34px 26px; }
    .login-welcome h1 { font-size: 22px; }
}
/* ==========================================================================
   登录页升级（背景光斑 / 悬浮人格图标 / 信息层级）
   ========================================================================== */
.login-page { position: relative; overflow: hidden; }
.login-bg { position: absolute; inset: 0; pointer-events: none; }
.lb-blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .6; }
.lb-1 { width: 460px; height: 460px; left: -120px; top: -140px; background: rgba(99,102,241,.55); animation: lb-float 14s ease-in-out infinite; }
.lb-2 { width: 420px; height: 420px; right: -140px; bottom: -160px; background: rgba(168,85,247,.45); animation: lb-float 18s ease-in-out infinite reverse; }
.lb-3 { width: 320px; height: 320px; right: 22%; top: -120px; background: rgba(34,211,238,.38); animation: lb-float 22s ease-in-out infinite; }
.lb-grid {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(99,102,241,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(99,102,241,.07) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(circle at 50% 40%, #000, transparent 72%);
    -webkit-mask-image: radial-gradient(circle at 50% 40%, #000, transparent 72%);
}
@keyframes lb-float {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(24px, -26px, 0) scale(1.07); }
}
.login-shell { position: relative; z-index: 1; }

.login-aside { padding: 40px 42px 34px; background: linear-gradient(155deg, #1e1b4b 0%, #4338ca 42%, #7c3aed 78%, #a855f7 100%); }
.login-aside-icons { position: absolute; inset: 0; pointer-events: none; }
.login-aside-icons .type-icon { position: absolute; opacity: .32; filter: drop-shadow(0 10px 20px rgba(0,0,0,.28)); animation: lb-float 16s ease-in-out infinite; }
.login-aside-icons .type-icon:nth-child(1) { right: 30px; top: 26px; }
.login-aside-icons .type-icon:nth-child(2) { right: 96px; top: 118px; animation-duration: 20s; animation-direction: reverse; }
.login-aside-icons .type-icon:nth-child(3) { right: 34px; bottom: 132px; animation-duration: 24s; }
.login-aside-icons .type-icon:nth-child(4) { left: 28px; bottom: 44px; animation-duration: 19s; animation-direction: reverse; }
.login-aside-icons .type-icon:nth-child(5) { left: 92px; top: 8px; animation-duration: 27s; }

.login-brand { margin-bottom: 34px; }
.login-brand .logo-lg {
    box-shadow: 0 12px 26px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.35);
    background: rgba(255,255,255,.2);
}
.login-brand-text strong { font-size: 16.5px; font-weight: 800; letter-spacing: .02em; }
.login-brand-text small { font-size: 11.5px; color: rgba(255,255,255,.68); letter-spacing: .06em; }

.login-aside h2 { font-size: 28px; line-height: 1.45; margin-bottom: 24px; font-weight: 700; }
.login-aside h2 em {
    font-style: normal;
    background: linear-gradient(90deg, #a5f3fc, #fde68a);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

.login-points li { align-items: flex-start; margin-bottom: 15px; }
.login-points .ico { margin-top: 1px; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.login-points b { display: block; font-size: 14px; font-weight: 700; letter-spacing: .01em; }
.login-points small { display: block; font-size: 12px; color: rgba(255,255,255,.68); margin-top: 2px; }

.login-stats {
    display: flex; gap: 10px; margin-top: 26px; padding-top: 22px;
    border-top: 1px solid rgba(255,255,255,.16);
}
.login-stats > div {
    flex: 1; border-radius: 13px; padding: 10px 12px;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16);
}
.login-stats strong { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.login-stats span { font-size: 11.5px; color: rgba(255,255,255,.72); }
.login-aside-foot { margin-top: auto; padding-top: 22px; font-size: 12px; color: rgba(255,255,255,.55); }

.login-panel { padding: 46px 46px; }
.login-pill {
    display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .08em;
    color: var(--primary-dark); background: var(--primary-light); border-radius: 999px;
    padding: 5px 12px; margin-bottom: 12px;
}
.login-welcome { margin-bottom: 24px; }
.login-welcome h1 { font-size: 27px; letter-spacing: -.02em; }
.login-inner { }

.login-secure {
    margin-top: 20px; padding: 11px 14px; border-radius: 12px; font-size: 12.5px;
    color: var(--text-light); background: #f7f8fc; border: 1px solid var(--border); line-height: 1.6;
}
.login-foot { margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.login-foot .dot { color: #cbd2e2; }

@media (max-width: 860px) {
    .login-aside-icons { display: none; }
}
