/* 衣库 —— 视觉沿用 Alphadiving 的一套：白底中性灰、200px 侧栏、衬线标题、细边卡片、右侧抽屉、手机底栏。只做浅色。 */
:root {
  color-scheme: light;
  --background: #ffffff;
  --foreground: #171717;
  --muted: #f5f5f5;
  --muted-fg: #737373;
  --border: #e5e5e5;
  --sidebar: #fafafa;
  --sidebar-border: #e8e8e8;
  --sidebar-accent: #ededed;
  --gain: #0d9b6c;
  --loss: #e21d48;
  --warn: #b45309;
  --series-1: rgb(0 58 143);
  --f-sans: Inter, system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --f-serif: Georgia, "Times New Roman", "Songti SC", "Noto Serif SC", serif;
  --f-editorial: "Kaiti SC", STKaiti, KaiTi, "楷体", Georgia, serif;
  --ease-ios: cubic-bezier(.32, .72, 0, 1);
  --ease-std: cubic-bezier(.4, 0, .2, 1);
  --press: .12s;
  --state: .22s;
  --sb-w: 200px;
  --r-sm: 8px; --r-md: 10px; --r-lg: 14px;
  --shadow-sm: 0 1px 3px rgb(0 0 0 / .05), 0 1px 2px -1px rgb(0 0 0 / .05);
  --line: rgb(229 229 229 / .6);
}
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--background); color: var(--foreground); font: 400 14px/1.5 var(--f-sans); overscroll-behavior-y: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid rgb(23 23 23 / .25); outline-offset: 1px; border-radius: 6px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.ic { width: 16px; height: 16px; flex: none; }
.up { color: var(--gain); } .down { color: var(--loss); } .muted { color: var(--muted-fg); }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }

/* ---------- 外壳 ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sb-w); display: flex; flex-direction: column; background: var(--sidebar); border-right: 1px solid var(--sidebar-border); padding: calc(10px + env(safe-area-inset-top, 0px)) 8px calc(10px + env(safe-area-inset-bottom, 0px)); }
.sb-top { display: flex; align-items: center; height: 32px; padding: 0 6px; margin-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-editorial); font-size: 18px; letter-spacing: .02em; }
.brand svg { width: 22px; height: 22px; flex: none; }
.store-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 6px 10px; margin-bottom: 4px; border-radius: var(--r-md); background: #fff; box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); font-size: 13px; font-weight: 500; text-align: left; transition: box-shadow var(--state) var(--ease-std); }
.store-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-btn .ic { margin-left: auto; color: var(--muted-fg); width: 14px; height: 14px; }
.store-btn:not(:disabled):hover { box-shadow: var(--shadow-sm), 0 0 0 1px #c9c9c9; }
.store-btn:disabled { cursor: default; }
.sb-group { display: flex; align-items: flex-end; height: 28px; padding: 0 12px 4px; margin: 4px 0 0; font-size: 11px; font-weight: 500; color: rgb(115 115 115 / .8); }
.sb-nav { display: grid; gap: 1px; }
.sb-nav a { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 12px; border-radius: var(--r-sm); font-size: 13px; color: var(--muted-fg); transition: color var(--press) var(--ease-std), background-color var(--press) var(--ease-std); }
.sb-nav a:hover { color: var(--foreground); background: rgb(0 0 0 / .03); }
.sb-nav a.on { color: var(--foreground); font-weight: 500; background: var(--sidebar-accent); }
.sb-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 6px 8px; border-radius: var(--r-md); text-align: left; transition: background-color var(--press) var(--ease-std); }
.sb-foot:hover, .sb-foot[aria-expanded="true"] { background: var(--sidebar-accent); }
.acct-txt { display: grid; min-width: 0; line-height: 1.3; }
.acct-txt b { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-txt span { font-size: 11px; color: var(--muted-fg); }
.avatar { width: 24px; height: 24px; border-radius: 999px; background: var(--foreground); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex: none; }
.avatar.lg { width: 32px; height: 32px; font-size: 13px; }
.main { margin-left: var(--sb-w); min-height: 100dvh; }
.page { padding: 28px 32px 56px; max-width: 1280px; animation: viewIn var(--state) var(--ease-ios) both; }
.page.narrow { max-width: 860px; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tabbar { display: none; }

/* 弹出菜单（账号、切换店铺） */
.menu { position: fixed; z-index: 80; width: 260px; max-height: calc(100dvh - 24px); overflow-y: auto; padding: 6px; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 16px 40px -18px rgb(15 23 42 / .35), 0 2px 6px -2px rgb(15 23 42 / .08); animation: viewIn var(--state) var(--ease-ios) both; }
.menu .mh { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; }
.menu .mh div { display: grid; line-height: 1.35; min-width: 0; }
.menu .mh b { font-size: 14px; font-weight: 600; }
.menu .mh span:not(.avatar) { font-size: 12px; color: var(--muted-fg); }
.menu .mg { display: grid; gap: 1px; padding: 6px 0; border-top: 1px solid var(--line); }
.menu .ml { margin: 2px 8px 4px; font-size: 11px; font-weight: 500; color: var(--muted-fg); }
.menu .mi { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 8px; border-radius: var(--r-sm); font-size: 13px; text-align: left; }
.menu .mi:hover { background: var(--muted); }
.menu .mi .ic { color: var(--muted-fg); }
.menu .mi small { margin-left: auto; font-size: 11px; color: var(--muted-fg); }
.menu .mi.on { font-weight: 600; }

/* ---------- 页头 ---------- */
.ph { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.eyebrow { margin: 0 0 4px; font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: rgb(115 115 115 / .8); }
.ph-title { margin: 0; font-family: var(--f-serif); font-size: 20px; font-weight: 500; line-height: 28px; letter-spacing: -.02em; }
.ph-sub { margin: 2px 0 0; font-size: 12px; line-height: 16px; color: var(--muted-fg); }
.ph-act { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search { position: relative; width: 260px; max-width: 100%; }
.search > .ic { position: absolute; left: 12px; top: 10px; color: var(--muted-fg); pointer-events: none; }
.search input { width: 100%; height: 36px; border: 0; border-radius: var(--r-sm); background: #fff; box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); padding: 0 12px 0 36px; outline: none; transition: box-shadow var(--state) var(--ease-std); }
.search input:focus { box-shadow: var(--shadow-sm), 0 0 0 1px var(--foreground); }
.utabs { display: flex; border-bottom: 1px solid var(--line); margin-top: 16px; overflow-x: auto; scrollbar-width: none; }
.utabs button { min-height: 44px; padding: 10px 12px; border-bottom: 2px solid transparent; font-size: 14px; font-weight: 500; color: var(--muted-fg); white-space: nowrap; transition: color var(--state) var(--ease-std); }
.utabs button:hover { color: var(--foreground); }
.utabs button.on { color: var(--foreground); border-bottom-color: var(--foreground); }
.bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.chips { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; color: var(--muted-fg); white-space: nowrap; transition: color var(--press) var(--ease-std), background-color var(--press) var(--ease-std); }
.chip:hover { color: var(--foreground); background: rgb(245 245 245 / .6); }
.chip.on { background: var(--foreground); color: #fff; font-weight: 500; }
.chip .n { font-size: 11px; opacity: .7; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--r-md); background: var(--muted); flex: none; }
.seg button { padding: 4px 10px; border-radius: var(--r-sm); font-size: 12px; font-weight: 600; color: var(--muted-fg); white-space: nowrap; transition: color var(--press) var(--ease-std), background-color var(--press) var(--ease-std); }
.seg button:hover { color: var(--foreground); }
.seg button.on { background: #fff; color: var(--foreground); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.select { height: 32px; padding: 0 28px 0 10px; border: 0; border-radius: var(--r-md); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 8px center / 14px no-repeat; box-shadow: inset 0 0 0 1px var(--border); font-size: 12px; font-weight: 500; -webkit-appearance: none; appearance: none; outline: none; }

/* ---------- 卡片、按钮、指标 ---------- */
.card { border: 1px solid rgb(229 229 229 / .5); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-sm); overflow: hidden; }
.card + .card, .grid + .card, .card + .grid { margin-top: 16px; }
.ch { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.ch h3 { margin: 0; font-size: 13px; font-weight: 600; }
.ch .s { font-size: 11px; color: var(--muted-fg); }
.cb { padding: 14px 16px; }
.grid { display: grid; gap: 16px; margin-top: 16px; }
.grid.c2 { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.grid.e2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid > .card { margin-top: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r-md); font-size: 13px; font-weight: 500; background: var(--foreground); color: #fafafa; white-space: nowrap; transition: background-color var(--state) var(--ease-std), transform var(--press) var(--ease-std), opacity var(--press); }
.btn:hover { background: #2b2b2b; }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.ghost { background: transparent; color: var(--foreground); box-shadow: inset 0 0 0 1px var(--border); }
.btn.ghost:hover { background: var(--muted); }
.btn.danger { background: transparent; color: var(--loss); box-shadow: inset 0 0 0 1px rgb(226 29 72 / .35); }
.btn.danger:hover { background: rgb(226 29 72 / .06); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: var(--r-sm); }
.btn.lg { height: 44px; padding: 0 20px; font-size: 14px; }
.btn.block { width: 100%; }
.iconbtn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-sm); color: var(--muted-fg); flex: none; transition: background-color var(--press), color var(--press); }
.iconbtn:hover { background: var(--muted); color: var(--foreground); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi { padding: 14px 16px; display: grid; gap: 2px; align-content: start; box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); }
.kpi .k { font-size: 10px; font-weight: 500; letter-spacing: .12em; color: var(--muted-fg); }
.kpi .v { font-size: 20px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.3; }
.kpi .s { font-size: 11px; color: var(--muted-fg); }
.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 500; color: var(--muted-fg); box-shadow: inset 0 0 0 1px var(--border); white-space: nowrap; }
.pill.warn { color: var(--warn); box-shadow: inset 0 0 0 1px #fcd34d; background: #fffbeb; }
.pill.bad { color: var(--loss); box-shadow: inset 0 0 0 1px rgb(226 29 72 / .3); background: rgb(226 29 72 / .05); }
.pill.dark { background: var(--foreground); color: #fff; box-shadow: none; }
.empty { padding: 28px 20px; border: 1px dashed #d4d4d4; border-radius: var(--r-lg); font-size: 13px; color: var(--muted-fg); margin-top: 16px; }
.card .empty { margin: 16px; }
.empty b { display: block; font-family: var(--f-serif); font-size: 15px; font-weight: 600; color: var(--foreground); margin-bottom: 4px; }
.empty .btn { margin-top: 12px; }
.note { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--r-md); background: var(--muted); font-size: 12px; color: var(--muted-fg); line-height: 1.6; }

/* ---------- 表格与列表 ---------- */
.tw { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { height: 36px; padding: 0 12px; text-align: left; font-size: 11px; font-weight: 500; color: var(--muted-fg); white-space: nowrap; border-bottom: 1px solid var(--line); }
.t td { padding: 8px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.t tbody tr:first-child td { border-top: 0; }
.t th.r, .t td.r { text-align: right; font-variant-numeric: tabular-nums; }
.t tr.click { cursor: pointer; transition: background-color var(--press); }
.t tr.click:hover { background: #fafafa; }
.t th:first-child, .t td:first-child { padding-left: 16px; }
.t th:last-child, .t td:last-child { padding-right: 16px; }
.t tr.void td { color: var(--muted-fg); text-decoration: line-through; }
.thumb { width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--muted) center / cover no-repeat; flex: none; display: inline-flex; align-items: center; justify-content: center; color: #c4c4c4; font-family: var(--f-editorial); font-size: 16px; overflow: hidden; }
.thumb.sm { width: 32px; height: 32px; border-radius: 6px; font-size: 13px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pname { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pname div { display: grid; min-width: 0; line-height: 1.35; }
.pname b { font-family: var(--f-editorial); font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pname span { font-size: 11px; color: var(--muted-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq { display: inline-block; min-width: 30px; }
.stockbar { display: inline-block; width: 44px; height: 4px; border-radius: 2px; background: var(--muted); margin-right: 6px; vertical-align: middle; overflow: hidden; }
.stockbar i { display: block; height: 100%; background: var(--foreground); border-radius: 2px; }
/* 按日期分组的单据列表 */
.day { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 16px 6px; font-size: 11px; font-weight: 500; color: var(--muted-fg); background: #fcfcfc; border-top: 1px solid var(--line); }
.day:first-child { border-top: 0; }
.doc { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 16px; border-top: 1px solid var(--line); text-align: left; transition: background-color var(--press); }
.doc:hover { background: #fafafa; }
.doc .d1 { display: grid; min-width: 0; line-height: 1.4; }
.doc .d1 b { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc .d1 span { font-size: 11.5px; color: var(--muted-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc .amt { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.doc .amt small { display: block; font-size: 11px; font-weight: 400; color: var(--muted-fg); }
.doc.void b, .doc.void .amt { text-decoration: line-through; color: var(--muted-fg); }
/* 排行条 */
.rank { display: grid; gap: 2px; padding: 8px; }
.rk { display: grid; grid-template-columns: 20px 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: var(--r-sm); text-align: left; transition: background-color var(--press); }
.rk:hover { background: var(--muted); }
.rk .i { font-size: 11px; color: var(--muted-fg); text-align: center; font-variant-numeric: tabular-nums; }
.rk .m { display: grid; gap: 4px; min-width: 0; }
.rk .m b { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk .m i { display: block; height: 4px; border-radius: 2px; background: var(--series-1); min-width: 2px; }
.rk .m i.g { background: #c9c9c9; }
.rk .v { text-align: right; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3; }
.rk .v small { display: block; font-size: 11px; font-weight: 400; color: var(--muted-fg); }
/* 动态时间线 */
.feed { display: grid; }
.fi { display: flex; align-items: baseline; gap: 10px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 12.5px; }
.fi:first-child { border-top: 0; }
.fi time { width: 68px; flex: none; font-size: 11px; color: var(--muted-fg); font-variant-numeric: tabular-nums; }
.fi .d { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fi .w { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 柱图 ---------- */
.chart { position: relative; height: 190px; margin: 4px 0 0; padding: 0 0 20px 40px; }
.chart .gl { position: absolute; left: 40px; right: 0; border-top: 1px solid rgb(229 229 229 / .7); }
.chart .gl span { position: absolute; right: calc(100% + 6px); top: -7px; font-size: 10px; color: var(--muted-fg); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart .bars { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 100%; }
.chart .b { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; min-width: 0; }
.chart .b i { display: block; width: 100%; max-width: 24px; min-height: 1px; background: var(--series-1); border-radius: 4px 4px 0 0; transition: opacity var(--press); }
.chart .b.z i { background: #d4d4d4; border-radius: 0; }
.chart .bars:hover .b i { opacity: .45; }
.chart .bars .b:hover i { opacity: 1; }
.chart .b em { position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-style: normal; font-size: 10px; color: var(--muted-fg); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tip { position: fixed; z-index: 90; pointer-events: none; min-width: 110px; background: #fff; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 10px; font-size: 11px; line-height: 1.5; box-shadow: var(--shadow-sm); opacity: 0; transition: opacity var(--press); }
.tip.on { opacity: 1; }
.tip b { display: block; font-weight: 600; }
.tip span { color: var(--muted-fg); }

/* ---------- 抽屉 ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgb(23 23 23 / .2); opacity: 0; pointer-events: none; transition: opacity var(--state) var(--ease-ios); }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(620px, 100%); background: #fff; border-left: 1px solid var(--border); box-shadow: -24px 0 60px -30px rgb(15 23 42 / .35); transform: translateX(102%); transition: transform .32s var(--ease-ios); display: flex; flex-direction: column; }
.drawer.on { transform: none; }
.dh { display: flex; align-items: center; gap: 8px; height: calc(52px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 10px 0 20px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 500; flex: none; }
.dh .x { margin-left: auto; width: 40px; height: 40px; }
.db { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 18px 20px 28px; }
.df { flex: none; display: flex; align-items: center; gap: 12px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: #fff; }
.df .tot { display: grid; line-height: 1.3; min-width: 0; }
.df .tot b { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.df .tot span { font-size: 11px; color: var(--muted-fg); }
.df .btn { margin-left: auto; }
.sec { margin-top: 22px; }
.sec:first-child { margin-top: 0; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.sec-h h4 { margin: 0; font-size: 12px; font-weight: 600; }
.sec-h .s { font-size: 11px; color: var(--muted-fg); }

/* 款式抽屉：图片条、可直接改的资料 */
.shots { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.shot { position: relative; width: 104px; height: 132px; border-radius: var(--r-md); background: var(--muted); flex: none; overflow: hidden; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot .cv { position: absolute; left: 6px; top: 6px; }
.shot.add { display: grid; align-content: center; justify-items: center; gap: 6px; border: 1px dashed #d4d4d4; background: #fff; color: var(--muted-fg); font-size: 12px; cursor: pointer; transition: border-color var(--press), color var(--press); }
.shot.add:hover { border-color: var(--foreground); color: var(--foreground); }
.shot.add .ic { width: 20px; height: 20px; }
.shot.add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.shot.busy::after { content: "上传中…"; position: absolute; inset: 0; display: grid; place-items: center; background: rgb(255 255 255 / .8); font-size: 12px; }
.pt { margin-top: 16px; }
.pt .nm { width: 100%; border: 0; padding: 2px 6px; margin-left: -6px; border-radius: 6px; font-family: var(--f-editorial); font-size: 24px; line-height: 1.3; outline: none; background: transparent; }
.inl { border: 0; padding: 2px 6px; border-radius: 6px; outline: none; background: transparent; transition: box-shadow var(--press), background-color var(--press); }
.inl:hover:not(:read-only), .pt .nm:hover:not(:read-only) { background: var(--muted); }
.inl:focus:not(:read-only), .pt .nm:focus:not(:read-only) { background: #fff; box-shadow: 0 0 0 1px var(--foreground); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; margin-top: 10px; }
.fact { display: flex; align-items: center; gap: 8px; min-height: 38px; border-top: 1px solid var(--line); font-size: 13px; }
.fact > span { width: 64px; flex: none; font-size: 12px; color: var(--muted-fg); }
.fact .inl { flex: 1; min-width: 0; height: 30px; margin-right: -6px; }
.fact.full { grid-column: 1 / -1; }

/* 颜色 × 尺码矩阵 */
.mxw { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
table.mx { border-collapse: collapse; width: 100%; font-size: 13px; }
.mx th, .mx td { padding: 0; height: 44px; text-align: center; border-top: 1px solid var(--line); border-left: 1px solid var(--line); min-width: 58px; }
.mx tr:first-child th { border-top: 0; height: 36px; font-size: 11px; font-weight: 500; color: var(--muted-fg); background: #fcfcfc; }
.mx th:first-child { position: sticky; left: 0; z-index: 1; border-left: 0; padding: 0 12px; text-align: left; font-weight: 500; white-space: nowrap; background: #fcfcfc; min-width: 76px; }
.mx td input { width: 100%; height: 43px; border: 0; background: transparent; text-align: center; font-variant-numeric: tabular-nums; outline: none; padding: 0 4px; -moz-appearance: textfield; transition: background-color var(--state); }
.mx td input::-webkit-outer-spin-button, .mx td input::-webkit-inner-spin-button { -webkit-appearance: none; }
.mx td input:focus { box-shadow: inset 0 0 0 1.5px var(--foreground); background: #fff; }
.mx td input:read-only { cursor: default; }
.mx td.z input { color: #b5b5b5; }
.mx td.neg input { color: var(--loss); font-weight: 600; }
.mx td.own input { font-weight: 600; }
.mx td.ok input { background: rgb(13 155 108 / .12); }
.mx td.err input { background: rgb(226 29 72 / .1); }
.mx .sum { background: #fcfcfc; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--foreground); }
.mx th .del { margin-left: 6px; color: var(--loss); font-size: 14px; line-height: 1; vertical-align: middle; }
/* 开单时点选的矩阵 */
.mx td.pick { padding: 0; }
.mx td.pick button { position: relative; width: 100%; height: 52px; display: grid; align-content: center; justify-items: center; line-height: 1.25; font-variant-numeric: tabular-nums; transition: background-color var(--press); }
.mx td.pick button:hover { background: var(--muted); }
.mx td.pick button:active { background: #e9e9e9; }
.mx td.pick button b { font-size: 14px; font-weight: 500; }
.mx td.pick button small { font-size: 10px; color: var(--muted-fg); }
.mx td.pick.sel button { background: var(--foreground); color: #fff; }
.mx td.pick.sel button small { color: rgb(255 255 255 / .7); }
.mx td.pick.z:not(.sel) button b { color: #b5b5b5; }

/* 单据编辑器 */
.form { display: grid; gap: 12px; }
.form.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form label, .lab { display: grid; gap: 4px; font-size: 11px; font-weight: 500; color: var(--muted-fg); min-width: 0; }
.form .full { grid-column: 1 / -1; }
.finput { width: 100%; height: 38px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: #fff; box-shadow: inset 0 0 0 1px var(--border); font-size: 14px; color: var(--foreground); outline: none; transition: box-shadow var(--press); min-width: 0; }
.finput:focus { box-shadow: inset 0 0 0 1.5px var(--foreground); }
textarea.finput { height: 64px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.pre { position: relative; }
.pre::before { content: "¥"; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted-fg); font-size: 13px; }
.pre .finput { padding-left: 24px; }
.pickl { display: grid; gap: 1px; margin-top: 8px; }
.pk { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: var(--r-sm); text-align: left; transition: background-color var(--press); }
.pk:hover { background: var(--muted); }
.pk .m { display: grid; min-width: 0; line-height: 1.35; }
.pk .m b { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk .m span { font-size: 11px; color: var(--muted-fg); }
.pk .q { margin-left: auto; font-size: 12px; color: var(--muted-fg); font-variant-numeric: tabular-nums; white-space: nowrap; }
.picked { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; margin-top: 8px; }
.picked .hd { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.lines { display: grid; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.ln { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 28px; align-items: center; gap: 8px; padding: 8px 6px 8px 12px; border-top: 1px solid var(--line); }
.ln:first-child { border-top: 0; }
.ln .m { display: grid; min-width: 0; line-height: 1.35; }
.ln .m b { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ln .m span { font-size: 11px; color: var(--muted-fg); }
.ln .m span.down { color: var(--loss); }
.step { display: inline-flex; align-items: center; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--border); }
.step button { width: 30px; height: 32px; font-size: 16px; color: var(--muted-fg); }
.step button:hover { color: var(--foreground); }
.step input { width: 38px; height: 32px; border: 0; background: transparent; text-align: center; font-variant-numeric: tabular-nums; outline: none; padding: 0; -moz-appearance: textfield; }
.step input::-webkit-outer-spin-button, .step input::-webkit-inner-spin-button { -webkit-appearance: none; }
.ln .pr { width: 84px; }
.ln .pr .finput { height: 32px; text-align: right; font-variant-numeric: tabular-nums; }
.tokens { display: flex; flex-wrap: wrap; gap: 6px; }
.tok { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; box-shadow: inset 0 0 0 1px var(--border); color: var(--muted-fg); transition: all var(--press); }
.tok:hover { color: var(--foreground); }
.tok.on { background: var(--foreground); color: #fff; box-shadow: none; }

/* ---------- 居中弹层 ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 70; display: none; align-items: center; justify-content: center; padding: 16px; background: rgb(23 23 23 / .28); }
.sheet-wrap.on { display: flex; }
.sheet { width: min(460px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: #fff; border-radius: 16px; box-shadow: 0 24px 60px -20px rgb(15 23 42 / .45); animation: viewIn var(--state) var(--ease-ios) both; }
.sheet.wide { width: min(560px, 100%); }
.sheet .sh { padding: 18px 20px 0; font-family: var(--f-serif); font-size: 17px; font-weight: 600; }
.sheet .sb { padding: 12px 20px 4px; overflow-y: auto; font-size: 13px; }
.sheet .sb > p { margin: 0 0 12px; color: var(--muted-fg); line-height: 1.6; }
.sheet .sf { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; }
.sheet .err, .login .err { margin: 10px 0 0; font-size: 12px; color: var(--loss); min-height: 18px; }
.viewer { position: fixed; inset: 0; z-index: 95; background: rgb(0 0 0 / .86); display: grid; grid-template-rows: 1fr auto; }
.viewer img { width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.viewer .va { display: flex; justify-content: center; gap: 10px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); }
.viewer .btn.ghost { color: #fff; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .35); }
.viewer .btn.ghost:hover { background: rgb(255 255 255 / .12); }
.toast { position: fixed; z-index: 99; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 12px); max-width: calc(100vw - 32px); padding: 9px 16px; border-radius: 999px; background: var(--foreground); color: #fff; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity var(--state) var(--ease-ios), transform var(--state) var(--ease-ios); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--loss); }

/* ---------- 登录 ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--sidebar); }
.login .box { width: min(360px, 100%); padding: 28px 24px 24px; }
.login .brand { font-size: 26px; gap: 10px; }
.login .brand svg { width: 30px; height: 30px; }
.login p { margin: 6px 0 20px; font-size: 13px; color: var(--muted-fg); }

/* 权限对照 */
.perm td, .perm th { text-align: center; }
.perm td:first-child, .perm th:first-child { text-align: left; }
.perm .y { color: var(--foreground); font-weight: 600; }
.perm .n { color: #c9c9c9; }

/* ---------- 手机 ---------- */
@media (max-width: 860px) {
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px !important; }  /* 小于 16px 的输入框获得焦点时 iOS 会放大整页 */
  .sidebar { position: sticky; top: 0; inset: auto; width: auto; flex-direction: row; align-items: center; gap: 8px; height: calc(52px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 12px 0 14px; border-right: 0; border-bottom: 1px solid var(--sidebar-border); background: rgb(250 250 250 / .92); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); }
  .sb-top { margin: 0; padding: 0; }
  .sb-group, .sb-nav { display: none; }
  .store-btn { width: auto; max-width: 46vw; min-height: 34px; margin: 0 0 0 auto; padding: 4px 10px; }
  .sb-foot { width: auto; margin: 0; padding: 4px; min-height: 0; }
  .sb-foot .acct-txt { display: none; }
  .sb-foot .avatar { width: 30px; height: 30px; font-size: 12px; }
  .main { margin-left: 0; min-height: 0; padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .page { padding: 18px 16px 32px; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); background: rgb(255 255 255 / .92); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); border-top: 1px solid rgb(229 229 229 / .8); }
  .tabbar a { height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 500; color: var(--muted-fg); }
  .tabbar .ic { width: 21px; height: 21px; }
  .tabbar a.on { color: var(--foreground); font-weight: 600; }
  .grid.c2, .grid.e2 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .v { font-size: 18px; }
  .search { width: 100%; }
  .bar .chips { flex-basis: 100%; }
  .bar .select { margin-left: auto; }
  .ph-act { width: 100%; }
  .ph-act .btn { flex: 1; height: 40px; }
  .drawer { width: 100%; border-left: 0; }
  .db { padding: 16px 16px 24px; }
  .df { padding-left: 16px; padding-right: 16px; }
  .hide-m { display: none !important; }
  .sheet-wrap { align-items: flex-end; padding: 0; }
  .sheet, .sheet.wide { width: 100%; max-height: 92dvh; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .menu { left: 12px !important; right: 12px; top: calc(58px + env(safe-area-inset-top, 0px)) !important; bottom: auto !important; width: auto; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .pt input.nm:not([type="checkbox"]):not([type="radio"]) { font-size: 22px !important; }
  .mx th, .mx td { min-width: 50px; }
  .mx th:first-child { min-width: 60px; padding: 0 10px; }
  .t td { padding-top: 10px; padding-bottom: 10px; }
  .chart { height: 160px; }
  .ln { grid-template-columns: minmax(0, 1fr) auto 28px; }
  .ln .m { grid-column: 1 / -1; }
  .ln .pr { width: auto; }
}
@media (min-width: 861px) { .only-m { display: none !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
