/* ==========================================================================
   烟雨集 · 界面
   以宣纸、青灰、黛色为基调，尽量安静，让照片说话。
   ========================================================================== */

:root {
  --paper: #f4f2ec;
  --paper-warm: #fbfaf6;
  --ink: #242b28;
  --ink-2: #5c6661;
  --ink-3: #8b928d;
  --line: #dcd8cc;
  --line-soft: #e8e5db;
  --celadon: #5d7f75;
  --celadon-deep: #405a52;
  --celadon-soft: #eaefe9;
  --seal: #a9473a;
  --stage-shadow: 0 2px 4px rgba(36, 43, 40, 0.12), 0 18px 45px rgba(36, 43, 40, 0.28);
  --serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  background: var(--paper);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(93, 127, 117, 0.24);
}

button,
input,
select {
  font-family: inherit;
}

button {
  color: inherit;
}

.app {
  display: grid;
  grid-template-columns: 354px minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
}

/* ============================== 侧栏 ============================== */

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 40%),
    linear-gradient(180deg, #fcfbf7 0%, #f7f5ef 100%);
  border-right: 1px solid var(--line);
}

.sidebar-scroll {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  padding: 24px 22px 16px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cfcab9 transparent;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 8px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: #d3cec0;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.sidebar-dock {
  flex: 0 0 auto;
  padding: 12px 22px 15px;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(252, 251, 247, 0.55), rgba(250, 249, 244, 0.98)),
    linear-gradient(180deg, #fcfbf7, #f7f5ef);
  box-shadow: 0 -12px 24px rgba(36, 43, 40, 0.05);
  backdrop-filter: blur(8px);
}

.sidebar-dock .section-head {
  margin-bottom: 4px;
}

.sidebar-dock .preset-desc {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 10px;
  min-height: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}

.dock-meta .mini-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 2px 0 0;
}

.seal {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #f7f1e6;
  background: linear-gradient(145deg, #b4513f, #94382d);
  border-radius: 6px;
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 3px 8px rgba(148, 56, 45, 0.28);
  transform: rotate(-2deg);
  user-select: none;
}

.brand-text h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.2em;
  line-height: 1.15;
}

.brand-text p {
  margin: 4px 0 0;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
}

.open-row {
  display: flex;
  gap: 8px;
}

.open-row .btn-primary {
  flex: 1;
}

/* ------------------------------ 通用按钮 ------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  background: transparent;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.1s ease;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #f6f4ee;
  box-shadow: 0 1px 2px rgba(36, 43, 40, 0.18);
}

.btn-primary:hover {
  background: #333d38;
  border-color: #333d38;
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.35);
}

.btn-ghost:hover {
  background: #fff;
  color: var(--ink);
}

.btn-wide {
  width: 100%;
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

/* ------------------------------ 区块 ------------------------------ */

.section {
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.section-head h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--ink-3);
}

.section-note {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #a9afa9;
}

.value {
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------ 滤镜格 ------------------------------ */

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 9px;
}

.filter-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.filter-card .thumb {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(36, 43, 40, 0.12);
  border-radius: 8px;
  background: #e6e2d8;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.filter-card canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #e6e2d8;
}

.filter-card:hover .thumb {
  border-color: rgba(36, 43, 40, 0.34);
  transform: translateY(-1px);
}

.filter-card.active .thumb {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.filter-card .check {
  position: absolute;
  top: 6px;
  right: 6px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink);
  color: #f6f4ee;
  font-size: 10px;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.filter-card.active .check {
  display: flex;
}

.filter-card .badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(169, 71, 58, 0.94);
  color: #fff;
  font-size: 9px;
  letter-spacing: 0.1em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.filter-card .name {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--ink-2);
  transition: color 0.15s ease;
}

.filter-card .name .cn {
  font-weight: 400;
}

.filter-card.active .name {
  color: var(--ink);
  font-weight: 600;
}

.filter-card .name .tag {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--seal);
  opacity: 0.9;
}

.filter-card.sig {
  grid-column: span 2;
}

.filter-card.sig .thumb {
  border-radius: 10px;
}

.filter-card.sig .name {
  font-size: 12.5px;
}

/* ------------------------------ 滑块 ------------------------------ */

.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  margin: 4px 0 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.range::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--ink) 0%, var(--ink) var(--fill, 100%), #dad6ca var(--fill, 100%), #dad6ca 100%);
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  margin-top: -5px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: #fcfbf7;
  box-shadow: 0 1px 3px rgba(36, 43, 40, 0.25);
  transition: transform 0.12s ease;
}

.range:hover::-webkit-slider-thumb,
.range:focus-visible::-webkit-slider-thumb {
  transform: scale(1.12);
}

.range::-moz-range-track {
  height: 3px;
  border-radius: 3px;
  background: #dad6ca;
}

.range::-moz-range-progress {
  height: 3px;
  border-radius: 3px;
  background: var(--ink);
}

.range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: #fcfbf7;
}

.range-sm::-webkit-slider-runnable-track {
  height: 2px;
}

.range-sm::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -5px;
}

.preset-desc {
  min-height: 17px;
  margin: 8px 1px 0;
  font-size: 10.5px;
  line-height: 1.65;
  color: var(--ink-3);
}

.field {
  margin-top: 10px;
}

.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.field-head label {
  font-size: 11px;
  color: var(--ink-2);
  letter-spacing: 0.02em;
  cursor: pointer;
}

/* ------------------------------ 烟雨面板 ------------------------------ */

.rain-panel {
  margin-top: 0;
  padding: 12px 12px 9px;
  border: 1px solid #d3ded6;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0)),
    var(--celadon-soft);
  transition: opacity 0.2s ease;
}

.rain-panel[hidden] {
  display: none;
}

.rain-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.rain-grid .field {
  margin-top: 8px;
}

.rain-grid .field-head label {
  font-size: 10.5px;
}

.rain-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.rain-title {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--celadon-deep);
}

.mini-btn {
  padding: 3px 9px;
  border: 1px solid rgba(64, 90, 82, 0.26);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.35);
  color: var(--celadon-deep);
  font-size: 10px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.mini-btn:hover {
  background: #fff;
}

.mini-btn.wide {
  width: 100%;
  margin-top: 12px;
  padding: 6px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px dashed rgba(64, 90, 82, 0.2);
  font-size: 11px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}

.switch-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 30px;
  height: 17px;
  border-radius: 20px;
  background: #cfd6d0;
  transition: background-color 0.18s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s ease;
}

.switch-row input:checked + .switch {
  background: var(--celadon);
}

.switch-row input:checked + .switch::after {
  transform: translateX(13px);
}

.switch-row input:focus-visible + .switch {
  outline: 2px solid var(--celadon);
  outline-offset: 2px;
}

/* ------------------------------ 基础调整 ------------------------------ */

.advanced {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.advanced summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.advanced summary::-webkit-details-marker {
  display: none;
}

.advanced summary .chev {
  position: relative;
  width: 9px;
  height: 9px;
}

.advanced summary .chev::before,
.advanced summary .chev::after {
  content: "";
  position: absolute;
  top: 4px;
  width: 5px;
  height: 1px;
  background: currentColor;
  transition: transform 0.18s ease;
}

.advanced summary .chev::before {
  left: 0;
  transform: rotate(45deg);
}

.advanced summary .chev::after {
  right: 0;
  transform: rotate(-45deg);
}

.advanced[open] summary .chev::before {
  transform: rotate(-45deg);
}

.advanced[open] summary .chev::after {
  transform: rotate(45deg);
}

.advanced-body {
  padding: 4px 0 2px;
}

/* ------------------------------ 导出 ------------------------------ */

.export-section {
  padding-top: 2px;
}

.select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 11px;
  color: var(--ink-2);
}

.select-row select {
  -webkit-appearance: none;
  appearance: none;
  width: 174px;
  padding: 7px 26px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235c6661' stroke-width='1.2'/%3E%3C/svg%3E") no-repeat right 9px center;
  font-size: 11.5px;
  color: var(--ink);
  cursor: pointer;
}

.hint {
  margin: 8px 1px 0;
  font-size: 10px;
  line-height: 1.6;
  color: var(--ink-3);
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--celadon);
  box-shadow: 0 0 0 2px rgba(93, 127, 117, 0.16);
}

/* ============================== 舞台 ============================== */

.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 100% at 50% -10%, #f0eee7 0%, #e6e3da 46%, #d8d5ca 100%);
}

.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.055'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.stage-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 55px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(36, 43, 40, 0.1);
  background: rgba(251, 250, 246, 0.5);
  backdrop-filter: blur(10px);
}

.stage-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 4px 6px;
  border-radius: 5px;
  color: var(--ink-2);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.back-link svg {
  width: 14px;
  height: 14px;
}

.back-link:hover {
  color: var(--ink);
  background: rgba(36, 43, 40, 0.06);
}

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

.stage-divider {
  flex: 0 0 auto;
  width: 1px;
  height: 16px;
  background: rgba(36, 43, 40, 0.16);
}

.file-info {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.file-name {
  max-width: 38vw;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  flex: 0 0 auto;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.stage-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.actions-divider {
  width: 1px;
  height: 18px;
  margin: 0 3px;
  background: rgba(36, 43, 40, 0.16);
}

.size-select {
  -webkit-appearance: none;
  appearance: none;
  height: 30px;
  padding: 0 24px 0 9px;
  border: 1px solid rgba(36, 43, 40, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235c6661' stroke-width='1.2'/%3E%3C/svg%3E") no-repeat right 8px center;
  font-size: 11px;
  color: var(--ink-2);
  cursor: pointer;
}

.size-select:hover {
  background-color: #fff;
  color: var(--ink);
}

.btn-sm {
  height: 32px;
  padding: 0 13px;
  border-radius: 7px;
  font-size: 11.5px;
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

.chip {
  padding: 5px 11px;
  border: 1px solid rgba(36, 43, 40, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.4);
  color: var(--ink-2);
  font-size: 11px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.chip:hover {
  background: #fff;
  color: var(--ink);
}

.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #f6f4ee;
}

.canvas-area {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 28px 36px;
}

.canvas-stack {
  position: relative;
  border-radius: 2px;
  background: #fff;
  box-shadow: var(--stage-shadow), 0 0 0 1px rgba(255, 255, 255, 0.4);
  animation: rise-in 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.canvas-stack[hidden] {
  display: none;
}

.canvas-stack canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 2px;
}

#resultCanvas {
  clip-path: inset(0 0 0 var(--split, 0%));
}

.canvas-stack.hold #resultCanvas {
  opacity: 0;
}

.canvas-stack.no-anim #resultCanvas {
  transition: none;
}

.split-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--split, 50%);
  z-index: 3;
  width: 1px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.16);
  transform: translateX(-0.5px);
  pointer-events: none;
  cursor: ew-resize;
}

.split-line[hidden] {
  display: none;
}

.split-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(251, 250, 246, 0.94);
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 1px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.26);
  transform: translate(-50%, -50%);
  user-select: none;
}

.canvas-area.dragging,
.canvas-area.dragging .canvas-stack {
  cursor: ew-resize;
  user-select: none;
}

.canvas-area.dragging #resultCanvas {
  transition: none;
}

/* 空状态 / 覆盖层 */

.empty-state {
  max-width: 460px;
  padding: 42px 44px 38px;
  border: 1px dashed rgba(36, 43, 40, 0.26);
  border-radius: 14px;
  background: rgba(251, 250, 246, 0.55);
  text-align: center;
  animation: rise-in 0.6s ease both;
}

.empty-state[hidden] {
  display: none;
}

.empty-mark {
  width: 74px;
  margin: 0 auto 14px;
  color: var(--celadon);
  opacity: 0.8;
}

.empty-mark svg {
  display: block;
  width: 100%;
  height: auto;
}

.empty-state h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.empty-state p {
  margin: 0 0 18px;
  font-size: 11.5px;
  line-height: 1.9;
  color: var(--ink-3);
}

.empty-sub {
  margin: 14px 0 0 !important;
  font-size: 10px !important;
  letter-spacing: 0.06em;
  color: #a5aaa4 !important;
}

.processing {
  position: absolute;
  top: 24px;
  left: 50%;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  border: 1px solid var(--line);
  border-radius: 40px;
  background: rgba(252, 251, 247, 0.94);
  box-shadow: 0 6px 24px rgba(36, 43, 40, 0.16);
  color: var(--ink-2);
  font-size: 12px;
  transform: translateX(-50%);
  backdrop-filter: blur(6px);
}

.processing[hidden] {
  display: none;
}

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(36, 43, 40, 0.14);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.drop-overlay {
  position: absolute;
  inset: 16px;
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(93, 127, 117, 0.6);
  border-radius: 12px;
  background: rgba(234, 239, 233, 0.66);
  backdrop-filter: blur(2px);
  pointer-events: none;
}

.drop-overlay[hidden] {
  display: none;
}

.drop-card {
  padding: 12px 24px;
  border-radius: 30px;
  background: var(--ink);
  color: #f6f4ee;
  font-size: 13px;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 30px rgba(36, 43, 40, 0.3);
}

.stage-foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 34px;
  padding: 0 22px;
  border-top: 1px solid rgba(36, 43, 40, 0.08);
  background: rgba(251, 250, 246, 0.32);
  color: rgba(36, 43, 40, 0.58);
  font-size: 10px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.stage-hint {
  flex: 0 0 auto;
  opacity: 0.8;
}

/* ============================== 提示 ============================== */

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  z-index: 50;
  padding: 10px 20px;
  border-radius: 30px;
  background: rgba(34, 41, 38, 0.94);
  color: #f4f2ec;
  font-size: 12px;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.24s ease, transform 0.24s ease;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.24);
}

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

/* ============================== 动画 ============================== */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================== 响应式 ============================== */

@media (max-width: 1180px) {
  .app {
    grid-template-columns: 320px minmax(0, 1fr);
  }
  .sidebar-scroll {
    padding: 20px 18px 14px;
  }
  .sidebar-dock {
    padding: 12px 18px 14px;
  }
  .canvas-area {
    padding: 22px 24px;
  }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }
  .app {
    display: flex;
    flex-direction: column-reverse;
    height: auto;
    min-height: 100vh;
  }
  .sidebar {
    overflow: visible;
    border-right: 0;
    border-top: 1px solid var(--line);
  }
  .sidebar-scroll {
    overflow: visible;
    padding: 20px 22px 8px;
  }
  .sidebar-dock {
    position: static;
  }
  .filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 10px;
  }
  .filter-card.sig {
    grid-column: span 2;
  }
  .filter-card.sig .thumb {
    max-width: none;
  }
  .stage {
    height: 58vh;
    min-height: 420px;
  }
  .canvas-area {
    padding: 16px;
  }
  .stage-bar {
    padding: 0 14px;
  }
  .file-name {
    max-width: 40vw;
  }
  .stage-hint {
    display: none;
  }
  .stage-foot {
    padding: 0 14px;
  }
}

@media (max-width: 560px) {
  .back-text {
    display: none;
  }
  .stage-divider {
    display: none;
  }
  .file-meta {
    display: none;
  }
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stage-actions .size-select {
    display: none;
  }
  .stage-actions .chip {
    padding: 4px 8px;
    font-size: 10px;
  }
  .file-name {
    max-width: 26vw;
  }
  .empty-state {
    padding: 28px 22px;
  }
  .empty-state h2 {
    font-size: 17px;
  }
}
