/* 融媒工场 · 配置后台样式
   覆盖：工作台 / 模板中心 / 素材库 / 可视化编辑器 / 弹窗与提示
   设计基调：纸感底色 + 墨色文本 + 朱砂强调，编辑部工具体验 */

:root {
  --paper: #f3efe6;
  --surface: #fffdf8;
  --surface-2: #f8f5ee;
  --ink: #211e19;
  --ink-2: #46413a;
  --muted: #7d776c;
  --line: rgba(33, 30, 25, .11);
  --line-strong: rgba(33, 30, 25, .2);
  --accent: #d2482f;
  --accent-soft: rgba(210, 72, 47, .09);
  --green: #2f7d57;
  --dark: #15130f;
  --radius: 14px;
  --shadow-card: 0 22px 48px -34px rgba(33, 30, 25, .7);
  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 620px at 82% -12%, rgba(210, 72, 47, .07), transparent 62%),
    radial-gradient(900px 500px at 4% 8%, rgba(46, 110, 94, .05), transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

img, svg, video { max-width: 100%; }
button { font-family: inherit; }
a { color: inherit; }

::selection { background: rgba(210, 72, 47, .18); }

#app { min-height: 100vh; display: flex; flex-direction: column; }
#view { flex: 1; min-width: 0; }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(33, 30, 25, .16); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(33, 30, 25, .3); background-clip: content-box; }
* { scrollbar-width: thin; scrollbar-color: rgba(33, 30, 25, .22) transparent; }

/* ===================================================================
   顶栏
   =================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  flex: none;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 0 clamp(16px, 3vw, 38px);
  background: var(--dark);
  color: rgba(246, 242, 233, .6);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: inherit;
  flex: none;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 6px 18px -8px rgba(210, 72, 47, .9);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { color: #f7f3ea; font-size: 15px; letter-spacing: .06em; font-weight: 600; }
.brand-text small { font-size: 8.5px; letter-spacing: .26em; color: rgba(246, 242, 233, .36); }

.tabs { display: flex; align-items: center; gap: 3px; margin-left: 6px; }
.tabs a {
  position: relative;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: rgba(246, 242, 233, .56);
  text-decoration: none;
  transition: color .2s ease, background .2s ease;
}
.tabs a:hover { color: #f7f3ea; background: rgba(255, 255, 255, .06); }
.tabs a.is-active { color: #fff; background: rgba(255, 255, 255, .09); }
.tabs a.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 14px;
  height: 2px;
  margin-left: -7px;
  border-radius: 2px;
  background: var(--accent);
}

.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.server-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12);
  font-size: 10.5px;
  letter-spacing: .08em;
  color: rgba(246, 242, 233, .62);
}
.server-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #59c08a;
  box-shadow: 0 0 0 3px rgba(89, 192, 138, .16);
}
.spec-badge { font-size: 9.5px; letter-spacing: .24em; color: rgba(246, 242, 233, .32); }

/* ===================================================================
   页面基础
   =================================================================== */

.page {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: clamp(26px, 4vw, 52px) clamp(18px, 3.4vw, 44px) 92px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px;
}
.page-title h1 {
  margin: 10px 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(26px, 3.1vw, 36px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .01em;
}
.page-title p { margin: 0; max-width: 640px; color: var(--muted); font-size: 13.5px; line-height: 1.85; }
.head-actions { display: flex; align-items: center; gap: 10px; flex: none; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ""; width: 16px; height: 1px; background: currentColor; opacity: .75; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.section-head h2 { margin: 0; font-family: var(--font-serif); font-size: 20px; font-weight: 700; }
.section-head span { font-size: 11.5px; letter-spacing: .04em; color: var(--muted); }

/* ===================================================================
   基础控件
   =================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease, border-color .18s ease, filter .18s ease;
}
.btn svg { width: 15px; height: 15px; flex: none; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -16px rgba(33, 30, 25, .8); }
.btn:active { transform: translateY(0) scale(.99); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px -14px rgba(210, 72, 47, .9); }
.btn-primary:hover { background: #dc5337; filter: saturate(1.05); }

.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface); border-color: rgba(33, 30, 25, .3); }

.btn-sm { height: 34px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-xs {
  height: 28px;
  padding: 0 9px;
  font-size: 11px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
  gap: 6px;
}
.btn-xs svg { width: 12px; height: 12px; }
.btn-xs:hover { border-color: var(--line-strong); background: #fff; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: rgba(33, 30, 25, .06); color: var(--ink); }
.icon-btn:active { background: rgba(33, 30, 25, .1); }

.input {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input::placeholder { color: rgba(125, 119, 108, .7); }
.input:hover { border-color: var(--line-strong); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

select.input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237d776c' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  cursor: pointer;
}

.textarea {
  height: auto;
  min-height: 86px;
  padding: 10px 12px;
  line-height: 1.7;
  resize: vertical;
}

.input-sm { height: 32px; font-size: 12px; border-radius: 7px; }

code {
  font-family: var(--font-mono);
  font-size: .9em;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(33, 30, 25, .06);
  color: var(--ink-2);
}

/* ===================================================================
   工作台
   =================================================================== */

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 36px;
}
.stat-card {
  position: relative;
  overflow: hidden;
  padding: 18px 20px 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -46px;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .05;
}
.stat-card span { display: block; font-size: 11px; letter-spacing: .14em; color: var(--muted); }
.stat-card strong {
  display: inline-block;
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .01em;
}
.stat-card small { margin-left: 5px; font-size: 11px; color: var(--muted); }

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}
.work-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.work-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); border-color: rgba(33, 30, 25, .16); }

.work-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  background-color: #14110e;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.work-cover--fallback::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 26px);
  opacity: .5;
  pointer-events: none;
}
.work-cover--video-scene {
  background:
    radial-gradient(circle at 76% 22%, rgba(210, 72, 47, .5), transparent 46%),
    linear-gradient(150deg, #2d2822, #0d0b09 74%);
}
.work-cover--handscroll {
  background:
    radial-gradient(circle at 72% 20%, rgba(46, 110, 94, .22), transparent 48%),
    linear-gradient(150deg, #f6eeda, #dccdb2);
}
.work-cover--handscroll::after {
  background-image: repeating-linear-gradient(0deg, rgba(43, 38, 32, .06) 0 1px, transparent 1px 24px);
}

.work-tag, .work-status {
  position: absolute;
  top: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: .08em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.work-tag {
  left: 12px;
  background: rgba(12, 10, 8, .52);
  border: 1px solid rgba(255, 255, 255, .16);
  color: rgba(255, 255, 255, .86);
}
.work-status { right: 12px; background: rgba(255, 253, 248, .88); color: var(--ink-2); }
.work-status.is-live { background: var(--green); color: #fff; }

.work-play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, .36);
  border-radius: 999px;
  background: rgba(12, 10, 8, .56);
  color: #fff;
  font-size: 11px;
  letter-spacing: .06em;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .22s ease, transform .22s ease, background .22s ease;
}
.work-play svg { width: 11px; height: 11px; }
.work-card:hover .work-play { opacity: 1; transform: none; }
.work-play:hover { background: rgba(12, 10, 8, .78); }
@media (hover: none) { .work-play { opacity: 1; transform: none; } }

.work-body { display: flex; flex-direction: column; gap: 9px; padding: 14px 16px 15px; }
.work-name {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.work-meta { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 10.5px; color: var(--muted); }
.meta-divider { width: 1px; height: 9px; background: var(--line-strong); }
.work-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}
.work-actions .icon-btn { margin-left: auto; }

.works-foot {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
}
.works-foot .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex: none; }

/* 新建作品弹窗 */
.create-form { display: flex; flex-direction: column; gap: 18px; }
.template-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pick-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.pick-card:hover { border-color: var(--line-strong); }
.pick-card.is-active { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.pick-index { font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; color: var(--muted); }
.pick-card strong { font-family: var(--font-serif); font-size: 16px; font-weight: 700; }
.pick-card small { font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.pick-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.pick-tags em {
  font-style: normal;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
}
.pick-card.is-active .pick-tags em { background: rgba(255, 255, 255, .66); border-color: transparent; color: var(--accent); }

/* ===================================================================
   模板中心
   =================================================================== */

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
  margin-bottom: 50px;
}
.template-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.template-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }

.template-art { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #100e0c; }
.template-art svg { display: block; width: 100%; height: 100%; }
.template-art-label {
  position: absolute;
  left: 14px;
  bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(12, 10, 8, .55);
  border: 1px solid rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .82);
  font-size: 10px;
  letter-spacing: .16em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.template-content { display: flex; flex-direction: column; gap: 12px; flex: 1; padding: 20px 22px 22px; }
.template-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.template-title-row h2 { margin: 7px 0 0; font-family: var(--font-serif); font-size: 22px; font-weight: 700; }
.template-accent {
  flex: none;
  width: 9px;
  height: 9px;
  margin-top: 9px;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(33, 30, 25, .04);
}
.template-desc { margin: 0; font-size: 12.5px; line-height: 1.85; color: var(--muted); }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 10px;
  letter-spacing: .06em;
}
.template-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.template-meta svg { width: 13px; height: 13px; color: var(--accent); flex: none; }
.template-actions { display: flex; gap: 10px; margin-top: auto; padding-top: 8px; }

.capability-band {
  padding: 26px 26px 14px;
  margin-bottom: 50px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.capability-head h2 { margin: 8px 0 20px; font-family: var(--font-serif); font-size: 22px; font-weight: 700; }
.cap-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  align-items: center;
  padding: 13px 4px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
}
.cap-row--head {
  border-top: 0;
  padding-bottom: 10px;
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}
.cap-row span:nth-child(2), .cap-row span:nth-child(3) { text-align: center; font-size: 14px; }
.cap-row--head span:nth-child(2), .cap-row--head span:nth-child(3) { font-size: 10px; }
.cap-on { color: var(--accent); }
.cap-half { color: var(--muted); }

.spec-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 34px; align-items: start; }
.spec-copy h2 { margin: 10px 0 14px; font-family: var(--font-serif); font-size: 26px; font-weight: 700; line-height: 1.35; }
.spec-copy > p { margin: 0 0 20px; font-size: 13px; line-height: 1.9; color: var(--muted); }
.spec-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.spec-list li { display: flex; gap: 12px; font-size: 12.5px; line-height: 1.78; color: var(--ink-2); }
.spec-list li span { flex: none; padding-top: 3px; font-family: var(--font-mono); font-size: 10px; color: var(--accent); }

.code-block {
  margin: 0;
  padding: 22px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .06);
  background: #171410;
  color: #d8d1c4;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.95;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
  box-shadow: 0 24px 56px -36px rgba(20, 18, 14, .9);
}

/* ===================================================================
   素材库
   =================================================================== */

.asset-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-group {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.chip {
  border: 0;
  padding: 7px 14px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.chip:hover { color: var(--ink); }
.chip.is-active { background: var(--ink); color: #f6f2e9; }
.asset-count { font-size: 11.5px; letter-spacing: .06em; color: var(--muted); }

.asset-drop {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  margin-bottom: 26px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.asset-drop:hover, .asset-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.asset-drop-icon {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--accent);
}
.asset-drop-icon svg { width: 18px; height: 18px; }
.asset-drop strong { display: block; margin-bottom: 3px; font-size: 13px; }
.asset-drop span { display: block; font-size: 11.5px; color: var(--muted); }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.asset-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.asset-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.asset-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  overflow: hidden;
}
.asset-thumb img, .asset-thumb video { display: block; width: 100%; height: 100%; object-fit: cover; }
.asset-thumb--audio { background: linear-gradient(140deg, #1f2823, #111714); }
.asset-icon { color: var(--muted); }
.asset-icon svg { width: 30px; height: 30px; }
.asset-icon--audio { color: #5aa387; }
.asset-play {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(10, 12, 14, .6);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.asset-play svg { width: 12px; height: 12px; }
.asset-badge {
  position: absolute;
  left: 9px;
  top: 9px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(12, 10, 8, .55);
  color: rgba(255, 255, 255, .8);
  font-size: 9px;
  letter-spacing: .14em;
}
.asset-body { display: flex; flex-direction: column; gap: 7px; padding: 12px 13px 13px; }
.asset-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-meta { display: flex; flex-wrap: wrap; gap: 5px; font-size: 10.5px; color: var(--muted); }
.asset-actions { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.asset-actions .icon-btn { width: 28px; height: 28px; }
.asset-actions .icon-btn svg { width: 14px; height: 14px; }

/* ===================================================================
   可视化编辑器
   =================================================================== */

body.is-editor { overflow: hidden; }
body.is-editor .topbar { display: none; }
body.is-editor #view { height: 100vh; overflow: hidden; }

.editor { height: 100vh; display: flex; flex-direction: column; background: var(--surface-2); }

.editor-bar {
  flex: none;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.editor-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.editor-back { flex: none; }
.editor-heading { min-width: 0; }
.editor-heading > .eyebrow { font-size: 8.5px; letter-spacing: .22em; color: var(--muted); }
.editor-heading > .eyebrow::before { width: 12px; }
.title-row { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.title-input {
  width: clamp(180px, 30vw, 380px);
  height: 32px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .01em;
  transition: background .18s ease, border-color .18s ease;
}
.title-input:hover { background: var(--surface-2); }
.title-input:focus { outline: none; background: #fff; border-color: var(--line-strong); }
.status-pill {
  flex: none;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(33, 30, 25, .06);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .12em;
}
.status-pill.is-live { background: rgba(89, 192, 138, .16); color: var(--green); }

.editor-right { display: flex; align-items: center; gap: 8px; flex: none; }

/* 编辑器 · 保存 / 上一步 / 下一步 / 重置 */
.history-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-right: 4px;
  padding: 3px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.history-actions .btn-xs {
  background: transparent;
  border-color: transparent;
  color: var(--ink-2);
}
.history-actions .btn-xs:hover:not(:disabled) {
  background: #fff;
  border-color: var(--line-strong);
}
.history-actions .btn-xs:disabled { opacity: .35; }
.history-actions #save-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.history-actions #save-btn:hover:not(:disabled) {
  background: #dc5337;
  border-color: #dc5337;
  color: #fff;
}
.save-state { margin-right: 4px; font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.save-state.is-dirty { color: #b4762a; }
.save-state.is-busy { color: #4a7a9c; }
.save-state.is-ok { color: var(--green); }
.save-state.is-error { color: var(--accent); }

.editor-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 340px;
}

/* 结构树 */
.tree-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.panel-head {
  flex: none;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 16px;
  border-bottom: 1px solid var(--line);
}
.panel-title { display: flex; align-items: center; gap: 8px; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.panel-title small {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(33, 30, 25, .06);
  font-size: 9.5px;
  letter-spacing: .06em;
}
.tree { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 8px 16px; }
.tree-node {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.tree-node svg { flex: none; width: 15px; height: 15px; color: var(--muted); }
.tree-node:hover { background: var(--surface-2); }
.tree-node.is-active { background: var(--accent-soft); color: var(--ink); }
.tree-node.is-active svg { color: var(--accent); }
.tree-node--root { margin-bottom: 7px; border: 1px solid var(--line); background: var(--surface); }
.tree-node--root.is-active { border-color: rgba(210, 72, 47, .34); }
.tree-row { display: block; }
.tree-idx { flex: none; width: 22px; font-family: var(--font-mono); font-size: 10px; color: var(--muted); letter-spacing: .04em; }
.tree-node.is-active .tree-idx { color: var(--accent); }
.tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 22px);
  margin-left: 22px;
  padding: 6px 10px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 7px 7px 0;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  text-align: left;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.tree-sub:hover { background: var(--surface-2); color: var(--ink); }
.tree-sub.is-active { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent); }
.tree-sub span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-sub-dot { flex: none; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.panel-tip {
  flex: none;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 10.5px;
  line-height: 1.75;
  color: var(--muted);
}

/* 舞台 */
.stage-panel { display: flex; flex-direction: column; min-width: 0; background: #141210; }
.stage-toolbar {
  flex: none;
  height: 50px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.device-switch {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .07);
}
.device-switch button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(244, 241, 234, .55);
  font-size: 11px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.device-switch button svg { width: 13px; height: 13px; }
.device-switch button:hover { color: #f4f1ea; background: rgba(255, 255, 255, .07); }
.device-switch button.is-active { background: rgba(244, 241, 234, .92); color: #1b1916; }
.stage-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  font-size: 11px;
  letter-spacing: .05em;
  color: rgba(244, 241, 234, .38);
}
.stage-hint svg { width: 13px; height: 13px; flex: none; color: rgba(210, 72, 47, .9); }
.stage-toolbar .icon-btn { color: rgba(244, 241, 234, .55); }
.stage-toolbar .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.stage-area { flex: 1; min-height: 0; display: grid; place-items: center; padding: 18px; overflow: hidden; }

.device-shell { display: flex; flex-direction: column; gap: 8px; }
.device-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
  color: rgba(244, 241, 234, .42);
  font-size: 10px;
  letter-spacing: .18em;
}
.device-label em { font-style: normal; font-family: var(--font-mono); letter-spacing: .08em; color: rgba(244, 241, 234, .28); }
.device-viewport {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #07080a;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 26px 70px rgba(0, 0, 0, .55);
}
.device-frame {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  background: #000;
}
.device-frame iframe { display: block; width: 100%; height: 100%; border: 0; background: #000; }

/* 属性面板 */
.inspector {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border-left: 1px solid var(--line);
}
.inspector-head {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--line);
}
.inspector-title { min-width: 0; }
.inspector-title .eyebrow { font-size: 8.5px; letter-spacing: .22em; color: var(--muted); }
.inspector-title .eyebrow::before { width: 12px; }
.inspector-title h2 {
  margin: 6px 0 0;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.crumb {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 11px;
  cursor: pointer;
}
.crumb::before { content: "← "; }
.crumb:hover { text-decoration: underline; }
.inspector-menu { display: flex; gap: 1px; flex: none; }
.inspector-menu .icon-btn { width: 28px; height: 28px; }
.inspector-menu .icon-btn svg { width: 14px; height: 14px; }
.inspector-menu .icon-btn:last-child:hover { color: var(--accent); background: var(--accent-soft); }

.inspector-body { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 40px; }
.insp-block { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.insp-block:last-child { border-bottom: 0; }
.insp-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 9.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}
.insp-empty { margin: 0; padding: 10px 0; font-size: 11.5px; line-height: 1.7; color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
/* .field 的 display:flex 会盖掉 [hidden] 的默认 display:none，需要显式补回 */
.field[hidden] { display: none; }
.field:last-child { margin-bottom: 0; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field-label { font-size: 11.5px; color: var(--ink-2); letter-spacing: .02em; }
.field-hint { font-size: 10.5px; line-height: 1.65; color: var(--muted); }
.range-val {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  margin: 9px 0 5px;
  border-radius: 3px;
  background: var(--line-strong);
  outline: none;
  cursor: pointer;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(33, 30, 25, .3);
  cursor: grab;
}
.range::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 4px rgba(33, 30, 25, .3);
  cursor: grab;
}
.range:active::-webkit-slider-thumb { cursor: grabbing; transform: scale(1.08); }

.switch { position: relative; display: inline-block; width: 38px; height: 22px; cursor: pointer; }
.switch input { position: absolute; width: 0; height: 0; opacity: 0; }
.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background .2s ease;
}
.switch-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(33, 30, 25, .28);
  transition: transform .2s ease;
}
.switch input:checked + .switch-slider { background: var(--accent); }
.switch input:checked + .switch-slider::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-slider { box-shadow: 0 0 0 3px var(--accent-soft); }

.color-field { display: flex; align-items: center; gap: 8px; }
.color-field input[type="color"] {
  flex: none;
  width: 38px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}
.color-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 4px; }

.media-field { display: flex; flex-direction: column; gap: 8px; }
.media-preview {
  display: grid;
  place-items: center;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  overflow: hidden;
}
.media-preview.is-empty { border-style: dashed; }
.media-preview img, .media-preview video { display: block; width: 100%; height: 100%; object-fit: cover; }
.media-preview svg { width: 22px; height: 22px; opacity: .5; }
.media-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.is-loading { opacity: .6; pointer-events: none; }

.nested-card {
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.nested-card:last-child { margin-bottom: 0; }
.nested-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.nested-name {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.nested-name:hover { color: var(--accent); }
.nested-tools { display: flex; gap: 1px; flex: none; }
.nested-tools .icon-btn { width: 26px; height: 26px; }
.nested-tools .icon-btn svg { width: 13px; height: 13px; }
.nested-tools .icon-btn:last-child:hover { color: var(--accent); background: var(--accent-soft); }

.insp-block--meta { background: var(--surface-2); }
.meta-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 11.5px;
}
.meta-row:last-child { border-bottom: 0; }
.meta-row span { flex: none; color: var(--muted); }
.meta-row strong { font-weight: 500; color: var(--ink-2); text-align: right; overflow-wrap: anywhere; }

/* 素材选择器 */
.asset-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.picker-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.picker-item:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 10px 22px -16px rgba(33, 30, 25, .7); }
.picker-item img { display: block; width: 100%; height: 78px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.picker-icon { display: grid; place-items: center; height: 78px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.picker-icon svg { width: 22px; height: 22px; }
.picker-name { font-size: 11px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===================================================================
   弹窗 / 提示 / 空态
   =================================================================== */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 18, 14, .5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .22s ease;
}
.modal-mask.is-show { opacity: 1; }
.modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 16px;
  box-shadow: 0 32px 92px rgba(20, 18, 14, .38);
  transform: translateY(12px) scale(.985);
  transition: transform .26s cubic-bezier(.2, .7, .3, 1);
}
.modal-mask.is-show .modal { transform: none; }
.modal-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 14px 15px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-family: var(--font-serif); font-size: 18px; font-weight: 700; }
.modal-close { width: 32px; height: 32px; font-size: 19px; line-height: 1; }
.modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px; }
.modal-foot {
  flex: none;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.modal-text { margin: 0; font-size: 13.5px; line-height: 1.9; color: var(--ink-2); }

.publish-result { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 6px 0; text-align: center; }
.publish-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(89, 192, 138, .16);
  color: var(--green);
  font-size: 22px;
}
.publish-title { margin: 0; font-family: var(--font-serif); font-size: 17px; font-weight: 700; }
.publish-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px 8px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  font-size: 11px;
  color: var(--muted);
}
.publish-link span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.publish-note { margin: 0; font-size: 10.5px; line-height: 1.7; color: var(--muted); }

#toast-root { position: fixed; left: 50%; bottom: 38px; transform: translateX(-50%); z-index: 400; pointer-events: none; }
.toast {
  padding: 11px 20px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px;
  background: rgba(24, 21, 17, .94);
  color: #f6f2e9;
  font-size: 12.5px;
  letter-spacing: .03em;
  white-space: nowrap;
  box-shadow: 0 16px 40px rgba(20, 18, 14, .32);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .28s ease, transform .28s ease;
}
.toast.is-show { opacity: 1; transform: translateY(0); }
.toast--error { background: rgba(160, 44, 29, .96); }

.empty-state {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  padding: 54px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: var(--surface);
  text-align: center;
}
.empty-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 20px;
}
.empty-mark svg { width: 22px; height: 22px; }
.empty-state h2 { margin: 0 0 8px; font-family: var(--font-serif); font-size: 22px; font-weight: 700; }
.empty-state p { margin: 0 0 20px; max-width: 430px; font-size: 13px; line-height: 1.85; color: var(--muted); }

.empty-inline {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 46px 20px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
}
.empty-inline svg { width: 24px; height: 24px; opacity: .6; }

.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 50vh;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: .16em;
}
.page-loading span {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: studio-spin .8s linear infinite;
}
@keyframes studio-spin { to { transform: rotate(360deg); } }

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

@media (max-width: 1180px) {
  .editor-body { grid-template-columns: 216px minmax(0, 1fr) 302px; }
  .stat-row { gap: 12px; }
}

@media (max-width: 1080px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .spec-section { grid-template-columns: 1fr; }
  .spec-copy h2 { font-size: 23px; }
}

@media (max-width: 940px) {
  body.is-editor { overflow: auto; }
  body.is-editor #view { height: auto; overflow: visible; }
  .editor { height: auto; min-height: 100vh; }
  .editor-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .editor-heading > .eyebrow { display: none; }
  .title-input { width: min(52vw, 300px); font-size: 15px; }
  .editor-right { gap: 6px; flex-wrap: wrap; }
  .editor-right .save-state { display: none; }
  .editor-right .btn span { display: none; }
  .editor-right .btn { width: 34px; padding: 0; }
  .editor-body { grid-template-columns: 1fr; height: auto; }
  .stage-panel { order: -1; min-height: 400px; }
  .stage-area { min-height: 350px; padding: 12px; }
  .stage-hint span { display: none; }
  .tree-panel { border-right: 0; border-top: 1px solid var(--line); }
  .tree { max-height: 260px; }
  .panel-tip { display: none; }
  .inspector { border-left: 0; border-top: 1px solid var(--line); }
  .inspector-body { overflow: visible; }
}

@media (max-width: 780px) {
  .topbar { gap: 12px; padding: 0 14px; }
  .brand-text small { display: none; }
  .brand { gap: 9px; }
  .tabs { margin-left: auto; }
  .tabs a { padding: 7px 10px; font-size: 12px; letter-spacing: .02em; }
  .top-right { display: none; }

  .page { padding: 24px 16px 72px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 16px; padding-bottom: 20px; }
  .page-title h1 { font-size: 25px; }
  .head-actions { width: 100%; flex-wrap: wrap; }
  .head-actions .btn { flex: 1; }

  .work-grid { grid-template-columns: 1fr; }
  .template-grid { grid-template-columns: 1fr; }
  .template-pick { grid-template-columns: 1fr; }
  .asset-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .asset-drop { padding: 14px; }

  .capability-band { padding: 20px 16px 10px; }
  .cap-row { grid-template-columns: 1.3fr .7fr .7fr; font-size: 11.5px; }
  .code-block { font-size: 10.5px; padding: 16px; }

  .modal-mask { padding: 12px; align-items: end; }
  .modal { max-height: 88vh; }
  .modal-body { padding: 14px; }

  .device-switch button span { display: none; }
  .device-switch button { padding: 0 9px; }
  .stage-hint { display: none; }
}

@media (hover: none) {
  .btn:hover, .work-card:hover, .asset-card:hover, .template-card:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------------- 登录 / 注册 ---------------- */

.auth-wrap {
  position: relative; min-height: 100vh;
  display: grid; grid-template-columns: 1.1fr .9fr;
  background: var(--paper);
}
.auth-wrap::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(210, 72, 47, .08), transparent 40%);
  pointer-events: none;
}
.auth-hero {
  position: relative; display: flex; flex-direction: column;
  padding: clamp(48px, 7vw, 88px) clamp(40px, 6vw, 80px);
  justify-content: space-between; overflow: hidden;
}
.auth-hero-mark {
  width: 56px; height: 56px; border-radius: 12px;
  background: var(--accent); color: #fff; display: grid; place-items: center;
  font-family: var(--font-serif); font-size: 28px; font-weight: 700;
  box-shadow: 0 14px 32px -14px rgba(210, 72, 47, .9);
}
.auth-hero-text h1 {
  font-family: var(--font-serif); margin: 20px 0 10px; font-size: clamp(38px, 5.6vw, 64px); line-height: 1.08; letter-spacing: .015em;
}
.auth-hero-text p { color: var(--muted); letter-spacing: .24em; font-size: 11px; text-transform: uppercase; margin: 0; }
.auth-hero-decor {
  position: absolute; right: clamp(20px, 5vw, 56px); bottom: clamp(24px, 6vw, 60px);
  width: clamp(180px, 22vw, 260px); opacity: .9;
}
.auth-card {
  position: relative; display: flex; flex-direction: column;
  padding: clamp(36px, 5vw, 64px) clamp(36px, 5vw, 72px);
  background: var(--surface); box-shadow: -1px 0 0 var(--line);
  justify-content: center;
}
.auth-tabs {
  display: flex; gap: 6px; margin-bottom: 28px;
  border-bottom: 1px solid var(--line-strong); padding-bottom: 12px;
}
.auth-tab {
  background: none; border: 0; padding: 6px 2px;
  font-size: 15px; font-weight: 500; color: var(--muted); cursor: pointer;
  letter-spacing: .04em; position: relative;
  transition: color .2s ease;
}
.auth-tab.is-active { color: var(--ink); }
.auth-tab.is-active::after {
  content: ""; position: absolute; bottom: -13px; left: 0; right: 0; height: 2px;
  background: var(--accent); border-radius: 2px;
}
.auth-form { display: flex; flex-direction: column; gap: 0; }
.auth-error {
  min-height: 0; margin: 4px 0 12px; padding: 8px 12px;
  background: rgba(210, 72, 47, .08); color: var(--accent); border-radius: 8px;
  font-size: 13px; line-height: 1.6; display: none;
}
.auth-error:not(:empty) { display: block; }
.auth-submit { width: 100%; justify-content: center; margin-top: 6px; padding: 15px; font-size: 15px; letter-spacing: .08em; }
.auth-hint { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 16px; }
.auth-hint a { color: var(--accent); text-decoration: none; font-weight: 500; }
.auth-hint a:hover { text-decoration: underline; }
.auth-demo {
  margin-top: 22px; padding: 12px 16px; border-radius: 10px;
  background: var(--surface-2); color: var(--muted); font-size: 12px;
  border: 1px dashed var(--line-strong); text-align: center;
}
.auth-demo code {
  background: #fff; border: 1px solid var(--line); padding: 2px 8px; border-radius: 4px;
  color: var(--ink); font-family: ui-monospace, monospace; margin-left: 4px;
}

@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { padding: 36px 28px 48px; }
  .auth-hero-text h1 { font-size: 34px; }
  .auth-hero-decor { display: none; }
  .auth-card { padding: 32px 24px 48px; box-shadow: none; }
}

/* ---------------- 系统管理 ---------------- */

.admin-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px;
}
.admin-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px 22px; transition: transform .18s ease, box-shadow .18s ease;
}
.admin-card:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -26px rgba(33, 30, 25, .5); }
.admin-card-title {
  font-size: 11px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; margin-bottom: 12px;
}
.admin-stat span {
  display: block; font-family: var(--font-serif); font-size: 36px; font-weight: 700; color: var(--ink); line-height: 1;
}
.admin-stat small { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }

.admin-table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
}
.admin-table th {
  text-align: left; padding: 12px 14px; font-size: 11px; letter-spacing: .14em;
  color: var(--muted); text-transform: uppercase; font-weight: 500;
  border-bottom: 1px solid var(--line-strong);
}
.admin-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr:hover td { background: var(--surface-2); }
.admin-self { color: var(--accent); font-size: 11px; letter-spacing: .06em; }

.role-pill {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px; font-size: 11px; letter-spacing: .1em; font-weight: 500;
}
.role-pill.admin { background: rgba(210, 72, 47, .1); color: var(--accent); }
.role-pill.user { background: rgba(47, 125, 87, .1); color: var(--green); }

@media (max-width: 780px) {
  .admin-grid { grid-template-columns: 1fr; }
  .admin-table { font-size: 12px; }
  .admin-table th, .admin-table td { padding: 9px 10px; }
}

/* ---------------- 组件库弹窗 ---------------- */

.fx-lib {
  display: flex; flex-direction: column; gap: 14px;
  max-height: 62vh; overflow: auto; padding-right: 4px;
}
.fx-search { width: 100%; }
.fx-current {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px dashed var(--line-strong);
  font-size: 12.5px; color: var(--muted);
}
.fx-current strong { color: var(--ink); font-size: 13.5px; font-weight: 600; }
.fx-current .btn { margin-left: auto; }
.fx-groups { display: flex; flex-direction: column; gap: 18px; }
.fx-group-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.fx-group-head small { letter-spacing: .06em; opacity: .72; }
.fx-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px;
}
.fx-chip {
  text-align: left; padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 12.5px; color: var(--ink-2); cursor: pointer; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}
.fx-chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.fx-chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.fx-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 12.5px; }
