/* ============================================================
   弱电工具箱 app.css —— 移动端优先 + 深色模式
   ============================================================ */
:root {
  --bg: #eef1f6;
  --bg-grad-a: #dfe7f5;
  --bg-grad-b: #f2f4f8;
  --card: #ffffff;
  --card2: #f7f9fc;
  --line: #e4e8ef;
  --txt: #17202e;
  --txt2: #5a6474;
  --txt3: #98a1b1;
  --brand: #1b5bff;
  --brand2: #0f3fb8;
  --brand-l: #e8efff;
  --ok: #0c9d58;
  --ok-l: #e4f6ec;
  --warn: #d9531e;
  --warn-l: #fdeee7;
  --star: #f5a623;
  --shadow: 0 1px 2px rgba(20, 32, 64, .05), 0 6px 18px rgba(20, 32, 64, .05);
  --shadow-lg: 0 12px 40px rgba(20, 32, 64, .18);
  --radius: 14px;
  --radius-s: 10px;
  --maxw: 560px;
  --tabh: 56px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}
html[data-theme="dark"] {
  --bg: #0b1020;
  --bg-grad-a: #101a33;
  --bg-grad-b: #0b1020;
  --card: #151c30;
  --card2: #1b2440;
  --line: #26304e;
  --txt: #e8ecf6;
  --txt2: #a6b0c6;
  --txt3: #6d7894;
  --brand: #4d84ff;
  --brand2: #7aa5ff;
  --brand-l: #1c2d5e;
  --ok: #35c07a;
  --ok-l: #123826;
  --warn: #ff8a5c;
  --warn-l: #40221a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 14px 48px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font: 15px/1.62 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
#app {
  max-width: var(--maxw); margin: 0 auto; min-height: 100vh;
  padding-bottom: calc(var(--tabh) + var(--sab) + 28px);
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select { font-family: inherit; }
button:focus, input:focus, select:focus { outline: none; }
::selection { background: rgba(27, 91, 255, .18); }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}
.sec-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 2px 10px; }
.sec-head h3 { font-size: 13px; margin: 0; color: var(--txt3); font-weight: 600; letter-spacing: .6px; }
.sec-head .cnt { font-size: 11.5px; color: var(--txt3); }
.empty { text-align: center; color: var(--txt3); padding: 46px 0; font-size: 14px; line-height: 2; }

/* 首页 */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--bg-grad-a), var(--bg-grad-b));
  padding: calc(18px + var(--sat)) 14px 14px;
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 0; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  background: linear-gradient(135deg, #3d7bff, #123c9e);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(27, 91, 255, .35);
}
.brand .logo svg { width: 24px; height: 24px; }
.brand h1 { font-size: 19px; margin: 0; font-weight: 700; letter-spacing: .3px; line-height: 1.25; }
.brand p { margin: 1px 0 0; font-size: 11.5px; color: var(--txt2); }
.iconbtn {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--card); color: var(--txt2); display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; flex: none; padding: 0;
}
.iconbtn:active { transform: scale(.94); }
.iconbtn svg { width: 19px; height: 19px; }
.catpick { padding: 10px 14px 4px; }
.cat-sel {
  width: 100%; padding: 11px 34px 11px 12px; font-size: 15px; color: var(--txt);
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background-color: var(--card2); outline: none; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2398a1b1' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
  transition: border-color .15s;
}
.cat-sel:focus { border-color: var(--brand); background-color: var(--card); }

.catblock { padding: 0 14px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 350px) { .grid { grid-template-columns: 1fr; } }
.tool {
  display: block; padding: 12px 12px 11px; border-radius: var(--radius); cursor: pointer;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.tool::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent, var(--brand)); opacity: .85;
}
.tool:active { transform: scale(.98); }
.tool-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.tool-name { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.tool-name .num { font-size: 10px; color: var(--txt3); font-weight: 400; margin-right: 4px; }
.star { color: var(--txt3); font-size: 16px; cursor: pointer; line-height: 1; flex: none; padding: 2px; }
.star.on { color: var(--star); }
.star.big { font-size: 22px; }
.tool-desc {
  font-size: 11.5px; color: var(--txt2); margin-top: 4px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.foot { text-align: center; color: var(--txt3); font-size: 11.5px; padding: 24px 18px 6px; line-height: 1.8; }
.foot .link { color: var(--brand2); cursor: pointer; }

/* ---------- 工具页 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 6px;
  padding: calc(8px + var(--sat)) 10px 8px;
  background: rgba(240, 243, 248, .9);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
html[data-theme="dark"] .topbar { background: rgba(11, 16, 32, .9); background: color-mix(in srgb, var(--bg) 82%, transparent); }
.topbar .backbtn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--txt2); cursor: pointer; flex: none;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.topbar .backbtn svg { width: 18px; height: 18px; }
.topbar .tb-title { flex: 1; text-align: center; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .tb-ph { width: 34px; flex: none; }
.tool-title { padding: 8px 14px 2px; }
.tool-title h2 { font-size: 20px; margin: 0; font-weight: 700; letter-spacing: .2px; }
.tool-title p { margin: 5px 0 0; font-size: 12.5px; color: var(--txt2); }

/* 表单 */
.form-inner { padding: 14px; }
.f { display: block; margin-bottom: 14px; }
.f:last-child { margin-bottom: 2px; }
.f-l { display: flex; align-items: baseline; gap: 6px; font-size: 13px; color: var(--txt2); margin-bottom: 6px; }
.f-l .u { color: var(--txt3); font-size: 11.5px; }
.f-l .hint { margin-left: auto; color: var(--txt3); font-size: 11px; }
.f-in {
  width: 100%; padding: 11px 12px; font-size: 16px; color: var(--txt);
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--card2); outline: none; appearance: none; -webkit-appearance: none;
  transition: border-color .15s;
}
.f-in:focus { border-color: var(--brand); background: var(--card); }
select.f-in {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2398a1b1' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px;
}
.listwrap .list-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.listwrap .list-hd .l { font-size: 13px; color: var(--txt2); }
.mini {
  padding: 6px 12px; font-size: 12.5px; border: 1px solid var(--brand); border-radius: 8px;
  background: var(--brand-l); color: var(--brand); cursor: pointer; font-family: inherit;
}
.mini.danger { border-color: transparent; background: var(--warn-l); color: var(--warn); padding: 2px 8px; border-radius: 7px; }
.lhead { font-size: 11px; color: var(--txt3); padding: 0 0 4px; }
.lrow { display: flex; align-items: center; gap: 5px; margin-bottom: 7px; }
.lrow > span { min-width: 0; flex: 1; }
.lrow .cell-input input {
  width: 100%; padding: 8px 5px; font-size: 16px; min-width: 0;
  border: 1px solid var(--line); border-radius: 7px; background: var(--card2); color: var(--txt);
}
.lrow .cell-del { flex: 0 0 30px; text-align: center; }
.lrow .cell-del button { padding: 4px 9px; }

/* 结果 */
.res { padding: 14px; }
.res-hd { font-size: 13px; font-weight: 700; color: var(--txt); margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.res-hd .ico { width: 4px; height: 14px; border-radius: 2px; background: var(--brand); display: inline-block; }
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 9px 12px; border-radius: 10px; background: var(--card2); margin-bottom: 6px;
}
.row .rl { font-size: 13px; color: var(--txt2); flex: none; max-width: 46%; }
.row .rv { font-size: 15px; font-weight: 650; text-align: right; word-break: break-all; }
.row .rv .u { font-style: normal; font-size: 11.5px; font-weight: 400; color: var(--txt3); margin-left: 4px; }
.row.hl { background: var(--brand-l); }
.row.hl .rv { color: var(--brand2); }
.row.warn { background: var(--warn-l); }
.row.warn .rv { color: var(--warn); }
.row.ok { background: var(--ok-l); }
.row.ok .rv { color: var(--ok); }
.rhint { font-size: 11px; color: var(--txt3); margin: -1px 0 9px 13px; line-height: 1.55; }
.dots { display: flex; gap: 4px; align-items: center; }
.dots i { width: 18px; height: 18px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.12); }
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -2px; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: max-content; }
th, td { padding: 8px 9px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--txt3); font-weight: 600; background: var(--card2); position: sticky; top: 0; }
tr:last-child td { border-bottom: none; }
td.hot { color: var(--brand2); font-weight: 600; }
.notes { padding: 13px 15px; }
.notes .res-hd { margin-bottom: 7px; }
.notes ul { margin: 0; padding-left: 17px; }
.notes li { font-size: 12.5px; color: var(--txt2); margin-bottom: 6px; line-height: 1.7; }
.notes li:last-child { margin-bottom: 0; }

/* 操作条 */
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 2px 14px 6px; }
.actions button {
  padding: 11px 4px; font-size: 13.5px; border-radius: 11px; cursor: pointer; font-family: inherit;
  border: 1px solid var(--brand); background: var(--brand); color: #fff; white-space: nowrap;
}
.actions button:active { opacity: .85; }
.actions button.ghost { background: var(--card); color: var(--txt2); border-color: var(--line); }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; max-width: var(--maxw); margin: 0 auto;
  background: rgba(255, 255, 255, .92);
  background: color-mix(in srgb, var(--card) 90%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: var(--sab);
}
html[data-theme="dark"] .tabbar { background: rgba(21, 28, 48, .92); background: color-mix(in srgb, var(--card) 90%, transparent); }
.tabbar button {
  flex: 1; background: none; border: none; cursor: pointer; padding: 7px 0 5px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--txt3); font-size: 10.5px; font-family: inherit;
}
.tabbar button svg { width: 21px; height: 21px; }
.tabbar button.on { color: var(--brand); }
.tabbar button:active { opacity: .75; }

/* ---------- 弹层 ---------- */
#layer { position: fixed; inset: 0; z-index: 60; display: none; }
#layer.show { display: block; }
.mask { position: absolute; inset: 0; background: rgba(8, 12, 26, .5); animation: fadeIn .18s; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: var(--maxw); margin: 0 auto;
  background: var(--card); border-radius: 18px 18px 0 0; padding: 8px 16px calc(18px + var(--sab));
  box-shadow: var(--shadow-lg); animation: up .22s cubic-bezier(.2, .8, .3, 1);
  max-height: 82vh; overflow-y: auto;
}
.sheet .grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 12px; }
.sheet h4 { margin: 0 0 4px; font-size: 16px; }
.sheet .sub { font-size: 12px; color: var(--txt3); margin-bottom: 12px; }
.set-group { margin-bottom: 14px; }
.set-group .g-t { font-size: 12px; color: var(--txt3); font-weight: 600; letter-spacing: .5px; margin-bottom: 8px; }
.seg { display: flex; background: var(--card2); border-radius: 11px; padding: 3px; }
.seg button {
  flex: 1; border: none; background: none; padding: 9px 4px; border-radius: 9px;
  font-size: 13px; color: var(--txt2); cursor: pointer; font-family: inherit;
}
.seg button.on { background: var(--card); color: var(--brand); font-weight: 600; box-shadow: var(--shadow); }
.set-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--card2); border: 1px solid var(--line); border-radius: 11px;
  padding: 11px 12px; margin-bottom: 8px; cursor: pointer; font-family: inherit; color: var(--txt); font-size: 13.5px;
}
.set-item svg { width: 18px; height: 18px; color: var(--brand); flex: none; }
.set-item .t { flex: 1; }
.set-item .sub2 { font-size: 11px; color: var(--txt3); }
.set-item:active { opacity: .85; }
.set-item.danger { color: var(--warn); }
.set-item.danger svg { color: var(--warn); }
.about-box { font-size: 12.5px; color: var(--txt2); line-height: 1.8; padding: 10px 2px 4px; border-top: 1px dashed var(--line); }
.about-box b { color: var(--txt); }

/* 设置页（独立页面） */
.setpage { padding: 16px 16px 4px; }
.setpage .set-group:last-child { margin-bottom: 6px; }

/* 图片导出 */
.modal {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal .m-card { background: var(--card); border-radius: 16px; padding: 14px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); }
.modal .m-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal .m-hd b { font-size: 15px; }
.modal .m-x { border: none; background: none; font-size: 20px; color: var(--txt3); cursor: pointer; }
.modal .imgbox { width: 100%; background: #fff; border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.modal .imgbox img { width: 100%; display: block; }
.modal .m-tip { font-size: 11.5px; color: var(--txt3); text-align: center; margin: 0 0 10px; line-height: 1.6; }
.modal .m-actions { display: flex; gap: 8px; }
.modal .m-actions button {
  flex: 1; padding: 10px; border-radius: 10px; font-size: 13.5px; cursor: pointer;
  border: 1px solid var(--brand); background: var(--brand); color: #fff; font-family: inherit;
}
.modal .m-actions button.ghost { background: var(--card); color: var(--txt2); border-color: var(--line); }

/* 顶部系统提示（toast） */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabh) + var(--sab) + 22px); transform: translateX(-50%);
  background: rgba(16, 22, 40, .92); color: #fff; font-size: 13px; padding: 9px 16px;
  border-radius: 999px; z-index: 90; max-width: 86vw; text-align: center;
  box-shadow: var(--shadow-lg); animation: up .2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html[data-theme="dark"] .toast { background: rgba(40, 50, 80, .95); }

@keyframes up { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 600px) {
  .page, .hero { border-radius: 0; }
  body { background: #e6eaf2; }
  html[data-theme="dark"] body { background: #070b16; }
  .sheet, .modal .m-card { border-radius: 18px; }
}

/* ---------- 色带（电阻） ---------- */
.stripewrap { background: var(--card2); border-radius: 10px; padding: 10px 12px; margin-bottom: 6px; }
.stripewrap .rl { display: block; font-size: 13px; color: var(--txt2); margin-bottom: 9px; }
.stripes { display: flex; gap: 12px; flex-wrap: wrap; }
.stripe { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.stripe i {
  width: 34px; height: 46px; border-radius: 7px;
  border: 1px solid rgba(127, 127, 127, .28);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
}
.stripe small { font-size: 10px; color: var(--txt3); white-space: nowrap; max-width: 84px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 图片导出 ---------- */
.modal .m-actions a.dlbtn {
  flex: 1; padding: 10px; border-radius: 10px; font-size: 13.5px; text-align: center;
  border: 1px solid var(--brand); background: var(--brand); color: #fff;
  text-decoration: none; font-family: inherit;
}
.modal .m-actions a.dlbtn:active { opacity: .85; }
@media (prefers-color-scheme: dark) {
  .stripe i { box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
}

/* ============================================================
   方案库
   ============================================================ */
.logo-plan { background: linear-gradient(135deg, #7c5cff, #2b1c8f) !important; box-shadow: 0 6px 16px rgba(124, 92, 255, .35) !important; }
.pgrid { padding: 10px 14px 6px; }
.pcard {
  display: flex; align-items: center; gap: 12px; padding: 14px 12px; margin-bottom: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); cursor: pointer; position: relative; overflow: hidden;
}
.pcard::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--pc, var(--brand)); opacity: .9;
}
.pcard:active { transform: scale(.985); }
.pno {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 700; background: var(--pc, var(--brand));
  box-shadow: 0 4px 12px color-mix(in srgb, var(--pc, var(--brand)) 40%, transparent);
}
.pcard .pt { flex: 1; min-width: 0; }
.pt-hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pt-hd b { font-size: 15px; font-weight: 600; line-height: 1.35; }
.pt-cat {
  font-size: 10px; color: var(--pc, var(--brand)); font-weight: 500;
  background: color-mix(in srgb, var(--pc, var(--brand)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--pc, var(--brand)) 28%, transparent);
  padding: 1px 8px; border-radius: 999px; white-space: nowrap;
}
.pt-brief {
  font-size: 12px; color: var(--txt2); margin-top: 3px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ptags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.ptags i {
  font-style: normal; font-size: 10.5px; color: var(--txt3);
  background: var(--card2); border: 1px solid var(--line);
  padding: 1px 8px; border-radius: 999px; white-space: nowrap;
}
.pcard .pgo { color: var(--txt3); font-size: 20px; flex: none; line-height: 1; font-weight: 300; }

/* 方案详情 */
.topbar .tb-ico { width: 38px; height: 38px; flex: none; }
.phead {
  position: relative; margin: 12px 14px; padding: 16px 16px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.phead::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--pc, var(--brand));
}
.phead .pcat2 {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px;
  color: var(--txt2); font-weight: 500;
}
.phead h2 { margin: 8px 0 4px; font-size: 19px; line-height: 1.35; }
.phead p { margin: 0; font-size: 13px; color: var(--txt2); line-height: 1.65; }
#app > .card.pblock { margin-left: 14px; margin-right: 14px; }
.plist { margin: 0; padding: 0; list-style: none; }
.plist li { position: relative; padding: 5px 0 5px 16px; font-size: 13px; color: var(--txt2); line-height: 1.7; }
.plist li::before {
  content: ""; position: absolute; left: 2px; top: 13px; width: 6px; height: 6px;
  border-radius: 2px; background: var(--brand);
}
.psys { display: flex; flex-direction: column; }
.psys-it { padding: 10px 0; border-top: 1px dashed var(--line); }
.psys-it:first-child { border-top: none; padding-top: 2px; }
.psys-it b { display: block; font-size: 13.5px; color: var(--txt); margin-bottom: 3px; }
.psys-it p { margin: 0; font-size: 12.5px; color: var(--txt2); line-height: 1.65; }
.pblock .res-hd { margin-bottom: 6px; }

/* ============================================================
   PC / 宽屏适配：≥900px 由「底部标签栏 + 单列」切换为
   「顶部导航 + 多列网格 + 居中卡片」，移动端样式完全不变
   ============================================================ */
.tab-brand { display: none; }
.icp { color: var(--txt3); font-size: 11px; text-decoration: none; }

@media (min-width: 900px) {
  :root { --maxw: 1080px; --navh: 62px; }

  /* 无底部标签栏，无需再为其留白；顶部给导航条留出位置 */
  #app { padding-bottom: 28px; }
  body { padding-top: var(--navh); }

  /* 底部导航 → 顶部横向导航（技术站风格） */
  .tabbar {
    top: 0; bottom: auto; left: 0; right: 0; width: auto; max-width: none; margin: 0;
    height: var(--navh); flex-direction: row; align-items: center; gap: 4px;
    padding: 0 max(24px, calc((100vw - var(--maxw)) / 2));
    border-top: none; border-bottom: 1px solid var(--line);
    background: var(--card); box-shadow: var(--shadow);
  }
  html[data-theme="dark"] .tabbar { background: var(--card); }
  .tab-brand {
    display: flex; align-items: center; gap: 10px; margin-right: 24px;
    padding: 0; color: var(--txt); letter-spacing: .3px;
  }
  .tab-brand .tb-logo {
    width: 30px; height: 30px; border-radius: 9px; flex: none; color: #fff;
    background: linear-gradient(135deg, #3d7bff, #123c9e);
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(27, 91, 255, .32);
  }
  .tab-brand .tb-logo svg { width: 17px; height: 17px; }
  .tab-brand b { display: block; font-size: 15.5px; font-weight: 700; line-height: 1.2; }
  .tab-brand small { display: block; font-size: 10.5px; color: var(--txt3); line-height: 1.3; }
  .tabbar button {
    flex: none; flex-direction: row; justify-content: flex-start; align-items: center;
    gap: 8px; padding: 9px 16px; font-size: 14px; border-radius: 10px; color: var(--txt2);
  }
  .tabbar button svg { width: 18px; height: 18px; }
  .tabbar button.on { background: var(--brand-l); color: var(--brand); font-weight: 600; }
  .tabbar button:hover { background: var(--card2); }
  .tabbar button.on:hover { background: var(--brand-l); }

  /* 工具页 / 方案页的吸顶标题栏要避让顶部导航 */
  .topbar { top: var(--navh); }

  /* 设置页 / 速查手册页：PC 顶部导航已有对应标签，吸顶标题栏完全重复，隐藏 */
  body[data-page="settings"] .topbar,
  body[data-page="ref"] .topbar { display: none; }
  body[data-page="settings"] .setpage { margin-top: 18px; }
  body[data-page="ref"] .tool-title { padding-top: 18px; }

  /* 首页 / 方案库：多列网格 */
  /* PC 顶部已有导航品牌区，列表页再放一个大标题区就重复了，隐藏它并留出间距 */
  .hero { display: none; }
  .catpick { max-width: 360px; padding: 20px 14px 6px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .pgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .pcard { margin-bottom: 0; }

  /* 工具页 / 方案详情：内容限宽居中，表单两列 */
  .tool-title, .actions, .phead { max-width: 880px; margin-left: auto; margin-right: auto; }
  .card, #app > .card.pblock { max-width: 880px; margin-left: auto; margin-right: auto; }
  .form-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; padding: 18px 16px; }
  .form-inner > .listwrap { grid-column: 1 / -1; }
  .tool-title { padding: 14px 16px 2px; }
  .actions { padding: 6px 16px 12px; }

  /* 弹层：底部抽屉 → 居中对话框 */
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%);
    width: 600px; max-width: calc(100vw - 48px); border-radius: 18px;
    padding: 18px 20px 20px; animation: fadeIn .18s; max-height: 84vh;
  }
  .sheet .grip { display: none; }
  .modal .m-card { max-width: 560px; }
  .toast { bottom: 28px; }
}

@media (min-width: 1280px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .pgrid { grid-template-columns: repeat(3, 1fr); }
}

/* 有指针设备：补充悬停反馈 */
@media (hover: hover) {
  .tool:hover, .pcard:hover { box-shadow: var(--shadow-lg); }
  .set-item:hover, .mini:hover, .actions button:hover, .iconbtn:hover { opacity: .88; }
  .tabbar button:active { opacity: 1; }
}
