:root,
[data-theme="jade"] {
  color-scheme: light;
  --ink: #16302b;
  --muted: #62756f;
  --line: #e2ebe7;
  --paper: #f6f8f7;
  --stage: #f7f9f8;
  --card: #ffffff;
  --accent: #0c7c74;
  --accent-strong: #09665f;
  --accent-soft: #e4f5f2;
  --accent-ink: #ffffff;
  --danger: #a12f2f;
  --radius: 20px;
  --btn-radius: 999px;
  --brand-radius: 9px;
  --nav-track: #ebeff0;
  --chip-batch-bg: #eef1f8;
  --chip-batch-ink: #4a5f92;
  --glow-a: rgba(12, 124, 116, 0.16);
  --glow-b: rgba(70, 140, 120, 0.1);
  --font-display: "Sora", "Segoe UI", sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --ritual-mark: "◇";
}
[data-theme="wuxia"] {
  --ink: #1b1410;
  --muted: #6d5c4c;
  --line: #e2d3bf;
  --paper: #f4ebe0;
  --stage: #efe3d2;
  --card: #fff7ec;
  --accent: #b83228;
  --accent-strong: #8f221c;
  --accent-soft: #f3ddd6;
  --accent-ink: #fff8f0;
  --danger: #8f221c;
  --radius: 14px;
  --btn-radius: 6px;
  --brand-radius: 3px;
  --nav-track: #e7d9c6;
  --chip-batch-bg: #eadfcf;
  --chip-batch-ink: #5a3f2e;
  --glow-a: rgba(184, 50, 40, 0.14);
  --glow-b: rgba(40, 90, 70, 0.12);
  --font-display: "ZCOOL XiaoWei", "Noto Serif SC", "Source Serif 4", serif;
  --font-body: "Source Serif 4", "Noto Serif SC", Georgia, serif;
  --ritual-mark: "剑";
}
[data-theme="qinghua"] {
  --ink: #16324f;
  --muted: #5d738a;
  --line: #d7e2ee;
  --paper: #f3f7fb;
  --stage: #eef4fa;
  --card: #ffffff;
  --accent: #1f5a9a;
  --accent-strong: #164679;
  --accent-soft: #e3eef9;
  --accent-ink: #ffffff;
  --danger: #9b2c2c;
  --radius: 18px;
  --btn-radius: 999px;
  --brand-radius: 999px;
  --nav-track: #e4ebf3;
  --chip-batch-bg: #e8eef7;
  --chip-batch-ink: #355886;
  --glow-a: rgba(31, 90, 154, 0.14);
  --glow-b: rgba(120, 160, 200, 0.12);
  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --ritual-mark: "瓷";
}
[data-theme="cinnabar"] {
  --ink: #2a1714;
  --muted: #7a5a52;
  --line: #ead8d1;
  --paper: #f7efe9;
  --stage: #f3e7df;
  --card: #fff9f5;
  --accent: #c23b22;
  --accent-strong: #9a2c18;
  --accent-soft: #f6ddd5;
  --accent-ink: #fff8f4;
  --danger: #9a2c18;
  --radius: 12px;
  --btn-radius: 8px;
  --brand-radius: 4px;
  --nav-track: #ebddd5;
  --chip-batch-bg: #f0e2da;
  --chip-batch-ink: #7a3b2e;
  --glow-a: rgba(194, 59, 34, 0.14);
  --glow-b: rgba(180, 120, 60, 0.1);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --ritual-mark: "印";
}
[data-theme="bamboo"] {
  --ink: #1d2c1a;
  --muted: #61735b;
  --line: #d9e5d3;
  --paper: #f3f7ef;
  --stage: #eef5e8;
  --card: #fbfff7;
  --accent: #3f7a3a;
  --accent-strong: #2f5f2c;
  --accent-soft: #e3f0df;
  --accent-ink: #f7fff4;
  --danger: #a12f2f;
  --radius: 18px;
  --btn-radius: 999px;
  --brand-radius: 10px;
  --nav-track: #e4ecdf;
  --chip-batch-bg: #e7efe0;
  --chip-batch-ink: #456140;
  --glow-a: rgba(63, 122, 58, 0.14);
  --glow-b: rgba(140, 170, 90, 0.1);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --ritual-mark: "竹";
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 16px/1.55 var(--font-body);
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; height: auto; }
.wrap {
  width: min(1080px, calc(100% - 40px));
  margin-left: auto;
  margin-right: auto;
}

.stage {
  position: relative;
  isolation: isolate;
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  overflow: hidden;
  background: var(--stage);
}
.stage-glow {
  --mx: 0px;
  --my: 0px;
  pointer-events: none;
  position: absolute;
  width: 56vmax;
  height: 56vmax;
  left: 50%;
  top: 20%;
  margin-left: -28vmax;
  margin-top: -28vmax;
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 40%, var(--glow-a), transparent 55%),
    radial-gradient(circle at 65% 60%, var(--glow-b), transparent 60%);
  transform: translate3d(var(--mx), var(--my), 0);
  animation: breathe 5.5s ease-in-out infinite;
  z-index: 0;
  will-change: transform, opacity, filter;
}
.stage-mist,
.stage-peaks {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
}
[data-theme="wuxia"] .stage-mist {
  opacity: 1;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(255, 248, 236, 0.55), transparent 45%),
    radial-gradient(ellipse at 80% 70%, rgba(255, 248, 236, 0.4), transparent 40%);
  animation: mistDrift 12s ease-in-out infinite alternate;
}
[data-theme="wuxia"] .stage-peaks {
  opacity: 1;
  background:
    linear-gradient(to top, rgba(40, 28, 18, 0.12), transparent 42%),
    linear-gradient(135deg, transparent 40%, rgba(40, 28, 18, 0.08) 41%, transparent 42%),
    linear-gradient(155deg, transparent 55%, rgba(40, 28, 18, 0.1) 56%, transparent 58%);
  background-position: bottom, 10% 100%, 70% 100%;
  background-size: 100% 100%, 50% 55%, 45% 48%;
  background-repeat: no-repeat;
}
[data-theme="qinghua"] .stage-mist {
  opacity: 1;
  background:
    radial-gradient(circle at 15% 20%, rgba(31, 90, 154, 0.08), transparent 35%),
    radial-gradient(circle at 85% 30%, rgba(31, 90, 154, 0.06), transparent 40%);
}
[data-theme="bamboo"] .stage-mist {
  opacity: 1;
  background:
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(63, 122, 58, 0.04) 46px 48px),
    radial-gradient(ellipse at 50% 0%, rgba(63, 122, 58, 0.08), transparent 50%);
}
@keyframes mistDrift {
  from { transform: translateX(-1.5%); }
  to { transform: translateX(1.5%); }
}
@keyframes breathe {
  0%, 100% { opacity: 0.72; filter: blur(0px) saturate(1); }
  50% { opacity: 1; filter: blur(1px) saturate(1.15); }
}

header {
  position: relative;
  z-index: 2;
  height: 68px;
  flex: 0 0 68px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  background: transparent;
}
.header-end { justify-self: end; }
.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.04em;
  font-size: 1.02rem;
}
.brand span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: 9px;
  border-radius: var(--brand-radius);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
}
[data-theme="wuxia"] .brand span,
[data-theme="cinnabar"] .brand span {
  box-shadow: inset 0 0 0 1px rgba(255, 248, 240, 0.35);
  font-family: var(--font-display);
}
h1 {
  margin: 0;
  justify-self: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a9b96;
}
.theme-dock {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto 4px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(20, 30, 28, 0.04);
}
.theme-dock-label {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.theme-bar {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.theme-bar button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 34px;
  width: auto;
  height: auto;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 650;
  box-shadow: none;
  overflow: visible;
}
.theme-bar button i {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--swatch, var(--accent));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.theme-bar button[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
  transform: none;
}
.theme-bar button[data-theme-set="jade"] { --swatch: #0c7c74; }
.theme-bar button[data-theme-set="wuxia"] { --swatch: #b83228; }
.theme-bar button[data-theme-set="qinghua"] { --swatch: #1f5a9a; }
.theme-bar button[data-theme-set="cinnabar"] { --swatch: #c23b22; }
.theme-bar button[data-theme-set="bamboo"] { --swatch: #3f7a3a; }
.theme-mute {
  flex: 0 0 auto;
  min-width: 72px;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: none;
}
.theme-mute[aria-pressed="true"] {
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: var(--accent-soft);
}
.header-end {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nav-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 14px;
  background: var(--nav-track);
}
.nav-tab {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  line-height: 1.15;
  border-radius: 11px;
  padding: 7px 12px;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.nav-tab small {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  opacity: 0.75;
}
.nav-tab:hover { color: var(--ink); }
.nav-tab[aria-current="page"] {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 40, 35, 0.06), 0 6px 16px rgba(20, 40, 35, 0.05);
}
.nav-tab[aria-current="page"] small { color: var(--accent); opacity: 1; }
.langs { display: flex; gap: 6px; align-items: center; padding-left: 6px; }
.langs a { color: var(--muted); font-size: 12px; text-decoration: none; }

.stage-body {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  width: min(1120px, calc(100% - 32px));
  margin: 8px auto 18px;
  animation: enter 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.tool {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
}
.board, .dock, .bar {
  border: 1px solid var(--line);
  background: var(--card);
}
.board {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
}
.board-chip {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tool[data-mode="batch"] .board-chip {
  background: var(--chip-batch-bg);
  color: var(--chip-batch-ink);
}
.drop {
  position: relative;
  flex: 1;
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  gap: 18px;
  padding: 56px 28px 40px;
  cursor: pointer;
}
.drop::before {
  content: "";
  position: absolute;
  inset: 20px;
  border: 1.5px dashed #c9d9d4;
  border-radius: 16px;
  pointer-events: none;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
  animation: dashPulse 2.4s ease-in-out infinite;
}
@keyframes dashPulse {
  0%, 100% {
    border-color: #c9d9d4;
    transform: scale(1);
    box-shadow: inset 0 0 0 0 rgba(12, 124, 116, 0);
  }
  50% {
    border-color: #6fafa5;
    transform: scale(1.015);
    box-shadow: inset 0 0 28px rgba(12, 124, 116, 0.06);
  }
}
.drop.is-over::before {
  border-color: var(--accent);
  border-style: solid;
  background: rgba(12, 124, 116, 0.05);
  transform: scale(1.03);
  box-shadow: inset 0 0 0 1px rgba(12, 124, 116, 0.08), 0 0 0 8px rgba(12, 124, 116, 0.06);
  animation: none;
}
.drop-visual {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  position: relative;
  z-index: 1;
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  transform: perspective(420px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transition: transform 0.12s ease-out;
  animation: visualFloat 3.6s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}
@keyframes visualFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -6px; }
}
.drop-visual i {
  position: absolute;
  inset: -8px;
  border-radius: 30px;
  border: 1.5px solid rgba(12, 124, 116, 0.28);
  pointer-events: none;
}
.drop-visual i:nth-of-type(1) { animation: ringOut 1.8s cubic-bezier(0.22, 1, 0.36, 1) infinite; }
.drop-visual i:nth-of-type(2) { animation: ringOut 1.8s cubic-bezier(0.22, 1, 0.36, 1) infinite 0.55s; }
.drop-visual i:nth-of-type(3) { animation: ringOut 1.8s cubic-bezier(0.22, 1, 0.36, 1) infinite 1.1s; }
.drop-visual b {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0c7c74;
  opacity: 0.55;
  pointer-events: none;
  z-index: 4;
  box-shadow: 0 0 10px rgba(12, 124, 116, 0.35);
}
.drop-visual b:nth-of-type(1) {
  top: 6px;
  right: 10px;
  animation: spark 2.4s ease-in-out infinite;
}
.drop-visual b:nth-of-type(2) {
  bottom: 12px;
  left: 4px;
  width: 5px;
  height: 5px;
  animation: spark 2.8s ease-in-out infinite 0.4s;
}
.drop-visual b:nth-of-type(3) {
  top: 18px;
  left: 8px;
  width: 4px;
  height: 4px;
  background: #5bb8ae;
  animation: spark 2.2s ease-in-out infinite 0.9s;
}
.drop-visual-single b:nth-of-type(2) {
  right: 4px;
  left: auto;
  bottom: 10px;
}
.drop-visual span {
  position: absolute;
  width: 40px;
  height: 50px;
  border-radius: 12px;
  background: linear-gradient(165deg, #ffffff 0%, #eef7f5 100%);
  border: 1px solid #d0e2dd;
  box-shadow: 0 10px 24px rgba(20, 50, 45, 0.1);
  transform-origin: 50% 90%;
  will-change: transform, box-shadow;
}
.drop-visual span:nth-of-type(1) {
  z-index: 3;
  animation: fanFront 2.1s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}
.drop-visual span:nth-of-type(2) {
  z-index: 2;
  animation: fanLeft 2.1s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}
.drop-visual span:nth-of-type(3) {
  z-index: 1;
  animation: fanRight 2.1s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}
.drop-visual-single span:nth-of-type(1) {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  animation: bob 1.8s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}
.drop.is-over .drop-visual {
  animation: visualFloatFast 0.9s ease-in-out infinite;
}
.drop.is-over .drop-visual span:nth-of-type(1) { animation: fanFrontFast 0.7s ease-in-out infinite; }
.drop.is-over .drop-visual span:nth-of-type(2) { animation: fanLeftFast 0.7s ease-in-out infinite; }
.drop.is-over .drop-visual span:nth-of-type(3) { animation: fanRightFast 0.7s ease-in-out infinite; }
.drop.is-over .drop-visual b { animation-duration: 0.9s; }
@keyframes visualFloatFast {
  0%, 100% { translate: 0 -2px; scale: 1.04; }
  50% { translate: 0 -10px; scale: 1.08; }
}
@keyframes fanFront {
  0%, 100% {
    transform: translateY(0) rotate(-1deg) scale(1);
    box-shadow: 0 10px 22px rgba(20, 50, 45, 0.1);
  }
  35% {
    transform: translateY(-16px) rotate(2deg) scale(1.07);
    box-shadow: 0 18px 32px rgba(20, 50, 45, 0.16);
  }
  70% {
    transform: translateY(-7px) rotate(-1deg) scale(1.03);
    box-shadow: 0 14px 26px rgba(20, 50, 45, 0.12);
  }
}
@keyframes fanLeft {
  0%, 100% {
    transform: translate(-10px, 6px) rotate(-14deg) scale(0.96);
    opacity: 0.72;
  }
  40% {
    transform: translate(-22px, -8px) rotate(-28deg) scale(1.02);
    opacity: 0.95;
  }
  75% {
    transform: translate(-16px, 0) rotate(-20deg) scale(0.98);
    opacity: 0.85;
  }
}
@keyframes fanRight {
  0%, 100% {
    transform: translate(10px, 6px) rotate(14deg) scale(0.96);
    opacity: 0.72;
  }
  45% {
    transform: translate(22px, -8px) rotate(28deg) scale(1.02);
    opacity: 0.95;
  }
  80% {
    transform: translate(16px, 0) rotate(20deg) scale(0.98);
    opacity: 0.85;
  }
}
@keyframes fanFrontFast {
  0%, 100% { transform: translateY(-4px) rotate(-2deg) scale(1.06); }
  50% { transform: translateY(-18px) rotate(3deg) scale(1.12); }
}
@keyframes fanLeftFast {
  0%, 100% { transform: translate(-16px, 2px) rotate(-22deg); }
  50% { transform: translate(-28px, -10px) rotate(-34deg); }
}
@keyframes fanRightFast {
  0%, 100% { transform: translate(16px, 2px) rotate(22deg); }
  50% { transform: translate(28px, -10px) rotate(34deg); }
}
@keyframes bob {
  0%, 100% {
    transform: translateY(0) scale(1) rotate(-2deg);
    box-shadow: 0 10px 22px rgba(20, 50, 45, 0.1);
  }
  40% {
    transform: translateY(-18px) scale(1.08) rotate(2deg);
    box-shadow: 0 22px 36px rgba(20, 50, 45, 0.18);
  }
  70% {
    transform: translateY(-8px) scale(1.03) rotate(-1deg);
    box-shadow: 0 14px 26px rgba(20, 50, 45, 0.12);
  }
}
@keyframes ringOut {
  0% { transform: scale(0.72); opacity: 0.65; }
  65% { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}
@keyframes spark {
  0%, 100% { transform: translate(0, 0) scale(0.7); opacity: 0.2; }
  35% { transform: translate(4px, -10px) scale(1.15); opacity: 0.85; }
  70% { transform: translate(-3px, -4px) scale(0.9); opacity: 0.45; }
}
.drop p {
  position: relative;
  z-index: 1;
  max-width: 28ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.45;
}
.tool-tip {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 40ch;
  font-size: 13.5px;
  color: var(--muted);
}
.tool-tip a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(9, 102, 95, 0.28);
  transition: border-color 0.2s ease;
}
.tool-tip a:hover { border-color: var(--accent-strong); }
.tool.has-batch .drop { flex: 0 0 auto; min-height: 0; padding: 20px 12px 12px; }
.tool.has-batch .drop::before { inset: 10px; animation: none; }
.tool.has-batch .drop-visual { display: none; }
.tool[data-mode="batch"].has-batch .drop > p:first-of-type,
.tool[data-mode="single"].has-batch .drop > p:first-of-type { display: none; }

.files {
  list-style: none;
  margin: 0;
  padding: 12px 14px 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  overflow: auto;
  min-height: 0;
  align-content: start;
}
.files:empty { display: none; }
.tool.has-batch .files { flex: 1; }
.file {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fafcfb;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.file:hover {
  transform: translateY(-2px);
  border-color: #c5d8d2;
}
.file img {
  width: 100%;
  height: 96px;
  object-fit: contain;
  border-radius: 10px;
  background: #eef3f1;
}
.file-index {
  position: absolute;
  top: 14px;
  left: 14px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 750;
  display: grid;
  place-items: center;
}
.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--ink);
}
.file-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.dock {
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
  overflow: auto;
  border-radius: var(--radius);
  padding: 18px 16px;
  animation: enter 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}
.dock-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8a9b96;
}
.options { display: grid; gap: 12px; }
.options label {
  display: grid;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a9b96;
  font-weight: 700;
  animation: enter 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.options label:nth-child(1) { animation-delay: 0.1s; }
.options label:nth-child(2) { animation-delay: 0.16s; }
.options label:nth-child(3) { animation-delay: 0.22s; }
.options label:nth-child(4) { animation-delay: 0.28s; }
.options label:nth-child(5) { animation-delay: 0.34s; }
select {
  appearance: none;
  font: inherit;
  color: var(--ink);
  background:
    linear-gradient(45deg, transparent 50%, #8a9b96 50%) right 12px center / 5px 5px no-repeat,
    linear-gradient(135deg, transparent 50%, #8a9b96 50%) right 7px center / 5px 5px no-repeat,
    #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 30px 10px 11px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
select:hover { border-color: #c5d8d2; }
select:focus {
  outline: none;
  border-color: rgba(12, 124, 116, 0.45);
  box-shadow: 0 0 0 3px rgba(12, 124, 116, 0.1);
}
button {
  font: inherit;
  font-family: var(--font-display);
  border: 0;
  border-radius: var(--btn-radius);
  padding: 11px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
#choose {
  position: relative;
  z-index: 1;
  min-width: 160px;
  min-height: 46px;
  font-size: 14.5px;
  overflow: hidden;
}
#choose::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 28%, rgba(255, 255, 255, 0.42) 48%, transparent 68%);
  transform: translateX(-120%);
  animation: sheen 2.4s ease-in-out infinite;
}
@keyframes sheen {
  0%, 40% { transform: translateX(-120%); }
  70%, 100% { transform: translateX(120%); }
}
.tool:not(.has-batch) #choose,
.tool[data-mode="batch"]:not(.has-batch) #choose {
  animation: softPulse 1.8s ease-in-out infinite;
}
@keyframes softPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent), 0 8px 18px color-mix(in srgb, var(--accent) 18%, transparent);
    transform: translateY(0) scale(1);
  }
  50% {
    box-shadow: 0 0 0 12px color-mix(in srgb, var(--accent) 14%, transparent), 0 14px 28px color-mix(in srgb, var(--accent) 24%, transparent);
    transform: translateY(-1px) scale(1.02);
  }
}
button:hover:not([disabled]) {
  background: var(--accent-strong);
  transform: translateY(-2px) scale(1.02);
}
button:active:not([disabled]) { transform: translateY(0); }
button[disabled] {
  opacity: 0.38;
  cursor: not-allowed;
  animation: none !important;
  box-shadow: none !important;
}
.download.is-working { cursor: wait; }
.file button,
.single-preview button {
  background: #eef3f1;
  color: var(--ink);
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 650;
  min-height: 32px;
  width: 100%;
}
.single-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fafcfb;
  max-width: 280px;
  margin: 0 auto 16px;
  animation: enter 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.single-preview img {
  width: 100%;
  height: 168px;
  object-fit: contain;
  border-radius: 12px;
  background:
    linear-gradient(45deg, #eef3f1 25%, transparent 25%) 0 0 / 14px 14px,
    linear-gradient(-45deg, #eef3f1 25%, transparent 25%) 0 7px / 14px 14px,
    #fafcfb;
}
.single-preview .file-actions { grid-template-columns: 1fr 1fr 1fr; }
.bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: 16px;
  padding: 10px 10px 10px 16px;
  animation: enter 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}
.meta { margin: 0; color: var(--muted); min-height: 1.2em; font-size: 14px; }
.error { margin: 0; color: var(--danger); font-size: 14px; }
.download {
  min-height: 46px;
  padding: 0 22px;
  white-space: nowrap;
  font-size: 14.5px;
}

.sheet {
  padding: 56px 0 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.lede {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: none;
  width: 100%;
  margin: 0 0 8px;
}
.prose { max-width: none; width: 100%; }
.sheet h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.25;
  margin: 36px 0 10px;
  letter-spacing: -0.02em;
}
.sheet a { color: var(--accent-strong); }
.steps { padding-left: 1.2rem; }
figure { margin: 16px 0 22px; }
figure img { border-radius: 14px; border: 1px solid var(--line); background: #fff; }
figcaption { color: var(--muted); font-size: 14px; }
.faq details { border-top: 1px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 700; }
footer { color: var(--muted); border-top: 1px solid var(--line); }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; padding: 18px 0 28px; }
footer nav { display: flex; gap: 14px; }
footer a { color: var(--ink); text-decoration: none; font-weight: 680; }

@media (max-width: 800px) {
  header {
    height: auto;
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    padding: 10px 12px 6px;
    gap: 8px;
  }
  h1 { flex: 1 0 100%; order: 3; text-align: left; font-size: 11px; margin-top: 2px; }
  .nav-switch { margin-left: auto; }
  .theme-dock {
    width: calc(100% - 16px);
    margin: 0 auto 6px;
    padding: 6px 8px;
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
  }
  .theme-dock-label {
    font-size: 10px;
    letter-spacing: 0.08em;
  }
  .theme-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 4px;
    padding-bottom: 1px;
  }
  .theme-bar::-webkit-scrollbar { display: none; }
  .theme-bar button {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 4px 8px;
    gap: 5px;
    font-size: 11px;
  }
  .theme-bar button i {
    width: 9px;
    height: 9px;
  }
  .theme-mute {
    width: auto;
    min-width: 52px;
    min-height: 28px;
    padding: 4px 8px;
    font-size: 11px;
  }
  .stage-body { width: calc(100% - 16px); margin: 4px auto 10px; }
  .tool { display: flex; flex-direction: column; gap: 8px; }
  .board { flex: 1; min-height: 140px; }
  .dock { flex: 0 0 auto; max-height: 34dvh; }
  .options { grid-template-columns: 1fr 1fr; }
  .bar { align-items: stretch; flex-direction: column; padding: 10px; }
  .download { width: 100%; }
  .drop p { font-size: 15px; }
  .files { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  footer .wrap { flex-direction: column; }
  .drop::before { inset: 12px; }
}
.ritual {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--stage) 72%, transparent);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.ritual.is-on {
  opacity: 1;
  pointer-events: auto;
}
.ritual-panel {
  position: relative;
  width: min(360px, calc(100% - 40px));
  padding: 36px 28px 28px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  text-align: center;
  box-shadow: 0 24px 60px rgba(20, 30, 28, 0.14);
  overflow: hidden;
}
.ritual-mark {
  margin: 0 auto 14px;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  animation: ritualSpin 1.8s linear infinite;
}
.ritual-mark::before { content: var(--ritual-mark); }
.ritual-panel::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: ritualBeam 1.2s ease-in-out infinite;
}
.ritual-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}
.ritual-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.ritual-quote {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-style: italic;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.ritual.is-on .ritual-quote {
  opacity: 0.92;
  transform: translateY(0);
  transition-delay: 0.12s;
}
[data-theme="wuxia"] .ritual-quote,
[data-theme="cinnabar"] .ritual-quote {
  font-style: normal;
  letter-spacing: 0.01em;
}
[data-theme="wuxia"] .ritual-panel {
  background:
    linear-gradient(180deg, rgba(184, 50, 40, 0.06), transparent 40%),
    var(--card);
}
[data-theme="wuxia"] .ritual-mark {
  border-radius: 4px;
  animation: ritualSeal 1.1s ease-in-out infinite;
}
[data-theme="qinghua"] .ritual-mark { animation: ritualRing 1.4s ease-out infinite; }
[data-theme="cinnabar"] .ritual-mark {
  border-radius: 6px;
  animation: ritualStamp 0.9s ease-in-out infinite;
}
[data-theme="bamboo"] .ritual-mark { animation: ritualSway 1.6s ease-in-out infinite; }
@keyframes ritualSpin {
  to { transform: rotate(360deg); }
}
@keyframes ritualSeal {
  0%, 100% { transform: scale(1) rotate(-4deg); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
  50% { transform: scale(1.08) rotate(4deg); box-shadow: 0 0 0 14px color-mix(in srgb, var(--accent) 12%, transparent); }
}
@keyframes ritualRing {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 25%, transparent); }
  100% { box-shadow: 0 0 0 22px transparent; }
}
@keyframes ritualStamp {
  0%, 100% { transform: translateY(0) scale(1); }
  40% { transform: translateY(4px) scale(0.94); }
  70% { transform: translateY(-2px) scale(1.04); }
}
@keyframes ritualSway {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(6deg); }
}
@keyframes ritualBeam {
  0%, 100% { opacity: 0.35; transform: scaleX(0.4); }
  50% { opacity: 1; transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
