/* 高一学习站 · 玫粉主题 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --brand: #D4537E;
  --brand-deep: #993556;
  --brand-dark: #72243E;
  --brand-soft: #FBEAF0;
  --brand-line: #F4C0D1;
  --bg: #FCF9FA;
  --card: #FFFFFF;
  --line: #F5EBEF;
  --line2: #EADDE3;
  --ink: #1F1F1D;
  --ink2: #5F5E5A;
  --ink3: #9A9A94;
  --ok: #0B5A46;
  --ok-soft: #E1F5EE;
  --err: #A32D2D;
  --err-soft: #FCEBEB;
  --warn: #854F0B;
  --warn-soft: #FAEEDA;
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

html, body { height: 100%; }

body {
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

#app { min-height: 100%; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--brand-deep); text-decoration: none; }

/* ---------- 布局骨架 ---------- */

.shell { display: flex; flex-direction: column; min-height: 100vh; }
.main { flex: 1; padding-bottom: calc(68px + var(--safe-b)); }
.main.no-tab { padding-bottom: 24px; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 12px 18px 13px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
}
.topbar .r1 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.topbar h1 { font-size: 18px; font-weight: 600; letter-spacing: -.2px; }
.topbar .sub { font-size: 12.5px; color: var(--ink3); margin-top: 2px; }
.iconbtn {
  width: 34px; height: 34px; border-radius: 10px; background: #FAF4F7;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--ink2); flex: 0 0 34px;
}
.iconbtn:active { background: var(--brand-soft); }

.pad { padding: 14px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(58px + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  display: flex; align-items: center;
}
.tab { flex: 1; text-align: center; font-size: 10.5px; color: #B4B2A9; padding: 6px 0; }
.tab .ico { display: block; font-size: 18px; line-height: 1.2; margin-bottom: 1px; }
.tab.on { color: var(--brand); font-weight: 600; }

/* ---------- 通用组件 ---------- */

.card {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  border: 1px solid var(--line); margin-bottom: 12px;
}
.card.flush { padding: 0; overflow: hidden; }

.hero {
  background: var(--brand); color: #fff; border-radius: 16px;
  padding: 18px; margin-bottom: 12px; position: relative; min-height: 104px;
}
.hero .num { font-size: 36px; font-weight: 600; line-height: 1.05; letter-spacing: -1px; }
.hero .lbl { font-size: 13px; margin-top: 4px; }
.hero .go {
  position: absolute; right: 16px; bottom: 16px;
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.4);
  color: #fff; font-size: 13px; padding: 7px 16px; border-radius: 999px;
}
.hero .go:active { background: rgba(255,255,255,.32); }

.sec { font-size: 13px; font-weight: 600; color: var(--ink2); margin: 16px 2px 8px; display: flex; justify-content: space-between; align-items: baseline; }
.sec span:last-child { font-weight: 400; color: var(--ink3); font-size: 12px; }

.btn {
  display: block; width: 100%; border-radius: 12px; padding: 14px;
  font-size: 15px; font-weight: 500; background: var(--brand); color: #fff;
  text-align: center;
}
.btn:active { background: #C4456F; }
.btn.ghost { background: #fff; color: var(--brand-deep); border: 1px solid var(--brand-line); }
.btn.ghost:active { background: var(--brand-soft); }
.btn.soft { background: #F8F1F4; color: var(--ink); }
.btn.sm { padding: 10px; font-size: 14px; border-radius: 10px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-row { display: flex; gap: 10px; margin-top: 10px; }
.btn-row .btn { flex: 1; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; padding: 6px 14px; border-radius: 999px;
  background: #F8F1F4; color: var(--ink2); border: 1px solid transparent; white-space: nowrap;
}
.chip.on { background: var(--brand); color: #fff; }
.chips-scroll { display: flex; gap: 7px; overflow-x: auto; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.chips-scroll::-webkit-scrollbar { height: 0; }
.chips-wrap { display: flex; gap: 7px; flex-wrap: wrap; }

.field { background: #fff; border-radius: 12px; padding: 13px 15px; margin-bottom: 10px; border: 1px solid var(--line); }
.field > .lb { font-size: 12px; color: var(--ink3); margin-bottom: 7px; }
.field input[type=text], .field input[type=date], .field input[type=number], .field textarea, .field select {
  width: 100%; border: none; outline: none; background: transparent; font-size: 15px; resize: vertical;
}
.field textarea { min-height: 64px; line-height: 1.6; }

.pick { font-size: 13px; padding: 6px 13px; border-radius: 8px; background: #F8F1F4; color: var(--ink2); border: 1px solid transparent; }
.pick.on { background: var(--brand-soft); color: var(--brand-deep); border-color: var(--brand-line); font-weight: 500; }

.empty { text-align: center; padding: 56px 20px; color: var(--ink3); font-size: 13.5px; line-height: 1.9; }

.tag { font-size: 11px; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.tag.sub { background: #E6F1FB; color: #185FA5; }
.tag.cause { background: var(--warn-soft); color: var(--warn); }
.tag.due { background: #FAECE7; color: #993C1D; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.none { background: var(--err-soft); color: var(--err); }

/* ---------- 登录 ---------- */

.login-wrap { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 32px 24px; max-width: 420px; margin: 0 auto; }
.login-logo { width: 60px; height: 60px; border-radius: 18px; background: var(--brand-soft); display: flex; align-items: center; justify-content: center; font-size: 28px; margin-bottom: 18px; }
.login-wrap h1 { font-size: 24px; font-weight: 600; letter-spacing: -.4px; }
.login-wrap .tip { color: var(--ink3); font-size: 13.5px; margin: 8px 0 26px; }
.login-wrap .field { background: #fff; }
.login-wrap .btn { margin-top: 18px; }
.login-err { color: var(--err); font-size: 13px; margin-top: 12px; min-height: 20px; }

/* ---------- 任务 ---------- */

.task { display: flex; align-items: flex-start; gap: 11px; padding: 13px 0; border-bottom: 1px solid #F8F1F4; }
.task:last-child { border-bottom: none; }
.task .ck {
  width: 21px; height: 21px; flex: 0 0 21px; border-radius: 50%;
  border: 1.5px solid #D3D1C7; margin-top: 1px; position: relative; background: #fff;
}
.task.done .ck { background: var(--brand); border-color: var(--brand); }
.task.done .ck::after {
  content: ""; position: absolute; left: 6.5px; top: 2.5px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.task .tx { flex: 1; min-width: 0; }
.task .nm { font-size: 14.5px; }
.task.done .nm { color: #B4B2A9; text-decoration: line-through; }
.task .mt { font-size: 12px; color: var(--ink3); margin-top: 2px; }
.task .del { color: #D3D1C7; font-size: 15px; padding: 0 2px; }

/* ---------- 错题 ---------- */

.mitem {
  background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px;
  border: 1px solid var(--line);
}
.mitem:active { background: #FDFAFB; }
.mitem .q {
  font-size: 14px; line-height: 1.55; color: #2C2C2A;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mitem .q.no-text { color: var(--ink3); font-style: italic; }
.mitem .tags { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.mitem .thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: #F8F1F4; float: right; margin-left: 10px; }

.ans { border-radius: 12px; padding: 13px 15px; margin-bottom: 10px; font-size: 14px; line-height: 1.65; }
.ans.wrong { background: var(--err-soft); color: var(--err); }
.ans.right { background: var(--ok-soft); color: var(--ok); }
.ans .lb { font-size: 11.5px; font-weight: 600; opacity: .85; margin-bottom: 5px; letter-spacing: .3px; }

.note { background: var(--warn-soft); border-radius: 12px; padding: 13px 15px; font-size: 13.5px; color: #633806; line-height: 1.7; }

.qimg { width: 100%; display: block; border-radius: 12px 12px 0 0; background: #F8F1F4; }

/* ---------- 拍照 ---------- */

.camzone {
  border: 1.5px dashed #E2D5DB; border-radius: 14px; background: #fff;
  padding: 46px 16px; text-align: center; margin-bottom: 12px;
}
.camzone:active { background: var(--brand-soft); }
.camzone .big { font-size: 32px; color: var(--brand); margin-bottom: 10px; line-height: 1; }
.camzone .t1 { font-size: 15px; font-weight: 500; }
.camzone .t2 { font-size: 12.5px; color: var(--ink3); margin-top: 6px; }

.preview { position: relative; margin-bottom: 12px; }
.preview img { width: 100%; border-radius: 12px; display: block; }
.preview .re {
  position: absolute; right: 10px; bottom: 10px; background: rgba(31,31,29,.72);
  color: #fff; font-size: 12.5px; padding: 6px 13px; border-radius: 999px;
}

/* ---------- 成绩 ---------- */

.score-bar { display: flex; align-items: center; padding: 11px 0; border-bottom: 1px solid #F8F1F4; font-size: 14px; }
.score-bar:last-child { border-bottom: none; }
.score-bar .n { width: 48px; color: var(--ink2); flex: 0 0 48px; }
.score-bar .b { flex: 1; height: 6px; background: #F5EBEF; border-radius: 3px; margin: 0 12px; overflow: hidden; }
.score-bar .b i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.score-bar .v { width: 48px; text-align: right; font-weight: 600; flex: 0 0 48px; }

.chart-wrap { background: #fff; border-radius: var(--radius); padding: 16px 10px 6px; border: 1px solid var(--line); margin-bottom: 12px; }

/* ---------- 弹层 ---------- */

.sheet-mask {
  position: fixed; inset: 0; background: rgba(31,31,29,.42); z-index: 60;
  display: flex; align-items: flex-end;
}
.sheet {
  width: 100%; background: #fff; border-radius: 18px 18px 0 0;
  padding: 18px 18px calc(18px + var(--safe-b)); max-height: 88vh; overflow-y: auto;
}
.sheet h3 { font-size: 16px; font-weight: 600; margin-bottom: 14px; }

.toast {
  position: fixed; left: 50%; bottom: calc(90px + var(--safe-b));
  transform: translateX(-50%) translateY(10px);
  background: rgba(31,31,29,.92); color: #fff; font-size: 13.5px;
  padding: 10px 18px; border-radius: 10px; opacity: 0; pointer-events: none;
  transition: all .2s; z-index: 80; max-width: 80vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.spin { text-align: center; padding: 50px 0; color: var(--ink3); font-size: 13px; }
