/* ============================================================
   Atelier · 英语学习工作台
   美学方向：Scholarly Atelier — 学术期刊质感 × 温暖工作台
   ============================================================ */

:root{
  /* 色板 —— 纸张 / 墨水 / 牛血红 / 林木绿 / 古金 */
  --paper:        #f3ede0;
  --paper-deep:   #ece4d2;
  --surface:      #fbf7ee;
  --surface-2:    #f6f0e2;
  --ink:          #1c1813;
  --ink-soft:     #3a332a;
  --ink-mute:     #6b6354;
  --ink-faint:    #9c9384;
  --line:         #d8cfbb;
  --line-soft:    #e3dbc8;

  --oxblood:      #8a2a2a;
  --oxblood-dk:   #6e1f1f;
  --sage:         #3f6b4e;
  --sage-dk:      #2f5239;
  --gold:         #b07d1f;
  --plum:         #6a3a5a;

  --shadow-sm: 0 1px 2px rgba(28,24,19,.06), 0 1px 1px rgba(28,24,19,.04);
  --shadow:    0 4px 16px rgba(28,24,19,.08), 0 2px 4px rgba(28,24,19,.05);
  --shadow-lg: 0 18px 48px rgba(28,24,19,.16), 0 6px 12px rgba(28,24,19,.08);

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 16px;
  --r-xl: 22px;

  --serif: Georgia, "Songti SC", "Times New Roman", serif;
  --display: Georgia, "Times New Roman", serif;
  --mono: "SF Mono", Consolas, "Courier New", monospace;

  --sb-w: 268px;
}

*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family: var(--serif);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

/* 纸张颗粒纹理 */
.grain{
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.09 0 0 0 0 0.07 0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

button{ font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select{ font-family: inherit; font-size: inherit; color: inherit; }
::selection{ background: var(--oxblood); color: #fbf7ee; }

/* ===== 布局 ===== */
.layout{
  display: grid;
  grid-template-columns: var(--sb-w) 1fr;
  height: 100vh;
  position: relative;
  z-index: 2;
}
.sidebar{
  position: fixed; top:0; left:0; bottom:0; width: var(--sb-w);
  background: var(--paper-deep);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 26px 20px 18px;
  z-index: 30;
  transition: transform .32s cubic-bezier(.4,0,.2,1);
}
.main{
  margin-left: var(--sb-w);
  height: 100vh;
  display: flex; flex-direction: column;
  min-width: 0;
}

/* ===== 侧边栏 ===== */
.brand{
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.brand-mark{
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--ink); color: var(--paper);
  display: grid; place-items: center;
  font-family: var(--display);
  font-weight: 900; font-size: 22px;
  font-style: italic;
  box-shadow: inset 0 0 0 2px var(--paper-deep), 0 0 0 1px var(--ink);
}
.brand-name{
  font-family: var(--display);
  font-weight: 600; font-size: 20px; letter-spacing: -.01em;
}
.brand-sub{
  font-size: 11.5px; color: var(--ink-mute);
  letter-spacing: .12em; text-transform: uppercase; margin-top: 1px;
}

.nav{ display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-item{
  display: flex; align-items: baseline; gap: 14px;
  padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--ink-soft);
  text-align: left;
  transition: background .18s, color .18s;
  position: relative;
}
.nav-item:hover{ background: rgba(28,24,19,.05); color: var(--ink); }
.nav-item.active{ background: var(--ink); color: var(--paper); }
.nav-item.active .nav-idx{ color: var(--gold); }
.nav-idx{
  font-family: var(--mono); font-size: 10.5px;
  color: var(--ink-faint); letter-spacing: .04em;
  min-width: 18px;
}
.nav-label{ font-size: 14.5px; font-weight: 500; }

.sidebar-foot{ margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.streak-card{
  display: flex; align-items: center; gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.streak-flame{ font-size: 20px; filter: saturate(1.2); }
.streak-num{ font-family: var(--display); font-weight: 700; font-size: 19px; line-height: 1; }
.streak-lbl{ font-size: 11px; color: var(--ink-mute); letter-spacing: .08em; text-transform: uppercase; margin-top: 2px;}

/* 通用按钮 */
.ghost-btn{
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink-soft);
  font-size: 13px; font-weight: 500;
  transition: all .18s;
}
.ghost-btn:hover{ border-color: var(--ink); color: var(--ink); }
.ghost-btn.danger:hover{ border-color: var(--oxblood); color: var(--oxblood); }
.primary-btn{
  padding: 9px 18px;
  background: var(--oxblood); color: #fbf7ee;
  border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600;
  letter-spacing: .01em;
  transition: background .18s, transform .12s;
  box-shadow: 0 1px 0 rgba(0,0,0,.12) inset;
}
.primary-btn:hover{ background: var(--oxblood-dk); }
.primary-btn:active{ transform: translateY(1px); }
.icon-btn{
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink-mute);
  transition: background .15s, color .15s;
}
.icon-btn:hover{ background: rgba(28,24,19,.08); color: var(--ink); }

/* ===== 顶栏 ===== */
.topbar{
  display: flex; align-items: center; gap: 16px;
  padding: 16px 30px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  flex-shrink: 0;
}
.menu-toggle{ display: none; color: var(--ink-soft); }
.topbar-title{
  font-family: var(--display);
  font-weight: 600; font-size: 22px; letter-spacing: -.01em;
}
.topbar-meta{
  margin-left: auto;
  font-size: 12.5px; color: var(--ink-mute);
  font-family: var(--mono);
}
.view-host{
  flex: 1; overflow-y: auto;
  padding: 30px;
  position: relative;
}

/* ===== 视图通用 ===== */
.view{ animation: fadeUp .4s cubic-bezier(.2,.7,.2,1); }
@keyframes fadeUp{ from{ opacity:0; transform: translateY(8px);} to{ opacity:1; transform: none; } }

.page-head{ margin-bottom: 24px; }
.eyebrow{
  font-family: var(--mono); font-size: 11px;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--oxblood); margin-bottom: 6px;
}
.page-title{
  font-family: var(--display); font-weight: 600;
  font-size: 34px; line-height: 1.1; letter-spacing: -.02em;
  margin: 0 0 6px;
}
.page-desc{ color: var(--ink-mute); font-size: 14.5px; max-width: 60ch; }

.card{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad{ padding: 22px 24px; }

.divider{ height: 1px; background: var(--line-soft); margin: 18px 0; }

/* ===== 仪表盘 ===== */
.dash-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}
.stat{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  position: relative; overflow: hidden;
}
.stat::before{
  content:""; position:absolute; right:-20px; top:-20px;
  width: 90px; height: 90px; border-radius: 50%;
  background: var(--paper-deep); opacity:.6;
}
.stat-num{
  font-family: var(--display); font-weight: 700;
  font-size: 40px; line-height: 1; letter-spacing: -.02em;
  position: relative;
}
.stat-lbl{ font-size: 13px; color: var(--ink-mute); margin-top: 6px; position: relative; }
.stat-ico{ position: absolute; right: 20px; bottom: 16px; font-size: 22px; opacity:.7; }

.dash-grid-2{
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px;
}
.feed-list{ list-style: none; padding: 0; margin: 0; }
.feed-list li{
  padding: 12px 0; border-bottom: 1px dashed var(--line-soft);
  display: flex; gap: 14px; align-items: flex-start;
}
.feed-list li:last-child{ border-bottom: none; }
.feed-time{
  font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
  white-space: nowrap; padding-top: 3px;
}
.feed-text{ flex: 1; }
.task-row{
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px dashed var(--line-soft);
}
.task-row:last-child{ border-bottom: none; }
.task-dot{
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--ink-faint);
  flex-shrink: 0; cursor: pointer;
  transition: all .18s;
  display: grid; place-items: center; color: transparent; font-size: 10px;
}
.task-dot.done{ background: var(--sage); border-color: var(--sage); color: #fff; }
.task-dot.done::after{ content:"✓"; }

/* ===== 口语对话 ===== */
.chat-wrap{
  display: grid; grid-template-columns: 1fr 280px; gap: 18px;
  height: calc(100vh - 180px);
}
.chat-col{ display: flex; flex-direction: column; min-height: 0; }
.chat-stream{
  flex: 1; overflow-y: auto; padding: 20px 22px;
  display: flex; flex-direction: column; gap: 18px;
}
.msg{ display: flex; gap: 12px; max-width: 92%; animation: fadeUp .3s; }
.msg.user{ align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar{
  width: 34px; height: 34px; border-radius: 50%;
  flex-shrink: 0; display: grid; place-items: center;
  font-family: var(--display); font-weight: 600; font-size: 14px;
}
.msg.ai .msg-avatar{ background: var(--ink); color: var(--paper); }
.msg.user .msg-avatar{ background: var(--oxblood); color: #fbf7ee; }
.msg-bubble{
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 14.5px; line-height: 1.65;
}
.msg.user .msg-bubble{ background: var(--ink); color: var(--paper); border-color: var(--ink); }
.msg-bubble.en{ font-family: var(--serif); }
.msg-foot{
  display: flex; gap: 8px; margin-top: 6px;
  font-size: 11px; color: var(--ink-faint);
}
.msg-foot button{
  font-size: 11px; color: var(--ink-mute);
  padding: 2px 8px; border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: all .15s;
}
.msg-foot button:hover{ border-color: var(--oxblood); color: var(--oxblood); }
.msg-suggest{
  margin-top: 8px; padding: 9px 12px;
  background: rgba(176,125,31,.1);
  border-left: 2px solid var(--gold);
  border-radius: 4px;
  font-size: 13px; color: var(--ink-soft);
}
.chat-input{
  display: flex; gap: 10px; padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.chat-input textarea{
  flex: 1; resize: none; border: none; outline: none;
  background: transparent; font-size: 14.5px; line-height: 1.5;
  max-height: 120px; padding: 8px 0;
}
.chat-input textarea::placeholder{ color: var(--ink-faint); }
.chat-side{
  display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto;
}
.scene-chip{
  padding: 9px 13px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); font-size: 13px; text-align: left;
  transition: all .15s;
}
.scene-chip:hover{ border-color: var(--ink); }
.scene-chip small{ display:block; color: var(--ink-faint); font-size: 11px; }

.typing{ display: inline-flex; gap: 4px; padding: 4px 0; }
.typing span{
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-faint);
  animation: blink 1.2s infinite;
}
.typing span:nth-child(2){ animation-delay: .2s; }
.typing span:nth-child(3){ animation-delay: .4s; }
@keyframes blink{ 0%,60%,100%{ opacity:.3; transform: translateY(0);} 30%{ opacity:1; transform: translateY(-3px);} }

/* ===== 阅读与朗读（合并「文本生词」+「分句朗读」） ===== */
.reader-wrap{ display: grid; grid-template-columns: 1fr 280px; gap: 18px; align-items: start; }
.reader-main{ display: flex; flex-direction: column; gap: 0; min-width: 0; }
.reader-input{
  width: 100%; min-height: 120px; max-height: 240px; padding: 14px 18px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface);
  font-family: var(--serif); font-size: 15px; line-height: 1.6;
  resize: vertical; outline: none;
  transition: border-color .2s;
}
.reader-input:focus{ border-color: var(--ink); }

/* 句子列表 */
.sentence-list-reader{
  padding: 4px 0;
  max-height: 52vh;
  overflow-y: auto;
}
.sentence-row-reader{
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px dashed var(--line-soft);
  cursor: pointer;
  transition: background .12s;
  line-height: 1.7;
}
.sentence-row-reader:last-child{ border-bottom: none; }
.sentence-row-reader:hover{ background: var(--surface-2); }
.sentence-row-reader.active{
  background: rgba(138,42,42,.08);
  border-left: 3px solid var(--oxblood);
  padding-left: 11px;
}

/* 单句播放按钮 */
.sent-play-btn{
  width: 28px; height: 28px; min-width: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  display: grid; place-items: center;
  cursor: pointer; flex-shrink: 0;
  color: var(--ink-soft); font-size: 11px;
  transition: all .15s; margin-top: 3px;
  padding: 0;
}
.sent-play-btn:hover{
  border-color: var(--oxblood); color: var(--oxblood);
  background: rgba(138,42,42,.08);
}
.sentence-row-reader .sn{
  font-family: var(--mono); font-size: 10px; color: var(--ink-faint);
  padding-top: 8px; min-width: 20px; user-select: none;
}
.sent-text{ flex: 1; font-size: 15px; padding-top: 2px; }
.sent-text .w{
  cursor: pointer; border-radius: 2px; padding: 1px;
  transition: background .12s, color .12s;
}
.sent-text .w:hover{ background: rgba(138,42,42,.14); }
.sent-text .w.in-book{ background: rgba(63,107,78,.16); }
.sent-text .w.in-book::after{ content:"✦"; font-size: 8px; vertical-align: super; color: var(--sage); }

/* 当前朗读句展示 */
.current-sentence-display{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 24px;
  text-align: center;
  font-family: var(--display);
  font-size: 22px;
  line-height: 1.5;
  margin-bottom: 0;
}
.current-sentence-display .num{
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: .15em;
  margin-bottom: 8px;
}

/* 保留旧版兼容样式 */
.reader-text{
  padding: 22px 26px; line-height: 2.1; font-size: 17px;
  min-height: 200px;
}
.reader-text .w{
  cursor: pointer; border-radius: 3px;
  padding: 1px 1px; margin: 0 -1px;
  transition: background .12s, color .12s;
}
.reader-text .w:hover{ background: rgba(138,42,42,.14); }
.reader-text .w.known{ color: var(--ink-faint); }
.reader-text .w.in-book{ background: rgba(63,107,78,.16); }
.reader-text .w.in-book::after{ content:"✦"; font-size: 9px; vertical-align: super; color: var(--sage); }

.side-tools{ position: sticky; top: 0; }
.tool-block{
  padding: 16px 18px; margin-bottom: 14px;
}
.tool-block h4{
  margin: 0 0 8px; font-family: var(--display); font-weight: 600;
  font-size: 14px; letter-spacing: .02em;
}
.tool-stat{ display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.tool-stat div{ font-size: 12px; color: var(--ink-mute); }
.tool-stat b{ display:block; font-family: var(--display); font-size: 20px; color: var(--ink); font-weight: 600;}

/* ===== 单词背诵 ===== */
.recite-wrap{ max-width: 720px; margin: 0 auto; }
.recite-progress{
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 18px;
}
.progress-bar{
  flex: 1; height: 6px; background: var(--line-soft);
  border-radius: 3px; overflow: hidden;
}
.progress-fill{
  height: 100%; background: var(--oxblood);
  border-radius: 3px; transition: width .4s;
}
.progress-text{ font-family: var(--mono); font-size: 12px; color: var(--ink-mute); }

.recite-card{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 40px 36px 30px;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.recite-card::before{
  content:""; position: absolute; top:0; left:0; right:0; height: 4px;
  background: linear-gradient(90deg, var(--oxblood), var(--gold));
}
.recite-phonetic{
  font-family: var(--mono); color: var(--ink-mute); font-size: 14px;
  margin: 8px 0 4px;
}
.recite-word{
  font-family: var(--display); font-weight: 600;
  font-size: 52px; letter-spacing: -.02em; margin: 6px 0;
}
.recite-pos{ font-size: 13px; color: var(--gold); font-style: italic; margin-bottom: 22px; }
.recite-options{ display: grid; gap: 10px; }
.opt-btn{
  padding: 14px 18px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface-2);
  font-size: 15px; line-height: 1.5;
  transition: all .15s;
  display: flex; gap: 12px; align-items: flex-start;
}
.opt-btn:hover:not(:disabled){ border-color: var(--ink); transform: translateX(2px); }
.opt-btn .opt-key{
  font-family: var(--mono); font-size: 12px; color: var(--ink-faint);
  border: 1px solid var(--line); border-radius: 4px;
  width: 22px; height: 22px; display: grid; place-items: center;
  flex-shrink: 0; padding: 0;
}
.opt-btn.correct{ border-color: var(--sage); background: rgba(63,107,78,.12); }
.opt-btn.correct .opt-key{ background: var(--sage); color: #fff; border-color: var(--sage); }
.opt-btn.wrong{ border-color: var(--oxblood); background: rgba(138,42,42,.1); }
.opt-btn.wrong .opt-key{ background: var(--oxblood); color: #fff; border-color: var(--oxblood); }
.opt-btn:disabled{ cursor: default; }
.recite-result{
  margin-top: 18px; padding: 16px; border-radius: var(--r);
  background: var(--paper-deep); text-align: left;
  font-size: 14px;
}
.recite-controls{
  display: flex; gap: 10px; justify-content: center; margin-top: 18px;
}

.recite-empty{ text-align: center; padding: 60px 20px; color: var(--ink-mute); }
.recite-empty .big{ font-size: 48px; margin-bottom: 12px; }

.mode-tabs{
  display: flex; gap: 6px; margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.mode-tab{
  padding: 8px 16px; font-size: 13px; color: var(--ink-mute);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all .15s;
}
.mode-tab.active{ color: var(--oxblood); border-color: var(--oxblood); }

/* ===== 文档提取 ===== */
.docs-wrap{ max-width: 900px; margin: 0 auto; }
.docs-dropzone{
  border: 2px dashed var(--line);
  border-radius: var(--r-lg);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: var(--surface);
}
.docs-dropzone:hover{ border-color: var(--ink-mute); background: var(--surface-2); }
.docs-dropzone.over{
  border-color: var(--oxblood); background: rgba(138,42,42,.06);
  transform: scale(1.01);
}
.dz-inner{ pointer-events: none; }
.dz-icon{ font-size: 40px; margin-bottom: 10px; }
.dz-title{ font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--ink); }
.dz-link{ color: var(--oxblood); border-bottom: 1px solid var(--oxblood); }
.dz-hint{ font-size: 12.5px; color: var(--ink-mute); margin-top: 6px; }
.docs-status{
  margin-top: 14px; padding: 11px 16px;
  border-radius: var(--r); background: var(--surface-2);
  border: 1px solid var(--line-soft);
  font-size: 13px; color: var(--ink-mute);
  display: none;
}
.docs-status.show{ display: block; }
.docs-status.error{ background: rgba(138,42,42,.08); border-color: var(--oxblood); color: var(--oxblood); }
.docs-result{ margin-top: 18px; overflow: hidden; }
.docs-head{
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
}
.docs-title{ font-family: var(--display); font-weight: 600; font-size: 16px; }
.docs-actions{ display: flex; gap: 8px; flex-wrap: wrap; }
.docs-actions .ghost-btn{ padding: 6px 11px; font-size: 12px; }
.docs-stats{
  padding: 12px 20px; font-size: 12.5px; color: var(--ink-mute);
  background: var(--paper-deep); border-bottom: 1px solid var(--line);
}
.docs-stats b{ color: var(--ink); font-family: var(--mono); font-size: 14px; }
.docs-lines{ max-height: 60vh; overflow-y: auto; padding: 8px 0; }
.doc-line{
  padding: 9px 20px; border-bottom: 1px dashed var(--line-soft);
  display: flex; gap: 14px; align-items: flex-start;
  font-size: 14.5px; line-height: 1.7;
  transition: background .12s;
}
.doc-line:hover{ background: var(--surface-2); }
.doc-line .ln{
  font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
  padding-top: 4px; min-width: 36px; user-select: none;
}
.doc-line .lt{ flex: 1; }
.doc-line .w{
  cursor: pointer; border-radius: 2px; padding: 1px;
  transition: background .12s, color .12s;
}
.doc-line .w:hover{ background: rgba(138,42,42,.14); }
.doc-line .w.in-book{ background: rgba(63,107,78,.16); }
.doc-line .w.in-book::after{ content:"✦"; font-size: 9px; vertical-align: super; color: var(--sage); }

/* ===== 资讯订阅 ===== */
.news-wrap{ max-width: 980px; margin: 0 auto; }
.tag-filter{ display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tag-pill{
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 20px;
  font-size: 12.5px; color: var(--ink-mute); background: var(--surface);
  transition: all .15s;
}
.tag-pill.active{ background: var(--ink); color: var(--paper); border-color: var(--ink); }
.news-list{ display: grid; gap: 14px; }
.news-item{
  display: grid; grid-template-columns: 90px 1fr; gap: 18px;
  padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.news-item:hover{ transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--ink-faint); }
.news-tag{
  font-family: var(--mono); font-size: 10px;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--oxblood); border: 1px solid var(--oxblood);
  border-radius: 3px; padding: 3px 0; text-align: center;
  align-self: start; height: fit-content;
}
.news-title{
  font-family: var(--display); font-weight: 600; font-size: 17px;
  line-height: 1.3; margin: 0 0 6px; color: var(--ink);
}
.news-title a{ color: inherit; text-decoration: none; }
.news-title a:hover{ color: var(--oxblood); }
.news-snippet{ font-size: 13.5px; color: var(--ink-mute); line-height: 1.55; }
.news-meta{ font-size: 11.5px; color: var(--ink-faint); margin-top: 8px; font-family: var(--mono); }

/* ===== 进度条（阅读与朗读共用） ===== */
.player-slider{
  margin-top: 0;
  padding: 0 4px;
}
.slider-track{
  height: 4px; background: var(--line-soft); border-radius: 2px;
  position: relative; cursor: pointer;
}
.slider-fill{
  height: 100%; background: var(--oxblood); border-radius: 2px;
  width: 0%; transition: width .2s;
}
.slider-handle{
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--oxblood);
  left: 0%; transition: left .2s;
}
.slider-marks{
  display: flex; justify-content: space-between;
  margin-top: 8px; font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
}

/* ===== 单词本 ===== */
.nb-toolbar{
  display: flex; gap: 10px; align-items: center; margin-bottom: 16px;
  flex-wrap: wrap;
}
.nb-search{
  flex: 1; min-width: 200px; padding: 9px 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); outline: none; font-size: 13.5px;
}
.nb-search:focus{ border-color: var(--ink); }
.nb-grid{
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.nb-card{
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px 18px;
  transition: all .18s; position: relative;
}
.nb-card:hover{ border-color: var(--ink-faint); box-shadow: var(--shadow-sm); }
.nb-word{
  font-family: var(--display); font-weight: 600; font-size: 20px;
  display: flex; align-items: baseline; gap: 8px;
}
.nb-phonetic{ font-family: var(--mono); font-size: 12px; color: var(--ink-mute); font-weight: 400; }
.nb-pos{ font-size: 12px; color: var(--gold); font-style: italic; margin: 4px 0 6px; }
.nb-meaning{ font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
.nb-stage{
  position: absolute; top: 14px; right: 14px;
  font-family: var(--mono); font-size: 10px;
  padding: 2px 7px; border-radius: 10px;
  background: var(--paper-deep); color: var(--ink-mute);
}
.nb-stage.s5{ background: var(--sage); color: #fff; }
.nb-empty{ text-align: center; padding: 60px; color: var(--ink-mute); }

/* ===== 学习笔记 ===== */
.note-item{
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px 18px; margin-bottom: 12px;
  border-left: 3px solid var(--gold);
}
.note-item .note-meta{ font-size: 11px; color: var(--ink-faint); font-family: var(--mono); margin-bottom: 6px; }
.note-item .note-text{ font-size: 14px; line-height: 1.6; }
.note-item .note-src{ font-size: 12px; color: var(--ink-mute); margin-top: 6px; font-style: italic; }
.note-del{
  float: right; color: var(--ink-faint); font-size: 12px;
  opacity: 0; transition: opacity .15s;
}
.note-item:hover .note-del{ opacity: 1; }
.note-del:hover{ color: var(--oxblood); }

/* ===== 弹层 ===== */
.modal{
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.modal.open{ display: flex; animation: fadeUp .25s; }
.modal-backdrop{
  position: absolute; inset: 0;
  background: rgba(28,24,19,.45);
  backdrop-filter: blur(4px);
}
.modal-panel{
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px; max-height: 88vh;
  display: flex; flex-direction: column;
}
.word-panel{ max-width: 560px; }
.modal-head{
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-head h2{
  margin: 0; font-family: var(--display); font-weight: 600;
  font-size: 26px; letter-spacing: -.01em;
}
.word-actions{ display: flex; gap: 4px; align-items: center; }
.modal-body{ padding: 20px 24px; overflow-y: auto; }
.modal-actions{
  padding: 14px 24px 18px; display: flex; gap: 10px; justify-content: flex-end;
  border-top: 1px solid var(--line-soft);
}

.field{ margin-bottom: 18px; }
.field label{
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--ink-soft); margin-bottom: 6px;
  letter-spacing: .02em;
}
.field input[type=text], .field input[type=password]{
  width: 100%; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--paper); outline: none; font-size: 13.5px;
}
.field input:focus{ border-color: var(--ink); }
.hint{ font-size: 11.5px; color: var(--ink-faint); margin: 5px 0 0; }

.chips{ display: flex; flex-wrap: wrap; gap: 7px; }
.chip{
  padding: 6px 13px; border: 1px solid var(--line); border-radius: 20px;
  font-size: 12.5px; color: var(--ink-mute); background: var(--surface);
  transition: all .15s;
}
.chip.active{ background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* 单词释义弹层内容 */
.dict-sense{
  padding: 10px 0; border-bottom: 1px dashed var(--line-soft);
}
.dict-sense:last-of-type{ border-bottom: none; }
.dict-pos{
  font-style: italic; color: var(--gold); font-size: 13px;
  margin-bottom: 4px;
}
.dict-en{
  font-size: 14px; line-height: 1.5; color: var(--ink); margin-bottom: 2px;
}
.dict-cn{
  font-size: 14px; line-height: 1.5; color: var(--ink-soft); margin-bottom: 4px;
}
.dict-ex{
  font-size: 13px; color: var(--ink-mute); font-style: italic;
  margin-top: 4px; padding-left: 12px; border-left: 2px solid var(--line);
}
.dict-sec-title{
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--oxblood); margin: 16px 0 8px;
}
.dict-collocations{ display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dict-collocations span{
  padding: 3px 9px; background: var(--paper-deep);
  border-radius: 4px; font-size: 12.5px; color: var(--ink-soft);
}
.dict-tags{ display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.syn-tag{
  padding: 3px 9px; background: rgba(40,120,80,0.08); border: 1px solid rgba(40,120,80,0.2);
  border-radius: 4px; font-size: 12.5px; color: #2a6b4a;
}
.ant-tag{
  padding: 3px 9px; background: rgba(160,50,50,0.08); border: 1px solid rgba(160,50,50,0.2);
  border-radius: 4px; font-size: 12.5px; color: #9a3a3a;
}
.dict-forms{ font-size: 12px; color: var(--ink-faint); margin-bottom: 14px; }
.dict-loading{ padding: 20px; text-align: center; color: var(--ink-mute); }
.dict-error{ padding: 14px; text-align: center; color: var(--oxblood); font-size: 13.5px; }

/* 句子时间戳标记 */
.ts-badge{
  display: inline-block; padding: 2px 8px; margin-left: auto;
  font-size: 11px; font-family: var(--mono); color: var(--gold);
  background: rgba(138,42,42,0.06); border-radius: 4px; white-space: nowrap;
  flex-shrink: 0;
}

/* 朗文词典结果样式 */
.dict-entry-header{
  display: flex; align-items: baseline; gap: 8px;
  margin: 14px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line-soft);
}
.dict-headword{ font-size: 16px; font-weight: 700; color: var(--ink); }
.dict-pos-tag{
  font-size: 12px; font-style: italic; color: var(--oxblood);
  background: rgba(138,42,42,0.06); padding: 2px 8px; border-radius: 4px;
}
.dict-sense-head{ display: flex; align-items: baseline; gap: 6px; margin-bottom: 3px; }
.dict-sense-num{
  font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--oxblood);
}
.dict-signpost{
  font-size: 11px; font-weight: 600; color: var(--gold);
  text-transform: uppercase; letter-spacing: .05em;
}
.dict-syn-line{ font-size: 12px; color: var(--ink-mute); margin-top: 4px; }
.dict-col-line{ font-size: 13px; color: var(--ink-soft); margin: 4px 0; }
.wf-tag{
  padding: 3px 9px; background: rgba(60,80,140,0.08); border: 1px solid rgba(60,80,140,0.15);
  border-radius: 4px; font-size: 12.5px; color: #3a4a7a;
}
.dict-etym{ font-size: 12.5px; color: var(--ink-mute); font-style: italic; line-height: 1.5; }

/* ===== Toast ===== */
.toast{
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--paper);
  padding: 11px 20px; border-radius: 24px;
  font-size: 13px; z-index: 200;
  opacity: 0; pointer-events: none;
  transition: all .3s cubic-bezier(.2,.7,.2,1);
  box-shadow: var(--shadow-lg);
}
.toast.show{ opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 响应式 ===== */
@media (max-width: 1024px){
  :root{ --sb-w: 240px; }
  .dash-grid{ grid-template-columns: repeat(2, 1fr); }
  .dash-grid-2{ grid-template-columns: 1fr; }
  .chat-wrap{ grid-template-columns: 1fr; height: auto; }
  .chat-side{ flex-direction: row; overflow-x: auto; }
  .reader-wrap{ grid-template-columns: 1fr; }
}
@media (max-width: 768px){
  :root{ --sb-w: 0px; }
  .sidebar{ transform: translateX(-100%); width: 260px; }
  .sidebar.open{ transform: translateX(0); }
  .main{ margin-left: 0; }
  .menu-toggle{ display: grid; }
  .view-host{ padding: 18px; }
  .topbar{ padding: 12px 18px; }
  .topbar-title{ font-size: 18px; }
  .dash-grid{ grid-template-columns: 1fr; }
  .page-title{ font-size: 26px; }
  .recite-word{ font-size: 38px; }
  .current-sentence-display{ font-size: 17px; }
  .news-item{ grid-template-columns: 1fr; }
  .news-tag{ width: fit-content; padding: 3px 10px; }
  .sentence-list-reader{ max-height: 40vh; }
  .sent-text{ font-size: 14px; }
}

/* 滚动条 */
::-webkit-scrollbar{ width: 9px; height: 9px; }
::-webkit-scrollbar-track{ background: transparent; }
::-webkit-scrollbar-thumb{ background: var(--line); border-radius: 5px; border: 2px solid var(--paper); }
::-webkit-scrollbar-thumb:hover{ background: var(--ink-faint); }
