/* 织一织 Z1Z — 极简沉浸
   Layout: 一屏一图的全屏推送；工具箱是从下方升起的一整面「灰泥墙」；所有工具共用同一套字段 / 分段 / 结果组件。 */
:root {
  --plaster: #EDE4D6;   /* 灰泥墙 · 主背景 */
  --linen:   #E3D7C4;   /* 亚麻 · 次级面 */
  --sand:    #CDBBA0;   /* 驼色 · 线与禁用 */
  --umber:   #7A6A56;   /* 赭褐 · 次要文字 */
  --ink:     #1D1915;   /* 墨 · 主文字/按钮 */
  --mohair:  #F6F1E8;   /* 马海毛白 · 高光 */
  --line:    rgba(29, 25, 21, .12);
  --on-photo: #F6F1E8;
  --scrim-photo: rgba(20, 16, 12, .55);
  --accent:  #9A6F4A;   /* 唯一强调：焦糖羊绒，用于已点亮的互动 */

  --f-mark: "Jost", "Futura", "Avenir Next", "Helvetica Neue", sans-serif;
  --f-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --f-logo: "M PLUS Rounded 1c", "Arial Rounded MT", "Nunito", system-ui, sans-serif;
  --f-num:  "Jost", "Avenir Next", system-ui, sans-serif;

  --ease: cubic-bezier(.22, .8, .2, 1);
  --r: 2px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --plaster: #1C1915; --linen: #26221D; --sand: #4A4136; --umber: #A8987F;
    --ink: #EDE4D6; --mohair: #2E2923; --line: rgba(237, 228, 214, .12);
    --accent: #C9986B; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --plaster: #1C1915; --linen: #26221D; --sand: #4A4136; --umber: #A8987F;
  --ink: #EDE4D6; --mohair: #2E2923; --line: rgba(237, 228, 214, .12);
  --accent: #C9986B; color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--linen); color: var(--ink);
  font-family: var(--f-body); font-weight: 300; font-size: 15px; line-height: 1.6;
  overflow: hidden; overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

/* 舞台：手机上全屏，桌面上居中成一部手机 */
.stage { position: fixed; inset: 0; display: grid; place-items: center; }
.app {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  background: var(--plaster); isolation: isolate;
}
@media (min-width: 640px) and (min-height: 700px) {
  .app { width: 420px; height: min(900px, calc(100% - 48px)); border-radius: 28px;
         box-shadow: 0 30px 80px -30px rgba(40, 28, 16, .45); }
}

.screen { position: absolute; inset: 0; }
.ic { display: inline-grid; place-items: center; width: 26px; height: 26px; }
.ic svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 14px; height: 14px; }

.wordmark { font-family: var(--f-logo); font-weight: 100; letter-spacing: -.02em; text-transform: uppercase; line-height: 1; }
.wordmark-lg { font-size: 60px; }
.wordmark-sm { font-size: 12px; font-weight: 300; }
.eyebrow { font-family: "Jost", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; font-weight: 400; font-size: 11px; letter-spacing: .3em; color: var(--umber); text-transform: uppercase; }

/* ---------- 登录 ---------- */
.login {
  display: grid; grid-template-rows: 1fr auto;
  background:
    radial-gradient(120% 70% at 20% 10%, var(--mohair) 0%, transparent 60%),
    radial-gradient(90% 60% at 90% 90%, var(--linen) 0%, transparent 70%),
    var(--plaster);
  padding-left: max(32px, env(safe-area-inset-left, 0px));
  padding-right: max(32px, env(safe-area-inset-right, 0px));
}
.login-inner { align-self: center; display: grid; gap: 14px; justify-items: center; }
.login-sub { color: var(--umber); font-size: 13px; letter-spacing: .2em; margin-bottom: 48px; }
.login-form { width: 100%; max-width: 320px; display: grid; gap: 22px; }
.login-err { margin: -8px 0 0; font-size: 12px; color: var(--accent); }
.login-foot { text-align: center; font-size: 11px; color: var(--umber); padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }

.field { display: grid; gap: 4px; }
.field-label { font-size: 11px; letter-spacing: .18em; color: var(--umber); }
.field input {
  width: 100%; border: 0; border-bottom: 1px solid var(--sand); background: transparent;
  padding: 8px 0; font-size: 16px; font-weight: 400; outline: none; border-radius: 0;
}
.field input:focus { border-bottom-color: var(--ink); }
.field input::placeholder { color: var(--sand); }
.btn-ink {
  margin-top: 10px; height: 50px; background: var(--ink); color: var(--plaster);
  font-family: var(--f-mark); letter-spacing: .4em; font-size: 14px; border-radius: var(--r);
}
.btn-ink:active { opacity: .85; }
.btn-text { font-size: 13px; color: var(--umber); letter-spacing: .08em; padding: 8px; }
.btn-text.strong { color: var(--ink); font-weight: 500; }

/* ---------- 推送 ---------- */
.feed { background: #14110E; color: var(--on-photo); touch-action: none; user-select: none; -webkit-user-select: none; }
.track { position: absolute; inset: 0; display: flex; will-change: transform; }
.track.anim { transition: transform .42s var(--ease); }
.slide { position: relative; flex: 0 0 100%; height: 100%; overflow: hidden; }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; -webkit-user-drag: none; }
.slide.chart { background: #E9DFCF; display: grid; place-items: center; padding: 88px 22px 170px; }
.slide.chart svg { width: 100%; height: 100%; max-width: 100%; }
.feed-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(20,16,12,.38), transparent 18%),
    linear-gradient(to top, var(--scrim-photo), transparent 42%);
}
.feed-top {
  position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: baseline;
  padding: calc(18px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) 0 max(20px, env(safe-area-inset-left, 0px));
  pointer-events: none;
}
.feed-date { font-family: var(--f-body); font-size: 12px; font-weight: 300; letter-spacing: .16em; line-height: 1; opacity: .9; }

.feed-caption {
  position: absolute; left: max(22px, env(safe-area-inset-left, 0px)); right: 96px;
  bottom: calc(86px + env(safe-area-inset-bottom, 0px)); pointer-events: none;
  transition: opacity .3s;
}
.cap-kicker { font-family: var(--f-mark); font-size: 11px; letter-spacing: .28em; opacity: .85; text-transform: uppercase; }
.cap-title { margin: 6px 0 4px; font-weight: 400; font-size: 24px; line-height: 1.3; letter-spacing: .04em; text-wrap: balance; }
.cap-meta { font-size: 12px; opacity: .85; letter-spacing: .06em; }
.cap-src { margin-top: 8px; font-size: 11px; letter-spacing: .08em; opacity: .7; }
.cap-src a { color: inherit; text-decoration: none; border-bottom: 1px solid currentColor; pointer-events: auto; }

.rail {
  position: absolute; right: max(12px, env(safe-area-inset-right, 0px)); top: 50%;
  display: grid; gap: 18px; transform: translate(16px, -50%); opacity: 0; pointer-events: none;
  transition: opacity .28s var(--ease), transform .28s var(--ease);
}
.rail.show { opacity: 1; transform: translate(0, -50%); pointer-events: auto; }
.rail-btn {
  display: grid; justify-items: center; gap: 1px; width: 56px; padding: 6px 0;
  color: var(--on-photo); text-shadow: 0 1px 8px rgba(0,0,0,.35);
}
.rail-btn .ic { width: 30px; height: 30px; filter: drop-shadow(0 1px 6px rgba(0,0,0,.35)); transition: transform .2s var(--ease); }
.rail-btn:active .ic { transform: scale(.88); }
.rail-btn em { font-style: normal; font-family: var(--f-num); font-size: 12px; font-variant-numeric: tabular-nums; }
.rail-btn i { font-style: normal; font-size: 10px; letter-spacing: .14em; opacity: .75; }
.rail-btn.on { color: var(--mohair); }
.rail-btn.on .ic svg { fill: #C9986B; stroke: #C9986B; }
.rail-btn.pop .ic { animation: pop .38s var(--ease); }
@keyframes pop { 40% { transform: scale(1.28); } }

.feed-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: 14px; justify-items: center;
  padding: 0 max(20px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
}
.bars { width: 100%; display: flex; gap: 4px; }
.bars span { flex: 1; height: 2px; background: rgba(246,241,232,.3); border-radius: 1px; transition: background .3s; }
.bars span.on { background: rgba(246,241,232,.95); }
.up-hint {
  display: flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .24em; color: var(--on-photo); opacity: .8;
  animation: breathe 2.8s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: translateY(-3px); opacity: 1; } }

/* ---------- 工具箱 ---------- */
.tools {
  position: absolute; inset: 0; z-index: 5; background: var(--plaster); color: var(--ink);
  transform: translateY(100%); will-change: transform; display: grid; grid-template-rows: auto 1fr;
}
.tools.lift { box-shadow: 0 -20px 60px -20px rgba(20,16,12,.4); }
.tools.anim { transition: transform .45s var(--ease); }
.tools-grab { display: grid; justify-items: center; gap: 6px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); touch-action: none; cursor: grab; }
.grabber { width: 36px; height: 3px; border-radius: 2px; background: var(--sand); }
.down-hint { display: flex; gap: 6px; align-items: center; font-size: 11px; letter-spacing: .22em; color: var(--umber); padding: 4px 10px; }
.tools-scroll {
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding-left: max(22px, env(safe-area-inset-left, 0px)); padding-right: max(22px, env(safe-area-inset-right, 0px));
  padding-block: 18px calc(30px + env(safe-area-inset-bottom, 0px));
}
.tools-head { display: grid; gap: 2px; margin-bottom: 26px; }
.tools-head .eyebrow { margin: 0; }
.tools-title { margin: 0; font-weight: 400; font-size: 30px; letter-spacing: .12em; }
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.tool-tile {
  aspect-ratio: 1 / 1.1; max-width: 100%; display: grid; align-content: space-between; justify-items: start; text-align: left;
  padding: 14px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transition: background .2s;
}
.tool-tile:hover, .tool-tile:active { background: var(--linen); }
.tool-tile .ic { width: 28px; height: 28px; color: var(--ink); }
.tool-tile b { display: block; font-weight: 400; font-size: 13px; letter-spacing: .02em; overflow-wrap: anywhere; }
.tool-tile > span { min-width: 0; max-width: 100%; }
.tool-tile small { display: block; font-family: var(--f-mark); font-size: 9px; letter-spacing: .2em; color: var(--umber); text-transform: uppercase; }
.tools-foot { text-align: center; font-size: 11px; letter-spacing: .2em; color: var(--sand); margin-top: 28px; }

.tool-view {
  position: absolute; inset: 0; background: var(--plaster); display: grid; grid-template-rows: auto 1fr;
  transform: translateX(100%); transition: transform .4s var(--ease); z-index: 2;
}
.tool-view.open { transform: none; }
.tv-head {
  display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line);
  padding: calc(14px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 14px max(10px, env(safe-area-inset-left, 0px));
}
.tv-back { width: 40px; height: 40px; display: grid; place-items: center; }
.tv-titles { min-width: 0; }
.tv-title { margin: 0; font-weight: 400; font-size: 20px; letter-spacing: .1em; }
.tv-body {
  overflow-y: auto; overscroll-behavior: contain;
  padding-left: max(22px, env(safe-area-inset-left, 0px)); padding-right: max(22px, env(safe-area-inset-right, 0px));
  padding-block: 22px calc(40px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 26px;
}

/* 统一的工具组件 */
.blk { display: grid; gap: 16px; }
.blk-title { font-family: var(--f-mark); font-size: 11px; letter-spacing: .3em; color: var(--umber); text-transform: uppercase; display: flex; justify-content: space-between; align-items: baseline; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.row2 > * { min-width: 0; }
.field .unit { position: relative; }
.field .unit input { padding-right: 34px; font-family: var(--f-num); font-size: 22px; font-variant-numeric: tabular-nums; }
.field .unit span { position: absolute; right: 0; bottom: 10px; font-size: 12px; color: var(--umber); }
.swap { display: grid; grid-template-columns: 1fr 24px 1fr; gap: 10px; align-items: end; }
.swap > * { min-width: 0; }
.swap .arrow { color: var(--sand); padding-bottom: 10px; text-align: center; font-family: var(--f-num); }
.seg { display: flex; border: 1px solid var(--line); border-radius: var(--r); padding: 3px; gap: 3px; }
.seg button { flex: 1; padding: 8px 6px; font-size: 13px; letter-spacing: .08em; color: var(--umber); border-radius: var(--r); }
.seg button.on { background: var(--ink); color: var(--plaster); }
.result { border-top: 1px solid var(--ink); padding-top: 14px; display: grid; gap: 6px; }
.result .big { font-family: var(--f-num); font-weight: 300; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.result .big small { font-size: 14px; color: var(--umber); margin-left: 6px; font-family: var(--f-body); }
.result p { margin: 0; font-size: 14px; }
.note { font-size: 12px; color: var(--umber); margin: 0; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.check input { accent-color: var(--ink); width: 16px; height: 16px; }
.btn-line { height: 44px; border: 1px solid var(--ink); border-radius: var(--r); font-size: 13px; letter-spacing: .2em; }
.btn-line.subtle { border-color: var(--line); color: var(--umber); }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.counter { display: grid; gap: 10px; justify-items: center; padding: 10px 0 18px; border-bottom: 1px solid var(--line); }
.counter .lbl { font-size: 12px; letter-spacing: .3em; color: var(--umber); }
.counter .num { font-family: var(--f-num); font-weight: 300; font-size: 88px; line-height: 1; font-variant-numeric: tabular-nums; }
.counter .ctl { display: flex; gap: 18px; align-items: center; }
.counter .ctl button { width: 56px; height: 56px; border: 1px solid var(--line); border-radius: 50%; font-family: var(--f-num); font-size: 26px; font-weight: 300; }
.counter .ctl button.plus { width: 76px; height: 76px; background: var(--ink); color: var(--plaster); border: 0; font-size: 32px; }

.search { display: flex; gap: 8px; align-items: center; border-bottom: 1px solid var(--sand); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 0; outline: none; font-size: 15px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--line); }
.list .item { width: 100%; display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; align-items: baseline; text-align: left; padding: 13px 0; }
.list .item > * { min-width: 0; }
.list .abbr { font-family: var(--f-num); font-weight: 500; font-size: 14px; letter-spacing: .04em; overflow-wrap: anywhere; }
.list .zh { font-size: 14px; }
.list .en { display: block; font-size: 11px; color: var(--umber); font-family: var(--f-mark); letter-spacing: .04em; }
.list .lvl { font-size: 10px; letter-spacing: .14em; color: var(--umber); border: 1px solid var(--line); padding: 1px 6px; border-radius: 10px; white-space: nowrap; }
.list .more { padding: 0 0 14px; font-size: 13px; color: var(--umber); }
.list .more ol { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.count-note { font-size: 11px; color: var(--umber); letter-spacing: .1em; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
th, td { padding: 10px 14px 10px 0; text-align: left; border-bottom: 1px solid var(--line); }
th { font-weight: 400; font-size: 11px; letter-spacing: .12em; color: var(--umber); }
td:first-child { font-weight: 500; font-family: var(--f-num); }

/* 我的项目 */
.pj-list { display: grid; gap: 8px; }
.pj-card { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; text-align: left; padding: 12px; background: var(--linen); border-radius: 12px; }
.pj-card > * { min-width: 0; }
.pj-thumb { width: 64px; height: 80px; border-radius: 8px; overflow: hidden; background: var(--plaster); display: grid; place-items: center; color: var(--sand); }
.pj-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pj-thumb > svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.pj-text { display: grid; gap: 4px; }
.pj-text b { font-weight: 400; font-size: 16px; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-text span { font-size: 12px; color: var(--umber); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pj-missing { display: grid; place-items: center; width: 100%; height: 100%; padding: 4px; font-size: 10px; line-height: 1.4; text-align: center; color: var(--umber); background: var(--linen); }
.pj-gal-wrap { margin: -6px -22px 0; }
.pj-gal { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.pj-gal::-webkit-scrollbar { display: none; }
.pj-slide { flex: 0 0 100%; aspect-ratio: 4 / 5; scroll-snap-align: start; position: relative; background: var(--linen); overflow: hidden; }
.pj-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pj-slide em { position: absolute; left: 14px; top: 14px; font-style: normal; font-size: 11px; letter-spacing: .1em; color: var(--plaster); background: rgba(29, 25, 21, .5); border-radius: 10px; padding: 1px 9px; }
.pj-slide .pj-missing { font-size: 13px; }
.pj-slide-empty { background: var(--linen); color: var(--sand); }
.pj-slide-empty .pj-cover-empty { color: var(--sand); }
.pj-slide-empty .pj-cover-empty svg { width: 44px; height: 44px; }
.pj-gal-wrap { position: relative; }
.pj-gal.dragging { scroll-snap-type: none; cursor: grabbing; }
.pj-gal img { -webkit-user-drag: none; user-select: none; }
.pj-gal-box { position: relative; }
.pj-gal-dots { display: flex; justify-content: center; gap: 2px; padding: 6px 0 0; }
.pj-gal-plus { position: absolute; right: 14px; bottom: 14px; width: 40px; height: 40px; border-radius: 50%; background: rgba(237, 228, 214, .9); color: var(--ink); font-size: 24px; font-weight: 300; line-height: 1; display: grid; place-items: center; box-shadow: 0 1px 6px rgba(29, 25, 21, .18); }
.pj-gal-dots button { width: 15px; height: 15px; display: grid; place-items: center; }
.pj-gal-dots button::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--sand); }
.pj-gal-dots button.on::before { background: var(--ink); }
.pj-gal-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; background: rgba(237, 228, 214, .85); color: var(--ink); font-size: 22px; line-height: 1; display: grid; place-items: center; box-shadow: 0 1px 6px rgba(29, 25, 21, .15); }
.pj-gal-nav.prev { left: 12px; } .pj-gal-nav.next { right: 12px; }
@media (hover: none) { .pj-gal-nav { display: none; } }
.pj-cover-empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--umber); }
.pj-cover-empty svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.1; }
.pj-cover-empty em { font-style: normal; font-size: 13px; letter-spacing: .1em; }
.pj-info { margin: 0; display: grid; }
.pj-info > div { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pj-info dt { color: var(--umber); font-size: 12px; letter-spacing: .1em; padding-top: 2px; }
.pj-info dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.pj-notes { margin: 0; font-size: 14px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.pj-files { margin-top: -6px; }
.pj-fname { display: flex; gap: 8px; align-items: center; min-width: 0; font-size: 14px; }
.pj-fname i { width: 18px; height: 18px; flex: 0 0 auto; color: var(--umber); }
.pj-fname i svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.3; }
.pj-files .gs-use > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-del.armed { width: auto; padding: 0 10px; font-size: 12px; color: var(--accent); border: 1px solid currentColor; border-radius: 14px; height: 26px; }
.pj-tip { color: var(--accent); }
.pj-del { justify-self: center; align-self: center; color: var(--warn, #9A4F3A); }
.pj-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pj-chips .field-label { width: 100%; }
.chip { border: 1px solid var(--line); border-radius: 16px; padding: 5px 12px; font-size: 13px; }
.chip:active { border-color: var(--ink); }
.pj-ta { width: 100%; border: 1px solid var(--sand); border-radius: var(--r); background: transparent; padding: 10px 12px; font: inherit; font-size: 15px; line-height: 1.7; color: var(--ink); outline: none; resize: vertical; }
.pj-ta:focus { border-color: var(--ink); }
.pj-ta::placeholder { color: var(--sand); }
.lightbox { position: absolute; inset: 0; z-index: 30; background: #15110D; display: grid; grid-template-rows: 1fr auto; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
.lightbox img { width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.lb-miss { align-self: center; text-align: center; color: var(--sand); font-size: 13px; margin: 0; }
.lb-bar { display: flex; justify-content: center; gap: 10px; padding: 14px 16px 18px; flex-wrap: wrap; }
.lb-bar button { color: var(--plaster); border: 1px solid rgba(237, 228, 214, .4); border-radius: 18px; padding: 7px 16px; font-size: 13px; letter-spacing: .08em; }
.lb-bar button.armed { color: #E9B49A; border-color: currentColor; }
.tag-ex { font-size: 10px; letter-spacing: .1em; color: var(--accent); border: 1px solid currentColor; border-radius: 8px; padding: 0 5px; margin-left: 6px; vertical-align: 2px; }

.saved-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.saved-grid button { aspect-ratio: 3/4; max-width: 100%; overflow: hidden; background: var(--linen); position: relative; }
.saved-grid img, .saved-grid svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.empty { text-align: center; color: var(--umber); font-size: 13px; padding: 40px 0; line-height: 2; }

/* ---------- 评论 ---------- */
.sheet-scrim { position: absolute; inset: 0; z-index: 8; background: rgba(20,16,12,.35); }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 9; max-height: 62%;
  background: var(--plaster); color: var(--ink); border-radius: 18px 18px 0 0;
  display: grid; grid-template-rows: auto auto 1fr auto; justify-items: stretch;
  transform: translateY(105%); transition: transform .4s var(--ease);
  padding: 10px max(20px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
}
.sheet.open { transform: none; }
.sheet .grabber { justify-self: center; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; letter-spacing: .14em; }
.comments { list-style: none; margin: 0; padding: 6px 0; overflow-y: auto; min-height: 120px; }
.comments li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 10px 0; }
.comments li > div { min-width: 0; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--linen); display: grid; place-items: center; font-size: 12px; color: var(--umber); }
.comments b { font-weight: 400; font-size: 12px; color: var(--umber); }
.comments p { margin: 2px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.comment-form { display: flex; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.comment-form input { flex: 1; min-width: 0; border: 0; background: var(--linen); border-radius: 18px; padding: 9px 14px; outline: none; font-size: 14px; }

.toast {
  position: absolute; left: 50%; top: calc(64px + env(safe-area-inset-top, 0px)); z-index: 20;
  transform: translate(-50%, -8px); opacity: 0; pointer-events: none; transition: .3s var(--ease);
  background: var(--ink); color: var(--plaster); font-size: 12px; letter-spacing: .1em; padding: 8px 16px; border-radius: 16px; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

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

/* 图解页是浅色纸面：前景切换为墨色 */
.feed.light { --on-photo: #1D1915; }
.feed .feed-shade { transition: opacity .35s; }
.feed.light .feed-shade { opacity: 0; }
.feed.light .rail-btn, .feed.light .rail-btn .ic { text-shadow: none; filter: none; }
.feed.light .bars span { background: rgba(29,25,21,.18); }
.feed.light .bars span.on { background: rgba(29,25,21,.85); }
.feed .feed-top, .feed .feed-caption, .feed .up-hint, .feed .rail-btn { transition: color .35s, opacity .3s, transform .28s; }
.feed-top, .feed-caption, .up-hint { color: var(--on-photo); }

/* 登录：语言切换 / 手机号 / 验证码 */
.login { position: absolute; }
.lang-btn {
  position: absolute; top: calc(16px + env(safe-area-inset-top, 0px)); right: max(20px, env(safe-area-inset-right, 0px));
  font-family: var(--f-mark); font-size: 12px; letter-spacing: .2em; color: var(--umber);
  border: 1px solid var(--line); border-radius: 14px; padding: 4px 12px;
}
.login-seg { margin-bottom: -4px; }
.phone-row, .code-row { display: flex; align-items: flex-end; gap: 12px; border-bottom: 1px solid var(--sand); }
.phone-row:focus-within, .code-row:focus-within { border-bottom-color: var(--ink); }
.phone-row input, .code-row input { flex: 1; min-width: 0; border-bottom: 0 !important; }
.phone-row .cc { padding: 8px 0; font-family: var(--f-num); font-size: 16px; font-weight: 400; }
.phone-row select {
  flex: 0 0 auto; max-width: 42%; border: 0; background: transparent; padding: 8px 0; font: inherit; font-size: 15px; font-weight: 400;
  color: var(--ink); outline: none; cursor: pointer;
}
.code-btn { flex: 0 0 auto; padding: 8px 0; font-size: 13px; letter-spacing: .06em; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.code-btn:disabled { color: var(--sand); cursor: default; }

/* 历史灵感 */
.hist { display: grid; gap: 14px; margin-top: 36px; }
#history, .hist-list { display: grid; gap: 20px; }
.hist-issue { display: grid; gap: 10px; }
.hist-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.hist-head b { font-weight: 400; font-size: 15px; letter-spacing: .08em; }
.hist-head span { font-size: 12px; color: var(--umber); }
.hist-head em { font-style: normal; color: var(--accent); }
.hist-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: 30%; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin-right: calc(-1 * max(22px, env(safe-area-inset-right, 0px))); padding-right: 22px; scrollbar-width: none;
}
.hist-strip::-webkit-scrollbar { display: none; }
.hist-th { display: grid; gap: 6px; text-align: left; scroll-snap-align: start; min-width: 0; }
.hist-th img, .hist-th svg { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; background: var(--linen); }
.hist-th span { font-size: 11px; color: var(--umber); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tools-sub { margin-bottom: 14px; }

.back-latest {
  position: absolute; left: 50%; transform: translateX(-50%); top: calc(48px + env(safe-area-inset-top, 0px)); z-index: 3;
  display: flex; gap: 10px; align-items: center; white-space: nowrap;
  font-size: 12px; letter-spacing: .06em; color: var(--on-photo);
  background: rgba(20,16,12,.32); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: 16px; padding: 6px 14px;
}
.back-latest b { font-weight: 500; }
.feed.light .back-latest { background: rgba(29,25,21,.08); }
.hist-all { justify-self: start; display: flex; gap: 6px; align-items: center; font-size: 13px; letter-spacing: .08em; color: var(--ink); padding: 6px 0; border-bottom: 1px solid var(--ink); }
.hist-all span { font-family: var(--f-num); }

/* 密度保存 */
.save-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.save-row > * { min-width: 0; }
.save-row .btn-line { padding: 0 20px; height: 40px; }
.gs-row { display: flex; align-items: center; gap: 8px; }
.gs-use { flex: 1; min-width: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; text-align: left; padding: 13px 0; }
.gs-use .zh { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-num { font-family: var(--f-num); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gs-del { width: 32px; height: 32px; color: var(--umber); font-size: 18px; line-height: 1; }
.note .btn-text { padding: 0 0 0 8px; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }

/* 设置 */
.settings { display: grid; gap: 4px; margin-top: 40px; }
.settings .blk-title { margin-bottom: 8px; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.set-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--umber); }
.set-seg { flex: 0 0 auto; }
.set-seg button { padding: 6px 14px; }
:root[lang="en"] .zh-only, :root:not([lang="en"]) .en-only { display: none; }

/* 灵感投稿 */
.hist-links { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.upload {
  display: grid; place-items: center; width: 210px; height: 280px; max-width: 100%; align-self: center; flex-shrink: 0;
  border: 1px dashed var(--sand); border-radius: var(--r); background: var(--linen); cursor: pointer; overflow: hidden; text-align: center;
}
.upload span { display: grid; gap: 4px; font-size: 14px; color: var(--ink); padding: 12px; }
.upload small { font-size: 11px; color: var(--umber); }
.upload.has { border-style: solid; border-color: var(--line); }
.upload img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload:focus-within { outline: 1px solid var(--accent); outline-offset: 3px; }
#tvBody > .btn-text { justify-self: center; align-self: center; margin-top: -16px; }
.select-line { width: 100%; border: 0; border-bottom: 1px solid var(--sand); background: transparent; padding: 8px 0; font: inherit; font-size: 16px; font-weight: 400; color: var(--ink); border-radius: 0; outline: none; }
.select-line:focus { border-bottom-color: var(--ink); }
.sub-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; }
.sub-row img { width: 48px; height: 64px; object-fit: cover; display: block; background: var(--linen); }
.sub-row > div { min-width: 0; display: grid; gap: 2px; }
.sub-row b { font-weight: 400; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-row span { font-size: 12px; color: var(--umber); }
.tv-body > * { flex-shrink: 0; }
/* 防止键盘聚焦或程序滚动把屏幕外的面板拖进来 */
.app, .tools, .screen { overflow: hidden; overflow: clip; }
.sub-ph { width: 48px; height: 64px; background: var(--linen); display: block; }
.login-hint { margin: -10px 0 0; font-size: 11px; color: var(--umber); }
.login-err.ok { color: var(--umber); }
.login-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-top: -8px; }
.login-links .btn-text { padding: 6px 0; font-size: 12px; }
.fatal { position: fixed; left: 0; right: 0; bottom: 0; z-index: 99; background: #7a2e1f; color: #fff; font: 12px/1.5 system-ui, sans-serif; padding: 10px max(16px, env(safe-area-inset-left, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)); word-break: break-all; }
:root[lang="en"] .login-form { margin-top: 56px; }
.login-or { display: flex; align-items: center; gap: 12px; font-size: 11px; letter-spacing: .2em; color: var(--umber); margin: -2px 0 -6px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-outline { height: 50px; border: 1px solid var(--ink); border-radius: var(--r); font-size: 14px; letter-spacing: .08em; background: transparent; }
.btn-outline:active { background: var(--linen); }
.login-foot { white-space: pre-line; }
.settings { padding-bottom: 12px; }
/* 尺码换算：分类 + 单位开关同一行 */
.sz-bar { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; }
.sz-bar > * { min-width: 0; }
.sz-bar [data-seg="su"] button { padding: 8px 10px; font-family: var(--f-num); }
.sz-bar [data-seg="sz"] button { padding: 8px 2px; }
/* 列少的表（童装、鞋袜）也铺满整行；列多的表仍可左右滑动 */
.table-wrap table { min-width: 100%; }
.table-wrap td:last-child, .table-wrap th:last-child { padding-right: 0; }
#szNote { white-space: pre-line; }

/* 身体尺寸：档案 */
.pf-list { display: grid; gap: 8px; }
.pf-card { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; text-align: left; padding: 14px; background: var(--linen); border-radius: 12px; }
.pf-card > * { min-width: 0; }
.pf-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--plaster); display: grid; place-items: center; font-size: 18px; color: var(--ink); }
.pf-text { display: grid; gap: 2px; }
.pf-text b { font-weight: 400; font-size: 16px; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-text span { font-size: 12px; color: var(--umber); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-icons { display: flex; gap: 2px; color: var(--umber); }
.pf-icons i { width: 18px; height: 18px; display: block; }
.pf-icons svg { width: 100%; height: 100%; }

.mz-top { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: stretch; }
.mz-top .btn-ink, .mz-top .btn-line { margin: 0; height: auto; min-height: 40px; }
.mz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.mz-view { display: grid; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.mz-view b { font-weight: 300; font-family: var(--f-num); font-size: 20px; font-variant-numeric: tabular-nums; }
.mz-view b small { font-size: 12px; color: var(--umber); font-family: var(--f-body); }
.mz-tag { font-style: normal; font-size: 10px; letter-spacing: .06em; color: var(--accent); border: 1px solid currentColor; border-radius: 8px; padding: 0 5px; margin-left: 6px; vertical-align: 1px; }
.mz-new { justify-self: start; padding-left: 0; }
.mz-hist { display: grid; gap: 4px; border-top: 1px solid var(--line); padding-top: 12px; }
.mz-hrow { display: flex; align-items: flex-start; gap: 8px; }
.mz-hrow .mz-rdel { margin-top: 8px; }
.mz-hbtn { flex: 1; min-width: 0; display: grid; gap: 4px; padding: 10px 0; text-align: left; font-size: 13px; border-bottom: 1px solid var(--line); }
.mz-hbtn span:last-child { color: var(--umber); font-size: 12px; line-height: 1.7; font-variant-numeric: tabular-nums; }
.mz-old { padding: 8px 0 12px; opacity: .85; }
.mz-garment { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.mz-g-head { display: flex; align-items: center; gap: 10px; }
.mz-g-head b { font-weight: 400; font-size: 15px; }
.mz-g-head small { font-size: 11px; color: var(--umber); }
.mz-g-head .gs-del { margin-left: auto; }
.mz-g-icon { width: 22px; height: 22px; color: var(--ink); flex: 0 0 auto; }
.mz-g-icon svg { width: 100%; height: 100%; }
.mz-g-name { flex: 1; min-width: 0; border: 0; border-bottom: 1px solid var(--sand); background: transparent; padding: 6px 0; font-size: 15px; outline: none; }
.mz-custom { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.mz-custom > * { min-width: 0; }
.mz-custom > input, .mz-custom .unit input { width: 100%; border: 0; border-bottom: 1px solid var(--sand); background: transparent; padding: 8px 0; font-size: 15px; outline: none; }
.mz-custom .unit { position: relative; }
.mz-custom .unit span { position: absolute; right: 0; bottom: 10px; font-size: 12px; color: var(--umber); }
.mz-addg { display: grid; gap: 10px; }
.mz-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mz-type { display: grid; justify-items: center; gap: 6px; padding: 12px 4px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; }
.mz-type svg { width: 24px; height: 24px; }
.mz-type:active { background: var(--linen); }
.mz-delp { justify-self: center; color: var(--accent); }
button.mz-tag { font-family: inherit; line-height: 1.4; cursor: pointer; }
.toast { white-space: normal; max-width: min(320px, calc(100% - 40px)); text-align: center; line-height: 1.6; }
.mz-gedit { margin-left: auto; padding: 4px 0; font-size: 12px; }
.mz-top { display: flex; }
.mz-top .seg { width: 120px; }
.mz-sec-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mz-sec-head .blk-title { flex: 1; }
.mz-sec-head .btn-text { padding: 4px 0; font-size: 12px; }
.mz-save { margin-top: 4px; }
.mz-garment.editing, .mz-editing { border-color: var(--ink); }
.mz-cadd { justify-self: start; padding-left: 0; }
.mz-save .btn-ink, .mz-save .btn-line { margin: 0; height: 44px; }
.mz-rdel.armed { width: auto; padding: 0 10px; font-size: 12px; color: var(--accent); border: 1px solid currentColor; border-radius: 14px; height: 26px; }

/* 基本尺寸：三列、小一号，更紧凑 */
.mz-body { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.mz-body .mz-empty { grid-column: 1 / -1; }
.mz-body .mz-view { padding-bottom: 6px; gap: 0; }
.mz-body .mz-view b { font-size: 17px; }
.mz-body .mz-view b small { font-size: 11px; }
.mz-body .field-label { font-size: 10px; letter-spacing: .1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mz-body .field .unit input { font-size: 17px; padding: 4px 26px 4px 0; }
.mz-body .field .unit span { bottom: 6px; font-size: 11px; }
.mz-garment .mz-delp { justify-self: center; padding: 4px 0 0; font-size: 12px; }
.cm-note { display: block !important; text-align: center; color: var(--umber); font-size: 13px; padding: 24px 0 !important; }
.cm-del { margin-top: 4px; font-size: 11px; color: var(--umber); padding: 2px 0; }
.cm-del.armed { color: var(--accent); }

/* 管理员审核 */
.rv-list { display: grid; gap: 14px; }
.rv-card { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.rv-img { display: block; width: 110px; aspect-ratio: 3 / 4; max-width: 100%; background: var(--linen); border-radius: 6px; overflow: hidden; }
.rv-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rv-body { display: grid; gap: 4px; align-content: start; min-width: 0; }
.rv-body h4 { margin: 0; font-weight: 400; font-size: 15px; overflow-wrap: anywhere; }
.rv-body p { margin: 0; font-size: 12px; color: var(--umber); overflow-wrap: anywhere; }
.rv-body a { color: var(--ink); }
.rv-kind { font-size: 11px; letter-spacing: .08em; color: var(--umber); }
.rv-ok { color: var(--accent) !important; }
.rv-body .btns { margin-top: 8px; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }
.rv-body .btns .btn-ink, .rv-body .btns .btn-line { margin: 0; height: 36px; font-size: 12px; letter-spacing: .04em; padding: 0 4px; }
@media (max-width: 360px) { .rv-card { grid-template-columns: 1fr; } .rv-img { width: 100%; } }

/* 隐私政策：登录页勾选 + 全屏查看 */
.agree { display: grid; gap: 8px; margin-top: -4px; }
.agree-row { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; font-size: 12px; line-height: 1.6; color: var(--umber); text-align: left; cursor: pointer; }
.agree-row input { width: 15px; height: 15px; margin: 2px 0 0; accent-color: var(--ink); }
.agree-link { font: inherit; color: var(--ink); border-bottom: 1px solid currentColor; padding: 0; line-height: 1.3; }
.doc-view { position: absolute; inset: 0; z-index: 40; background: var(--plaster); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.doc-head { display: flex; justify-content: space-between; align-items: center; padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 12px; border-bottom: 1px solid var(--line); font-size: 15px; letter-spacing: .08em; }
.doc-frame { width: 100%; height: 100%; border: 0; background: var(--plaster); display: block; }
.doc-foot { display: grid; gap: 10px; padding: 14px 20px calc(16px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--plaster); }
.doc-foot > p:first-child { margin: 0; font-size: 13px; }
.doc-foot .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.doc-foot .login-err { margin: 0; }
.btns .btn-ink, .btns .btn-line { margin: 0; height: 44px; }
.doc-foot .btns .btn-ink, .doc-foot .btns .btn-line { font-size: 13px; letter-spacing: .1em; padding: 0 8px; white-space: nowrap; }
/* 注销账号 */
.btn-text.del-btn { color: #9A4F3A; }
.del-lead { margin: 0 0 6px; font-size: 14px; }
.del-list { margin: 0 0 14px; padding-left: 1.2em; font-size: 14px; line-height: 1.9; color: var(--ink); }
.btn-ink.btn-danger { background: #8E4A36; width: 100%; }
.btn-ink:disabled { opacity: .55; }

/* 内测期间去掉了「织一织」副标题，补上原来的间距（正式名字恢复后这条不会生效） */
.wordmark-lg + .login-form { margin-top: 56px; }

/* 计数器：每次计数的时间 */
.c-log { display: grid; gap: 6px; padding: 4px 0 14px; border-bottom: 1px solid var(--line); }
.c-log ul { list-style: none; margin: 0; padding: 0; display: grid; }
.c-log li { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--umber); padding: 5px 0; border-top: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.c-log li:first-child { border-top: 0; }
.c-log time { white-space: nowrap; }

/* 计数器：点大数字直接修改 */
.counter .num-edit { color: var(--ink); cursor: text; padding: 0 6px; border-radius: 10px; }
.counter .num-edit:active { background: var(--linen); }
.counter .num-input { width: 4.2ch; text-align: center; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; outline: none; padding: 0; }
.counter .num-hint { font-size: 11px; color: var(--umber); letter-spacing: .08em; margin-top: -2px; }
.c-totals .result { border-top: 0; padding-top: 0; }

/* 意见反馈 */
.fb-list { list-style: none; margin: 0; padding: 0; display: grid; }
.fb-list li { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.fb-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; color: var(--umber); }
.fb-meta .tag-ex { margin: 0; }
.fb-meta .tag-ex.ok { color: var(--ink); }
.fb-list p { margin: 0; font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
