/* 好分数 Windows 版 —— 界面样式 */

:root {
  --bg: #0b0e14;
  --bg-soft: #0e121a;
  --panel: #121722;
  --panel-2: #161c28;
  --panel-3: #1b2230;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #e9edf5;
  --text-2: #aab4c5;
  --muted: #7d8798;
  --gold: #f2c14e;
  --gold-strong: #e5a93a;
  --gold-soft: rgba(242, 193, 78, 0.12);
  --red: #ef6b62;
  --green: #4cc38a;
  --blue: #6aa2ff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  --titlebar: 52px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); background-clip: content-box; }

.app { height: 100vh; display: flex; flex-direction: column; }

/* ---------------- 标题栏 ---------------- */
.titlebar {
  height: var(--titlebar);
  flex: 0 0 var(--titlebar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 160px 0 18px; /* 右侧给系统窗口按钮留位置 */
  background: rgba(11, 14, 20, 0.86);
  border-bottom: 1px solid var(--line);
  -webkit-app-region: drag;
  user-select: none;
}

.titlebar__brand { display: flex; align-items: center; gap: 10px; }

.logo-mark {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, #ffd874, var(--gold-strong));
  color: #2a1d00;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0;
  box-shadow: 0 4px 14px rgba(229, 169, 58, 0.35);
}

.logo-mark--lg { width: 54px; height: 54px; border-radius: 16px; font-size: 26px; }

.titlebar__name { font-weight: 600; letter-spacing: 0.5px; }
.titlebar__tag {
  font-size: 11px; color: var(--muted);
  border: 1px solid var(--line-strong);
  padding: 1px 7px; border-radius: 20px;
}

.titlebar__actions { display: flex; align-items: center; gap: 8px; -webkit-app-region: no-drag; }

.icon-btn {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; color: var(--text-2);
}
.icon-btn:hover { background: var(--panel-3); color: var(--text); }

.badge {
  font-size: 11px; padding: 2px 8px; border-radius: 20px;
  background: var(--gold-soft); color: var(--gold);
  border: 1px solid rgba(242, 193, 78, 0.28);
}

/* ---------------- 登录 ---------------- */
.login {
  flex: 1; position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px;
  padding: 24px;
  overflow: hidden;
}

.login__glow {
  position: absolute; inset: -20% -10% auto -10%;
  height: 70%;
  background:
    radial-gradient(60% 60% at 30% 20%, rgba(242, 193, 78, 0.14), transparent 70%),
    radial-gradient(50% 50% at 75% 10%, rgba(106, 162, 255, 0.1), transparent 70%);
  pointer-events: none;
}

.login__card {
  position: relative;
  width: 420px;
  padding: 34px 36px 26px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(24, 30, 42, 0.96), rgba(17, 22, 31, 0.96));
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  animation: rise 0.35s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.login__head { text-align: center; margin-bottom: 24px; }
.login__head h1 { font-size: 20px; margin: 14px 0 6px; font-weight: 600; }
.login__head p { margin: 0; color: var(--muted); font-size: 13px; }

.form { display: flex; flex-direction: column; gap: 15px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field__label { font-size: 12.5px; color: var(--text-2); }

.field__input {
  height: 42px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  background: #0c1017;
  border: 1px solid var(--line-strong);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field__input::placeholder { color: #596273; }
.field__input:focus { border-color: rgba(242, 193, 78, 0.55); box-shadow: 0 0 0 3px rgba(242, 193, 78, 0.1); }

.segmented {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px; background: #0c1017; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}
.segmented__item {
  height: 32px; border-radius: 7px; color: var(--text-2); font-size: 13px;
  transition: background 0.15s, color 0.15s;
}
.segmented__item:hover { color: var(--text); }
.segmented__item.is-active { background: var(--panel-3); color: var(--gold); font-weight: 600; }

.check { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12.5px; }
.check input { accent-color: var(--gold-strong); width: 14px; height: 14px; }

.btn {
  height: 42px; padding: 0 18px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; transition: filter 0.15s, background 0.15s, transform 0.05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: linear-gradient(180deg, #ffd269, var(--gold-strong));
  color: #2b1e00; font-weight: 600;
  box-shadow: 0 8px 22px rgba(229, 169, 58, 0.24);
}
.btn--primary:hover { filter: brightness(1.05); }
.btn--primary:disabled { filter: grayscale(0.35) brightness(0.8); cursor: default; }
.btn--block { width: 100%; }
.btn--ghost { background: var(--panel-2); border: 1px solid var(--line-strong); color: var(--text-2); }
.btn--ghost:hover { background: var(--panel-3); color: var(--text); }
.btn--sm { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }

.btn__spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.25); border-top-color: #2b1e00;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.alert {
  padding: 9px 12px; border-radius: var(--radius-sm);
  background: rgba(239, 107, 98, 0.1);
  border: 1px solid rgba(239, 107, 98, 0.28);
  color: #ffb4ae; font-size: 12.5px;
}
.alert--ok { background: rgba(76, 195, 138, 0.1); border-color: rgba(76, 195, 138, 0.28); color: #a6e8c6; }

.login__foot {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 12px; color: var(--muted);
}
.login__foot .dot { opacity: 0.5; }
.link { color: var(--gold); font-size: 12px; padding: 0; }
.link:hover { text-decoration: underline; }

.login__note { position: relative; margin: 0; font-size: 11.5px; color: #5d6678; }

/* ---------------- 主框架 ---------------- */
.main { flex: 1; display: flex; min-height: 0; }

.sidebar {
  width: 224px; flex: 0 0 224px;
  display: flex; flex-direction: column;
  padding: 14px 12px 16px;
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
}

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav__item {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 12px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 13.5px; text-align: left;
  transition: background 0.15s, color 0.15s;
}
.nav__item:hover { background: var(--panel); color: var(--text); }
.nav__item.is-active { background: var(--gold-soft); color: var(--gold); font-weight: 600; }
.nav__item svg { flex: 0 0 auto; opacity: 0.9; }

.sidebar__user {
  margin-top: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 8px; border-top: 1px solid var(--line);
}
.avatar {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--panel-3); color: var(--gold); font-weight: 600;
}
.sidebar__user-info { min-width: 0; }
.sidebar__user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ghost-btn {
  margin-top: 4px; height: 32px; border-radius: 8px;
  color: var(--muted); font-size: 12.5px;
}
.ghost-btn:hover { background: var(--panel); color: var(--text-2); }

.sidebar__actions { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.side-btn {
  height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 13px;
}
.side-btn--gold {
  background: var(--gold-soft);
  border: 1px solid rgba(242, 193, 78, 0.45);
  color: var(--gold); font-weight: 600;
}
.side-btn--gold:hover { background: rgba(242, 193, 78, 0.2); }
.side-btn--plain {
  background: var(--panel-2);
  border: 1px solid var(--line-strong);
  color: var(--text-2);
}
.side-btn--plain:hover { background: var(--panel-3); color: var(--text); }

.content { flex: 1; min-width: 0; overflow-y: auto; padding: 26px 32px 48px; }
.pane { max-width: 1080px; margin: 0 auto; }

.pane__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.pane__head h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: 0.2px; }
.pane__sub { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.pane__tools { display: flex; align-items: center; gap: 10px; }

.search {
  width: 240px; height: 36px; padding: 0 12px;
  border-radius: 10px; background: var(--panel); border: 1px solid var(--line);
  outline: none; font-size: 13px;
}
.search:focus { border-color: rgba(242, 193, 78, 0.45); }
.search::placeholder { color: #5a6373; }

/* ---------------- 成绩卡片 ---------------- */
.exam-list { display: flex; flex-direction: column; gap: 10px; }

.exam-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  transition: border-color 0.15s, transform 0.12s, background 0.15s;
  animation: rise 0.3s ease both;
}
.exam-card:hover { border-color: rgba(242, 193, 78, 0.35); background: var(--panel-2); transform: translateY(-1px); }

.exam-date {
  text-align: center; padding-right: 16px;
  border-right: 1px solid var(--line);
}
.exam-date__day { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.exam-date__ym { font-size: 11px; color: var(--muted); }

.exam-main { min-width: 0; }
.exam-title { font-size: 15px; font-weight: 600; margin: 0 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exam-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.chip {
  font-size: 11px; padding: 1px 7px; border-radius: 6px;
  background: var(--panel-3); color: var(--text-2);
}
.chip--gold { background: var(--gold-soft); color: var(--gold); }

.exam-right { display: flex; align-items: center; gap: 22px; }
.exam-score { text-align: right; min-width: 92px; }
.exam-score__value { font-size: 24px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; line-height: 1.1; }
.exam-score__value small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.exam-score__label { font-size: 11px; color: var(--muted); }

.exam-ranks { display: flex; gap: 18px; }
.rank-mini { text-align: center; min-width: 54px; }
.rank-mini b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.rank-mini span { font-size: 11px; color: var(--muted); }

.arrow { color: #4d5566; }

.empty { text-align: center; padding: 60px 0; color: var(--muted); }
.empty__icon { font-size: 34px; opacity: 0.6; margin-bottom: 8px; }
.empty p { margin: 0 0 4px; color: var(--text-2); }

/* ---------------- 详情 ---------------- */
.detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.back-btn {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--line); color: var(--text-2);
}
.back-btn:hover { color: var(--text); background: var(--panel-2); }
.detail-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.detail-head .pane__sub { margin-top: 2px; }

.hero {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px;
  padding: 22px 24px; margin-bottom: 14px;
  border-radius: var(--radius);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(242, 193, 78, 0.14), transparent 55%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-strong);
}
.hero__label { font-size: 12px; color: var(--muted); letter-spacing: 0.4px; }
.hero__score { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 10px; }
.hero__score b { font-size: 56px; line-height: 1.05; color: var(--gold); font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.hero__score span { color: var(--muted); font-size: 14px; }
.hero__tags { display: flex; gap: 8px; flex-wrap: wrap; }

.rank-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-content: center; }
.rank-box {
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
}
.rank-box__value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rank-box__value small { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 2px; }
.rank-box__label { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.rank-box--gold .rank-box__value { color: var(--gold); }

.card {
  padding: 18px 20px; margin-bottom: 14px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
}
.card h3 { margin: 0 0 2px; font-size: 14.5px; font-weight: 600; }
.card__sub { margin: 0 0 14px; color: var(--muted); font-size: 12px; }

.chart-card__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.chart-card canvas { width: 100%; display: block; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 12px;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.045); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.table .strong { font-weight: 600; }
.table .gold { color: var(--gold); font-weight: 600; }
.table .weak { color: var(--red); }
.table .good { color: var(--green); }
.table--clickable tbody tr { cursor: pointer; }

.subject-name { display: flex; align-items: center; gap: 8px; }
.subject-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); opacity: 0.8; }

.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.bar-track { flex: 1; height: 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--gold-strong), var(--gold)); }
.bar-fill--low { background: linear-gradient(90deg, #c25049, var(--red)); }

.detail-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }

/* 详情子页 Tab */
.detail-tabs {
  display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap;
}
.detail-tab {
  height: 34px; padding: 0 16px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--text-2); font-size: 13px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.detail-tab:hover { color: var(--text); background: var(--panel-2); }
.detail-tab.is-active {
  background: var(--gold-soft); color: var(--gold);
  border-color: rgba(242, 193, 78, 0.45); font-weight: 600;
}

/* 科目 pill 多选 */
.subject-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  height: 32px; padding: 0 14px; border-radius: 20px;
  background: var(--panel); border: 1px solid var(--line-strong);
  color: var(--text-2); font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.15s;
}
.pill:hover { color: var(--text); border-color: rgba(242, 193, 78, 0.4); }
.pill.is-active {
  background: var(--gold-soft); color: var(--gold);
  border-color: rgba(242, 193, 78, 0.5); font-weight: 600;
}
.pill-badge {
  background: rgba(239, 107, 98, 0.18); color: var(--red);
  border-radius: 10px; font-size: 11px; padding: 0 6px; line-height: 16px;
}

/* 表格行高亮（我所在行） */
.row-me { background: rgba(242, 193, 78, 0.07); }
.row-me td { border-bottom-color: rgba(242, 193, 78, 0.12); }

.bar-track--gold { outline: 1px solid rgba(242, 193, 78, 0.35); outline-offset: 1px; border-radius: 5px; }

/* 图片网格与放大 */
.pic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.pic-thumb {
  padding: 0; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--panel-2);
  aspect-ratio: 3 / 4; display: block;
}
.pic-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pic-thumb:hover { border-color: rgba(242, 193, 78, 0.4); }
.img-overlay {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(4, 7, 12, 0.88);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 30px;
}
.img-overlay img { max-width: 92%; max-height: 86vh; object-fit: contain; border-radius: 8px; }

.plain-list { margin: 8px 0 0; padding-left: 20px; color: var(--text-2); display: flex; flex-direction: column; gap: 7px; }
.plain-list li { line-height: 1.6; }
.plain-list b { color: var(--text); }

/* ---------------- 设置 ---------------- */
.settings-card { padding: 4px 20px; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.row:last-child { border-bottom: 0; }
.row > span { color: var(--text-2); }
.row > b { font-weight: 500; }
.row--action { padding-right: 0; }

/* ---------------- 弹层 ---------------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; }
.modal__mask { position: absolute; inset: 0; background: rgba(5, 8, 14, 0.62); backdrop-filter: blur(2px); }
.modal__card {
  position: relative; width: 400px; max-height: 70vh; overflow-y: auto;
  padding: 22px 24px; border-radius: 16px;
  background: linear-gradient(180deg, #1a2130, #141a26);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  animation: rise 0.25s ease both;
}
.modal__card h3 { margin: 0 0 4px; font-size: 16px; }
.modal__foot { display: flex; justify-content: flex-end; margin-top: 16px; }

.modal__tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: #0c1017; border: 1px solid var(--line-strong); border-radius: 10px; margin-bottom: 12px; }
.modal__tab { height: 30px; border-radius: 7px; color: var(--text-2); font-size: 13px; }
.modal__tab.is-active { background: var(--panel-3); color: var(--gold); font-weight: 600; }

.student-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.student-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line);
  text-align: left; width: 100%;
  transition: border-color 0.15s, background 0.15s;
}
.student-item:hover { border-color: rgba(242, 193, 78, 0.4); background: var(--panel-2); }
.student-item.is-current { border-color: rgba(242, 193, 78, 0.55); background: var(--gold-soft); }
.student-item .avatar { flex: 0 0 auto; }
.student-item__name { font-weight: 600; font-size: 14px; }
.student-item__meta { font-size: 12px; color: var(--muted); }
.student-item__tag {
  margin-left: auto; font-size: 11px; color: var(--gold);
  border: 1px solid rgba(242, 193, 78, 0.35); padding: 1px 8px; border-radius: 20px;
}

/* 本地存档卡片 */
.record-flag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--blue);
}
.est-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text-2);
  background: rgba(106, 162, 255, 0.1);
  border: 1px solid rgba(106, 162, 255, 0.3);
  padding: 1px 8px; border-radius: 20px;
}

.account-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.account-item:last-child { border-bottom: 0; }
.account-item__name { font-weight: 600; }
.account-item__meta { color: var(--muted); font-size: 12px; }
.account-item__actions { margin-left: auto; display: flex; gap: 6px; }

/* ---------------- 提示 ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 42px; transform: translate(-50%, 12px);
  padding: 10px 18px; border-radius: 10px;
  background: #1d2431; border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); font-size: 13px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
  max-width: 70vw;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast--error { border-color: rgba(239, 107, 98, 0.4); color: #ffb4ae; }

@media (max-width: 1120px) {
  .hero { grid-template-columns: 1fr; }
  .exam-right { gap: 12px; }
  .exam-ranks { display: none; }
}

/* ---------------- 逐题查看 / 错题展开 / 班级成绩单 ---------------- */

/* 逐题查看卡片：题号 + 分数徽章 + 裁剪图 */
.q-crop-item { display: flex; flex-direction: column; gap: 6px; }
.q-crop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.q-crop-item .pic-thumb { width: 100%; aspect-ratio: auto; min-height: 90px; max-height: 260px; }
.q-crop-item .pic-thumb img { object-fit: contain; background: #fff; }
.score-badge {
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 1px 8px;
}
.score-badge small { color: var(--text-2); font-weight: 400; }
.score-badge.good { color: var(--green); border-color: rgba(76, 195, 138, 0.4); }
.score-badge.weak { color: var(--red); border-color: rgba(239, 107, 98, 0.4); }
.q-noimg {
  border: 1px dashed var(--line); border-radius: 10px; padding: 14px 10px;
  text-align: center; color: var(--text-2); font-size: 12.5px; background: var(--panel-2);
}
.q-noimg b { color: var(--text); }

/* 错题失分明细：可展开行（查看原题） */
.lost-row { cursor: pointer; }
.lost-row:hover td { background: rgba(255, 255, 255, 0.03); }
.lost-detail-row > td { padding: 0 12px 12px; background: rgba(255, 255, 255, 0.02); }
.lost-detail-row .pic-thumb { width: 300px; height: auto; aspect-ratio: auto; }
.lost-detail-row .pic-thumb img { object-fit: contain; background: #fff; }
.lost-link { color: var(--gold); cursor: pointer; font-size: 12px; white-space: nowrap; }
.lost-link:hover { text-decoration: underline; }

/* 班级成绩单开关卡片 */
.class-report-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bar-fill--me { background: linear-gradient(90deg, var(--gold), #ffd98a); }

/* ================= 安卓/移动端适配（Capacitor WebView，宽度 < 768px） ================= */
@media (max-width: 768px) {
  /* ---------- 滚动模式切换：整页自然滚动 ---------- */
  html, body { height: auto !important; overflow: visible !important; }
  body { font-size: 14px; overflow-y: auto !important; -webkit-overflow-scrolling: touch; }
  .app:not(.hidden), .main:not(.hidden) { display: block !important; padding: 0 !important; height: auto !important; min-height: 100vh; overflow: visible !important; }
  .main.hidden, .app.hidden { display: none !important; }

  /* 桌面标题栏隐藏 */
  .titlebar { display: none !important; }

  /* ---------- 顶部导航条（fixed，两行：品牌 + 图标导航） ---------- */
  .sidebar {
    position: fixed !important;
    top: 0; left: 0; right: 0; bottom: auto;
    width: 100% !important;
    height: auto !important;
    display: block !important;
    padding: 0 !important;
    z-index: 100;
    background: rgba(13, 17, 24, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  /* 品牌行 */
  .sidebar::before {
    content: '好分数';
    display: block;
    padding: 9px 14px 7px;
    font-weight: 700;
    font-size: 15px;
    color: var(--gold);
    letter-spacing: 1px;
  }
  /* 隐藏桌面版元素 */
  .sidebar__user, .sidebar__actions, .sidebar__label { display: none !important; }
  /* 导航行：图标 + 小字，等宽分布 */
  .sidebar .nav {
    display: flex !important;
    flex-direction: row !important;
    gap: 0 !important;
    padding: 0 4px 6px !important;
  }
  .sidebar .nav__item {
    flex: 1 1 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 2px !important;
    padding: 6px 2px !important;
    font-size: 10.5px !important;
    border-radius: 10px !important;
    min-height: 46px !important;
  }
  .sidebar .nav__item svg { width: 19px; height: 19px; }
  .sidebar .nav__item.is-active { background: var(--gold-soft); color: var(--gold); }

  /* ---------- 主内容区 ---------- */
  .content {
    margin-top: 92px !important;
    padding: 12px 12px 40px !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }
  .pane { overflow: visible !important; height: auto !important; }
  /* 登录视图 */
  .login:not(.hidden) {
    overflow-y: auto !important; height: auto !important; min-height: 100vh;
    padding: 24px 16px !important; display: flex !important;
  }
  .login.hidden { display: none !important; }
  .login input { font-size: 16px !important; min-height: 46px !important; }
  .login__card { max-width: 100% !important; width: 100% !important; }

  /* ---------- 成绩列表卡片 ---------- */
  .exam-card {
    display: block !important;
    padding: 12px 14px !important;
    margin-bottom: 10px !important;
  }
  .exam-card .exam-right { display: none !important; }
  .exam-title { white-space: normal !important; font-size: 15px !important; }
  .exam-meta { flex-wrap: wrap !important; gap: 6px !important; }

  /* ---------- 详情页 hero ---------- */
  .hero { grid-template-columns: 1fr !important; gap: 12px !important; padding: 14px !important; }
  .hero__score b { font-size: 36px !important; }
  .rank-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  .rank-box { padding: 10px !important; }
  .rank-box__value { font-size: 18px !important; }
  .rank-box__label { font-size: 10.5px !important; }

  /* ---------- 详情子页 tabs 吸顶 ---------- */
  .detail-tabs {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    background: rgba(13, 17, 24, 0.97);
    backdrop-filter: blur(8px);
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    margin: 0 -12px !important;
    padding: 0 12px !important;
    border-bottom: 1px solid var(--line);
  }
  .detail-tab { padding: 10px 12px !important; font-size: 12.5px !important; flex: 0 0 auto !important; min-height: 42px !important; }

  /* ---------- 表格 ---------- */
  .table-wrap { overflow-x: auto !important; -webkit-overflow-scrolling: touch; margin: 0 -12px !important; padding: 0 12px !important; }
  .table { font-size: 12px !important; min-width: 460px; }
  .table th, .table td { padding: 7px 7px !important; white-space: nowrap; }

  /* ---------- 卡片 ---------- */
  .card { padding: 12px !important; margin-bottom: 10px !important; border-radius: 12px !important; }
  .card h3 { font-size: 15px !important; }
  .card__sub { font-size: 11px !important; }

  /* ---------- 按钮/表单 ---------- */
  .btn { min-height: 42px !important; padding: 9px 14px !important; font-size: 13.5px !important; }
  .btn--sm { min-height: 36px !important; padding: 7px 11px !important; font-size: 12.5px !important; }
  .btn, .nav__item, .exam-card, .link, .detail-tab, input, select { -webkit-tap-highlight-color: transparent; }
  input, select { min-height: 42px !important; font-size: 14px !important; }

  /* ---------- 弹窗/抽屉（:not(.hidden) 防止覆盖关闭状态） ----------
     移动端改为 absolute + 顶部对齐：键盘弹出时页面可滚动，输入框不被遮挡 */
  .modal:not(.hidden) {
    position: absolute !important;
    display: block !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .modal.hidden { display: none !important; }
  .modal__box, .modal__card {
    position: relative !important;
    margin: 60px 12px 40px !important;
    max-height: none !important;
    max-width: 100% !important;
    width: auto !important;
    border-radius: 14px !important;
  }
  /* 输入框：大触摸目标，聚焦时高亮 */
  .modal__box input, .modal__card input { min-height: 46px !important; font-size: 16px !important; width: 100% !important; }

  /* ---------- 图表 ---------- */
  .chart-card canvas { max-width: 100% !important; }
  .chart-card__head { flex-wrap: wrap !important; gap: 8px !important; }
  .chart-card__head h3 { font-size: 14px !important; }

  /* ---------- 子页头部 ---------- */
  .pane__head { flex-wrap: wrap !important; gap: 8px !important; }
  .pane__head h2 { font-size: 17px !important; }
  .pane__sub { font-size: 11.5px !important; }}

/* ---------- 超小屏（<380px） ---------- */
@media (max-width: 380px) {
  .rank-grid { grid-template-columns: 1fr 1fr !important; }
  .rank-box__value { font-size: 16px !important; }
  .table { font-size: 11px !important; min-width: 420px; }
  .sidebar .nav__item { font-size: 9.5px !important; }
  .hero__score b { font-size: 30px !important; }
}/* 超小屏（<380px）进一步压缩 */
@media (max-width: 380px) {
  .rank-grid { grid-template-columns: 1fr !important; }
  .table { font-size: 11px !important; }
}

/* ---------------- 图片版 Logo（方案A：图表上升） ---------------- */
.logo-mark.logo-img {
  width: 26px; height: 26px;
  border-radius: 7px;
  object-fit: cover;
  box-shadow: 0 3px 10px rgba(229, 169, 58, 0.35);
  flex: 0 0 auto;
}
.logo-mark.logo-img--lg {
  width: 62px; height: 62px;
  border-radius: 16px;
  box-shadow: 0 8px 26px rgba(229, 169, 58, 0.42);
}
