/* 手机版：沿用 app.css 的配色与组件，只重做布局 */
html, body { height: 100%; overflow: hidden; background: #E9E2D7; }
body { font-size: 15px; -webkit-tap-highlight-color: transparent; }
.m-app { max-width: 480px; height: 100%; height: 100dvh; margin: 0 auto; background: var(--bg); display: flex; flex-direction: column; position: relative; box-shadow: 0 0 40px rgba(0,0,0,.08); }
.m-view { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.m-view.flex { display: flex; flex-direction: column; overflow: hidden; }

/* 底部导航 */
.tabbar { flex: none; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; font-size: 11px; color: var(--muted); text-decoration: none; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.tabbar a.on { color: var(--amber); }
.m-app.sub .tabbar { display: none; }

/* 顶栏 */
.m-head { flex: none; position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 12px; background: rgba(244,239,231,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.m-head h1 { margin: 0; font: 600 17px var(--serif); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-head .back { width: 36px; height: 36px; border: 0; background: none; display: grid; place-items: center; margin-left: -6px; color: var(--ink); text-decoration: none; font-size: 26px; line-height: 1; }
.m-head .act { font-size: 13px; color: var(--amber); text-decoration: none; white-space: nowrap; }

.m-pad { padding: 14px 14px 24px; }
.m-sec { margin-top: 18px; }
.m-sec > h2 { display: flex; align-items: baseline; margin: 0 0 10px; font: 600 16px var(--serif); }
.m-sec > h2 a, .m-sec > h2 span { margin-left: auto; font: 13px var(--sans); color: var(--muted); text-decoration: none; }
.m-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }

/* 首页 */
.hero-dark { background: linear-gradient(160deg, #2A2019, #1C1714 70%); color: #E9DFD2; padding: calc(18px + env(safe-area-inset-top)) 18px 44px; border-radius: 0 0 22px 22px; position: relative; overflow: hidden; }
.hero-dark::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 1px solid rgba(200,146,90,.18); box-shadow: 0 0 0 30px rgba(200,146,90,.04); }
.hello { display: flex; align-items: center; gap: 10px; }
.hello .seal { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--amber-2), var(--amber)); color: #1C1714; display: grid; place-items: center; font: 700 17px var(--serif); }
.hello b { font: 600 16px var(--serif); color: #F4ECE1; }
.hello small { display: block; font-size: 12px; color: #9C8F81; }
.big { margin-top: 20px; }
.big .l { font-size: 13px; color: #A99C8E; }
.big .v { font: 600 38px/1.2 var(--serif); color: #F6EBDC; margin-top: 2px; }
.big .d { font-size: 13px; color: #8FC2A7; margin-top: 2px; }
.mini { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; }
.mini div { font-size: 12px; color: #9C8F81; }
.mini b { display: block; font: 600 18px var(--serif); color: #F1E6D8; margin-top: 2px; }
.mini b small { font: 11px var(--sans); color: #9C8F81; margin-left: 2px; }

.askbar { display: flex; align-items: center; gap: 10px; margin: -22px 14px 0; position: relative; z-index: 2; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 6px 20px rgba(42,33,27,.08); text-decoration: none; color: var(--muted); }
.askbar .orb { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--amber-2), var(--amber)); color: #fff; display: grid; place-items: center; flex: none; }
.askbar span { flex: 1; font-size: 14.5px; }
.qchips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 14px 2px; scrollbar-width: none; }
.qchips::-webkit-scrollbar { display: none; }
.qchips .chip { flex: none; font-size: 13px; padding: 7px 12px; text-decoration: none; }

.todo { display: flex; gap: 12px; align-items: center; padding: 13px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.todo:last-child { border-bottom: 0; }
.todo .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font: 600 14px var(--serif); flex: none; }
.todo .w { flex: 1; min-width: 0; }
.todo .w b { display: block; font-size: 14.5px; font-weight: 600; }
.todo .w span { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo .go { font-size: 12.5px; color: var(--amber); white-space: nowrap; }
.ic.danger { background: var(--danger-soft); color: var(--danger); }
.ic.warn { background: var(--warn-soft); color: #8F6216; }
.ic.jade { background: var(--jade-soft); color: var(--jade); }
.ic.plain { background: var(--surface-2); color: var(--ink-2); }

.agrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 6px; padding: 16px 8px; }
.agrid a { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); text-decoration: none; }
.agrid .glyph { width: 44px; height: 44px; border-radius: 13px; font-size: 18px; }
.m-bars { padding: 14px; }
.m-bars .bar-row { grid-template-columns: 62px 1fr 74px; font-size: 13px; }

/* 问 AI */
.agent-bar { flex: none; display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--bg); scrollbar-width: none; }
.agent-bar::-webkit-scrollbar { display: none; }
.agent-bar a { flex: none; display: flex; align-items: center; gap: 6px; padding: 5px 12px 5px 5px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--ink-2); text-decoration: none; }
.agent-bar a .glyph { width: 24px; height: 24px; border-radius: 50%; font-size: 12px; }
.agent-bar a.on { border-color: var(--amber-2); background: var(--amber-soft); color: #7A4F1E; font-weight: 600; }
.ai-desc { flex: none; padding: 8px 14px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.ai-desc > span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-desc .think-toggle { margin-left: auto; height: 28px; padding: 0 9px; font-size: 12px; border-radius: 999px; }
.m-chat { flex: 1; min-height: 0; }
.m-chat .chat-log { padding: 12px 12px 6px; gap: 12px; }
.m-chat .msg { max-width: 92%; }
.m-chat .bubble { font-size: 15px; padding: 10px 13px; border-radius: 14px; }
.m-chat .msg.ai .bubble { background: var(--surface); }
.m-chat .bubble table { font-size: 12.5px; }
.m-chat .chat-presets { flex-wrap: nowrap; overflow-x: auto; padding: 6px 12px 2px; scrollbar-width: none; }
.m-chat .chat-presets::-webkit-scrollbar { display: none; }
.m-chat .chat-presets .chip { flex: none; font-size: 13px; }
.m-chat .chat-input { padding: 8px 10px 10px; gap: 8px; background: var(--bg); }
.m-chat .chat-input textarea { scrollbar-width: none; font-size: 16px; min-height: 42px; border-radius: 21px; padding: 9px 14px; }
.m-chat .chat-input .send { height: 42px; border-radius: 21px; padding: 0 16px; }
.mic { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.mic.on { background: var(--danger); border-color: var(--danger); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(178,74,59,.5); } 100% { box-shadow: 0 0 0 12px rgba(178,74,59,0); } }

/* 库存 */
.search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.search input { flex: 1; border: 0; outline: none; background: none; font-size: 16px; min-width: 0; }
.stat3 { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; padding: 12px 0; }
.stat3 div { font-size: 12px; color: var(--muted); }
.stat3 div + div { border-left: 1px solid var(--line); }
.stat3 b { display: block; font: 600 20px var(--serif); color: var(--ink); }
.fchips { display: flex; gap: 8px; overflow-x: auto; margin: 12px -14px 0; padding: 0 14px; scrollbar-width: none; }
.fchips::-webkit-scrollbar { display: none; }
.fchips button { flex: none; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--ink-2); }
.fchips button.on { background: var(--ink); color: #F4ECE1; border-color: var(--ink); }
.icard { display: flex; gap: 12px; padding: 12px; margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: inherit; }
.icard .thumb { width: 72px; height: 72px; border-radius: 10px; }
.icard .w { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.icard b { font-size: 15px; font-weight: 600; line-height: 1.4; }
.icard .mono { color: var(--muted); font-size: 11.5px; }
.icard .tags { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.icard .tags .tag { font-size: 11px; padding: 0 6px; }
.icard .row { display: flex; align-items: baseline; margin-top: auto; padding-top: 4px; }
.icard .price { font: 600 16px var(--serif); color: var(--amber); }
.icard .qty { margin-left: auto; font-size: 12px; color: var(--muted); }
.alert-strip { display: flex; gap: 10px; align-items: center; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-size: 13px; text-decoration: none; }
.alert-strip span { flex: 1; }

/* 详情 */
.d-hero { height: 220px; position: relative; }
.d-hero .stamp { position: absolute; left: 16px; right: 16px; bottom: 16px; color: #F3E3CC; font: 600 21px/1.35 var(--serif); text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.d-hero .stamp small { display: block; font: 12.5px var(--sans); opacity: .85; margin-top: 4px; }
.d-price { display: flex; align-items: baseline; gap: 10px; padding: 14px 16px; }
.d-price b { font: 600 26px var(--serif); color: var(--amber); }
.m-card .kv { margin: 0; border: 0; border-radius: 0; }
.m-card .kv div { font-size: 14px; }
.m-card .timeline { padding: 14px 16px 2px; margin: 0; }
.m-card h3 { margin: 0; padding: 14px 16px 0; font: 600 15px var(--serif); }
.actions2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions2 a { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; color: var(--ink); text-decoration: none; }
.actions2 a.pri { background: var(--ink); color: #F4ECE1; border-color: var(--ink); }

/* 合规 */
.m-ta { width: 100%; min-height: 130px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 16px; line-height: 1.7; background: var(--surface); outline: none; resize: vertical; }
.m-ta:focus { border-color: var(--amber-2); }
.scan-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.scan-head .ring { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font: 600 18px var(--serif); flex: none; }
.scan-head b { font-size: 15px; }
.scan-head div div { font-size: 12.5px; color: var(--muted); }
.m-card .marked { border: 0; border-radius: 0; background: none; font-size: 15px; }
.risk-row { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; padding: 9px 14px; border-top: 1px dashed var(--line); font-size: 13.5px; }
.risk-row > span:nth-child(2) { flex: 1; min-width: 0; }
.risk-row .basis { flex-basis: 100%; font-size: 11.5px; color: var(--muted); }
.big-btn { display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px; height: 48px; border-radius: 14px; border: 0; background: var(--amber); color: #fff; font-size: 16px; font-weight: 600; }
.big-btn:disabled { opacity: .6; }
.ai-out { padding: 14px; font-size: 15px; line-height: 1.75; }
.ai-out table { font-size: 12.5px; }

/* 更多 */
.alist a { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.alist a:last-child { border-bottom: 0; }
.alist .w { flex: 1; min-width: 0; }
.alist b { display: block; font-size: 15px; font-weight: 600; }
.alist span { display: block; font-size: 12.5px; color: var(--muted); }
.alist .arr { color: var(--muted); font-size: 18px; }
.foot-note { text-align: center; font-size: 11.5px; color: var(--muted); line-height: 1.8; margin-top: 18px; }
