@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&family=DM+Mono:wght@400;500&display=swap');

/* RESPONSIVE HELPERS */
.mobile-only { display: none !important; }
.desktop-only { display: block; }

@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; }
  .btn-row, .header, .steps-bar { display: none !important; } /* 彻底隐藏冗余容器 */
  
  body { flex-direction: column !important; overflow-x: hidden; }
  .panel-l, .panel-r { display: none !important; }

  .mobile-toolbar {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: calc(6px + env(safe-area-inset-top)) 10px 10px;
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e7e4dc;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .mobile-toolbar .m-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .mobile-toolbar .m-row.row-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px 64px;
    gap: 8px;
    align-items: center;
  }

  .mobile-toolbar .m-row.row-export {
    grid-template-columns: 1fr 1fr auto;
  }

  .mobile-toolbar .m-row.row-tools {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
  }

  .mobile-toolbar .m-ctl { 
    min-height: 40px; 
    border-radius: 10px; 
    font-size: 13px; 
    line-height: normal;
    background: #ffffff;
    color: #2c2c2a;
    border: 1px solid #e7e4dc;
    padding: 0 8px;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(44, 44, 42, 0.05);
  }

  .mobile-toolbar .m-icon-btn {
    min-width: 44px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
  }
  .mobile-toolbar .m-icon-btn.m-lang-btn {
    gap: 6px;
    min-width: 64px;
  }
  .mobile-toolbar #mReleaseTog {
    min-width: 54px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 10px;
    font-family: 'DM Mono', monospace;
    letter-spacing: 0.03em;
  }
  .mobile-toolbar .m-icon-btn .m-lang-text {
    font-size: 11px;
    font-family: 'DM Mono', monospace;
    letter-spacing: 0.04em;
  }

  .mobile-toolbar .m-primary-mini {
    background: linear-gradient(135deg, #1d9e75, #16795a);
    color: #fff;
    border-color: rgba(29,158,117,0.4);
  }

  .mobile-toolbar .m-subtle {
    background: #f8f7f3;
  }

  .mobile-toolbar .m-row.row-tools #mBg {
    justify-content: flex-start;
    text-align: left;
    padding: 0 12px;
    font-weight: 600;
    border-color: #ddd9cf;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
  }

  .mobile-toolbar .m-row.row-tools .m-icon-btn {
    min-height: 34px;
    border-radius: 999px;
    font-size: 11px;
    padding: 0 11px;
    box-shadow: none;
  }

  .mobile-toolbar .m-row.row-tools .m-primary-mini {
    background: rgba(29,158,117,0.12);
    color: #1d9e75;
    border-color: rgba(29,158,117,0.28);
  }

  .mobile-toolbar .m-row.row-tools .m-subtle {
    background: #f8f7f3;
    color: #444441;
    border-color: #e7e4dc;
  }

  .mobile-toolbar .m-row.row-export #btnExportMain {
    min-height: 34px;
    border-radius: 999px;
    padding: 0 14px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: none;
    background: rgba(29,158,117,0.12);
    color: #1d9e75;
    border: 1px solid rgba(29,158,117,0.28);
  }

  .mobile-toolbar .m-row.row-export #btnExportMain:hover {
    background: rgba(29,158,117,0.18);
  }
  
  .center { padding: 12px !important; }
  .drop-zone { aspect-ratio: 1/1.2; }
  .product-hero { grid-template-columns: 1fr !important; padding: 18px !important; gap: 16px !important; }
  .hero-features { grid-template-columns: 1fr !important; }
  .workflow-grid { grid-template-columns: 1fr !important; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-title { font-size: 28px !important; }
  .section-title { font-size: 22px !important; }
}

:root {
  --bg0: #f5f4f0;
  --bg1: #ffffff;
  --bg2: #e7e4dc;
  --ink: #2c2c2a;
  --ink2: #444441;
  --ink3: #888780;
  --gold: #1d9e75;
  --gold-l: #27b488;
  --blue: #1d9e75;
  --blue-l: #ecf8f3;
  --red: #b83228;
  --green: #2a7a4e;
  --shadow: 0 8px 24px rgba(44, 44, 42, 0.06);
  --shadow-lg: 0 18px 42px rgba(44, 44, 42, 0.1);
}
[data-theme="dark"] {
  --bg0: #1a1916;
  --bg1: #22211d;
  --bg2: #3a3832;
  --ink: #f5f3ef;
  --ink2: #f0ede6;
  --ink3: #c5c3bd;
  --blue: #4a86cf;
  --blue-l: #1e2a3a;
  --shadow: 0 4px 20px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.7);
}
* { box-sizing: border-box; margin: 0; padding: 0; transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease; }
body {
  font-family: 'Noto Sans SC', sans-serif;
  background: var(--bg0);
  color: var(--ink);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-size: 14px;
}

/* HEADER */
.header {
  background: rgba(250, 249, 246, 0.96);
  color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
  height: 56px; gap: 12px; position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(44, 44, 42, 0.08);
  box-shadow: 0 6px 18px rgba(44, 44, 42, 0.04);
}
.header-side { display: flex; align-items: center; gap: 10px; min-width: 0; }
.header-side-left { min-width: 60px; }
.header-side-right { margin-left: auto; }
.header-icon {
  width: 28px; height: 28px;
  border: 1.5px solid rgba(29, 158, 117, 0.4);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}
.header h1 {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
}
.header-release {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(29, 158, 117, 0.16);
  background: rgba(29, 158, 117, 0.08);
  color: #1d7e60;
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  cursor: pointer;
}
.theme-tog {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  background: #ffffff;
  color: var(--ink2);
  border: 1px solid var(--bg2);
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(44, 44, 42, 0.06);
  transition: transform 0.2s, box-shadow 0.2s ease;
}
.theme-tog:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(44, 44, 42, 0.1); border-color: rgba(29, 158, 117, 0.26); color: var(--gold); }
.lang-tog { margin-left: 8px; }
.header-sub { font-size: 11px; font-family: 'DM Mono', monospace; color: var(--ink3); margin-left: 4px; }

[data-theme="dark"] .header {
  background: var(--bg1);
  color: var(--ink);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
[data-theme="dark"] .header-icon {
  background: transparent;
  border-color: var(--gold);
  box-shadow: none;
}
[data-theme="dark"] .header-release {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--ink3);
}
[data-theme="dark"] .theme-tog {
  background: var(--bg2);
  color: var(--ink);
  border: none;
  box-shadow: none;
}
[data-theme="dark"] .theme-tog:hover { transform: scale(1.1); box-shadow: none; }
[data-theme="dark"] .header-sub { color: var(--ink3); }

/* LAYOUT */
.layout { display: grid; grid-template-columns: 252px 1fr 268px; flex: 1; overflow: hidden; }

/* PANELS */
.panel,
.panel-l { background: var(--bg1); border-right: 1px solid var(--bg2); overflow-y: auto; padding: 18px 14px; }
.panel-r { background: var(--bg1); border-left: 1px solid var(--bg2); overflow-y: auto; padding: 18px 14px; }
[data-theme="dark"] .panel,
[data-theme="dark"] .panel-l { background: var(--bg1); border-right: 1px solid var(--bg2); }
[data-theme="dark"] .panel-r { background: var(--bg1); border-left: 1px solid var(--bg2); }

.sect { margin-bottom: 20px; }
.start-panel-hint {
  margin-top: 8px;
  color: var(--ink3);
  font-size: 11px;
  line-height: 1.55;
}
.sect-lbl {
  font-size: 10px; font-family: 'DM Mono', monospace; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink3);
  margin-bottom: 9px; display: flex; align-items: center; gap: 6px;
}
.sect-lbl::after { content:''; flex:1; height:1px; background:var(--bg2); }
.mini-lbl {
  display: block;
  margin-bottom: 8px;
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink3);
}

.advanced-panel {
  margin-bottom: 20px;
  border: 1px solid var(--bg2);
  border-radius: 12px;
  background: var(--bg1);
  box-shadow: var(--shadow);
}
.advanced-summary {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 14px 12px;
  cursor: pointer;
}
.advanced-summary::-webkit-details-marker { display: none; }
.advanced-summary span {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.advanced-summary small {
  color: var(--ink3);
  font-size: 11px;
  line-height: 1.45;
}
.advanced-content {
  padding: 0 14px 14px;
  border-top: 1px solid var(--bg2);
}

.api-box { background: var(--blue-l); border: 1px solid rgba(29, 158, 117, 0.14); border-radius: 8px; padding: 12px; margin-bottom: 16px; transition: none; }
[data-theme="dark"] .api-box { background: rgba(30, 78, 140, 0.15); border-color: rgba(74, 134, 207, 0.3); }
.api-title { font-size: 11px; font-weight: 700; color: var(--blue); margin-bottom: 5px; }
.api-box p { font-size: 11px; color: var(--ink2); line-height: 1.55; margin-bottom: 7px; }
.api-box a { color: var(--blue); font-size: 11px; font-family: 'DM Mono', monospace; text-decoration: none; }
.api-box a:hover { text-decoration: underline; }
.api-inp {
  width: 100%; background: white; border: 1px solid #c2d0e8; border-radius: 5px;
  padding: 6px 8px; font-size: 12px; font-family: 'DM Mono', monospace; color: #1a1916;
  outline: none; margin-top: 7px;
}
.api-inp:focus { border-color: var(--blue); }
.api-inp::placeholder { color: #6b7280; opacity: 1; }
[data-theme="dark"] .api-inp {
  background: #f7f5ef;
  color: #1a1916;
  border-color: rgba(74, 134, 207, 0.35);
}
.api-save { width: 100%; margin-top: 6px; background: var(--blue); color: white; border: none; border-radius: 5px; padding: 6px; font-size: 12px; cursor: pointer; transition: opacity .15s; }
.api-save:hover { opacity: .85; }
.api-st { font-size: 10px; font-family: 'DM Mono', monospace; margin-top: 4px; text-align: center; min-height: 14px; }

/* PRESET SELECT */
.preset-select {
  width: 100%;
  min-height: 38px;
  background: var(--bg1);
  border: 1px solid var(--bg2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  font-family: 'Noto Sans SC', sans-serif;
  color: var(--ink);
  outline: none;
}
.preset-select:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(29,158,117,0.12); }

/* CUSTOM SIZE */
.cs-row { display: grid; grid-template-columns: 1fr 14px 1fr; gap: 4px; align-items: center; }
.cs-inp { background: var(--bg1); border: 1px solid var(--bg2); border-radius: 5px; padding: 5px 7px; font-size: 12px; font-family: 'DM Mono', monospace; text-align: center; color: var(--ink); width: 100%; outline: none; }
.cs-inp:focus { border-color: var(--gold); }
.cs-inp::placeholder { color: var(--ink3); opacity: 1; }
.cs-x { text-align: center; color: var(--ink3); font-size: 12px; }

/* BG SWATCHES */
.bg-strip { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.swatch { width: 28px; height: 28px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; transition: transform .12s; position: relative; flex-shrink: 0; }
.swatch:hover { transform: scale(1.12); }
.swatch.active { border-color: var(--ink); box-shadow: 0 0 0 2px var(--bg0); }
.swatch.disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; transform: none !important; }
.swatch.checker { background-image: repeating-conic-gradient(#ccc 0% 25%, white 0% 50%); background-size: 9px 9px; }
.swatch.custom-c { background: conic-gradient(red,yellow,lime,cyan,blue,magenta,red); overflow: hidden; }
.swatch.custom-c input { opacity:0; position:absolute; inset:0; width:100%; height:100%; cursor:pointer; border:none; padding:0; }

/* RANGE */
.rng-row { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.rng-row label { font-size: 11px; color: var(--ink2); display: flex; justify-content: space-between; cursor: pointer; user-select: none; }
.rng-row label:hover { color: var(--gold); }
.rng-row label span { font-family: 'DM Mono', monospace; color: var(--gold); pointer-events: none; }
.rng-row input[type=range] { width: 100%; accent-color: var(--gold); }

/* CENTER */
.center { padding: 28px 20px; display: flex; flex-direction: column; align-items: center; gap: 18px; background: var(--bg0); }

.product-hero {
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
  gap: 18px;
  padding: 22px;
  background: linear-gradient(145deg, rgba(255,255,255,0.96), rgba(248,247,243,0.96));
  border: 1px solid var(--bg2);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
}
.hero-copy { display: flex; flex-direction: column; gap: 12px; }
.hero-eyebrow,
.section-kicker {
  font-size: 11px;
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gold);
}
.hero-title {
  font-size: 34px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.hero-subtitle,
.section-copy {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink2);
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-actions .btn { padding-inline: 18px; }
.hero-trust {
  display: inline-flex;
  align-self: flex-start;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(29,158,117,0.1);
  color: #14674d;
  font-size: 12px;
  font-weight: 600;
}
.hero-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.feature-card,
.start-card,
.info-card {
  background: var(--bg1);
  border: 1px solid var(--bg2);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.feature-card { padding: 14px; }
.feature-card h3 {
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--ink);
}
.feature-card p {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink2);
}
.start-card,
.info-card {
  width: 100%;
  max-width: 980px;
  padding: 18px 20px;
}
.section-title {
  margin-top: 5px;
  font-size: 24px;
  line-height: 1.2;
  color: var(--ink);
}
.workflow-grid {
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.flow-list,
.tips-list {
  margin-top: 14px;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--ink2);
  font-size: 13px;
  line-height: 1.65;
}
.flow-list li,
.tips-list li { padding-left: 2px; }
.flow-list strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 13px;
}
.flow-list span { display: block; }

/* STEPS BAR */
.steps-bar { display: flex; align-self: stretch; border-radius: 10px; overflow: hidden; border: 1px solid var(--bg2); box-shadow: var(--shadow); background: var(--bg1); }
.step-item { flex: 1; padding: 12px 4px; text-align: center; font-size: 11px; color: var(--ink3); border-right: 1px solid var(--bg2); position: relative; transition: all 0.3s; }
.step-item:last-child { border-right: none; }
.step-item.done { color: var(--green); background: rgba(42, 122, 78, 0.12); }
.step-item.active { color: var(--gold); background: var(--bg1); font-weight: 700; box-shadow: inset 0 -3px 0 var(--gold); }
.step-item.active::after { display: none; }
.step-n { display: block; font-family: 'DM Mono', monospace; font-size: 16px; font-weight: 700; margin-bottom: 2px; color: var(--ink2); opacity: 0.6; }
.step-item.active .step-n, .step-item.done .step-n { opacity: 1; color: inherit; }

/* DROP ZONE */
.drop-zone {
  width: 100%; max-width: 470px; aspect-ratio: 4/3;
  border: 2px dashed var(--bg2); border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  cursor: pointer; transition: all .2s; background: var(--bg1); border-color: var(--bg2);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 6%, var(--bg1));
  box-shadow: 0 0 0 4px rgba(29, 158, 117, 0.08);
}
.dz-icon { font-size: 34px; }
.drop-zone p { font-size: 16px; font-weight: 600; color: var(--ink); }
.drop-zone span { font-size: 11px; color: var(--ink3); text-align: center; line-height: 1.6; max-width: 300px; }
#dropSubTitle { font-size: 12px; color: var(--ink2); font-weight: 500; }
.drop-zone input { display: none; }

/* STAGE */
.stage { display: none; flex-direction: column; align-items: center; gap: 14px; width: 100%; max-width: 470px; }
.stage.show { display: flex; }
.canvas-wrap { position: relative; width: 100%; max-width: 420px; aspect-ratio: 1/1; background-image: repeating-conic-gradient(#ccc 0% 25%, #eee 0% 50%); background-size: 13px 13px; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--bg2); }
.canvas-wrap::after { content:''; position:absolute; inset:0; pointer-events:none; border-radius:8px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1); }
#editCanvas { display: block; background: #fff; box-shadow: var(--shadow-lg); cursor: move; width:100%; height:auto; touch-action: none; }
.canvas-hint { font-size: 11px; font-family: 'DM Mono', monospace; color: var(--ink3); text-align: center; }

/* BUTTONS */
.btn-row { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; }
.btn { padding: 8px 17px; border-radius: 6px; font-size: 12px; font-family: 'Noto Sans SC', sans-serif; font-weight: 500; cursor: pointer; border: 1.5px solid transparent; transition: all .16s cubic-bezier(0.4, 0, 0.2, 1); display: flex; align-items: center; gap: 5px; }
.btn:active { transform: scale(0.96); }
.btn-dark { background: var(--ink); color: var(--bg0); border-color: var(--ink); }
.btn-dark:hover { background: #333; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn-gold { background: var(--gold); color: white; border-color: var(--gold); }
.btn-gold:hover { background: var(--gold-l); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(29,158,117,0.24); }
.btn-gold:disabled { opacity: .4; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--bg2); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-ghost:disabled { opacity: .4; cursor: not-allowed; }

/* LOADER */
.loader { display: none; align-items: center; gap: 7px; font-size: 12px; font-family: 'DM Mono', monospace; color: var(--blue); }
.loader.show { display: flex; }
.spin { width: 13px; height: 13px; border: 2px solid var(--bg2); border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* RIGHT */
.rbox { background: var(--bg0); border-radius: 9px; border: 1px solid var(--bg2); overflow: hidden; display: none; margin-bottom: 12px; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); }
.rbox.show { display: block; animation: rboxIn 0.5s forwards cubic-bezier(0.23, 1, 0.32, 1); }
@keyframes rboxIn { to { opacity: 1; transform: translateY(0); } }
.rbox-hd { padding: 10px 14px; font-size: 11px; font-family: 'DM Mono', monospace; font-weight: 600; color: var(--gold); background: #fafbf9; border-bottom: 1px solid var(--bg2); letter-spacing: .08em; text-transform: uppercase; }
.rbox-bd { padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 9px; }
#resultPrev { max-width: 170px; max-height: 190px; border-radius: 3px; box-shadow: var(--shadow); }

.info-tbl { width: 100%; border-collapse: collapse; font-size: 11px; font-family: 'DM Mono', monospace; }
.info-tbl td { padding: 3px 2px; border-bottom: 1px solid var(--bg2); }
.info-tbl td:first-child { color: var(--ink3); vertical-align: top; white-space: nowrap; }
.info-tbl td:last-child { text-align: right; font-weight: 500; color: var(--ink); }
.info-tbl tr:last-child td { border-bottom: none; }

/* PRINT */
.print-wrap { width: 100%; background: white; border-radius: 5px; padding: 8px; border: 1px solid var(--bg2); }
.print-grid { display: flex; flex-direction: column; align-items: center; gap: 0; }
.print-row-g { display: flex; }
.print-thumb-img { display: block; }

/* TOGGLE */
.tog-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--ink2); margin-top: 4px; }
.toggle { position: relative; width: 34px; height: 18px; }
.toggle input { display: none; }
.t-tr { position: absolute; inset: 0; background: var(--bg2); border-radius: 9px; cursor: pointer; transition: .2s; }
.t-tr::after { content:''; position:absolute; width:12px;height:12px; left:3px;top:3px; background:white; border-radius:50%; transition:.2s; box-shadow:0 1px 3px rgba(0,0,0,.2); }
.toggle input:checked + .t-tr { background: var(--gold); }
.toggle input:checked + .t-tr::after { transform: translateX(16px); }

/* EMPTY */
.empty { text-align: center; padding: 28px 10px; color: var(--ink3); font-size: 12px; line-height: 1.7; }
.empty .ei { font-size: 28px; margin-bottom: 7px; }

/* TOAST */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(60px); opacity: 0; visibility: hidden; background: var(--ink); color: var(--bg0); padding: 10px 20px; border-radius: 20px; font-size: 13px; line-height: 1.45; max-width: calc(100vw - 32px); text-align: center; transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .22s ease, visibility 0s linear .22s; z-index: 999; pointer-events: none; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .22s ease; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: var(--bg2); border-radius: 2px; }

/* MICRO-ADJUST */
.adj-row { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; align-items: center; }
.adj-btn { width: 30px; height: 30px; border-radius: 5px; border: 1.5px solid var(--bg2); background: var(--bg1); cursor: pointer; font-size: 13px; display: flex; align-items: center; justify-content: center; transition: all .12s; color: var(--ink2); }
.adj-btn:hover { border-color: var(--gold); color: var(--gold); background: #fff; }
.adj-sep { width: 1px; height: 22px; background: var(--bg2); margin: 0 2px; }

/* GUIDE LEGEND */
.guide-legend { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.gl-item { display: flex; align-items: center; gap: 7px; font-size: 10px; color: var(--ink2); line-height: 1.4; }
.gl-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

/* FILE SIZE ROW */
.fs-row { display: flex; align-items: center; gap: 6px; width: 100%; font-size: 11px; color: var(--ink2); }
.fs-inp { width: 64px; background: var(--bg1); border: 1px solid var(--bg2); border-radius: 5px; padding: 4px 6px; font-size: 12px; font-family: 'DM Mono', monospace; text-align: center; color: var(--ink); outline: none; }
.fs-inp:focus { border-color: var(--gold); }
.fs-inp::placeholder { color: var(--ink3); opacity: 1; }

/* COLLAPSIBLE AI BOX */
.api-box-toggle { display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; }
.api-box-toggle .api-title { margin-bottom: 0; }
.api-box-body { margin-top: 8px; }
.api-box-chevron { font-size: 10px; color: var(--blue); transition: transform .2s; }
.api-box-chevron.open { transform: rotate(180deg); }

/* PRIVACY MODAL */
.hidden { display: none !important; }
.modal-overlay { position: fixed; inset: 0; background: rgba(26,25,22,0.55); z-index: 200; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.modal-overlay.hidden { display: none; }
.modal-box { background: var(--bg0); border: 1px solid var(--bg2); border-radius: 14px; padding: 28px 24px; max-width: 420px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,.25); color: var(--ink); }
.modal-box h2 { font-size: 15px; font-weight: 700; margin-bottom: 12px; color: var(--ink); }
.modal-box p { font-size: 12px; color: var(--ink2); line-height: 1.7; margin-bottom: 10px; }
.modal-box .modal-btns { display: flex; gap: 8px; margin-top: 18px; }
.modal-box .modal-btns button { flex: 1; padding: 9px; border-radius: 7px; font-size: 13px; font-family: 'Noto Sans SC', sans-serif; cursor: pointer; border: 1.5px solid transparent; transition: all .14s; }
.modal-accept { background: var(--gold); color: #fff; border-color: var(--gold) !important; }
.modal-accept:hover { background: var(--gold-l); border-color: var(--gold-l) !important; }
.modal-decline { background: transparent; color: var(--ink2); border-color: var(--bg2) !important; }
.modal-decline:hover { border-color: var(--ink) !important; }
.report-list { margin: 12px 0; display: grid; gap: 10px; }
.report-preview { margin: 4px 0 14px; display: flex; justify-content: center; }
.report-preview img { max-width: 220px; max-height: 300px; border-radius: 10px; border: 1px solid var(--bg2); background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.12); object-fit: contain; }
.report-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; font-size: 12px; }
.report-row strong { color: var(--ink); font-weight: 700; }
.report-row span { color: var(--ink2); text-align: right; }
.report-note { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--gold) 10%, var(--bg0)); border: 1px solid color-mix(in srgb, var(--gold) 28%, var(--bg2)); color: var(--ink2); font-size: 12px; line-height: 1.6; }
.donation-modal { max-width: 460px; }
.donation-account { margin-top: 14px; word-break: break-word; }
.donation-settings-account { margin-top: 10px; }
.donation-settings-actions { margin-top: 10px; }
.donation-settings-actions button { flex: 1; }
.lang-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.lang-item { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--bg2); background: var(--bg0); color: var(--ink); font-size: 13px; cursor: pointer; }
.lang-item.active { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(29,158,117,0.25) inset; }
.lang-item small { color: var(--ink3); font-family: 'DM Mono', monospace; }
.lang-ico { width: 16px; height: 16px; display: block; fill: currentColor; }
.release-meta { font-size: 11px; font-family: 'DM Mono', monospace; color: var(--ink2); margin-top: 4px; }
.release-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; max-height: 50vh; overflow: auto; }
.release-item { border: 1px solid var(--bg2); border-radius: 10px; padding: 12px; background: var(--bg0); }
.release-item h3 { font-size: 13px; margin-bottom: 4px; color: var(--ink); }
.release-item time { display: block; font-size: 11px; color: var(--ink3); margin-bottom: 8px; font-family: 'DM Mono', monospace; }
.release-item ul { margin: 0; padding-left: 18px; color: var(--ink2); font-size: 12px; line-height: 1.6; }
.release-empty { font-size: 12px; color: var(--ink2); margin-top: 12px; }

/* RESPONSIVE */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .panel { border-right: none; border-bottom: 1px solid var(--bg2); }
  .panel-r { border-left: none; border-top: 1px solid var(--bg2); }
  .center { padding: 16px 12px; }
  #editCanvas { width: 100% !important; height: auto !important; }
  .drop-zone { aspect-ratio: 3/2; }
  .header-sub { display: none; }
  .header-side-left { min-width: 36px; }
  .header h1 { font-size: 15px; }
}
