/* ============================================================
   析题 · 北京高考英语拍照解析
   设计语言：纸质手账 —— 米白纸感、陶土橙点缀、衬线大标题
   ============================================================ */

:root {
  --bg: #f7f8fa;
  --paper: #fff;
  --ink: #282f34;
  --muted: #92979f;
  --line: #e9ebee;
  --accent: #c87352;
  --accent-deep: #a95f42;
  --accent-light: #f8eee8;
  --green: #547769;
  --green-light: #edf4ef;
  --sidebar: 236px;
  --radius: 11px;
  --shadow-sm: 0 3px 10px #4b53620a;
  --shadow-md: 0 8px 24px #4b53620f;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

button:focus-visible, a:focus-visible {
  outline: 3px solid #dfb295;
  outline-offset: 3px;
  border-radius: 4px;
}
input:focus { outline: 2px solid #e6bda8; outline-offset: 1px; }

.hidden { display: none !important; }

/* ============================ 侧边栏 ============================ */

#sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: var(--paper);
  border-right: 1px solid var(--line);
  padding: 32px 18px 20px;
  display: flex;
  flex-direction: column;
  z-index: 30;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
}

.brand-mark {
  width: 38px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 22px;
  display: grid;
  place-items: center;
  transform: rotate(-5deg);
  flex: none;
  box-shadow: 0 4px 10px #c8735240;
}

.brand-en {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--accent);
  margin-left: 3px;
  font-weight: 600;
}

.brand small {
  display: block;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .5px;
  color: var(--muted);
  margin-top: 5px;
}

.primary {
  background: var(--accent);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 13px;
  box-shadow: 0 4px 12px #c8735230;
  transition: background .16s, transform .16s;
}
.primary:hover { background: var(--accent-deep); }
.primary:active { transform: translateY(1px); }
.primary span { font-size: 18px; font-weight: 400; margin-right: 4px; }

.side-upload {
  margin: 28px 2px 6px;
  width: calc(100% - 4px);
  text-align: center;
}

.nav-label {
  font-size: 10px;
  letter-spacing: 1.2px;
  color: #a3a7ae;
  padding: 20px 11px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}
.nav-label > span { font-size: 10px; color: #c0c4c9; font-weight: 400; }

nav { display: grid; gap: 3px; }

.nav-item {
  width: 100%;
  border-radius: 7px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  text-align: left;
  gap: 10px;
  font-size: 12px;
  color: #717780;
  min-height: 38px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: #f8f8f9; }
.nav-item.active {
  background: var(--accent-light);
  color: var(--accent-deep);
  font-weight: 600;
}
.nav-icon {
  width: 16px;
  text-align: center;
  font-size: 14px;
  line-height: 1;
  color: #9aa0a8;
  flex: none;
}
.nav-item.active .nav-icon { color: var(--accent); }

.nav-count {
  margin-left: auto;
  font-size: 10px;
  color: #a5abb3;
  background: #f4f5f7;
  border-radius: 20px;
  padding: 2px 7px;
  min-width: 20px;
  text-align: center;
}
.nav-item.active .nav-count {
  background: #fff;
  color: var(--accent);
}

/* 侧边栏的题型条目左侧那条彩色小竖线 */
.nav-item .type-bar {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  flex: none;
  opacity: .55;
}
.nav-item.active .type-bar { opacity: 1; }

/* 功能导航：两行文字（名称 + 一句说明），比纯题型列表更好认 */
.nav-item .func-body { display: grid; gap: 2px; min-width: 0; }
.nav-item .func-body b { font-size: 12.5px; font-weight: 500; color: #5b636c; }
.nav-item .func-body small {
  font-size: 9.5px;
  color: #a8aeb6;
  letter-spacing: .1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-item.active .func-body b { color: var(--accent-deep); }
.nav-item.active .func-body small { color: #c09a86; }
.nav-item .nav-arrow {
  margin-left: auto;
  color: #c9ced4;
  font-size: 13px;
  line-height: 1;
  flex: none;
}
.nav-item.active .nav-arrow { color: var(--accent); }

/* 侧边栏「今日签」入口 */
.side-today {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 11.5px;
  color: #717780;
  text-align: left;
  transition: background .15s;
}
.side-today:hover { background: #f8f8f9; }
.side-today .st-label { color: #8d939b; }
.side-today .st-value {
  margin-left: auto;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .5px;
}
.side-today .st-value[data-tone="plain"] { color: #8a9099; }
.side-today .st-value[data-tone="bad"] { color: #7c8fa6; }
.side-today .st-go { color: #c9ced4; font-size: 12px; }


.side-bottom {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  border-top: 1px solid var(--line);
  margin: 26px 2px 0;
  padding-top: 18px;
  font-size: 10px;
  color: #707b76;
  line-height: 1.6;
}
.side-bottom small {
  display: block;
  font-size: 9px;
  color: #a8aeab;
  margin-top: 3px;
}
.local-dot {
  width: 6px;
  height: 6px;
  background: #7c9b83;
  border-radius: 50%;
  flex: none;
  margin-top: 5px;
}

/* ============================ 主区域 ============================ */

.workspace { margin-left: var(--sidebar); }

header {
  height: 72px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: #ffffffcc;
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  color: var(--muted);
}
.breadcrumb b { font-weight: 500; color: #555e68; }
.slash { color: #c9ced4; }

.header-right { display: flex; align-items: center; gap: 20px; }
.header-note { font-size: 11px; color: #9aa0a6; font-style: italic; font-family: var(--font-serif); }
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green-light);
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
}

main {
  max-width: 1420px;
  margin: 0 auto;
  padding: 34px 40px 0;
}

/* ---------- 页面标题 ---------- */

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  font-size: 9px;
  letter-spacing: 2.2px;
  color: #a1a5ac;
  font-weight: 600;
}

h1 {
  font-size: 26px;
  letter-spacing: .2px;
  line-height: 1.45;
  margin: 9px 0 7px;
  font-weight: 600;
}
h1 > span { color: var(--accent); }

.page-heading p { margin: 0; color: #8a9098; font-size: 12px; line-height: 1.7; }

.date-tag {
  border: 1px solid #e5e8eb;
  border-radius: 6px;
  padding: 9px 13px;
  font-size: 10px;
  color: #9399a0;
  background: #ffffff99;
  white-space: nowrap;
  flex: none;
  font-variant-numeric: tabular-nums;
}

/* ---------- 统计条 ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 0;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}

.stat {
  padding: 0 22px;
  border-right: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 13px;
}
.stat:last-child { border: 0; }

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #f2f4f7;
  display: grid;
  place-items: center;
  font-size: 17px;
  color: #7c8a9a;
  flex: none;
}
.stat:nth-child(1) .stat-icon { color: #7c8a9a; background: #f2f4f7; }
.stat:nth-child(2) .stat-icon { color: #bc9a55; background: #faf5e9; }
.stat:nth-child(3) .stat-icon { color: #779685; background: var(--green-light); }
.stat:nth-child(4) .stat-icon { color: #b98775; background: #f9f0eb; }

.stat-label { font-size: 10px; color: #949aa2; display: block; margin-bottom: 5px; }
.stat strong { font-size: 22px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.stat small { font-size: 10px; font-weight: 400; color: #a4a9af; margin-left: 5px; }

/* 从侧边栏跳转时，别让吸顶导航盖住标题 */
#photoMode, #readMode, .library { scroll-margin-top: 86px; }

/* ---------- 每日：一句英文 + 一支签 ---------- */

.daily-band {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
  align-items: stretch;
}

/* 名言：像一张贴在手账上的纸片 */
.daily-quote {
  position: relative;
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px 14px 26px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.daily-quote::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(#e3c3b0, #f0dcd0);
}
.dq-mark {
  position: absolute;
  right: 14px;
  top: -10px;
  font-family: var(--font-serif);
  font-size: 76px;
  line-height: 1;
  color: #f3e7df;
  pointer-events: none;
  user-select: none;
}
.dq-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
  position: relative;
}
.dq-tag { font-size: 9px; color: #c0b4a9; letter-spacing: .3px; }
.daily-quote blockquote { margin: auto 0; position: relative; }
.dq-en {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.55;
  font-style: italic;
  color: #2f363d;
  letter-spacing: .1px;
}
.dq-zh {
  margin: 0;
  font-size: 12px;
  color: #8b929a;
  line-height: 1.7;
}
.daily-quote figcaption {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.dq-by { font-size: 10px; color: #b0b5bc; letter-spacing: .4px; }
.dq-next {
  font-size: 10.5px;
  color: #a5abb3;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color .16s, background .16s;
}
.dq-next:hover { color: var(--accent); background: var(--accent-light); }

.daily-quote.swap { animation: quoteIn .5s ease both; }
@keyframes quoteIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* 抽签卡 */
.fortune {
  background: linear-gradient(160deg, #fffdfb 0%, #fdf6f1 100%);
  border: 1px solid #f0e2d9;
  border-radius: var(--radius);
  padding: 15px 18px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 158px;
  position: relative;
  overflow: hidden;
  transition: box-shadow .25s;
}
.fortune-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.fortune-date { font-size: 9.5px; color: #bfae9f; letter-spacing: .3px; }

.fortune-idle {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-align: center;
}
.fortune-idle p { margin: 0; font-size: 11.5px; color: #9a8e84; }

/* 一个很轻的「签筒」：三根签从筒里探出来 */
.lot-tube {
  position: relative;
  width: 48px;
  height: 34px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}
.lot-tube::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 4px;
  right: 4px;
  height: 18px;
  border-radius: 4px 4px 6px 6px;
  background: #e2b79f;
  box-shadow: inset 0 -3px 0 #cfa189;
}
.lot-stick {
  width: 6px;
  height: 26px;
  border-radius: 3px 3px 0 0;
  background: #f6e5d9;
  border: 1px solid #e3c6b5;
  border-bottom: 0;
  transform-origin: bottom center;
  position: relative;
  z-index: 1;
}
.lot-stick:nth-child(1) { transform: rotate(-9deg); height: 22px; }
.lot-stick:nth-child(3) { transform: rotate(8deg); height: 24px; }

.draw-btn {
  background: var(--accent);
  color: #fff;
  border-radius: 20px;
  padding: 7px 22px;
  font-size: 11.5px;
  letter-spacing: 1.5px;
  box-shadow: 0 4px 12px #c8735230;
  transition: background .16s, transform .16s;
}
.draw-btn:hover { background: var(--accent-deep); }
.draw-btn:active { transform: translateY(1px); }
.draw-btn.pulse { animation: btnPulse .55s ease 2; }
@keyframes btnPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 12px #c8735230; }
  50% { transform: scale(1.06); box-shadow: 0 6px 18px #c8735255; }
}

/* 摇签动画 */
.fortune.drawing { animation: shakeLot .6s ease-in-out; }
@keyframes shakeLot {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-1.4deg); }
  45% { transform: rotate(1.4deg); }
  70% { transform: rotate(-.8deg); }
}

.fortune-result {
  flex: 1;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  grid-template-areas:
    "seal line"
    "grid grid"
    "word word";
  gap: 7px 12px;
  align-items: center;
  animation: sealIn .45s ease both;
}
@keyframes sealIn {
  from { opacity: 0; transform: scale(.92); }
  to { opacity: 1; transform: none; }
}

/* 印章式吉凶 */
.fc-seal {
  grid-area: seal;
  width: 58px;
  height: 58px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #f6e3da;
  border: 1px solid #e5bda9;
  transform: rotate(-4deg);
}
.fc-seal b {
  font-family: var(--font-serif);
  font-size: 21px;
  letter-spacing: 1px;
  color: var(--accent-deep);
}
.fortune[data-tone="great"] .fc-seal { background: #f7e2d8; border-color: #dfaf96; }
.fortune[data-tone="great"] .fc-seal b { color: #b4553f; }
.fortune[data-tone="good"] .fc-seal { background: #f8f0dd; border-color: #e2cda2; }
.fortune[data-tone="good"] .fc-seal b { color: #a8843a; }
.fortune[data-tone="warm"] .fc-seal { background: #f7ecdf; border-color: #e5ceb4; }
.fortune[data-tone="warm"] .fc-seal b { color: #a1714a; }
.fortune[data-tone="plain"] .fc-seal { background: #eff2f5; border-color: #dbe1e7; }
.fortune[data-tone="plain"] .fc-seal b { color: #6f7d8a; }
.fortune[data-tone="bad"] .fc-seal { background: #ebeff3; border-color: #cdd7e0; }
.fortune[data-tone="bad"] .fc-seal b { color: #5b7183; }

.fc-line {
  grid-area: line;
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: #6a625c;
}
.fc-grid {
  grid-area: grid;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.fc-cell {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 1px solid #f0e7e0;
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 11px;
  color: #5f646b;
  min-width: 0;
}
.fc-cell b {
  font-size: 9.5px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border-radius: 4px;
  padding: 1px 5px;
  flex: none;
}
.fc-cell.ji b { background: #93a3b1; }
.fc-cell span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-word {
  grid-area: word;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  color: #a89c93;
  letter-spacing: .3px;
}
.fc-word b {
  font-family: var(--font-serif);
  font-size: 12px;
  color: #8a7565;
  letter-spacing: 0;
}
.fc-tip { display: none; }

/* ---------- 欢迎区（上传 + 题型） ---------- */

.welcome-panels {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
  align-items: stretch;
}

/* 上传面板 */
.upload-panel {
  border: 1px solid #eae3da;
  border-radius: var(--radius);
  min-height: 250px;
  background: #f6f2e9;
  position: relative;
  overflow: hidden;
  padding: 26px 28px;
  display: flex;
  transition: outline-color .2s, background .2s;
}
.upload-panel.dragover {
  outline: 2px dashed var(--accent);
  outline-offset: -6px;
  background: #f4eee2;
}

.mini-label {
  font-size: 8px;
  letter-spacing: 1.8px;
  color: #a49481;
  font-weight: 600;
}

.upload-panel h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 13px 0 9px;
  line-height: 1.45;
}
.upload-panel p { font-size: 11px; color: #998f81; line-height: 1.9; margin: 0; }

.upload-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 19px 0 11px;
}
.upload-actions .primary { font-size: 12px; padding: 9px 16px; }
.upload-actions .primary span { font-size: 15px; }

.text-button {
  font-size: 11px;
  color: #887e70;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background .15s;
}
.text-button:hover { background: #ece6da; }

.upload-panel small { font-size: 8px; color: #aaa296; letter-spacing: .2px; }

.panel-copy { z-index: 2; position: relative; }

/* 手账纸艺术装饰 */
.paper-art {
  position: absolute;
  right: 16px;
  top: 22px;
  width: 190px;
  height: 215px;
  pointer-events: none;
}
.art-orbit {
  position: absolute;
  width: 185px;
  height: 185px;
  border-radius: 50%;
  background: #ece8db;
  top: 5px;
  right: -10px;
}
.paper-back {
  position: absolute;
  background: #d5dbc9;
  transform: rotate(12deg);
  height: 158px;
  width: 121px;
  top: 26px;
  left: 31px;
  border-radius: 4px;
}
.paper-front {
  position: absolute;
  background: #fffdf8;
  transform: rotate(-9deg);
  height: 162px;
  width: 122px;
  top: 16px;
  left: 20px;
  box-shadow: 0 7px 18px #84795b15;
  padding: 15px 14px;
}
.paper-tag { font-size: 6px; letter-spacing: 1.4px; color: #a3a699; }
.paper-front strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 24px;
  line-height: 1.1;
  font-weight: 400;
  margin: 11px 0;
  color: #586c54;
}
.paper-front em { font-weight: 400; color: #bd7858; font-style: italic; }
.paper-line { background: #e4e1d7; height: 2px; width: 66px; margin: 7px 0; }
.paper-line.short { width: 41px; }
.paper-tick {
  position: absolute;
  bottom: 8px;
  right: -13px;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #6b8268;
  font-size: 19px;
  transform: rotate(9deg);
  border: 4px solid #f6f2e9;
}
.art-spark { position: absolute; right: 18px; top: 0; color: #c09c56; font-size: 28px; }
.art-pencil {
  position: absolute;
  width: 7px;
  height: 92px;
  border-radius: 2px;
  background: #c98a64;
  transform: rotate(30deg);
  right: 23px;
  top: 78px;
  box-shadow: inset 2px 0 #dca886;
}
.art-pencil::after {
  content: '';
  position: absolute;
  bottom: -9px;
  border-top: 10px solid #656c54;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
}
.art-caption {
  position: absolute;
  bottom: 2px;
  font-family: var(--font-serif);
  font-style: italic;
  right: 12px;
  font-size: 11px;
  color: #a3a48e;
  transform: rotate(-5deg);
}

/* 题型面板 */
.type-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.type-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 8px 0 14px;
  gap: 8px;
}
.type-panel-head h2 { font-size: 17px; font-weight: 600; margin: 0; }
.type-hint { font-size: 9px; color: #a8aeb5; }

.type-grid { display: grid; gap: 6px; }

.type-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  background: #fafbfc;
  border: 1px solid #edeff2;
  text-align: left;
  transition: all .16s;
  position: relative;
}
.type-btn:hover {
  background: #fff;
  border-color: #e2d3c7;
  transform: translateX(2px);
}
.type-btn.active {
  background: var(--accent-light);
  border-color: #e8c6b3;
  box-shadow: 0 2px 8px #c8735215;
}
.type-btn.active .type-name { color: var(--accent-deep); }

.type-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid #e9ecef;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #8d99a6;
  flex: none;
  font-family: var(--font-serif);
}
.type-btn.active .type-icon {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.type-icon em { font-size: 8px; font-style: normal; opacity: .7; }

.type-name { font-size: 12px; font-weight: 500; display: block; }
.type-desc {
  font-size: 9px;
  color: #a5abb3;
  display: block;
  margin-top: 1px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.type-num {
  font-size: 9px;
  color: #b0b6bc;
  background: #fff;
  border: 1px solid #eef0f2;
  border-radius: 20px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
  flex: none;
}
.type-num.has { color: var(--accent); border-color: #f0d9cd; background: #fffaf7; }

.type-ai-entry {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-top: 1px dashed #eceff2;
  text-align: left;
  width: 100%;
  transition: opacity .15s;
}
.type-ai-entry:hover { opacity: .75; }
.entry-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f4f1fb;
  display: grid;
  place-items: center;
  font-size: 13px;
  flex: none;
}
.type-ai-entry b { font-size: 11px; display: block; font-weight: 500; }
.type-ai-entry small { font-size: 9px; color: #a5abb3; display: block; margin-top: 1px; }
.entry-arrow { margin-left: auto; color: #b9bec4; font-size: 12px; }

/* ---------- 工作台 ---------- */

.workbench {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 30px;
  align-items: start;
}
/* AI 解析是主力，给它最大面积：左边只留一条窄轨道放图片和模板 */
.workbench.has-side {
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
}
.workbench.reading { grid-template-columns: minmax(0, 1fr); }
.workbench.reading .wb-side { display: none; }
.workbench.hidden { display: none !important; }

.wb-side { display: grid; gap: 16px; min-width: 0; align-content: start; }
.wb-stage { min-width: 0; display: grid; }

/* ---------- 模式切换 ---------- */
.mode-switch {
  display: flex;
  gap: 8px;
  margin: 18px 0 22px;
  padding: 5px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.mode-switch button {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: #6d7680;
  background: transparent;
  transition: background .18s, color .18s;
  text-align: left;
}
.mode-switch button span { font-size: 15px; }
.mode-switch button small {
  margin-left: auto;
  font-size: 11px;
  font-weight: 400;
  color: #a2a9b1;
  letter-spacing: 0;
}
.mode-switch button:hover { background: #faf7f4; color: #3f4750; }
.mode-switch button.active { background: var(--accent); color: #fff; }
.mode-switch button.active small { color: rgba(255,255,255,.72); }

/* ---------- 长文精读 ---------- */
.reader-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 26px 18px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.reader-head {
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.reader-head h2 { font-size: 21px; margin: 6px 0 6px; letter-spacing: -.2px; }
.reader-head p { margin: 0; font-size: 12.5px; color: #7b838c; line-height: 1.75; max-width: 620px; }
.reader-settings { flex: none; }
.field { display: grid; gap: 5px; }
.field span { font-size: 10.5px; color: #9aa1a9; letter-spacing: .5px; }
.field select {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 12.5px;
  color: #3f4750;
  background: #fff;
  min-width: 168px;
  cursor: pointer;
}
.passage-input {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 14.5px;
  line-height: 1.85;
  color: #2b3138;
  background: #fdfdfc;
  transition: border-color .18s, box-shadow .18s;
}
.passage-input:focus {
  outline: none;
  border-color: #d9bda9;
  box-shadow: 0 0 0 3px rgba(200,115,82,.1);
  background: #fff;
}
.passage-input::placeholder { color: #b3b9c0; font-size: 13px; line-height: 1.9; }
.reader-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 13px;
  flex-wrap: wrap;
}
.reader-meta { font-size: 11.5px; color: #98a0a8; display: flex; gap: 7px; align-items: center; }
.reader-meta .dot { color: #d2d7dc; }
.reader-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- AI 主舞台 ---------- */
/* 顶部 header 是 sticky 的（72px），滚动到这里时要让它落在 header 下面，
   否则标题会被 header 盖住 —— 之前"解析被挡住"的观感有一半来自这里。 */
.ai-panel { padding: 0; overflow: hidden; scroll-margin-top: 86px; }
.ai-panel-head {
  padding: 20px 26px 16px;
  border-bottom: 1px solid #f2f0ee;
  flex-wrap: wrap;
  gap: 12px;
}
.ai-panel-head h2 { font-size: 20px; }
.ai-head-right { display: flex; align-items: center; gap: 10px; }
.seg {
  display: inline-flex;
  padding: 3px;
  background: #f4f2f0;
  border-radius: 9px;
  gap: 2px;
}
.seg button {
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 11.5px;
  color: #7b838c;
  transition: background .16s, color .16s;
}
.seg button.active { background: #fff; color: var(--accent-deep, #8e4f36); box-shadow: 0 1px 3px rgba(0,0,0,.07); font-weight: 600; }

.ai-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 26px;
  background: #fbfaf9;
  border-bottom: 1px solid #f2f0ee;
  font-size: 11.5px;
  color: #8d949c;
  flex-wrap: wrap;
}
.toolbar-actions { display: flex; gap: 8px; }
.mini-btn {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 11.5px;
  color: #5d656e;
  transition: border-color .16s, color .16s, background .16s;
}
.mini-btn:hover { border-color: #d9bda9; color: var(--accent-deep, #8e4f36); }
.mini-btn.danger { color: #b4553f; border-color: #eed6cc; }
.mini-btn.danger:hover { background: #fdf1ec; }

.ai-panel .ai-result { border: 0; border-radius: 0; background: transparent; padding: 24px 30px 34px; }
.ai-panel .ai-result.prose { font-size: 14.5px; line-height: 1.95; }

/* 流式输出时的光标 */
.stream-cursor {
  display: inline-block;
  width: 8px;
  height: 15px;
  margin-left: 2px;
  background: var(--accent);
  border-radius: 1px;
  vertical-align: -2px;
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { 0%,50% { opacity: 1; } 50.01%,100% { opacity: .15; } }

/* 空状态 */
.stage-empty {
  border: 1px dashed #e2ded9;
  border-radius: var(--radius);
  background: #fdfdfc;
  padding: 54px 24px;
  text-align: center;
  color: #9aa1a9;
}
.stage-empty-art { display: grid; gap: 8px; justify-items: center; margin-bottom: 16px; }
.se-line { display: block; width: 120px; height: 7px; border-radius: 4px; background: #f0ece7; }
.se-line.short { width: 74px; }
.stage-empty h3 { margin: 0 0 6px; font-size: 15px; color: #727a83; font-weight: 600; }
.stage-empty p { margin: 0; font-size: 12.5px; line-height: 1.8; }

/* ---------- 结果里的表格 ---------- */
.ai-result.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 16px;
  font-size: 13.5px;
  background: #fff;
  border: 1px solid #eee9e4;
  border-radius: 10px;
  overflow: hidden;
}
.ai-result.prose th,
.ai-result.prose td {
  padding: 9px 12px;
  border-bottom: 1px solid #f2eeea;
  text-align: left;
  vertical-align: top;
  line-height: 1.7;
}
.ai-result.prose th {
  background: #faf6f2;
  font-weight: 600;
  color: #8e4f36;
  font-size: 12.5px;
  white-space: nowrap;
}
.ai-result.prose tr:last-child td { border-bottom: 0; }
.ai-result.prose td:first-child { white-space: nowrap; color: #8d949c; width: 56px; }
.ai-result.prose tbody tr:hover td { background: #fdfbf9; }
.table-scroll { overflow-x: auto; }

/* ---------- 分享 ---------- */
.share-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 16px 0 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fdfbf9;
  text-align: left;
  transition: border-color .18s, background .18s;
}
.share-entry:hover { border-color: #d9bda9; background: #fbf5f0; }
.share-icon {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
}
.share-entry b { display: block; font-size: 12.5px; color: #3f4750; font-weight: 600; }
.share-entry small { display: block; font-size: 10.5px; color: #9aa1a9; margin-top: 2px; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(28, 32, 36, .42);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 200;
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative;
  width: min(520px, 100%);
  background: var(--paper);
  border-radius: 18px;
  padding: 30px 30px 26px;
  box-shadow: 0 24px 60px rgba(20, 24, 28, .22);
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 28px; height: 28px; border-radius: 8px;
  color: #9aa1a9; font-size: 14px;
}
.modal-close:hover { background: #f4f1ee; }
.modal-card h2 { margin: 6px 0 10px; font-size: 22px; letter-spacing: -.2px; }
.modal-desc { margin: 0 0 16px; font-size: 12.5px; line-height: 1.85; color: #6d7680; }
.modal-desc b { color: #8e4f36; }
.share-url-box {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px;
  background: #fbf7f3;
  border: 1px solid #f0e4db;
  border-radius: 11px;
}
.share-url-box code {
  flex: 1;
  font-family: ui-monospace, 'Cascadia Code', Menlo, monospace;
  font-size: 13.5px;
  color: #8e4f36;
  word-break: break-all;
}
.share-tips {
  margin: 14px 0 0; padding-left: 18px;
  font-size: 12px; line-height: 1.95; color: #7b838c;
}
.share-other {
  margin-top: 16px; padding: 12px 14px;
  background: #f7f8fa; border-radius: 11px;
  font-size: 12px; line-height: 1.8; color: #6d7680;
}
.share-other b { display: block; color: #3f4750; margin-bottom: 2px; }


.preview-wrap {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  /* 不再吸顶：往下划时原图跟着页面一起走开，不会一直悬在那儿挡住解析 */
  position: static;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px 9px 14px;
  border-bottom: 1px solid #f0f2f4;
  font-size: 10px;
  color: #949aa2;
  letter-spacing: .3px;
}

/* 整条标题都是「收起 / 展开」开关：AI 解析是主角，原图随时能让位 */
.preview-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  padding: 2px 0;
  font-size: 10.5px;
  color: #949aa2;
  letter-spacing: .3px;
  text-align: left;
}
.preview-toggle .pt-arrow {
  font-size: 11px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform .18s;
  color: #b3a89f;
}
.preview-toggle .pt-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-toggle .pt-hint {
  margin-left: auto;
  font-size: 9.5px;
  color: #c0c5cb;
  flex: none;
}
.preview-toggle:hover { color: var(--accent); }
.preview-toggle:hover .pt-hint { color: var(--accent); }

.preview-wrap.folded .preview-toggle .pt-arrow { transform: rotate(-90deg); }
.preview-wrap.folded .preview-media,
.preview-wrap.folded .preview-foot { display: none; }
.preview-wrap.folded .preview-head { border-bottom: 0; }

.preview-remove {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: #a9afb6;
  font-size: 13px;
  display: grid;
  place-items: center;
  flex: none;
}
.preview-remove:hover { background: #f5f6f8; color: #7d858e; }

.preview-media { background: #fbfbfc; }
.preview-wrap img {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  background: #fbfbfc;
  cursor: zoom-in;
}

/* ---- 多页：侧栏里一页一张缩略图，能删、能继续加 ---- */
.page-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  max-height: 46vh;
  overflow-y: auto;
}
.page-stack:empty { display: none; }

.page-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #eceef1;
  background: #fff;
}
.page-stack.multi .page-item img { max-height: 168px; }

.page-num {
  position: absolute;
  top: 6px;
  left: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: rgba(24, 28, 33, .6);
  color: #fff;
  font-size: 10px;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.page-del {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: rgba(24, 28, 33, .58);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity .15s, background .15s;
}
.page-item:hover .page-del { opacity: 1; }
.page-del:hover { background: #c0574d; }
@media (hover: none) { .page-del { opacity: .9; } }

.page-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: calc(100% - 16px);
  margin: 0 8px 8px;
  padding: 7px 0;
  border-radius: 8px;
  border: 1px dashed #dcdfe4;
  background: #fcfcfd;
  color: #8a9199;
  font-size: 10.5px;
  transition: .15s;
}
.page-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}
.page-add .pa-plus { font-size: 12px; line-height: 1; }

.preview-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid #f0f2f4;
  font-size: 10px;
  color: #9aa0a8;
}
.preview-foot-right { display: flex; align-items: center; gap: 2px; flex: none; }
.preview-change {
  font-size: 10px;
  color: var(--accent);
  padding: 3px 6px;
  border-radius: 5px;
}
.preview-change:hover { background: var(--accent-light); }



/* 通用面板 */
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 13px;
  border-bottom: 1px solid #f2f4f6;
}
.panel-head h2 { font-size: 17px; font-weight: 600; margin: 7px 0 0; }

.panel-tag {
  font-size: 9px;
  color: #a5886f;
  background: #faf5ee;
  border: 1px solid #f0e4d6;
  border-radius: 20px;
  padding: 4px 10px;
  white-space: nowrap;
  flex: none;
}
.panel-tag.ai-tag { color: #7c8fa6; background: #f3f6fa; border-color: #e4ebf2; }

/* 模板结果 */
.result-body { display: grid; gap: 15px; }

.result-block {
  background: #fbfaf8;
  border: 1px solid #f1eee8;
  border-radius: 9px;
  padding: 14px 16px;
}
.result-block h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-deep);
  margin: 0 0 9px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.result-block h3::before {
  content: '';
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--accent);
  flex: none;
}
.result-block ul { margin: 0; padding-left: 16px; }
.result-block li {
  font-size: 11px;
  line-height: 1.85;
  color: #5b636b;
  margin-bottom: 4px;
}
.result-block li::marker { color: #d3b7a6; }

.result-body .tip {
  background: #f2f7f2;
  border-left: 3px solid #8aa78d;
  border-radius: 8px;
  padding: 12px 15px;
  font-size: 11px;
  line-height: 1.8;
  color: #58705c;
}

.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #f2f4f6;
  flex-wrap: wrap;
}

.btn-ai {
  background: linear-gradient(135deg, #c87352, #b9694a);
  color: #fff;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: 0 4px 12px #c8735230;
  transition: transform .16s, box-shadow .16s;
}
.btn-ai:hover { transform: translateY(-1px); box-shadow: 0 6px 16px #c8735240; }
.btn-ai span { margin-right: 4px; }
.btn-ai:disabled { opacity: .65; cursor: wait; transform: none; }

.secondary {
  padding: 11px 16px;
  background: #fff;
  border: 1px solid #e3e7eb;
  border-radius: 8px;
  font-size: 12px;
  color: #5d6670;
  transition: background .15s, border-color .15s;
}
.secondary:hover { background: #fafbfc; border-color: #d6dbe1; }

/* AI loading */
.ai-loading { text-align: center; padding: 30px 20px 26px; }
.ai-loading p { margin: 0; font-size: 12px; color: #6d7680; }

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #f0e2d9;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-track {
  height: 4px;
  background: #edeff2;
  border-radius: 10px;
  overflow: hidden;
  margin: 14px auto 8px;
  max-width: 260px;
}
.progress-track.slim { height: 3px; }
.progress-track > div {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #d99a7c, var(--accent));
  border-radius: 10px;
  transition: width .9s linear;
}

.ai-progress {
  font-size: 10px !important;
  color: #a4aab2 !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

/* AI 结果正文 */
.ai-result {
  font-size: 12px;
  line-height: 1.85;
  color: #3f4750;
  white-space: pre-wrap;
}
.ai-result.prose { white-space: normal; }

.ai-result.prose h3,
.ai-result.prose h4,
.ai-result.prose h5 {
  color: var(--accent-deep);
  margin: 22px 0 8px;
  line-height: 1.5;
  font-weight: 600;
  padding-bottom: 7px;
  border-bottom: 1px dashed #f0e4dc;
}
/* ## 用 h3（板块标题），### 用 h4（每道题），拉开层级差 */
.ai-result.prose h3 { font-size: 16.5px; letter-spacing: -.1px; }
.ai-result.prose h4 { font-size: 14.5px; border-bottom: 0; padding-bottom: 0; margin: 16px 0 5px; }
.ai-result.prose h5 { font-size: 13.5px; border-bottom: 0; padding-bottom: 0; margin: 13px 0 4px; color: #6d7680; }
.ai-result.prose h3:first-child,
.ai-result.prose h4:first-child,
.ai-result.prose h5:first-child { margin-top: 0; }

.ai-result.prose p { margin: 7px 0; }
.ai-result.prose ul,
.ai-result.prose ol { padding-left: 20px; margin: 8px 0; }
.ai-result.prose li { margin-bottom: 4px; }
.ai-result.prose li::marker { color: #d3b7a6; }
.ai-result.prose strong { color: #8e4f36; font-weight: 600; }
.ai-result.prose em { color: #6b7683; }
.ai-result.prose code {
  background: #f7f1ec;
  color: #a95f42;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .9em;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.ai-result.prose pre {
  background: #faf7f4;
  border: 1px solid #f0ebe5;
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  margin: 10px 0;
}
.ai-result.prose pre code {
  background: transparent;
  padding: 0;
  white-space: pre;
  display: block;
  line-height: 1.65;
  color: #5b636b;
}
.ai-result.prose blockquote {
  margin: 10px 0;
  padding: 8px 14px;
  border-left: 3px solid #e5d3c7;
  background: #fbf8f5;
  color: #6b7580;
  border-radius: 0 6px 6px 0;
}
.ai-result.prose hr {
  border: none;
  border-top: 1px dashed #ece4dd;
  margin: 16px 0;
}
.ai-result.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.ai-usage {
  margin-top: 16px;
  padding-top: 11px;
  border-top: 1px dashed #eeeae4;
  font-size: 9px;
  color: #adb3ba;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 错误 / 配置引导 */
.ai-error {
  background: #fdf4f2;
  border-left: 3px solid #c4674f;
  border-radius: 9px;
  padding: 15px 17px;
}
.ai-error-title { font-size: 12px; font-weight: 600; color: #a34f3a; line-height: 1.7; }
.ai-error-hint { font-size: 11px; color: #8a7570; margin-top: 7px; line-height: 1.8; }

.ai-setup { font-size: 12px; }
.ai-setup-title { font-size: 13px; font-weight: 600; color: var(--accent-deep); margin-bottom: 9px; }
.ai-setup-desc { font-size: 11px; color: #7c848d; line-height: 1.85; margin: 0 0 14px; }
.setup-steps { padding-left: 18px; margin: 0 0 16px; }
.setup-steps li { font-size: 11px; line-height: 1.9; color: #5b636b; margin-bottom: 3px; }
.setup-steps code {
  background: #f7f1ec;
  color: #a95f42;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .92em;
}
.setup-providers {
  background: #fbfaf8;
  border: 1px solid #f1eee8;
  border-radius: 9px;
  padding: 13px 15px;
}
.setup-label { font-size: 10px; color: #a5abb3; margin-bottom: 9px; letter-spacing: .3px; }
.setup-providers ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.setup-providers li {
  font-size: 11px;
  line-height: 1.7;
  padding-bottom: 10px;
  border-bottom: 1px solid #f2efea;
}
.setup-providers li:last-child { border: 0; padding-bottom: 0; }
.setup-providers li strong { font-size: 11.5px; color: #4d5560; }
.setup-badge {
  font-size: 8px;
  color: #fff;
  background: var(--accent);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: middle;
}
.setup-key { display: block; color: #8d949c; font-size: 10.5px; margin-top: 2px; }
.setup-key code { background: #f2f5f2; color: #547769; padding: 1px 4px; border-radius: 3px; }
.setup-providers a { color: var(--accent); font-size: 10.5px; }
.setup-model { display: block; font-size: 9.5px; color: #b0b6bc; margin-top: 2px; }

/* ---------- 题库 ---------- */

.library-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-title { display: flex; align-items: center; gap: 9px; }
.section-title h2 { font-size: 17px; font-weight: 600; margin: 0; }
.section-title > span {
  font-size: 10px;
  background: #eaeef1;
  color: #7b8491;
  border-radius: 5px;
  padding: 3px 7px;
  font-variant-numeric: tabular-nums;
}

.library-tools { display: flex; gap: 11px; }

.search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #e4e7eb;
  border-radius: 7px;
  background: #fff;
  padding: 0 11px;
  transition: border-color .15s;
}
.search-box:focus-within { border-color: #ddb9a4; }
.search-box > span { font-size: 18px; color: #a2a9b2; line-height: 1; }
.search-box input {
  border: 0;
  background: none;
  width: 200px;
  font-size: 11px;
  padding: 9px 0;
  color: #535f6d;
  outline: none;
}
.search-box input::placeholder { color: #adb3ba; }

.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e7e9ed;
  margin: 16px 0 20px;
  gap: 14px;
}
.filter-tabs { display: flex; gap: 24px; }
.filter-tabs button {
  padding: 8px 1px 12px;
  color: #949ba4;
  font-size: 11px;
  border-bottom: 2px solid transparent;
  transition: color .15s;
}
.filter-tabs button:hover { color: #6f7883; }
.filter-tabs button.active {
  color: var(--accent-deep);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.sort-wrap { display: flex; gap: 14px; align-items: center; padding-bottom: 9px; }
.sample-hint { font-size: 9px; color: #b0b6bc; }

/* 当前题型胶囊：点了题型后出现，点一下就取消筛选 */
.active-type-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--accent-light);
  color: var(--accent-deep);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.active-type-chip b { font-weight: 600; }
.active-type-chip span { color: #c99a83; font-size: 9px; }
.active-type-chip:hover { background: #f3e1d8; }

.danger-link { font-size: 10px; color: #b8827a; }
.danger-link:hover { color: #a3544a; text-decoration: underline; }

/* 卡片网格 */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.question-card {
  background: var(--paper);
  border: 1px solid #e5e8ed;
  border-radius: 10px;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.question-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #dde3e8;
}

.card-image {
  height: 132px;
  position: relative;
  background: #f3f5f4;
  overflow: hidden;
  border-bottom: 1px solid #eef0f2;
  cursor: zoom-in;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.card-image.tone-1 { background: #f1efea; }
.card-image.tone-2 { background: #edf0f3; }
.card-image.tone-3 { background: #eff1eb; }
.card-image.tone-4 { background: #f3eeec; }
.card-image.tone-5 { background: #eeedf3; }

/* 没图片时的纸片样式 */
.card-noimg {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 14px;
}
.card-noimg .mini-paper {
  background: #fffdfa;
  border: 1px solid #ecebe6;
  padding: 12px 14px;
  transform: rotate(-2deg);
  font-family: var(--font-serif);
  font-size: 9px;
  line-height: 1.7;
  color: #82837e;
  box-shadow: 0 3px 8px #00000006;
  width: 100%;
  max-height: 100%;
  overflow: hidden;
}
.card-noimg .mini-paper strong {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: #5f6a63;
  margin-bottom: 5px;
}

.card-type-badge {
  position: absolute;
  top: 9px;
  left: 9px;
  background: #ffffffed;
  border: 1px solid #edeef0;
  padding: 3px 7px;
  font-size: 8.5px;
  color: #8d949c;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

.card-body { padding: 13px 14px 10px; flex: 1; display: flex; flex-direction: column; }

.card-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  gap: 8px;
}

.category-chip {
  font-size: 9px;
  color: #7b93a8;
  background: #eff3f8;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.status-chip {
  font-size: 9px;
  color: #b18f5a;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.status-chip::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.status-chip.mastered { color: #6e927b; }
.status-chip.new { color: #97a0ab; }

.card-note {
  font-size: 11px;
  color: #6f7883;
  line-height: 1.7;
  margin: 0 0 10px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 37px;
}
.card-note.empty { color: #b3b9bf; font-style: italic; }

.card-date {
  font-size: 9px;
  color: #b0b6bc;
  margin-top: auto;
  font-variant-numeric: tabular-nums;
}

.card-bottom {
  display: flex;
  align-items: center;
  border-top: 1px solid #f1f3f5;
  padding: 8px 14px;
  color: #a9afb6;
  font-size: 9px;
  gap: 6px;
}
.card-action {
  font-size: 9.5px;
  color: #8d97a2;
  padding: 3px 5px;
  border-radius: 4px;
  transition: background .15s, color .15s;
}
.card-action:hover { background: #f5f7f9; color: #5f6a75; }
.card-action.danger:hover { background: #fdf3f1; color: #b05a49; }
.card-action.master { margin-left: auto; }
.card-action.master.on { color: var(--green); }

/* 空状态 */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  border: 1px dashed #dfe3e8;
  border-radius: 11px;
  padding: 52px 20px;
  color: #9099a5;
  background: #fdfdfe;
}
.empty-state > span { font-size: 30px; color: #cbb9a4; display: block; margin-bottom: 8px; }
.empty-state h3 { font-size: 15px; color: #66737e; font-weight: 500; margin: 0 0 7px; }
.empty-state p { font-size: 11px; margin: 0; line-height: 1.8; }

footer {
  margin-top: 34px;
  padding: 20px 0 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: #b0b6bd;
  font-size: 9px;
  gap: 16px;
  flex-wrap: wrap;
}
footer b { font-weight: 500; color: #919ca6; }

/* toast */
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translate(-50%, 16px);
  background: #354a3e;
  color: #fff;
  border-radius: 8px;
  padding: 12px 22px;
  font-size: 12px;
  box-shadow: 0 6px 26px #0002;
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  max-width: 80vw;
  text-align: center;
}
#toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* 图片放大查看 */
.image-dialog {
  border: 1px solid #e6e4e0;
  border-radius: 14px;
  padding: 14px;
  width: min(1100px, 94vw);
  max-height: 92vh;
  overflow: auto;
  box-shadow: 0 30px 100px #25304025;
  background: #fff;
}
.image-dialog::backdrop { background: #25303966; backdrop-filter: blur(4px); }
.image-dialog img { display: block; width: 100%; height: auto; border-radius: 8px; }
.image-dialog > button {
  display: block;
  margin: 0 0 10px auto;
  font-size: 18px;
  color: #9aa1a9;
  padding: 2px 8px;
}

.mobile-menu { display: none; font-size: 20px; padding: 4px 6px; color: #8d959d; }

/* ============================ 响应式 ============================ */

@media (min-width: 1450px) {
  .paper-art { right: 48px; }
  .upload-panel { padding-left: 34px; }
  .card-image { height: 150px; }
}

@media (max-width: 1200px) {
  :root { --sidebar: 208px; }
  #sidebar { padding-left: 12px; padding-right: 12px; }
  main { padding: 28px 24px 0; }
  header { padding: 0 24px; }
  .paper-art { right: -18px; transform: scale(.86); transform-origin: right center; }
  .upload-panel { padding: 23px 20px; }
  .upload-panel h2 { font-size: 20px; }
  .stat { padding: 0 16px; gap: 10px; }
  .stat-icon { width: 34px; height: 34px; font-size: 15px; }
  .cards { gap: 13px; }
  h1 { font-size: 23px; }
  .workbench.has-side { grid-template-columns: 270px minmax(0, 1fr); }
}

@media (max-width: 980px) {
  .paper-art { opacity: .35; right: -36px; }
  .welcome-panels { grid-template-columns: 1.25fr 1fr; }
  .daily-band { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-icon { display: none; }
  .stat { padding: 0 18px; }
  .header-note { display: none; }
  .date-tag { display: none; }
  .search-box input { width: 140px; }
  .sample-hint { display: none; }
  .workbench.has-side { grid-template-columns: 240px minmax(0, 1fr); }
}

@media (max-width: 820px) {
  .welcome-panels { grid-template-columns: 1fr; }
  .workbench.has-side { grid-template-columns: 1fr; }
  .preview-wrap { position: static; }
  .preview-wrap img { max-height: 220px; }
  /* 单列布局下 AI 解析永远排第一：不再被原图和答题模板压在下面 */
  .workbench.has-ai .wb-stage { order: -1; }
}

@media (max-width: 720px) {
  :root { --sidebar: 0px; }
  #sidebar {
    width: 240px;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 10px 0 34px #00000014;
  }
  body.menu-open #sidebar { transform: translateX(0); }
  body.menu-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: #25303944;
    z-index: 25;
  }
  .mobile-menu { display: block; }

  header { height: 58px; padding: 0 16px; }
  main { padding: 22px 16px 0; }
  .page-heading { margin-bottom: 20px; flex-direction: column; gap: 10px; }
  h1 { font-size: 21px; }
  .eyebrow { font-size: 8px; letter-spacing: 1.6px; }

  .stats { padding: 15px 0; margin-bottom: 18px; }
  .stat { padding: 0 11px; flex-direction: column; align-items: flex-start; gap: 0; }
  .stat-label { font-size: 9px; }
  .stat strong { font-size: 19px; }
  .stat small { font-size: 8px; margin-left: 2px; }

  #photoMode, #readMode, .library { scroll-margin-top: 72px; }
  .daily-band { gap: 11px; margin-bottom: 14px; }
  .daily-quote { padding: 15px 16px 12px 18px; }
  .dq-en { font-size: 15px; }
  .dq-zh { font-size: 11.5px; }
  .dq-mark { font-size: 58px; right: 8px; }
  .fortune { padding: 13px 14px 12px; min-height: 0; }
  .fc-seal { width: 52px; height: 52px; }
  .fc-seal b { font-size: 19px; }

  .upload-panel { min-height: 232px; padding: 20px 18px; }
  .upload-panel h2 { font-size: 19px; }
  .paper-art { opacity: .85; right: 6px; transform: scale(.78); transform-origin: right top; }

  .type-panel { padding: 18px 16px 14px; }
  .type-desc { display: none; }

  .library-heading { flex-direction: column; align-items: stretch; gap: 12px; }
  .library-tools, .search-box { width: 100%; }
  .search-box input { width: 100%; }
  .filter-tabs { gap: 20px; }
  .sort-wrap { gap: 0; }

  .cards { grid-template-columns: 1fr; gap: 12px; }
  .card-image { height: 150px; }
  .card-body { padding: 12px 12px 9px; }
  .card-bottom { padding: 8px 12px; }

  .panel { padding: 17px 16px; }
  .panel-head h2 { font-size: 15px; }
  .result-actions { flex-direction: column; }
  .result-actions .btn-ai, .result-actions .secondary { width: 100%; text-align: center; }

  footer { flex-direction: column; gap: 6px; font-size: 8px; }
}

@media (max-width: 560px) {
  .mode-switch { margin: 14px 0 18px; padding: 4px; }
  .mode-switch button {
    padding: 9px 10px;
    font-size: 12.5px;
    gap: 6px;
    white-space: nowrap;
    justify-content: center;
  }
  .mode-switch button small { display: none; }
  .reader-panel { padding: 20px 16px 14px; }
  .reader-head { flex-direction: column; gap: 12px; }
  .reader-head h2 { font-size: 18px; }
  .reader-settings, .field select { width: 100%; min-width: 0; }
  .passage-input { min-height: 150px; font-size: 13.5px; }
  .reader-foot { flex-direction: column; align-items: stretch; }
  .reader-actions { justify-content: space-between; }
  .ai-panel-head { padding: 16px 16px 13px; }
  .ai-panel-head h2 { font-size: 17px; }
  .ai-panel { scroll-margin-top: 70px; }
  .ai-panel .ai-result { padding: 18px 16px 26px; font-size: 14px; }
  .ai-toolbar { padding: 9px 16px; }
  .ai-result.prose table { font-size: 12.5px; }
  .ai-result.prose th, .ai-result.prose td { padding: 7px 8px; }
  .ai-result.prose td:first-child { width: 40px; }
  .modal-card { padding: 26px 20px 20px; }
  .stats {
    grid-template-columns: repeat(4, 1fr);
    padding: 14px 0;
    gap: 0;
  }
  .stat,
  .stat:nth-child(3),
  .stat:nth-child(4) {
    padding: 0 5px;
    border: 0;
    border-top: 0;
    flex-direction: column;
    align-items: center;
    gap: 0;
    text-align: center;
  }
  .stat-label { font-size: 8.5px; margin-bottom: 4px; letter-spacing: -.2px; }
  .stat strong { font-size: 18px; }
  .stat small { font-size: 8px; margin-left: 2px; }
  .paper-art { opacity: .5; right: 4px; transform: scale(.62); transform-origin: right top; }
}

@media (max-width: 390px) {
  .paper-art { opacity: .38; right: 2px; transform: scale(.56); transform-origin: right top; }
  .card-image { height: 135px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation-duration: .01ms !important; }
}

/* ============================================================
   三界面布局（拍照解题 / 长文精读 / 我的题库）
   每个功能一个独立界面，一屏能看完，不用往下翻着找
   ============================================================ */

/* ---------- 侧边栏瘦身：只做导航，把地方让给内容 ---------- */
:root { --sidebar: 196px; }

#sidebar { padding: 22px 12px 16px; }
.brand { font-size: 18px; gap: 8px; padding: 0 4px; letter-spacing: 1px; }
.brand-mark { width: 30px; height: 34px; font-size: 17px; border-radius: 9px; }
.brand-en { font-size: 8px; letter-spacing: 1.4px; }
.brand small { font-size: 8.5px; margin-top: 3px; }

.nav-label { font-size: 9.5px; letter-spacing: 1px; padding: 17px 9px 6px; }
.nav-item { padding: 8px 9px; min-height: 34px; gap: 8px; font-size: 11.5px; border-radius: 6px; }
.nav-item .nav-icon { width: 14px; font-size: 12.5px; }
.nav-item .func-body b { font-size: 12px; }
.nav-item .nav-count { font-size: 9.5px; padding: 1px 6px; }
.side-today { padding: 8px 9px; font-size: 11px; }
.share-entry { padding: 10px 11px; margin-top: 16px; }
.share-entry b { font-size: 11.5px; }
.share-entry small { font-size: 9.5px; }
.side-bottom { margin-top: 16px; padding-top: 13px; font-size: 9.5px; }

/* ---------- 界面切换 ---------- */
.view { animation: viewIn .2s ease both; scroll-margin-top: 86px; }
.view.hidden { display: none !important; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}
.stage-mount { display: block; }

.view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 18px;
}
.view-head h1 { font-size: 23px; margin: 7px 0 6px; }
.view-head p { margin: 0; font-size: 12px; color: #8a9098; line-height: 1.7; }

.depth-field { flex: none; }
.depth-field select { min-width: 168px; }

.new-btn { align-self: flex-start; flex: none; font-size: 12.5px; padding: 10px 18px; }

/* ---------- 拍照界面：上传 + 题型（一张卡） + 今日（抽签/句子） ---------- */
.photo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  margin-bottom: 20px;
  align-items: stretch;
}

.capture-card {
  background: #f6f2e9;
  border: 1px solid #eae3da;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: outline-color .2s, background .2s;
}
.capture-card.dragover {
  outline: 2px dashed var(--accent);
  outline-offset: -6px;
  background: #f4eee2;
}

.capture-main {
  position: relative;
  flex: 1;
  min-height: 202px;
  padding: 24px 26px 22px;
  display: flex;
  align-items: center;
}
.capture-copy { position: relative; z-index: 2; max-width: calc(100% - 190px); }
.capture-copy h2 { font-size: 22px; font-weight: 600; margin: 11px 0 8px; line-height: 1.4; }
.capture-copy p { margin: 0; font-size: 11.5px; color: #998f81; line-height: 1.85; }

.capture-actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* 有图之后按钮从 2 个变 3 个（分析 / 再加一页 / 清空），窄屏上排成两行更省地方 */
.capture-card.ready .btn-album { padding: 11px 16px; font-size: 13px; }

/* 正在把图片压小 / 逐页入队时先别让人连点 */
.capture-card.loading { opacity: .72; pointer-events: none; }

/* 主行动按钮：一眼就知道要干什么 */
.btn-capture {
  background: var(--accent);
  color: #fff;
  border-radius: 11px;
  padding: 15px 26px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 6px 18px #c8735238;
  transition: background .16s, transform .16s, box-shadow .16s;
  white-space: nowrap;
}
.btn-capture span { font-size: 19px; font-weight: 400; }
.btn-capture:hover { background: var(--accent-deep); transform: translateY(-1px); box-shadow: 0 9px 22px #c8735245; }
.btn-capture:active { transform: translateY(1px); }

.btn-album {
  border: 1px solid #ded3c3;
  background: #fffdf9;
  color: #7d7264;
  border-radius: 11px;
  padding: 14px 18px;
  font-size: 13px;
  white-space: nowrap;
  transition: background .16s, border-color .16s;
}
.btn-album:hover { background: #fff; border-color: #cbbda8; }

.capture-card .paper-art {
  right: 12px;
  top: 20px;
  transform: scale(.8);
  transform-origin: right top;
}

/* 题型：横向一排，不再占掉半屏 */
.type-strip {
  border-top: 1px solid #ece5d9;
  background: #fffdf9;
  padding: 12px 20px 15px;
}
.type-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}
.type-ai-link {
  font-size: 10.5px;
  color: #a08b78;
  padding: 3px 7px;
  border-radius: 5px;
  transition: color .15s, background .15s;
}
.type-ai-link:hover { color: var(--accent); background: var(--accent-light); }

.type-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.type-strip .type-btn {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 9px 9px 10px;
  border-radius: 9px;
  position: relative;
}
.type-strip .type-btn:hover { transform: translateY(-1px); }
.type-strip .type-icon { width: 24px; height: 24px; font-size: 11px; }
.type-strip .type-name { font-size: 11.5px; white-space: nowrap; }
.type-strip .type-desc { display: none; }
.type-strip .type-num {
  position: absolute;
  top: 7px;
  right: 7px;
  font-size: 8.5px;
  padding: 0 5px;
  min-width: 15px;
  opacity: 0;
  transition: opacity .15s;
}
.type-strip .type-num.has { opacity: 1; }

/* 今日卡：抽签按钮做大，旁边塞一句英文，不额外占高度 */
.today-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 11px;
  min-width: 0;
}
.today-card .fortune { min-height: 0; padding: 14px 16px 15px; }
.today-card .fortune-idle { gap: 11px; padding: 2px 0; }
.today-card .fortune-idle p { font-size: 11px; }
.today-card .lot-tube { width: 54px; height: 38px; }
.today-card .draw-btn {
  width: 100%;
  padding: 15px 18px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 3px;
  border-radius: 11px;
  box-shadow: 0 6px 16px #c8735233;
}
.today-card .draw-btn:hover { box-shadow: 0 9px 20px #c8735245; }

.today-card .daily-quote { padding: 12px 15px 11px 17px; }
.today-card .dq-top { margin-bottom: 6px; }
.today-card .dq-en { font-size: 14px; line-height: 1.5; margin-bottom: 4px; }
.today-card .dq-zh { font-size: 11px; line-height: 1.6; }
.today-card .dq-mark { font-size: 50px; top: -14px; right: 8px; }
.today-card .dq-by { font-size: 9px; }
.today-card .dq-next { font-size: 10px; }
.today-card .daily-quote figcaption { padding-top: 7px; }

/* ---------- 三界面的响应式 ---------- */
@media (max-width: 1200px) {
  :root { --sidebar: 180px; }
  .photo-grid { grid-template-columns: minmax(0, 1fr) 288px; }
  .capture-copy h2 { font-size: 20px; }
  .new-btn { font-size: 12px; padding: 9px 15px; }
}

@media (max-width: 980px) {
  .photo-grid { grid-template-columns: 1fr; }
  .today-card { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .capture-card .paper-art { opacity: .38; right: -14px; }
  .type-strip .type-name { font-size: 11px; }
}

@media (max-width: 720px) {
  :root { --sidebar: 0px; }
  #sidebar { width: 224px; }

  .view-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .view-head h1 { font-size: 20px; }
  .depth-field, .depth-field select { width: 100%; }
  .new-btn { align-self: stretch; text-align: center; }

  .photo-grid { gap: 11px; margin-bottom: 14px; }
  .capture-main { padding: 18px 16px 16px; min-height: 0; }
  .capture-copy { max-width: calc(100% - 110px); }
  .capture-copy h2 { font-size: 18px; margin: 8px 0 0; }
  .capture-copy p { display: none; }
  .capture-actions { flex-direction: column; align-items: stretch; gap: 8px; margin-top: 14px; }
  .btn-capture { padding: 13px 14px; font-size: 14px; }
  .btn-album { padding: 10px 12px; font-size: 12px; text-align: center; }

  /* 有图时：主按钮占整行，「再加一页」「清空」并排一行，不额外多占高度 */
  .capture-card.ready .capture-actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }
  .capture-card.ready .btn-capture { flex: 1 1 100%; justify-content: center; }
  .capture-card.ready .btn-album {
    flex: 1 1 0;
    min-width: 0;
    padding: 10px 6px;
    font-size: 12px;
    text-align: center;
    justify-content: center;
  }
  .capture-card .paper-art { transform: scale(.58); right: -16px; top: 8px; opacity: .5; }

  .type-strip { padding: 11px 12px 13px; }
  .type-strip-head { margin-bottom: 8px; }
  .type-ai-link { font-size: 9.5px; padding: 2px 4px; }
  .type-grid { gap: 5px; }
  .type-strip .type-btn { padding: 7px 4px 8px; align-items: center; gap: 5px; }
  .type-strip .type-name { font-size: 9.5px; letter-spacing: -.2px; }
  .type-strip .type-icon { width: 21px; height: 21px; font-size: 10px; }
  .type-strip .type-num { display: none; }

  .today-card { grid-template-columns: 1fr; gap: 9px; }
  .today-card .draw-btn { padding: 13px 16px; font-size: 14px; }
  .today-card .daily-quote { padding: 11px 13px 10px 15px; }
  .today-card .dq-en { font-size: 13px; }
  .today-card .dq-zh { font-size: 10.5px; }
}

/* 侧栏底部信息贴到底部，中间留白不显得空 */
.side-bottom { margin-top: auto; }

/* 手机上让主按钮再宽一点，一眼就能戳到 */
@media (max-width: 720px) {
  .capture-copy { max-width: calc(100% - 92px); }
  .capture-card .paper-art { opacity: .42; }
}

/* ============================================================
   去掉答题模板之后的调整：AI 解析就是唯一主角
   原图只占一条窄轨道，解析吃满剩下的全部宽度
   ============================================================ */

.workbench.has-side {
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 16px;
}
.workbench.has-side .wb-side { position: relative; }

.ai-panel .ai-result {
  padding: 26px 34px 44px;
  max-width: 980px;
}
.ai-panel .ai-result.prose { font-size: 15px; line-height: 2; }
.ai-panel .ai-result.prose h3 { font-size: 17.5px; margin: 26px 0 8px; }
.ai-panel .ai-result.prose h4 { font-size: 15.5px; margin: 18px 0 6px; }

/* 解析里的「第 N 题」小标题稍微抬一下，逐题扫读更顺 */
.ai-result.prose h3:has(+ p) { scroll-margin-top: 100px; }

/* ---------- 上传卡：有图之后主按钮变成「开始 AI 分析」 ---------- */
.capture-card.ready {
  background: #f4f1e8;
  border-color: #e5dccd;
}
.capture-card.ready .capture-main { padding-bottom: 20px; }
.capture-card.ready .paper-art { opacity: .5; }

.btn-capture#quickAiBtn {
  background: var(--accent);
  box-shadow: 0 8px 22px #c8735242;
}
.btn-capture#quickAiBtn:hover { background: var(--accent-deep); }

/* ---------- 原图上的题型徽标 ---------- */
.preview-type-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  letter-spacing: .3px;
  color: #9aa0a8;
  background: #f4f6f8;
  border: 1px solid #eceff2;
  border-radius: 20px;
  padding: 3px 9px;
  white-space: nowrap;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview-type-chip.detected {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.preview-type-chip.detected::before {
  content: '✓';
  font-size: 9px;
  opacity: .9;
}

/* ---------- 工具栏：存入题库 ---------- */
.mini-btn.strong {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.mini-btn.strong:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.mini-btn.saved {
  background: #eef6f1;
  border-color: #cfe6d9;
  color: #4d7f63;
}

/* ---------- 题库卡片：错因标签 / 有解析标记 / 看解析按钮 ---------- */
.doc-chip {
  font-size: 9px;
  letter-spacing: .3px;
  color: #4d7f63;
  background: #eff6f2;
  border: 1px solid #d5e8dd;
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}
.card-errs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 6px;
}
.err-tag {
  font-size: 9.5px;
  color: #a8644a;
  background: #fbf1ec;
  border: 1px solid #f2ddd2;
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}
.card-action.open { color: var(--accent); font-weight: 600; }
.card-action.open:hover { background: var(--accent-light); }

/* ---------- 题库详情弹窗 ---------- */
body.modal-open { overflow: hidden; }

.detail-card {
  width: min(880px, 94vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.detail-head {
  padding: 24px 28px 16px;
  border-bottom: 1px solid #f0f2f4;
}
.detail-head h2 { font-size: 20px; margin: 8px 0 9px; }
.detail-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-date { font-size: 11px; color: #a0a6ad; }

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 28px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.detail-body.prose { font-size: 14.5px; line-height: 1.95; }
.detail-empty {
  color: #9aa1a9;
  font-size: 13px;
  line-height: 1.9;
  text-align: center;
  padding: 30px 10px;
}

.detail-foot {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  padding: 14px 28px 18px;
  border-top: 1px solid #f0f2f4;
  background: #fcfcfd;
}
.detail-foot .mini-btn.danger { color: #b05a49; }
.detail-foot .mini-btn.danger:hover { background: #fdf3f1; }

@media (max-width: 1200px) {
  .workbench.has-side { grid-template-columns: 236px minmax(0, 1fr); }
  .ai-panel .ai-result { padding: 22px 24px 38px; }
}

@media (max-width: 980px) {
  .workbench.has-side { grid-template-columns: 200px minmax(0, 1fr); }
  .ai-panel .ai-result.prose { font-size: 14.5px; }
}

@media (max-width: 820px) {
  /* 手机上原图收成一条就够，解析必须吃满整屏 */
  .workbench.has-side { grid-template-columns: minmax(0, 1fr); }
  .ai-panel .ai-result { padding: 18px 16px 32px; }
  .ai-panel .ai-result.prose { font-size: 14.5px; line-height: 1.9; }

  .detail-card { width: 100vw; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .detail-head { padding: 18px 18px 13px; }
  .detail-body { padding: 16px 18px 6px; }
  .detail-foot { padding: 12px 18px 16px; flex-wrap: wrap; }
  .detail-foot .mini-btn { flex: 1; text-align: center; }
}

/* 原图收成一条之后：解析独占整屏，那条窄栏就浮在上面当个「展开原图」的开关 */
.workbench.has-folded-src {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.workbench.has-folded-src .preview-wrap {
  box-shadow: none;
  border-radius: 10px;
}
.workbench.has-folded-src .preview-head { padding: 9px 14px; }
.workbench.has-folded-src .ai-panel .ai-result { max-width: none; }

/* ============================================================
   可读性加强：只放大「要用户动手 / 不看清楚就会点错」的文字
   —— 按钮、导航、表单标签、操作说明、提示；
      解析正文（.ai-result.prose / .detail-body.prose）保持原样，
      那是阅读区，字号和行宽已经单独调过。
   ============================================================ */

/* ---- 左侧功能导航 ---- */
.nav-item {
  min-height: 48px;
  padding: 11px 12px;
  gap: 11px;
  font-size: 14px;
}
.nav-item .func-body b { font-size: 14.5px; font-weight: 600; color: #4d555d; }
.nav-icon { font-size: 16px; width: 18px; }
.nav-arrow { font-size: 15px; }
.nav-count { font-size: 11.5px; padding: 2px 8px; }
.nav-label > span { font-size: 11px; }

/* ---- 上传卡：标题 / 说明 / 按钮 ---- */
.mini-label { font-size: 11px; letter-spacing: 1.4px; }
.capture-copy h2 { font-size: 25px; }
.capture-copy p { font-size: 14px; line-height: 1.8; }
.btn-capture { font-size: 17px; padding: 16px 28px; }
.btn-capture span { font-size: 20px; }
.btn-album { font-size: 14.5px; padding: 14px 20px; }
.capture-card.ready .btn-album { font-size: 14.5px; padding: 12px 18px; }

/* ---- 抽签（侧栏那个小的；主页大按钮另有 15px 规则，不动） ---- */
.draw-btn { font-size: 13.5px; padding: 9px 24px; }

/* ---- 长文精读：标签 / 下拉 / 输入框 / 按钮 ---- */
.reader-head p { font-size: 14px; }
.field span { font-size: 13px; color: #8b929a; }
.field select { font-size: 14px; padding: 10px 12px; }
.passage-input { font-size: 15.5px; }
.btn-ai { font-size: 14.5px; padding: 13px 24px; }
.secondary { font-size: 14px; padding: 12px 18px; }
.primary { font-size: 15px; padding: 13px 22px; }
.text-button { font-size: 13px; padding: 9px 12px; }
.reader-meta { font-size: 12.5px; }
.eyebrow { font-size: 11px; letter-spacing: 1.2px; }

/* ---- AI 面板：快速/精准、存入题库、复制、停止、重新分析 ---- */
.ai-panel-head h2 { font-size: 22px; }
.seg button { font-size: 13.5px; padding: 7px 14px; }
.ai-toolbar { font-size: 12.5px; }
.mini-btn { font-size: 13.5px; padding: 7px 13px; }
.ai-error-hint { font-size: 13px; }

/* ---- 原图侧栏上的操作 ---- */
.preview-toggle { font-size: 12.5px; }
.preview-toggle .pt-hint { font-size: 11.5px; }
.preview-change { font-size: 12.5px; padding: 4px 8px; }
.page-add { font-size: 12px; padding: 9px 0; }
.page-num { font-size: 11px; min-width: 20px; height: 20px; line-height: 20px; }
.page-del { width: 23px; height: 23px; font-size: 12px; }

/* ---- 题库：筛选 / 搜索 / 空状态 ---- */
.filter-tabs button { font-size: 14px; }
.search-box input { font-size: 13.5px; }
.sample-hint { font-size: 11.5px; }
.empty-state h3 { font-size: 17px; }
.empty-state p { font-size: 13px; }
.stage-empty h3 { font-size: 17px; }
.stage-empty p { font-size: 14px; }

/* ---- 弹窗里的操作按钮 ---- */
.detail-foot .mini-btn { font-size: 14px; padding: 9px 16px; }
.modal-close { font-size: 16px; }

/* ---- 提示条：一句话要能看清 ---- */
#toast { font-size: 13.5px; padding: 13px 24px; }

/* 窄屏：按钮文字别大到换行，说明文字也别整个藏起来 */
@media (max-width: 720px) {
  .nav-item { min-height: 46px; }
  .capture-copy h2 { font-size: 21px; }
  .capture-copy p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.7;
  }
  .btn-capture { font-size: 16px; padding: 14px 20px; }
  .capture-card.ready .btn-album { font-size: 13.5px; padding: 10px 6px; }
  .mini-btn { font-size: 13px; padding: 7px 11px; }
  .seg button { font-size: 13px; padding: 6px 12px; }
  .filter-tabs { gap: 16px; }
  .filter-tabs button { font-size: 13.5px; }
}

/* ============================================================
   写作批改（北京卷情景作文 / 应用文）
   —— 沿用精读面板的纸感，只在上面加一条「拍照 / 识别」工具条
   ============================================================ */

/* ---------- 工具条：拍作文 / 选图片 / 识别成文字 ---------- */
.writer-tools {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 13px;
}
.tool-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #4d555d;
  border-radius: 9px;
  padding: 9px 15px;
  font-size: 13.5px;
  font-weight: 500;
  transition: border-color .15s, color .15s, background .15s;
}
.tool-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--accent-light);
}
.tool-btn:disabled { opacity: .45; cursor: not-allowed; }
.tool-btn.strong {
  background: var(--accent-light);
  border-color: #ecd8cb;
  color: var(--accent-deep);
}
.writer-hint {
  margin-left: auto;
  font-size: 12px;
  color: #98a0a8;
  line-height: 1.6;
}

/* ---------- 作文缩略图：横着排一排，不占纵向空间 ---------- */
.essay-shots { margin-bottom: 13px; }
.essay-shots .page-stack {
  flex-direction: row;
  gap: 8px;
  padding: 0;
  max-height: none;
  overflow: visible;
}
.essay-shots .page-item { flex: 0 0 auto; }
.essay-shots .page-item img {
  display: block;
  width: 94px;
  height: 122px;
  object-fit: cover;
  object-position: top center;
  cursor: zoom-in;
}

/* ---------- 题目要求 ---------- */
.writer-topic { display: block; margin-bottom: 12px; }
.writer-topic > span {
  display: block;
  font-size: 12px;
  color: #9aa1a9;
  letter-spacing: .4px;
  margin-bottom: 6px;
}
.writer-topic textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.75;
  color: #3f4750;
  background: #fdfdfc;
  transition: border-color .18s, box-shadow .18s;
}
.writer-topic textarea:focus {
  outline: none;
  border-color: #d9bda9;
  box-shadow: 0 0 0 3px rgba(200,115,82,.1);
  background: #fff;
}
.writer-topic textarea::placeholder { color: #b3b9c0; }

/* 作文正文：比精读的段落框矮一点，留给下面的核对提示 */
.essay-input { min-height: 232px; }

/* ---------- OCR 核对提示条 ---------- */
.ocr-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 11px 14px;
  background: #fdf6ee;
  border: 1px solid #f0ddc9;
  border-radius: 10px;
}
.ocr-notice-text { font-size: 13px; color: #8a6a4f; line-height: 1.7; }
.ocr-notice-text b { color: var(--accent-deep); }
.ocr-notice .mini-btn { flex: none; }
.ocr-notice.hidden { display: none; }

/* 文字还没核对时，主按钮变灰并换文案，点它不会发请求 */
.primary.need-review,
.primary.need-review:hover {
  background: #b9bec4;
  box-shadow: none;
}

/* ---------- 结果舞台：和精读一样单列 ---------- */
.workbench.writing { grid-template-columns: minmax(0, 1fr); }
.workbench.writing .wb-side { display: none; }

/* ---------- 题库里的「作文」筛选 ---------- */
.filter-tabs .filter-sep {
  width: 1px;
  height: 13px;
  align-self: center;
  background: var(--line);
}

@media (max-width: 720px) {
  .writer-tools { gap: 8px; margin-bottom: 11px; }
  .tool-btn { flex: 1 1 auto; padding: 9px 10px; font-size: 12.5px; text-align: center; }
  .writer-hint { display: none; }
  .essay-shots .page-item img { width: 76px; height: 100px; }
  .essay-input { min-height: 150px; }
  .writer-topic textarea { min-height: 64px; font-size: 13px; }
  .ocr-notice { padding: 10px 12px; }
  .ocr-notice-text { font-size: 12.5px; }
}
