/* ============================================================
   智课云 · 教学门户  —  设计系统
   ============================================================ */

:root{
  /* 中性色 */
  --bg:#f4f6fb;
  --surface:#ffffff;
  --surface-2:#f7f9fc;
  --surface-3:#eef1f7;
  --border:#e7ebf3;
  --border-strong:#d6dce8;
  --text:#1c2434;
  --text-muted:#5b6577;
  --text-subtle:#9aa4b6;

  /* 主题色（由 data-theme 覆盖） */
  --primary:#3a5bd9;
  --primary-strong:#2c47b8;
  --primary-soft:#eef1ff;
  --primary-softer:#f6f8ff;
  --primary-contrast:#ffffff;
  --ring:rgba(58,91,217,.22);

  /* 语义色 */
  --success:#1f9d6b;   --success-soft:#e6f6ee;
  --warning:#d98a10;   --warning-soft:#fbf1dd;
  --danger:#d9483b;    --danger-soft:#fbe9e7;
  --info:#3478c6;      --info-soft:#e8f1fb;

  /* 侧栏 */
  --nav-bg:#111726;
  --nav-bg-2:#161d30;
  --nav-text:#aab3c5;
  --nav-text-strong:#ffffff;
  --nav-active:var(--primary);

  --radius:16px;
  --radius-sm:10px;
  --radius-lg:22px;
  --shadow-sm:0 1px 2px rgba(19,28,54,.05), 0 1px 3px rgba(19,28,54,.06);
  --shadow:0 6px 22px -8px rgba(19,28,54,.16), 0 2px 8px -4px rgba(19,28,54,.08);
  --shadow-lg:0 24px 60px -22px rgba(19,28,54,.32);
  --font:"PingFang SC","Microsoft YaHei","Hiragino Sans GB","Source Han Sans SC",system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}

/* ---- 主题 ---- */
[data-theme="ink"]{      --primary:#3a5bd9; --primary-strong:#2c47b8; --primary-soft:#edf0ff; --primary-softer:#f6f8ff; --ring:rgba(58,91,217,.22); }
[data-theme="celadon"]{  --primary:#0e9e8e; --primary-strong:#0a7d70; --primary-soft:#e2f6f3; --primary-softer:#f1fbf9; --ring:rgba(14,158,142,.22); }
[data-theme="pine"]{     --primary:#2f8f57; --primary-strong:#247044; --primary-soft:#e6f4ec; --primary-softer:#f2faf5; --ring:rgba(47,143,87,.22); }
[data-theme="plum"]{     --primary:#6d4bd0; --primary-strong:#573cad; --primary-soft:#efeafc; --primary-softer:#f7f4fe; --ring:rgba(109,75,208,.22); }
[data-theme="amber"]{    --primary:#dd7a17; --primary-strong:#b96210; --primary-soft:#fcefdd; --primary-softer:#fff8ee; --ring:rgba(221,122,23,.22); }
[data-theme="rosewood"]{ --primary:#c0435a; --primary-strong:#9e2f45; --primary-soft:#fbe8ec; --primary-softer:#fef4f6; --ring:rgba(192,67,90,.22); }

/* 石墨（深色）主题 */
[data-theme="graphite"]{
  --bg:#0e1118; --surface:#161b26; --surface-2:#1a2130; --surface-3:#212938;
  --border:#242c3c; --border-strong:#313a4d;
  --text:#e8ecf4; --text-muted:#9aa5ba; --text-subtle:#6b7688;
  --primary:#6a8bff; --primary-strong:#5878f0; --primary-soft:#1d2740; --primary-softer:#182135;
  --primary-contrast:#0e1118; --ring:rgba(106,139,255,.28);
  --success-soft:#13291f; --warning-soft:#2c2410; --danger-soft:#2c1917; --info-soft:#132436;
  --nav-bg:#0a0d14; --nav-bg-2:#10141f; --nav-text:#8b95a8;
  --shadow-sm:0 1px 2px rgba(0,0,0,.4);
  --shadow:0 8px 26px -10px rgba(0,0,0,.6);
  --shadow-lg:0 30px 70px -24px rgba(0,0,0,.7);
}

*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;font-family:var(--font);background:var(--bg);color:var(--text);
  -webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;
  font-size:14px;line-height:1.6;
}
a{color:inherit;text-decoration:none;}
button{font-family:inherit;cursor:pointer;}
img{max-width:100%;display:block;}
svg{width:18px;height:18px;flex:0 0 auto;} /* 默认图标尺寸，上下文可覆盖 */
::selection{background:var(--primary-soft);color:var(--primary-strong);}

/* ============ 布局骨架 ============ */
.app{display:grid;grid-template-columns:248px 1fr;min-height:100vh;}

/* ---------- 侧边栏 ---------- */
.sidebar{
  background:linear-gradient(185deg,var(--nav-bg),var(--nav-bg-2));
  color:var(--nav-text);display:flex;flex-direction:column;
  position:sticky;top:0;height:100vh;padding:20px 14px;gap:6px;
}
.brand{display:flex;align-items:center;gap:11px;padding:6px 8px 18px;}
.brand-mark{
  width:38px;height:38px;border-radius:11px;flex:0 0 auto;
  background:linear-gradient(135deg,var(--primary),var(--primary-strong));
  display:grid;place-items:center;color:#fff;font-weight:800;font-size:19px;
  box-shadow:0 6px 16px -6px var(--ring);letter-spacing:-1px;
}
.brand-name{color:var(--nav-text-strong);font-weight:700;font-size:16px;letter-spacing:.3px;}
.brand-sub{font-size:11px;color:var(--nav-text);opacity:.7;margin-top:1px;}

.nav-group-label{font-size:11px;letter-spacing:1.5px;color:var(--nav-text);opacity:.5;
  padding:14px 12px 6px;text-transform:uppercase;}
.nav-item{
  display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:11px;
  color:var(--nav-text);font-size:14px;font-weight:500;transition:.16s;position:relative;cursor:pointer;
}
.nav-item svg{width:19px;height:19px;flex:0 0 auto;opacity:.85;}
.nav-item:hover{background:rgba(255,255,255,.06);color:var(--nav-text-strong);}
.nav-item.active{background:var(--primary);color:#fff;box-shadow:0 8px 18px -8px var(--ring);}
.nav-item.active svg{opacity:1;}
.nav-item .nav-badge{margin-left:auto;background:var(--danger);color:#fff;font-size:11px;
  min-width:18px;height:18px;border-radius:9px;display:grid;place-items:center;padding:0 5px;font-weight:600;}
.nav-item.active .nav-badge{background:rgba(255,255,255,.28);}
.sidebar .spacer{flex:1;}
.account-card{margin-top:8px;display:flex;align-items:center;gap:11px;padding:11px;border-radius:14px;
  background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.08);}
.account-card .avatar{width:36px;height:36px;border-radius:10px;flex:0 0 auto;}
.account-card .ac-info{min-width:0;flex:1;}
.account-card .ac-name{color:var(--nav-text-strong);font-weight:600;font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.account-card .ac-role{color:var(--nav-text);font-size:11.5px;opacity:.75;margin-top:1px;}
.account-card .ac-logout{width:32px;height:32px;border-radius:9px;flex:0 0 auto;display:grid;place-items:center;
  color:var(--nav-text);background:rgba(0,0,0,.2);transition:.16s;}
.account-card .ac-logout:hover{color:#fff;background:var(--danger);}
.account-card .ac-logout svg{width:17px;height:17px;}
.role-pill{font-size:12px;font-weight:600;color:var(--primary-strong);background:var(--primary-soft);
  padding:6px 12px;border-radius:999px;white-space:nowrap;}
.role-card{
  margin-top:8px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.08);
  border-radius:14px;padding:12px;
}
.role-card .rc-label{font-size:11px;color:var(--nav-text);opacity:.7;margin-bottom:8px;letter-spacing:.5px;}
.role-toggle{display:flex;background:rgba(0,0,0,.25);border-radius:10px;padding:3px;gap:2px;}
.role-toggle button{
  flex:1;border:0;background:transparent;color:var(--nav-text);padding:7px 4px;border-radius:8px;
  font-size:13px;font-weight:600;transition:.16s;
}
.role-toggle button.on{background:var(--primary);color:#fff;box-shadow:var(--shadow-sm);}

/* ---------- 顶栏 ---------- */
.main{min-width:0;display:flex;flex-direction:column;}
.topbar{
  position:sticky;top:0;z-index:30;background:color-mix(in srgb,var(--surface) 86%,transparent);
  backdrop-filter:saturate(180%) blur(12px);border-bottom:1px solid var(--border);
  display:flex;align-items:center;gap:18px;padding:0 30px;height:64px;
}
.crumb{display:flex;align-items:center;gap:9px;color:var(--text-subtle);font-size:13px;}
.crumb b{color:var(--text);font-weight:600;font-size:15px;}
.crumb .sep{opacity:.5;}
.search{
  margin-left:6px;display:flex;align-items:center;gap:9px;background:var(--surface-2);
  border:1px solid var(--border);border-radius:11px;padding:9px 13px;width:280px;color:var(--text-subtle);
}
.search input{border:0;background:transparent;outline:0;color:var(--text);width:100%;font-size:13.5px;}
.search svg{width:17px;height:17px;}
.top-actions{margin-left:auto;display:flex;align-items:center;gap:10px;}
.icon-btn{
  width:40px;height:40px;border-radius:11px;border:1px solid var(--border);background:var(--surface);
  display:grid;place-items:center;color:var(--text-muted);position:relative;transition:.16s;
}
.icon-btn:hover{border-color:var(--border-strong);color:var(--text);background:var(--surface-2);}
.icon-btn svg{width:19px;height:19px;}
.icon-btn .dot{position:absolute;top:9px;right:10px;width:7px;height:7px;border-radius:50%;
  background:var(--danger);border:2px solid var(--surface);}
.user-chip{display:flex;align-items:center;gap:10px;padding:5px 12px 5px 5px;border-radius:12px;
  border:1px solid var(--border);background:var(--surface);}
.user-chip:hover{background:var(--surface-2);}
.avatar{width:32px;height:32px;border-radius:9px;background:linear-gradient(135deg,var(--primary),var(--primary-strong));
  color:#fff;display:grid;place-items:center;font-weight:700;font-size:13px;}
.user-chip .u-name{font-size:13.5px;font-weight:600;}
.user-chip .u-role{font-size:11px;color:var(--text-subtle);}

/* ---------- 内容区 ---------- */
.content{padding:28px 30px 60px;max-width:1240px;width:100%;margin:0 auto;}
.view{display:none;animation:fade .34s ease both;}
.view.active{display:block;}
@keyframes fade{from{opacity:0;transform:translateY(8px);}to{opacity:1;transform:none;}}

.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-bottom:20px;}
.page-title{font-size:22px;font-weight:700;letter-spacing:-.3px;margin:0;}
.page-desc{color:var(--text-muted);font-size:13.5px;margin-top:4px;}

/* 角色可见性 */
[data-role="student"] .teacher-only{display:none !important;}
[data-role="teacher"] .student-only{display:none !important;}

/* ============ 通用组件 ============ */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-sm);}
.card-pad{padding:20px 22px;}
.section-title{display:flex;align-items:center;gap:10px;font-size:16px;font-weight:700;margin:0;}
.section-title .st-ico{width:26px;height:26px;border-radius:8px;background:var(--primary-soft);color:var(--primary-strong);
  display:grid;place-items:center;}
.section-title .st-ico svg{width:16px;height:16px;}
.section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;}
.link-more{color:var(--primary-strong);font-weight:600;font-size:13px;display:inline-flex;align-items:center;gap:4px;cursor:pointer;}
.link-more svg{width:15px;height:15px;}
.a-title{cursor:pointer;}
.link-more:hover{opacity:.8;}

.btn{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--border-strong);background:var(--surface);
  color:var(--text);padding:9px 15px;border-radius:10px;font-size:13.5px;font-weight:600;transition:.16s;}
.btn:hover{background:var(--surface-2);border-color:var(--text-subtle);}
.btn svg{width:16px;height:16px;}
.btn-primary{background:var(--primary);border-color:var(--primary);color:#fff;box-shadow:0 8px 18px -10px var(--ring);}
.btn-primary:hover{background:var(--primary-strong);border-color:var(--primary-strong);}
.btn-soft{background:var(--primary-soft);border-color:transparent;color:var(--primary-strong);}
.btn-soft:hover{background:var(--primary-soft);filter:brightness(.97);}
.btn-sm{padding:6px 11px;font-size:12.5px;border-radius:9px;}
.btn-ghost{background:transparent;border-color:transparent;color:var(--text-muted);}
.btn-ghost:hover{background:var(--surface-3);color:var(--text);}

.chip{display:inline-flex;align-items:center;gap:6px;padding:4px 11px;border-radius:999px;font-size:12px;font-weight:600;
  background:var(--surface-3);color:var(--text-muted);}
.chip.solid{background:var(--primary);color:#fff;}
.badge{display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border-radius:7px;font-size:11.5px;font-weight:600;white-space:nowrap;flex:0 0 auto;}
.badge.ok{background:var(--success-soft);color:var(--success);}
.badge.warn{background:var(--warning-soft);color:var(--warning);}
.badge.danger{background:var(--danger-soft);color:var(--danger);}
.badge.info{background:var(--info-soft);color:var(--info);}
.badge.mute{background:var(--surface-3);color:var(--text-muted);}
.dot-i{width:6px;height:6px;border-radius:50%;background:currentColor;display:inline-block;}

.grid{display:grid;gap:20px;}
.g-2{grid-template-columns:1fr 1fr;}
.g-3{grid-template-columns:repeat(3,1fr);}
.g-4{grid-template-columns:repeat(4,1fr);}
.two-col{display:grid;grid-template-columns:1.55fr 1fr;gap:20px;align-items:start;}

/* ============ 课程首页 Hero ============ */
.hero{position:relative;overflow:hidden;border-radius:var(--radius-lg);color:#fff;
  background:linear-gradient(120deg,var(--primary-strong),var(--primary));box-shadow:var(--shadow);}
.hero::after{content:"";position:absolute;inset:0;
  background:
    radial-gradient(600px 300px at 88% -20%,rgba(255,255,255,.28),transparent 60%),
    radial-gradient(400px 260px at 10% 120%,rgba(255,255,255,.16),transparent 60%);
  pointer-events:none;}
.hero-inner{position:relative;z-index:1;display:grid;grid-template-columns:1fr auto;gap:26px;padding:28px 30px;}
.hero .eyebrow{display:inline-flex;align-items:center;gap:8px;font-size:12.5px;font-weight:600;
  background:rgba(255,255,255,.18);padding:5px 12px;border-radius:999px;margin-bottom:14px;backdrop-filter:blur(4px);}
.hero h1{margin:0 0 10px;font-size:28px;letter-spacing:-.4px;font-weight:800;}
.hero .intro{max-width:560px;color:rgba(255,255,255,.9);font-size:14px;line-height:1.7;}
.hero-meta{display:flex;flex-wrap:wrap;gap:22px;margin-top:20px;}
.hero-meta .m{display:flex;flex-direction:column;gap:2px;}
.hero-meta .m .k{font-size:12px;color:rgba(255,255,255,.72);}
.hero-meta .m .v{font-size:15px;font-weight:700;}
.hero-side{display:flex;flex-direction:column;justify-content:space-between;align-items:flex-end;gap:18px;min-width:190px;}
.progress-ring{--p:0;width:118px;height:118px;border-radius:50%;display:grid;place-items:center;
  background:conic-gradient(#fff calc(var(--p)*1%),rgba(255,255,255,.22) 0);position:relative;}
.progress-ring::before{content:"";position:absolute;inset:11px;border-radius:50%;background:var(--primary-strong);
  background:linear-gradient(135deg,var(--primary),var(--primary-strong));}
.progress-ring .pr-txt{position:relative;z-index:1;text-align:center;}
.progress-ring .pr-txt b{font-size:26px;font-weight:800;}
.progress-ring .pr-txt span{display:block;font-size:11px;color:rgba(255,255,255,.8);}
.hero .continue{background:#fff;color:var(--primary-strong);border:0;font-weight:700;width:100%;justify-content:center;}
.hero .continue:hover{background:rgba(255,255,255,.9);}

/* 学生头像堆叠 */
.stack{display:flex;align-items:center;}
.stack .av{width:30px;height:30px;border-radius:50%;border:2px solid var(--surface);margin-left:-8px;
  display:grid;place-items:center;font-size:11px;font-weight:700;color:#fff;}
.stack .av:first-child{margin-left:0;}
.stack .more{background:var(--surface-3);color:var(--text-muted);}

/* ============ 学习任务 ============ */
.stat-row{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:18px;}
.stat{background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:15px 17px;
  display:flex;align-items:center;gap:14px;box-shadow:var(--shadow-sm);position:relative;overflow:hidden;}
.stat .s-ico{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;flex:0 0 auto;}
.stat .s-ico svg{width:22px;height:22px;}
.stat .s-num{font-size:24px;font-weight:800;line-height:1;letter-spacing:-.5px;}
.stat .s-lab{font-size:12.5px;color:var(--text-muted);margin-top:5px;white-space:nowrap;}
.stat{min-width:0;}
.stat.danger .s-ico{background:var(--danger-soft);color:var(--danger);}
.stat.warn .s-ico{background:var(--warning-soft);color:var(--warning);}
.stat.info .s-ico{background:var(--info-soft);color:var(--info);}
.stat.ok .s-ico{background:var(--success-soft);color:var(--success);}

.tabs{display:flex;gap:4px;background:var(--surface-3);padding:4px;border-radius:11px;}
.tabs button{border:0;background:transparent;padding:7px 15px;border-radius:8px;font-size:13px;font-weight:600;
  color:var(--text-muted);transition:.16s;}
.tabs button.on{background:var(--surface);color:var(--text);box-shadow:var(--shadow-sm);}
.tabs.pill button.on{background:var(--primary);color:#fff;}

.task{display:flex;align-items:center;gap:15px;padding:15px 6px;border-bottom:1px solid var(--border);cursor:pointer;transition:.14s;}
.task:last-child{border-bottom:0;}
.task:hover{background:var(--surface-2);border-radius:12px;padding-left:14px;padding-right:14px;}
.task .t-flag{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;font-weight:800;font-size:13px;flex:0 0 auto;
  background:var(--surface-3);color:var(--text-subtle);}
.task.urgent .t-flag{background:var(--danger);color:#fff;box-shadow:0 0 0 4px var(--danger-soft);}
.task .t-ico{width:42px;height:42px;border-radius:11px;display:grid;place-items:center;flex:0 0 auto;
  background:var(--primary-soft);color:var(--primary-strong);}
.task .t-ico svg{width:20px;height:20px;}
.task .t-main{flex:1;min-width:0;}
.task .t-title{font-weight:600;font-size:14.5px;display:flex;align-items:center;gap:8px;}
.task .t-sub{font-size:12.5px;color:var(--text-subtle);margin-top:3px;display:flex;gap:14px;flex-wrap:wrap;}
.task .t-sub .lock{display:inline-flex;align-items:center;gap:4px;color:var(--warning);}
.task .t-right{text-align:right;flex:0 0 auto;display:flex;flex-direction:column;align-items:flex-end;gap:6px;}
.task .t-due{font-size:12px;color:var(--text-muted);}

/* ============ 列表 / 表格 ============ */
.table{width:100%;border-collapse:collapse;}
.table th{text-align:left;font-size:12px;font-weight:600;color:var(--text-subtle);padding:11px 14px;
  border-bottom:1px solid var(--border);background:var(--surface-2);white-space:nowrap;}
.table th:first-child{border-top-left-radius:10px;}
.table th:last-child{border-top-right-radius:10px;}
.table td{padding:14px;border-bottom:1px solid var(--border);font-size:13.5px;white-space:nowrap;}
.table td.cell-wrap{white-space:normal;min-width:190px;}
.table .badge{white-space:nowrap;}
.table tr:last-child td{border-bottom:0;}
.table tbody tr:hover{background:var(--surface-2);}
.prog{height:7px;border-radius:4px;background:var(--surface-3);overflow:hidden;min-width:90px;}
.prog i{display:block;height:100%;border-radius:4px;background:var(--primary);}

.filters{display:flex;align-items:center;gap:18px;flex-wrap:wrap;margin-bottom:4px;}
.filter{display:flex;align-items:center;gap:8px;}
.filter .f-lab{font-size:12.5px;color:var(--text-subtle);}
.seg{display:flex;border:1px solid var(--border);border-radius:9px;overflow:hidden;}
.seg button{border:0;background:var(--surface);padding:7px 13px;font-size:12.5px;font-weight:600;color:var(--text-muted);border-right:1px solid var(--border);}
.seg button:last-child{border-right:0;}
.seg button.on{background:var(--primary-soft);color:var(--primary-strong);}

/* ============ 公告 ============ */
.ann{display:flex;gap:14px;padding:14px 6px;border-bottom:1px solid var(--border);}
.ann:last-child{border-bottom:0;}
.ann .a-date{flex:0 0 auto;width:54px;text-align:center;}
.ann .a-date .d{font-size:22px;font-weight:800;line-height:1;}
.ann .a-date .m{font-size:11px;color:var(--text-subtle);margin-top:3px;}
.ann .a-body{flex:1;min-width:0;}
.ann .a-title{font-weight:600;font-size:14px;display:flex;align-items:center;gap:8px;}
.ann .a-title:hover{color:var(--primary-strong);cursor:pointer;}
.ann .a-text{font-size:12.5px;color:var(--text-muted);margin-top:4px;
  display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;}
.ann .a-meta{font-size:11.5px;color:var(--text-subtle);margin-top:7px;display:flex;gap:12px;}

/* ============ 互动 ============ */
.inter{display:flex;gap:13px;padding:15px 6px;border-bottom:1px solid var(--border);}
.inter:last-child{border-bottom:0;}
.inter .i-av{width:40px;height:40px;border-radius:11px;flex:0 0 auto;display:grid;place-items:center;color:#fff;font-weight:700;font-size:14px;}
.inter .i-body{flex:1;min-width:0;}
.inter .i-head{font-size:13px;color:var(--text-muted);}
.inter .i-head b{color:var(--text);}
.inter .i-quote{margin-top:8px;background:var(--surface-2);border:1px solid var(--border);border-left:3px solid var(--primary);
  border-radius:8px;padding:9px 12px;font-size:12.5px;color:var(--text-muted);}
.inter .i-reply{margin-top:8px;font-size:13.5px;color:var(--text);}
.inter .i-meta{margin-top:9px;display:flex;align-items:center;gap:16px;font-size:12px;color:var(--text-subtle);}
.inter .i-meta .act{display:inline-flex;align-items:center;gap:5px;}
.inter .i-meta .act svg{width:14px;height:14px;}

/* ============ 课程导航（教师） ============ */
.nav-actions{display:grid;grid-template-columns:repeat(5,1fr);gap:12px;}
.na{border:1px solid var(--border);border-radius:14px;padding:20px 12px;display:flex;flex-direction:column;gap:10px;
  align-items:center;justify-content:center;background:var(--surface);transition:.16s;text-align:center;}
.na:hover{border-color:var(--primary);box-shadow:var(--shadow);transform:translateY(-2px);}
.na .na-ico{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;background:var(--primary-soft);color:var(--primary-strong);}
.na .na-ico svg{width:21px;height:21px;}
.na .na-t{font-weight:600;font-size:13.5px;}
.na .na-d{font-size:11.5px;color:var(--text-subtle);line-height:1.5;}

/* ============ 主题门户 ============ */
.theme-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;}
.theme-card{border:2px solid var(--border);border-radius:16px;overflow:hidden;background:var(--surface);cursor:pointer;transition:.18s;position:relative;}
.theme-card:hover{transform:translateY(-3px);box-shadow:var(--shadow);}
.theme-card.selected{border-color:var(--primary);box-shadow:0 0 0 4px var(--ring);}
.theme-card .tc-preview{height:104px;position:relative;display:flex;}
.theme-card .tc-nav{width:34%;height:100%;}
.theme-card .tc-body{flex:1;padding:12px;display:flex;flex-direction:column;gap:7px;}
.theme-card .tc-bar{height:9px;border-radius:5px;}
.theme-card .tc-bar.w1{width:70%;} .theme-card .tc-bar.w2{width:45%;}
.theme-card .tc-pill{height:22px;width:56px;border-radius:7px;margin-top:auto;}
.theme-card .tc-foot{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-top:1px solid var(--border);}
.theme-card .tc-name{font-weight:700;font-size:14px;}
.theme-card .tc-hex{font-size:11.5px;color:var(--text-subtle);}
.theme-card .tc-check{width:22px;height:22px;border-radius:50%;background:var(--primary);color:#fff;display:none;place-items:center;}
.theme-card.selected .tc-check{display:grid;}
.swatch{width:26px;height:26px;border-radius:8px;border:2px solid rgba(255,255,255,.7);box-shadow:var(--shadow-sm);}

/* ============ 练习本 ============ */
.qbank-item{display:flex;align-items:center;gap:15px;padding:16px;border:1px solid var(--border);border-radius:14px;margin-bottom:12px;background:var(--surface);transition:.16s;}
.qbank-item:hover{border-color:var(--border-strong);box-shadow:var(--shadow-sm);}
.qbank-item .qb-ico{width:46px;height:46px;border-radius:12px;display:grid;place-items:center;flex:0 0 auto;
  background:var(--primary-soft);color:var(--primary-strong);}
.qbank-item .qb-ico svg{width:22px;height:22px;}
.qbank-item .qb-main{flex:1;min-width:0;}
.qbank-item .qb-title{font-weight:700;font-size:15px;}
.qbank-item .qb-sub{font-size:12.5px;color:var(--text-subtle);margin-top:4px;display:flex;gap:14px;flex-wrap:wrap;}

/* 开关 */
.switch{position:relative;width:46px;height:26px;flex:0 0 auto;}
.switch input{opacity:0;width:0;height:0;position:absolute;}
.switch .track{position:absolute;inset:0;background:var(--border-strong);border-radius:999px;transition:.2s;}
.switch .track::before{content:"";position:absolute;width:20px;height:20px;border-radius:50%;background:#fff;
  top:3px;left:3px;transition:.2s;box-shadow:var(--shadow-sm);}
.switch input:checked + .track{background:var(--primary);}
.switch input:checked + .track::before{transform:translateX(20px);}
.switch-lg{width:52px;height:30px;}
.switch-lg .track::before{width:24px;height:24px;}
.switch-lg input:checked + .track::before{transform:translateX(22px);}

/* 答题 */
.question{border:1px solid var(--border);border-radius:14px;padding:22px;background:var(--surface);}
.q-stem{font-size:15.5px;font-weight:600;line-height:1.7;margin:12px 0 18px;}
.q-opt{display:flex;align-items:center;gap:12px;padding:13px 15px;border:1.5px solid var(--border);border-radius:12px;margin-bottom:11px;
  cursor:pointer;transition:.14s;font-size:14px;}
.q-opt:hover{border-color:var(--primary);background:var(--primary-softer);}
.q-opt .q-key{width:26px;height:26px;border-radius:8px;border:1.5px solid var(--border-strong);display:grid;place-items:center;
  font-weight:700;font-size:13px;color:var(--text-muted);flex:0 0 auto;transition:.14s;}
.q-opt.chosen{border-color:var(--primary);background:var(--primary-soft);}
.q-opt.chosen .q-key{background:var(--primary);color:#fff;border-color:var(--primary);}
.q-opt.correct{border-color:var(--success);background:var(--success-soft);}
.q-opt.correct .q-key{background:var(--success);color:#fff;border-color:var(--success);}
.q-opt.wrong{border-color:var(--danger);background:var(--danger-soft);}
.q-opt.wrong .q-key{background:var(--danger);color:#fff;border-color:var(--danger);}
.analysis{margin-top:16px;border-radius:12px;border:1px solid var(--border);overflow:hidden;display:none;}
.analysis.show{display:block;animation:fade .3s both;}
.analysis .an-head{padding:11px 16px;background:var(--success-soft);color:var(--success);font-weight:700;font-size:13.5px;
  display:flex;align-items:center;gap:8px;}
.analysis .an-head svg{width:16px;height:16px;}
.hero .eyebrow svg{width:15px;height:15px;}
.task .t-sub svg{width:14px;height:14px;}
.analysis.miss .an-head{background:var(--danger-soft);color:var(--danger);}
.analysis .an-body{padding:15px 16px;font-size:13.5px;line-height:1.75;color:var(--text-muted);}
.analysis .an-body b{color:var(--text);}

/* ============ 视频 / 水印 ============ */
.player{position:relative;border-radius:16px;overflow:hidden;background:#0b1020;aspect-ratio:16/9;box-shadow:var(--shadow);}
.player .stage{position:absolute;inset:0;background:
  radial-gradient(1200px 500px at 30% 10%,rgba(90,120,255,.28),transparent 55%),
  radial-gradient(900px 500px at 80% 90%,rgba(20,180,160,.22),transparent 55%),
  linear-gradient(160deg,#141a2e,#0b1020);}
.player .center{position:absolute;inset:0;display:grid;place-items:center;color:rgba(255,255,255,.9);text-align:center;}
.player .play-btn{width:74px;height:74px;border-radius:50%;background:rgba(255,255,255,.16);backdrop-filter:blur(6px);
  border:1.5px solid rgba(255,255,255,.4);display:grid;place-items:center;margin:0 auto 14px;transition:.16s;}
.player .play-btn:hover{background:rgba(255,255,255,.28);transform:scale(1.05);}
.player .play-btn svg{width:30px;height:30px;color:#fff;margin-left:4px;}
.player .p-title{font-size:15px;font-weight:600;}
.player .p-sub{font-size:12.5px;color:rgba(255,255,255,.6);margin-top:4px;}
.watermark{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:5;opacity:0;transition:opacity .25s;}
.watermark.on{opacity:1;}
.watermark .wm-tile{position:absolute;color:rgba(255,255,255,.16);font-size:15px;font-weight:600;white-space:nowrap;
  transform:rotate(-28deg);letter-spacing:1px;}
.player .controls{position:absolute;left:0;right:0;bottom:0;z-index:6;padding:14px 16px;
  background:linear-gradient(transparent,rgba(0,0,0,.6));display:flex;align-items:center;gap:14px;color:#fff;}
.player .controls .bar{flex:1;height:5px;border-radius:3px;background:rgba(255,255,255,.25);overflow:hidden;}
.player .controls .bar i{display:block;height:100%;width:34%;background:#fff;border-radius:3px;}
.player .controls .time{font-size:12px;color:rgba(255,255,255,.85);font-variant-numeric:tabular-nums;}
.player .controls svg{width:18px;height:18px;}

/* ============ 弹层 ============ */
.modal-mask{position:fixed;inset:0;background:rgba(12,18,34,.5);backdrop-filter:blur(3px);z-index:100;
  display:none;align-items:center;justify-content:center;padding:24px;}
.modal-mask.open{display:flex;animation:fade .2s both;}
.modal{background:var(--surface);border-radius:18px;box-shadow:var(--shadow-lg);width:100%;max-width:540px;
  overflow:hidden;animation:pop .24s cubic-bezier(.2,.8,.3,1) both;}
@keyframes pop{from{opacity:0;transform:translateY(14px) scale(.97);}to{opacity:1;transform:none;}}
.modal .m-head{padding:20px 24px;border-bottom:1px solid var(--border);display:flex;align-items:flex-start;justify-content:space-between;gap:12px;}
.modal .m-title{font-size:17px;font-weight:700;}
.modal .m-sub{font-size:12.5px;color:var(--text-subtle);margin-top:4px;}
.modal .m-close{width:32px;height:32px;border-radius:9px;border:1px solid var(--border);background:var(--surface);color:var(--text-muted);display:grid;place-items:center;}
.modal .m-close:hover{background:var(--surface-2);}
.modal .m-body{padding:22px 24px;max-height:60vh;overflow:auto;}
.modal .m-foot{padding:16px 24px;border-top:1px solid var(--border);display:flex;justify-content:flex-end;gap:10px;}
.kv{display:flex;justify-content:space-between;gap:16px;padding:11px 0;border-bottom:1px dashed var(--border);font-size:13.5px;}
.kv:last-child{border-bottom:0;}
.kv .k{color:var(--text-subtle);}
.kv .v{font-weight:600;text-align:right;}

/* Toast */
.toast{position:fixed;bottom:26px;left:50%;transform:translateX(-50%) translateY(20px);z-index:200;
  background:var(--text);color:var(--surface);padding:12px 20px;border-radius:12px;font-size:13.5px;font-weight:600;
  box-shadow:var(--shadow-lg);opacity:0;transition:.28s;display:flex;align-items:center;gap:9px;pointer-events:none;}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0);}
.toast svg{width:17px;height:17px;color:#4ade80;}

.empty{text-align:center;padding:40px 20px;color:var(--text-subtle);}
.empty svg{width:44px;height:44px;margin:0 auto 12px;opacity:.5;}

.muted{color:var(--text-muted);}
.small{font-size:12.5px;}
.mt-0{margin-top:0;} .mt-8{margin-top:8px;} .mt-16{margin-top:16px;} .mt-20{margin-top:20px;} .mt-24{margin-top:24px;}
.mb-0{margin-bottom:0;}
.flex{display:flex;} .between{justify-content:space-between;} .center-y{align-items:center;} .gap-8{gap:8px;} .gap-12{gap:12px;} .wrap{flex-wrap:wrap;}

/* ============ 通知中心 ============ */
.notif-wrap{position:relative;}
.notif-panel{position:absolute;top:calc(100% + 12px);right:0;width:344px;background:var(--surface);border:1px solid var(--border);
  border-radius:16px;box-shadow:var(--shadow-lg);z-index:60;opacity:0;visibility:hidden;transform:translateY(-6px) scale(.98);
  transform-origin:top right;transition:.18s;overflow:hidden;}
.notif-panel.open{opacity:1;visibility:visible;transform:none;}
.np-head{display:flex;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid var(--border);}
.np-head b{font-size:14.5px;}
.np-count{font-size:11.5px;color:var(--danger);background:var(--danger-soft);padding:2px 8px;border-radius:6px;font-weight:600;}
.np-count.read{color:var(--text-subtle);background:var(--surface-3);}
.np-read{margin-left:auto;border:0;background:transparent;color:var(--primary-strong);font-size:12.5px;font-weight:600;}
.np-read:hover{text-decoration:underline;}
.np-list{max-height:344px;overflow:auto;}
.np-item{display:flex;gap:12px;padding:12px 16px 12px 20px;border-bottom:1px solid var(--border);position:relative;transition:.14s;}
.np-item:last-child{border-bottom:0;}
.np-item:hover{background:var(--surface-2);}
.np-item.unread{background:var(--primary-softer);}
.np-item.unread::before{content:"";position:absolute;left:8px;top:19px;width:6px;height:6px;border-radius:50%;background:var(--primary);}
.np-ico{width:34px;height:34px;border-radius:9px;flex:0 0 auto;display:grid;place-items:center;}
.np-ico svg{width:17px;height:17px;}
.np-ico.task{background:var(--info-soft);color:var(--info);}
.np-ico.interact{background:var(--primary-soft);color:var(--primary-strong);}
.np-ico.announce{background:var(--warning-soft);color:var(--warning);}
.np-body{min-width:0;}
.np-t{font-size:13px;font-weight:500;line-height:1.5;}
.np-time{font-size:11.5px;color:var(--text-subtle);margin-top:3px;}
.np-foot{padding:11px 16px;border-top:1px solid var(--border);text-align:center;}
.np-foot a{color:var(--primary-strong);font-weight:600;font-size:13px;display:inline-flex;align-items:center;gap:4px;cursor:pointer;}
.np-foot a svg{width:14px;height:14px;}

/* ============ 学习足迹热力图 ============ */
.hm-grid{display:flex;gap:4px;}
.hm-col{display:flex;flex-direction:column;gap:4px;flex:1;}
.hm-c{width:100%;aspect-ratio:1;border-radius:3px;background:var(--surface-3);}
.hm-c.l1{background:color-mix(in srgb,var(--primary) 28%,var(--surface-3));}
.hm-c.l2{background:color-mix(in srgb,var(--primary) 50%,var(--surface));}
.hm-c.l3{background:color-mix(in srgb,var(--primary) 74%,var(--surface));}
.hm-c.l4{background:var(--primary);}
.hm-legend{display:flex;align-items:center;gap:5px;justify-content:flex-end;margin-top:12px;font-size:11.5px;color:var(--text-subtle);}
.hm-legend .hm-c{width:13px;height:13px;aspect-ratio:auto;flex:0 0 auto;}
.wt-chart{display:flex;align-items:flex-end;gap:10px;height:150px;}
.wt-col{flex:1;display:flex;flex-direction:column;align-items:center;height:100%;}
.wt-track{flex:1;width:100%;display:flex;align-items:flex-end;justify-content:center;}
.wt-track i{display:block;width:64%;min-height:5px;border-radius:6px 6px 0 0;background:linear-gradient(var(--primary),var(--primary-strong));transition:.3s;}
.wt-d{font-size:12px;color:var(--text-muted);margin-top:8px;}
.wt-h{font-size:11px;color:var(--text-subtle);margin-top:2px;}

/* 响应式 */
@media (max-width:1080px){
  .two-col{grid-template-columns:1fr;}
  .g-4{grid-template-columns:repeat(2,1fr);}
  .theme-grid{grid-template-columns:repeat(2,1fr);}
  .nav-actions{grid-template-columns:repeat(3,1fr);}
}
@media (max-width:820px){
  .app{grid-template-columns:1fr;}
  .sidebar{display:none;}
  .stat-row{grid-template-columns:repeat(2,1fr);}
  .search{display:none;}
  .hero-inner{grid-template-columns:1fr;}
}
