@import url("card-view.css");

/* ==========================================================================
   拼读词典 · 样式
   移动端优先，PC 端 >= 900px 展开侧栏
   ========================================================================== */

:root {
  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --surface-2: #F1F3F6;
  --text: #1A1D23;
  --text-2: #5C6270;
  --text-3: #9298A5;
  --border: #E4E7EC;
  --brand: #4C6EF5;
  --brand-soft: #EDF1FF;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
  --shadow-sm: 0 1px 3px rgba(16,24,40,.08);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

html[data-theme="dark"] {
  --bg: #0E1015;
  --surface: #171A21;
  --surface-2: #1F232C;
  --text: #E8EAEE;
  --text-2: #A2A9B8;
  --text-3: #6E7686;
  --border: #262B35;
  --brand: #6B8AFF;
  --brand-soft: #1B2136;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  overscroll-behavior-y: none;
}

body { display: flex; flex-direction: column; }

/* ★ 全局修正：hidden 属性的优先级低于元素自身的 display:flex，
   导致「弹层/菜单即使加了 hidden 仍然显示并拦截点击」。
   这条规则统一兜底，各处局部的 [hidden] 规则可保留。 */
[hidden] { display: none !important; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: calc(10px + var(--safe-t)) 14px 10px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tb-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo {
  width: 34px; height: 34px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #7048E8);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.tb-title { min-width: 0; }
.tb-title h1 {
  margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -.01em;
  white-space: nowrap;
}
.tb-title span {
  display: block; font-size: 11.5px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tb-right { display: flex; align-items: center; gap: 4px; }
.icon-btn {
  position: relative;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: none; background: transparent;
  color: var(--text-2);
  border-radius: 10px; cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.badge {
  position: absolute; top: 3px; right: 3px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px;
  background: #E5484D; color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.only-desktop { display: none; }
#themeBtnMobile { display: grid; }
@media (min-width: 900px) { #themeBtnMobile { display: none; } }


/* ---------------- 口音快捷菜单 ---------------- */
.accent-menu { position: relative; flex-shrink: 0; }
.accent-btn {
  height: 28px; padding: 0 8px; margin-right: 2px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2);
  font-family: inherit; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  cursor: pointer; transition: all .15s;
  display: inline-flex; align-items: center; gap: 5px;
}
.accent-btn:hover { border-color: var(--brand); color: var(--brand); }
.accent-btn.uk { background: var(--brand); border-color: var(--brand); color: #fff; }
.accent-btn .caret { opacity: .6; }
.accent-menu.open .accent-btn { border-color: var(--brand); color: var(--brand); }
.accent-menu.open .accent-btn.uk { color: #fff; }

.accent-pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 120;
  min-width: 176px; padding: 5px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow);
  animation: fade .14s;
}
.accent-pop[hidden] { display: none !important; }
.accent-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 7px 9px; border: none; border-radius: 8px;
  background: transparent; cursor: pointer; text-align: left;
  font-family: inherit; color: var(--text);
}
.accent-item:hover { background: var(--surface-2); }
.accent-item.on { background: var(--brand-soft); }
.accent-item .ai-code {
  flex-shrink: 0; min-width: 26px; height: 26px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px; background: var(--surface-2);
  font-size: 11px; font-weight: 800; letter-spacing: .03em; color: var(--text-2);
}
.accent-item.on .ai-code { background: var(--brand); color: #fff; }
.accent-item .ai-name { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.accent-item .ai-name small {
  display: block; font-size: 10.5px; font-weight: 400; color: var(--text-3); margin-top: 1px;
}
.accent-item.auto .ai-code { font-size: 13px; }
.accent-sep { height: 1px; background: var(--border); margin: 4px 6px; }

/* ---------------- 布局 ---------------- */
.layout { flex: 1; display: flex; min-height: 0; }

/* ---------------- 侧栏（PC） ---------------- */
.sidebar {
  display: none;
  width: 268px; flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 16px 14px 24px;
  overflow-y: auto;
}
.sb-sec { margin-bottom: 22px; }
.sb-sec h3 {
  margin: 0 0 9px; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3);
  display: flex; align-items: center; gap: 6px;
}
.cnt {
  display: inline-block; min-width: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--surface-2);
  color: var(--text-2); font-size: 10.5px; font-weight: 700;
  text-align: center; letter-spacing: 0;
}
.stage-list { display: flex; flex-direction: column; gap: 3px; }
.stage-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; width: 100%;
  padding: 8px 10px;
  border: none; background: transparent;
  border-radius: 9px; cursor: pointer;
  color: var(--text-2); font-size: 13.5px; text-align: left;
  font-family: inherit;
  transition: background .15s, color .15s;
}
.stage-item:hover { background: var(--surface-2); color: var(--text); }
.stage-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.stage-item .n { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.stage-item.active .n { color: var(--brand); }

.recent-list { display: flex; flex-direction: column; gap: 2px; }
.recent-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 8px;
  cursor: pointer; border: none; background: transparent;
  color: var(--text-2); font-size: 13px; width: 100%; text-align: left;
  font-family: inherit;
}
.recent-item:hover { background: var(--surface-2); color: var(--text); }
.recent-item .w { font-weight: 550; color: var(--text); }
.recent-item .d { font-size: 11.5px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item .rw { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.recent-item .w {
  font-weight: 550; color: var(--text);
  display: flex; align-items: baseline; gap: 5px; min-width: 0;
}
.recent-item .ri-pos {
  font-style: normal; font-size: 9.5px; font-weight: 600;
  color: var(--brand); background: var(--brand-soft);
  padding: 1px 5px; border-radius: 4px; flex-shrink: 0;
}
.recent-item .ri-book {
  flex-shrink: 0; font-size: 10px; color: var(--text-3);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 2px 6px; border-radius: 5px; white-space: nowrap;
}
.empty-hint { margin: 4px 10px; font-size: 12px; color: var(--text-3); }

/* 滚动时出现的迷你吸顶条 */
.mini-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  cursor: pointer; flex-shrink: 0;
  font-family: inherit; text-align: left;
  animation: miniIn .18s;
  /* 高度占位，避免压住下方内容 */
  position: relative; z-index: 6;
}
.mini-bar[hidden] { display: none !important; }
@keyframes miniIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.mb-word { font-size: 14px; font-weight: 650; color: var(--text); }
.mb-pos {
  font-size: 10.5px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); padding: 1px 6px; border-radius: 4px;
}
.mb-back {
  margin-left: auto; display: inline-flex; align-items: center; gap: 3px;
  font-size: 11.5px; color: var(--text-3); font-weight: 500;
}

/* ---------------- 聊天区 ---------------- */
.chatwrap { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat {
  flex: 1; overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex; flex-direction: column; gap: 14px;
  scroll-behavior: smooth;
  /* 程序化滚动时避开 sticky 词头 */
  scroll-padding-top: 96px;
  min-height: 0;
}

/* 消息 */
.msg { display: flex; flex-direction: column; max-width: 100%; }
.msg.user { align-items: flex-end; }
.bubble-user {
  background: var(--brand); color: #fff;
  padding: 9px 14px; border-radius: 18px 18px 4px 18px;
  font-size: 14.5px; max-width: 78%;
  word-break: break-word; box-shadow: var(--shadow-sm);
}
.msg.bot { align-items: flex-start; }
.bubble-bot {
  background: var(--surface); border: 1px solid var(--border);
  padding: 14px; border-radius: 4px 18px 18px 18px;
  box-shadow: var(--shadow-sm);
  max-width: 100%; width: 100%;
}
.bubble-bot p { margin: 0 0 10px; font-size: 14px; color: var(--text-2); }
.bubble-bot p:last-child { margin-bottom: 0; }
.bubble-bot p.lead { color: var(--text); font-size: 14.5px; }

/* 打字指示 */
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-3); animation: blink 1.3s infinite;
}
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%,60%,100% { opacity:.25; transform:translateY(0); } 30% { opacity:1; transform:translateY(-3px); } }

/* ---------- 范围提示 ---------- */
.scope-note {
  margin: 10px 0 2px; padding: 9px 12px;
  border-radius: 9px; background: var(--surface-2);
  font-size: 12.5px; color: var(--text-2); line-height: 1.55;
}
.scope-note b { color: var(--text); font-weight: 600; }
.scope-note.warn { background: #FFF8E6; color: #8A6410; }
.scope-note.warn b { color: #6B4E0A; }
html[data-theme="dark"] .scope-note.warn { background: #2A2415; color: #E8C87A; }
html[data-theme="dark"] .scope-note.warn b { color: #F5D98B; }

/* 例句 */
.exs { margin-top: 12px; }
.exs-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; font-weight: 700; color: var(--text-2);
  margin-bottom: 7px;
}
.exs-range {
  font-size: 11px; font-weight: 600; color: var(--brand);
  background: var(--brand-soft); padding: 2px 8px; border-radius: 20px;
}
.exs-range.out { color: #B8860B; background: #FFF3D6; }
html[data-theme="dark"] .exs-range.out { color: #E8C87A; background: #2A2415; }
.ex.out-ex { opacity: .85; border-left: 2.5px solid #E0A800; }
.ex.out-ex .ex-book { color: #B8860B; border-color: #E0A800; }
.ex {
  padding: 9px 11px; border-radius: 10px;
  background: var(--surface-2); margin-bottom: 6px;
  cursor: pointer; transition: background .14s;
}
.ex:hover { background: var(--brand-soft); }
.ex .en { font-size: 13.5px; color: var(--text); line-height: 1.45; }
.ex .cn { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.ex-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 6px;
}
.ex-book, .ex-pos {
  font-size: 10.5px; padding: 1.5px 6px; border-radius: 5px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-3);
}
.ex-pos { color: var(--brand); border-color: transparent; background: var(--brand-soft); }
/* ★ .ex .play 的样式已移入共享的 card-view.css
   —— 原来这页自带定义，会覆盖共享样式（按钮变不成可点的样子）。 */
.ex-more {
  font-size: 11.5px; color: var(--text-3); text-align: center;
  padding: 6px 0 2px;
}

/* 元信息 */
.meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.tag {
  font-size: 11px; padding: 3px 8px; border-radius: 6px;
  background: var(--brand-soft); color: var(--brand); font-weight: 600;
}
.tag.gray { background: var(--surface-2); color: var(--text-2); }

/* 记忆/同根 */
.memo {
  margin-top: 11px; padding: 10px 12px;
  border-radius: 10px; background: #FFF8E6;
  border: 1px solid #FFE3A3; font-size: 13px; color: #8A6410;
}
html[data-theme="dark"] .memo { background: #2A2415; border-color: #4A3D1C; color: #E8C87A; }
.rels { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.rel {
  font-size: 11.5px; padding: 3px 9px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; color: var(--text-2); font-family: inherit;
}
.rel:hover { border-color: var(--brand); color: var(--brand); }
.rel b { font-weight: 650; }

/* 未收录 */
.notfound {
  text-align: center; padding: 18px 12px; color: var(--text-2);
}
.notfound .big { font-size: 26px; margin-bottom: 8px; }

/* ---------------- 输入区 ---------------- */
.composer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 9px 12px calc(9px + var(--safe-b));
}
.quick-row {
  display: flex; gap: 6px; overflow-x: auto;
  padding-bottom: 8px; scrollbar-width: none;
}
.quick-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 5px 12px; border-radius: 16px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-2); font-size: 12.5px; cursor: pointer;
  font-family: inherit; transition: all .14s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

.input-row { display: flex; align-items: flex-end; gap: 8px; }
.field {
  flex: 1; min-width: 0;
  background: var(--surface-2);
  border: 1.5px solid transparent;
  border-radius: 20px;
  padding: 8px 14px;
  transition: border-color .15s;
}
.field:focus-within { border-color: var(--brand); }
#input {
  width: 100%; border: none; outline: none; resize: none;
  background: transparent; color: var(--text);
  font-family: inherit; font-size: 15px; line-height: 1.4;
  max-height: 110px;
}
#input::placeholder { color: var(--text-3); }

.mic-btn, .send-btn {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: 50%; border: none; cursor: pointer;
  display: grid; place-items: center;
  transition: transform .12s, background .15s, color .15s;
}
.mic-btn { background: var(--surface-2); color: var(--text-2); position: relative; }
.mic-btn:hover { color: var(--brand); background: var(--brand-soft); }
.mic-btn.rec { background: #E5484D; color: #fff; }
.mic-btn.rec .mic-on { display: none; }
.mic-btn .mic-wave { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 2px; }
.mic-btn .mic-wave i {
  width: 2.5px; height: 6px; border-radius: 2px; background: #fff;
  animation: wave .9s infinite ease-in-out;
}
.mic-btn .mic-wave i:nth-child(2) { animation-delay: .12s; }
.mic-btn .mic-wave i:nth-child(3) { animation-delay: .24s; }
.mic-btn .mic-wave i:nth-child(4) { animation-delay: .36s; }
.mic-btn .mic-wave i:nth-child(5) { animation-delay: .48s; }
@keyframes wave { 0%,100% { height: 5px; } 50% { height: 14px; } }
.send-btn { background: var(--brand); color: #fff; }
.send-btn:active { transform: scale(.9); }
.send-btn:disabled { background: var(--surface-2); color: var(--text-3); cursor: default; }

.composer-hint {
  font-size: 11.5px; color: var(--text-3);
  text-align: center; padding-top: 7px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}

/* ---------------- 弹层 ---------------- */
.sheet-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(16,24,40,.42);
  backdrop-filter: blur(2px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .18s;
}
/* hidden 属性优先级低于 display:flex，必须显式覆盖 */
.sheet-mask[hidden] { display: none !important; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%; max-width: 520px;
  max-height: 78vh; overflow-y: auto;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(20px + var(--safe-b));
  animation: slideUp .24s cubic-bezier(.22,1,.36,1);
  box-shadow: 0 -8px 40px rgba(16,24,40,.16);
}
@keyframes slideUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h2 { margin: 0; font-size: 16px; font-weight: 650; display: flex; align-items: center; gap: 7px; }
.sheet-desc {
  margin: -6px 0 14px; font-size: 12.5px; color: var(--text-2); line-height: 1.55;
}
.sheet-desc b { color: var(--brand); }
.sheet-close {
  width: 30px; height: 30px; border-radius: 50%;
  border: none; background: var(--surface-2); color: var(--text-2);
  cursor: pointer; font-size: 14px; line-height: 1;
}

/* 学段范围列表 */
.level-list { display: flex; flex-direction: column; gap: 7px; }
.level-item {
  display: block; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: var(--radius);
  border: 1.5px solid var(--border); background: var(--surface);
  cursor: pointer; font-family: inherit; transition: all .15s;
}
.level-item:hover { border-color: var(--brand); background: var(--brand-soft); }
.level-item.active { border-color: var(--brand); background: var(--brand-soft); }
.li-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.li-name { font-size: 14.5px; font-weight: 650; color: var(--text); }
.li-badge {
  font-size: 10.5px; font-weight: 700; color: #fff;
  background: var(--brand); padding: 2px 8px; border-radius: 20px;
}
.li-desc { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.li-count { font-size: 11.5px; color: var(--text-3); margin-top: 5px; font-variant-numeric: tabular-nums; }
.stage-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stage-card {
  padding: 13px; border-radius: var(--radius);
  border: 1.5px solid var(--border); background: var(--surface);
  cursor: pointer; text-align: left; font-family: inherit;
  transition: all .15s;
}
.stage-card:hover { border-color: var(--brand); background: var(--brand-soft); }
.stage-card.active { border-color: var(--brand); background: var(--brand-soft); }
.stage-card .sc-name { font-size: 14px; font-weight: 650; color: var(--text); }
.stage-card .sc-n { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.stage-card .sc-d { font-size: 11px; color: var(--text-2); margin-top: 6px; line-height: 1.4; }

.wb-list { display: flex; flex-direction: column; gap: 6px; }
.wb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 11px;
  background: var(--surface-2); cursor: pointer;
  transition: background .14s;
}
.wb-item:hover { background: var(--brand-soft); }
.wb-item .ww { font-size: 15px; font-weight: 650; }
.wb-item .wd { font-size: 12px; color: var(--text-2); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-item .wx {
  width: 26px; height: 26px; border-radius: 50%; border: none;
  background: transparent; color: var(--text-3); cursor: pointer; font-size: 15px;
  flex-shrink: 0;
}
.wb-item .wx:hover { color: #E5484D; background: var(--surface); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(88px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 200;
  background: rgba(26,29,35,.94); color: #fff;
  padding: 9px 16px; border-radius: 22px;
  font-size: 13px; box-shadow: var(--shadow);
  animation: fade .16s; max-width: 84vw; text-align: center;
  white-space: nowrap;
}
.toast[hidden] { display: none !important; }

/* ---------------- PC 适配 ---------------- */
@media (min-width: 900px) {
  .only-desktop { display: grid; }
  .sidebar { display: block; }
  .topbar { padding: 12px 22px; }
  .chat { padding: 22px 26px 10px; }
  .chat > .msg { max-width: 860px; width: 100%; margin-left: auto; margin-right: auto; }
  .bubble-bot { width: auto; max-width: 100%; }
  .wc-head { margin: -14px -14px 10px; padding: 12px 14px 10px; }
  .composer { padding: 11px 26px 14px; }
  .composer > * { max-width: 860px; margin-left: auto; margin-right: auto; }
  .quick-row { justify-content: flex-start; }
  .sheet-mask { align-items: center; }
  .sheet { border-radius: 18px; max-height: 82vh; }
  .stage-grid { grid-template-columns: repeat(3, 1fr); }
  .tb-title h1 { font-size: 16px; }
  .wc-word { font-size: 34px; }
}

@media (min-width: 1280px) {
  .sidebar { width: 292px; }
  .chat { padding: 26px 40px 12px; }
  .composer { padding: 12px 40px 16px; }
}

/* 小屏优化 */
@media (max-width: 380px) {
  .chat { padding: 14px 10px 6px; }
  .composer { padding: 8px 10px calc(8px + var(--safe-b)); }
  .gblock { min-width: 30px; padding: 6px 6px 4px; }
  .gblock .letters { font-size: 17px; }
  .wc-word { font-size: 26px; }
  .bubble-bot { padding: 12px; }
}

/* ============================================================
   ★ 中文反查结果样式（与窗体演示保持一致）
   ============================================================ */
.cn-word {
  border: 1px solid var(--brand-soft); background: var(--brand-soft);
  border-radius: 11px; padding: 11px 12px; margin-top: 9px;
}
.cn-word-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cn-word-top .w { font-size: 21px; font-weight: 700; letter-spacing: -.01em; color: var(--brand); }
.cn-word-top .p {
  font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 5px;
  background: var(--surface); color: var(--text-2);
}
.cn-word-top .cn { font-size: 12.5px; color: var(--text); }
.cn-ph { font-size: 11px; color: var(--text-2); font-family: "SF Mono", Menlo, Consolas, monospace; margin-top: 3px; }
.cn-ex { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.cn-ex-item { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; }
.cn-ex-item .en { font-size: 12.5px; color: var(--text); line-height: 1.45; }
.cn-ex-item .cn { font-size: 11.5px; color: var(--text-2); margin-top: 2px; }
.cn-ex-item .src { font-size: 9.5px; color: var(--text-3); margin-top: 3px; }

/* ============================================================
   ★ 句子 / 短语翻译结果样式（与窗体演示保持一致）
   ============================================================ */
.tr-main{background:var(--brand-soft);border:1px solid var(--brand);
  border-radius:11px;padding:12px 13px;margin:9px 0;}
.tr-main .orig{font-size:13.5px;line-height:1.5;color:var(--text);font-weight:600;}
.tr-main .tr-arrow{color:var(--brand);font-size:13px;margin:5px 0;}
.tr-main .trans{font-size:15px;line-height:1.55;color:var(--brand);font-weight:650;}
.tr-literal{font-size:11.5px;color:var(--text-3);margin-top:6px;padding-top:6px;
  border-top:1px dashed rgba(76,110,245,.25);}
.tr-sec{margin-top:11px;}
.tr-sec-h{font-size:11.5px;font-weight:700;color:var(--text-2);margin-bottom:6px;
  display:flex;align-items:center;gap:6px;}
.tr-sec-h::before{content:'';width:3px;height:11px;border-radius:2px;background:var(--brand);}
.tr-item{border-left:2px solid var(--border);padding:3px 0 3px 10px;margin-bottom:6px;}
.tr-item .en{font-size:12.5px;line-height:1.5;color:var(--text);}
.tr-item .cn{font-size:12px;color:var(--text-2);margin-top:2px;}
.tr-item .note{font-size:11px;color:var(--warn,#E8590C);margin-top:3px;
  background:rgba(232,89,12,.08);padding:2px 7px;border-radius:5px;display:inline-block;}
.tr-kw{display:flex;flex-wrap:wrap;gap:6px;}
.tr-kw-item{background:var(--surface-2);border:1px solid var(--border);
  border-radius:9px;padding:6px 9px;min-width:96px;}
.tr-kw-item .w{font-size:13px;font-weight:700;color:var(--text);display:inline-block;}
.tr-kw-item .p{font-size:9.5px;font-weight:700;padding:1px 5px;border-radius:4px;
  background:var(--brand-soft);color:var(--brand);margin-left:5px;}
.tr-kw-item .cn{font-size:11.5px;color:var(--text-2);margin-top:2px;}
.tr-kw-item .note{font-size:10.5px;color:var(--text-3);margin-top:3px;line-height:1.4;}
.tr-gram{background:var(--surface-2);border-radius:9px;padding:8px 10px;margin-bottom:6px;}
.tr-gram .t{font-size:12px;font-weight:700;color:var(--text);}
.tr-gram .d{font-size:11.5px;color:var(--text-2);margin-top:3px;line-height:1.5;}

/* ============================================================
   ★ 义项专属例句（挂在词性组下）
   ============================================================ */
.def-exs{margin-top:7px;padding-top:7px;border-top:1px dashed var(--border);
  display:flex;flex-direction:column;gap:5px;}
.def-ex{background:var(--surface-2);border:1px solid transparent;border-radius:8px;
  padding:7px 9px;cursor:pointer;transition:background .14s,border-color .14s;}
.def-ex:hover{background:var(--brand-soft);border-color:var(--brand-soft);}
.def-ex.playing{background:var(--brand-soft);border-color:var(--brand);}
.def-ex .en{font-size:12.5px;line-height:1.5;color:var(--text);}
.def-ex .cn{font-size:11.5px;color:var(--text-2);margin-top:3px;line-height:1.45;}
.def-ex .ex-meta{display:flex;align-items:center;gap:6px;margin-top:5px;flex-wrap:wrap;}
.def-ex .play{margin-left:auto;}
