:root {
  --paper: #F6F3EC;
  --paper-2: #FCFAF5;
  --paper-3: #EFEAE0;
  --ink: #1B1917;
  --ink-2: #3D3934;
  --muted: #8C8378;
  --line: #E3DCCF;
  --line-2: #D3C9B8;
  --accent: #B4462F;
  --accent-soft: #F4E3DC;
  --green: #2F4A3F;
  --green-soft: #E3EAE4;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif;
  --sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(27, 25, 23, .04), 0 8px 24px -12px rgba(27, 25, 23, .12);
  --r: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 14.5px; line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #E8CDBF; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #D8CFC0; border-radius: 9px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #C3B7A3; background-clip: content-box; }

.app { display: flex; height: 100vh; overflow: hidden; }

/* ---------------- 侧栏 ---------------- */
.sidebar {
  width: 236px; flex: 0 0 236px; background: #17140F; color: #EDE6D8;
  display: flex; flex-direction: column; padding: 22px 14px 16px; position: relative;
}
.sidebar::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 60% at 0% 0%, rgba(180, 70, 47, .16), transparent 60%);
}
.brand { display: flex; gap: 11px; align-items: center; padding: 0 6px 22px; position: relative; z-index: 1; }
.logo {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px;
  background: linear-gradient(160deg, #E4D9C4, #C9B99A); color: #17140F;
  display: grid; place-items: center; font-family: var(--serif); font-size: 21px; font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.3; }
.brand-txt b { font-family: var(--serif); font-size: 17px; letter-spacing: .12em; }
.brand-txt span { font-size: 10.5px; color: #9A8F7C; letter-spacing: .06em; }

.nav { display: flex; flex-direction: column; gap: 2px; position: relative; z-index: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 9px;
  color: #B7AC99; font-size: 13.5px; cursor: pointer; transition: .16s; position: relative;
}
.nav-item i { font-style: normal; font-size: 13px; width: 16px; text-align: center; opacity: .8; }
.nav-item em { font-style: normal; margin-left: auto; font-size: 11px; color: #7A7062; }
.nav-item:hover { background: rgba(255, 255, 255, .05); color: #EDE6D8; }
.nav-item.active { background: rgba(228, 217, 196, .13); color: #F5EEE0; }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-item.active i { color: #E0A08C; opacity: 1; }

.sidebar-foot { margin-top: auto; position: relative; z-index: 1; }
.model-chip {
  font-size: 11px; color: #9A8F7C; background: rgba(255, 255, 255, .06); border-radius: 8px;
  padding: 6px 9px; margin-bottom: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  cursor: pointer; transition: .16s;
}
.model-chip:hover { background: rgba(255, 255, 255, .1); color: #D8CCB6; }
.model-chip.warn { color: #E8A88F; background: rgba(180, 70, 47, .16); }
.foot-note { font-size: 10.5px; line-height: 1.7; color: #6B6255; padding: 0 2px; }

/* ---------------- 主区 ---------------- */
.main { flex: 1; min-width: 0; overflow-y: auto; position: relative; }
.main.no-scroll { overflow: hidden; }
.page { max-width: 1180px; margin: 0 auto; padding: 34px 40px 80px; }
.page.wide { max-width: 1320px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-title { font-family: var(--serif); font-size: 27px; font-weight: 700; letter-spacing: .04em; margin: 0; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 6px; max-width: 620px; }
.head-actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* 按钮 */
.btn {
  border: 1px solid var(--line-2); background: var(--paper-2); color: var(--ink-2);
  padding: 8px 15px; border-radius: 9px; cursor: pointer; font-size: 13px;
  transition: .15s; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn:hover { border-color: #BCAE99; background: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--ink); color: #F6F3EC; border-color: var(--ink); }
.btn.primary:hover { background: #2C2723; }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.accent:hover { background: #9E3C27; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); padding: 6px 9px; }
.btn.ghost:hover { background: var(--paper-3); color: var(--ink); }
.btn.sm { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn.danger:hover { border-color: #C58A7C; color: var(--accent); background: #FBF1EE; }

/* 卡片 */
.card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.tag {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 20px;
  background: var(--paper-3); color: var(--muted); border: 1px solid var(--line);
}
.tag.accent { background: var(--accent-soft); color: #8E3A26; border-color: #EBCFC5; }
.tag.green { background: var(--green-soft); color: var(--green); border-color: #CBD8CE; }

/* ---------------- 创作台 ---------------- */
.create-wrap { display: flex; flex-direction: column; height: 100vh; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 14px 30px;
  border-bottom: 1px solid var(--line); background: rgba(252, 250, 245, .86);
  backdrop-filter: blur(8px); flex: 0 0 auto; position: sticky; top: 0; z-index: 20;
}
.mode-switch { display: flex; background: var(--paper-3); padding: 3px; border-radius: 10px; gap: 2px; }
.mode-switch button {
  border: 0; background: transparent; padding: 6px 13px; border-radius: 8px; cursor: pointer;
  font-size: 12.5px; color: var(--muted); transition: .15s;
}
.mode-switch button.on { background: var(--paper-2); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.topbar-spacer { flex: 1; }
.writer-pick {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--paper-2);
  border-radius: 9px; padding: 6px 10px; font-size: 12.5px; cursor: pointer;
}
.writer-pick:hover { border-color: #BCAE99; }
.writer-pick .av { font-size: 14px; }
/* 名字单独一层，窄屏才能省略号收尾；混在文本节点里没法截断 */
.writer-pick .wp-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.writer-pick .wp-caret { color: var(--muted); font-size: 10px; flex: 0 0 auto; }
.ir-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.thread { flex: 1; overflow-y: auto; padding: 26px 30px 10px; }
.thread-inner { max-width: 820px; margin: 0 auto; }

.empty {
  text-align: center; padding: 8vh 20px 40px; color: var(--muted);
}
.empty .big { font-family: var(--serif); font-size: 34px; color: var(--ink); letter-spacing: .06em; margin-bottom: 14px; }
.empty .big span { color: var(--accent); }
.empty p { max-width: 460px; margin: 0 auto 8px; font-size: 13.5px; }
.starter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 620px; margin: 26px auto 0; }
.starter {
  text-align: left; padding: 13px 15px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--paper-2); cursor: pointer; transition: .16s;
}
.starter:hover { border-color: #C9B79E; transform: translateY(-1px); box-shadow: var(--shadow); }
.starter b { display: block; font-size: 13px; margin-bottom: 3px; }
.starter span { font-size: 11.5px; color: var(--muted); }

.msg-user {
  display: flex; justify-content: flex-end; margin: 18px 0;
}
.msg-user .bubble {
  background: var(--ink); color: #F3EDE1; padding: 11px 16px; border-radius: 14px 14px 4px 14px;
  max-width: 78%; white-space: pre-wrap; font-size: 13.5px;
}

.stage {
  border: 1px solid var(--line); background: var(--paper-2); border-radius: var(--r);
  margin: 14px 0; overflow: hidden; box-shadow: var(--shadow); animation: rise .3s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.stage-head {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px;
  border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #FDFBF7, #F8F5EE);
}
.stage-av {
  width: 29px; height: 29px; border-radius: 9px; display: grid; place-items: center;
  background: var(--paper-3); font-size: 14px; flex: 0 0 29px;
}
.stage-name { font-family: var(--serif); font-weight: 700; font-size: 14px; letter-spacing: .04em; }
.stage-role { font-size: 11.5px; color: var(--muted); }
.stage-head .sp { flex: 1; }
.stage-status { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: #C9BFAE; }
.dot.live { background: var(--accent); animation: pulse 1.1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.stage-body { padding: 14px 18px 16px; font-size: 13.8px; color: var(--ink-2); }
.stage-body:empty::after { content: "…"; color: var(--muted); }

.composer { flex: 0 0 auto; padding: 10px 30px 20px; background: linear-gradient(180deg, rgba(246,243,236,0), var(--paper) 30%); }
.banner {
  flex: 0 0 auto; margin: 0 30px; padding: 10px 16px; border-radius: 10px;
  background: #FBF0EA; border: 1px solid #EFD6CA; color: #8E3A26; font-size: 12.5px;
}
.banner b { font-weight: 700; }
.banner a { text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
/* 流程中断后的恢复条：比普通提示更醒目，因为它挡住了一次未完成的活儿 */
.banner.warn {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  background: #FDF6E8; border-color: #EBD9B4; color: #7A5A16; margin-bottom: 8px;
}
.composer-inner { max-width: 820px; margin: 0 auto; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 9px; }
.chip {
  border: 1px solid var(--line); background: var(--paper-2); border-radius: 20px; padding: 4px 11px;
  font-size: 11.5px; color: var(--muted); cursor: pointer; transition: .15s;
}
.chip:hover { border-color: #C9B79E; color: var(--ink); background: #fff; }
.chip.on { background: var(--accent-soft); border-color: #E4C4B8; color: #8E3A26; }
.input-box {
  border: 1px solid var(--line-2); background: var(--paper-2); border-radius: 14px;
  padding: 12px 14px; box-shadow: var(--shadow); transition: .16s;
}
.input-box:focus-within { border-color: #BCA98C; box-shadow: 0 0 0 3px rgba(180, 70, 47, .07); }
.input-box textarea {
  width: 100%; border: 0; outline: 0; background: transparent; resize: none;
  font-size: 14px; line-height: 1.7; max-height: 200px; min-height: 46px; display: block;
}
.input-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.input-row .hint { font-size: 11px; color: var(--muted); margin-right: auto; }

/* ---------------- 作家库 ---------------- */
.writer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.writer-card {
  padding: 20px; cursor: pointer; transition: .18s; position: relative; overflow: hidden;
  display: flex; flex-direction: column; min-height: 196px;
}
.writer-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(27,25,23,.05), 0 16px 34px -18px rgba(27,25,23,.28); border-color: var(--line-2); }
.writer-card .accent-bar { position: absolute; left: 0; top: 0; width: 100%; height: 3px; }
.wc-top { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.wc-av {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 20px;
  background: var(--paper-3); flex: 0 0 42px;
}
.wc-name { font-family: var(--serif); font-size: 16.5px; font-weight: 700; letter-spacing: .03em; }
.wc-tag { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.wc-tagline { font-size: 13px; color: var(--ink-2); line-height: 1.65; margin-bottom: 12px; flex: 1; }
.wc-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.wc-foot { margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line); display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.writer-card.add {
  display: grid; place-items: center; border-style: dashed; background: transparent; box-shadow: none;
  color: var(--muted); text-align: center;
}
.writer-card.add:hover { background: var(--paper-2); border-color: #C9B79E; }
.writer-card.add .plus { font-size: 26px; display: block; margin-bottom: 6px; color: #C0B39C; }

/* ---------------- 专家库 ---------------- */
.expert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.expert-card { padding: 17px 18px; cursor: pointer; transition: .16s; }
.expert-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -16px rgba(27,25,23,.26); }
.ec-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 9px; }
.ec-av { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; background: var(--paper-3); flex: 0 0 34px; }
.ec-id { min-width: 0; }
.ec-name { font-family: var(--serif); font-weight: 700; font-size: 15px; }
.ec-role { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* 关卡标签并进角色那一行：原来单独占一行，十张卡白吃两百多像素 */
.ec-gate {
  font-size: 10px; letter-spacing: .04em; color: var(--accent); background: var(--accent-soft);
  border-radius: 4px; padding: 0 5px; white-space: nowrap;
}
.ec-tagline { font-size: 12.8px; color: var(--ink-2); margin-bottom: 10px; min-height: 40px; }
.ec-duties { display: flex; flex-direction: column; gap: 3px; }
.ec-duties span { font-size: 11.5px; color: var(--muted); padding-left: 12px; position: relative; }
.ec-duties span::before { content: "·"; position: absolute; left: 3px; color: var(--accent); font-weight: 700; }

.golden { margin-top: 30px; padding: 26px 30px; background: linear-gradient(160deg, #1F1B16, #17140F); color: #E8DFCD; border: 0; }
.golden h3 { font-family: var(--serif); font-size: 19px; margin: 0 0 4px; letter-spacing: .06em; }
.golden .core { font-size: 12.5px; color: #A99E8A; margin-bottom: 20px; font-style: italic; }
.golden-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.gl-item { display: flex; gap: 10px; }
.gl-n { font-family: var(--serif); font-size: 15px; color: #C9705A; flex: 0 0 18px; }
.gl-t { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.gl-d { font-size: 11.5px; color: #9C9182; line-height: 1.6; }

/* ---------------- 作品库 ---------------- */
.work-row {
  display: flex; gap: 14px; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line);
  cursor: pointer; transition: .15s;
}
.work-row:last-child { border-bottom: 0; }
.work-row:hover { background: #FDFBF6; }
.wr-title { font-family: var(--serif); font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.wr-meta { font-size: 11.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.wr-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ---------------- 设置 ---------------- */
.form { max-width: 560px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.field .desc { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--paper-2); outline: 0; font-size: 13px; transition: .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: #BCA98C; box-shadow: 0 0 0 3px rgba(180,70,47,.07); }
.field textarea { min-height: 90px; resize: vertical; line-height: 1.65; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------------- Markdown ---------------- */
.md h1, .md h2, .md h3, .md h4 { font-family: var(--serif); line-height: 1.45; margin: 20px 0 9px; letter-spacing: .02em; }
.md h1 { font-size: 21px; } .md h2 { font-size: 17.5px; } .md h3 { font-size: 15.5px; } .md h4 { font-size: 14px; }
.md p { margin: 0 0 11px; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 21px; }
.md li { margin-bottom: 5px; }
.md strong { font-weight: 700; color: var(--ink); }
.md blockquote { margin: 12px 0; padding: 8px 14px; border-left: 3px solid #DCC6B4; background: #F8F4EC; color: var(--ink-2); font-size: 13px; }
.md code { background: var(--paper-3); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.md pre { background: #1F1B16; color: #E8DFCD; padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-size: 12.5px; }
.md pre code { background: transparent; color: inherit; padding: 0; }
.md table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 12.5px; }
.md th, .md td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
.md th { background: var(--paper-3); font-weight: 600; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.md a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ---------------- 弹层 ---------------- */
.modal-root:empty { display: none; }
.mask {
  position: fixed; inset: 0; background: rgba(23, 20, 15, .42); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 30px; z-index: 100; animation: fade .18s;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.sheet {
  background: var(--paper-2); border-radius: 16px; width: min(760px, 100%); max-height: 86vh;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 70px -20px rgba(0,0,0,.4);
  animation: rise .22s ease;
}
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.sheet-body { padding: 20px 24px; overflow-y: auto; }
.sheet-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 9px; justify-content: flex-end; background: #FBF9F4; }
.sheet h4 { font-family: var(--serif); font-size: 18px; margin: 16px 0 8px; }
.sheet h4:first-child { margin-top: 0; }

.toast-wrap { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #1F1B16; color: #F3EDE1; padding: 9px 17px; border-radius: 10px; font-size: 12.5px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); animation: rise .22s; max-width: 80vw;
}
/* 错误提示：停留、可读、可复制、可关闭 */
.toast.err {
  background: #8E3A26; display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 12px 11px 16px; max-width: min(680px, 88vw); cursor: pointer;
  text-align: left; line-height: 1.55;
}
.toast.err .toast-txt { flex: 1; min-width: 0; word-break: break-word; }
.toast-x {
  flex: 0 0 auto; background: rgba(255,255,255,.14); color: #F3EDE1; border: 0;
  width: 22px; height: 22px; border-radius: 6px; font-size: 15px; line-height: 1;
  cursor: pointer; padding: 0;
}
.toast-x:hover { background: rgba(255,255,255,.28); }

.loading-line { display: inline-block; width: 7px; height: 14px; background: var(--accent); vertical-align: -2px; animation: blink 1s steps(2) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0 } }

.divider-title { display: flex; align-items: center; gap: 12px; margin: 34px 0 18px; font-family: var(--serif); font-size: 16px; letter-spacing: .06em; }
.divider-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .page { padding: 24px 18px 70px; }
  .thread, .composer { padding-left: 16px; padding-right: 16px; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .starter-grid { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
}

/* ---------------- 创作项目 ---------------- */
.crumb { font-size: 12px; color: var(--muted); display: inline-block; margin-bottom: 8px; }
.crumb:hover { color: var(--accent); }

.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.proj-card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 20px; box-shadow: var(--shadow); cursor: pointer; transition: .16s;
  display: flex; flex-direction: column; gap: 10px;
}
.proj-card:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: 0 16px 36px -20px rgba(27,25,23,.34); }
.proj-top { display: flex; align-items: flex-start; gap: 10px; }
.proj-name { font-family: var(--serif); font-size: 17px; font-weight: 700; flex: 1; min-width: 0; }
.proj-desc { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; min-height: 20px; }
.proj-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.proj-bar { height: 5px; background: var(--paper-3); border-radius: 4px; overflow: hidden; }
.proj-bar i { display: block; height: 100%; background: linear-gradient(90deg, #B4462F, #D08A6E); border-radius: 4px; transition: width .4s; }
.proj-next { font-size: 11.5px; color: var(--muted); }

.stat-row { display: flex; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.stat {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px;
  min-width: 104px; display: flex; flex-direction: column; justify-content: center;
}
.stat b { font-family: var(--serif); font-size: 24px; display: block; line-height: 1.15; }
.stat span { font-size: 11px; color: var(--muted); }
/* 第四块是"下一期进度"，桌面上比前三块宽一倍；手机上它单独占一整行 */
.stat-wide { flex: 2; min-width: 220px; }

.sect { margin-bottom: 16px; overflow: hidden; }
.sect-head { display: flex; align-items: center; gap: 10px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.sect-title { font-family: var(--serif); font-size: 15px; font-weight: 700; }
.sect-body { padding: 16px 20px; font-size: 13px; }

.plan-row { display: flex; gap: 14px; padding: 15px 20px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.plan-row:last-child { border-bottom: 0; }
.plan-row.done { background: #FAF8F2; }
.plan-seq {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%; background: var(--paper-3);
  color: var(--muted); display: grid; place-items: center; font-size: 12px; font-weight: 600; margin-top: 2px;
}
.plan-row.done .plan-seq { background: var(--green-soft); color: var(--green); }
.plan-main { flex: 1; min-width: 0; cursor: pointer; }
.plan-title { font-family: var(--serif); font-size: 14.5px; font-weight: 600; }
.plan-angle { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.plan-detail { margin-top: 10px; padding: 12px 14px; background: var(--paper); border-radius: 9px; font-size: 12px; line-height: 1.75; }
.pd { margin-bottom: 6px; }
.pd:last-child { margin-bottom: 0; }
.pd b { color: var(--accent); font-weight: 600; margin-right: 8px; }
.plan-act { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.plan-tip {
  font-size: 12px; color: var(--muted); background: var(--paper);
  border-left: 2px solid var(--accent); padding: 10px 13px; border-radius: 0 8px 8px 0; line-height: 1.7;
}

/* ---------------- 分发到平台 ---------------- */
.plat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 18px; }
.plat-card {
  display: flex; gap: 11px; align-items: flex-start; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--paper-2); cursor: pointer; transition: .15s;
}
.plat-card:hover { border-color: var(--line-2); background: #fff; }
.plat-card.on { border-color: #D9A794; background: var(--accent-soft); }
.plat-ic {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; background: var(--paper-3);
  display: grid; place-items: center; font-family: var(--serif); font-size: 14px; font-weight: 700; color: var(--ink-2);
}
.plat-card.on .plat-ic { background: #fff; color: var(--accent); }
.plat-name { font-size: 13px; font-weight: 600; }
.plat-desc { font-size: 11px; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.fmt-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.fmt-out {
  width: 100%; min-height: 300px; max-height: 46vh; padding: 14px 16px;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--paper);
  font-family: var(--sans); font-size: 13px; line-height: 1.85; outline: 0; resize: vertical;
}
.fmt-preview { max-height: 46vh; overflow: auto; padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.dist-bar { padding: 10px 22px; border-top: 1px solid var(--line); display: flex; gap: 7px; flex-wrap: wrap; align-items: center; background: #FBF9F4; }

/* ---------------- 转图文 ---------------- */
.card-wrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.card-item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--paper-3); }
.card-item img { width: 100%; display: block; }
.card-cap { display: flex; align-items: center; justify-content: space-between; padding: 5px 8px; font-size: 11px; color: var(--muted); background: var(--paper-2); }

/* ---------------- 版本更新提示 ---------------- */
.ver-bar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px 16px; border-radius: 10px;
  background: #1F1B14; color: #F3EDE0;
  font-family: var(--sans); font-size: 13px; line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  z-index: 9999; max-width: calc(100% - 32px);
}
.ver-bar > span { flex: 1; }
/* 插进页面流里的形态：贴在输入框上方，不遮任何按钮 */
.ver-bar.in-flow {
  position: static; transform: none; left: auto; bottom: auto;
  flex: 0 0 auto; align-self: center;
  width: min(820px, calc(100% - 60px));
  margin: 8px 0 0; box-shadow: 0 3px 12px rgba(0, 0, 0, .16);
}
.ver-bar button {
  border: 0; border-radius: 7px; padding: 7px 13px; cursor: pointer;
  font-size: 12.5px; font-family: inherit; white-space: nowrap;
}
#verReload { background: #E4D9C4; color: #1F1B14; font-weight: 600; }
#verLater { background: transparent; color: #9C9382; padding: 7px 8px; font-size: 15px; }

/* ---------------- AI 配图 ---------------- */
.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.art-item {
  position: relative; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; background: var(--paper-3);
}
/* 以前是 aspect-ratio:1/1 + cover，竖图被裁成方块，看着像尺寸没生效。
   改成统一画框 + contain：真实比例一眼能看出来，也不会把画面裁掉。 */
.art-item img {
  width: 100%; display: block; aspect-ratio: 4 / 5;
  object-fit: contain; background: var(--paper-3); cursor: zoom-in;
}
.art-item img:hover { filter: brightness(1.04); }
.art-dim {
  position: absolute; right: 6px; bottom: 6px; z-index: 2;
  padding: 1px 6px; border-radius: 4px;
  background: rgba(23, 20, 15, .62); color: #F3EDE0;
  font-size: 10px; letter-spacing: .02em; font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.art-item .art-ops { opacity: 0; transition: opacity .15s; }
.art-item:hover .art-ops { opacity: 1; }
.art-ops {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; gap: 6px; padding: 7px;
  background: linear-gradient(to top, rgba(23,20,15,.72), rgba(23,20,15,0));
}
.art-ops .btn { background: rgba(252,250,245,.94); color: var(--ink); border: 0; }
.art-badge {
  position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 20px;
  background: var(--accent); color: #fff; font-size: 10.5px; letter-spacing: .04em;
}
.art-params { display: flex; gap: 14px; align-items: flex-end; margin-top: 12px; flex-wrap: wrap; }
.art-params .field { min-width: 120px; }

.art-ideas { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.art-idea {
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px;
  background: var(--paper-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.art-idea:hover { border-color: var(--line-2); background: var(--paper); }
.art-idea.on { border-color: var(--accent); background: var(--accent-soft); }
.art-idea .ai-t { font-size: 12.5px; font-weight: 650; margin-bottom: 3px; }
.art-idea .ai-p { font-size: 12px; color: var(--ink-2); line-height: 1.65; }
.art-idea .ai-w { font-size: 11.5px; color: var(--muted); margin-top: 5px; font-style: italic; }

.art-strip { padding: 4px 26px 12px; }
.art-strip .as-t { font-size: 11.5px; color: var(--muted); margin-bottom: 7px; }
.art-strip .as-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.art-strip .as-row img {
  height: 92px; width: 92px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line); flex: 0 0 auto;
}

.wr-cover {
  width: 46px; height: 46px; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--line); flex: 0 0 auto; margin-right: 12px;
}
.switch-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); padding: 7px 0; }
.switch-row input { width: auto; margin: 0; }

/* 配图的描述框：.fmt-out 默认最小 300px，在弹窗里会把方案区挤没 */
.art-ta { min-height: 0 !important; height: 104px; max-height: none; }

/* Key 保存状态：输入框会被清空，所以状态必须一直挂在 label 上 */
.key-state { font-size: 11.5px; font-weight: 400; margin-left: 8px; letter-spacing: .01em; }
.key-ok { color: #2F7A50; }
.key-no { color: #B4462F; }
.lnk {
  border: 0; background: none; padding: 0; margin-left: 4px;
  color: var(--muted); text-decoration: underline; cursor: pointer;
  font-size: 12px; font-family: inherit;
}
.lnk:hover { color: var(--accent); }

/* 方案多选的勾选框 */
.art-idea .ai-pick {
  display: inline-block; width: 13px; height: 13px; margin-right: 7px;
  border: 1.5px solid var(--line-2); border-radius: 4px;
  vertical-align: -1px; position: relative; transition: background .12s, border-color .12s;
}
.art-idea.on .ai-pick { background: var(--accent); border-color: var(--accent); }
.art-idea.on .ai-pick::after {
  content: '✓'; position: absolute; inset: 0;
  color: #fff; font-size: 10px; line-height: 12px; text-align: center;
}
.art-idea.on .ai-t { color: var(--accent); }

/* 点图放大 */
.zoom-mask {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(14, 11, 8, .92);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 26px; cursor: zoom-out;
  animation: zoomIn .16s ease-out;
}
@keyframes zoomIn { from { opacity: 0; } to { opacity: 1; } }
.zoom-mask img {
  max-width: 100%; max-height: calc(100% - 76px);
  object-fit: contain; border-radius: 6px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .55); cursor: default;
}
.zoom-bar {
  display: flex; gap: 12px; align-items: center; margin-top: 16px;
  color: #E4D9C4; font-size: 12.5px; font-family: var(--sans);
}
.zoom-bar .btn { border: 1px solid rgba(228, 217, 196, .3); background: transparent; color: #E4D9C4; }
.zoom-bar .btn.ghost { border-color: transparent; color: #9C9382; }

/* 触屏没有 hover，操作按钮必须常显，否则手机上根本点不到下载 */
@media (hover: none) {
  .art-item .art-ops { opacity: 1; }
}

/* ---------------- 多模型 ---------------- */
/* 输入框左下角的模型胶囊：一眼知道这一步谁在写，点开就换 */
.model-pick {
  display: flex; align-items: center; gap: 6px; flex: 0 0 auto;
  border: 1px solid var(--line-2); background: var(--paper); border-radius: 8px;
  padding: 3px 8px; font-size: 11.5px; color: var(--ink-2); cursor: pointer;
  max-width: 210px; transition: .15s; font-family: var(--sans);
}
.model-pick:hover { border-color: #BCAE99; background: #fff; }
.mp-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 168px; }
.mp-caret { color: var(--muted); font-size: 10px; }
.mp-dot { width: 6px; height: 6px; border-radius: 50%; background: #2F7A50; flex: 0 0 auto; }
.mp-dot.off { background: #C4693F; }

/* 消息头上标出这条是谁写的 */
.stage-model {
  margin-left: 7px; font-size: 10.5px; color: #8C8578;
  background: rgba(27, 25, 23, .045); border-radius: 5px; padding: 1px 6px;
}

/* 换模型弹层 */
.model-list { display: flex; flex-direction: column; gap: 6px; }
.model-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--paper-2);
  transition: .14s;
}
.model-row:hover { border-color: #C9B79E; background: #fff; }
.model-row.on { border-color: #D9B9AC; background: var(--accent-soft); }
.mr-av {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; color: var(--muted); border: 1px solid var(--line-2); flex: 0 0 auto;
}
.model-row.on .mr-av { color: #8E3A26; border-color: #DFBEAF; background: #fff; }
.mr-main { flex: 1; min-width: 0; }
.mr-name { font-weight: 700; font-size: 13px; }
.mr-meta { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-tag {
  font-size: 10px; color: #7A5A16; background: #FDF6E8; border: 1px solid #EBD9B4;
  border-radius: 5px; padding: 1px 6px; flex: 0 0 auto;
}

/* 设置页的模型清单 */
.model-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 20px;
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.model-item:last-child { border-bottom: 0; }
.mi-main { flex: 1; min-width: 190px; }
.mi-name { font-size: 13.5px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.mi-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; word-break: break-all; }
.mi-tag { font-size: 10px; font-weight: 400; border-radius: 5px; padding: 1px 6px; border: 1px solid var(--line-2); color: var(--muted); }
.mi-tag.def { color: #7A5A16; background: #FDF6E8; border-color: #EBD9B4; }
.mi-tag.cur { color: #8E3A26; background: var(--accent-soft); border-color: #E4C4B8; }
.mi-tag.warn { color: #8E3A26; background: #FBF0EA; border-color: #EFD6CA; }
.mi-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.mi-ping { width: 100%; margin-top: 6px; font-size: 11.5px; color: var(--muted); line-height: 1.6; word-break: break-word; }
.mi-ping.ok { color: #2F7A50; }
.mi-ping.bad { color: #B4462F; }
.model-foot {
  display: flex; align-items: center; gap: 12px; padding: 14px 20px;
  background: rgba(27, 25, 23, .015); border-top: 1px solid var(--line); flex-wrap: wrap;
}
.foot-tip { font-size: 11px; color: var(--muted); }
.model-empty { padding: 22px 20px; font-size: 12.5px; color: var(--muted); }
.danger-txt { color: #A5452E; }
.danger-txt:hover { color: #8A2F1B; }

@media (max-width: 760px) {
  .input-row .hint { display: none; }
  .model-pick { max-width: 46vw; }
  .mp-txt { max-width: 32vw; }
  .model-item { padding: 13px 15px; }
  .mi-actions { width: 100%; }
}

/* ---------------- 字数控制 ---------------- */
.wc-pick { gap: 4px; font-weight: 600; }
.wc-pick .wc-txt { font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wc-pick.off { color: var(--muted); font-weight: 400; }
.wc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.wc-opt {
  border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 10px; cursor: pointer;
  background: var(--paper-2); transition: .14s; display: flex; flex-direction: column; gap: 2px;
}
.wc-opt b { font-size: 14.5px; font-family: var(--serif); font-weight: 700; }
.wc-opt span { font-size: 10.5px; color: var(--muted); line-height: 1.45; }
.wc-opt:hover { border-color: #C9B79E; background: #fff; }
.wc-opt.on { border-color: #D9B9AC; background: var(--accent-soft); }
.wc-opt.on b { color: #8E3A26; }
.wc-custom { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.wc-custom input { width: 112px; }
.wc-note { margin-top: 10px; font-size: 11.5px; color: var(--muted); line-height: 1.7; }

/* ---------------- 存作品：起标题 ---------------- */
.sw-cand-head { display: flex; align-items: center; gap: 10px; margin: 16px 0 8px; font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }
.sw-cand-head .lnk { margin-left: auto; }
.sw-cand { display: flex; flex-direction: column; gap: 7px; }
.sw-t { border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; cursor: pointer; background: var(--paper-2); transition: .14s; }
.sw-t b { display: block; font-size: 13.5px; font-weight: 700; }
.sw-t span { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.sw-t:hover { border-color: #C9B79E; background: #fff; }
.sw-t.on { border-color: #D9B9AC; background: var(--accent-soft); }
.sw-loading { font-size: 12.5px; color: var(--muted); padding: 12px 2px; }
.sw-fail { font-size: 12.5px; color: #B4462F; padding: 10px 2px; }

@media (max-width: 760px) {
  .wc-grid { grid-template-columns: repeat(2, 1fr); }
  .input-row .model-pick { max-width: 40vw; }
  .input-row .wc-pick { max-width: 26vw; }
  .wc-custom input { width: 84px; }
}

/* ================= 发现（全网雷达） =================
   这一页信息密度比别处高，所以用"纸面 + 细线 + 少量红点"来分层，
   不靠大色块。数字用衬线，读起来像报告不像后台。
*/
.disc { padding-top: 26px; }
.disc-title {
  font-family: var(--serif); font-size: 30px; font-weight: 700; letter-spacing: .06em;
  display: flex; align-items: baseline; gap: 12px;
}
.disc-title-sub {
  font-family: var(--sans); font-size: 11px; font-weight: 400; letter-spacing: .18em;
  color: var(--muted); text-transform: uppercase; padding-bottom: 4px;
}
.disc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.disc-meta { font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.9; }
.disc-meta b { color: var(--ink-2); font-weight: 600; }
.dm-dot { margin: 0 6px; opacity: .5; }
.dm-err { color: var(--accent); }
.dm-q { color: var(--green); }
.disc-tools { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.disc-search { position: relative; }
.disc-search .ds-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }
.disc-search input {
  width: 268px; padding: 8px 12px 8px 30px; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--paper-2); outline: none; font-size: 13px; transition: .15s;
}
.disc-search input:focus { border-color: #C2AF92; background: #fff; box-shadow: 0 0 0 3px rgba(180,70,47,.06); }

/* --- 共振带 --- */
.disc-reso { display: flex; gap: 12px; align-items: stretch; margin-bottom: 20px; }
.reso-lab {
  writing-mode: vertical-rl; font-family: var(--serif); font-size: 12px; letter-spacing: .3em;
  color: var(--accent); padding: 6px 0; flex: 0 0 auto;
}
.reso-rail { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; flex: 1; min-width: 0; }
.reso-rail::-webkit-scrollbar { height: 5px; }
.reso-card {
  flex: 0 0 218px; text-align: left; border: 1px solid var(--line); background: var(--paper-2);
  border-radius: 12px; padding: 11px 13px; cursor: pointer; transition: .16s; position: relative; overflow: hidden;
}
.reso-card::after {
  content: ""; position: absolute; right: -20px; top: -20px; width: 60px; height: 60px; border-radius: 50%;
  background: radial-gradient(circle, rgba(180,70,47,.10), transparent 70%);
}
.reso-card:hover { border-color: #CBB79B; transform: translateY(-1px); box-shadow: var(--shadow); }
.rc-top { display: flex; align-items: baseline; gap: 3px; }
.rc-num { font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--accent); line-height: 1; }
.rc-unit { font-size: 10.5px; color: var(--accent); margin-right: 6px; }
.rc-plats { font-size: 10.5px; color: var(--muted); background: var(--paper-3); padding: 1px 7px; border-radius: 20px; }
.rc-title {
  font-size: 12.5px; line-height: 1.55; margin: 7px 0 6px; color: var(--ink-2); font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rc-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.rc-tags span { font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
.reso-empty { font-size: 12.5px; color: var(--muted); padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: 12px; }

/* --- 三栏 ---
   minmax(0,1fr) 里的 0 不是可有可无的：默认 min-width:auto 会让网格列
   按"最长一行内容"撑开，发现页在手机上会被撑到 1500 多像素宽。
   同理，每个格子自己也要写 min-width:0，光改列宽只解决一半。 */
.disc-grid { display: grid; grid-template-columns: 196px minmax(0, 1fr) 344px; gap: 22px; align-items: start; }
.disc-grid > * { min-width: 0; }
.disc-side { position: sticky; top: 10px; }
/* 手机端的筛选开关。桌面端三组筛选常驻，它一直 display:none，
   具体长什么样写在文件末尾的媒体查询里。 */
.side-toggle {
  display: none; align-items: center; gap: 8px; width: 100%;
  border: 1px solid var(--line); background: var(--paper-2); border-radius: 10px;
  padding: 9px 12px; cursor: pointer; font-family: inherit; text-align: left;
  font-size: 12.5px; color: var(--ink-2); -webkit-tap-highlight-color: transparent;
}
.side-toggle .st-ico { font-size: 13px; color: var(--muted); line-height: 1; }
.side-toggle .st-lab { font-weight: 600; flex: 0 0 auto; }
.side-toggle .st-sum {
  flex: 1; min-width: 0; color: var(--muted); font-size: 11.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-toggle .st-caret { color: var(--muted); font-size: 10px; flex: 0 0 auto; }
.side-toggle.dirty { border-color: #D9B9AC; background: var(--accent-soft); }
.side-toggle.dirty .st-lab { color: #8E3A26; }
/* 手机上选完要能立刻看到结果，不然展开的筛选把列表顶到屏幕外面去了 */
.side-done { display: none; }
.side-block { margin-bottom: 20px; }
.sb-h {
  font-size: 10.5px; letter-spacing: .16em; color: var(--muted); margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.sb-h-n { margin-left: auto; letter-spacing: 0; }
.sb-list { display: flex; flex-wrap: wrap; gap: 5px; }
.sb-i {
  border: 1px solid transparent; background: transparent; color: var(--ink-2); font-size: 12px;
  padding: 3px 8px; border-radius: 7px; cursor: pointer; transition: .14s; display: inline-flex; align-items: center; gap: 5px;
}
.sb-i em { font-style: normal; font-size: 10px; color: var(--muted); }
.sb-i:hover { background: var(--paper-3); }
.sb-i.on { background: var(--ink); color: #F4EEE2; border-color: var(--ink); }
.sb-i.on em { color: #B6AC9A; }
/* 手机上题材只列前十，"还有 N 个"用虚线框跟真实选项区分开 */
.sb-i.sb-more { color: var(--accent); border: 1px dashed #DCC0B4; }
.sb-check { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-top: 9px; cursor: pointer; }
.sb-check input { accent-color: var(--accent); }
.sb-src { display: flex; flex-direction: column; gap: 1px; }
.src { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); padding: 2px 0; }
.src i { width: 5px; height: 5px; border-radius: 50%; background: #7FA086; flex: 0 0 5px; }
.src.off { opacity: .5; }
.src.off i { background: #C0AFA0; }
.src span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src em { margin-left: auto; font-style: normal; font-size: 10px; opacity: .75; }

/* --- 列表 --- */
.list-head {
  display: flex; justify-content: space-between; align-items: baseline; font-size: 11px;
  color: var(--muted); padding: 0 4px 8px; border-bottom: 1px solid var(--line-2);
}
.lh-note { font-size: 10.5px; opacity: .8; }
.rows { display: flex; flex-direction: column; }
.disc-row {
  display: flex; gap: 12px; align-items: flex-start; padding: 11px 8px 11px 4px;
  border-bottom: 1px solid var(--line); transition: .13s; position: relative;
}
.disc-row:hover { background: rgba(252, 250, 245, .9); }
.dr-score {
  font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--muted);
  width: 34px; flex: 0 0 34px; text-align: right; padding-top: 1px; font-variant-numeric: tabular-nums;
}
.disc-row:nth-child(-n+3) .dr-score { color: var(--accent); }
.dr-body { min-width: 0; flex: 1; }
.dr-title {
  font-family: var(--serif); font-size: 14.5px; line-height: 1.62; color: var(--ink);
  display: block; transition: .13s;
}
.dr-title:hover { color: var(--accent); }
.dr-meta { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; margin-top: 5px; font-size: 10.5px; color: var(--muted); }
.dr-plat { color: var(--ink-2); font-weight: 600; }
.dr-rank { opacity: .8; }
.dr-hot { color: #9A6B45; }
.dr-tag { background: var(--paper-3); padding: 1px 7px; border-radius: 20px; }
.dr-tag.ghost { background: transparent; border: 1px solid var(--line-2); }
.dr-reso { color: var(--accent); background: var(--accent-soft); padding: 1px 7px; border-radius: 20px; }
.dr-act { display: flex; gap: 4px; flex: 0 0 auto; opacity: 0; transition: .14s; }
.disc-row:hover .dr-act { opacity: 1; }
@media (hover: none) { .dr-act { opacity: 1; } }
.dbtn {
  border: 1px solid var(--line-2); background: var(--paper-2); border-radius: 7px; cursor: pointer;
  font-size: 11.5px; padding: 3px 9px; color: var(--ink-2); transition: .13s;
}
.dbtn:hover { background: var(--ink); color: #F4EEE2; border-color: var(--ink); }
.dbtn.ghost { border-color: transparent; background: transparent; color: var(--muted); padding: 3px 7px; }
.dbtn.ghost:hover { background: var(--paper-3); color: var(--ink); }
.dbtn.on { color: var(--green); border-color: #CBD8CE; background: var(--green-soft); }
.more { width: 100%; margin-top: 14px; justify-content: center; }
.disc-empty {
  text-align: center; color: var(--muted); font-size: 13px; padding: 60px 20px;
  border: 1px dashed var(--line-2); border-radius: 14px;
}
.spin {
  width: 15px; height: 15px; border: 2px solid var(--line-2); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: -2px; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg) } }
.spin-wrap { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--muted); font-size: 12.5px; }

/* --- 墨眼 --- */
.disc-eye {
  position: sticky; top: 10px; background: linear-gradient(180deg, #FCFAF5, #F9F5EC);
  border: 1px solid var(--line); border-radius: 14px; padding: 16px 16px 18px;
  box-shadow: var(--shadow); max-height: calc(100vh - 40px); overflow-y: auto;
}
.eye-h {
  display: flex; align-items: center; gap: 7px; font-family: var(--serif); font-size: 15px;
  letter-spacing: .1em; margin-bottom: 12px;
}
/* 折叠用的副标题和箭头只在手机出现，桌面一直是展开的 */
.eye-sub { font-family: var(--sans); font-size: 10.5px; letter-spacing: 0; color: var(--muted); }
.eye-caret { display: none; margin-left: auto; color: var(--muted); font-size: 11px; letter-spacing: 0; }
.disc-eye.collapsed { padding-bottom: 12px; cursor: pointer; }
.disc-eye.collapsed .eye-h { margin-bottom: 0; }
.disc-eye.collapsed .eye-intro,
.disc-eye.collapsed .eye-sum,
.disc-eye.collapsed .eye-picks,
.disc-eye.collapsed .eye-block,
.disc-eye.collapsed .eye-busy,
.disc-eye.collapsed .eye-redo { display: none; }
.eye-dot { width: 7px; height: 7px; border-radius: 50%; background: #C0AFA0; }
.eye-dot.on { background: var(--accent); box-shadow: 0 0 0 3px rgba(180,70,47,.13); }
.eye-dot.live { background: var(--accent); animation: pulse 1.3s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
.eye-redo { margin-left: auto; }
.eye-intro p { font-size: 12.5px; line-height: 1.85; color: var(--ink-2); margin: 0 0 10px; }
.eye-go { width: 100%; justify-content: center; margin: 4px 0 8px; padding: 9px; }
.eye-tip { font-size: 10.5px !important; color: var(--muted) !important; margin: 0 !important; }
.eye-busy { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); padding: 10px 0; flex-wrap: wrap; }
.eye-busy .btn { margin-left: auto; }
.eye-sum {
  font-size: 13px; line-height: 1.85; color: var(--ink); padding: 10px 12px; background: var(--paper-3);
  border-radius: 10px; margin-bottom: 14px; border-left: 2px solid var(--accent);
}
.eye-picks { display: flex; flex-direction: column; gap: 12px; }
.pick { border-top: 1px dashed var(--line-2); padding-top: 12px; }
.pick:first-child { border-top: none; padding-top: 0; }
.pk-top { display: flex; gap: 7px; align-items: baseline; }
.pk-i { font-family: var(--serif); font-size: 11px; color: var(--accent); flex: 0 0 auto; }
.pk-title { font-family: var(--serif); font-size: 14.5px; font-weight: 700; line-height: 1.55; color: var(--ink); }
.pk-why { font-size: 11.5px; color: var(--muted); margin: 5px 0 7px; line-height: 1.7; }
.pk-angle, .pk-diff { font-size: 12px; line-height: 1.8; color: var(--ink-2); margin-bottom: 5px; }
.pk-angle b, .pk-diff b {
  display: inline-block; font-size: 10px; color: var(--accent); background: var(--accent-soft);
  border-radius: 4px; padding: 0 5px; margin-right: 6px; font-weight: 600; letter-spacing: .04em;
}
.pk-diff b { color: var(--green); background: var(--green-soft); }
.pk-foot { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; margin-top: 7px; }
.pk-tag { font-size: 10px; padding: 1px 7px; border-radius: 20px; background: var(--paper-3); color: var(--ink-2); }
.pk-tag.ghost { background: transparent; border: 1px solid var(--line-2); color: var(--muted); }
.pk-tag.warn { background: #FBEDE8; color: var(--accent); }
.pk-tag.good { background: var(--green-soft); color: var(--green); }
.pk-heat { margin-left: auto; font-size: 8px; letter-spacing: 1px; color: var(--accent); }
.pk-titles { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.pk-t {
  border: 1px solid var(--line); background: var(--paper-2); border-radius: 6px; padding: 3px 8px;
  font-size: 11px; color: var(--ink-2); cursor: pointer; transition: .13s; text-align: left;
}
.pk-t:hover { border-color: #C6B49B; background: #fff; }
.pk-t.copied { border-color: #CBD8CE; background: var(--green-soft); color: var(--green); }
.pk-risk { font-size: 11px; color: #96604B; margin-top: 7px; line-height: 1.65; }
.pk-act { margin-top: 9px; }
.eye-block { margin-top: 16px; }
.eb-h { font-size: 10.5px; letter-spacing: .14em; color: var(--muted); margin-bottom: 6px; }
.eye-block ul { margin: 0; padding-left: 15px; }
.eye-block li { font-size: 11.5px; line-height: 1.8; color: var(--ink-2); }
.bars { display: flex; flex-direction: column; gap: 5px; }
.bar { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }
.bar-k { width: 30px; flex: 0 0 30px; }
.bar-t { flex: 1; height: 5px; background: var(--paper-3); border-radius: 4px; overflow: hidden; }
.bar-t i { display: block; height: 100%; background: linear-gradient(90deg, #D9B9A8, #B4462F); border-radius: 4px; }
.bar-v { width: 24px; text-align: right; font-variant-numeric: tabular-nums; }

/* --- 弹层 --- */
.sheet-in { display: flex; flex-direction: column; max-height: 86vh; }
.sheet-h { display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
.sheet-h h3 { font-family: var(--serif); font-size: 17px; margin: 0; line-height: 1.55; flex: 1; }
.sheet-sub { font-size: 11.5px; color: var(--muted); margin: 6px 0 0; }
.cl-list { overflow-y: auto; padding: 10px 22px; }
.cl-i {
  display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px dashed var(--line);
  font-size: 12.5px; color: var(--ink-2);
}
.cl-i:hover .cl-t { color: var(--accent); }
.cl-plat { flex: 0 0 76px; font-size: 11px; color: var(--muted); }
.cl-t { flex: 1; line-height: 1.6; }
.cl-h { flex: 0 0 auto; font-size: 10.5px; color: #9A6B45; }
.deep-body { overflow-y: auto; padding: 16px 24px; font-size: 13.5px; line-height: 1.9; }
.deep-body .md-body h2, .deep-body .md-body h3 { font-family: var(--serif); font-size: 15px; margin: 18px 0 6px; }
.deep-body .md-body p { margin: 6px 0; }
.deep-body .md-body ul { padding-left: 20px; }

@media (max-width: 1240px) {
  .disc-grid { grid-template-columns: 176px minmax(0, 1fr); }
  .disc-eye { grid-column: 1 / -1; position: static; max-height: none; }
}
@media (max-width: 900px) {
  .disc-head { flex-direction: column; gap: 12px; }
  .disc-search input { width: 100%; }
  .disc-tools { width: 100%; }
  .disc-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .disc-side { position: static; }
  .disc-side .side-block:last-child { display: none; }
  .disc-title { font-size: 24px; }
  .dr-act { opacity: 1; }
  .lh-note { display: none; }
}

/* 列表操作按钮常显半透明：全藏在 hover 里，第一次用的人根本不知道能点。
   手机上后面没有 hover 来"救"它们，必须给满不透明度——半透明在触屏上
   等于没画出来（这条被 .disc 前缀抬高了优先级，所以媒体查询要写同款选择器）。 */
.disc .dr-act { opacity: .5; }
.disc .disc-row:hover .dr-act { opacity: 1; }
@media (max-width: 900px) {
  .disc .dr-act { opacity: 1; }
}
/* 共振带右侧渐隐，暗示还能往右滑 */
.disc-reso { position: relative; }
.disc-reso::after {
  content: ""; position: absolute; right: 0; top: 0; bottom: 4px; width: 60px; pointer-events: none;
  background: linear-gradient(90deg, rgba(246,243,236,0), var(--paper));
}

/* ---------------- 发现 · 四榜（2.0） ----------------
 * 四个榜的区别在排序逻辑，不在这里的皮。所以样式统一，
 * 只有标签颜色分家：涨=accent（红）、缺=green（青）、相关=紫、新上榜=琥珀。 */
.disc-boards { margin-bottom: 18px; }
.db-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.db-tabs { display: flex; gap: 2px; background: var(--paper-3); padding: 3px; border-radius: 11px; }
.db-tab {
  display: flex; align-items: center; gap: 6px; border: 0; background: transparent; cursor: pointer;
  padding: 5px 13px; border-radius: 9px; color: var(--muted); font-size: 12.5px; transition: .15s;
}
.db-tab b { font-weight: 600; }
.db-tab em { font-style: normal; font-size: 10.5px; opacity: .65; font-variant-numeric: tabular-nums; }
.db-tab:hover { color: var(--ink-2); }
.db-tab.on { background: var(--paper-2); color: var(--ink); box-shadow: var(--shadow); }
.db-tab.on em { opacity: .9; color: var(--accent); }
.db-hint { font-size: 11.5px; color: var(--muted); }

/* 冷启动说明条：不写清楚是估的，人会把它当真实涨幅 */
.db-cold {
  font-size: 11.5px; line-height: 1.55; color: var(--ink-2);
  background: var(--paper-3); border-left: 2px solid var(--accent);
  border-radius: 0 8px 8px 0; padding: 7px 11px; margin-bottom: 10px;
}

.db-rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 212px; gap: 10px;
  overflow-x: auto; padding: 2px 2px 8px;
}
.db-rail::-webkit-scrollbar { height: 5px; }
.db-card {
  text-align: left; background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 12px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 6px;
  min-height: 106px; transition: .15s; position: relative;
}
.db-card::after {
  content: ""; position: absolute; inset: 0; border-radius: 12px; pointer-events: none;
  box-shadow: inset 0 0 0 1px transparent; transition: .15s;
}
.db-card:hover { border-color: #CBB79B; transform: translateY(-1px); box-shadow: var(--shadow); }
.dc-top { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 10.5px; min-height: 15px; }
.dc-num { font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--accent); line-height: 1; }
.dc-unit { font-size: 10px; color: var(--accent); margin-right: 5px; }
.dc-plats { font-size: 10.5px; color: var(--muted); background: var(--paper-3); padding: 1px 7px; border-radius: 20px; }
.dc-plat { color: var(--muted); }
.dc-title {
  font-family: var(--serif); font-size: 13px; line-height: 1.5; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.dc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.dc-score { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dc-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: auto; }
.dc-tags span { font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }

.dc-rise { color: var(--accent); background: var(--accent-soft); padding: 0 6px; border-radius: 4px; font-size: 10px; font-weight: 600; }
.dc-rise.new { background: #FAEBD3; color: #96631A; }
.dc-gap { color: #3C6355; background: var(--green-soft); padding: 0 6px; border-radius: 4px; font-size: 10px; }
.dc-rel { color: #6A5A8C; background: #EDE8F4; padding: 0 6px; border-radius: 4px; font-size: 10px; }

/* 迷你趋势线：涨红跌绿，跟股市一个约定，别反过来 */
.spark { color: var(--accent); flex: 0 0 auto; }
.spark.down { color: var(--green); }
.spark-none { color: var(--line-2); font-size: 11px; }

/* 列表行里的趋势列 —— 比分数更早告诉你这条在往哪走 */
.dr-trend { flex: 0 0 58px; display: flex; align-items: center; justify-content: flex-end; padding-top: 2px; }
.dr-rise { color: var(--accent); background: var(--accent-soft); padding: 1px 7px; border-radius: 20px; font-weight: 600; }
.dr-rise.new { background: #FAEBD3; color: #96631A; }
.dr-fall { color: var(--green); background: var(--green-soft); padding: 1px 7px; border-radius: 20px; }
.dr-up { color: var(--accent); }
.dr-gap { color: #3C6355; background: var(--green-soft); padding: 1px 7px; border-radius: 20px; }
.dr-rel { color: #6A5A8C; background: #EDE8F4; padding: 1px 7px; border-radius: 20px; }
.dr-done { color: var(--muted); border: 1px dashed var(--line-2); padding: 1px 7px; border-radius: 20px; }
.dm-wait { color: #96631A; }

@media (max-width: 940px) {
  .db-rail { grid-auto-columns: 178px; }
  .dr-trend { display: none; }
}

/* ================= 移动端 =================
   桌面端是「侧栏 + 主区」两栏；手机上侧栏会占掉大半屏，
   所以 ≤900px 时把它收进抽屉，另用底部 tab 做主导航。
   这一整段都写在媒体查询里，桌面端完全不受影响。
   要点：tab 高度用 --tab-h 统一，所有需要避让的容器都减它一次。 */
:root { --tab-h: 54px; }
.tabbar, .drawer-mask, .drawer-x { display: none; }

@media (max-width: 900px) {
  /* 手机上 100vh 含地址栏，滚动时会跳。dvh 跟随可视区收缩，输入法弹起也准 */
  .app { height: 100vh; height: 100dvh; }
  .tabbar, .drawer-mask { display: flex; }

  /* ---------- 底部导航 ---------- */
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 190;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(23, 20, 15, .96); backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, .07);
  }
  .tb-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; color: #8B8172; font-size: 10.5px; letter-spacing: .02em;
    -webkit-tap-highlight-color: transparent; transition: color .15s;
  }
  .tb-item i { font-style: normal; font-size: 18px; line-height: 1; }
  .tb-item.active { color: #F1E6D3; }
  .tb-item.active i { color: #E0A08C; }

  /* ---------- 侧栏 → 抽屉 ---------- */
  .sidebar {
    display: flex; position: fixed; top: 0; left: 0; bottom: 0; z-index: 220;
    width: 78vw; max-width: 296px; transform: translateX(-102%);
    transition: transform .26s cubic-bezier(.4, 0, .2, 1);
    padding-top: calc(16px + env(safe-area-inset-top));
  }
  body.drawer-open .sidebar {
    transform: translateX(0);
    box-shadow: 0 0 60px rgba(0, 0, 0, .55);
  }
  .drawer-mask {
    display: block; position: fixed; inset: 0; z-index: 210;
    background: rgba(23, 20, 15, .46);
    opacity: 0; pointer-events: none; transition: opacity .26s;
  }
  body.drawer-open .drawer-mask { opacity: 1; pointer-events: auto; }
  .drawer-x {
    display: grid; place-items: center; margin-left: auto; flex: 0 0 auto;
    width: 30px; height: 30px; border: 0; border-radius: 8px; cursor: pointer;
    background: rgba(255, 255, 255, .08); color: #C9BCA6; font-size: 18px; line-height: 1;
  }
  .nav-item { padding: 12px 12px; font-size: 14.5px; }
  .nav-item i { font-size: 15px; width: 19px; }
  .foot-note { display: none; }

  /* ---------- 页面留白：底部必须让出 tab ---------- */
  .page { padding: 20px 16px calc(var(--tab-h) + env(safe-area-inset-bottom) + 26px); }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
  .page-title { font-size: 23px; }
  .page-sub { font-size: 12.5px; margin-top: 4px; }
  .head-actions { width: 100%; }

  /* ---------- 创作台 ---------- */
  .create-wrap {
    height: calc(100vh - var(--tab-h) - env(safe-area-inset-bottom));
    height: calc(100dvh - var(--tab-h) - env(safe-area-inset-bottom));
  }
  .thread { padding: 14px 14px 6px; }
  .composer { padding: 8px 14px calc(12px + env(safe-area-inset-bottom)); }
  .topbar { padding: 9px 14px 10px; gap: 7px; }
  .banner { margin: 0 14px 8px; }
  /* 顶栏原来换行后"清空"会孤零零占一行。改成两行：模式切换独占一行，
     行业/风格平分一行，两个按钮缩到行尾，靠省略号保证不把行撑破。 */
  .mode-switch { flex: 1 1 100%; }
  .mode-switch button { flex: 1; padding: 7px 0; font-size: 12.5px; }
  .topbar-spacer { display: none; }
  .topbar .writer-pick {
    flex: 1 1 0; min-width: 0; padding: 7px 9px; font-size: 12px; gap: 5px;
  }
  .topbar .writer-pick .wp-name { flex: 1; }
  .topbar .btn.sm { padding: 5px 9px; font-size: 11.5px; flex: 0 0 auto; }
  /* 输入区：文字 16px 起（iOS 在更小字号上会自动放大整页） */
  .input-box { padding: 10px 12px; border-radius: 13px; }
  .input-box textarea { min-height: 48px; font-size: 16px; line-height: 1.6; }
  /* 底部按钮行原来四个东西挤一行，溢出 15px。改成：胶囊一行，按钮换行平分。 */
  .input-row { flex-wrap: wrap; gap: 7px; margin-top: 9px; }
  .input-row .model-pick { max-width: none; }
  .input-row .wc-pick { flex: 0 0 auto; }
  .input-row #modelPick { flex: 1 1 0; min-width: 0; }
  .input-row .mp-txt { max-width: none; }
  .ir-actions { flex: 1 1 100%; gap: 7px; }
  .ir-actions .btn { flex: 1 1 0; justify-content: center; }
  /* 建议词胶囊：竖着换行会占掉两行，横滑更省屏 */
  .chips {
    flex-wrap: nowrap; overflow-x: auto; margin-bottom: 8px; padding-bottom: 2px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; white-space: nowrap; }
  .empty { padding: 4vh 12px 24px; }
  .empty .big { font-size: 24px; }
  .empty p { font-size: 13px; }
  /* 四张引导卡在手机上一屏放不下，压一档，别让人滚动才能看全 */
  .starter-grid { gap: 8px; margin-top: 18px; }
  .starter { padding: 11px 13px; }
  .starter b { font-size: 12.5px; margin-bottom: 2px; }
  .starter span { font-size: 11px; }
  .msg-user .bubble { max-width: 84%; }
  .stage-head { padding: 10px 14px; gap: 8px; }
  .stage-body { padding: 12px 14px 14px; font-size: 13.5px; }

  /* 弹窗必须盖住底部导航：tabbar 是 190，原来 .mask 只有 100，会被 tab 压在上面 */
  .mask { padding: 0; align-items: flex-end; z-index: 240; }
  /* iOS 在字号 <16px 的输入框上会自动放大页面，这里统一顶到 16 */
  input, textarea, select { font-size: 16px; }
  .sheet {
    width: 100%; max-width: 100%; max-height: 92vh; max-height: 92dvh;
    border-radius: 18px 18px 0 0;
  }
  .sheet-head { padding: 15px 16px; }
  .sheet-body { padding: 16px; }
  .sheet-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .sheet h4 { font-size: 16.5px; }

  /* ---------- 触控目标：手指不是鼠标 ---------- */
  .btn { min-height: 38px; }
  .btn.sm { min-height: 32px; }
  .tag { padding: 3px 9px; }

  /* toast 抬高，别被 tab 盖住 */
  .toast-wrap { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 14px); }

  /* 作品行：不换行。之前用 flex-wrap 会把"删除"挤到第二行，白占一整行高度 */
  .work-row { padding: 12px 14px; gap: 10px; align-items: flex-start; }
  .wr-right { margin-left: auto; flex: 0 0 auto; width: auto; padding-top: 1px; }
  .wr-right .btn.sm { padding: 4px 9px; min-height: 0; font-size: 11.5px; }
  .wr-cover { width: 42px; height: 42px; margin-right: 0; }
  .wr-title { font-size: 14px; line-height: 1.5; }
  /* meta 一行排完：字数在详情里有，手机上先让位给"谁写的 / 什么模式"。
     换行会让每行高度参差，列表像被啃过一样。 */
  .wr-meta { gap: 7px; font-size: 10.5px; flex-wrap: nowrap; overflow: hidden; }
  .wr-meta > span { flex: 0 0 auto; white-space: nowrap; }
  .wr-meta .wr-who { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .wr-meta .wr-chars { display: none; }

  /* ---------- 卡片类页面：作家库 / 专家库 / 品控团 ---------- */
  /* 头像原来 vertical 居中，一旦简介长到三四行，头像就飘到中间，看着像错位 */
  .wc-top { align-items: flex-start; }
  .writer-card { padding: 16px; min-height: 0; }
  .wc-name { font-size: 15.5px; }
  /* 蒸馏自哪几本书这种长串，手机上两行封顶，别把卡片撑成一堵墙 */
  .wc-tag { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.55; }
  .wc-tagline { font-size: 12.8px; margin-bottom: 10px; }
  .wc-foot { margin-top: 10px; padding-top: 9px; font-size: 10.5px; }
  .expert-card { padding: 14px 15px; }
  .ec-tagline { min-height: 0; font-size: 12.5px; margin-bottom: 8px; line-height: 1.6; }
  .ec-name { font-size: 14.5px; }
  .ec-duties span { font-size: 11px; line-height: 1.6; }
  .golden { margin-top: 20px; padding: 18px 16px; }
  .golden h3 { font-size: 17px; }
  .golden-list { grid-template-columns: 1fr; gap: 11px; }
  .gl-d { font-size: 11px; }

  /* ---------- 项目卡 ---------- */
  .proj-card { padding: 15px 16px; }
  .proj-name { font-size: 16px; }
  /* 三块数字并排一行，"下一期"整行压在下面。
     之前四项挤一个 flex 行，前三块被压到 40px 宽，"计划期数"竖着排。 */
  .stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
  .stat { padding: 10px 11px; border-radius: 11px; min-width: 0; }
  .stat b { font-size: 20px; }
  .stat span { font-size: 10px; }
  .stat-wide { grid-column: 1 / -1; min-width: 0; flex: none; }
  /* 标题被右边的说明气泡挤成"创作纲/领"两行，先保住标题 */
  .sect-head { padding: 13px 15px; flex-wrap: wrap; gap: 7px; }
  .sect-title { flex: 0 0 auto; white-space: nowrap; font-size: 14.5px; }
  .sect-head .tag { font-size: 10px; line-height: 1.5; padding: 2px 8px; }
  .sect-body { padding: 13px 15px; }
  .plan-row { padding: 13px 15px; gap: 10px; }
  .plan-title { font-size: 14px; }
  .plan-act { justify-content: flex-start; }
  .plan-act .btn.sm { padding: 5px 10px; min-height: 0; font-size: 11.5px; }

  /* ---------- 设置页 ---------- */
  .model-item { padding: 13px 15px; gap: 10px; }
  .mi-name { font-size: 13px; }
  /* 一长串 base_url + Key 尾巴，手机上给两行就够，再长也读不出重点。
     break-all 会把 "Key" 拆成 "Ke / y"，所以只在实在排不下时才断。 */
  .mi-meta {
    font-size: 11px; line-height: 1.5; word-break: normal; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .mi-actions { gap: 4px; }
  .mi-actions .btn.sm { padding: 4px 9px; font-size: 11.5px; }
  .model-foot { padding: 12px 15px; }
  .form { max-width: none; }

  /* ---------- 配图页 ---------- */
  /* 模型全名常常二三十个字，手机上顶成两行很难看，单行省略，详情去设置里看 */
  .head-actions .tag {
    display: block; max-width: 100%; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; padding: 4px 10px;
  }
  .art-params { gap: 10px; }
  .art-params .field { min-width: 0; flex: 1 1 calc(50% - 5px); }
  .art-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .divider-title { margin: 24px 0 14px; font-size: 15px; }
  .divider-title span { font-size: 10.5px !important; }
  .proj-grid, .writer-grid, .expert-grid { grid-template-columns: 1fr; }
  .row2, .starter-grid { grid-template-columns: 1fr; }

  /* ---------- 发现页 ---------- */
  /* 整页横向拖动是最糟的体验：宁可让内部该横滑的地方自己滑。
     .main 默认 overflow-y:auto 会把 overflow-x 也算成 auto，这里明确关掉。 */
  .main { overflow-x: hidden; }
  .page.wide { max-width: 100%; }

  /* 头部：标题 + 说明压两行，采集耗时这类排障信息手机上不需要 */
  .disc { padding-top: 18px; }
  .disc-head { gap: 12px; margin-bottom: 14px; }
  .disc-title { font-size: 22px; gap: 8px; }
  .disc-title-sub { font-size: 10px; letter-spacing: .14em; padding-bottom: 2px; }
  .disc-meta { font-size: 11.5px; line-height: 1.65; margin-top: 5px; }
  .disc-meta .dm-took { display: none; } /* 采集耗时是排障用的，手机上省这一行 */
  .disc-tools { gap: 8px; }
  .disc-search { flex: 1 1 auto; min-width: 0; }
  .disc-search input { width: 100%; padding: 9px 12px 9px 30px; }
  .disc-tools .btn { flex: 0 0 auto; }

  /* 四个榜名都超过手机宽度，不横滑就一定折行（"正在起/来"这种断字最难读） */
  .db-tabs {
    overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .db-tabs::-webkit-scrollbar { display: none; }
  .db-tab { flex: 0 0 auto; white-space: nowrap; padding: 6px 12px; }
  .db-head { flex-direction: column; align-items: stretch; gap: 7px; }
  /* flex-start 会让 tab 条按内容宽（约 369px）撑开，整页就多出一根横向滚动条 */
  .db-tabs { max-width: 100%; min-width: 0; }
  .db-hint { font-size: 11px; line-height: 1.5; }

  /* 筛选：手机端收进一个"筛选"条，收起后只留一行，第一屏直接看到信号流 */
  .side-toggle { display: flex; }
  .disc-side.collapsed .side-body,
  .disc-side.collapsed .side-done { display: none; }
  .side-block { display: block; margin-bottom: 11px; }
  .sb-h { margin-bottom: 6px; font-size: 10.5px; }
  /* 展开后 chips 换行排，不用横滑——横滑会把"资讯"切成半个字。
     尺寸压小一档，二十来个题材也不会铺满整屏。 */
  .sb-list { flex-wrap: wrap; overflow: visible; gap: 5px; }
  .sb-i { padding: 4px 9px; font-size: 11.5px; border-radius: 6px; }
  .sb-i em { font-size: 9.5px; }
  .sb-check { margin-top: 2px; }
  .side-done { display: flex; width: 100%; justify-content: center; margin-top: 6px; }

  /* 榜单横滑卡片窄一点，一屏能露出"还有下一张" */
  .db-rail { grid-auto-columns: 158px; gap: 8px; }
  .db-rail { scroll-snap-type: x proximity; }
  .db-rail > * { scroll-snap-align: start; }
  .db-card { padding: 10px 11px 9px; min-height: 0; gap: 5px; border-radius: 11px; }
  .dc-title { font-size: 12.5px; -webkit-line-clamp: 2; }
  .dc-num { font-size: 18px; }
  .dc-top { gap: 4px; font-size: 10px; }
  .dc-plats, .dc-plat { font-size: 10px; padding: 0 6px; }
  .dc-foot { margin-top: 2px; }
  .dc-score { font-size: 10.5px; }
  .db-cold { font-size: 11px; line-height: 1.55; }

  /* 列表行：手机上标题要占满宽，标签能省的都省掉。
     原来一条 7 个标签挤在 358px 里，meta 折三行，标题被右侧按钮压成两行。 */
  .list-head { font-size: 10.5px; padding-bottom: 7px; }
  .disc-row { padding: 11px 2px 10px; gap: 9px; }
  .dr-score { width: 26px; flex: 0 0 26px; font-size: 14px; }
  .dr-title { font-size: 14px; line-height: 1.55; }
  .dr-meta { gap: 5px; margin-top: 6px; font-size: 10.5px; }
  .dr-meta .dr-tag { display: none; }   /* 题材/形式在筛选里已经选过了 */
  .dr-meta .dr-up { display: none; }    /* "升3位"信息量最低 */
  .dr-trend { display: none; }
  .dr-act { gap: 5px; align-self: flex-start; padding-top: 1px; }
  .dbtn {
    padding: 0 11px; height: 29px; min-height: 0; font-size: 11.5px;
    display: inline-flex; align-items: center; border-radius: 8px;
  }
  .dbtn.ghost {
    padding: 0 9px; background: var(--paper-2); border-color: var(--line-2);
    color: var(--ink-2); font-size: 11.5px;
  }
  .dbtn.ghost.on { background: var(--green-soft); color: var(--green); border-color: #CBD8CE; }
  .disc-row:active { background: rgba(252, 250, 245, .9); }
  .disc-eye { padding: 14px; border-radius: 12px; order: -1; position: static; max-height: none; }
  .disc-eye.collapsed { padding: 11px 14px; }
  .eye-h { font-size: 14px; margin-bottom: 10px; cursor: pointer; }
  .eye-caret { display: inline; margin-left: auto; }
  /* 手机上墨眼排在信号流前面，默认收成一条：
     5 张作战卡摊开会把整屏信号挤走，而它本来就是"看完榜再决定"的第二步。 */
  .disc-side { order: -2; }
}

/* 窄屏（竖着的手机）才把操作按钮换到下一行。
   平板 768 上标题够宽，按钮留在右边，换行反而会在中间拉出一大片空白。 */
@media (max-width: 560px) {
  .disc-row { flex-wrap: wrap; row-gap: 0; }
  /* 三个操作换到标题下面一行右对齐：留在右边会把标题挤成两行，
     ghost 按钮在纸上又几乎看不见，这里统一给它们一个浅底方块。 */
  .dr-act {
    flex: 1 0 100%; justify-content: flex-end; margin-top: 6px; gap: 6px;
  }
}
