* { box-sizing: border-box; }
:root { --tools-gutter: 32px; }
body[data-page="tools"] {
  margin: 0;
  min-width: 0;
  color: #18243a;
  font-family: var(--site-font-family);
  background:
    radial-gradient(circle at 8% 9%, rgba(0,172,235,.42), transparent 24%),
    radial-gradient(circle at 88% 4%, rgba(0,172,235,.24), transparent 26%),
    radial-gradient(circle at 18% 82%, rgba(219, 234, 254, .58), transparent 28%),
    linear-gradient(145deg, #f0fafd 0%, #f7fcfe 44%, #e6f7fd 100%);
}
body[data-page="tools"]::before {
  background:
    linear-gradient(112deg, rgba(255,255,255,.62) 0%, transparent 26%, rgba(255,255,255,.26) 51%, transparent 72%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.18) 0 1px, transparent 1px 80px) !important;
  opacity: .72 !important;
}
body[data-page="tools"] a { color: inherit; text-decoration: none; }
body[data-page="tools"] button,
body[data-page="tools"] input,
body[data-page="tools"] textarea { font: inherit; }
.tools-container { width: min(1280px, calc(100% - (var(--tools-gutter) * 2))); margin-inline: auto; }
.tools-nav {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(248, 252, 255, .72);
  border-bottom: 1px solid rgba(255, 255, 255, .72);
  backdrop-filter: blur(22px) saturate(150%);
}
.tools-nav-inner { min-height: 76px; display: grid; grid-template-columns: 260px minmax(420px, 1fr) 300px; gap: 18px; align-items: center; }
.tools-logo { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tools-logo-mark { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; background: rgba(255,255,255,.9); display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(255,255,255,.9); box-shadow: 0 10px 28px rgba(57, 108, 176, .12); }
.tools-logo-mark img { width: 78%; height: 78%; object-fit: contain; }
.tools-logo strong { display: block; font-size: 16px; letter-spacing: .01em; }
.tools-logo > span:not(.tools-logo-mark), .tools-nav-note { display: block; font-size: 12px; color: #6e7e97; }
.tools-nav-menu { min-width: 0; display: flex; justify-content: center; align-items: center; gap: 2px; white-space: nowrap; }
.tools-nav-menu a { padding: 10px 12px; border-radius: 12px; font-size: 14px; color: #43546c; }
.tools-nav-menu a:hover, .tools-nav-menu a.active { color: #226ef6; background: rgba(224, 243, 255, .8); }
.tools-nav-note { text-align: right; }
.tools-hero { padding: 34px 0 22px; }
.tools-hero-shell, .tool-workspace, .tool-feature-note {
  border: 1px solid rgba(255,255,255,.8);
  background: linear-gradient(116deg, rgba(255,255,255,.7), rgba(236,247,255,.57));
  box-shadow: 0 20px 50px rgba(58, 98, 153, .12), inset 0 1px rgba(255,255,255,.75);
  backdrop-filter: blur(20px) saturate(145%);
}
.tools-hero-shell { border-radius: 28px; padding: 34px 36px; }
.tools-eyebrow { display: inline-flex; gap: 8px; align-items: center; padding: 7px 11px; border-radius: 999px; background: rgba(255,255,255,.58); border: 1px solid rgba(137, 190, 255, .4); color: #3477de; font-size: 13px; font-weight: 700; }
.tools-hero h1 { margin: 0 0 9px; font-size: clamp(32px, 4vw, 46px); letter-spacing: .02em; line-height: 1.12; }
.tools-hero p { max-width: 720px; margin: 0; color: #5d718f; font-size: 16px; line-height: 1.75; }
.tool-workspace { border-radius: 26px; padding: 26px; margin-bottom: 20px; }
main > .tool-workspace:first-child { margin-top: 24px; }
.tool-workspace-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.tool-workspace-head h2 { margin: 0 0 6px; font-size: 23px; }
.tool-workspace-head p { margin: 0; color: #6e7e97; font-size: 14px; line-height: 1.6; }
.local-badge, .vision-badge { flex: 0 0 auto; padding: 8px 11px; border-radius: 999px; background: rgba(255,255,255,.74); color: #3e6caa; border: 1px solid rgba(133,185,245,.43); font-size: 13px; }
.tool-grid { display: grid; grid-template-columns: minmax(260px, .9fr) minmax(320px, 1.25fr) minmax(280px, 1fr); gap: 18px; align-items: stretch; }
.tool-panel { min-width: 0; padding: 18px; border-radius: 20px; background: rgba(255,255,255,.58); border: 1px solid rgba(255,255,255,.84); box-shadow: inset 0 1px rgba(255,255,255,.82); }
.panel-title { display: flex; align-items: center; gap: 9px; margin: 0 0 14px; font-size: 16px; font-weight: 800; }
.panel-title svg { width: 20px; height: 20px; stroke: #397df4; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.upload-zone { position: relative; min-height: 250px; display: grid; place-items: center; text-align: center; cursor: pointer; border: 1.5px dashed rgba(89, 145, 234, .55); border-radius: 16px; background: linear-gradient(135deg, rgba(255,255,255,.76), rgba(226,244,255,.62)); transition: .2s ease; overflow: hidden; }
.upload-zone:hover, .upload-zone.is-dragover { border-color: #4385fa; box-shadow: 0 0 0 4px rgba(79,144,255,.12); }
.upload-zone.is-busy { cursor: progress; opacity: .78; }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-zone-inner { padding: 24px; }
.upload-icon { width: 46px; height: 46px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 15px; color: #fff; background: linear-gradient(135deg, #4b82ff, #74d7f2); box-shadow: 0 12px 26px rgba(62,129,250,.24); }
.upload-icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.upload-zone strong { display: block; font-size: 15px; }
.upload-zone small { display: block; margin-top: 7px; color: #71839c; line-height: 1.6; }
.image-preview { display: none; width: 100%; height: 250px; object-fit: contain; padding: 10px; background: rgba(255,255,255,.7); }
.upload-zone.has-preview .upload-zone-inner { display: none; }
.upload-zone.has-preview .image-preview { display: block; }
.image-batch-count { position: absolute; inset-inline-end: 10px; inset-block-end: 10px; padding: 5px 8px; border: 1px solid rgba(255,255,255,.78); border-radius: 999px; background: rgba(31, 63, 109, .8); color: #fff; font-size: 12px; font-weight: 700; line-height: 1.2; box-shadow: 0 2px 8px rgba(23, 53, 97, .15); }
.image-batch { margin-top: 10px; border: 1px solid rgba(133,185,245,.38); border-radius: 12px; background: rgba(247,251,255,.72); overflow: hidden; }
.image-batch[hidden] { display: none; }
.image-batch-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 7px; color: #506786; font-size: 12px; font-weight: 700; }
.image-batch-summary strong { color: #2f69b7; font-variant-numeric: tabular-nums; }
.image-batch-list { display: grid; gap: 1px; margin: 0; padding: 0; list-style: none; background: rgba(133,185,245,.2); }
.image-batch-item { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 7px 9px; background: rgba(255,255,255,.82); }
.image-batch-index { width: 20px; height: 20px; flex: 0 0 20px; display: grid; place-items: center; border: 1px solid rgba(115,171,238,.45); border-radius: 50%; color: #3673c4; background: rgba(235,246,255,.9); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.image-batch-name { min-width: 0; flex: 1; overflow: hidden; color: #425b7b; font-size: 12px; line-height: 1.35; text-align: start; text-overflow: ellipsis; white-space: nowrap; }
.image-batch-remove { width: 30px; height: 30px; flex: 0 0 30px; border: 1px solid rgba(133,185,245,.42); border-radius: 9px; color: #52749e; background: rgba(255,255,255,.82); font-size: 18px; line-height: 1; cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.image-batch-remove:hover { border-color: rgba(97,145,212,.72); color: #285c9f; background: #fff; }
.image-batch-remove:focus-visible { outline: 2px solid #6299fc; outline-offset: 2px; }
.privacy-note { margin: 12px 1px 0; color: #74859b; font-size: 12px; line-height: 1.55; }
.ocr-text { width: 100%; min-height: 230px; resize: vertical; border: 1px solid rgba(154,187,228,.44); background: rgba(250,253,255,.78); border-radius: 15px; padding: 13px; outline: none; color: #263a57; line-height: 1.65; }
.ocr-text:focus { border-color: #6299fc; box-shadow: 0 0 0 4px rgba(84,145,253,.12); }
.tool-status { min-height: 22px; margin-top: 10px; color: #74859b; font-size: 13px; }
.tool-status.error { color: #bd455a; }
.tool-status.success { color: #278357; }
.ocr-progress {
  display: block;
  width: 100%;
  height: 6px;
  margin: 8px 0 0;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #dff4fb;
  accent-color: #00aceb;
}
.ocr-progress[hidden] { display: none; }
.ocr-progress::-webkit-progress-bar { border-radius: 999px; background: #dff4fb; }
.ocr-progress::-webkit-progress-value { border-radius: 999px; background: #00aceb; transition: width .2s ease; }
.ocr-progress::-moz-progress-bar { border-radius: 999px; background: #00aceb; }
.ocr-confidence-note { margin-top: 8px; padding: 7px 9px; border: 1px solid rgba(220, 173, 71, .45); border-radius: 10px; background: rgba(255, 247, 218, .76); color: #8a6422; font-size: 12px; line-height: 1.45; }
.ocr-confidence-note[hidden] { display: none; }
.tool-actions { display: flex; gap: 10px; margin-top: 10px; }
.btn-primary, .btn-secondary, .style-chip { border: 0; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.btn-primary { min-height: 42px; padding: 0 18px; border-radius: 13px; color: #fff; font-weight: 700; background: linear-gradient(100deg, #4c81ff, #77d8ef); box-shadow: 0 10px 24px rgba(65,132,247,.23); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(65,132,247,.3); }
.btn-primary:disabled { cursor: wait; opacity: .68; transform: none; }
.btn-primary.is-loading::before { content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 7px; border: 1.5px solid rgba(255,255,255,.48); border-top-color: #fff; border-radius: 50%; vertical-align: -1px; animation: tool-spin .7s linear infinite; }
@keyframes tool-spin { to { transform: rotate(360deg); } }
.btn-secondary { min-height: 42px; padding: 0 15px; border-radius: 13px; color: #38536f; background: rgba(255,255,255,.75); border: 1px solid rgba(138,183,238,.5); font-weight: 650; }
.btn-secondary:disabled { cursor: not-allowed; opacity: .48; }
.copy-actions { align-items: stretch; }
.copy-actions > button { flex: 1 1 108px; }
.style-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 13px; }
.style-chip { border: 1px solid rgba(140,183,238,.47); padding: 8px 10px; border-radius: 11px; background: rgba(255,255,255,.72); color: #46627e; font-size: 13px; }
.style-chip.active, .style-chip:hover { color: #fff; border-color: transparent; background: linear-gradient(100deg, #4c81ff, #77d8ef); }
/* 场景文案两个板块（通用 / 节日文案）的分组容器 */
.copy-group { padding: 14px 14px 6px; margin-bottom: 12px; border: 1px solid rgba(148,163,184,.18); border-radius: 16px; background: rgba(248,251,255,.55); }
.copy-group-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 11px; }
.copy-group-title { font-size: 14px; font-weight: 800; color: #003b52; }
.copy-group-desc { font-size: 12px; color: #7b8ca1; }
.copy-group .style-row { margin-bottom: 11px; }
.copy-group .scene-row { margin-bottom: 6px; }
.copy-group .festival-row { padding-top: 0; border-top: 0; margin-bottom: 6px; }
.scene-label { flex: 0 0 auto; color: #5b7391; background: rgba(235,242,250,.7); border: 1px solid rgba(148,163,184,.22); padding: 5px 9px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.scene-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 13px; }
/* 场景/节日 chip 与「社区交流」版块标签（安装经验/售后排查）同款交互样式 */
.scene-chip,
.festival-chip {
  position: relative !important;
  isolation: isolate;
  flex: 0 0 auto;
  height: 32px !important;
  padding: 0 12px !important;
  border: 1px solid rgba(0,172,235,.34) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, .50) !important;
  color: #003b52 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .12s ease !important;
}
.scene-chip:hover,
.festival-chip:hover {
  border-color: #99dcf0 !important;
  background: rgba(255, 255, 255, .92) !important;
  color: #003b52 !important;
}
.scene-chip.active,
.festival-chip.active {
  border-color: #6fd4f4 !important;
  background: #e6f7fd !important;
  color: #174e7c !important;
  box-shadow: inset 0 -2px 0 #00aceb, inset 0 0 0 1px rgba(37, 132, 221, .16), 0 8px 18px rgba(37, 132, 221, .09) !important;
  font-weight: 700 !important;
}
.festival-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 13px; padding-top: 12px; border-top: 1px dashed rgba(140,183,238,.4); }
.festival-label { flex: 0 0 auto; color: #8a6a2f; background: rgba(250,229,188,.5); border: 1px solid rgba(217,174,101,.4); padding: 6px 9px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.festival-chip.festival-now { position: relative; box-shadow: inset 0 0 0 1px rgba(37,132,221,.22), 0 0 0 2px rgba(0,134,255,.3) !important; }
.festival-chip.festival-now::after { content: '临近'; position: absolute; top: -8px; right: -6px; padding: 1px 6px; border-radius: 8px; background: #e8663d; color: #fff; font-size: 10px; font-weight: 700; }
.copy-output { width: 100%; min-height: 230px; resize: vertical; border: 1px solid rgba(154,187,228,.4); background: rgba(255,255,255,.76); border-radius: 15px; padding: 13px; outline: none; color: #283c58; line-height: 1.75; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
.copy-output:empty::before { content: attr(data-empty-message); color: #7b8ca1; }
.tool-feature-note { border-radius: 22px; padding: 20px 23px; margin: 0 0 40px; display: grid; grid-template-columns: 42px 1fr; gap: 13px; }
.tool-feature-note svg { width: 30px; height: 30px; stroke: #4385fa; fill: none; stroke-width: 1.8; }
.tool-feature-note strong { display: block; margin-bottom: 4px; }
.tool-feature-note p { margin: 0; color: #667a96; line-height: 1.65; font-size: 14px; }
@media (max-width: 980px) {
  .tools-nav-inner { grid-template-columns: 1fr; gap: 6px; padding: 10px 0; }
  .tools-nav-note { display: none; }
  .tools-nav-menu { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .tools-nav-menu::-webkit-scrollbar { display: none; }
  .tools-logo { padding-left: 2px; }
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .tool-grid .tool-panel:last-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  :root { --tools-gutter: 14px; }
  .tools-container { width: calc(100% - (var(--tools-gutter) * 2)); }
  .tools-nav-inner { min-height: 0; }
  .tools-logo-mark { width: 36px; height: 36px; flex-basis: 36px; border-radius: 10px; }
  .tools-logo strong { font-size: 14px; }
  .tools-logo > span:not(.tools-logo-mark) { font-size: 11px; }
  .tools-nav-menu { gap: 1px; justify-content: space-between; }
  .tools-nav-menu a { padding: 8px 8px; font-size: 12px; }
  .tools-hero { padding: 16px 0 14px; }
  .tools-hero-shell { border-radius: 22px; padding: 21px 19px; }
  .tools-eyebrow { padding: 6px 9px; font-size: 12px; }
  .tools-hero h1 { margin: 12px 0 7px; font-size: 28px; }
  .tools-hero p { font-size: 14px; line-height: 1.6; }
  .tool-workspace { padding: 14px; border-radius: 20px; }
  main > .tool-workspace:first-child { margin-top: 14px; }
  .tool-workspace-head { align-items: flex-start; gap: 10px; margin-bottom: 14px; }
  .tool-workspace-head h2 { font-size: 19px; }
  .tool-workspace-head p { font-size: 12px; }
  .local-badge { font-size: 11px; padding: 6px 8px; }
  .tool-grid { grid-template-columns: 1fr; gap: 12px; }
  .tool-grid .tool-panel:last-child { grid-column: auto; }
  .tool-panel { padding: 14px; border-radius: 16px; }
  .upload-zone { min-height: 190px; }
  .image-preview { height: 190px; }
  .ocr-text, .copy-output { min-height: 150px; }
  .tool-feature-note { padding: 15px; border-radius: 18px; margin-bottom: 24px; }
}

/* The dedicated mobile URL must remain a vertical phone layout even when opened on a desktop browser. */
body.mobile-page[data-page="tools"] {
  /* Match the home page's viewport-inclusive phone canvas. */
  width: min(100vw, 390px) !important;
  max-width: 390px !important;
  min-height: 100vh;
  margin-left: 0 !important;
  margin-right: auto !important;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 9%, rgba(0,172,235,.42), transparent 24%),
    radial-gradient(circle at 88% 4%, rgba(0,172,235,.24), transparent 26%),
    radial-gradient(circle at 18% 82%, rgba(219, 234, 254, .58), transparent 28%),
    linear-gradient(145deg, #f0fafd 0%, #f7fcfe 44%, #e6f7fd 100%) !important;
}
body.mobile-page[data-page="tools"] main,
body.mobile-page[data-page="tools"] .tools-nav { width: 100%; min-width: 0; }
body.mobile-page[data-page="tools"] { --tools-gutter: 10px; }
body.mobile-page[data-page="tools"] .tools-container { width: calc(100% - (var(--tools-gutter) * 2)); max-width: none; margin-inline: auto; }
body.mobile-page[data-page="tools"] section.tools-container.tool-workspace,
body.mobile-page[data-page="tools"] aside.tools-container.tool-feature-note {
  width: calc(100% - (var(--tools-gutter) * 2)) !important;
  max-width: none !important;
  margin-inline: auto !important;
}
body.mobile-page[data-page="tools"] .tools-hero { padding: 12px 0 14px; }
body.mobile-page[data-page="tools"] .tools-hero-shell { padding: 22px; border-radius: 20px; }
body.mobile-page[data-page="tools"] .tools-eyebrow { display: none; }
body.mobile-page[data-page="tools"] .tools-hero h1 { margin: 0 0 5px; font-size: 25px; }
body.mobile-page[data-page="tools"] .tools-hero p { font-size: 13px; line-height: 1.55; }
body.mobile-page[data-page="tools"] .tool-workspace { padding: 12px; border-radius: 18px; margin-bottom: 12px; }
body.mobile-page[data-page="tools"] main > .tool-workspace:first-child { margin-top: 10px; }
body.mobile-page[data-page="tools"] .tool-workspace-head { gap: 8px; margin-bottom: 10px; }
body.mobile-page[data-page="tools"] .tool-workspace-head h2 { font-size: 19px; }
body.mobile-page[data-page="tools"] .tool-workspace-head p { font-size: 12px; }
body.mobile-page[data-page="tools"] .local-badge,
body.mobile-page[data-page="tools"] .vision-badge { padding: 6px 8px; font-size: 11px; }
body.mobile-page[data-page="tools"] .tool-grid { grid-template-columns: minmax(0, 1fr); gap: 9px; }
body.mobile-page[data-page="tools"] .tool-grid .tool-panel:last-child { grid-column: auto; }
body.mobile-page[data-page="tools"] .tool-panel { padding: 12px; border-radius: 15px; }
body.mobile-page[data-page="tools"] .panel-title { margin-bottom: 10px; font-size: 15px; }
body.mobile-page[data-page="tools"] .upload-zone { min-height: 142px; }
body.mobile-page[data-page="tools"] .image-preview { height: 142px; }
body.mobile-page[data-page="tools"] .image-batch-count { inset-inline-end: 8px; inset-block-end: 8px; padding: 4px 7px; font-size: 10px; }
body.mobile-page[data-page="tools"] .image-batch { margin-top: 8px; border-radius: 10px; }
body.mobile-page[data-page="tools"] .image-batch-summary { padding: 7px 8px 6px; font-size: 11px; }
body.mobile-page[data-page="tools"] .image-batch-item { gap: 7px; padding: 6px 8px; }
body.mobile-page[data-page="tools"] .image-batch-index { width: 18px; height: 18px; flex-basis: 18px; font-size: 10px; }
body.mobile-page[data-page="tools"] .image-batch-name { font-size: 11px; }
body.mobile-page[data-page="tools"] .image-batch-remove { width: 32px; height: 32px; flex-basis: 32px; border-radius: 8px; }
body.mobile-page[data-page="tools"] .upload-zone-inner { padding: 14px; }
body.mobile-page[data-page="tools"] .upload-icon { width: 36px; height: 36px; margin-bottom: 7px; border-radius: 12px; }
body.mobile-page[data-page="tools"] .upload-icon svg { width: 19px; height: 19px; }
body.mobile-page[data-page="tools"] .upload-zone strong { font-size: 14px; }
body.mobile-page[data-page="tools"] .upload-zone small { margin-top: 4px; font-size: 11px; line-height: 1.45; }
body.mobile-page[data-page="tools"] .privacy-note { margin-top: 8px; font-size: 11px; }
body.mobile-page[data-page="tools"] .ocr-text,
body.mobile-page[data-page="tools"] .copy-output { min-height: 122px; padding: 11px; font-size: 13px; }
body.mobile-page[data-page="tools"] .tool-status { min-height: 18px; margin-top: 7px; font-size: 11px; }
body.mobile-page[data-page="tools"] .ocr-confidence-note { margin-top: 6px; padding: 6px 8px; font-size: 11px; }
body.mobile-page[data-page="tools"] .style-chip { padding: 7px 8px; font-size: 12px; }
body.mobile-page[data-page="tools"] .style-row { gap: 6px; margin-bottom: 9px; }
body.mobile-page[data-page="tools"] .copy-group { padding: 11px 10px 6px; margin-bottom: 9px; border-radius: 13px; }
body.mobile-page[data-page="tools"] .copy-group-head { margin-bottom: 8px; }
body.mobile-page[data-page="tools"] .tool-actions { flex-wrap: wrap; gap: 7px; margin-top: 8px; }
body.mobile-page[data-page="tools"] .btn-primary,
body.mobile-page[data-page="tools"] .btn-secondary { min-height: 44px; padding: 0 13px; font-size: 13px; }
body.mobile-page[data-page="tools"] .scene-chip,
body.mobile-page[data-page="tools"] .festival-chip { min-height: 44px !important; height: 44px !important; }
body.mobile-page[data-page="tools"] .image-batch-remove { width: 44px; height: 44px; flex-basis: 44px; }
body.mobile-page[data-page="tools"] .tool-actions .btn-primary { flex: 1 1 150px; }
body.mobile-page[data-page="tools"] .copy-actions > button { flex: 1 1 calc(50% - 4px); }
body.mobile-page[data-page="tools"] .copy-actions .btn-primary { flex-basis: 100%; }
body.mobile-page[data-page="tools"] .tool-feature-note { grid-template-columns: 28px 1fr; gap: 9px; padding: 12px; border-radius: 16px; margin-bottom: 18px; }
body.mobile-page[data-page="tools"] .tool-feature-note p { font-size: 12px; line-height: 1.5; }

/* Keep the dedicated mobile tools URL aligned with the shared home navigation. */
body.mobile-page[data-page="tools"] .tools-nav-inner {
  width: calc(100% - 20px) !important;
  max-width: 370px !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 6px !important;
  margin-inline: auto !important;
  padding: 10px 0 8px !important;
}

body.mobile-page[data-page="tools"] .logo {
  width: 100% !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
}

body.mobile-page[data-page="tools"] .logo-mark {
  width: 36px !important;
  height: 36px !important;
  flex: 0 0 36px !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 0 !important;
  overflow: visible !important;
}

body.mobile-page[data-page="tools"] .logo-mark img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

body.mobile-page[data-page="tools"] .logo-copy strong {
  font-size: 17px !important;
  line-height: 20px !important;
}

body.mobile-page[data-page="tools"] .logo-copy span {
  font-size: 11px !important;
  line-height: 1.27 !important;
}

body.mobile-page[data-page="tools"] .tools-nav-note { display: none !important; }

body.mobile-page[data-page="tools"] .tools-nav-menu {
  position: static !important;
  width: 100% !important;
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  align-items: center !important;
  gap: 3px !important;
  padding: 2px !important;
  overflow: visible !important;
  white-space: normal !important;
  border: 1px solid rgba(148, 163, 184, .20) !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, .94) !important;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .08) !important;
  backdrop-filter: blur(18px) !important;
}

body.mobile-page[data-page="tools"] .tools-nav-menu a {
  min-width: 0 !important;
  width: auto !important;
  height: 30px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 2px !important;
  border-radius: 12px !important;
  color: #40556d !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}

body.mobile-page[data-page="tools"] .tools-nav-menu a.active {
  background: rgba(255, 255, 255, .42) !important;
  color: #3478dd !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5) !important;
}

/* Match the mobile home navigation surface while preserving the tool page grid. */
body.mobile-page[data-page="tools"] .tools-nav-menu {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* The workspace title is the page's first visible heading after the hero was
   intentionally removed. Keep it in the same title tier as product search:
   26px on desktop and 22px on the dedicated mobile layout. */
body[data-page="tools"] .tool-workspace-head h2 {
  margin: 0 0 12px !important;
  font-size: 26px !important;
  line-height: 1.18 !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}

body.mobile-page[data-page="tools"] .tool-workspace-head h2 {
  margin: 0 0 8px !important;
  font-size: 22px !important;
  line-height: 1.18 !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}

/* Keep the OCR editor focus light and consistent with the rest of the site. */
body[data-page="tools"] .ocr-text:focus {
  border-color: rgba(82, 142, 200, .42) !important;
  box-shadow: 0 0 0 2px rgba(82, 142, 200, .08) !important;
  outline: none !important;
}

/* 移动端优化 */
@media (max-width: 768px) {
  .upload-zone {
    min-height: 180px;
    padding: 20px 16px;
  }

  .btn-primary,
  .btn-secondary {
    min-height: 48px;
    font-size: 16px;
    padding: 12px 24px;
  }

  .ocr-text {
    min-height: 150px;
    font-size: 16px;
    line-height: 1.6;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }
}

/* Toast 提示 */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  padding: 12px 24px;
  background: #333;
  color: #fff;
  border-radius: 8px;
  font-size: 15px;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9999;
  max-width: 90%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.toast-show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-error {
  background: #f44336;
}

.toast-warning {
  background: #ff9800;
}

.toast-success {
  background: #4caf50;
}

.toast-info {
  background: #2196f3;
}

