* { box-sizing: border-box; margin: 0; padding: 0; }
:root{
  --bg:#f4f6fb; --card:#fff; --primary:#2563eb; --primary-d:#1d4fd8; --primary-soft:#eef4ff;
  --green:#16a34a; --red:#dc2626; --amber:#d97706;
  --text:#1f2937; --muted:#6b7280; --line:#eceff4;
  /* 统一圆角 / 阴影 / 焦点环 / 过渡,供各组件复用,保证整体风格一致 */
  --radius:12px; --radius-sm:8px; --radius-lg:16px;
  --shadow-sm:0 1px 2px rgba(16,24,40,.05);
  --shadow:0 4px 16px rgba(16,24,40,.07);
  --shadow-lg:0 18px 50px rgba(15,23,42,.18);
  --ring:0 0 0 3px rgba(37,99,235,.16);
  --ease:.18s cubic-bezier(.4,0,.2,1);
}
body{ font-family:-apple-system,"PingFang SC","Microsoft YaHei",Segoe UI,sans-serif;
  background:var(--bg); color:var(--text); font-size:14px;
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; }
::selection{ background:rgba(37,99,235,.16); }
/* 更细的滚动条,贴合整体清爽风格 */
*::-webkit-scrollbar{ width:10px; height:10px; }
*::-webkit-scrollbar-thumb{ background:#d3dae6; border-radius:6px;
  border:2px solid transparent; background-clip:content-box; }
*::-webkit-scrollbar-thumb:hover{ background:#b9c2d0; background-clip:content-box; }
#app{ display:flex; min-height:100vh; }

/* 侧边栏(亮色清爽) */
.sidebar{ width:228px; background:#ffffff; color:#475569; display:flex;
  flex-direction:column; position:fixed; height:100vh; border-right:1px solid var(--line); }
.brand{ font-size:18px; font-weight:800; color:#0f172a; padding:20px 18px 16px;
  border-bottom:1px solid #f1f5f9; }
.brand span{ display:block; font-size:12px; color:#94a3b8; font-weight:400; margin-top:3px; }
#nav{ flex:1; padding:10px 8px; overflow-y:auto; -webkit-overflow-scrolling:touch; }
#nav a{ position:relative; display:block; padding:10px 14px; border-radius:9px; color:#475569;
  cursor:pointer; margin-bottom:2px; font-size:14px; transition:.15s; }
#nav a:hover{ background:#f1f5f9; color:#0f172a; }
#nav a.active{ background:var(--primary-soft); color:var(--primary); font-weight:600; }
#nav a.active::before{ content:''; position:absolute; left:0; top:8px; bottom:8px;
  width:3px; border-radius:0 3px 3px 0; background:var(--primary); }
.side-foot{ padding:14px 18px; font-size:11px; color:#94a3b8; border-top:1px solid #f1f5f9; }

/* 主区 */
.content{ flex:1; margin-left:228px; padding:0 28px 28px; }

/* 顶部面包屑栏 */
.appbar{ position:sticky; top:0; z-index:30; height:58px; display:flex; align-items:center;
  gap:12px; margin:0 -28px 22px; padding:0 28px;
  background:rgba(255,255,255,.85); backdrop-filter:blur(10px); border-bottom:1px solid var(--line); }
.appbar .crumb{ font-size:15px; color:var(--muted); display:flex; align-items:center; gap:6px; }
.appbar .crumb b{ color:#0f172a; font-weight:700; }
.appbar .spacer{ flex:1; }
.appbar .ab-btn{ font-size:13px; color:var(--muted); background:#f1f5f9; border:none;
  padding:7px 13px; border-radius:8px; cursor:pointer; text-decoration:none; }
.appbar .ab-btn:hover{ background:#e6ebf2; color:#0f172a; }

/* 列宽可拖拽 */
#view th{ position:relative; }
.col-resize{ position:absolute; top:0; right:0; width:8px; height:100%;
  cursor:col-resize; user-select:none; touch-action:none; z-index:2; }
.col-resize:hover{ background:linear-gradient(90deg,transparent,var(--primary)); opacity:.5; }
#view td{ overflow:hidden; text-overflow:ellipsis; }
/* 紧凑模式:更小的内边距与字号,一屏看更多 */
body.compact #view table{ line-height:1.2; }
body.compact #view th, body.compact #view td{ padding:4px 8px; font-size:12px; }
body.compact .panel{ padding:12px; }
body.compact .page-sub{ margin-bottom:8px; }

.page-title{ font-size:20px; font-weight:700; margin-bottom:4px; }
.page-sub{ color:var(--muted); margin-bottom:18px; font-size:13px; }

/* KPI 卡片 */
.cards{ display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
  gap:16px; margin-bottom:22px; }
.kpi{ position:relative; overflow:hidden; background:var(--card); border:1px solid var(--line);
  border-radius:var(--radius); padding:17px 20px; box-shadow:var(--shadow-sm); transition:var(--ease); }
.kpi::before{ content:''; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--primary); opacity:.85; }
.kpi:hover{ box-shadow:var(--shadow); transform:translateY(-2px); }
.kpi .label{ color:var(--muted); font-size:13px; }
.kpi .num{ font-size:26px; font-weight:800; margin-top:8px; letter-spacing:-.5px; }
.kpi .num.green{ color:var(--green); } .kpi .num.red{ color:var(--red); }
.kpi .num.amber{ color:var(--amber); }

.panel{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); padding:18px 20px;
  box-shadow:var(--shadow-sm); margin-bottom:18px; }
.panel h3{ font-size:15px; margin-bottom:14px; padding-bottom:11px; border-bottom:1px solid #f1f5f9; }

/* 工具条 */
.toolbar{ display:flex; gap:10px; align-items:center; flex-wrap:wrap;
  margin-bottom:14px; }
.toolbar .spacer{ flex:1; }

/* 表格 */
table{ width:100%; border-collapse:collapse; }
th,td{ text-align:left; padding:11px 14px; border-bottom:1px solid var(--line);
  font-size:13px; }
th{ color:#64748b; font-weight:600; background:#f8fafc; position:sticky; top:0;
  letter-spacing:.2px; }
tbody tr:nth-child(even) td{ background:#fcfdff; }
tbody tr:hover td{ background:var(--primary-soft); }
td.num,th.num{ text-align:right; font-variant-numeric:tabular-nums; }
td.sel,th.sel{ width:42px; text-align:center; padding-left:10px; padding-right:10px; }
td.sel input,th.sel input{ width:auto; }
.empty{ text-align:center; color:var(--muted); padding:40px; }

/* 标签 */
.tag{ display:inline-block; padding:2px 9px; border-radius:20px; font-size:12px; }
.tag.in{ background:#dcfce7; color:#15803d; }
.tag.out{ background:#fee2e2; color:#b91c1c; }
.tag.pdd{ background:#fee2e2; color:#dc2626; }
.tag.taobao{ background:#ffedd5; color:#ea580c; }
.tag.offline{ background:#e5e7eb; color:#374151; }
.tag.raw{ background:#e0e7ff; color:#4338ca; }
.tag.finished{ background:#d1fae5; color:#047857; }
.tag.warn{ background:#fef3c7; color:#b45309; }

/* 按钮 */
button,.btn{ font-family:inherit; font-size:13px; font-weight:500; padding:8px 15px;
  border:1px solid #e2e8f0; border-radius:var(--radius-sm); cursor:pointer;
  background:#fff; color:#334155; transition:var(--ease); }
button:hover{ background:#f8fafc; border-color:#cbd5e1; }
button:active{ transform:translateY(1px); }
button:focus-visible,.btn:focus-visible{ outline:none; box-shadow:var(--ring); }
button:disabled{ opacity:.45; cursor:not-allowed; background:#f8fafc; transform:none; }
.btn-primary{ background:var(--primary); color:#fff; border-color:var(--primary);
  box-shadow:0 1px 2px rgba(37,99,235,.25); }
.btn-primary:hover{ background:var(--primary-d); border-color:var(--primary-d); }
.btn-danger{ background:#fff; color:var(--red); border:1px solid #fca5a5; }
.btn-danger:hover{ background:#fef2f2; border-color:#f87171; }
.btn-sm{ padding:5px 10px; font-size:12px; }
.btn-link{ background:none; border:none; color:var(--primary); padding:4px 8px; }
.btn-link:hover{ background:var(--primary-soft); }

/* 表单 */
input,select,textarea{ font-family:inherit; font-size:13px; padding:9px 11px;
  border:1px solid #dfe3ea; border-radius:var(--radius-sm); background:#fff;
  width:100%; transition:var(--ease); }
input:focus,select:focus,textarea:focus{ outline:none; border-color:var(--primary);
  box-shadow:var(--ring); }
input:hover:not(:focus),select:hover:not(:focus),textarea:hover:not(:focus){ border-color:#c7ccd6; }
.field{ margin-bottom:13px; }
.field label{ display:block; font-size:12px; color:var(--muted); margin-bottom:5px; }
.grid2{ display:grid; grid-template-columns:1fr 1fr; gap:13px; }
.inline-search{ max-width:220px; }
.inline-select{ width:auto; min-width:120px; }

/* 弹窗 */
.modal-mask{ position:fixed; inset:0; background:rgba(15,23,42,.45);
  display:flex; align-items:flex-start; justify-content:center; padding-top:6vh;
  z-index:50; }
.modal-mask.hidden{ display:none; }
.modal{ background:#fff; border-radius:var(--radius-lg); width:520px; max-width:92vw;
  max-height:86vh; overflow:auto; box-shadow:var(--shadow-lg);
  animation:modal-in .18s cubic-bezier(.4,0,.2,1); }
@keyframes modal-in{ from{ opacity:0; transform:translateY(8px) scale(.99); } to{ opacity:1; transform:none; } }
.modal-head{ display:flex; justify-content:space-between; align-items:center;
  padding:16px 20px; border-bottom:1px solid var(--line); font-weight:700; }
.modal-close{ background:none; font-size:16px; color:var(--muted); padding:2px 6px; }
.modal-body{ padding:18px 20px; }
.modal-actions{ display:flex; justify-content:flex-end; gap:10px; margin-top:8px; }

/* 提示 */
.toast{ position:fixed; top:18px; right:24px; background:#0f172a; color:#fff;
  padding:11px 18px; border-radius:9px; opacity:0; transform:translateY(-8px);
  transition:.25s; z-index:99; pointer-events:none; }
.toast.show{ opacity:1; transform:translateY(0); }
.toast.err{ background:var(--red); }

/* 顶部移动栏(默认隐藏,手机显示) */
.topbar{ display:none; align-items:center; gap:12px; background:#0f172a;
  color:#fff; padding:11px 14px; border-radius:10px; margin-bottom:14px;
  position:sticky; top:8px; z-index:40; }
.topbar .hb{ background:rgba(255,255,255,.15); color:#fff; font-size:18px;
  border:none; border-radius:8px; padding:4px 13px; line-height:1; }
.topbar-title{ font-weight:700; font-size:15px; }
.nav-mask{ display:none; }

/* ===== 手机端适配 ===== */
@media(max-width:768px){
  .sidebar{ transform:translateX(-100%); transition:transform .25s;
    z-index:100; box-shadow:6px 0 24px rgba(0,0,0,.3); }
  .sidebar.open{ transform:translateX(0); }
  .content{ margin-left:0; padding:14px;
    padding-top:calc(14px + env(safe-area-inset-top)); }
  .appbar{ display:none; }
  .topbar{ display:flex; }
  .nav-mask{ position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:90; }
  .nav-mask.show{ display:block; }
  #nav a{ padding:13px 14px; font-size:15px; }
  .grid2{ grid-template-columns:1fr; }
  .page-title{ font-size:18px; }
  /* 宽表格横向滑动,不挤压 */
  .panel{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
  table{ white-space:nowrap; }
  /* 弹窗占满屏宽 */
  .modal{ width:94vw; }
  .modal-mask{ padding-top:3vh; align-items:flex-start; }
  /* 工具条按钮换行更友好 */
  .toolbar{ gap:8px; }
  .toolbar .inline-search, .toolbar .inline-select{ flex:1; min-width:0; max-width:none; }
  .kpi .num{ font-size:22px; }
}

/* ===== 养成小鸡 ===== */
.chick-game{ display:grid; grid-template-columns:1fr 360px; gap:20px; }
.chick-stage{ background:linear-gradient(#bfe9ff,#eafff0); border-radius:16px;
  padding:24px; text-align:center; position:relative; overflow:hidden;
  min-height:380px; display:flex; flex-direction:column; align-items:center;
  justify-content:center; }
.chick-stage .sun{ position:absolute; top:18px; right:22px; width:52px; height:52px;
  background:#ffe169; border-radius:50%; box-shadow:0 0 28px #ffe16988; }
.chick-stage .cloud{ position:absolute; width:70px; height:24px; background:#fff;
  border-radius:20px; opacity:.85; animation:drift 14s linear infinite; }
@keyframes drift{ from{transform:translateX(-90px)} to{transform:translateX(640px)} }
.chick{ width:190px; height:190px; animation:bob 2.6s ease-in-out infinite; cursor:pointer; z-index:2; }
@keyframes bob{ 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }
.chick.hop{ animation:hop .5s; }
@keyframes hop{ 0%{transform:translateY(0)} 30%{transform:translateY(-38px) scaleX(1.06)} 55%{transform:translateY(0)} 72%{transform:translateY(-13px)} 100%{transform:translateY(0)} }
.chick .eye{ transform-origin:center; transform-box:fill-box; animation:blink 4.2s infinite; }
@keyframes blink{ 0%,95%,100%{transform:scaleY(1)} 97%{transform:scaleY(.1)} }
.chick-name{ font-size:20px; font-weight:800; margin-top:12px; color:#4a3b00; }
.lvbar{ height:10px; background:#ffffff88; border-radius:6px; overflow:hidden; margin:8px auto 0; width:200px; }
.lvbar>i{ display:block; height:100%; background:#ffb300; transition:width .4s; }
.bubble{ position:absolute; top:14px; left:50%; transform:translateX(-50%);
  background:#fff; border:2px solid #ffd24d; border-radius:16px; padding:10px 16px;
  max-width:78%; font-size:14px; box-shadow:0 6px 16px rgba(0,0,0,.1); z-index:3; }
.chick-panel .stat{ margin:12px 0; }
.chick-panel .stat .lab{ display:flex; justify-content:space-between; font-size:13px; margin-bottom:4px; color:var(--muted); }
.chick-panel .bar{ height:14px; background:#f0f0f0; border-radius:8px; overflow:hidden; }
.chick-panel .bar>i{ display:block; height:100%; transition:width .4s; }
.acts{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:14px 0; }
.acts button{ padding:13px; font-size:15px; border-radius:12px; border:none; background:#fff7e0; cursor:pointer; }
.acts button:hover{ background:#ffefc2; }
.qa-row{ display:flex; gap:8px; }
.feed-times{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
@media(max-width:768px){ .chick-game{ grid-template-columns:1fr; } }

/* ===== 牧场场景(类蚂蚁庄园风格 2D)===== */
.farm{ position:relative; height:440px; border-radius:18px; overflow:hidden;
  background:linear-gradient(#8fd0f4 0%,#bfeaff 50%,#86cf5a 50%,#5fb344 100%); }
.farm.night{ background:linear-gradient(#15244e 0%,#2a3e72 50%,#3c7a45 50%,#2c6238 100%); }
.farm .star{ position:absolute; width:3px; height:3px; background:#fff; border-radius:50%;
  opacity:.85; animation:twinkle 2.5s infinite; }
@keyframes twinkle{ 0%,100%{opacity:.3} 50%{opacity:1} }
.sky-obj{ position:absolute; top:24px; right:38px; width:52px; height:52px; border-radius:50%; }
.sky-obj.sun{ background:#ffe169; box-shadow:0 0 34px #ffe169cc; }
.sky-obj.moon{ background:#f2f5ff; box-shadow:0 0 26px #ffffff99; }
.farm .cloud{ position:absolute; background:#fff; height:22px; width:64px; border-radius:20px;
  opacity:.9; animation:drift 18s linear infinite; }
.farm .deco{ position:absolute; user-select:none; pointer-events:none; }
.farm .hut{ left:5%; bottom:42%; font-size:78px; }
.farm .tree1{ right:8%; bottom:44%; font-size:64px; }
.farm .tree2{ right:22%; bottom:46%; font-size:46px; }
.farm .apple{ left:1%; bottom:30%; font-size:50px; }
.farm-info{ position:absolute; top:12px; left:14px; z-index:6; color:#fff;
  text-shadow:0 1px 4px rgba(0,0,0,.4); }
.farm-info b{ font-size:17px; }
.farm-info .lvbar{ width:150px; margin:6px 0 0 0; background:#ffffff55; }
.walker{ position:absolute; bottom:5%; left:42%; width:120px; z-index:5; cursor:pointer;
  transition:left 2.6s cubic-bezier(.37,0,.63,1), width .5s; transform-origin:bottom center; }
.walker::after{ content:''; position:absolute; left:50%; bottom:-4px; width:58%; height:12px;
  background:rgba(0,0,0,.18); border-radius:50%; transform:translateX(-50%); filter:blur(2px); z-index:-1; }
.walker .inner{ animation:bob 2.8s ease-in-out infinite; }
.walker.moving .inner{ animation:waddle .42s ease-in-out infinite; }
@keyframes waddle{ 0%,100%{transform:rotate(-5deg) translateY(0)} 50%{transform:rotate(5deg) translateY(-3px)} }
.walker .inner.hop{ animation:hop .6s cubic-bezier(.28,.84,.42,1); }
.farm .bubble{ top:12px; max-width:60%; left:50%; }
.food-drop{ position:absolute; font-size:26px; z-index:6; animation:drop 1s ease-in forwards; }
@keyframes drop{ 0%{transform:translateY(-60px);opacity:0} 30%{opacity:1} 100%{transform:translateY(0);opacity:0} }
.walker .inner.peck{ animation:peck .55s ease-in-out; }
@keyframes peck{ 0%,100%{transform:translateY(0) rotate(0)} 40%{transform:translateY(10px) rotate(10deg)} 70%{transform:translateY(2px) rotate(2deg)} }
.confetti{ position:absolute; top:-24px; z-index:7; animation:fall linear forwards; pointer-events:none; }
@keyframes fall{ to{ transform:translateY(480px) rotate(380deg); opacity:.2; } }
.farm{ cursor:pointer; }
/* 屋内场景 */
.farm.house{ background:linear-gradient(#f1ddbb 0%,#f1ddbb 54%,#c79a6a 54%,#b07f4f 100%); }
.farm.house .window{ position:absolute; top:34px; left:9%; width:96px; height:74px;
  background:linear-gradient(#bfe9ff,#dff3ff); border:6px solid #fff; border-radius:8px;
  box-shadow:inset 0 0 0 2px #cbd5e1; }
.farm.house .lamp{ position:absolute; top:6px; right:16%; font-size:30px; }
.farm .bed{ position:absolute; right:7%; bottom:7%; font-size:96px; user-select:none; }
.farm .foodbowl{ position:absolute; left:6%; bottom:6%; width:70px; height:46px; z-index:4; cursor:pointer; }
.foodbowl .fb-food{ position:absolute; left:12px; right:12px; bottom:18px; height:0; opacity:0; z-index:1;
  background:radial-gradient(circle at 50% 30%, #ffe680, #f3b000); border-radius:50%;
  box-shadow:inset 0 -2px 3px rgba(0,0,0,.12); transition:height .45s ease, opacity .3s; }
.foodbowl .fb-front{ position:absolute; left:0; right:0; bottom:0; height:30px; z-index:2;
  background:linear-gradient(#eef3f8,#bcc7d3); border:2px solid #8c9aa8; border-radius:10px 10px 42px 42px; }
.foodbowl .fb-front::before{ content:''; position:absolute; left:-3px; right:-3px; top:-7px; height:13px;
  background:#dde4ec; border:2px solid #8c9aa8; border-radius:50%; }
.foodbowl .bowl-amt{ position:absolute; top:-15px; left:50%; transform:translateX(-50%); z-index:3;
  font-size:11px; background:#fff; color:#b45309; border-radius:10px; padding:0 7px; font-weight:700; white-space:nowrap; }
.walker.lying{ transform:rotate(80deg) !important; transition:left .6s ease, bottom .6s ease, transform .6s ease; }
.walker.lying .inner{ animation:none; }
@media(max-width:768px){ .farm{ height:360px; } .farm .bed{ font-size:74px; } }

/* 登录页 */
.login-mask{ position:fixed; inset:0; display:flex; align-items:center;
  justify-content:center; z-index:200;
  background:radial-gradient(1200px 600px at 50% -10%,#1e3a5f 0%,#0f172a 60%); }
.login-box{ position:relative; background:#fff; border-radius:var(--radius-lg);
  padding:38px 32px 30px; width:344px; max-width:90vw; box-shadow:var(--shadow-lg);
  text-align:center; animation:modal-in .22s cubic-bezier(.4,0,.2,1); overflow:hidden; }
.login-box::before{ content:''; position:absolute; left:0; right:0; top:0; height:4px;
  background:linear-gradient(90deg,var(--primary),#38bdf8); }
.login-logo{ font-size:21px; font-weight:800; letter-spacing:-.3px; }
.login-sub{ color:var(--muted); font-size:13px; margin:6px 0 22px; }
.login-box input{ margin-bottom:14px; }
.login-box .btn-primary{ box-shadow:0 4px 14px rgba(37,99,235,.3); }
.login-err{ color:var(--red); font-size:13px; margin-top:10px; min-height:18px; }

/* BOM 行 */
.bom-row{ display:grid; grid-template-columns:1fr 90px 36px; gap:8px;
  align-items:center; margin-bottom:8px; }
.muted{ color:var(--muted); }
.bar{ height:8px; background:#eef2f7; border-radius:5px; overflow:hidden; margin-top:6px; }
.bar > i{ display:block; height:100%; background:var(--primary); }
.hint{ background:#f0f9ff; border:1px solid #bae6fd; color:#0369a1;
  padding:10px 12px; border-radius:8px; font-size:12px; margin-bottom:12px; }
.shortage{ background:#fef2f2; border:1px solid #fecaca; color:#b91c1c;
  padding:10px 12px; border-radius:8px; font-size:13px; margin-top:10px; }
.ledger-check{ padding:12px 14px; border-radius:9px; margin:12px 0;
  line-height:1.8; }
.ledger-check.ok{ background:#ecfdf5; border:1px solid #86efac; color:#166534; }
.ledger-check.bad{ background:#fef2f2; border:1px solid #fecaca; color:#b91c1c; }
.ledger-table-wrap{ overflow-x:auto; margin-bottom:12px; }
.ledger-table-wrap table{ min-width:760px; }
.voucher-toolbar{ display:flex; gap:10px; margin-bottom:14px; flex-wrap:wrap; }
.voucher-paper{ background:#fff; border:1px solid #cbd5e1; padding:28px 34px 20px;
  box-shadow:0 3px 12px rgba(15,23,42,.08); min-width:760px; }
.voucher-heading{ position:relative; display:flex; justify-content:center; align-items:flex-end;
  min-height:58px; margin-bottom:8px; }
.voucher-heading h1{ margin:0; font-size:28px; font-weight:500; letter-spacing:5px;
  border-bottom:3px double #64748b; padding:0 16px 5px; }
.voucher-period{ position:absolute; left:0; bottom:4px; color:var(--muted); }
.voucher-attachments{ position:absolute; right:0; bottom:0; display:flex;
  align-items:center; gap:5px; }
.voucher-attachments input{ width:58px; text-align:center; }
.voucher-meta{ display:flex; gap:22px; align-items:center; margin:10px 0; }
.voucher-meta label{ display:flex; gap:7px; align-items:center; white-space:nowrap; }
.voucher-meta select{ width:70px; }
.voucher-meta input{ width:92px; }
.voucher-meta input[type=date]{ width:145px; }
.voucher-grid-wrap{ overflow-x:auto; }
.voucher-grid{ border-collapse:collapse; min-width:980px; border:1px solid #475569; }
.voucher-grid th,.voucher-grid td{ border:1px solid #94a3b8; padding:0; }
.voucher-grid th{ text-align:center; background:#f8fafc; height:43px; }
.voucher-grid td{ height:76px; }
.voucher-grid input{ border:0; border-radius:0; height:100%; min-height:64px;
  background:transparent; }
.voucher-grid input:focus{ box-shadow:inset 0 0 0 2px var(--primary); }
.voucher-account-box{ position:relative; z-index:1; }
.voucher-line:focus-within .voucher-account-box{ z-index:30; }
.voucher-grid .voucher-account{ min-height:38px; height:38px; font-weight:600;
  padding-right:30px; background:#fff; }
.voucher-account-box::after{ content:'⌄'; position:absolute; right:10px; top:8px;
  color:#64748b; pointer-events:none; }
.voucher-account-picker{ display:none;
  max-height:260px; overflow-y:auto; background:#fff; border:1px solid #64748b;
  box-shadow:0 8px 20px rgba(15,23,42,.18); z-index:60; }
.voucher-account-picker.show{ display:block; }
.voucher-account-floating{ position:fixed; z-index:500; right:auto; bottom:auto; }
.voucher-account-floating{ overscroll-behavior:contain; scrollbar-gutter:stable; }
.voucher-account-option{ width:100%; min-height:42px; display:flex; align-items:center;
  justify-content:space-between; gap:12px; padding:7px 10px; border:0;
  border-bottom:1px solid #eef2f7; border-radius:0; background:#fff;
  text-align:left; color:#1e293b; }
.voucher-account-option:hover,.voucher-account-option:focus{ background:#eff6ff; }
.voucher-account-option span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.voucher-account-option small{ flex:none; color:#94a3b8; font-size:11px; }
.voucher-account-empty{ padding:16px; color:#94a3b8; text-align:center; }
.voucher-grid .voucher-aux{ min-height:27px; height:27px; padding-top:3px;
  border-top:1px dashed #cbd5e1; color:#475569; font-size:12px; }
.voucher-grid .voucher-aux.hidden{ display:none; }
.voucher-aux-row{ display:flex; align-items:stretch; border-top:1px dashed #cbd5e1; }
.voucher-aux-row .voucher-aux{ flex:1; border:0; min-height:29px; height:29px; }
.voucher-aux-add{ white-space:nowrap; padding:2px 7px; border-left:1px solid #e2e8f0; }
.voucher-line-balance{ min-height:22px; padding:3px 9px; border-top:1px dotted #e2e8f0;
  background:#f8fafc; color:#475569; font-size:11px; line-height:1.4; }
.voucher-line-balance b{ color:#0f766e; }
.voucher-balance-loading{ color:#94a3b8; }
.voucher-money-box{ height:100%; min-height:75px; display:flex; align-items:center;
  background:repeating-linear-gradient(90deg,#fff 0,#fff 31px,#e2e8f0 32px);
  position:relative; }
.voucher-money-box>span{ color:#94a3b8; padding-left:8px; font-size:13px; }
.voucher-grid .voucher-money{ font-size:19px; font-variant-numeric:tabular-nums;
  min-width:160px; text-align:right; padding:0 12px 0 4px; letter-spacing:.3px; }
.voucher-grid .voucher-money::placeholder{ color:#cbd5e1; }
.voucher-grid .voucher-money:focus{ background:#fffceb; }
.voucher-seq{ text-align:center; color:var(--muted); width:44px; }
.voucher-del{ font-size:20px; color:#94a3b8; width:100%; }
.voucher-grid tfoot td{ height:48px; padding:8px 12px; font-weight:700;
  background:#f8fafc; }
.voucher-add-line{ margin-top:10px; background:#fff; border:1px dashed #94a3b8;
  color:#475569; }
.voucher-maker{ margin-top:14px; color:#475569; }
.voucher-balanced{ color:#15803d; margin-left:10px; }
.voucher-unbalanced{ color:#dc2626; margin-left:10px; }
.voucher-warning{ margin:14px 0; color:#dc2626; font-size:13px; }
.voucher-bottom-actions{ display:flex; gap:10px; justify-content:flex-end; }
.fixed-assets-table{ overflow-x:auto; }
.fixed-assets-table table{ min-width:1180px; }
.settings-two{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.fin-tabs button{ min-width:105px; }
.fin-filter{ padding:12px 16px; }
.fin-checks{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:14px; }
.fin-check{ padding:9px 12px; border-radius:9px; font-size:13px; }
.fin-check.ok{ background:#ecfdf5; color:#166534; border:1px solid #86efac; }
.fin-check.bad{ background:#fff7ed; color:#9a3412; border:1px solid #fdba74; }
.fin-check span{ margin-left:8px; }
.fin-two{ display:grid; grid-template-columns:1fr 1fr; gap:16px; align-items:start; }
.fin-statement{ overflow-x:auto; }
.fin-statement table{ min-width:560px; }
.fin-wide{ overflow-x:auto; }
.fin-wide table{ min-width:1180px; }
.fin-total td{ font-weight:600; background:#f8fafc; }
.fin-grand td{ font-weight:700; background:#eef2ff; border-top:2px solid #c7d2fe; }
.fin-pending-row{ display:grid; grid-template-columns:minmax(260px,1fr) minmax(220px,360px) auto;
  gap:10px; align-items:center; padding:10px 0; border-bottom:1px solid var(--line); }
@media(max-width:980px){ .fin-two{ grid-template-columns:1fr; } }
@media(max-width:1100px){ .settings-two{ grid-template-columns:1fr; } }
@media(max-width:768px){
  .voucher-paper{ min-width:720px; padding:22px 20px; }
  .fin-pending-row{ grid-template-columns:1fr; }
  .fin-tabs button{ flex:1; min-width:135px; }
}

/* 防伪编码 */
.verify-config{ padding:12px 14px; border-radius:9px; margin-bottom:14px;
  font-size:13px; }
.verify-config.ok{ background:#ecfdf5; border:1px solid #86efac; color:#166534; }
.verify-config.warn{ background:#fff7ed; border:1px solid #fdba74; color:#9a3412; }
.verify-thumb{ width:64px; height:64px; object-fit:cover; border-radius:7px;
  border:1px solid var(--line); background:#fff; }
.verify-code-thumb{ width:72px; height:72px; object-fit:contain; border-radius:7px;
  border:1px solid var(--line); background:#fff; }
.verify-image-preview{ min-height:100px; display:flex; align-items:center;
  justify-content:center; margin-top:8px; padding:10px; border:1px dashed var(--line);
  border-radius:8px; color:var(--muted); }
.verify-image-preview img{ display:block; max-width:100%; max-height:240px;
  border-radius:8px; }

/* ============================================================
   手机端记账体验增强(全页面通用)
   只用 CSS,不改业务结构;放在文件末尾,确保覆盖前面的移动规则。
   ============================================================ */
@media(max-width:768px){
  html{ -webkit-text-size-adjust:100%; }
  body{ overflow-x:hidden; }              /* 杜绝整页被宽内容撑出横向滚动 */
  button,.btn,a,#nav a,.ab-btn{ -webkit-tap-highlight-color:transparent; }

  /* 触摸目标更大;输入框 16px 防 iOS 聚焦时自动放大页面 */
  input,select,textarea{ font-size:16px; min-height:44px; }
  button,.btn{ min-height:42px; padding:10px 16px; }
  .btn-sm{ min-height:36px; padding:7px 12px; }
  .btn-link{ min-height:auto; }
  .modal-close{ min-width:40px; min-height:40px; font-size:20px; }
  td.sel input,th.sel input{ width:20px; height:20px; }

  /* 顶部移动栏贴合刘海/状态栏安全区 */
  .topbar{ top:0; border-radius:0; margin:-14px -14px 14px;
    padding:calc(10px + env(safe-area-inset-top)) 14px 10px; }

  /* KPI 两列,信息密度更合理(原本一列太长) */
  .cards{ grid-template-columns:repeat(2,1fr); gap:12px; margin-bottom:16px; }
  .kpi{ padding:14px 15px; border-radius:var(--radius); }
  .kpi .num{ font-size:20px; margin-top:6px; }
  .kpi .label{ font-size:12px; }

  /* 工具条:搜索/筛选各占满整行,按钮自动换行、易点 */
  .toolbar{ gap:8px; }
  .toolbar .spacer{ display:none; }
  .toolbar .inline-search,.toolbar .inline-select{
    width:100%; max-width:none; min-width:0; flex:1 1 100%; }

  /* 宽表格:更顺滑的横向滚动 + 稍紧凑 */
  .panel{ position:relative; }
  table{ font-size:13px; }
  th,td{ padding:10px 10px; }
  .page-sub{ font-size:12px; }

  /* 弹窗改为「底部抽屉」式:贴着拇指,表单更好填写 */
  .modal-mask{ align-items:flex-end; padding:0; }
  .modal{ width:100%; max-width:100%; max-height:92vh;
    border-radius:16px 16px 0 0; animation:sheet-up .24s cubic-bezier(.4,0,.2,1); }
  .modal-head{ position:sticky; top:0; background:#fff; z-index:3; }
  .modal-body{ padding-bottom:calc(18px + env(safe-area-inset-bottom)); }
  /* 操作按钮吸附底部,贴满整行,单手可点 */
  .modal-actions{ position:sticky; bottom:0; z-index:3; background:#fff;
    margin:14px -20px 0; padding:12px 20px calc(12px + env(safe-area-inset-bottom));
    border-top:1px solid var(--line); }
  .modal-actions button,.modal-actions .btn{ flex:1; }

  /* 主内容底部留出手势条安全区 */
  .content{ padding-bottom:calc(20px + env(safe-area-inset-bottom)); }
}
@keyframes sheet-up{ from{ transform:translateY(100%); } to{ transform:none; } }

/* ============================================================
   会计凭证录入:手机端「竖排卡片」表单
   保留原有表格 DOM 与全部录入逻辑(选科目/算余额/合计/保存),
   仅通过 CSS 把每条分录从「一行」变成「一张卡片」,借贷并排。
   ============================================================ */
@media(max-width:768px){
  /* 凭证纸张去掉固定宽度与边框,贴合屏幕 */
  .voucher-paper{ min-width:0; width:100%; padding:4px 0 12px;
    border:0; box-shadow:none; background:transparent; }
  .voucher-heading{ min-height:auto; flex-direction:column; gap:4px;
    align-items:center; margin-bottom:14px; }
  .voucher-heading h1{ font-size:22px; letter-spacing:3px; padding-bottom:4px; }
  .voucher-period,.voucher-attachments{ position:static; }
  .voucher-meta{ flex-wrap:wrap; gap:10px 14px; }
  .voucher-meta label{ flex:1 1 40%; white-space:normal; }
  .voucher-meta select,.voucher-meta input{ width:100%; }
  .voucher-meta input[type=date]{ width:100%; }

  /* 表格容器与表格本体改为块级,取消横向滚动 */
  .voucher-grid-wrap{ overflow:visible; }
  .voucher-grid{ display:block; min-width:0; border:0; }
  .voucher-grid thead{ display:none; }                 /* 表头改由每个字段标签代替 */
  .voucher-grid tbody{ display:block; }
  .voucher-grid tr{ display:block; }
  .voucher-grid td{ display:block; border:0; height:auto; padding:0; }

  /* 每条分录 = 一张卡片 */
  .voucher-line{ position:relative; background:#fff; border:1px solid var(--line);
    border-radius:var(--radius); box-shadow:var(--shadow-sm);
    padding:40px 14px 14px; margin-bottom:14px; overflow:hidden; }
  .voucher-line::after{ content:''; display:block; clear:both; }  /* 清除借贷浮动 */

  /* 序号 → 卡片顶部「分录 N」标题条 */
  .voucher-grid .voucher-seq{ position:absolute; top:0; left:0; right:0; width:auto;
    height:34px; line-height:34px; padding:0 14px; text-align:left;
    background:#f8fafc; border-bottom:1px solid var(--line);
    color:#475569; font-size:12px; font-weight:600; }
  .voucher-grid .voucher-seq::before{ content:'分录 '; color:#94a3b8; }

  /* 删除按钮 → 卡片标题条右侧 */
  .voucher-line .voucher-del-cell{ position:absolute; top:0; right:6px; height:34px; }
  .voucher-grid .voucher-del{ width:auto; height:34px; line-height:34px;
    font-size:22px; padding:0 8px; }

  /* 字段标签(摘要/会计科目/借方/贷方) */
  .voucher-grid td[data-label]::before{ content:attr(data-label); display:block;
    font-size:12px; color:var(--muted); margin:0 0 5px; }
  .voucher-grid td[data-label]{ margin-top:12px; }

  /* 摘要 / 科目恢复为常规输入框 */
  .voucher-grid .voucher-summary,
  .voucher-grid .voucher-account{ height:44px; min-height:44px;
    border:1px solid #dfe3ea; border-radius:var(--radius-sm);
    background:#fff; padding:9px 11px; font-size:16px; }
  .voucher-grid .voucher-account{ padding-right:30px; }
  .voucher-account-box::after{ top:14px; }
  .voucher-line-balance{ margin-top:6px; }

  /* 借方 / 贷方并排两列,单手输入更顺 */
  .voucher-line .voucher-debit-cell,
  .voucher-line .voucher-credit-cell{ float:left; width:calc(50% - 6px); }
  .voucher-line .voucher-debit-cell{ margin-right:12px; }
  .voucher-grid .voucher-money-box{ height:46px; min-height:46px;
    border:1px solid #dfe3ea; border-radius:var(--radius-sm);
    background:#fff; padding-left:6px; }
  .voucher-grid .voucher-money{ height:44px; min-height:44px; min-width:0;
    font-size:16px; text-align:right; padding:0 10px 0 2px; }
  .voucher-grid .voucher-money:focus{ background:#fffceb; }

  /* 合计行卡片化 */
  .voucher-grid tfoot{ display:block; }
  .voucher-grid tfoot tr{ display:flex; flex-wrap:wrap; align-items:center;
    gap:4px 16px; background:#f1f5f9; border:1px solid var(--line);
    border-radius:var(--radius); padding:12px 14px; }
  .voucher-grid tfoot td{ display:block; height:auto; padding:0;
    font-weight:700; font-size:14px; }

  /* 添加分录、底部操作按钮铺满整行 */
  .voucher-add-line{ width:100%; min-height:44px; }
  .voucher-toolbar button,.voucher-bottom-actions button{ flex:1 1 auto; min-height:44px; }
  .voucher-bottom-actions{ flex-wrap:wrap; }
}

/* 超窄屏(小手机):KPI 回到单列,避免数字被挤换行 */
@media(max-width:380px){
  .cards{ grid-template-columns:1fr; }
}
