/* ==========================================================
   BOX3 — Industrial Dark Mode
   CAD / Parametric Engine · Monospace · Cyan accent
   ========================================================== */

@import 'normalize.css';

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

:root {
  color-scheme: dark;
  --bg: #0d1117;
  --surface-1: #161b22;
  --surface-2: #1c2333;
  --border: #30363d;
  --border-strong: #484f58;
  --ink: #e6edf3;
  --ink-2: #c9d1d9;
  --ink-3: #8b949e;
  --ink-4: #6e7681;
  --accent: #0ea5e9;
  --accent-hover: #38bdf8;
  --accent-soft: rgba(14,165,233,0.10);
  --accent-ink: #0d1117;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --r-xs: 2px; --r-sm: 4px; --r-md: 6px; --r-lg: 8px;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-2: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-3: 0 10px 32px rgba(0,0,0,0.5);
  --ring: 0 0 0 2px rgba(14,165,233,0.3);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Cascadia Code", "Fira Code", "Roboto Mono", Consolas, monospace;
  --container-max: 1280px;
  --easing: cubic-bezier(0.2, 0, 0, 1);
  --t-fast: 100ms var(--easing);
  --t: 150ms var(--easing);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { margin: 0; min-width: auto; padding-bottom: 80px !important; }
a { color: var(--ink-2); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--accent); }
img, svg { vertical-align: middle; max-width: 100%; height: auto; }
button { font-family: var(--font-mono); }

/* ============================================================
   Layout
   ============================================================ */

.container,
.argumentcontainer {
  background: var(--bg);
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--s-4);
  border-radius: 0;
  box-shadow: none;
  float: none;
}

/* Fixed Header 补偿：防止内容被遮挡 */
body > main.container {
  padding-top: 60px !important;
}

.container > div[style*="float"],
.argumentcontainer > div[style*="float"] {
  float: none !important;
  width: 100% !important;
}

.container img[src$="boxes-logo.svg"],
.argumentcontainer img[src$="boxes-logo.svg"] { display: none; }

.clear { display: none; }
hr { display: none; }

/* --- 1. 顶部导航栏 (终极 Fixed 定位，彻底免疫文档流塌陷) --- */
.site-header {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin: 0;
  background: rgba(28, 28, 30, 0.95) !important; /* 原生暗灰底色，带微透明 */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: fixed !important; /* 彻底脱离文档流，永远固定在顶部 */
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  z-index: 9999 !important;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.site-brand { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-link { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-link:hover { color: var(--ink); }
.brand-text-block { display: flex; flex-direction: column; }
.brand-name {
  font-family: var(--font-mono); font-weight: 700; font-size: 15px;
  letter-spacing: -0.01em; color: var(--ink); white-space: nowrap;
}
#brand-tagline { display: none; }
.site-tools { display: flex; align-items: center; gap: 8px; }
.header-icon-btn { color: #fff !important; background: transparent; border: none; cursor: pointer; padding: 4px; }
.header-icon-btn:focus { outline: none; }

/* ── P3: 2D页面连续性 - SVG预览区平滑过渡 ── */
#svg-display {
  background: #f8fafc;
  border-radius: 8px;
  box-shadow: 0 -1px 0 rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.04);
}
#svg-display::before {
  content: '';
  position: absolute;
  top: -12px; left: 0; right: 0;
  height: 12px;
  background: linear-gradient(to bottom, rgba(13,17,23,0.03), transparent);
  pointer-events: none;
}
@media (min-width: 640px) { .brand-name { font-size: 17px; } }

/* --- 2. 隐藏式搜索栏 (默认不占用任何空间) --- */
.page-toolbar {
  display: none !important; /* 默认彻底隐藏 */
  padding: 4px 16px 12px;
  background: var(--bg);
  margin: 0;
  border-bottom: 1px solid #1c1c1e;
}
.page-toolbar.search-open {
  display: block !important; /* 点击后展开 */
  animation: searchSlideDown 0.25s cubic-bezier(0.2, 0, 0, 1);
}
.search-field { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 12px; width: 16px; height: 16px; color: #8e8e93; z-index: 2; pointer-events: none; }
#search {
  width: 100%;
  background: #1c1c1e;
  border: none;
  border-radius: 10px;
  padding: 8px 14px 8px 36px;
  min-height: 38px;
  font-size: 15px;
  color: #fff;
}
#search:focus { outline: none; box-shadow: 0 0 0 2px rgba(14,165,233,0.3); }
@keyframes searchSlideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- 3. 分类 Tab --- */
.asset-filter-bar {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: hidden;
  padding: 8px 8px 0;
  margin-bottom: 8px;
  background: var(--bg);
  border-bottom: 1px solid #1c1c1e;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.asset-filter-bar::-webkit-scrollbar { display: none; }

/* ============================================================
   Floating CTA — Premium Full-width Pill
   ============================================================ */
.cta-fab {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px); /* 手机端两边留白 16px */
  max-width: 380px;
  justify-content: center;
  background: rgba(14, 165, 233, 0.85); /* 降低一点透明度 */
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: 16px; /* 苹果圆角 */
  padding: 14px 20px;
  color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5); /* 强烈阴影让其悬浮 */
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-sans);
  text-decoration: none;
  z-index: 100;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--t), box-shadow var(--t), background var(--t);
}
.cta-fab:hover {
  background: rgba(14, 165, 233, 0.95);
  color: #fff;
  box-shadow: 0 12px 36px rgba(0,0,0,0.6);
  transform: translateX(-50%) translateY(-2px);
}
.cta-fab:active { transform: translateX(-50%) translateY(0); }
.cta-fab-icon { font-size: 16px; line-height: 1; flex-shrink: 0; }
.cta-fab-text { white-space: nowrap; }

@media (max-width: 389px) {
  .cta-fab { width: calc(100% - 24px); padding: 12px 16px; }
  .cta-fab-text { font-size: 13px; }
}

/* ============================================================
   Gallery — blueprint / technical catalog
   ============================================================ */

.gallery-grid { display: flex; flex-direction: column; gap: var(--s-6); }
@media (min-width: 640px) { .gallery-grid { gap: var(--s-7); } }

.gallery-section h2,
.container h2 {
  display: none !important;
}

.asset-filter-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  background: transparent; border: none;
  color: #6e7681; font-size: 13px; font-weight: 500;
  padding: 0 2px;
  border-radius: 20px;
  border: 1.5px solid transparent;
  transition: all 0.2s; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  cursor: pointer;
}
.asset-filter-btn .filter-icon {
  width: 16px; height: 16px; flex: 0 0 16px;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1;
}
.asset-filter-btn .filter-icon svg {
  width: 15px; height: 15px;
  stroke: currentColor;
  stroke-width: 1.8;
}
.asset-filter-btn .filter-text { line-height: 1; }
.asset-filter-btn:hover {
  color: #c9d1d9;
  background: rgba(255,255,255,0.05);
}
.asset-filter-btn.active {
  color: #0ea5e9; font-weight: 600;
  background: rgba(14,165,233,0.1);
  border-color: rgba(14,165,233,0.3);
}
.asset-filter-btn.favorite-filter {
  color: #8e8e93;
}
.asset-filter-btn.favorite-filter:hover {
  color: #c9d1d9;
}
.asset-filter-btn.favorite-filter.active {
  color: var(--pro-accent, #f59e0b);
  font-weight: 600;
}

/* 移动端进一步压缩字号，四项一屏 */
@media (max-width: 389px) {
  .asset-filter-btn { font-size: 11px; gap: 1px; padding: 0 0; }
  .asset-filter-btn .filter-icon { font-size: 10px; }
}
@media (min-width: 390px) and (max-width: 767px) {
  .asset-filter-btn { font-size: 12px; gap: 2px; padding: 0 2px; }
}

/* ============================================================
   Gallery — Knots 3D / iOS List Style
   ============================================================ */
.gallery-row { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 0 12px; padding-bottom: calc(48px + 16px + 16px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 640px)  { .gallery-row { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .gallery-row { grid-template-columns: repeat(3, 1fr); } }

/* 收藏空状态 */
.favorites-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  gap: 12px;
  text-align: center;
}
.favorites-empty .empty-icon {
  font-size: 48px;
  line-height: 1;
  opacity: 0.5;
  animation: empty-icon-float 3s ease-in-out infinite;
}
@keyframes empty-icon-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}
.favorites-empty .empty-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  margin: 4px 0 0;
}
.favorites-empty .empty-desc {
  font-size: 13px;
  color: var(--ink-3, #8b949e);
  line-height: 1.6;
  margin: 0;
}
.favorites-empty .empty-action {
  margin-top: 8px;
  padding: 9px 24px;
  border-radius: 20px;
  border: 1px solid rgba(14,165,233,0.4);
  background: transparent;
  color: var(--accent, #0ea5e9);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
}
.favorites-empty .empty-action:hover {
  background: rgba(14,165,233,0.1);
  border-color: rgba(14,165,233,0.7);
}
/* 收藏按钮 */
.fav-btn {
  border: none;
  background: none;
  cursor: pointer;
  padding: 2px;
  margin: 0 0 0 4px;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease;
}
.fav-btn:active {
  transform: scale(1.3);
}
.fav-btn svg {
  width: 14px;
  height: 14px;
  stroke: rgba(255, 255, 255, 0.5);
  fill: none;
  stroke-width: 2;
  transition: all 0.2s;
}
.fav-btn:hover svg {
  stroke: #fff;
}
.fav-btn.favorited svg {
  stroke: #ef4444;
  fill: #ef4444;
}

.gallery, .card-missing {
  background: #1c1c1e;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  width: auto;
  display: block;
  margin: 0;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  -webkit-tap-highlight-color: transparent;
}
.gallery:hover, .card-missing:hover {
  transform: translateY(-2px);
  border-color: rgba(14,165,233,0.25);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3), 0 0 0 1px rgba(14,165,233,0.1);
}
.gallery > a, .card-missing > a {
  display: flex; flex-direction: row; align-items: center;
  padding: 12px; gap: 16px;
  text-decoration: none; color: var(--ink);
}
.card-thumb {
  width: 64px; height: 64px; min-width: 64px; flex-shrink: 0;
  background: var(--surface-3, #0f172a); border: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.gallery .card-thumb { position: relative; }
.gallery img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transition: filter 0.2s;
}
.gallery:hover img { filter: brightness(1.08); }

.card-missing .card-thumb {
  background: #2c2c2e;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32' fill='none' stroke='%23333' stroke-width='1.5' stroke-linecap='round'%3E%3Crect x='2' y='2' width='28' height='28' rx='2'/%3E%3Cpath d='M12 12l8 8M20 12l-8 8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center;
}

.card-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.card-title-row {
  display: flex; align-items: center; gap: var(--s-2, 8px);
  min-width: 0; margin-bottom: 4px;
}
.gallery .card-title, .card-missing .card-title {
  flex: 1 1 auto; min-width: 0;
  font-size: 16px; color: #fff; font-weight: 600; letter-spacing: 0.5px;
  font-family: var(--font-sans);
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
  min-height: 2.6em;
  padding: 0; border-top: none;
}
.card-tech-tag {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.4;
  background: transparent;
  color: #8e8e93;
  border: 1px solid rgba(142,142,147,0.3);
}
/* PRO/付费标签：实心醒目，突出商业信号 */
.card-tech-tag.pro-tag {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0;
  box-shadow: none;
}
.card-missing .card-tech-tag {
  color: #8e8e93; border-color: rgba(142,142,147,0.3);
}
.card-doc {
  font-size: 13px; color: var(--ink-3, #6b7280); margin-top: 4px; line-height: 1.4;
  font-family: var(--font-sans);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 200px;
}

.card-missing { border: none; min-height: auto; }
.card-missing .card-title-row { margin-bottom: 2px; }
.card-missing .card-doc {
  font-size: 12px; color: #8e8e93; font-family: var(--font-mono);
}

.gallery_missing { display: none !important; }
.card-badge { display: none !important; }

/* ============================================================
   Menu page — collapsible accordion
   ============================================================ */

.menu { width: 100% !important; }
.menu > h3,
h3.toggle {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  min-height: 44px;
  margin: 4px 0 0;
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  transition: background var(--t-fast), border-color var(--t-fast);
}
h3.toggle:hover { background: var(--surface-2); border-color: var(--accent); color: var(--ink); }
h3::before,
h3.open::before {
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 16px; height: 16px;
  font-size: 10px;
  color: var(--ink-3);
  transition: transform var(--t);
  content: "";
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='none' stroke='%238b949e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 1 7 5 3 9'/%3E%3C/svg%3E") center/10px no-repeat;
}
h3.open::before { transform: rotate(90deg); }

.menu ul { list-style: none; padding: 0; margin: var(--s-2) 0 0; }
.menu ul li {
  list-style-type: none;
  padding: 0; margin: 0;
  border-radius: var(--r-xs);
  color: var(--ink-3);
  font-size: 13px;
  transition: background var(--t-fast);
}
.menu ul li:hover { background: var(--surface-1); color: var(--ink); }
.menu ul li:hover a { color: var(--ink); }
.menu ul li a {
  padding: 10px var(--s-3);
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}
.menu ul li span { display: none; }

#sample-preview {
  position: fixed;
  right: var(--s-5); bottom: var(--s-5);
  width: 200px; max-width: 30vw;
  border-radius: var(--r-xs);
  background: var(--surface-1);
  box-shadow: var(--shadow-3);
  border: 1px solid var(--border);
  z-index: 110;
  display: none;
}

img[id|=sample] { position: fixed; bottom: var(--s-5); right: var(--s-5); }

/* ============================================================
   Args page — parameter form
   ============================================================ */

.generator-header { margin: var(--s-2) 0 0; }
.generator-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--s-1);
}
.argumentcontainer .generator-header h2,
.argumentcontainer h2 {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-2);
  text-transform: none;
  color: var(--ink);
  border-bottom: none;
  padding: 0;
}
.generator-doc,
.argumentcontainer > p,
.argumentcontainer .description p {
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}
.generator-doc { margin-bottom: 0; }

#arguments { display: block; margin: 0 !important; padding: 0 !important; }
#arguments h3.toggle { margin: 2px 0 0; }

/* Accordion */
.accordion-group { position: relative; }
#arguments .accordion-body {
  display: none;
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  z-index: 40;
  background-color: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  max-height: 60vh;
  overflow-y: auto;
}
#arguments table {
  display: block;
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  border-spacing: 0;
  background: transparent;
}
#arguments tbody { display: block; }
#arguments table tr {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto;
  row-gap: 4px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
#arguments table tr:last-child { border-bottom: none; }
#arguments table td { display: block; padding: 0; vertical-align: top; }
#arguments table td:first-child {
  grid-column: 1; grid-row: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-2);
  letter-spacing: -0.005em;
  word-break: break-word;
}
#arguments table td:first-child label { cursor: pointer; }
#arguments table td:nth-child(2) { grid-column: 1; grid-row: 2; width: 100%; }
#arguments table td:last-child {
  grid-column: 1; grid-row: 3;
  font-size: 10px;
  line-height: 1.4;
  color: var(--ink-4);
}
#arguments table td:last-child p { margin: 0; }

/* Form controls — 极简仪表盘风格 */
#arguments input[type="text"],
#arguments input[type="number"],
#arguments input:not([type]) {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  max-width: 100%;
  padding: 6px 0;
  min-height: 32px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  border-radius: 0;
  transition: border-color var(--t-fast), color var(--t-fast);
}
#arguments input[type="text"]:hover,
#arguments input[type="number"]:hover {
  border-bottom-color: var(--ink-4);
}
#arguments input[type="text"]:focus,
#arguments input[type="number"]:focus,
#arguments input:not([type]):focus {
  outline: none;
  border-bottom-color: var(--accent);
  color: var(--accent);
  box-shadow: none;
}

/* Stepper buttons — +/- 微调按钮 */
.input-with-stepper {
  display: flex;
  align-items: center;
  width: 100%;
}
.input-with-stepper input {
  flex: 1;
  min-width: 52px;
  max-width: 72px;
  -webkit-appearance: textfield;
  -moz-appearance: textfield;
  appearance: textfield;
}
.input-with-stepper input::-webkit-outer-spin-button,
.input-with-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.stepper-btn {
  flex-shrink: 0;
  height: 24px;
  min-width: 24px;
  padding: 0 4px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  margin-left: 2px;
  font-size: 16px;
  line-height: 1;
  transition: background var(--t-fast), color var(--t-fast);
}
.stepper-btn:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
}
.stepper-btn:active {
  background: var(--accent);
  color: #fff;
}
.stepper-btn svg,
.stepper-btn i {
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.param-unit {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  margin-left: 4px;
  white-space: nowrap;
  align-self: center;
}

#arguments select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  max-width: 100%;
  padding: 6px 28px 6px 8px;
  min-height: 32px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  color-scheme: dark;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-sm);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%238b949e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color var(--t-fast), background var(--t-fast);
  cursor: pointer;
}
#arguments select:hover { border-color: var(--ink-3); }
#arguments select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(14,165,233,0.1);
}
/* 下拉弹窗 — 暗黑工业风，杜绝白底 */
#arguments select option {
  background: #161b22;
  color: var(--ink);
  padding: 8px 12px;
}
#arguments select option:checked {
  color: var(--accent);
  background: rgba(14,165,233,0.08);
}
#arguments select option:hover {
  background: rgba(14,165,233,0.18);
  color: #fff;
}
#arguments textarea {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  max-width: 100%;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  border-radius: 0;
  resize: vertical;
  min-height: 80px;
  padding: 6px 0;
}
#arguments input[type="checkbox"],
#arguments input[type="radio"] {
  width: 18px; height: 18px;
  accent-color: var(--accent);
  margin: 0; vertical-align: middle;
  cursor: pointer;
  flex-shrink: 0;
}

/* Action buttons */
.form-actions,
#arguments p:has(button),
#arguments > p:last-of-type {
  display: flex; flex-wrap: wrap; gap: var(--s-2);
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
}
button {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 16px;
  min-height: 42px;
  background: var(--surface-1);
  color: var(--ink-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
button:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--ink);
}
button:active { transform: translateY(1px); }
button:focus-visible { outline: none; box-shadow: var(--ring); }
button[value="1"],
button.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
button[value="1"]:hover,
button.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-ink);
}

/* ============================================================
   Args page two-panel layout
   ============================================================ */

.args-page-header {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: calc(60px + env(safe-area-inset-top, 0px)) var(--s-3) 0;
}
.args-page-layout {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--s-3) var(--s-3);
  gap: 0;
  height: auto;
}
.args-panel { flex: 1 1 auto; width: 100%; min-width: 0; }
.preview-panel { margin: 0 !important; padding-top: 0 !important; }
.args-panel { margin-bottom: 0 !important; padding-bottom: 0 !important; }
/* 手机端手风琴改为内联展开，参数行压缩为单行布局 */
@media (max-width: 767px) {
  #arguments .accordion-body {
    position: static !important;
    max-height: 50vh !important;
    overflow-y: auto !important;
    height: auto !important;
    padding: 0 !important;
  }
  /* 参数行改为极简仪表盘风格：去边框、悬停反馈 */
  #arguments table tr {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 12px !important;
    border-bottom: 1px solid rgba(255,255,255,0.04) !important;
    transition: background 0.15s ease !important;
    gap: 12px !important;
  }
  #arguments table tr:hover {
    background: rgba(255,255,255,0.03) !important;
  }
  #arguments table tr:last-child {
    border-bottom: none !important;
  }
  /* 参数名：左对齐 */
  #arguments table td:first-child {
    flex: 0 0 auto !important;
    max-width: 50% !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    color: rgba(255,255,255,0.7) !important;
    padding: 0 !important;
    letter-spacing: 0 !important;
  }
  /* 输入框：去边框，数值右对齐，无背景 */
  #arguments table td:nth-child(2) {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    padding: 0 !important;
  }
  #arguments table td:nth-child(2) input[type="text"],
  #arguments table td:nth-child(2) input[type="number"] {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    text-align: right !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--ink) !important;
  }
  #arguments table td:nth-child(2) input:focus {
    outline: none !important;
    box-shadow: none !important;
    color: var(--accent) !important;
  }
  /* Select 保持独立性，但简化 */
  #arguments table td:nth-child(2) select {
    background: rgba(255,255,255,0.03) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 6px !important;
    padding: 6px 24px 6px 8px !important;
    min-height: 32px !important;
    font-size: 12px !important;
  }
  /* 说明文字隐藏（手机端去除冗余） */
  #arguments table td:last-child {
    display: none !important;
  }

  /* ── Bottom Sheet: select 替代方案 ── */
  .bs-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9000;
    opacity: 0;
    transition: opacity 0.25s ease;
  }
  .bs-overlay.open { opacity: 1; }
  .bs-sheet {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    max-height: 50vh;
    z-index: 9001;
    background: var(--surface-1, #161b22);
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
  }
  .bs-sheet.open { transform: translateY(0); }
  .bs-handle {
    width: 36px; height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
  }
  .bs-title {
    padding: 12px 16px 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-3, #8b949e);
    letter-spacing: 0.02em;
    flex-shrink: 0;
  }
  .bs-options {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .bs-option {
    min-height: 44px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    color: var(--ink, #e6edf3);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    cursor: pointer;
    transition: background 0.12s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .bs-option:last-child { border-bottom: none; }
  .bs-option:active { background: rgba(14,165,233,0.08); }
  .bs-option.active {
    border-left: 3px solid var(--accent, #0ea5e9);
    color: var(--accent, #0ea5e9);
    font-weight: 500;
    padding-left: 13px;
  }
  .bs-option .bs-check {
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    flex-shrink: 0;
  }
  .bs-option.active .bs-check {
    background: var(--accent, #0ea5e9);
    border-color: var(--accent, #0ea5e9);
    box-shadow: inset 0 0 0 3px var(--surface-1, #161b22);
  }

  /* Stepper 按钮移动端 44px 触控区 */
  .stepper-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    margin-left: 6px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
  }
  .stepper-btn:hover {
    background: rgba(255,255,255,0.1);
  }
  .stepper-btn svg,
  .stepper-btn i {
    width: 18px;
    height: 18px;
  }
  .param-unit {
    margin-left: 6px;
  }
}

@media (min-width: 960px) {
  .args-page-layout {
    flex-direction: row;
    padding: 0 var(--s-5) var(--s-3);
    gap: var(--s-3);
    height: calc(100vh - 70px);
    margin-top: 4px;
  }
  .args-panel {
    flex: 0 0 380px;
    max-width: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: auto;
  }
  .args-panel::-webkit-scrollbar { display: none; }
  .preview-panel {
    display: flex !important;
    flex: 1 1 0;
    overflow: auto;
    width: auto;
    height: 100%;
    position: relative;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--r-xs);
    background: var(--surface-1);
  }
  .monitor-window,
  .monitor-restore { display: none !important; }
}

/* ============================================================
   Floating monitor (mobile)
   ============================================================ */

.monitor-close {
  position: absolute;
  top: -10px; right: -10px; z-index: 92;
  width: 22px !important; height: 22px !important;
  min-width: 22px !important; max-width: 22px !important;
  min-height: 22px !important; max-height: 22px !important;
  aspect-ratio: 1 / 1 !important;
  box-sizing: border-box !important;
  border-radius: 50% !important;
  padding: 0 !important; margin: 0 !important;
  display: flex !important;
  align-items: center !important; justify-content: center !important;
  flex-shrink: 0 !important;
  border: none;
  background: rgba(13,17,23,0.9);
  color: var(--ink);
  font-size: 14px !important; line-height: 1;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.monitor-close:hover { background: rgba(13,17,23,1); }
.monitor-close:active { transform: scale(0.88); }

.monitor-restore {
  display: flex;
  align-items: center; justify-content: center;
  position: fixed;
  bottom: 120px; right: 10px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background-color: var(--surface-1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  z-index: 91;
  padding: 0;
  transition: box-shadow 0.2s, transform 0.2s;
}
.monitor-restore:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); }
.monitor-restore:active { transform: scale(0.92); }
.monitor-restore.hidden { display: none; }

.monitor-window {
  position: fixed;
  bottom: 120px; right: 10px;
  width: 34vw; min-width: 120px; max-width: 160px;
  aspect-ratio: 1;
  z-index: 90;
  background: var(--surface-1);
  border-radius: var(--r-sm);
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.3), 0 8px 10px -6px rgba(0,0,0,0.2);
  overflow: visible !important;
  border: 1px solid var(--accent);
  transition: box-shadow 0.2s;
}
.monitor-window:hover { box-shadow: 0 25px 30px -8px rgba(0,0,0,0.4); }
.monitor-window.hidden { display: none; }

.monitor-inner {
  display: block;
  width: 100%; height: 100%;
  overflow: hidden;
  border-radius: 3px;
}
.monitor-inner img {
  display: block;
  width: 100%; height: 100%;
  object-fit: contain;
  cursor: pointer;
  background:
    linear-gradient(45deg, var(--surface-2) 25%, transparent 25%) -6px 0 / 12px 12px,
    linear-gradient(-45deg, var(--surface-2) 25%, transparent 25%) -6px 0 / 12px 12px,
    linear-gradient(45deg, transparent 75%, var(--surface-2) 75%) 0 6px / 12px 12px,
    linear-gradient(-45deg, transparent 75%, var(--surface-2) 75%) 0 6px / 12px 12px,
    var(--bg);
}

.monitor-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--bg);
  display: flex;
  align-items: center; justify-content: center;
  overflow: auto;
  cursor: pointer;
}
.monitor-fullscreen img {
  max-width: 95vw; max-height: 95vh;
  object-fit: contain;
  pointer-events: none; user-select: none;
}
.monitor-fullscreen-close { display: none !important; }

/* ============================================================
   Preview buttons
   ============================================================ */

#preview_buttons {
  display: flex; align-items: center; gap: var(--s-2);
  flex-wrap: wrap;
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink-3);
  flex-shrink: 0;
}
.preview-label {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.preview-toggle label {
  display: inline-flex; align-items: center; gap: 4px;
  cursor: pointer;
  min-height: 36px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.preview-zoom {
  display: inline-flex; align-items: center; gap: var(--s-1);
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
}
.preview-zoom .muted { color: var(--ink-4); margin-right: var(--s-1); font-size: 11px; }
.preview-rotate { display: none; align-items: center; gap: 2px; }
.preview-panel.preview-fullscreen .preview-rotate { display: inline-flex; align-items: center; gap: 2px; }
#preview_buttons button {
  padding: 6px 10px;
  min-width: 34px; min-height: 34px;
  font-size: 12px; font-weight: 600;
}
/* 工具栏溢出菜单 */
.toolbar-overflow {
  position: relative;
  margin-left: auto;
}
.toolbar-overflow-toggle {
  min-width: 34px; min-height: 34px;
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--ink-3);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast), color var(--t-fast);
}
.toolbar-overflow-toggle:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.toolbar-overflow-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  padding: 4px;
  z-index: 50;
  min-width: 120px;
}
.toolbar-overflow-menu.open { display: block; }
.toolbar-overflow-menu button {
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
}
.toolbar-overflow-menu button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.preview-canvas {
  overflow: auto;
  flex: 1 1 0;
  height: 0;
  min-height: 0;
  cursor: pointer;
  background: #f8fafc;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.04);
  margin: 8px;
}

.preview-panel.preview-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
  width: 100vw !important; height: 100vh !important;
  max-width: none !important; max-height: none !important;
  flex: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  z-index: 1000 !important;
  background: var(--bg);
  box-shadow: none !important;
  transition: none;
}
.preview-panel.preview-fullscreen .preview-canvas {
  height: auto;
  flex: 1 1 0;
  min-height: 0;
}

#preview_fullscreen_btn { font-size: 14px; line-height: 1; }
#preview_figure { margin: 0; padding: var(--s-2); }
#preview_img { display: block; width: 100%; height: auto; }

/* ============================================================
   Description / generator-sample
   ============================================================ */

.description {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}
.description:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}
.description.is-empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}
.description img {
  border-radius: var(--r-xs);
  border: 1px solid var(--border);
  margin: var(--s-3) 0;
  width: 100%;
}

/* ============================================================
   创客成品画廊 — Maker Showcase Grid
   ============================================================ */

.maker-showcase {
  margin-top: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
}
.maker-showcase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.showcase-title-row {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.showcase-icon {
  color: var(--ink-3);
  flex-shrink: 0;
  opacity: 0.7;
}
.maker-showcase-header h3 {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  margin: 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.showcase-subtitle {
  display: none;
}
.showcase-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  min-height: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--ink-3);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.showcase-upload-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.showcase-upload-btn:active { transform: scale(0.97); }

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 500px) {
  .showcase-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 768px) {
  .showcase-grid { grid-template-columns: repeat(2, 1fr); }
}

.showcase-card {
  aspect-ratio: 4 / 3;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface-1);
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
  -webkit-tap-highlight-color: transparent;
}
.showcase-card:hover {
  border-color: rgba(255,255,255,0.15);
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}
.showcase-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
  border: none;
  margin: 0;
  filter: brightness(0.92);
  transition: filter var(--t);
}
.showcase-card:hover img {
  filter: brightness(1);
}
.showcase-card-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 10px 8px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--t);
  pointer-events: none;
}
.showcase-card:hover .showcase-card-label { opacity: 1; }

.showcase-hint {
  margin: var(--s-5) 0 0;
  font-size: 12px;
  color: var(--ink-4);
  font-family: var(--font-sans);
  text-align: center;
  display: none;
}
.showcase-grid:empty ~ .showcase-hint { display: block; }

/* 移动端画廊适配 */
@media (max-width: 767px) {
  .maker-showcase { padding-top: var(--s-4); }
  .maker-showcase-header { flex-direction: row; align-items: center; }
  .showcase-grid { gap: 8px; }
  .showcase-card { aspect-ratio: 1 / 1; border-radius: var(--r-md); }
  .showcase-card:hover { transform: none; }
  .showcase-card-label { opacity: 1; padding: 16px 8px 6px; font-size: 10px; }
}
.generator-sample {
  margin: 0 0 var(--s-2);
}
.generator-sample img {
  border-radius: var(--r-xs);
  border: 1px solid var(--border);
  width: 100%;
  display: block;
  cursor: zoom-in;
  transition: opacity var(--t-fast);
}
.generator-sample img:hover { opacity: 0.85; }

/* Image lightbox */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(13,17,23,0.95);
  display: flex;
  align-items: center; justify-content: center;
  cursor: zoom-out;
  animation: fadeIn 150ms var(--easing);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.image-lightbox img {
  max-width: 95vw; max-height: 95vh;
  object-fit: contain;
  border-radius: var(--r-xs);
  box-shadow: var(--shadow-3);
  transform: scale(1);
  transition: transform 200ms var(--easing);
}
.image-lightbox img.pinch-zoomed {
  transform: scale(3);
  cursor: move;
}

/* Language select */
.site-tools form { margin: 0; }
/* 语言切换移动端隐藏，降低顶部拥挤 */
@media (max-width: 767px) {
  .site-tools form { display: none; }
}
.site-tools select,
.linkbar form select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  padding: 6px 26px 6px 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface-1)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%238b949e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E")
    no-repeat right 8px center;
  color: var(--ink-2);
  cursor: pointer;
  min-height: 38px;
  transition: border-color var(--t-fast);
}
.site-tools select:hover { border-color: var(--accent); }

#preview_chk {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  vertical-align: middle;
  margin: 0;
}

/* Footer */
.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  width: 100%;
  margin-top: var(--s-7);
  padding-left: var(--s-4);
  padding-right: var(--s-4);
}
.site-footer p { margin: 0; font-size: 10px; color: var(--ink-4); font-family: var(--font-mono); }
.site-footer p + p { margin-top: 6px; }
.footer-icp-link { color: var(--ink-4); }
.footer-icp-link:hover { color: var(--ink-3); }

/* ============================================================
   Responsive
   ============================================================ */

@media (min-width: 640px) {
  .container, .argumentcontainer { padding: var(--s-4) var(--s-4); }

  #arguments table tr {
    grid-template-columns: 160px 1fr;
    grid-template-rows: auto auto;
    column-gap: var(--s-3);
    row-gap: 0;
    padding: 1px 0;
  }
  #arguments table td:first-child { grid-column: 1; grid-row: 1 / 3; padding-top: 2px; }
  #arguments table td:nth-child(2) { grid-column: 2; grid-row: 1; }
  #arguments table td:last-child { grid-column: 2; grid-row: 2; }

  .brand-name { font-size: 18px; }
  .argumentcontainer h2 { font-size: 24px; }
}

@media (min-width: 960px) {
  .container, .argumentcontainer { padding: var(--s-5) var(--s-5); }
  .brand-name { font-size: 22px; }
  .argumentcontainer h2 { font-size: 28px; }
}

/* ============================================================
   Desktop Enhancement — 大屏布局收缩 & 交互反馈
   ============================================================ */

/* ── P1: 大屏布局收紧 (>1280px) ── */
@media (min-width: 1280px) {
  .args-page-layout {
    max-width: 1440px;
    margin: 0 auto;
    gap: var(--s-5);
  }
  .args-panel {
    flex: 0 0 460px;
    max-width: 500px;
  }
  /* 画布区域约束：不让黑色无限延伸 */
  .preview-wrap,
  .svg-preview-wrap {
    max-width: 860px;
    max-height: 78vh;
    margin: 0 auto;
  }
}

/* ── P2: 桌面端隐藏悬浮 CTA（迁至左侧面板底部） ── */
@media (min-width: 960px) {
  .args-page-header .cta-fab,
  .cta-fab {
    display: none !important;
  }
}

/* ── P3: 右上操作区 Hover 增强 ── */
@media (min-width: 960px) {
  .header-icon-btn {
    position: relative;
    border-radius: var(--r-sm);
    padding: 6px;
    min-width: 34px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  }
  .header-icon-btn:hover {
    background: rgba(14,165,233,0.1);
    transform: scale(1.08);
    box-shadow: 0 0 8px rgba(14,165,233,0.15);
  }
  .header-icon-btn:active {
    transform: scale(0.95);
    background: rgba(14,165,233,0.15);
  }

  /* 画布内浮动工具栏 — 桌面端增强 */
  .canvas-floating-controls {
    padding: 3px;
    gap: 1px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255,255,255,0.1);
  }
  .canvas-floating-controls button,
  .canvas-floating-controls .cf-btn {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    border-radius: 6px !important;
  }
  .canvas-floating-controls button:hover,
  .canvas-floating-controls .cf-btn:hover {
    background: rgba(14,165,233,0.12) !important;
    color: #fff !important;
  }
}

/* ── P4: 底部说明文字桌面端隐藏 ── */
@media (min-width: 960px) {
  /* 隐藏参数面板中的非操作性说明文字 */
  .args-panel > .description,
  .argumentcontainer > p:last-of-type:not(.form-actions),
  #arguments ~ p:not(.form-actions) {
    display: none;
  }
}

/* ── P5: 描述文字上移到标题下方 ── */
@media (min-width: 960px) {
  .desktop-subtitle {
    font-size: 12px;
    color: var(--ink-3, #8b949e);
    margin: 2px 0 8px;
    line-height: 1.4;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ── P6: 图文卡片化 — 缩略图+标题并列 ── */
@media (min-width: 960px) {
  .generator-header {
    display: flex;
    gap: 16px;
    align-items: start;
    margin-bottom: var(--s-3);
  }
  .generator-header .generator-sample {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    margin: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
  }
  .generator-header .generator-sample img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 10px;
    border: none;
    filter: contrast(0.85) brightness(0.9);
    transition: filter 0.2s;
  }
  .generator-header .generator-sample img:hover {
    filter: contrast(1) brightness(1);
  }
  .generator-text {
    flex: 1;
    min-width: 0;
  }
}

/* ── P7: 左侧面板底部操作区 — 工具图标 + CTA ── */
@media (min-width: 960px) {
  .args-panel-bottom {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: var(--bg, #0d1117);
    padding: 16px var(--s-3) calc(20px + env(safe-area-inset-bottom, 0px));
    margin: 24px -12px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 -6px 12px rgba(0,0,0,0.25);
  }
  .args-panel-tools {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 10px;
  }
  .args-panel-tools .tool-icon-btn {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    background: transparent !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    border-radius: 8px !important;
    color: var(--ink-3) !important;
    font-size: 13px !important;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .args-panel-tools .tool-icon-btn:hover {
    background: rgba(255,255,255,0.06) !important;
    color: var(--ink) !important;
    border-color: rgba(255,255,255,0.14) !important;
  }
  .args-panel-tools .tool-icon-btn svg {
    width: 15px;
    height: 15px;
  }
  .desktop-cta-btn {
    display: block;
    width: 100%;
    padding: 11px 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    border: none;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(14,165,233,0.35);
  }
  .desktop-cta-btn:hover {
    box-shadow: 0 6px 22px rgba(14,165,233,0.5);
    transform: translateY(-1px);
  }
  .desktop-cta-btn:active {
    transform: scale(0.97);
  }

  /* ── P8: 桌面端参数行一体化 — 标签/输入框并排，工业仪表盘风格 ── */
  #arguments table tr {
    display: flex;
    align-items: center;
    height: 34px;
    padding: 0 4px;
    border-bottom: none;
    gap: 8px;
  }
  #arguments table tr:nth-child(even) {
    background: rgba(255,255,255,0.015);
    border-radius: 4px;
  }
  #arguments table tr:hover {
    background: rgba(255,255,255,0.035);
    border-radius: 4px;
  }
  /* 参数名：左侧固定，降暗 */
  #arguments table td:first-child {
    flex: 1 1 auto;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0;
  }
  /* 输入框列：右侧限宽 */
  #arguments table td:nth-child(2) {
    flex: 0 0 130px;
    width: 130px;
    min-width: 0;
    padding: 0;
  }
  /* 说明列：桌面端隐藏在行内 */
  #arguments table td:last-child {
    display: none;
  }
  /* 输入框：紧凑内联风格 */
  #arguments input[type="text"],
  #arguments input[type="number"],
  #arguments input:not([type]) {
    padding: 4px 6px;
    min-height: 26px;
    height: 26px;
    font-size: 13px;
    color: var(--ink);
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    text-align: right;
    width: 100%;
  }
  #arguments input[type="text"]:hover,
  #arguments input[type="number"]:hover {
    border-color: rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.05);
  }
  #arguments input[type="text"]:focus,
  #arguments input[type="number"]:focus,
  #arguments input:not([type]):focus {
    border-color: var(--accent);
    background: rgba(14,165,233,0.04);
    box-shadow: 0 0 0 2px rgba(14,165,233,0.1);
  }
  /* Stepper 按钮桌面端：紧凑但有反馈 */
  #arguments .stepper-btn {
    height: 24px !important;
    min-width: 24px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 3px !important;
    font-size: 16px;
    color: rgba(255,255,255,0.45);
    margin-left: 3px;
    transition: color 0.15s ease, transform 0.12s ease;
  }
  #arguments .stepper-btn:hover {
    background: transparent !important;
    color: var(--accent);
    transform: scale(1.15);
  }
  #arguments .stepper-btn:active {
    background: transparent !important;
    color: #fff;
    transform: scale(0.9);
  }
  #arguments .input-with-stepper input {
    min-width: 52px;
    text-align: right;
  }
  #arguments .stepper-btn svg,
  #arguments .stepper-btn i {
    width: 12px;
    height: 12px;
  }
  #arguments select {
    min-height: 26px;
    height: 26px;
    font-size: 12px;
    padding: 3px 22px 3px 6px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    width: 100%;
  }
  #arguments select:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.16);
  }
  #arguments select:focus {
    background: rgba(14,165,233,0.04);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(14,165,233,0.1);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
  .gallery:hover img { filter: brightness(1.05); }
}

/* Print */
@media print {
  .linkbar, .modenav, #preview, button { display: none !important; }
  .container, .argumentcontainer { box-shadow: none; }
  html, body { background: #fff; color: #000; }
}

/* ============================================================
   2D 参数页 — 手风琴与按钮高级化
   ============================================================ */

/* 手风琴折叠菜单：工业暗黑质感 */
#arguments h3.toggle {
  background: rgba(255, 255, 255, 0.025) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  color: var(--ink-2, #9ca3af) !important;
  border-radius: 8px !important;
  padding: 14px 18px !important;
  margin-bottom: 6px !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  letter-spacing: 0.02em !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
#arguments h3.toggle:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: var(--ink-1, #e6edf3) !important;
}
#arguments .accordion-group:last-of-type h3.toggle { margin-bottom: 0 !important; }
#arguments h3.open {
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  margin-bottom: 0 !important;
  background: rgba(14, 165, 233, 0.04) !important;
  border-color: rgba(14, 165, 233, 0.3) !important;
  color: var(--ink-1, #e6edf3) !important;
}

/* 底部动作按钮改组为 App 网格 */
.form-actions, #arguments > p:last-of-type {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 20px 0 !important;
  border-top: 1px solid rgba(255,255,255,0.04) !important;
  margin-top: 16px !important;
}
.form-actions button[value="2"],
.form-actions button[name="render"][value="2"] {
  grid-column: 1 / -1;
  height: 48px !important;
  border-radius: 10px !important;
  background: var(--accent, #0ea5e9) !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  border: none !important;
  letter-spacing: 0.01em !important;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.form-actions button[value="2"]:hover,
.form-actions button[name="render"][value="2"]:hover {
  background: var(--accent-hover, #38bdf8) !important;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.3) !important;
  transform: translateY(-1px) !important;
}
.form-actions button,
#arguments button:not(.stepper-btn) {
  height: 40px;
  border-radius: 8px !important;
  background: rgba(255,255,255,0.03) !important;
  color: var(--ink-3, #8b949e) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  transition: all 0.15s ease !important;
}
.form-actions button:hover,
#arguments button:not(.stepper-btn):hover {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.15) !important;
  color: var(--ink-2, #c9d1d9) !important;
}

/* ============================================================
   BOX3 图标机械化全局样式 (Icon Mechanizer CSS)
   配合 self.js 中的 stroke-linecap:square / stroke-linejoin:miter
   ============================================================ */

/* 基础：所有 Lucide SVG 图标统一尺寸与描边颜色继承 */
svg.lucide,
svg[class*="lucide"],
[data-lucide] svg,
i[data-lucide] svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
  /* 机械化已由 JS 注入 stroke-linecap/linejoin，此处补充视觉 */
  filter: drop-shadow(0 0 1px rgba(14, 165, 233, 0.15));
  transition: filter 0.2s ease, opacity 0.15s ease;
}

/* Hover 微辉光（仅在可交互元素内生效） */
button:hover svg.lucide,
a:hover svg.lucide,
button:hover [data-lucide] svg,
a:hover [data-lucide] svg,
.header-icon-btn:hover svg {
  filter: drop-shadow(0 0 3px rgba(14, 165, 233, 0.4));
  opacity: 1;
}

/* Active 按压态 — 图标微缩 */
button:active svg.lucide,
a:active svg.lucide {
  transform: scale(0.92);
}

/* Header 区域图标稍大 (22px) */
.site-header svg.lucide,
.site-header svg[class*="lucide"],
.site-header [data-lucide] svg {
  width: 22px;
  height: 22px;
}

/* CTA / 强调按钮中的图标使用 accent 色 */
.btn-build svg.lucide,
.cta-fab svg.lucide,
.btn-primary svg.lucide {
  stroke: var(--accent, #0ea5e9);
  filter: drop-shadow(0 0 4px rgba(14, 165, 233, 0.35));
}

/* ── P5: 首页CTA改为右下角悬浮FAB（非侵入式） ── */
.cta-fab-v2 {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: rgba(14,165,233,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(14,165,233,0.4);
  border-radius: 28px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(14,165,233,0.35);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34,1.56,0.64,1);
  pointer-events: none;
}
.cta-fab-v2.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  animation: cta-fab-bounce 0.6s cubic-bezier(0.34,1.56,0.64,1) 0.1s both,
             cta-fab-pulse 3s ease-in-out 1s infinite;
}
.cta-fab-v2:hover {
  background: rgba(14,165,233,1);
  box-shadow: 0 6px 28px rgba(14,165,233,0.55);
  transform: translateY(-2px) scale(1.03);
  animation: none;
}
.cta-fab-v2:active {
  transform: scale(0.96);
  animation: none;
}
@keyframes cta-fab-bounce {
  0%   { transform: translateY(20px); opacity: 0; }
  60%  { transform: translateY(-6px); opacity: 1; }
  80%  { transform: translateY(2px); }
  100% { transform: translateY(0); }
}
@keyframes cta-fab-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(14,165,233,0.35); }
  50%       { box-shadow: 0 4px 28px rgba(14,165,233,0.6), 0 0 40px rgba(14,165,233,0.12); }
}
@media (max-width: 768px) {
  .cta-fab-v2 {
    bottom: 16px;
    right: 12px;
    padding: 8px 14px;
    font-size: 12px;
    border-radius: 24px;
  }
}

/* ============================================================
   P3: 2D 导出按钮 CTA 仪式感统一
   ============================================================ */
.form-actions button[value="2"],
.form-actions button[name="render"][value="2"] {
  background: linear-gradient(135deg, #0ea5e9, #06b6d4) !important;
  box-shadow: 0 4px 14px rgba(14,165,233,0.35) !important;
  animation: cta-pulse-2d 2.5s ease-in-out infinite;
}
.form-actions button[value="2"]:hover,
.form-actions button[name="render"][value="2"]:hover {
  box-shadow: 0 6px 20px rgba(14,165,233,0.5) !important;
}
@keyframes cta-pulse-2d {
  0%, 100% { box-shadow: 0 4px 14px rgba(14,165,233,0.35); }
  50% { box-shadow: 0 4px 24px rgba(14,165,233,0.55), 0 0 40px rgba(14,165,233,0.1); }
}

/* ============================================================
   P1: 底部浮动操作栏（导出+CTA 合一）
   ============================================================ */
@media (max-width: 767px) {
  .mobile-floating-cta {
    position: fixed;
    bottom: 0;
    left: 0; right: 0;
    z-index: 100;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(13, 17, 23, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    gap: 14px;
    align-items: center;
  }
  /* 左侧辅助导出按钮组 — 胶囊底板，图标融为一体 */
  .cta-aux-group {
    display: flex;
    gap: 0;
    align-items: center;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 2px;
  }
  .cta-aux-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    border-radius: 6px !important;
    color: rgba(255,255,255,0.6) !important;
    font-size: 14px !important;
    padding: 0 !important;
    transition: all 0.15s ease !important;
  }
  /* 按钮之间加细分割线 */
  .cta-aux-btn + .cta-aux-btn {
    border-left: 1px solid rgba(255,255,255,0.06) !important;
    border-radius: 0 6px 6px 0 !important;
  }
  .cta-aux-btn:first-child {
    border-radius: 6px 0 0 6px !important;
  }
  .cta-aux-btn:last-child {
    border-radius: 0 6px 6px 0 !important;
  }
  .cta-aux-btn:only-child {
    border-radius: 6px !important;
  }
  .cta-aux-btn:hover,
  .cta-aux-btn:active {
    color: rgba(255,255,255,0.9) !important;
    background: rgba(255,255,255,0.08) !important;
  }
  .cta-aux-btn,
  .cta-aux-btn * {
    background-color: transparent !important;
    box-shadow: none !important;
  }
  .cta-aux-btn svg {
    color: inherit !important;
    stroke: currentColor !important;
  }
  /* 右侧主 CTA — 呼吸灯 */
  .mobile-floating-cta .cta-main {
    flex: 1;
    height: 44px;
    border-radius: 10px !important;
    background: linear-gradient(135deg, #0ea5e9, #06b6d4) !important;
    color: #fff !important;
    border: none !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em !important;
    box-shadow: 0 4px 14px rgba(14,165,233,0.35) !important;
    animation: cta-breathe 2.5s ease-in-out infinite;
  }
  .mobile-floating-cta .cta-main:active {
    transform: scale(0.97);
    animation: none;
  }
  @keyframes cta-breathe {
    0%, 100% { box-shadow: 0 4px 14px rgba(14,165,233,0.3); }
    50% { box-shadow: 0 4px 22px rgba(14,165,233,0.55), 0 0 30px rgba(14,165,233,0.1); }
  }
  /* 有浮动 CTA 时，底部留白避免遮挡 */
  body.has-floating-cta {
    padding-bottom: 80px !important;
  }
  /* 原始表单按钮区在移动端隐藏（已提升到浮动栏） */
  body.has-floating-cta .form-actions,
  body.has-floating-cta #arguments > p:last-of-type {
    display: none !important;
  }
}

/* ============================================================
   P2: 紧凑控制带 — 仅标题 + 智能排版按钮
   ============================================================ */
#preview_buttons {
  background: rgba(13, 17, 23, 0.95) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: none !important;
  padding: 4px 12px 4px !important;
  gap: 6px !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  justify-content: space-between !important;
}
/* Preview 标签隐藏（冗余） */
#preview_buttons .preview-label {
  display: none !important;
}
/* Tab 标签 — 左侧功能区标题 */
#preview_buttons .preview-tabs {
  margin-left: 0 !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}
/* 导出按钮组在移动端已迁到底部 */
@media (max-width: 767px) {
  #preview_buttons .preview-tool-group {
    display: none !important;
  }
}
/* 视图控制按钮（👀 □ ⟳）— 默认隐藏，由JS移入画布内 */
#preview_buttons button {
  min-width: 28px !important;
  min-height: 28px !important;
  width: 28px;
  height: 28px;
  padding: 0 !important;
  border-radius: 6px !important;
  background: transparent !important;
  border: none !important;
  color: var(--ink-4) !important;
  font-size: 13px !important;
  transition: all 0.15s ease !important;
  flex-shrink: 0 !important;
}
#preview_buttons button:hover {
  background: rgba(255,255,255,0.06) !important;
  color: var(--ink) !important;
}
/* "开启智能排版" —— 右侧带 Icon 的紧凑按钮 */
#preview_buttons button[class*="smart-nest"],
#preview_buttons .gs-nest-btn,
.gs-nest-toolbar button:first-child {
  min-width: unset !important;
  width: auto !important;
  height: 26px !important;
  min-height: 26px !important;
  padding: 0 10px !important;
  background: transparent !important;
  border: 1px solid var(--accent) !important;
  color: var(--accent) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: 13px !important;
  box-shadow: none !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  margin-left: auto !important;
}
#preview_buttons button[class*="smart-nest"]:hover,
#preview_buttons .gs-nest-btn:hover,
.gs-nest-toolbar button:first-child:hover {
  background: rgba(14,165,233,0.1) !important;
  box-shadow: 0 0 8px rgba(14,165,233,0.2) !important;
}
/* 智能排版工具栏（动态注入）— 去白底，融入深色控制带 */
#gs-nest-toolbar,
.gs-nest-toolbar {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 4px 8px !important;
}
#gs-nest-toolbar button,
.gs-nest-toolbar button {
  background: transparent !important;
  border: none !important;
  color: var(--ink-3) !important;
  min-width: 28px !important;
  min-height: 28px !important;
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  border-radius: 6px !important;
  font-size: 13px !important;
}
#gs-nest-toolbar button:hover,
.gs-nest-toolbar button:hover {
  background: rgba(255,255,255,0.06) !important;
  color: var(--ink) !important;
}
/* 导出按钮组（桌面端样式） */
.preview-tool-group {
  margin-left: auto !important;
  display: flex;
  gap: 2px;
  align-items: center;
}
.tool-icon-btn {
  min-width: 28px !important;
  min-height: 28px !important;
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 6px !important;
  color: var(--ink-4) !important;
  font-size: 13px !important;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tool-icon-btn:hover {
  background: rgba(255,255,255,0.06) !important;
  color: var(--ink) !important;
}

/* 画布内悬浮视图控制按钮（👀 □ ⟳） */
.canvas-floating-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 100;
  display: flex;
  gap: 0;
  padding: 2px;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  transition: background 0.2s ease;
}
.canvas-floating-controls:hover,
.canvas-floating-controls:active {
  background: rgba(0, 0, 0, 0.45);
}
.canvas-floating-controls button,
.canvas-floating-controls .cf-btn {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border: none !important;
  border-radius: 4px !important;
  color: rgba(255,255,255,0.7) !important;
  font-size: 12px !important;
  cursor: pointer;
  transition: all 0.15s ease;
}
.canvas-floating-controls button svg,
.canvas-floating-controls .cf-btn svg {
  display: block !important;
  width: 13px !important;
  height: 13px !important;
}
.canvas-floating-controls button:hover,
.canvas-floating-controls .cf-btn:hover {
  color: rgba(255,255,255,0.95) !important;
  background: rgba(255,255,255,0.1) !important;
}


/* ============================================================
   P3: 智能排版切换按钮（✨开启 ↔ ⬅返回）
   ============================================================ */
.smart-nest-toggle {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 12px !important;
  border-radius: 14px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  cursor: pointer;
  transition: all 0.2s ease !important;
  flex-shrink: 0 !important;
}
.smart-nest-toggle[data-state="idle"] {
  background: rgba(14,165,233,0.12) !important;
  border: 1px solid var(--accent, #0ea5e9) !important;
  color: var(--accent, #0ea5e9) !important;
}
.smart-nest-toggle[data-state="idle"]:hover {
  background: rgba(14,165,233,0.2) !important;
  box-shadow: 0 0 10px rgba(14,165,233,0.25) !important;
}
.smart-nest-toggle[data-state="active"] {
  background: rgba(14,165,233,0.18) !important;
  border: 1px solid #0ea5e9 !important;
  color: #0ea5e9 !important;
  box-shadow: 0 0 12px rgba(14,165,233,0.35) !important;
}
.smart-nest-toggle[data-state="active"]:hover {
  background: rgba(14,165,233,0.25) !important;
  box-shadow: 0 0 16px rgba(14,165,233,0.45) !important;
}
.smart-nest-toggle .snt-icon {
  font-size: 13px;
  filter: grayscale(0.3);
}
.smart-nest-toggle[data-state="active"] .snt-icon {
  filter: none;
}

/* 移动端控制条（当 gs-nest-toolbar 不存在时的备选挂载点） */
.mobile-ctrl-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.mobile-ctrl-strip .mcs-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2, #c9d1d9);
  letter-spacing: 0.02em;
}
#btn-save-url {
  -webkit-tap-highlight-color: transparent;
}
#btn-save-url:focus:not(:focus-visible) {
  outline: none;
  background: initial;
  color: initial;
}
