
*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg:        #f4f6f9;
  --surface:   #ffffff;
  --text:      #1a1e26;
  --text-2:    #59616f;
  --text-3:    #8f97a6;
  --warn:      #9a6b00;
  --line:      #e7eaf0;
  --brand:     #2f6ae8;
  --brand-2:   #6f8df7;
  --brand-soft:#eef3fe;
  --radius:    16px;
  --shadow:    0 1px 2px rgba(18,26,40,.04), 0 10px 28px -16px rgba(18,26,40,.16);
  --shadow-hi: 0 2px 6px rgba(18,26,40,.06), 0 20px 40px -20px rgba(18,26,40,.22);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --header-bg: rgba(244, 246, 249, .84);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #12151b;
    --surface:   #1a1e26;
    --text:      #e8ebf0;
    --text-2:    #a4adbc;
    --text-3:    #79828f;
  --warn:      #e0b25c;
    --line:      #262c36;
    --brand:     #7ea2ff;
    --brand-2:   #9db6ff;
    --brand-soft:#1e2739;
    --shadow:    0 1px 2px rgba(0,0,0,.3), 0 10px 28px -16px rgba(0,0,0,.5);
    --shadow-hi: 0 2px 6px rgba(0,0,0,.35), 0 20px 40px -20px rgba(0,0,0,.6);
    --header-bg: rgba(18, 21, 27, .82);
  }
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.75 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* 纵向 flex：让 #main 撑满剩余高度，页脚才能稳定贴住视口底部 */
  display: flex; flex-direction: column; min-height: 100vh;
}
#main { flex: 1 0 auto; }
img { max-width: 100%; }
a { color: inherit; }

.wrap { width: 100%; max-width: 1060px; margin: 0 auto; padding: 0 22px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--brand); color: #fff;
  padding: 8px 14px; border-radius: 8px; text-decoration: none; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.head-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: grid; place-items: center;
  font-size: 15px; font-weight: 700; letter-spacing: .5px;
}
.brand-name { font-size: 15.5px; font-weight: 650; letter-spacing: .2px; }
.nav { display: flex; align-items: center; gap: 2px; }
.nav a {
  color: var(--text-2); text-decoration: none; font-size: 14.5px;
  padding: 7px 13px; border-radius: 9px; transition: background .16s, color .16s;
}
.nav a:hover { background: var(--brand-soft); color: var(--brand); }
.nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* ---------- Hero ---------- */
.hero { padding: 58px 0 40px; text-align: center; }
.hero h1 { margin: 0 0 14px; font-size: 38px; line-height: 1.25; letter-spacing: -.4px; font-weight: 700; }
.hero .tagline { margin: 0 auto; max-width: 620px; color: var(--text-2); font-size: 16.5px; }
.hero .stats {
  margin-top: 22px; color: var(--text-3); font-size: 13.5px;
  display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap;
}
.hero .stats i { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); opacity: .6; font-style: normal; }

/* ---------- 区块标题 ---------- */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 20px; }
.sec-head h2 { margin: 0; font-size: 19px; letter-spacing: -.2px; min-width: 0; }
.sec-head .more { color: var(--text-3); font-size: 13.5px; text-decoration: none; flex: none; white-space: nowrap; }
.sec-head .more:hover { color: var(--brand); }

/* ---------- 卡片 ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .2s cubic-bezier(.2,.7,.3,1), box-shadow .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hi); }
.card-cover {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #eef1f7;
  display: block;
}
.card-cover img { width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .45s cubic-bezier(.2,.7,.3,1); }
.card:hover .card-cover img { transform: scale(1.045); }
.card-cover.ph { display: grid; place-items: center; }
.card-cover.ph span { font-size: 15px; font-weight: 650; letter-spacing: .22em;
  color: rgba(28,38,58,.34); text-indent: .22em; }
.ph-1 { background: linear-gradient(135deg, #e8efff, #f3f0ff); }
.ph-2 { background: linear-gradient(135deg, #e6f6f1, #eef7ff); }
.ph-3 { background: linear-gradient(135deg, #fdf0e8, #fbeff4); }
.ph-4 { background: linear-gradient(135deg, #eef0fb, #e8f4ff); }
.ph-5 { background: linear-gradient(135deg, #f4efe6, #eef4ea); }
.ph-6 { background: linear-gradient(135deg, #eaeef6, #f5f1fa); }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card-title { margin: 0; font-size: 18.5px; line-height: 1.45; font-weight: 650; letter-spacing: -.2px; }
.card-title a { text-decoration: none; color: var(--text); }
.card-title a:hover { color: var(--brand); }
.card-excerpt {
  margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.72;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot { margin-top: auto; padding-top: 6px; display: flex; align-items: center;
  gap: 9px; color: var(--text-3); font-size: 12.8px; flex-wrap: wrap; }
.card-foot .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .55; }
.card-foot .tag { color: var(--brand); text-decoration: none; }
.card-foot .tag:hover { text-decoration: underline; }

/* ---------- 主题 B：横向列表卡 ---------- */
body.theme-b .grid { grid-template-columns: 1fr; gap: 16px; }
body.theme-b .card { flex-direction: row; align-items: stretch; }
body.theme-b .card-cover { width: 236px; flex: none; aspect-ratio: auto; min-height: 156px; }
body.theme-b .card-body { padding: 18px 22px; }
body.theme-b .card-title { font-size: 19.5px; }
body.theme-b .card-excerpt { -webkit-line-clamp: 2; }
@media (max-width: 700px) {
  body.theme-b .card { flex-direction: column; }
  body.theme-b .card-cover { width: 100%; aspect-ratio: 16/9; min-height: 0; }
  /* 窄屏一行只放得下约 22 个字，2 行装不下一句完整的摘要（会被截在句子中间），
     放宽到 3 行；桌面端维持 2 行不变。 */
  .card-excerpt { -webkit-line-clamp: 3; }
}

/* ---------- 分页 ---------- */
.pager { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 44px 0 8px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 38px; height: 38px; padding: 0 12px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; text-decoration: none; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2); transition: .16s;
}
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager .cur { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager .gap { border: 0; background: none; color: var(--text-3); }
.pager .dis { opacity: .45; }
/* 顶部翻页栏：与底部同一组件，仅收窄间距，避免抢首屏 */
.pager-top { margin: 0 0 26px; }
.pager-top a, .pager-top span { min-width: 34px; height: 34px; font-size: 13.5px; }

/* ---------- 文章页 ---------- */
.art-head { padding: 46px 0 26px; max-width: 760px; margin: 0 auto; }
.art-head h1 { margin: 0 0 16px; font-size: 32px; line-height: 1.35; letter-spacing: -.5px; font-weight: 700; }
.art-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  color: var(--text-3); font-size: 13.5px; }
.art-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .55; }
.art-meta .tag { color: var(--brand); text-decoration: none; background: var(--brand-soft);
  padding: 3px 10px; border-radius: 999px; font-size: 12.5px; }
.art-meta .tag:hover { background: var(--brand); color: #fff; }
.src-note { margin: 18px 0 0; padding: 11px 15px; background: var(--brand-soft);
  border-left: 3px solid var(--brand); border-radius: 0 8px 8px 0;
  color: var(--text-2); font-size: 13.5px; }
.art-body {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 40px 46px; max-width: 860px; margin: 0 auto;
}

.prose { font-size: 17px; line-height: 1.92; color: var(--text); word-wrap: break-word; }
.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }
.prose p { margin: 0 0 1.15em; }
.prose p.step {
  margin: 1.9em 0 .7em; font-weight: 650; color: var(--text); font-size: 17.5px;
  padding-left: 12px; border-left: 3px solid var(--brand); line-height: 1.6;
}
.prose a { color: var(--brand); text-decoration: none; border-bottom: 1px solid rgba(47,106,232,.32); }
.prose a:hover { border-bottom-color: var(--brand); }
.prose .url-line { word-break: break-all; }
.prose img { max-width: 100%; height: auto; display: block; border-radius: 10px; }
.prose .fig { margin: 1.7em 0; display: grid; gap: 10px; grid-template-columns: 1fr; }
/* 单图限高：竖构图的照片按 100% 宽显示会占满一屏多，一张图滚一屏很累（2026-09-29 配游记图时发现）。
   横图高度到不了 600，不受影响；竖图等比缩到 600 高并居中。 */
.prose .fig:not(.multi) img { max-height: 600px; width: auto; justify-self: center; }
.prose .fig.multi { display: block; columns: 2; column-gap: 10px; }
.prose .fig.multi img { width: 100%; height: auto; margin-bottom: 10px;
  break-inside: avoid; -webkit-column-break-inside: avoid; }
.prose pre.code {
  margin: 1.5em 0; background: #f6f8fc; border: 1px solid var(--line); border-radius: 11px;
  padding: 15px 18px; overflow-x: auto; font-size: 14px; line-height: 1.78;
  color: #263043;
}
@media (prefers-color-scheme: dark) {
  .prose pre.code { background: #151922; color: #cdd6e4; }
}
.prose pre.code code { font-family: var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.prose code { font-family: var(--mono); }
.prose :not(pre) > code {
  background: #eef1f7; padding: 2px 6px; border-radius: 5px; font-size: .88em; color: #2c3a52;
}
@media (prefers-color-scheme: dark) {
  .prose :not(pre) > code { background: #232b38; color: #b9c6da; }
}
.prose br + br { display: none; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--line); color: var(--text-2); }
.prose h2, .prose h3 { margin: 1.9em 0 .7em; line-height: 1.45; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.prose li { margin: .35em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 15px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.prose th { background: #f7f9fc; font-weight: 650; }

/* ---------- 附件 ---------- */
.attach { max-width: 860px; margin: 22px auto 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow); }
.attach h3 { margin: 0 0 12px; font-size: 15px; color: var(--text-2); font-weight: 650; }
.attach a { display: flex; align-items: center; gap: 12px; text-decoration: none;
  color: var(--text); padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px;
  transition: .16s; font-size: 14.5px; }
.attach a:hover { border-color: var(--brand); background: var(--brand-soft); }
.attach .ico { width: 34px; height: 34px; flex: none; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 700; }
.attach .sz { margin-left: auto; color: var(--text-3); font-size: 13px; }

/* ---------- 上下篇 ---------- */
.artnav { max-width: 860px; margin: 30px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.artnav a {
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px;
  padding: 16px 18px; text-decoration: none; color: var(--text);
  box-shadow: var(--shadow); transition: .18s; display: block;
}
.artnav a:hover { transform: translateY(-2px); box-shadow: var(--shadow-hi); border-color: var(--brand); }
.artnav .lbl { display: block; color: var(--text-3); font-size: 12.5px; margin-bottom: 6px; }
.artnav .ttl { font-size: 15px; font-weight: 600; line-height: 1.5; }
.artnav .next { text-align: right; }

/* ---------- 归档 ---------- */
.year { margin: 0 0 42px; }
.year-h { display: flex; align-items: baseline; gap: 12px; margin: 0 0 16px;
  font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.year-h span { font-size: 13px; font-weight: 500; color: var(--text-3); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; align-items: baseline; gap: 14px; padding: 11px 4px;
  border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline time { flex: none; width: 52px; color: var(--text-3); font-size: 13px;
  font-family: var(--mono); }
.timeline a { text-decoration: none; color: var(--text); font-size: 15.5px; font-weight: 500; }
.timeline a:hover { color: var(--brand); }
.timeline .t { color: var(--text-3); font-size: 12.5px; margin-left: auto; flex: none; }

/* ---------- 标签 ---------- */
.tag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.tag-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px 22px; text-decoration: none; color: var(--text); box-shadow: var(--shadow);
  transition: .18s; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tag-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hi); border-color: var(--brand); }
.tag-card .nm { font-size: 17px; font-weight: 650; }
.tag-card .ct { color: var(--text-3); font-size: 13px; }

/* ---------- 关于 ---------- */
.about { max-width: 760px; margin: 0 auto; }
.about h1 { font-size: 30px; margin: 0 0 22px; letter-spacing: -.4px; }
.facts { margin: 34px 0 0; padding: 22px 26px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.facts dl { margin: 0; display: grid; grid-template-columns: 96px 1fr; gap: 10px 18px; font-size: 14.5px; }
.facts dt { color: var(--text-3); }
.facts dd { margin: 0; color: var(--text-2); word-break: break-all; }
.facts dd a.mail { color: var(--brand); text-decoration: underline;
  text-underline-offset: 3px; text-decoration-color: var(--brand-2); }
.facts dd a.mail:hover { text-decoration-color: var(--brand); }

/* ---------- 页脚（常驻视口底部） ----------
   sticky + bottom:0：内容不满一屏时贴底；内容超一屏时滚动过程中恒定可见。
   用 sticky 而非 fixed —— sticky 仍参与文档流，到底部时不会盖住正文最后一段。 */
.site-footer {
  position: sticky; bottom: 0; z-index: 30;
  margin-top: 74px;
  background: var(--bg);
  border-top: 1px solid var(--line);
  box-shadow: 0 -1px 0 rgba(18, 26, 40, .02), 0 -10px 26px -20px rgba(18, 26, 40, .5);
  padding: 11px 0 13px;
  text-align: center; color: var(--text-3); font-size: 12.8px; line-height: 1.85;
}
.site-footer a { color: var(--text-3); text-decoration: none; }
.site-footer a:hover { color: var(--brand); }
.site-footer .f-line { margin: 0; }
.site-footer .sep { margin: 0 8px; opacity: .5; }
@media (prefers-color-scheme: dark) {
  .site-footer { box-shadow: 0 -1px 0 rgba(0, 0, 0, .25), 0 -10px 26px -20px rgba(0, 0, 0, .8); }
}

/* ---------- 空状态 / 404 ---------- */
.empty { text-align: center; padding: 90px 20px; }
.empty .code { font-size: 62px; font-weight: 800; letter-spacing: -2px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }
.empty p { color: var(--text-2); margin: 18px 0 26px; }
.btn { display: inline-block; background: var(--brand); color: #fff; text-decoration: none;
  padding: 11px 22px; border-radius: 10px; font-size: 14.5px; font-weight: 600; transition: .16s; }
.btn:hover { opacity: .9; transform: translateY(-1px); }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .art-body { padding: 30px 24px; }
  .art-head h1 { font-size: 26px; }
  .hero h1 { font-size: 30px; }
  .hero { padding: 40px 0 30px; }
}
@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; gap: 18px; }
  .brand-name { display: none; }
  .nav a { padding: 7px 10px; font-size: 14px; }
  .artnav { grid-template-columns: 1fr; }
  .prose { font-size: 16.3px; }
  .facts dl { grid-template-columns: 1fr; gap: 4px 0; }
  .facts dt { margin-top: 8px; }
  /* 常驻页脚在窄屏上要压紧，否则会吃掉太多可视高度 */
  .site-footer { padding: 9px 0 10px; font-size: 11.6px; line-height: 1.7; margin-top: 56px; }
  .site-footer .sep { margin: 0 5px; }
  .pager-top { margin: 0 0 20px; }
  .pager-top a, .pager-top span { min-width: 32px; height: 32px; padding: 0 9px; font-size: 13px; }
}

/* ---------- 工具页 ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 16px;
  margin: 0 0 34px; }
.tool-card { display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 19px 20px 17px; text-decoration: none; color: inherit;
  box-shadow: var(--shadow); transition: transform .16s, box-shadow .16s, border-color .16s; }
.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hi); border-color: var(--brand); }
.tool-card .nm { display: block; font-size: 17px; font-weight: 650; letter-spacing: -.2px; }
.tool-card .ds { display: block; margin-top: 8px; font-size: 13px; line-height: 1.7; color: var(--text-2); }
.tool-card .go { display: block; margin-top: 13px; font-size: 12.5px; font-weight: 600; color: var(--brand); }
.tool { margin: 4px 0 34px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 24px 22px; }
.tool-head h2 { margin: 0 0 7px; font-size: 19px; letter-spacing: -.2px; }
.tool-head p { margin: 0 0 20px; color: var(--text-2); font-size: 14px; line-height: 1.72; }
.tool-label { display: block; font-size: 13px; color: var(--text-2); margin: 0 0 8px; }
.tool textarea, .tool input[type=number] {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; outline: none;
}
.tool textarea { min-height: 78px; resize: vertical; line-height: 1.72; }
.tool textarea:focus, .tool input[type=number]:focus {
  border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 22px; }
.chip { font: inherit; font-size: 13px; padding: 6px 15px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer;
  transition: border-color .16s, color .16s, background .16s; }
.chip:hover { border-color: var(--brand-2); color: var(--text); }
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.chip-custom { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3);
  white-space: nowrap; }
.chip-custom input { width: 88px; padding: 6px 9px; }
.qr-out { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.qr-box { width: 224px; height: 224px; flex: 0 0 auto; border-radius: 12px; overflow: hidden;
  border: 1px dashed var(--line); background: #fff; display: grid; place-items: center; }
.qr-box canvas { width: 100%; height: 100%; display: block; }
.qr-box.filled { border-style: solid; }
.qr-empty { margin: 0; padding: 0 22px; text-align: center; font-size: 13px; color: #8f97a6; line-height: 1.7; }
.qr-side { flex: 1 1 190px; min-width: 180px; }
.qr-info { margin: 0 0 16px; font-size: 13px; color: var(--text-2); min-height: 20px; }
.qr-info b { color: var(--text); font-variant-numeric: tabular-nums; }
.tool-note { margin: 18px 0 0; font-size: 12.5px; color: var(--text-3); line-height: 1.7; }
/* ---------- 工具页 · 图片装框 ---------- */
.tool [hidden] { display: none !important; }
.it-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 18px; }
.it-status { font-size: 13px; color: var(--text-3); }
.it-status.on { color: var(--text-2); }
.it-layout { display: grid; grid-template-columns: 206px minmax(0, 1fr); gap: 18px; align-items: start; }
.it-list { border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  height: 440px; overflow-y: auto; padding: 6px; }
.it-none { margin: 14px 8px; font-size: 12.5px; color: var(--text-3); line-height: 1.7; }
.it-item { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  border: 1px solid transparent; background: none; border-radius: 9px; padding: 5px 7px;
  font: inherit; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.it-item:hover { background: var(--surface); border-color: var(--line); }
.it-item.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.it-thumb { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 6px; overflow: hidden;
  background: var(--line); display: grid; place-items: center; }
.it-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.it-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.it-item.done .it-name::after { content: " \2713"; color: #3f8f5f; font-weight: 700; }
.it-side { min-width: 0; }
.it-topbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin: 0 0 12px; }
.it-sz { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-3);
  white-space: nowrap; }
.it-sz input { width: 76px; padding: 6px 8px; }
.it-lab { font-size: 13px; color: var(--text-3); margin-left: 6px; }
.it-stage { position: relative; height: 440px; border-radius: 12px; background: var(--bg);
  border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden;
  touch-action: none; cursor: grab; }
.it-stage.grabbing { cursor: grabbing; }
.it-frame { position: relative; overflow: hidden; box-shadow: 0 0 0 1px var(--brand-2); }
.it-frame[data-bg="transparent"] { background-color: #fff;
  background-image: linear-gradient(45deg, #e7ecf3 25%, transparent 25%, transparent 75%, #e7ecf3 75%),
                    linear-gradient(45deg, #e7ecf3 25%, transparent 25%, transparent 75%, #e7ecf3 75%);
  background-position: 0 0, 8px 8px; background-size: 16px 16px; }
.it-frame[data-bg="white"] { background: #fff; }
.it-frame[data-bg="black"] { background: #000; }
.it-img { position: absolute; top: 0; left: 0; transform-origin: 0 0;
  /* 站点的全局 img{max-width:100%} 会把这里的宽度压住、导致预览被横向压扁，
     所以必须显式解除。注意：导出走的是 canvas，不受 CSS 影响，
     所以这个 bug 只会让预览失真、不会让输出出错 —— 更难发现。 */
  max-width: none; max-height: none;
  user-select: none; -webkit-user-drag: none; }
.it-ph { position: absolute; margin: 0; padding: 0 20px; text-align: center;
  font-size: 13px; color: var(--text-3); line-height: 1.7; }
.it-ctrl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 13px 0 0; }
.it-zoom { min-width: 46px; text-align: center; font-size: 13px; color: var(--text-2);
  font-variant-numeric: tabular-nums; }
.it-info { margin: 10px 0 0; font-size: 12.5px; color: var(--text-3); min-height: 18px;
  font-variant-numeric: tabular-nums; }

/* ---------- 工具页 · 快速裁切 ---------- */
.it-stage:focus { outline: none; }
.it-stage:focus-visible { box-shadow: inset 0 0 0 2px var(--brand-soft); }
.it-warn { margin: 6px 0 0; font-size: 12.5px; color: var(--warn); min-height: 18px;
  font-variant-numeric: tabular-nums; }

/* ---------- 工具页 · 条形码 ---------- */
.bc-box { flex: 1 1 380px; min-width: 220px; min-height: 150px; padding: 14px 16px;
  border-radius: 12px; border: 1px dashed var(--line); background: #fff;
  display: grid; place-items: center; overflow-x: auto; }
.bc-box canvas { max-width: 100%; height: auto; display: block; }
.bc-box.filled { border-style: solid; }
.btn.sm { padding: 7px 15px; font-size: 13px; }
.btn.ghost { background: var(--surface); color: var(--text-2); border: 1px solid var(--line); }
.btn.ghost:hover { opacity: 1; transform: none; border-color: var(--brand-2); color: var(--text); }
.btn[disabled] { opacity: .45; pointer-events: none; }
@media (max-width: 700px) {
  .it-layout { grid-template-columns: 1fr; gap: 14px; }
  .it-list { height: 158px; }
  .it-stage { height: 320px; }
  .it-sz input { width: 64px; }
  .bc-box { min-width: 0; padding: 10px 12px; }
}

@media (max-width: 700px) {
  .tool { padding: 20px 17px 18px; }
  .qr-out { gap: 18px; }
  .qr-box { width: 100%; height: auto; aspect-ratio: 1 / 1; }
  .qr-side { flex: 1 1 100%; }
}
