:root {
  color-scheme: light;
  --bg: #f7f6f2;
  --card: #ffffff;
  --ink: #1d1d1b;
  --muted: #6d6d68;
  --dim: #9a9a93;
  --soon-ink: #55554f;
  --line: #e4e4df;
  --line-soft: #ecebe6;
  --accent: #2f6f5f;
  --accent-ink: #245a4d;
  --accent-strong: #245a4d;
  --on-accent: #ffffff;
  --accent-soft: #e9f1ee;
  --dash: #cfd8d3;
  --stage: #eceae4;
  --row-active: #fafaf7;
  --error: #b42318;
  --avatar-bg: #e9f1ee;
  --avatar-border: #d9e7e1;
  --toggle-bg: #ffffff;
  --toggle-border: #e4e4df;
  --dot-glow: transparent;
  --body-image:
    radial-gradient(46% 32% at 0% 0%, rgba(61, 220, 151, .08), transparent 62%),
    radial-gradient(42% 30% at 100% 0%, rgba(245, 181, 68, .07), transparent 60%),
    radial-gradient(40% 28% at 6% 62%, rgba(177, 140, 255, .05), transparent 66%),
    radial-gradient(52% 34% at 100% 100%, rgba(85, 200, 255, .06), transparent 65%);
  --body-size: auto;
  --body-repeat: no-repeat;
  --radius: 14px;
  --maxw: 720px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080d0b;
  --card: #0d1512;
  --ink: #e8f5ef;
  --muted: #8ba39a;
  --dim: #7d9188;
  --soon-ink: #cfe4da;
  --line: #1b2a24;
  --line-soft: #18241f;
  --accent: #3ddc97;
  --accent-ink: #3ddc97;
  --accent-strong: #2fbf82;
  --on-accent: #06110c;
  --accent-soft: rgba(61, 220, 151, .08);
  --dash: rgba(61, 220, 151, .3);
  --stage: #0a100d;
  --row-active: #0f1a15;
  --error: #ff6b6b;
  --avatar-bg: #0d1a14;
  --avatar-border: #2f5a49;
  --toggle-bg: #0d1512;
  --toggle-border: #1b2a24;
  --dot-glow: rgba(61, 220, 151, .9);
  --body-image:
    linear-gradient(rgba(255, 255, 255, .012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .012) 1px, transparent 1px);
  --body-size: 26px 26px;
  --body-repeat: repeat;
}

/* 分类色：白天用深色系，夜间用霓虹色 */
.group-image {
  --accent: #1f7a5f;
  --tile-bg: rgba(31, 122, 95, .13);
  --tile-border: rgba(31, 122, 95, .32);
  --tile-glow: transparent;
  --solid-shadow: 0 6px 16px rgba(31, 122, 95, .18);
}

.group-convert {
  --accent: #b04a35;
  --tile-bg: rgba(176, 74, 53, .13);
  --tile-border: rgba(176, 74, 53, .32);
  --tile-glow: transparent;
  --solid-shadow: 0 6px 16px rgba(176, 74, 53, .18);
}

.group-util {
  --accent: #8f5e12;
  --tile-bg: rgba(143, 94, 18, .14);
  --tile-border: rgba(143, 94, 18, .34);
  --tile-glow: transparent;
  --solid-shadow: 0 6px 16px rgba(143, 94, 18, .18);
}

.group-text {
  --accent: #6b4bb8;
  --tile-bg: rgba(107, 75, 184, .13);
  --tile-border: rgba(107, 75, 184, .32);
  --tile-glow: transparent;
  --solid-shadow: 0 6px 16px rgba(107, 75, 184, .18);
}

.group-dev {
  --accent: #1f6f9e;
  --tile-bg: rgba(31, 111, 158, .13);
  --tile-border: rgba(31, 111, 158, .32);
  --tile-glow: transparent;
  --solid-shadow: 0 6px 16px rgba(31, 111, 158, .18);
}

[data-theme="dark"] .group-image {
  --accent: #3ddc97;
  --tile-bg: rgba(61, 220, 151, .10);
  --tile-border: rgba(61, 220, 151, .5);
  --tile-glow: rgba(61, 220, 151, .10);
  --solid-shadow: 0 0 20px rgba(61, 220, 151, .4);
}

[data-theme="dark"] .group-convert {
  --accent: #ff8f75;
  --tile-bg: rgba(255, 143, 117, .10);
  --tile-border: rgba(255, 143, 117, .5);
  --tile-glow: rgba(255, 143, 117, .10);
  --solid-shadow: 0 0 20px rgba(255, 143, 117, .4);
}

[data-theme="dark"] .group-util {
  --accent: #f5b544;
  --tile-bg: rgba(245, 181, 68, .10);
  --tile-border: rgba(245, 181, 68, .5);
  --tile-glow: rgba(245, 181, 68, .10);
  --solid-shadow: 0 0 20px rgba(245, 181, 68, .4);
}

[data-theme="dark"] .group-text {
  --accent: #b18cff;
  --tile-bg: rgba(177, 140, 255, .10);
  --tile-border: rgba(177, 140, 255, .5);
  --tile-glow: rgba(177, 140, 255, .10);
  --solid-shadow: 0 0 20px rgba(177, 140, 255, .4);
}

[data-theme="dark"] .group-dev {
  --accent: #55c8ff;
  --tile-bg: rgba(85, 200, 255, .10);
  --tile-border: rgba(85, 200, 255, .5);
  --tile-glow: rgba(85, 200, 255, .10);
  --solid-shadow: 0 0 20px rgba(85, 200, 255, .4);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0 18px calc(48px + env(safe-area-inset-bottom));
  background-color: var(--bg);
  background-image: var(--body-image);
  background-size: var(--body-size);
  background-repeat: var(--body-repeat);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 图标雪碧图（Lucide，ISC） */
.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-glyph {
  fill: currentColor;
  stroke: none;
}

.chevron {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--accent);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 0 4px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .01em;
  text-decoration: none;
}

.brand::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--dot-glow);
}

.tagline {
  color: var(--muted);
  font-size: 13px;
}

.theme-toggle {
  margin-left: auto;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--toggle-border);
  border-radius: 12px;
  background: var(--toggle-bg);
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon.icon-sun {
  display: none;
}

[data-theme="dark"] .theme-icon.icon-sun {
  display: block;
}

[data-theme="dark"] .theme-icon.icon-moon {
  display: none;
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
}

.intro {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 22px 0 6px;
}

.avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--avatar-border);
  border-radius: 50%;
  background: var(--avatar-bg);
  color: var(--accent);
  font-size: 20px;
  font-weight: 600;
}

[data-theme="dark"] .avatar {
  box-shadow: 0 0 20px rgba(61, 220, 151, .12);
}

.intro-body h1 {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.4;
  letter-spacing: .01em;
}

.intro-body p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.intro-body p + p {
  margin-top: 6px;
}

/* ---- 菜单式工具分组 ---- */

.tool-groups {
  margin-top: 30px;
}

.group {
  margin-top: 26px;
}

.group:first-child {
  margin-top: 0;
}

.group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding-left: 2px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
}

.group-title::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

[data-theme="dark"] .group-title::before {
  box-shadow: 0 0 8px var(--accent);
}

.group-count {
  color: var(--accent);
  opacity: .55;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
}

.menu {
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu > li {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.menu > li + li {
  margin-top: 10px;
}

.menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 14px;
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

a.menu-row:active {
  background: var(--row-active);
}

a.menu-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.menu-icon {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--tile-border);
  border-radius: 13px;
  background: var(--tile-bg);
  color: var(--accent);
}

.menu-icon .icon {
  width: 22px;
  height: 22px;
}

[data-theme="dark"] .menu-icon {
  box-shadow: inset 0 0 16px var(--tile-glow);
}

.menu-icon::after {
  content: none;
}

[data-theme="dark"] .menu-icon::after {
  content: "";
  position: absolute;
  left: 7px;
  bottom: 7px;
  width: 5px;
  height: 5px;
  border-left: 1px solid var(--tile-border);
  border-bottom: 1px solid var(--tile-border);
}



.menu-body {
  flex: 1 1 auto;
  min-width: 0;
}

.menu-name {
  display: block;
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}


.menu-desc {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.menu-status {
  flex: 0 0 auto;
  min-width: 44px;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
  white-space: nowrap;
}

.is-soon .menu-name {
  color: var(--soon-ink);
}

.site-footer {
  max-width: var(--maxw);
  margin: 44px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 13px;
  line-height: 1.7;
}

.site-footer p {
  margin: 0;
}

.site-footer .copyright {
  margin-top: 8px;
  color: var(--dim);
}

.site-footer a {
  color: var(--accent-ink);
  text-decoration: none;
}

.site-footer a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.site-footer .version {
  color: var(--dim);
}

@media (max-width: 359px) {
  .tagline {
    display: none;
  }
}

@media (min-width: 380px) {
  .menu-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .menu-icon .icon {
    width: 24px;
    height: 24px;
  }
}

@media (min-width: 640px) {
  .site-header {
    padding-top: 36px;
  }

  .menu-row {
    padding: 16px 18px;
  }

  .menu-icon {
    width: 52px;
    height: 52px;
  }

  .menu-icon .icon {
    width: 26px;
    height: 26px;
  }

  .group {
    margin-top: 30px;
  }
}

/* ---- 工具页 ---- */

.back-link {
  display: inline-block;
  margin-top: 18px;
  color: var(--accent-ink);
  font-size: 14px;
  text-decoration: none;
}

.back-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tool-page h1 {
  margin: 18px 0 6px;
  font-size: 24px;
  line-height: 1.35;
}

.tool-page .lead {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.upload-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 220px;
  margin-top: 18px;
  padding: 24px;
  border: 1.5px dashed var(--dash);
  border-radius: var(--radius);
  background: var(--card);
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.upload-drop.is-drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.upload-icon {
  width: 34px;
  height: 34px;
  margin-bottom: 4px;
  color: var(--accent);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-title {
  font-size: 17px;
  font-weight: 600;
}

.upload-hint {
  color: var(--muted);
  font-size: 13px;
}

.upload-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.editor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.file-meta {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
}

.btn-link {
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--accent-ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.btn-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 16px;
}

.spec-chip {
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.spec-chip.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.spec-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.spec-meta {
  margin: -6px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.stage-wrap {
  margin-top: 2px;
}

.stage {
  display: block;
  width: 100%;
  height: min(56vh, 440px);
  min-height: 300px;
  border-radius: var(--radius);
  background: var(--stage);
  cursor: grab;
  touch-action: none;
}

.stage:active {
  cursor: grabbing;
}

.stage-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.zoom-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.zoom-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.zoom {
  flex: 1 1 auto;
  height: 32px;
  accent-color: var(--accent);
}

.export-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.export-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.export-label {
  color: var(--muted);
  font-size: 12px;
}

.export-info strong {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .01em;
}

#export-spec {
  color: var(--muted);
  font-size: 12px;
}

.btn-primary {
  flex: 0 0 auto;
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:active {
  background: var(--accent-strong);
}

.btn-primary:disabled {
  opacity: .6;
  cursor: default;
}

.btn-primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.status {
  margin: 10px 0 0;
  color: var(--accent-ink);
  font-size: 13px;
}

.error {
  margin: 10px 0 0;
  color: var(--error);
  font-size: 13px;
}

.tool-footnote {
  margin: 18px 0 0;
  color: var(--dim);
  font-size: 12px;
}

/* ---- 图片压缩 ---- */

.compress-settings {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.target-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.target-label {
  color: var(--muted);
  font-size: 14px;
}

.target-input {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.target-input input {
  width: 108px;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  text-align: center;
}

.target-input input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.target-unit {
  color: var(--muted);
  font-size: 14px;
}

.unit-select {
  height: 46px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.unit-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
}

.mode-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.mode-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.percent-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.warning {
  margin: 12px 0 0;
  color: var(--error);
  font-size: 13px;
}

.compress-actions {
  margin-top: 14px;
}

.compress-actions .btn-primary {
  width: 100%;
}

.results {
  margin: 18px 0 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  list-style: none;
}

.result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.result-row + .result-row {
  border-top: 1px solid var(--line-soft);
}

.result-thumb {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--stage);
  color: var(--dim);
  font-size: 16px;
  font-weight: 700;
}

.result-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-thumb.is-fail {
  color: var(--error);
}

.result-body {
  flex: 1 1 auto;
  min-width: 0;
}

.result-name {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.result-badge {
  flex: 0 0 auto;
  color: var(--dim);
  font-size: 12px;
}

.result-badge.is-ok {
  color: var(--accent-ink);
}

.result-badge.is-fail {
  color: var(--error);
}

.download-box {
  margin-top: 18px;
}

.download-box .btn-primary {
  width: 100%;
}

.notice {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  font-size: 15px;
}

.notice p {
  margin: 0;
  color: var(--muted);
}

.notice p + p {
  margin-top: 8px;
}

.notice strong {
  color: var(--ink);
}

/* ---- 更新日志 ---- */

.log {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.log-entry {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.log-entry:first-child {
  padding-top: 4px;
  border-top: 0;
}

.log-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.log-version {
  font-size: 16px;
  font-weight: 600;
}

.log-date {
  color: var(--muted);
  font-size: 12px;
}

.log-entry ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 520px) {
  .export-box {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-primary {
    width: 100%;
  }
}

/* ---- 图片压缩 v2：文件框 + 参数区 ---- */

.file-card {
  margin-top: 18px;
  padding: 18px 16px;
  border: 1.5px dashed var(--dash);
  border-radius: var(--radius);
  background: var(--card);
  text-align: center;
}

.file-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.file-box.is-drag {
  opacity: .75;
}

.file-title {
  font-size: 17px;
  font-weight: 600;
}

.file-hint {
  color: var(--muted);
  font-size: 13px;
}

.progress-wrap {
  margin-top: 14px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--accent-soft);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .15s ease;
}

.progress-text {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.file-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.options-card {
  margin-top: 16px;
  padding: 4px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.option-row:last-of-type {
  border-bottom: 0;
}

.option-row > label {
  flex: 1 1 auto;
  color: var(--muted);
  font-size: 14px;
}

.option-row select {
  height: 42px;
  max-width: 55%;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.option-row select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.exif-panel {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.exif-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.exif-head small {
  color: var(--dim);
  font-size: 12px;
  text-align: right;
}

.exif-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
}

.exif-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.exif-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.action-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 16px;
}

.action-row .btn-primary {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  padding: 0 12px;
  white-space: nowrap;
}

.action-row #download-btn {
  flex: 1 1 0;
  min-width: 0;
}

@media (max-width: 520px) {
  .action-row .btn-primary {
    width: auto;
  }
}

.preview-wrap {
  margin: 10px 0 0;
  font-size: 13px;
}

.preview-wrap a {
  color: var(--accent-ink);
}

.warning {
  margin: 12px 0 0;
  color: var(--error);
  font-size: 13px;
}

@media (max-width: 359px) {
  .option-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .option-row select {
    max-width: none;
  }
}
.option-field {
  margin-top: 14px;
}

.option-field > label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.option-field select {
  width: 100%;
  height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.option-field select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.option-field .target-input {
  display: flex;
  width: 100%;
}

.option-field .target-input input {
  flex: 1 1 auto;
  width: auto;
}

.option-field .target-input select {
  flex: 0 0 auto;
  width: auto;
  min-width: 74px;
}

.range-input {
  display: block;
  width: 100%;
  height: 34px;
  accent-color: var(--accent);
}

.exif-note {
  margin: 6px 0 0;
  color: var(--dim);
  font-size: 12px;
}
/* ---- 证件照：底色 / 容差 ---- */

.id-options .specs {
  margin-top: 8px;
}

.bg-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.bg-swatch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.bg-swatch.is-active {
  border-color: var(--accent);
  color: var(--ink);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.swatch-dot {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 50%;
}

.tolerance-row {
  margin-top: 10px;
}

.tolerance-row > label {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 12px;
}
.bg-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.bg-row .bg-swatches {
  flex: 1 1 auto;
  min-width: 0;
}

.bg-preview {
  flex: 0 0 auto;
  width: 60px;
  height: 84px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--stage);
}
.stage-wrap {
  position: relative;
}

.stage-empty {
  position: absolute;
  inset: 0 0 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 20px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  pointer-events: none;
}
.id-photo .upload-drop {
  padding: 24px 16px;
}

.id-photo .upload-icon {
  width: 40px;
  height: 40px;
}
/* ---- 已选图片列表 ---- */

.file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  margin-top: 10px;
  overflow-y: auto;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--card);
}

.file-thumb {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--accent-soft);
}

.file-item-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item-size {
  flex: 0 0 auto;
  color: var(--dim);
  font-size: 11px;
}

.file-item-remove {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.file-item-remove:hover {
  background: var(--row-active);
  color: var(--ink);
}

.file-item-remove:disabled {
  opacity: .5;
}
.upload-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 6px;
  margin-top: 2px;
}

.pick-more {
  display: block;
  margin: 2px auto 0;
}
.upload-actions .btn-link {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-ink);
  font-size: 13px;
}
.photo-tips {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.photo-tips h2 {
  margin: 0 0 6px;
  color: var(--accent-ink);
  font-size: 14px;
}

.photo-tips ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}
.range-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.range-name {
  flex: 0 0 32px;
  color: var(--muted);
  font-size: 12px;
}

.range-line input[type="range"] {
  flex: 1 1 auto;
  min-width: 0;
  accent-color: var(--accent);
}

.range-val {
  flex: 0 0 20px;
  color: var(--dim);
  font-size: 12px;
  text-align: right;
}

.segmented {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.segmented button {
  flex: 1 1 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.segmented button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.manual-reset {
  margin-top: 4px;
  padding-left: 0;
  color: var(--accent-ink);
}

.stage.is-manual {
  cursor: crosshair;
}
.manual-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.manual-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.manual-toggle-copy strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.manual-toggle-copy span {
  color: var(--muted);
  font-size: 12px;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 50px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
  transition: background .18s ease;
}

.switch .switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .18s ease;
}

.switch[aria-checked="true"] {
  background: var(--accent);
}

.switch[aria-checked="true"] .switch-knob {
  transform: translateX(20px);
}

.manual-panel {
  margin-top: 10px;
  padding: 2px 16px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.zoom-row .zoom {
  flex: 1 1 auto;
  min-width: 0;
}

.zoom-lock {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
}

.zoom-lock svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zoom-lock.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.stage.is-locked {
  cursor: default;
}

.stage.is-manual {
  cursor: crosshair;
}
/* ---- 工具内页：清爽化 ---- */

body.tool-body {
  background-color: var(--bg);
  background-image: radial-gradient(70% 32% at 50% 0%, var(--accent-soft), transparent 72%);
}

.tool-page {
  padding-top: 22px;
}

.tool-page h1 {
  margin: 8px 0 8px;
  font-size: 28px;
  letter-spacing: -.02em;
}

.tool-page .lead {
  max-width: 34em;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.tool-page .back-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--muted);
  font-size: 13px;
}

.file-card {
  margin-top: 0;
  padding: 22px 16px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--card);
}

.file-title {
  font-size: 16px;
}

.file-hint {
  font-size: 12.5px;
}

.file-meta {
  margin-top: 6px;
  font-size: 12px;
}

.file-list {
  gap: 4px;
  margin-top: 8px;
}

.file-item {
  padding: 6px 8px;
  border: 0;
  border-radius: 9px;
  background: var(--bg);
}

.file-thumb {
  width: 34px;
  height: 34px;
  border-radius: 7px;
}

.file-item-name {
  font-size: 12.5px;
}

.file-item-remove {
  width: 30px;
  height: 30px;
  font-size: 18px;
}

.options-card {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--card);
}

.panel-title {
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
}

.option-field {
  margin-top: 14px;
}

.option-field > label {
  margin-bottom: 6px;
  color: var(--dim);
  font-size: 12px;
  letter-spacing: .01em;
}

.option-field select {
  height: 46px;
  border-color: var(--line-soft);
  border-radius: 10px;
  background: var(--bg);
  font-size: 14px;
}

.target-input input,
.target-input select {
  height: 46px;
  border-color: var(--line-soft);
  border-radius: 10px;
  background: var(--bg);
}

.exif-note {
  margin-top: 6px;
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.55;
}

.exif-fields {
  gap: 7px 14px;
  margin-top: 8px;
}

.exif-field {
  font-size: 12.5px;
}

.warning {
  margin-top: 10px;
  font-size: 12.5px;
}

.action-row {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.action-row .btn-primary {
  min-height: 50px;
  border-radius: 12px;
  font-size: 15px;
}

.action-row #download-btn {
  background: var(--accent-soft);
  color: var(--accent-ink);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.preview-wrap {
  margin-top: 10px;
  font-size: 12.5px;
}

.tool-footnote {
  margin-top: 18px;
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.6;
}

/* 证件照 */

.id-photo .upload-drop {
  padding: 26px 16px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--card);
}

.id-photo .upload-icon {
  width: 40px;
  height: 40px;
}

.id-photo .upload-title {
  font-size: 16px;
}

.id-photo .upload-hint {
  font-size: 12.5px;
}

.id-photo .upload-note {
  margin-top: 8px;
  font-size: 11.5px;
}

.photo-tips {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: transparent;
}

.photo-tips h2 {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 13px;
}

.photo-tips ul {
  padding-left: 16px;
  font-size: 12.5px;
  line-height: 1.7;
}

.id-photo .editor-bar {
  margin-top: 16px;
}

.id-photo .file-meta {
  font-size: 12px;
}

.id-options .specs {
  gap: 6px;
  margin: 10px 0 8px;
}

.id-photo .spec-chip {
  min-height: 40px;
  padding: 7px 13px;
  border-color: var(--line-soft);
  font-size: 13px;
}

.id-photo .spec-chip.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.id-photo .spec-meta {
  margin: 0 0 4px;
  font-size: 12px;
}

.id-photo .stage {
  height: min(50vh, 400px);
  min-height: 280px;
  border-radius: 14px;
}

.id-photo .stage-hint {
  margin-top: 7px;
  font-size: 11.5px;
}

.id-photo .zoom-row {
  margin-top: 8px;
}

.id-photo .zoom-label {
  font-size: 12px;
}

.zoom-lock {
  width: 42px;
  height: 42px;
}

.bg-swatches {
  gap: 7px;
}

.bg-swatch {
  padding: 5px 8px 5px 5px;
  border-color: var(--line-soft);
  font-size: 12px;
}

.swatch-dot {
  width: 22px;
  height: 22px;
}

.bg-preview {
  width: 56px;
  height: 78px;
  border-color: var(--line-soft);
  border-radius: 7px;
}

.manual-toggle-card {
  margin-top: 10px;
  padding: 11px 14px;
  border-color: var(--line-soft);
  border-radius: 12px;
}

.manual-toggle-copy strong {
  font-size: 13.5px;
}

.manual-toggle-copy span {
  font-size: 11.5px;
}

.manual-panel {
  margin-top: 8px;
  padding: 2px 16px 16px;
  border-color: var(--line-soft);
  border-radius: 12px;
}

.id-photo .segmented button {
  min-height: 38px;
  font-size: 12.5px;
}

.id-photo .range-name,
.id-photo .range-val {
  font-size: 11.5px;
}

.id-photo .tool-footnote {
  margin-top: 16px;
}
.id-options .specs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.id-options .spec-chip {
  padding-right: 4px;
  padding-left: 4px;
  text-align: center;
}
/* ---- 文档格式转换 ---- */

.doc-convert .mode-tabs {
  display: block;
}

.doc-convert .mode-group + .mode-group {
  margin-top: 14px;
}

.doc-convert .mode-group-label {
  display: block;
  margin: 0 0 6px 2px;
  color: var(--dim);
  font-size: 11.5px;
  letter-spacing: .06em;
}

.doc-convert .mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.doc-convert .mode-grid .spec-chip {
  min-height: 44px;
  padding: 8px 6px;
  border-color: var(--line-soft);
  border-radius: 11px;
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
}

.doc-convert .mode-grid .spec-chip.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

.doc-convert .mode-grid .spec-chip:disabled {
  opacity: .55;
  cursor: default;
}

@media (min-width: 620px) {
  .doc-convert .mode-grid.is-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .doc-convert .mode-grid.is-five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 619px) {
  .doc-convert .mode-grid.is-five .spec-chip:last-child {
    grid-column: 1 / -1;
  }
}

.docx-stage {
  position: fixed;
  top: 0;
  left: -20000px;
  z-index: -1;
  background: #fff;
}

.docx-stage .docx-wrapper {
  padding: 0 !important;
  background: #fff !important;
}

.docx-stage section.docx {
  box-shadow: none !important;
  margin: 0 !important;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.color-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-row input[type="color"] {
  flex: 0 0 auto;
  width: 52px;
  height: 46px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
}

.color-row .text-input {
  flex: 1 1 auto;
  min-width: 0;
  text-transform: uppercase;
}

.field-note-warn {
  margin: 10px 0 0;
  padding: 9px 12px;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  line-height: 1.6;
}

.preview-text {
  max-height: 360px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.doc-convert .file-card {
  margin-top: 14px;
}

.doc-convert .file-card.is-drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.doc-convert .file-badge {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
}

.doc-convert .file-item-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 2px;
}

.doc-convert .icon-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.doc-convert .icon-btn:hover:not(:disabled) {
  background: var(--row-active);
  color: var(--ink);
}

.doc-convert .icon-btn:disabled {
  opacity: .35;
  cursor: default;
}

.doc-convert .icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.option-note {
  margin: 10px 0 0;
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.6;
}

.text-input {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.text-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.html-preview {
  display: block;
  width: 100%;
  height: 320px;
  margin-top: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
}

.result-summary {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.print-link {
  margin-top: 6px;
  padding-left: 0;
  font-size: 13px;
}
/* ---- 文档格式转换 v2：预览 / 排序 / 查看器 ---- */

.preview-area {
  margin-top: 12px;
}

.preview-html {
  display: block;
  width: 100%;
  height: 420px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
}

.preview-note {
  margin: 8px 0 0;
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.6;
}

.preview-loading {
  padding: 18px 0;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
}

.preview-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.preview-thumb {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  aspect-ratio: 3 / 4;
}

.preview-thumb canvas,
.preview-thumb img {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.preview-item-name {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-single {
  display: block;
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
}

.preview-pdf-first {
  display: block;
  width: 100%;
  height: auto;
  max-height: 72vh;
  object-fit: contain;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fff;
}

.result-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.btn-secondary {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--accent-ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--accent-soft);
}

.btn-secondary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.sortable .file-item {
  cursor: grab;
}

.sortable .file-item.is-dragging {
  opacity: .45;
}

.sortable .file-item.is-drop-target {
  box-shadow: inset 0 2px 0 var(--accent);
}

.drag-handle {
  flex: 0 0 auto;
  padding-right: 2px;
  color: var(--dim);
  font-size: 13px;
  letter-spacing: -1px;
  user-select: none;
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: #080c0a;
}

.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  color: #f2f7f4;
  font-size: 13px;
}

.viewer-close {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.viewer-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 0 12px 28px;
}

.viewer-page {
  display: block;
  max-width: 100%;
  margin: 0 auto 12px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
}

.viewer-hint {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, .6);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 520px) {
  .preview-html {
    height: 340px;
  }

  .preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  }
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 80;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(20, 26, 23, .92);
  color: #f2f7f4;
  font-size: 13px;
  transform: translateX(-50%);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}

.toast.is-out {
  opacity: 0;
  transform: translate(-50%, 6px);
}