/* 学习站 · 暖白与深暖灰，少量雾蓝和珊瑚色点缀。
   基础样式和首页：以排版与留白建立层次；其他页面专属布局保留。
   保留原有类名与行为钩子；首页新增 home-* 类隔离布局。 */
:root {
  --bg: #faf9f6; --card: rgba(255, 255, 255, .64);
  --ink: #3d3a37; --muted: #68635e; --subtle: #736f6b; --line: #e4e8e8; --line-strong: #c9d3d7;
  --accent: #ad5f4f; --accent-dark: #924b3e; --accent-light: #fbefea; --accent-border: #ead2c8;
  --ok: #49816d; --ok-bg: #edf5f0; --bad: #b85252; --bad-bg: #fbefed;
  --rest: #587c9d; --rest-bg: #edf3f9;
  --honey: #a78952; --honey-bg: #faf5e9; --purple: #87779e; --purple-bg: #f4f0f7;
  --r-sm: 8px; --r-md: 10px; --r-lg: 16px;
  --shadow-sm: 0 2px 10px rgba(50, 70, 85, .025);
  --shadow-md: 0 5px 18px rgba(50, 70, 85, .045);
  --shadow-lg: 0 12px 30px rgba(50, 70, 85, .08);
}
* { box-sizing: border-box; }
html { scroll-padding-top: 150px; }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--bg);
  /* 往门面（catlab）那边轻轻靠：左上一丝浅蓝、右下一丝蜜桃，比门面淡，里面保持安静 */
  background-image: linear-gradient(135deg, #f5f7fb 0%, #fcfaf6 50%, #fdf4ec 100%);
  background-attachment: fixed;
}
a { color: var(--accent); text-decoration: none; text-underline-offset: 4px; }
a:hover { color: var(--accent-dark); }
:where(a, button, summary, input, select, textarea):focus-visible {
  outline: 2px solid #6c91ad; outline-offset: 4px;
}
code { background: var(--accent-light); color: var(--accent-dark); padding: 0 5px; border-radius: 5px; font-size: .88em; }
mark { background: #f5e9bb; padding: 0 4px; margin: 0 2px; border-radius: 4px; }

/* ---------- 全站导航 ---------- */
.top {
  position: sticky; top: 0; z-index: 30; padding: 0 32px;
  background: rgba(253, 250, 245, .84);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.top-inner { max-width: 1320px; min-height: 84px; margin: auto; display: flex; align-items: center; gap: 30px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-weight: 650; font-size: 1rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-text { overflow-wrap: anywhere; }
.top .brand-badge {
  flex: 0 0 34px; height: 34px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #f5ede3, #f8eee7); font-size: 1rem; box-shadow: none; animation: none;
}
.brand-img { height: 34px; max-width: 100px; object-fit: contain; border-radius: 8px; }
.top nav { display: flex; gap: 3px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.top nav::-webkit-scrollbar { display: none; }
.top nav a {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 9px 11px; min-height: 44px; border: 0; border-radius: 8px;
  color: #5b5550; font-size: .94rem; font-weight: 550; white-space: nowrap;
  transition: background-color .18s, color .18s;
}
.top nav .ico { font-size: .9em; }
.top nav a:hover { color: var(--ink); background: rgba(239, 229, 217, .5); }
.top nav a.on { color: var(--ink); background: #f1e9df; font-weight: 650; box-shadow: none; }
.top-meta { display: flex; align-items: center; gap: 20px; margin-left: auto; flex-shrink: 0; }
.top .date { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.top .me { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.top .me .link { min-height: 40px; font-size: inherit; }
main { max-width: 1080px; margin: 0 auto; padding: 40px 28px 80px; }

/* ---------- 全站容器、文字与反馈 ---------- */
.card { background: var(--card); border: 1px solid rgba(255, 255, 255, .75); border-radius: var(--r-lg);
  padding: 26px 28px; margin-bottom: 24px; box-shadow: var(--shadow-sm); }
.big { font-size: 1.2rem; font-weight: 650; margin: 0 0 14px; line-height: 1.5; }
.hint, .muted, .legend { color: var(--muted); }
.legend { font-size: .82rem; margin: 16px 0 0; line-height: 1.9; }
.small { font-size: .875em; }
.tag { display: inline-block; color: var(--rest); background: var(--rest-bg); margin-left: 8px; font-size: .8em; padding: 2px 8px; border-radius: 6px; font-weight: 500; }
.plus { color: var(--ok); margin-left: 8px; font-size: .9em; font-weight: 600; }
.flash { padding: 12px 16px; border-radius: var(--r-md); margin-bottom: 16px; border: 1px solid transparent; }
.flash.ok { background: var(--ok-bg); border-color: #d5e5dd; }
.flash.error { background: var(--bad-bg); border-color: #efd6d2; }
.flash.warn { background: var(--honey-bg); border-color: #e9dfc7; }
.flash.here { margin: 14px 0 0; }

/* ---------- 全站按钮和表单 ---------- */
button { font: inherit; font-size: .92rem; font-weight: 550; min-height: 42px; padding: 8px 16px;
  border-radius: var(--r-md); border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .72);
  color: var(--ink); cursor: pointer; transition: background-color .18s, border-color .18s, color .18s; }
button:hover { background: #fff; border-color: #9cadb5; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .6; cursor: not-allowed; transform: none; }
button.start, button.stop { font-size: 1rem; min-height: 48px; padding: 11px 26px; margin-top: 8px; border: 1px solid transparent; color: #fff; }
button.start { background: #ae6453; box-shadow: 0 3px 10px rgba(142, 83, 68, .08); }
button.start:hover { background: #985444; color: #fff; }
button.stop { background: #fcf7f2; color: var(--accent-dark); border-color: #cda99b; box-shadow: none; }
button.stop:hover { background: #f6e8df; color: var(--accent-dark); border-color: #b88674; }
button.danger { color: var(--bad); border-color: #e8caca; background: #fffafa; }
button.danger:hover { background: var(--bad-bg); color: var(--bad); }
button.link { min-height: 0; border: 0; background: none; padding: 0 2px; color: var(--accent); font-weight: 500; }
button.link:hover { background: none; text-decoration: underline; }
button.unlock { margin-left: 6px; font-size: .85rem; padding: 6px 10px; }
input[type=number], input[type=date], input:not([type]), input[type=password], input[type=text], select, textarea {
  max-width: 100%; min-height: 42px; font: inherit; color: var(--ink); background: rgba(255, 255, 255, .8);
  border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 8px 12px;
  transition: border-color .18s, box-shadow .18s;
}
input:focus, select:focus, textarea:focus { border-color: #809fb5; box-shadow: 0 0 0 3px rgba(128, 159, 181, .12); }
input[type=number] { width: 5.5em; }
input[type=checkbox] { accent-color: #6488a0; }
input:disabled, textarea:disabled, select:disabled { background: #f2f3f1; color: var(--muted); }
form.inline { display: inline; }

/* ---------- 内页共用：开放分区、表单和轻边界（首页保持不变） ---------- */
.page { --line: #e6e0d8; --line-strong: #cec5bb; padding-top: 18px; }
.page-heading { margin: 0 0 30px; }
.page-heading h1, .page .page-title { margin: 0 0 24px; font-size: clamp(1.8rem, 3vw, 2.3rem); line-height: 1.4; font-weight: 600; letter-spacing: -.025em; color: var(--ink); }
.page-heading h1 { margin-bottom: 0; }
.page .card { padding: 0 0 32px; margin: 0 0 32px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; }
.page .card:last-child { border-bottom: 0; margin-bottom: 0; }
.page .big { line-height: 1.6; }
.page .big .small { font-weight: 400; font-size: .8rem; }
.page .muted, .page .legend { line-height: 1.85; }
.page .small { font-size: .875rem; }
.page p { overflow-wrap: anywhere; }
.page :is(input:not([type=hidden]):not([type=checkbox]), select, textarea) { min-height: 44px; border-color: var(--line-strong); }
.page :is(input, select, textarea) { font-size: 1rem; }
.page textarea { display: block; max-width: 100%; resize: vertical; line-height: 1.8; }
.page input[type=file] { width: 100%; max-width: 100%; min-width: 0; font-size: .875rem; padding: 8px 0; }
.page input[type=file]::file-selector-button { font: inherit; min-height: 40px; margin-right: 12px; padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fcf7f2; color: var(--ink); cursor: pointer; }
.page :is(button, summary) { min-height: 44px; }
.page button.link { padding: 6px 8px; }
.page summary { padding: 8px 0; cursor: pointer; }
.page .row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.page .bar { height: 7px; min-width: 0; background: #eae5dd; }
.page .bar i { background: #83a492; }
.page .bar.hot i { background: #c2a06e; }
.page .bar.full i { background: #c68073; }
.page .flash { max-width: 100%; font-size: .9rem; }
.page .table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #cbbfb2 transparent; }
.page .month-nav { gap: 16px; margin-bottom: 24px; }
.page .month-nav > a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 10px; font-size: .9rem; font-weight: 500; }
.page [id] { scroll-margin-top: 20px; }
@media (max-width: 700px) {
  .page { padding-top: 6px; }
  .page-heading { margin-bottom: 24px; }
  .page .card { padding-bottom: 24px; margin-bottom: 24px; }
  .page .big .small { display: block; margin-top: 6px; }
  .page .month-nav { gap: 8px; }
  .page .month-nav > a { padding: 8px 2px; font-size: .8125rem; }
  .page .month-nav .big { font-size: 1rem; text-align: center; }
}

/* ---------- 进度条 ---------- */
.bar { display: block; height: 10px; background: #F1EADF; border-radius: 999px; overflow: hidden; margin: 4px 0; min-width: 120px; }
.bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6FD3A0, var(--ok)); }
.bar.hot i { background: linear-gradient(90deg, #FFCB6B, var(--honey)); }
.bar.full i { background: linear-gradient(90deg, #FF8A8A, var(--bad)); }

/* ---------- 首页：留白、学习重点与轻量辅助信息 ---------- */
.home-page { padding-top: 18px; }
.home-heading { margin-bottom: 32px; }
.eyebrow { margin: 0 0 10px; color: var(--subtle); font-size: .8rem; letter-spacing: .14em; }
.home-heading h1 { margin: 0; font-size: clamp(1.9rem, 3vw, 2.5rem); line-height: 1.35; font-weight: 600; letter-spacing: -.035em; color: var(--ink); }
.home-page .home-today { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 30%); gap: 32px;
  padding: 4px 0 32px; margin: 0 0 28px; border: 0; border-bottom: 1px solid #e8e1d9;
  border-radius: 0; background: none; box-shadow: none; overflow: visible; }
.home-page .card.today::before, .home-page .card.today::after { content: none; }
.home-focus { min-width: 0; }
.home-stats { display: flex; flex-wrap: wrap; gap: 16px 42px; }
.home-stats > span { display: block; font-size: .875rem; font-weight: 400; color: var(--muted); }
.home-stats b { display: inline-block; padding: 0 5px; color: var(--ink); font-size: 2.15rem; line-height: 1.4; font-weight: 550; font-variant-numeric: tabular-nums; }
.home-stats > span:last-child b { color: var(--accent); }
.home-focus > .big:not(.home-stats) { font-size: 1.5rem; padding: 12px 0; }
.home-focus > form { margin-top: 24px; }
.home-focus .timer { margin-top: 24px; }
.home-focus .timer::before { content: none; }
.timer-label { display: block; color: var(--muted); font-size: .875rem; }
.timer-label::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: #729c89; vertical-align: 2px; }
.home-focus #clock { display: block; font-size: clamp(2.4rem, 5vw, 3.3rem); line-height: 1.3; color: var(--ink);
  font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: .02em; animation: none; text-shadow: none; }
.home-focus .timer > .muted { display: block; margin-top: 4px; font-size: .875rem; }
.home-focus .timer form { margin-top: 14px; }
.home-focus .forgot { margin-top: 20px; padding: 14px 16px; background: var(--honey-bg); border: 1px solid #e9dfc7; border-radius: var(--r-md); font-size: .875rem; }
.home-focus .forgot input, .home-focus .forgot button { margin-top: 8px; }
.home-aside { align-self: center; display: grid; gap: 18px; padding-left: 24px; border-left: 1px solid #e8e1d9; }
/* 图标和字连在一起写（测试按「🪙 抽奖币」「📝 打卡」整句找）；三行的 emoji 一样宽，字照样对齐 */
.home-aside .exam { margin: 0; font-size: .9rem; line-height: 1.8; }
.home-aside .exam b { font-size: 1.35rem; font-weight: 550; color: var(--ink); }
.home-aside .coin-badge { margin: 0; }
.home-aside .coin-badge a { display: block; padding: 0; background: none; border: 0; border-radius: 0; color: var(--ink); font-size: .9rem; }
.home-aside .coin-badge a b { font-size: 1.25rem; font-weight: 550; }
.home-aside .coin-badge a::after { content: none; }
.home-aside .coin-badge .small { display: block; font-size: .875rem; margin: 5px 0 0 1.6em; }
.home-aside .checkin-link { margin: 0; }
.home-aside .checkin-link a { display: inline-block; min-height: 44px; padding: 8px 0; font-weight: 500; color: var(--accent); }
.home-aside .checkin-link a::after { content: " →"; margin-left: 8px; }
.home-aside a:hover { text-decoration: underline; }
.home-calendar.card { padding: 0; border: 0; background: none; box-shadow: none; border-radius: 0; }
.calendar-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 24px; padding-right: 24px; }
.calendar-heading h2 { margin: 0; font-size: 1.2rem; font-weight: 600; }
.calendar-note { color: #5b5550; font-size: .875rem; font-weight: 500; }
.home-calendar .month-nav { justify-content: flex-start; gap: 20px; margin-bottom: 20px; }
.home-calendar .month-nav b { min-width: 140px; text-align: center; font-size: 1rem; font-weight: 550; }
.home-calendar .month-nav > a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0; color: #627f93; background: rgba(255, 255, 255, .6); border-radius: 50%; font-size: 1.3rem; }
.home-calendar .month-nav > a:hover { background: #f1e9df; }
.home-calendar .cal { border-spacing: 5px; }
.home-calendar .cal th { padding: 0 0 12px; color: var(--muted); font-size: .8rem; font-weight: 400; }
.home-calendar .cal td { height: 83px; border-color: transparent; border-radius: 10px; background: rgba(255, 255, 255, .42); transition: background-color .18s; }
.home-calendar .cal td.blank { background: none; }
.home-calendar .cal td:not(.blank):hover { transform: none; box-shadow: none; background: #f1e9df; }
.home-calendar .cal td a { padding: 10px 12px; }
.home-calendar .cal .n { color: var(--ink); font-size: .875rem; font-weight: 500; }
.home-calendar .cal .m { color: var(--muted); margin-top: 5px; font-size: .75rem; white-space: normal; overflow-wrap: anywhere; }
.home-calendar .cal td.done { background: #eaf3ef; }
.home-calendar .cal td.miss { background: #f9eeeb; }
.home-calendar .cal td.rest, .home-calendar .cal td.home { background: #eaf0f7; }
.home-calendar .cal td.studied { background: #f6f1e5; }
.home-calendar .cal td.is-today { border: 1px solid #d1af9f; background: #faf0e7; box-shadow: none; animation: none; }
.home-calendar .cal td.is-today.done { background: var(--ok-bg); }
.home-calendar .cal td.is-today.miss { background: var(--bad-bg); }
.home-calendar .cal td.is-today.rest, .home-calendar .cal td.is-today.home { background: var(--rest-bg); }
.home-calendar .cal td.is-today.studied { background: #f6f1e5; }
.home-calendar .legend { font-size: .8125rem; line-height: 2; margin-top: 14px; }
.home-calendar .legend-item { display: inline-block; margin-right: 16px; white-space: nowrap; }
.home-calendar .legend-help { white-space: normal; }

/* ---------- 月历 ---------- */
.month-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 8px; }
.month-nav > a { padding: 4px 10px; border-radius: 999px; font-weight: 600; }
.month-nav > a:hover { background: var(--accent-light); }
.cal { width: 100%; border-collapse: separate; border-spacing: 5px; table-layout: fixed; }
.cal th { color: var(--muted); font-weight: 600; font-size: .85em; padding: 2px 0; }
.cal td { background: #FCFAF7; border: 1px solid var(--line); border-radius: 12px; height: 66px; vertical-align: top; padding: 0;
  transition: transform .15s, box-shadow .15s; }
.cal td:not(.blank):hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.cal td a { display: block; height: 100%; padding: 5px 7px; color: var(--ink); }
.cal .n { display: block; font-size: .85em; font-weight: 700; color: var(--muted); }
.cal .m { display: block; font-size: .78em; white-space: nowrap; overflow: hidden; }
.cal td.blank { border: 0; background: none; }
.cal td.done { background: var(--ok-bg); border-color: #CDEBDB; }
.cal td.miss { background: var(--bad-bg); border-color: #FFD3D3; }
.cal td.rest, .cal td.home { background: var(--rest-bg); border-color: #D7E3FA; }
.cal td.studied { background: #FFFBF2; }
.cal td.future .m { color: var(--muted); }
.cal td.is-today { border: 2px solid transparent;   /* ⑤ 金粉渐变边框，光晕一呼一吸 */
  background: linear-gradient(var(--tf, #FFFDF8), var(--tf, #FFFDF8)) padding-box, linear-gradient(135deg, #FFD97A, #FF9A62, #C4A8FF) border-box;
  animation: todayglow 2.2s ease-in-out infinite; }
/* 今天这格原来的底色照留（学够了还是绿的） */
.cal td.is-today.done { --tf: var(--ok-bg); } .cal td.is-today.miss { --tf: var(--bad-bg); }
.cal td.is-today.rest, .cal td.is-today.home { --tf: var(--rest-bg); } .cal td.is-today.studied { --tf: #FFFBF2; }
@keyframes todayglow { 0%, 100% { box-shadow: 0 0 0 3px rgba(255, 214, 130, .25); }
  50% { box-shadow: 0 0 0 6px rgba(255, 214, 130, .12), 0 6px 18px rgba(255, 154, 98, .4); } }

/* ---------- 周计划：日期、时长、操作对齐 ---------- */
.uniform { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 16px; font-size: .9rem; }
.uniform .small { margin-left: 4px; }
.week { width: 100%; border-collapse: collapse; margin-top: 20px; }
.week td { border-bottom: 1px solid var(--line); padding: 18px 12px; vertical-align: middle; }
.week td.wd { width: 105px; padding-left: 0; font-weight: 550; }
.week .wd .muted { font-size: .8125rem; font-weight: 400; }
.week tr.is-today td { background: #f8efe6; }
.week tr.is-today td.wd { padding-left: 12px; }
.week tr.past td { color: var(--muted); }
.week .ops { text-align: right; }
.week .ops button { margin: 3px 0; }
.week .inline { white-space: nowrap; }
.week details { display: inline-block; max-width: 300px; text-align: left; margin-left: 10px; vertical-align: middle; }
.week details[open] { margin-top: 8px; }
.week details form { padding: 12px 0; line-height: 2; font-size: .875rem; }
.week summary { color: var(--accent); font-weight: 500; }
.week label { display: inline-block; margin-right: 8px; white-space: nowrap; }
.week label.off { color: var(--muted); }
.week .plus, .week .tag { display: inline-block; margin-top: 8px; }
.today-tag { color: var(--accent); font-size: .8rem; font-weight: 600; }
.week-cal { margin: 0; }
.week-cal summary { list-style: none; padding: 8px 14px; border-radius: 8px; background: #f1e9df; color: var(--ink); font-weight: 550; white-space: nowrap; }
.week-cal summary::-webkit-details-marker { display: none; }
.week-cal .cal-box { position: absolute; left: 50%; transform: translateX(-50%); z-index: 20; background: #fffdf9;
  border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-top: 8px; width: min(440px, 92vw); box-shadow: var(--shadow-lg); }
.mini-cal { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; font-size: .85rem; }
.mini-cal th { color: var(--muted); font-weight: 500; }
.mini-cal td { border: 1px solid transparent; border-radius: 6px; height: 48px; vertical-align: top; padding: 0; background: #f8f5ef; }
.mini-cal td a { display: block; height: 100%; padding: 3px; color: var(--ink); }
.mini-cal td.past { color: var(--muted); background: #f2efea; }
.mini-cal td.this-week { border-color: #c89c89; background: #faf0e7; }
.mini-cal td.blank { border: 0; background: none; }
.mini-cal .m { display: block; font-size: .75rem; }
.exam-form { display: block; margin: 0 0 16px; }
.exam-form summary { color: var(--accent); font-weight: 500; }
.exam-form form { padding: 12px 0; font-size: .9rem; }
@media (max-width: 700px) {
  .week { display: block; }
  .week tbody { display: block; }
  .week tr { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px 8px; padding: 18px 0; border-bottom: 1px solid var(--line); }
  .week tr.is-today { background: #f8efe6; padding: 18px 10px; border-radius: 8px; }
  .week td, .week tr.is-today td { display: block; border: 0; padding: 0; background: none; }
  .week td.wd, .week tr.is-today td.wd { width: auto; padding: 0; }
  .week .ops { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; text-align: left; }
  .week .ops .unlock { margin-left: 0; }
  .week details { margin-left: 0; max-width: 100%; }
  .week details[open] { flex-basis: 100%; }
  .week .inline { white-space: normal; }
  .week td:nth-child(2) .inline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .week-cal summary { font-size: .8125rem; padding: 8px; }
  .uniform .small { flex-basis: 100%; margin-left: 0; }
}

/* ---------- 每日记录：编辑区、照片与按日期浏览 ---------- */
.sessions { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: .9rem; }
.sessions td { border-top: 1px solid var(--line); padding: 14px 10px; vertical-align: middle; }
.sessions td:first-child { padding-left: 0; }
.sessions td:last-child { padding-right: 0; }
.page-day .sessions td:last-child { text-align: right; }
.page-day .sessions .inline { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; }
#checkin textarea { width: 100%; padding: 16px; resize: vertical; }
.page-day #checkin { max-width: 860px; }
.photos { display: flex; flex-wrap: wrap; gap: 16px; margin: 16px 0; }
.photos figure { margin: 0; width: 140px; }
.photos img { display: block; width: 140px; height: 140px; object-fit: cover; border: 1px solid var(--line); border-radius: 10px; background: #f4efe7; }
.photos figcaption { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 6px; }
.photos figcaption span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lock-bar { background: #f3eee6; border: 1px solid #e4d9ca; border-radius: 8px; padding: 12px 16px; margin: 0 0 24px; color: var(--muted); font-size: .875rem; }
.lockable.locked .card { opacity: 1; }
.timeline details { border-top: 1px solid var(--line); padding: 12px 0; overflow-x: auto; }
.timeline summary { cursor: pointer; }
.timeline summary .small { margin-left: 12px; font-size: .8125rem; }
.tl { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: .875rem; }
.tl td { padding: 10px 8px; border-top: 1px solid var(--line); white-space: nowrap; }
.tl tr.here td { background: #f8efe6; }
.tl-bar { width: 36%; }
.tl-bar .bar { margin: 0; min-width: 60px; }
.page-day .tl-bar .bar i::after { content: none; }
.tl-num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 复习卡：问题、答案、出处与 AI 补充 ---------- */
.page-cards, .page-cards-day { max-width: 900px; }
.qa { border-top: 1px solid var(--line); padding: 26px 0 30px; }
.qa label { display: block; margin: 16px 0 8px; font-size: .9rem; color: var(--ink); font-weight: 550; }
.qa label.drop, .extra label { display: inline-block; font-weight: 400; }
.qa textarea, .ocr textarea { width: 100%; padding: 12px 16px; resize: vertical; background: rgba(255, 255, 255, .72); }
.qa > button { margin: 16px 8px 0 0; }
.page-cards .qa > button:not(.danger) { color: var(--accent-dark); border-color: #d4b5a7; background: #fcf5ef; }
.extra { margin: 16px 0; padding: 14px 16px; background: #f0f3f5; border: 0; border-left: 2px solid #adc0cd; border-radius: 0 8px 8px 0; font-size: .875rem; }
.extra-text { white-space: pre-wrap; margin: 8px 0; }
.src summary { cursor: pointer; color: var(--muted); font-size: .8125rem; display: inline-block; padding: 8px 0; border: 0; background: none; }
.src-body { margin: 8px 0 16px; padding: 14px 18px; background: #f6f1e9; border-left: 2px solid #d5c4ae; border-radius: 0 8px 8px 0; }
.src-text { white-space: pre-wrap; margin: 0 0 12px; }
.src-body .photos img { width: 110px; height: 110px; }
.ocr { display: flex; align-items: flex-start; gap: 24px; margin: 20px 0; }
.ocr img { width: 220px; max-height: 340px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: #f6f1ea; }
.ocr > div { flex: 1; min-width: 0; }
.guess { margin: 10px 0 0; font-size: .875rem; color: #846637; }
.guess-warn { color: #846637; margin-left: 6px; }
/* 复习页（PLAN §3.5）：一次一张，先想、再点「看答案」、再点四档之一 */
.review-q { font-size: 1.15rem; font-weight: 550; margin: 18px 0 14px; white-space: pre-wrap; }
.review-a > summary { display: inline-block; padding: 10px 24px; border-radius: 8px; background: #ae6453; color: #fff; font-weight: 500; list-style: none; }
.review-a > summary::-webkit-details-marker { display: none; }
.review-a[open] > summary { display: none; }
.review-label { margin: 18px 0 8px; font-size: .9rem; font-weight: 550; }
.review-answer { white-space: pre-wrap; padding: 14px 16px; background: #fcf5ef; border-left: 2px solid #d4b5a7; border-radius: 0 8px 8px 0; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.grade { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 56px; }
.grade small { font-size: .75rem; color: var(--muted); }
.review-status { margin: 4px 0 0; font-size: .8125rem; color: var(--muted); }
.home-aside .review-badge { margin: 0; }
.home-aside .review-badge .small { display: block; font-size: .875rem; margin: 5px 0 0 1.6em; }
@media (max-width: 560px) { .grades { grid-template-columns: repeat(2, 1fr); } }
/* 章节目录（PLAN §3.4） */
.cards-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; margin: 4px 0 8px; }
.cards-bar .row { margin: 0; }
.toc-text { width: 100%; padding: 12px 16px; font-family: inherit; line-height: 1.7; white-space: pre; overflow-x: auto; resize: vertical; }
.toc { list-style: none; padding: 0; margin: 12px 0; }
.toc > li { border-top: 1px solid var(--line); }
.toc ul { margin: 0 0 12px; padding-left: 1.6em; }
.toc ul li { padding: 4px 0; }
/* ③ 考点查漏：没卡的节标【空】 */
.cards-links { display: inline-flex; flex-wrap: wrap; gap: 4px 16px; }
.gaps { margin: 8px 0 0; }
.gaps b { color: var(--bad); }
.gaps-switch { margin-left: 10px; white-space: nowrap; }
.empty-tag, .full-tag { display: inline-block; font-size: .8em; padding: 0 7px; border-radius: 6px; margin-left: 4px; white-space: nowrap; }
.empty-tag { color: var(--bad); background: var(--bad-bg); }
.full-tag { color: var(--ok); background: var(--ok-bg); }
.ch-pick { display: block; margin: 20px 0 6px; font-weight: 550; }
.ch-pick select { margin-left: 8px; max-width: 100%; }
@media (max-width: 700px) {
  .page-day .sessions, .page-day .sessions tbody { display: block; }
  .page-day .sessions tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 16px 0; border-top: 1px solid var(--line); }
  .page-day .sessions td { padding: 0; border: 0; }
  .page-day .sessions td:first-child { grid-column: 1 / -1; }
  .timeline summary .small { display: block; margin: 6px 0 0; }
  .tl { min-width: 500px; }
  .ocr { flex-direction: column; gap: 16px; }
  .ocr > a, .ocr > div { width: 100%; }
  .ocr img { width: 100%; }
  .qa { padding: 22px 0 26px; }
  .page-day .lock-bar .unlock { display: block; margin: 10px 0 0; }
}

/* ---------- 登录、第一次使用 ---------- */
.page .auth { max-width: 400px; margin: 36px auto 0; padding: 0; border: 0; box-shadow: none; }
.page .auth .page-title { margin-bottom: 12px; }
.page .page-title .tag { display: inline-block; vertical-align: middle; font-size: .8125rem; line-height: 1.8; letter-spacing: 0; background: #eee9e2; color: var(--muted); }
.auth label { display: block; margin: 20px 0; color: var(--ink); font-size: .9375rem; font-weight: 550; }
.auth input:not([type=checkbox]) { display: block; width: 100%; margin-top: 8px; padding: 10px 14px; }
.auth label.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 400; }
.auth button.start { width: 100%; margin-top: 8px; }

/* ---------- 设置：轻分区与统一表单 ---------- */
.page-settings .section-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: -8px 0 34px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.section-nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; color: var(--muted); font-size: .9375rem; font-weight: 550; }
.section-nav a:hover { color: var(--accent-dark); }
/* 分页：当前这页字变深、底下一道横线（压在整排的分隔线上） */
.page-settings.tabbed .section-nav { padding-bottom: 0; }
.page-settings.tabbed .section-nav a { padding: 0 2px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.page-settings.tabbed .section-nav a.on { color: var(--ink); border-bottom-color: var(--accent); }
.page-settings .set > form, .page-settings .set > .row { max-width: 820px; }
.set label { display: block; margin: 20px 0; color: var(--ink); font-size: .9375rem; font-weight: 550; }
.set input:not([type=checkbox]):not([type=file]):not([type=number]):not(.num), .set select, .set textarea {
  display: block; width: 100%; margin-top: 8px; padding: 10px 12px; }
/* 页数框（.num，10-05 晚从 type=number 换成文字框）：跟字排在同一行，不吃上面「独占一行」那条；
   .inline-row＝这一行的 label 不撑满，按钮紧跟在后面（沈菀：「右边是要开蜜雪冰城吗，这么大的地方扯五行」） */
.page input.num { display: inline-block; width: 6em; margin: 0 4px; vertical-align: middle; }
@media (max-width: 700px) { .page input.num { width: 4.5em; } }   /* 手机上「认 PDF 第 [ ] 页到第 [ ] 页」一行放得下，三位数照样看得全（翻书跳页框有自己的宽度，#r-p 那条） */
.set .row.inline-row label { flex: 0 1 auto; }
/* 花钱前的确认框（认字页「认剩下的」）：网页自己画、在页面正中间（浏览器自带的 confirm 在顶上；沈菀 10-05 晚「这个放在界面正中间」） */
dialog.ocr-ask { width: min(460px, calc(100vw - 32px)); padding: 24px 26px; border: 1px solid var(--line-strong); border-radius: 14px;
  background: #fffdfb; color: var(--ink); box-shadow: 0 18px 50px rgba(60, 45, 35, .18); }
dialog.ocr-ask::backdrop { background: rgba(40, 32, 28, .35); }
dialog.ocr-ask .row { margin: 18px 0 0; gap: 12px; }
#confirm-msg { margin: 0; white-space: pre-line; line-height: 1.7; }   /* 全站确认框（base.html）借这个样子；话里的换行照样换 */
.set textarea { font-family: ui-monospace, Consolas, monospace; font-size: .875rem; line-height: 1.8; }
.page .set .row { margin: 18px 0; gap: 16px; }
.set .row label { flex: 1 1 190px; min-width: 0; margin: 0; }
.set .row input { max-width: 100%; }
.set .row:not(.inline-row) input.num { margin-top: 8px; }   /* 10-05 晚：原来管 type=number，换成文字框后跟着认 .num；页数框那几行（inline-row）不管 */
.page-settings #prizes input[name=amount] { display: block; width: 100%; margin-top: 8px; }
.set .row label.check { display: flex; gap: 8px; align-items: flex-start; line-height: 1.8; color: var(--muted); }
.set label.check input { flex: 0 0 auto; margin-top: 6px; }
.page-settings #pool .row label { flex: 0 1 auto; }
.page-settings #pool input.num { width: 6em; margin-left: 8px; }
.page-settings #review input.num { width: 5.5em; margin-left: 0; margin-right: 0; }   /* 跟换文字框前一样宽、左右不留边：多 8px 就把「没想起来 [ ] 分钟」挤成两行（10-05 晚量过） */
.look-imgs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; margin-top: 28px; max-width: 820px; }
.look-img { min-width: 0; }
.look-img > p:first-child { font-weight: 550; }
.look-img img { display: block; max-width: 100%; max-height: 140px; border-radius: 8px; border: 1px solid var(--line); margin: 12px 0; }
.look-img input[type=file] { margin: 4px 0 12px; }
.look-img code { overflow-wrap: anywhere; }
.prize-list { display: flex; flex-direction: column; margin: 8px 0 24px; }
.prize { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.prize b { font-weight: 550; }
.prize img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; }
.prize form { margin-left: auto; }
@media (max-width: 700px) {
  .page .auth { margin-top: 16px; }
  .page-settings .section-nav { gap: 4px 22px; margin-bottom: 26px; }
  /* 手机：不左右滑，分两行 4 + 3，每格一样宽，第二行居中 */
  .page-settings.tabbed .section-nav { justify-content: center; gap: 8px; border-bottom: 0; }
  .page-settings.tabbed .section-nav a { flex: 0 0 calc((100% - 24px) / 4); min-width: 0; min-height: 42px; padding: 0 4px; margin: 0;
    border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(255, 255, 255, .6); font-size: .875rem; white-space: nowrap; }
  .page-settings.tabbed .section-nav a.on { color: var(--accent-dark); background: var(--accent-light); border-color: var(--accent-border); }
  .page .set .row { gap: 14px; }
  .set .row label { flex-basis: 100%; }
  .look-imgs { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .prize { gap: 6px 10px; }
  .prize > .small { flex-basis: 100%; order: 1; }
}

/* ---------- 奖池：浅蓝与奶油底色，稀有度只作局部强调 ---------- */
[hidden] { display: none !important; }
.pool { background: none; }
.pool-top { display: flex; flex-wrap: wrap; gap: 16px 36px; margin-bottom: 18px; }
.badge-big { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 8px; color: var(--muted); }
.badge-big b { font-size: 1.8rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ban { color: var(--bad); font-size: .85em; font-weight: 600; }
.money-up { display: inline-block; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
.draw-btns { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.page-pool button.ten { background: #edf2f3; color: #4f626a; border: 1px solid #cfdbde; box-shadow: none; }
.page-pool button.ten:hover { background: #e5edef; border-color: #b8c9ce; }

/* 召唤台：静态细环与微弱柔光，保留揭晓节奏。 */
.stage { position: relative; overflow: hidden; border-radius: 16px; min-height: 360px; margin: 24px 0 12px; padding: 36px 24px;
  background: radial-gradient(ellipse at 50% 45%, #fffcf5 0%, #f6f7f4 48%, #edf3f4 100%); border: 1px solid #e0e7e6;
  display: flex; align-items: center; justify-content: center; }
.ring { position: absolute; left: 50%; top: 50%; border-radius: 50%; pointer-events: none; transition: border-color .6s, box-shadow .6s; }
.ring.r1 { width: 420px; height: 420px; margin: -210px; border: 1px dashed #d7e1e0; }
.ring.r2 { width: 300px; height: 300px; margin: -150px; border: 1px solid #e0e5df; }
@keyframes spin { to { transform: rotate(360deg); } }
.beam { position: absolute; left: 50%; top: -30%; width: 360px; height: 130%; margin-left: -180px; pointer-events: none; opacity: 0;
  transition: opacity .5s; filter: blur(30px); border-radius: 50%; }
.stage.c-ssr .ring { border-color: #d9cbb0; }
.stage.c-sr .ring { border-color: #d8d4df; }
.stage.c-r .ring { border-color: #cfdde0; }
.stage.c-ssr .beam { background: linear-gradient(#f1e7d0, transparent); }
.stage.c-sr .beam { background: linear-gradient(#e8e5ef, transparent); }
.stage.c-r .beam { background: linear-gradient(#dae8ed, transparent); }
.stage.lit .beam { opacity: .45; }
.stage.quake { animation: quake .5s ease; }
@keyframes quake { 20% { transform: translate(-1px, 1px); } 40% { transform: translate(1px, -1px); } 60% { transform: translate(-1px, -1px); } 80% { transform: translate(1px, 1px); } }

/* 卡包：还没抽时立在中间轻轻浮；点了抽奖先抖一阵 */
.deck { position: relative; z-index: 2; width: 150px; height: 220px; border-radius: 12px; border: 1px solid #c8d6d9;
  background: linear-gradient(150deg, #edf4f6, #f8faf7 54%, #f8f0e2); box-shadow: 0 8px 18px rgba(85, 101, 107, .09);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #4f626a; font-weight: 600;
  animation: float 6s ease-in-out infinite; }
.deck::before { content: ""; position: absolute; inset: 9px; border: 1px solid rgba(142, 163, 169, .35); border-radius: 7px; }
.deck .big-ico { font-size: 3rem;  }
.deck small { font-weight: 400; color: #68716e; }
@keyframes float { 50% { transform: translateY(-4px) rotate(-.5deg); } }
.deck.shake { animation: summon .8s ease-in-out forwards; }
@keyframes summon { 15% { transform: translate(-5px, 3px) rotate(-2deg) scale(1.04); } 30% { transform: translate(5px, -4px) rotate(2deg) scale(1.06); }
  45% { transform: translate(-6px, -2px) rotate(-3deg) scale(1.08); } 60% { transform: translate(6px, 4px) rotate(3deg) scale(1.1); }
  80% { transform: translate(-3px, 2px) rotate(-1deg) scale(1.12); } 100% { transform: scale(1.15); opacity: 0; } }

/* 稀有度大字＋冲击波 */
.burst { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(255, 252, 248, .7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); pointer-events: none; animation: fadein .25s; }
.burst b { font-size: 5.5rem; font-weight: 900; letter-spacing: 2px; line-height: 1; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.burst span { margin-top: 10px; font-weight: 700; color: var(--muted); }
.burst.ssr b { background-image: linear-gradient(90deg, #9b8056, #ba9f76); }
.burst.sr b { background-image: linear-gradient(90deg, #81758f, #a396ad); }
.burst.r b { background-image: linear-gradient(90deg, #65818d, #92aab3); }
.burst::after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; border: 3px solid currentColor; animation: wave .9s ease-out; opacity: 0; }
.burst.ssr { color: #c9b790; } .burst.sr { color: #b3a9c0; } .burst.r { color: #acc5ce; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
@keyframes wave { from { transform: scale(.5); opacity: .8; } to { transform: scale(1.6); opacity: 0; } }
@keyframes fadein { from { opacity: 0; } }

/* 牌桌：十连 5×2 整整齐齐的竖卡；单抽一张大的 */
#result { position: relative; z-index: 2; width: min(100%, 760px); }
.cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; perspective: 1000px; }
.cards:not(.ten) { grid-template-columns: 200px; justify-content: center; }
.gcard { position: relative; aspect-ratio: 2 / 3; cursor: pointer; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.2, .8, .2, 1);
  animation: deal .45s cubic-bezier(.2, 1.2, .4, 1) both; }
@keyframes deal { from { transform: translateY(40px) scale(.3) rotate(-8deg); opacity: 0; } }
.gcard.open { transform: rotateY(180deg); }
.gcard:hover:not(.open) { transform: translateY(-2px); }
.gcard .back, .gcard .front { position: absolute; inset: 0; border-radius: 14px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px; text-align: center; }
.gcard .back { background: linear-gradient(150deg, #eaf2f5, #f7faf7 55%, #f8efe0); border: 1px solid #c9d8dd; color: #607781; font-size: 1.8em;
  box-shadow: 0 3px 8px rgba(85, 101, 107, .07); }
.gcard .back::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(142, 163, 169, .35); border-radius: 9px; }
.gcard .front { transform: rotateY(180deg); background: #fff; border: 1px solid var(--line); overflow: hidden; }
.gcard .front b { font-size: .9em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
.gcard .front img { max-width: 70%; max-height: 38%; border-radius: 8px; }
.gcard .front::after { content: ""; position: absolute; inset: 0; pointer-events: none;   /* 全息光泽扫过 */
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .6) 48%, transparent 66%); background-size: 250% 100%;
  animation: holo 1.5s ease-out; }
@keyframes holo { from { background-position: 200% 0; } to { background-position: -150% 0; } }
.gcard.r-ssr .front { border-color: #c9b48f; background: linear-gradient(160deg, #fffdf8, #f4ead7); box-shadow: 0 3px 12px rgba(156, 133, 91, .1); }
.gcard.r-sr .front { border-color: #c5bbd0; background: linear-gradient(160deg, #fdfcfb, #eeebf3); box-shadow: 0 3px 10px rgba(109, 99, 125, .07); }
.gcard.r-r .front { border-color: #c6d7df; background: linear-gradient(160deg, #fafcfb, #eaf1f4); }
.gcard.empty .front { background: #F4F1EC; border-color: #DDD; color: var(--muted); box-shadow: none; }
.gcard.empty .front::after { display: none; }
.cards:not(.ten) .gcard .front b { font-size: 1.15em; } .cards:not(.ten) .gcard .back { font-size: 3em; }
.rar, .rar-tag { font-size: .75em; font-weight: 800; padding: 0 7px; border-radius: 6px; background: rgba(255, 255, 255, .7); }
.r-ssr .rar, .rar-tag.r-ssr { color: #8c7149; } .r-sr .rar, .rar-tag.r-sr { color: #7c6a90; } .r-r .rar, .rar-tag.r-r { color: #567785; }

/* 翻出来的特效：SSR 金星＋彩带；SR 紫色光圈荡开＋紫蓝小星星（不金、不撒彩带） */
.confetti { opacity: .5; position: fixed; top: -10px; width: 8px; height: 12px; border-radius: 2px; z-index: 99; animation: fall 2.2s linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); } }
.spark { opacity: .6; position: fixed; z-index: 70; pointer-events: none; line-height: 1; animation: rise-up 1.1s ease-out forwards; }
@keyframes rise-up { to { transform: translate(var(--dx), -80px) scale(.3) rotate(120deg); opacity: 0; } }
.ripple-sr { animation: ripple-sr 1s ease-out 2; }
@keyframes ripple-sr { from { box-shadow: 0 0 0 0 rgba(155, 140, 177, .25), 0 0 14px rgba(155, 140, 177, .12); }
  to { box-shadow: 0 0 0 18px rgba(167, 123, 224, 0), 0 0 14px rgba(155, 140, 177, .12); } }

/* 点一张卡：拿到正前面放大看（表情包能看大图）；点任意处放回去 */
.zoom { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(255, 250, 245, .78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadein .2s; cursor: zoom-out; }
.zoom-card { width: min(300px, 72vw); animation: zoomin .35s cubic-bezier(.2, 1.3, .4, 1); }
.zoom .gcard { width: 100%; animation: none; }   /* 卡上不挂任何动画，只管翻面（没翻的在这儿当面翻开） */
@keyframes zoomin { from { transform: scale(.4); opacity: 0; } }
.zoom .gcard .front { padding: 18px; gap: 10px; }
.zoom .gcard .front b { font-size: 1.5rem; -webkit-line-clamp: 6; } .zoom .gcard .front .rar { font-size: .95rem; }
.zoom .gcard .front .small { font-size: 1rem; } .zoom .gcard .back { font-size: 4rem; }
.zoom .gcard .front img { max-width: 92%; max-height: 62%; border-radius: 12px; }
.zoom .tip { color: var(--muted); font-size: .85rem; }

.stage-ops { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; min-height: 40px; }
/* 抽奖仪式的大框：盖住整页（记录、零花钱都看不见也点不到），翻完点「收下奖品」才收起 */
.ritual { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px)); overflow-y: auto;
  background: rgba(250, 249, 246, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: fadein .25s; }
/* 召唤台跟着浏览器窗口变大（沈菀 10-04：比窗口小一圈）：算出「宽也放得下、高也放得下」的最大卡，整场仪式都是这个大小，发牌时不跳。
   --side＝左右要留的总宽，--vert＝上下要留给按钮那一行和边距的总高；卡宽最大 280px，免得大屏上大得离谱 */
.ritual { --g: 14px; --px: 24px; --py: 32px; --side: 120px; --vert: 120px;
  --cw: min(280px, calc((100vw - var(--side) - 2 * var(--px) - 4 * var(--g)) / 5), calc((100vh - var(--vert) - 2 * var(--py) - var(--g)) / 3));
  --one: min(340px, calc(100vw - var(--side) - 2 * var(--px)), calc((100vh - var(--vert) - 2 * var(--py)) / 1.5)); }
.ritual .stage { box-sizing: border-box; width: calc(5 * var(--cw) + 4 * var(--g) + 2 * var(--px)); height: calc(3 * var(--cw) + var(--g) + 2 * var(--py));
  min-height: 0; max-width: 100%; margin: 0; padding: var(--py) var(--px); flex: 0 0 auto; }
.ritual.one .stage { width: calc(var(--one) + 2 * var(--px)); height: calc(1.5 * var(--one) + 2 * var(--py)); }
.ritual #result { width: auto; }
/* 发牌前的卡包也跟着召唤台缩放：大约一张卡的 1.6 倍高、不超过召唤台（手机上固定 220px 会被切掉底） */
.ritual .deck { width: auto; height: min(max(calc(1.6 * var(--cw)), 160px), 100%); aspect-ratio: 15 / 22; font-size: clamp(13px, calc(var(--cw) * .09), 20px); }
.ritual.one .deck { height: min(calc(1.2 * var(--one)), 100%); font-size: clamp(14px, calc(var(--one) * .06), 20px); }
.ritual .deck .big-ico { font-size: 2.8em; }
.ritual .cards.ten { grid-template-columns: repeat(5, var(--cw)); gap: var(--g); font-size: clamp(12px, calc(var(--cw) * .1), 18px); }
.ritual .cards:not(.ten) { grid-template-columns: var(--one); font-size: clamp(14px, calc(var(--one) * .07), 20px); }
.ritual .stage-ops { width: min(760px, 100%); }
.ritual #done { min-width: 10em; }
body.ritual-open { overflow: hidden; }
.summary { font-weight: 550; padding: 8px 0;
  animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
.summary .s { color: #8c7149; } .summary .sr { color: #7c6a90; } .summary .r { color: #567785; }

/* 零花钱标题下的说明小字；抽奖记录平时折着 */
.sub { margin: -6px 0 12px; }
details.hist > summary { cursor: pointer; list-style: none; font-size: 1.18rem; font-weight: 700; }
details.hist > summary::-webkit-details-marker { display: none; }
details.hist > summary::after { content: " ▸"; color: var(--muted); font-size: .8em; }
details.hist[open] > summary::after { content: " ▾"; }
tr.fresh td { animation: fadein .6s; background: #faf5ea; }
td.minus { color: var(--bad); } td.plus { color: var(--ok); }

/* 账号自定义装饰仍保留；奖池卡面避免持续闪烁。 */
.page-pool .gcard .back { border-color: #c9d8dd; }

/* 卡背图（设置 → 装扮，沈菀 10-04 晚）：整张显示不裁，透明的地方露出原来的卡面底色；卡包上图是主角、字缩小放在图下面。
   花边（卡背里那一圈细线）可关。开关挂在 body 上，因为放大的大卡也挂在 body 上 */
.has-cardback .gcard .back { background: var(--cardback) center / contain no-repeat, linear-gradient(150deg, #eaf2f5, #f7faf7 55%, #f8efe0); }
.has-cardback .deck::before, .has-cardback .gcard .back::before { border-color: rgba(255, 255, 255, .75); }
.deck.with-pic { justify-content: flex-end; gap: 4px; padding: 8px 8px 7px; }
.deck.with-pic .pic { flex: 1; min-height: 0; width: 100%; background: var(--cardback) center / contain no-repeat; border-radius: 6px; }
.deck.with-pic .cap { position: relative; font-size: .72em; font-weight: 500; line-height: 1.3; text-align: center; }
.no-frame .deck::before, .no-frame .gcard .back::before { display: none; }
.page-pool .gcard.r-ssr .front, .zoom .gcard.r-ssr .front { animation: none; }
.page-pool #money > form { max-width: 820px; }
.page-pool #money input[name=amount] { display: block; width: 100%; margin-top: 8px; }
.page-pool .sessions { table-layout: fixed; }
.page-pool .sessions td { overflow-wrap: anywhere; }
.page-pool .sessions td:first-child { width: 30%; color: var(--muted); }
.page-pool .sessions td:nth-child(2) { width: 22%; }
.page-pool .hist > summary .small { font-weight: 400; }
@media (max-width: 700px) {
  .pool-top { gap: 12px 28px; }
  .badge-big { gap: 6px; font-size: .875rem; }
  .badge-big b { font-size: 1.5rem; }
  .draw-btns { gap: 10px; }
  .page-pool .draw-btns button { padding: 10px 14px; font-size: .875rem; }
  /* 手机十连也是 5×2（沈菀 10-04 定）：大框占满屏幕、召唤台里边距收窄，卡更大；字调小 */
  .stage { padding: 20px 6px; min-height: 300px; }
  .ritual { padding-left: 10px; padding-right: 10px; --g: 6px; --px: 6px; --py: 20px; --side: 20px; }   /* 手机：大框几乎贴边，卡离屏幕边 10＋6＝16px */
  .cards.ten { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .cards:not(.ten) { grid-template-columns: minmax(0, 190px); }
  .cards.ten .gcard .back { font-size: 1.1em; }
  .cards.ten .gcard .back::before { inset: 4px; }
  .cards.ten .gcard .front { padding: 3px 2px; gap: 1px; border-radius: 10px; }
  .cards.ten .gcard .front b { font-size: .6875rem; line-height: 1.3; -webkit-line-clamp: 2; }
  .cards.ten .gcard .front .rar { font-size: .5625rem; padding: 0 4px; }
  .cards.ten .gcard .front img { max-height: 32%; }
  .cards.ten .gcard .front .small { display: none; }   /* 「+¥5 已进余额」小卡上放不下，点开大图能看到 */
  .cards:not(.ten) .gcard .front b { font-size: .9375rem; line-height: 1.6; }
  .cards:not(.ten) .gcard .front .small { font-size: .75rem; line-height: 1.5; }
  .burst b { font-size: 3.6rem; }
  .summary { font-size: .875rem; }
  .page-pool .sessions td { padding: 12px 6px; font-size: .875rem; }
  .page-pool .hist > summary .small { display: block; margin-top: 4px; line-height: 1.8; }
}

/* ---------- 服务器总览、清理空间 ---------- */
.table-wrap { overflow-x: auto; }
.usage { width: 100%; min-width: 820px; border-collapse: collapse; font-size: .9375rem; }
.usage th { text-align: left; color: var(--muted); font-weight: 550; padding: 12px 10px; border-bottom: 1px solid var(--line-strong); background: rgba(237, 233, 227, .35); }
.usage td { padding: 18px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.usage th, .usage td { white-space: nowrap; }
.usage tr.hot td { background: #faf4e9; }
.usage td:first-child .tag { display: table; margin-top: 6px; }
.usage .bar { width: 130px; }
.usage details summary, .new-user summary { cursor: pointer; color: var(--accent-dark); font-weight: 550; }
.usage details form { padding-bottom: 14px; }
.usage details form input[name=name], .usage input[type=password] { display: block; width: 14em; margin: 8px 0; padding: 8px 12px; }
.usage .quota { margin-top: 10px; white-space: nowrap; }
.usage .quota input { width: 4.5em; margin: 0 4px; }
.new-user { margin-top: 22px; }
.new-user .row { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.new-user input { flex: 1 1 210px; min-width: 0; padding: 10px 12px; }
.page-space { max-width: 900px; }
.page-space .set .row { align-items: center; gap: 12px 18px; }
.page-space .set .row label { display: flex; flex-wrap: wrap; align-items: center; flex: 0 1 auto; gap: 10px; font-weight: 400; }
.page-space .set .row label select { width: auto; max-width: 100%; margin: 0; }
.page-space .set .row input.num { margin: 0; }
@media (max-width: 700px) {
  .page-admin .table-wrap { padding-bottom: 12px; }
  .page-admin .usage { font-size: .875rem; }
  .page-admin .new-user .row input { flex-basis: 100%; }
  .page-space .set .row label { flex-basis: 100%; }
}

/* ---------- 手机 ---------- */
@media (max-width: 560px) {
  .top { padding: 8px 12px; }
  main { padding: 16px 10px 40px; }
  .card { padding: 16px; }
  .cal { border-spacing: 3px; }
  .cal td { height: 54px; border-radius: 9px; }
  .cal .m { font-size: .68em; }
  .ocr { flex-direction: column; }
  .ocr img { width: 100%; }
}

/* ---------- 基础导航与首页响应式（其他页面布局不变） ---------- */
@media (max-width: 1180px) {
  .top-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 20px; padding-top: 12px; }
  .top nav { grid-column: 1 / -1; grid-row: 2; padding: 6px 0 10px; }
  .top-meta { grid-column: 2; grid-row: 1; }
}
@media (max-width: 700px) {
  .top { padding: 0 20px; }
  .top-inner { gap: 0 12px; }
  .brand { font-size: .88rem; gap: 8px; }
  .top .brand-badge { flex-basis: 30px; height: 30px; }
  .top-meta { flex-direction: column; gap: 0; align-items: flex-end; }
  .top .date { font-size: .75rem; }
  .top .me { font-size: .75rem; }
  .top .me .link { min-height: 28px; }
  .top nav { gap: 4px; mask-image: linear-gradient(to right, #000 94%, transparent); }
  .top nav a { padding: 9px 12px; font-size: .9rem; }
  main { padding: 28px 20px 56px; }
  .card { padding: 22px 20px; }
  .home-page { padding-top: 6px; }
  .home-heading { margin-bottom: 24px; }
  .home-page .home-today { grid-template-columns: minmax(0, 1fr); gap: 26px; padding-bottom: 24px; margin-bottom: 22px; }
  .home-stats { gap: 12px 22px; }
  .home-stats b { font-size: 1.8rem; padding: 0 2px; }
  .home-focus .timer { margin-top: 18px; }
  .home-aside { gap: 12px; padding: 20px 0 0; border-left: 0; border-top: 1px solid #e8e1d9; }
  .calendar-heading { display: block; margin-bottom: 16px; padding-right: 0; }
  .calendar-note { display: block; margin-top: 4px; font-size: .8125rem; }
  .home-calendar .month-nav { justify-content: space-between; gap: 8px; margin-bottom: 16px; }
  .home-calendar .cal { border-spacing: 3px; }
  .home-calendar .cal td { height: 74px; border-radius: 7px; }
  .home-calendar .cal td a { padding: 7px 3px; }
  .home-calendar .cal .n { font-size: .8rem; }
  .home-calendar .cal .m { font-size: .7rem; line-height: 1.5; }
  .home-calendar .legend-item { margin-right: 12px; }
}
@media (max-width: 360px) {
  .top { padding: 0 14px; }
  main { padding-left: 14px; padding-right: 14px; }
  .home-stats { gap: 10px 16px; }
  .home-stats > span { font-size: .8rem; }
}

/* 放在最后，覆盖所有页面的装饰动画。 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* 门面（没登录时看到的首页，沈菀 10-04 晚）：她的代码在隔离小窗里铺满整个窗口；右上角「登录」、备案号是网站自己的 */
.facade-body { margin: 0; background: #fdf8f3; }
.facade-frame { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.facade-login { position: fixed; top: 16px; right: 18px; z-index: 2; padding: 8px 20px; border-radius: 999px;
  background: rgba(255, 255, 255, .78); border: 1px solid rgba(174, 100, 83, .28); color: #8e5344; font-size: 15px;
  text-decoration: none; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 2px 10px rgba(142, 83, 68, .08); }
.facade-login:hover { background: #fff; text-decoration: none; }
.facade-foot { position: fixed; left: 0; right: 0; bottom: 8px; z-index: 2; padding: 0 16px; text-align: center; font-size: 12px; color: #a8a29a; }
.facade-foot a:hover { text-decoration: underline !important; }

/* 服务器总览 → 门面那一块 */
.facade-code { width: 100%; font-family: Consolas, "Courier New", monospace; font-size: 13px; line-height: 1.5; }
.facade-ops { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.facade-ops form { margin: 0; }
.facade-imgs-title { margin-top: 28px; }
.facade-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin: 14px 0; }
.facade-img { min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: rgba(255, 255, 255, .6); }
.facade-img img { display: block; max-width: 100%; max-height: 120px; margin: 0 auto 10px; }
.facade-img .addr { display: flex; gap: 6px; align-items: center; }
.facade-img .addr input { flex: 1; min-width: 0; min-height: 36px; font-family: Consolas, monospace; font-size: 12.5px; }
.facade-img .addr button { min-height: 36px; padding: 4px 12px; }
.facade-img .check { display: flex; gap: 8px; align-items: center; margin-top: 8px; }

/* 书架（PLAN §3.10 ⑤）：一个科目一张卡，里面一本书一块；「📖 翻开」做成按钮的样子，手机上占满一行好按 */
.shelf-subject .book { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.shelf-subject .book .row form { margin: 0; }
.page a.open-book, .page a.btn-book, .page summary.btn-book { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 6px 18px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: #fcf7f2; color: var(--ink); text-decoration: none;
  font-size: .92rem; font-weight: 550; box-sizing: border-box; }
.page a.open-book:hover, .page a.btn-book:hover, .page summary.btn-book:hover { background: #fff; text-decoration: none; }
.shelf-subject .subject-edit { margin-top: 14px; }
/* 10-05 晚重排（沈菀：字号一塌糊涂、重点不突出）：只用三种字号——科目（.big）、书名、正文小字；一排一样大的按钮，下一步那个颜色最深 */
.shelf-subject .book-title { font-size: 1.05rem; font-weight: 650; margin: 0 0 4px; line-height: 1.5; }
.shelf-subject .book-meta { color: var(--muted); font-size: .875rem; margin: 0 0 12px; }
.shelf-subject .book-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 8px; }
.page a.btn-book.primary { background: #ae6453; border-color: transparent; color: #fff; }
.page a.btn-book.primary:hover { background: #985444; color: #fff; }
.shelf-subject .book-more { margin-top: 6px; }
.shelf-subject .book-more > summary { font-size: .875rem; color: var(--muted); }
.page details.new-book > summary { list-style: none; }
.page details.new-book > summary::-webkit-details-marker { display: none; }
.page details.new-book[open] > summary { margin-bottom: 12px; }
@media (max-width: 700px) {
  .page a.open-book, .page a.btn-book { display: flex; width: 100%; box-sizing: border-box; }
  .shelf-subject .book .row button { width: 100%; }
  .shelf-subject .book input:not([type=file]):not([type=number]), .shelf-subject .book select { width: 100%; box-sizing: border-box; }
}

/* 翻书（PLAN §3.10 ⑤ 第 2 件）：PDF.js 把这一页画成一张图（canvas），上面铺一层透明的字（textLayer）能选中。
   textLayer 那几条照抄 PDF.js 6.4.299 的 web/pdf_viewer.css（拆掉了嵌套写法、去掉了搜索高亮），改版本时一起对 */
.textbook-nav .r-flip, .textbook-nav .r-zoom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.textbook-nav .r-zoom[hidden] { display: none; }
.textbook-nav #r-p { width: 5em; }
.textbook-page { display: block; width: 100%; height: 85vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.reader-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 10px 0; }
.reader-page { position: relative; margin: 0 auto; background: #fff; box-shadow: 0 1px 8px rgba(50, 70, 85, .14);
  --user-unit: 1; --total-scale-factor: calc(var(--scale-factor) * var(--user-unit)); --scale-round-x: 1px; --scale-round-y: 1px; }
.reader-page canvas { display: block; }
.textLayer { color-scheme: only light; position: absolute; text-align: initial; inset: 0; overflow: clip; opacity: 1; line-height: 1;
  letter-spacing: normal; word-spacing: normal; -webkit-text-size-adjust: none; text-size-adjust: none; forced-color-adjust: none;
  transform-origin: 0 0; caret-color: CanvasText; z-index: 0;
  --min-font-size: 1; --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size)); --min-font-size-inv: calc(1 / var(--min-font-size)); }
.textLayer span, .textLayer br { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%;
  -webkit-user-select: text; user-select: text; }
.textLayer > :not(.markedContent), .textLayer .markedContent span:not(.markedContent) { z-index: 1; --font-height: 0;
  font-size: calc(var(--text-scale-factor) * var(--font-height)); --scale-x: 1; --rotate: 0deg;
  transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv)); }
.textLayer .markedContent { display: contents; }
.textLayer span[role="img"] { -webkit-user-select: none; user-select: none; cursor: default; }
.textLayer ::selection { background: rgba(0, 0, 255, .25); background: color-mix(in srgb, AccentColor, transparent 50%); color: transparent; }
.textLayer.selectionRendering ::selection { background: transparent; color: transparent; }
.textLayer br::selection { background: transparent; }
.textLayer .endOfContent { display: block; position: absolute; inset: 100% 0 0; z-index: 0; cursor: default; -webkit-user-select: none; user-select: none; }
.textLayer.selecting .endOfContent { top: 0; }
@media (max-width: 700px) {
  /* 手机：翻页、放大按钮固定在屏幕底部，单手拇指够得着（沈菀 10-05：不要滑动翻页、默认铺满屏宽） */
  .page-textbook { padding-bottom: 130px; }
  .reader .textbook-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; gap: 6px 10px; justify-content: center;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: rgba(250, 249, 246, .97); border-top: 1px solid var(--line-strong);
    box-shadow: 0 -4px 14px rgba(50, 70, 85, .08); }
  .reader .textbook-nav label { flex: 0 0 auto; }
  .reader .textbook-nav .r-word { display: none; }   /* 「书上第 / 页」藏起来，只留数字框：两行放得下，不挡书 */
  .reader .textbook-nav #r-p { width: 4.2em; }
  .reader .textbook-nav .r-flip { justify-content: center; flex-wrap: nowrap; gap: 8px; }
  .reader .textbook-nav .r-zoom { justify-content: center; }
  .reader .textbook-nav .r-zoom button { min-height: 38px; padding: 4px 16px; }
  .reader .textbook-nav a { padding: 10px 4px; white-space: nowrap; }
  .page-textbook .page-title { font-size: 1.15rem; }
  .reader-scroll { margin-left: -8px; margin-right: -8px; }
}

/* 书上的笔记（PLAN §3.10 ⑤ 第 3 件）：选中字后的一排按钮、写笔记的框、这页的笔记 */
.r-tools { position: absolute; z-index: 40; display: flex; gap: 6px; padding: 6px; background: #fff; border: 1px solid var(--line-strong);
  border-radius: 12px; box-shadow: var(--shadow-lg); }
.r-tools[hidden] { display: none; }
.r-tools button { min-height: 40px; padding: 6px 12px; white-space: nowrap; }
.r-panel { position: fixed; z-index: 50; right: 24px; bottom: 24px; width: min(460px, calc(100vw - 48px)); max-height: calc(100vh - 48px);
  overflow-y: auto; box-sizing: border-box; padding: 18px 20px; background: #fff; border: 1px solid var(--line-strong);
  border-radius: 16px; box-shadow: var(--shadow-lg); }
.r-panel[hidden] { display: none; }
.r-panel .big { margin-top: 0; }
.rp-quote { margin: 8px 0 12px; padding: 8px 12px; border-left: 3px solid var(--accent-border); background: var(--accent-light);
  border-radius: 6px; white-space: pre-wrap; max-height: 12em; overflow-y: auto; }
.rp-label { display: block; }
.rp-label textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; }
.r-panel .extra-text, .r-note .extra-text, .note-item .extra-text { white-space: pre-wrap; }
.rp-buttons { margin-top: 12px; }
.r-notes-box { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.r-note { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.r-note:last-child { border-bottom: 0; }
.r-note-body { white-space: pre-wrap; margin: 6px 0; }
.r-note-ops { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin: 6px 0 0; }
@media (max-width: 700px) {
  /* 手机：按钮贴在翻页栏上面（手机自己的「复制 / 全选」菜单在选中的字旁边，别挡它）；写笔记的框从底下升起来 */
  .r-tools.dock { position: fixed; left: 8px; right: 8px; bottom: calc(118px + env(safe-area-inset-bottom)); justify-content: center; }
  .r-tools.dock button { flex: 1 1 0; padding: 6px 4px; }
  .r-panel { left: 0; right: 0; bottom: 0; width: auto; max-height: 85vh; border-radius: 16px 16px 0 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
  .r-panel .rp-buttons button { flex: 1 1 auto; }
}
/* 写笔记的框能拖（沈菀 10-05）：宽屏按住标题行拖，手机上不拖 */
.r-panel .rp-grip { float: right; color: var(--subtle); font-size: 1.1rem; line-height: 1.6; }
@media (min-width: 701px) {
  .r-panel #rp-head { cursor: move; -webkit-user-select: none; user-select: none; touch-action: none; }
}
@media (max-width: 700px) { .r-panel .rp-grip { display: none; } }
