/* 配色、排版照电脑上的 Claude 桌面 App（Code 标签页）取的 */
:root {
  --bg: #fcfcfb;
  --side: #f6f6f4;
  --panel: #ffffff;
  --text: #141413;
  --text2: #52514e;
  --text3: #898781;
  --line: #e3e3e2;
  --line2: #ecebe8;
  --sel: #ebeae6;
  --bubble: #f0f0ef;
  --code: #f4f4f2;
  --accent: #d97757;
  --accent-soft: #f7ebe6;
  --link: #1f7bc4;
  --ok: #3f9a5b;
  --bad: #d03b3b;
  --shadow: 0 8px 32px rgba(20, 20, 19, .12);
  --box-shadow: 0 1px 2px rgba(20, 20, 19, .04), 0 4px 16px rgba(20, 20, 19, .05);
  --sl: max(14px, env(safe-area-inset-left));
  --sr: max(14px, env(safe-area-inset-right));
  --st: env(safe-area-inset-top);
  --sb: env(safe-area-inset-bottom);
  --app-h: 100dvh;
  --hinge: 0px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1e1d;
    --side: #1a1918;
    --panel: #2a2927;
    --text: #f0efea;
    --text2: #b1afa8;
    --text3: #85837d;
    --line: #3a3936;
    --line2: #32312e;
    --sel: #2f2e2c;
    --bubble: #33322f;
    --code: #262523;
    --accent-soft: #3a2a23;
    --link: #6aaee8;
    --shadow: 0 8px 32px rgba(0, 0, 0, .5);
    --box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body {
  color: var(--text);
  font: 15.5px/1.65 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ── 布局 ──
   外屏 / 窄屏：单栏，对话列表从左边抽出来
   Duo 展开（≥700）：左右对半分，正好对着折痕，左边列表右边对话（跟系统 Mail 一样）
   更宽的屏（≥1100）：左栏固定宽度 */
#app { height: var(--app-h); display: grid; grid-template-columns: 1fr; overflow: hidden; }
#main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; background: var(--bg); }
#side {
  position: fixed; inset: 0 auto 0 0; z-index: 50;
  width: min(84vw, 330px);
  background: var(--side);
  display: flex; flex-direction: column;
  padding-top: var(--st);
  padding-left: env(safe-area-inset-left);
  transform: translateX(-104%); visibility: hidden;
  transition: transform .28s cubic-bezier(.3, .7, .2, 1), visibility 0s linear .28s;
}
#side.on { transform: none; visibility: visible; box-shadow: var(--shadow); transition: transform .28s cubic-bezier(.3, .7, .2, 1); }
@media (min-width: 700px) {
  #app { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #side {
    min-width: 0; overflow: hidden;
    position: static; width: auto; transform: none; visibility: visible; box-shadow: none; transition: none;
    border-right: 1px solid var(--line2);
    padding-right: 6px; /* 离折痕远一点 */
  }
  #main { padding-left: 6px; }
  #btnMenu { display: none; }
  #scrim.for-side { display: none !important; }
}
@media (min-width: 1100px) {
  #app { grid-template-columns: 320px minmax(0, 1fr); }
  #side { padding-right: 0; }
  #main { padding-left: 0; }
}
/* 有折痕位置信息时（Safari 的 Viewport Segments，功能标志打开才有）按真实折痕分栏 */
@media (horizontal-viewport-segments: 2) {
  #app {
    grid-template-columns: env(viewport-segment-width 0 0) env(viewport-segment-width 1 0);
    column-gap: calc(env(viewport-segment-left 1 0) - env(viewport-segment-right 0 0));
  }
  #side, #main { padding-left: 0; padding-right: 0; }
  #btnMenu { display: none; }
}

/* ── 顶栏 ── */
#top {
  display: flex; align-items: center; gap: 2px;
  padding: calc(var(--st) + 6px) var(--sr) 6px var(--sl);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line2);
  z-index: 5;
}
@media (min-width: 700px) { #top { padding-top: calc(var(--st) + 10px); } }
#title { flex: 1; min-width: 0; padding: 2px 6px; border-radius: 10px; cursor: pointer; }
#title:active { background: var(--sel); }
#tName { font-size: 15.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tSub { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text3); white-space: nowrap; overflow: hidden; line-height: 1.4; }
#tStatus { overflow: hidden; text-overflow: ellipsis; }
#dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text3); flex: none; }
#dot.ok { background: var(--ok); }
#dot.busy { background: var(--accent); animation: pulse 1.1s ease-in-out infinite; }
#dot.bad { background: var(--bad); }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

.icon {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  background: transparent; border: 0; border-radius: 10px; cursor: pointer; color: var(--text2);
  transition: background .15s, transform .1s;
}
.icon:active { background: var(--sel); transform: scale(.94); }
.icon.sm { width: 34px; height: 34px; }

#banner {
  margin: 8px var(--sr) 0 var(--sl);
  padding: 9px 12px; border-radius: 12px;
  background: var(--accent-soft); font-size: 13.5px; line-height: 1.5;
  display: flex; gap: 10px; align-items: center;
}
#banner.bad { background: color-mix(in srgb, var(--bad) 12%, var(--panel)); }
#banner button { margin-left: auto; flex: none; border: 0; background: var(--text); color: var(--bg); border-radius: 999px; padding: 4px 12px; font-size: 13px; cursor: pointer; }
#banner .x { background: transparent; color: var(--text3); padding: 4px 6px; }

/* ── 对话区 ── */
#feed {
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  padding: 18px var(--sr) 10px var(--sl);
  overscroll-behavior: contain;
}
#feed > * { max-width: 760px; margin-left: auto; margin-right: auto; }

.empty {
  min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: var(--text2); text-align: center; padding: 24px 0;
}
.mark { width: 44px; height: 44px; border-radius: 12px; background: var(--accent) url("/icon-180.png") center/cover; }
.empty p { margin: 0; font-size: 16px; color: var(--text); }
.empty small { font-size: 13px; color: var(--text3); max-width: 280px; line-height: 1.6; }
.chip-btn { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 7px 14px; font-size: 13.5px; cursor: pointer; }

.loader { display: block; margin: 0 auto 16px; border: 0; background: transparent; color: var(--text3); font-size: 13px; padding: 6px 12px; cursor: pointer; }
.sysline { text-align: center; color: var(--text3); font-size: 12px; margin: 4px auto 20px; display: flex; align-items: center; gap: 10px; }
.sysline::before, .sysline::after { content: ""; flex: 1; height: 1px; background: var(--line2); }

.msg { margin-bottom: 20px; }
.msg.user { display: flex; flex-direction: column; align-items: flex-end; }
.bubble {
  max-width: min(82%, 620px);
  padding: 8px 14px; border-radius: 14px;
  background: var(--bubble); color: var(--text);
  white-space: pre-wrap; word-break: break-word; line-height: 1.55;
}
.msg.user.queued .bubble { opacity: .6; }
.tag { font-size: 11.5px; color: var(--text3); margin-top: 4px; }
.uimgs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-bottom: 6px; max-width: 82%; }
.uimgs a { display: block; }
.uimgs img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; display: block; background: var(--line2); }
.uimgs .fchip { font-size: 12.5px; padding: 6px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bot { word-break: break-word; }
.bot > .md + .md, .bot > .tools + .md, .bot > .md + .tools, .bot > .tools + .tools { margin-top: 10px; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.cursor > :last-child::after, .cursor:empty::after {
  content: ""; display: inline-block; width: 7px; height: 1em; vertical-align: -2px;
  margin-left: 2px; border-radius: 2px; background: var(--accent); animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

/* 运行中：跟电脑上一样，橙色星芒 + 秒数 */
.working { display: flex; align-items: center; gap: 8px; color: var(--text3); font-size: 13px; margin-top: 8px; }
.working .spark { width: 18px; height: 18px; color: var(--accent); animation: spin 2.4s linear infinite; }
.working .spark path { fill: currentColor; stroke: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Markdown */
.md h2, .md h3, .md h4, .md h5 { font-size: 16px; line-height: 1.45; margin: 18px 0 8px; font-weight: 650; }
.md h2 { font-size: 17px; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md li { margin: 4px 0; }
.md li::marker { color: var(--text2); }
.md li > ul, .md li > ol { margin: 4px 0; }
.md strong { font-weight: 650; }
.md a { color: var(--link); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--link) 45%, transparent); text-underline-offset: 2px; word-break: break-all; }
.md code { font: 13.5px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--code); padding: 1px 5px; border-radius: 5px; }
.md blockquote { margin: 0 0 10px; padding: 2px 0 2px 12px; border-left: 3px solid var(--line); color: var(--text2); }
.md hr { border: 0; border-top: 1px solid var(--line2); margin: 16px 0; }
.md .tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.md table { border-collapse: collapse; font-size: 14px; min-width: 100%; }
.md th, .md td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.md th { font-weight: 600; white-space: nowrap; color: var(--text2); }
.md td.num, .md th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.md tr:last-child td { border-bottom: 0; }
.code { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--code); }
.code-h { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 4px 12px; font-size: 11.5px; color: var(--text3); border-bottom: 1px solid var(--line); }
.code-h button { border: 0; background: transparent; color: var(--text2); font-size: 12px; padding: 3px 6px; border-radius: 6px; cursor: pointer; }
.code pre { margin: 0; padding: 10px 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.code pre code { background: none; padding: 0; font-size: 12.5px; white-space: pre; }

.choices { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; }
.choice {
  display: flex; align-items: center; gap: 10px; text-align: left;
  border: 1px solid var(--line); background: var(--panel); border-radius: 12px;
  padding: 10px 14px; font-size: 15px; line-height: 1.45; cursor: pointer;
  transition: transform .1s, border-color .15s;
}
.choice > span { flex: 1; min-width: 0; }
.choice.rec { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.rec-tag { flex: none; font-style: normal; font-size: 11px; font-weight: 600; color: #fff; background: var(--accent); border-radius: 6px; padding: 1px 6px; }
.choice:active:not(:disabled) { transform: scale(.985); }
.choice:disabled { opacity: .45; cursor: default; }
.choice.picked { opacity: 1; border-color: var(--text); }

.fimg { display: block; margin: 4px 0 12px; }
.fimg img { display: block; max-width: 100%; max-height: 420px; border-radius: 12px; background: var(--line2); }
.fvid, .faud { display: block; width: 100%; max-width: 520px; margin: 4px 0 12px; border-radius: 12px; }
.fcard {
  display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  color: var(--text) !important; text-decoration: none !important;
}
.fext { flex: none; width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); }
.fname { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fgo { flex: none; font-size: 13px; color: var(--link); }

/* 工具步骤：跑的时候露最近几步，跑完收成一行 */
.tools { display: flex; flex-direction: column; gap: 1px; }
.tool { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text3); line-height: 1.55; min-width: 0; }
.tool span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool i { width: 5px; height: 5px; border-radius: 50%; flex: none; background: var(--accent); animation: pulse 1.1s ease-in-out infinite; }
.tool.ok i { background: var(--line); animation: none; }
.tool.err i { background: var(--bad); animation: none; }
.tools-sum, .tools-more {
  border: 0; background: transparent; padding: 2px 0; text-align: left; cursor: pointer;
  font-size: 13px; color: var(--text3); display: flex; align-items: center; gap: 4px;
}
.tools-sum svg { width: 14px; height: 14px; transition: transform .2s; }
.tools.open .tools-sum svg { transform: rotate(90deg); }
.tools.folded .tool { display: none; }
.tools.folded.open .tool { display: flex; }

.foot { display: flex; align-items: center; gap: 14px; margin-top: 6px; font-size: 12px; color: var(--text3); }
.foot button { border: 0; background: transparent; color: var(--text3); font-size: 12px; padding: 2px 0; cursor: pointer; }
.err-box { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--bad) 10%, var(--panel)); font-size: 14px; white-space: pre-wrap; }

/* ── 输入区：白色圆角框，下面一行左边权限、右边模型和智能度（跟电脑上一样） ── */
#composer { padding: 6px var(--sr) max(8px, var(--sb)) var(--sl); background: var(--bg); }
#composer > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.box {
  display: flex; align-items: flex-end; gap: 2px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 5px 5px 5px 4px; box-shadow: var(--box-shadow);
  transition: border-color .15s;
}
.box:focus-within { border-color: color-mix(in srgb, var(--text3) 60%, var(--line)); }
#input {
  flex: 1; min-width: 0; resize: none; max-height: 40vh;
  padding: 7px 4px; border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 16px; line-height: 1.45; outline: none;
}
#input::placeholder { color: var(--text3); }
.send {
  width: 34px; height: 34px; flex: none; border-radius: 50%; border: 0;
  display: grid; place-items: center; cursor: pointer;
  background: var(--text); color: var(--bg); transition: opacity .15s, transform .1s;
}
.send svg { width: 18px; height: 18px; stroke-width: 2.3; }
.send .i-stop { display: none; fill: currentColor; stroke: none; }
.send.stop .i-send { display: none; }
.send.stop .i-stop { display: block; }
.send:disabled { opacity: .22; cursor: default; }
.send:active:not(:disabled) { transform: scale(.92); }
.meta-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 0; }
.meta-btn {
  display: inline-flex; align-items: center; gap: 5px; min-width: 0;
  border: 0; background: transparent; padding: 4px 4px; border-radius: 8px;
  font-size: 13px; color: var(--text2); cursor: pointer; white-space: nowrap;
}
.meta-btn b { font-weight: 500; color: var(--text3); }
.meta-btn svg { width: 13px; height: 13px; color: var(--text3); }
.meta-btn:active { background: var(--sel); }
.meta-btn.plan { color: var(--accent); }
#atts { display: flex; gap: 8px; overflow-x: auto; padding: 0 2px 8px; }
.att { flex: none; position: relative; display: flex; align-items: center; gap: 8px; max-width: 220px; padding: 5px 28px 5px 5px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); font-size: 12.5px; }
.att img, .att .fext { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; flex: none; }
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att .rm { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--text3); font-size: 15px; width: 24px; height: 24px; cursor: pointer; }
.att.up { opacity: .6; }

/* ── 左栏：跟电脑上一样按目录分组、按最后活动排 ── */
.side-top { padding: 10px 10px 4px; display: flex; flex-direction: column; gap: 4px; }
.side-row { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; font-size: 14.5px; cursor: pointer; text-align: left; }
.side-row svg { width: 17px; height: 17px; color: var(--text2); }
.side-row:active { background: var(--sel); }
.side-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 36px; border-radius: 8px; background: color-mix(in srgb, var(--text) 5%, transparent); }
.side-search svg { width: 16px; height: 16px; color: var(--text3); }
.side-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font: inherit; font-size: 15px; color: var(--text); -webkit-appearance: none; }
.side-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 8px 10px; }
.grp { font-size: 12.5px; color: var(--text3); padding: 14px 10px 4px; display: flex; align-items: center; gap: 6px; }
.grp button { margin-left: auto; border: 0; background: transparent; color: var(--text3); font-size: 12px; cursor: pointer; padding: 0 2px; }
.sess { width: 100%; min-width: 0; text-align: left; border: 0; background: transparent; padding: 7px 10px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 36px; }
.sess:active { background: var(--sel); }
.sess.cur { background: var(--sel); }
.sess b { flex: 1; min-width: 0; font-weight: 400; font-size: 14.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess em { flex: none; font-style: normal; font-size: 11px; color: var(--text3); }
.sess .busy { width: 6px; height: 6px; border-radius: 50%; background: var(--text3); flex: none; }
.sess .busy.run { background: var(--accent); animation: pulse 1.1s ease-in-out infinite; }
.sess.arch b { color: var(--text2); }
.side-empty { padding: 14px 10px; color: var(--text3); font-size: 13px; }
.side-foot {
  display: flex; align-items: center; gap: 10px; border: 0; border-top: 1px solid var(--line2); background: transparent;
  padding: 12px 18px max(12px, var(--sb)); font-size: 14px; color: var(--text2); cursor: pointer; text-align: left;
}
.side-foot span:nth-child(2) { flex: 1; }
.side-foot svg { width: 15px; height: 15px; color: var(--text3); }
.spark-mini { width: 16px; height: 16px; border-radius: 4px; background: url("/icon-180.png") center/cover; flex: none; }
#noticeDot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* ── 底部弹层（宽屏变成居中卡片） ── */
#scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .32); opacity: 0; transition: opacity .22s; }
#scrim.on { opacity: 1; }
#sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  max-height: 84dvh; display: flex; flex-direction: column;
  background: var(--panel); border-radius: 20px 20px 0 0;
  padding: 6px max(14px, env(safe-area-inset-right)) max(14px, var(--sb)) max(14px, env(safe-area-inset-left));
  box-shadow: var(--shadow);
  transform: translateY(104%); transition: transform .3s cubic-bezier(.3, .7, .2, 1);
}
#sheet.on { transform: none; }
@media (min-width: 700px) {
  #sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 420px; border-radius: 18px; transform: translate(-50%, -46%) scale(.98); opacity: 0; transition: transform .22s, opacity .22s; padding-bottom: 14px; }
  #sheet.on { transform: translate(-50%, -50%); opacity: 1; }
  .sheet-grip { display: none; }
}
.sheet-grip { width: 36px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 10px; flex: none; }
.sheet-title { font-size: 16px; font-weight: 600; padding: 4px 6px 0; }
.sheet-sub { font-size: 13px; color: var(--text2); padding: 3px 6px 10px; line-height: 1.55; }
.sheet-sub:empty { padding-bottom: 6px; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.opt { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.opt:active { background: var(--sel); }
.opt.cur { background: var(--sel); }
.opt .t { flex: 1; min-width: 0; }
.opt .t b { display: block; font-weight: 600; font-size: 15px; }
.opt .t span { display: block; font-size: 12.5px; color: var(--text2); line-height: 1.5; }
.opt .ck { width: 20px; height: 20px; color: var(--accent); flex: none; }
.opt .lv { flex: none; display: flex; gap: 3px; align-items: flex-end; height: 16px; }
.opt .lv i { width: 4px; border-radius: 2px; background: var(--line); }
.opt .lv i.on { background: var(--accent); }
.seg { display: flex; gap: 4px; padding: 4px; margin: 2px 6px 6px; background: color-mix(in srgb, var(--text) 5%, transparent); border-radius: 10px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 7px 0; border-radius: 8px; font-size: 13.5px; color: var(--text2); cursor: pointer; }
.seg button.on { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.sheet-sec { font-size: 12px; color: var(--text3); padding: 12px 12px 4px; }
.sheet-more { width: 100%; border: 0; background: transparent; color: var(--text2); font-size: 13px; padding: 10px; cursor: pointer; }
.sheet-input { display: flex; gap: 8px; padding: 6px 6px 4px; }
.sheet-input input { flex: 1; min-width: 0; font: inherit; font-size: 15px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; outline: none; }
.sheet-input button, .big-btn { border: 0; background: var(--text); color: var(--bg); border-radius: 10px; padding: 0 16px; font-weight: 600; cursor: pointer; }
.row-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 0; background: transparent; padding: 12px; border-radius: 12px; font-size: 15px; cursor: pointer; text-align: left; }
.row-btn:active { background: var(--sel); }
.row-btn b { font-weight: 400; color: var(--text2); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.notice { padding: 10px 12px; border-bottom: 1px solid var(--line2); }
.notice:last-child { border-bottom: 0; }
.notice b { display: block; font-size: 14.5px; }
.notice time { font-size: 11.5px; color: var(--text3); }
.notice p { margin: 4px 0 0; font-size: 13.5px; color: var(--text2); white-space: pre-wrap; word-break: break-word; }
.steps { margin: 4px 6px 6px; padding-left: 20px; font-size: 14.5px; line-height: 1.8; }
.ver { padding: 10px 12px 2px; font-size: 11.5px; color: var(--text3); }

#toast {
  position: fixed; left: 50%; bottom: calc(max(10px, var(--sb)) + 110px); z-index: 90;
  transform: translate(-50%, 8px); opacity: 0;
  max-width: min(88vw, 420px); padding: 9px 16px; border-radius: 12px;
  background: var(--text); color: var(--bg); font-size: 14px; line-height: 1.5;
  box-shadow: var(--shadow); transition: opacity .2s, transform .2s; pointer-events: none;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

#login, #wx { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 320px); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.login-card p { margin: 0; font-size: 15px; }
.login-card input { width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; outline: none; text-align: center; }
.login-card small { color: var(--text3); font-size: 12px; line-height: 1.6; }
.big-btn { width: 100%; height: 44px; font-size: 15px; }
#wx { place-items: start end; text-align: right; background: rgba(10, 10, 12, .92); color: #fff; }
#wx .wx-arrow { font-size: 64px; line-height: 1; margin: 0 6px 6px 0; }
#wx p { margin: 0 6px; font-size: 20px; line-height: 1.6; }
#wx small { display: block; margin: 10px 6px 0; color: #bbb; font-size: 13px; }

/* 外屏横拿 / 矮屏：省点竖向空间 */
@media (max-height: 500px) {
  #top { padding-top: calc(var(--st) + 2px); padding-bottom: 2px; }
  #feed { padding-top: 10px; }
  .meta-row { padding-top: 2px; }
}
