/* 青橙教务：暖橙品牌色 + 浅色侧栏，圆润亲和 */
:root {
  --primary: #f46a25; --primary-hover: #ff8547; --primary-active: #de5a18;
  --primary-1: #fff4ed; --primary-2: #ffe4d4; --primary-3: #ffc2a0;
  --bg: #f7f6f4; --radius: 14px; --radius-sm: 8px; --border-2: #f1efec;
  --fill: #f8f7f5;
}
body { overflow: hidden; }
.shell { display: flex; height: 100vh; }
.side { width: 232px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--border-2); display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 12px; }
.brand b { display: block; font-size: 17px; letter-spacing: 1px; }
.brand small { display: block; font-size: 11px; color: var(--text-3); margin-top: -1px; }
.campus { margin: 4px 14px 8px; padding: 9px 12px; border-radius: 10px; background: var(--fill); display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; position: relative; }
.campus:hover { background: var(--primary-1); }
.campus .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px #dcfce7; }
.campus .pop { top: 42px; left: 0; right: 0; }
.nav { flex: 1; overflow: auto; padding: 6px 14px; }
.nav-group { font-size: 11px; color: var(--text-3); padding: 14px 10px 6px; letter-spacing: 1px; }
.nav-item { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; border-radius: 12px; color: var(--text-2); font-size: 14px; margin-bottom: 2px; transition: all .15s; }
.nav-item:hover { background: var(--fill); color: var(--text); }
.nav-item.active { background: var(--primary-1); color: var(--primary); font-weight: 600; }
.nav-item.active .ic { color: var(--primary); }
.nav-item .badge-count { margin-left: auto; }
.side-card { margin: 12px 14px 16px; padding: 14px; border-radius: 14px; background: linear-gradient(145deg, #fff1e8, #ffe2cf); font-size: 12px; color: #9a4a1c; }
.side-card b { display: block; font-size: 20px; color: #c2410c; margin: 2px 0; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 24px; background: rgba(247, 246, 244, .9); backdrop-filter: blur(8px); flex-shrink: 0; }
.menu-toggle { display: none; }
.tb-title { font-size: 13px; color: var(--text-3); white-space: nowrap; }
.tb-search { margin-left: auto; position: relative; width: 280px; }
.tb-search > span { position: absolute; left: 12px; top: 9px; color: var(--text-3); display: flex; }
.tb-search .input { padding-left: 34px; height: 34px; border-radius: 17px; background: #fff; border-color: var(--border-2); }
.ts-drop { position: absolute; top: 40px; left: 0; right: 0; background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 50; }
.ts-drop.show { display: block; }
.ts-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.ts-item:hover { background: var(--primary-1); }
.has-dot { position: relative; }
.has-dot::after { content: ""; position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 1.5px solid #fff; }
.me { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 20px; position: relative; }
.me:hover { background: #fff; }
.me .n { font-size: 13px; line-height: 1.2; } .me .r { font-size: 11px; color: var(--text-3); }
.pop { position: absolute; top: 46px; right: 0; background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 180px; z-index: 60; display: none; }
.pop.show { display: block; animation: toastIn .18s; }
.pop-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.pop-item:hover { background: var(--fill); color: var(--text); }
.main-scroll { flex: 1; overflow: auto; }
.page { padding: 8px 24px 48px; max-width: 1560px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; }
.page-head .desc-text { color: var(--text-3); font-size: 13px; margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { border: 0; box-shadow: 0 1px 2px rgba(60, 40, 20, .04), 0 4px 16px rgba(60, 40, 20, .04); }
.btn { border-radius: 10px; }
.btn-sm { border-radius: 8px; }

/* 概览 */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.kpi { padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; }
.kpi .k-ic { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kpi .l { font-size: 13px; color: var(--text-2); }
.kpi .v { font-size: 26px; font-weight: 700; line-height: 1.25; margin-top: 2px; letter-spacing: -.5px; }
.kpi .v small { font-size: 13px; font-weight: 400; color: var(--text-3); margin-left: 3px; }
.kpi .s { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.up { color: #16a34a; } .down { color: #dc2626; }
.dash-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 16px; margin-bottom: 16px; }
.dash-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.today-list { padding: 4px 20px 16px; }
.today-item { display: grid; grid-template-columns: 92px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--border-2); cursor: pointer; }
.today-item:last-child { border-bottom: 0; }
.today-item .tm { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.today-item .tm small { display: block; font-size: 12px; color: var(--text-3); font-weight: 400; }
.today-item .cn { display: flex; gap: 10px; align-items: center; min-width: 0; }
.today-item .bar { width: 4px; height: 36px; border-radius: 2px; flex-shrink: 0; }
.today-item .t { font-size: 14px; font-weight: 500; }
.today-item .s { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.today-item:hover .t { color: var(--primary); }
.renew-row { display: flex; gap: 12px; align-items: center; padding: 11px 20px; border-bottom: 1px solid var(--border-2); }
.renew-row:last-child { border-bottom: 0; }
.renew-row .t { font-size: 14px; font-weight: 500; }
.renew-row .s { font-size: 12px; color: var(--text-3); }
.hours-pill { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.hp-danger { background: #fee2e2; color: #dc2626; } .hp-warn { background: #ffedd5; color: #c2410c; } .hp-ok { background: #dcfce7; color: #15803d; }
.chart { width: 100%; height: 280px; }

/* 课表 */
.sch-bar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; flex-wrap: wrap; border-bottom: 1px solid var(--border-2); }
.sch-bar .wk { font-size: 16px; font-weight: 600; min-width: 200px; text-align: center; }
.sch-legend { display: flex; gap: 12px; flex-wrap: wrap; padding: 10px 16px; font-size: 12px; color: var(--text-2); border-bottom: 1px solid var(--border-2); }
.sch-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sch-legend i { width: 10px; height: 10px; border-radius: 3px; }
.sch-wrap { overflow: auto; max-height: calc(100vh - 250px); min-height: 480px; position: relative; }
.sch { display: grid; grid-template-columns: 56px repeat(5, minmax(112px, 1fr)) repeat(2, minmax(160px, 1.45fr)); min-width: 980px; position: relative; }
.sch-head { position: sticky; top: 0; z-index: 6; background: #fff; border-bottom: 1px solid var(--border-2); height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 13px; color: var(--text-2); }
.sch-head b { font-size: 18px; color: var(--text); font-weight: 600; line-height: 1.2; }
.sch-head.today { color: var(--primary); }
.sch-head.today b { color: #fff; background: var(--primary); border-radius: 50%; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.sch-head .hol { font-size: 10px; color: #16a34a; }
.sch-corner { position: sticky; top: 0; left: 0; z-index: 7; background: #fff; border-bottom: 1px solid var(--border-2); }
.sch-times { position: sticky; left: 0; z-index: 5; background: #fff; }
.sch-time { height: 46px; font-size: 11px; color: var(--text-3); text-align: right; padding-right: 8px; transform: translateY(-7px); }
.sch-day { position: relative; border-left: 1px solid var(--border-2); background-image: linear-gradient(to bottom, var(--border-2) 1px, transparent 1px), linear-gradient(to bottom, #faf9f7 1px, transparent 1px); background-size: 100% 46px, 100% 23px; background-position: 0 0, 0 23px; }
.sch-day.today { background-color: #fffaf6; }
.sch-day.weekend { background-color: #fcfbfa; }
.sch-slot-hover { position: absolute; left: 2px; right: 2px; height: 23px; border-radius: 6px; background: var(--primary-1); border: 1px dashed var(--primary-3); display: none; pointer-events: none; font-size: 11px; color: var(--primary); align-items: center; justify-content: center; }
.ev { position: absolute; border-radius: 8px; padding: 4px 6px; font-size: 12px; line-height: 1.35; cursor: pointer; overflow: hidden; border-left: 3px solid; transition: box-shadow .15s, transform .15s; z-index: 2; }
.ev:hover { box-shadow: 0 6px 16px rgba(0, 0, 0, .12); transform: translateY(-1px); z-index: 4; }
.ev .en { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .em { opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.ev.past { opacity: .55; }
.ev.extra::after { content: attr(data-kind); position: absolute; right: 4px; top: 4px; font-size: 10px; background: rgba(255, 255, 255, .85); padding: 0 4px; border-radius: 4px; }
.ev.flash { animation: flash 1.2s ease 2; }
@keyframes flash { 0%, 100% { box-shadow: 0 0 0 0 rgba(244, 106, 37, 0); } 50% { box-shadow: 0 0 0 4px rgba(244, 106, 37, .45); } }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: #ef4444; z-index: 3; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; }
.conflict-box { border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-top: 4px; display: flex; gap: 8px; align-items: flex-start; line-height: 1.7; }
.conflict-box.ok { background: #f0fdf4; color: #15803d; }
.conflict-box.bad { background: #fef2f2; color: #b91c1c; }
.conflict-box.idle { background: var(--fill); color: var(--text-3); }
.conflict-box .ic { margin-top: 3px; }

/* 学员 */
.stu-name { display: flex; gap: 10px; align-items: center; }
.hours { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.hours .top { display: flex; justify-content: space-between; font-size: 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.acc-card { border: 1px solid var(--border-2); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.acc-card .hd { display: flex; align-items: center; gap: 8px; }
.acc-card .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; text-align: center; }
.acc-card .nums b { display: block; font-size: 18px; }
.acc-card .nums span { font-size: 12px; color: var(--text-3); }

/* 班级 */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.class-card { padding: 18px; cursor: pointer; transition: transform .15s, box-shadow .15s; position: relative; overflow: hidden; }
.class-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(60, 40, 20, .1); }
.class-card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--cc); }
.class-card .hd { display: flex; gap: 10px; align-items: flex-start; }
.class-card .cn { font-size: 16px; font-weight: 600; line-height: 1.4; }
.class-card .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; font-size: 13px; color: var(--text-2); }
.class-card .meta span { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.class-card .pg { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; font-size: 12px; color: var(--text-3); }
.class-card .pg .top { display: flex; justify-content: space-between; margin-bottom: 4px; }
.class-card .pg b { color: var(--text); }
.course-dot { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }

/* 缴费 */
.money-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.money-strip .card { padding: 18px 20px; }
.money-strip .l { font-size: 13px; color: var(--text-2); }
.money-strip .v { font-size: 24px; font-weight: 700; margin-top: 4px; }
.money-strip .s { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.pkg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pkg { border: 1.5px solid var(--border); border-radius: 12px; padding: 12px; cursor: pointer; text-align: center; transition: all .15s; position: relative; }
.pkg:hover { border-color: var(--primary-3); }
.pkg.on { border-color: var(--primary); background: var(--primary-1); }
.pkg b { display: block; font-size: 18px; }
.pkg span { font-size: 12px; color: var(--text-3); }
.pkg .hot { position: absolute; top: -9px; right: 8px; background: var(--primary); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 6px; }
.sum-box { background: var(--fill); border-radius: 12px; padding: 12px 14px; font-size: 13px; }
.sum-box .row { display: flex; justify-content: space-between; padding: 3px 0; color: var(--text-2); }
.sum-box .row.total { font-size: 15px; color: var(--text); font-weight: 600; border-top: 1px dashed var(--border); margin-top: 6px; padding-top: 8px; }
.sum-box .row.total b { color: var(--primary); font-size: 20px; }
.receipt { border: 1px dashed var(--border); border-radius: 12px; padding: 20px; background: #fffdfb; }
.receipt h3 { text-align: center; font-size: 17px; letter-spacing: 2px; }
.receipt .no { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 4px; }
.receipt table { width: 100%; font-size: 13px; margin-top: 16px; border-collapse: collapse; }
.receipt td { padding: 7px 0; border-bottom: 1px dashed var(--border-2); }
.receipt td:last-child { text-align: right; }

@media (max-width: 1200px) {
  .dash-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1080px) {
  .kpis, .money-strip { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .side { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .25s; }
  .shell.side-open .side { transform: none; box-shadow: var(--shadow-lg); }
  .shell.side-open + .side-mask { display: block; }
  .side-mask { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 15; }
  .menu-toggle { display: inline-flex; }
  .tb-search { display: none; }
  .me { margin-left: auto; }
  .me .n, .me .r { display: none; }
  .dash-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .page { padding: 8px 12px 48px; }
  .topbar { padding: 0 12px; }
  .kpis, .money-strip { gap: 10px; }
  .kpi { padding: 14px; flex-direction: column; gap: 8px; }
  .kpi .k-ic { width: 36px; height: 36px; }
  .kpi .v { font-size: 20px; }
  .pkg-grid { grid-template-columns: 1fr 1fr; }
  .today-item { grid-template-columns: 70px 1fr; }
  .today-item > :last-child { display: none; }
  .sch-bar .wk { min-width: 0; font-size: 14px; }
}
.ev.need-roll { opacity: .9; }
.ev.need-roll::before { content: "待点名"; position: absolute; right: 4px; bottom: 4px; font-size: 10px; background: #ef4444; color: #fff; padding: 0 5px; border-radius: 4px; line-height: 16px; }

@media (max-width: 640px) { .card-hd { flex-wrap: wrap; row-gap: 6px; } .card-hd .extra { flex-wrap: wrap; } }
.dash-grid > *, .dash-grid-3 > * { min-width: 0; }

/* 窄屏：数据表改为卡片（每行一张，左侧字段名），不在容器内横向滑动 */
@media (max-width:640px){
  .dt-scroll{overflow:visible}
  .dt-scroll>.table,.dt-scroll>.table>tbody{display:block;width:100%;min-width:0}
  .dt-scroll>.table>thead{display:none}
  .dt-scroll>.table tr.dr{display:block;padding:10px 14px;border-bottom:1px solid var(--border-2,#eef0f3)}
  .dt-scroll>.table tr.dr>td{display:block;padding:3px 0;border:0;white-space:normal;text-align:right;min-height:24px;background:none}
  .dt-scroll>.table tr.dr>td::before{content:attr(data-l);float:left;margin-right:12px;color:var(--text-3,#98a2b3);font-size:12px;text-align:left}
  .dt-scroll>.table tr.dr>td.c-first{display:block;text-align:left;padding-bottom:6px}
  .dt-scroll>.table tr.dr>td.c-first::before,.dt-scroll>.table tr.dr>td.c-op::before,.dt-scroll>.table tr.dr>td[data-l=""]::before{display:none}
  .dt-scroll>.table tr.dr>td.c-op{text-align:right;padding-top:6px}
  .dt-scroll>.table tr.dr>td.col-check{display:none}
  .dt-scroll>.table tr.dr>td>*{min-width:0}
}

@media (max-width:640px){.dt-scroll>.table tr.dr>td::after{content:'';display:table;clear:both}}

/* 手机端排课：按天日程列表（替代需横向滑动的周视图） */
.sch-m { display: none; }
@media (max-width: 640px) {
  .sch-wrap, .sch-legend { display: none; }
  .sch-m { display: block; padding: 0 0 14px; }
  .sch-bar #mode { order: 9; }
  .am-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 10px 10px 8px; border-bottom: 1px solid var(--border-2); }
  .am-d { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0; border-radius: 10px; background: none; border: 0; color: var(--text-2); font-size: 11px; cursor: pointer; }
  .am-d b { font-size: 16px; color: var(--text); font-weight: 600; line-height: 1.3; }
  .am-d i { font-style: normal; font-size: 10px; color: var(--text-3); }
  .am-d.today b { color: var(--primary); }
  .am-d.on { background: var(--primary); color: #fff; }
  .am-d.on b, .am-d.on i { color: #fff; }
  .am-hd { display: flex; align-items: center; gap: 8px; padding: 12px 14px 4px; font-weight: 600; font-size: 14px; }
  .am-hd .hol { font-size: 11px; color: #16a34a; font-weight: 400; }
  .am-hd .c-muted { margin-left: auto; font-weight: 400; font-size: 12px; }
  .am-it { display: grid; grid-template-columns: 46px 3px 1fr auto; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px dashed var(--border-2); cursor: pointer; }
  .am-it .tm { font-weight: 600; font-size: 14px; line-height: 1.2; }
  .am-it .tm small { display: block; font-weight: 400; font-size: 11px; color: var(--text-3); }
  .am-it .bar { align-self: stretch; border-radius: 3px; }
  .am-c { min-width: 0; }
  .am-c .t { font-size: 14px; font-weight: 500; }
  .am-c .s { font-size: 12px; color: var(--text-3); margin-top: 2px; }
  .am-add { display: flex; width: calc(100% - 28px); margin: 14px 14px 0; justify-content: center; gap: 6px; }
}

/* 「在线体验」标记：桌面放在侧栏底部空白处（本周课次卡片上方），窄屏挂在顶栏下沿右侧，不压正文 */
@media (min-width: 861px) {
  .demo-badge { left: 14px; right: auto; bottom: 158px; font-size: 11.5px; box-shadow: none; background: #fafafa; }
}
@media (max-width: 860px) {
  .demo-badge { top: 60px; bottom: auto; right: 12px; font-size: 10px; line-height: 15px; padding: 0 8px; border-radius: 0 0 6px 6px; border-top: 0; box-shadow: none; background: rgba(255, 255, 255, .96); z-index: 19; letter-spacing: .3px; }
}
