/* 设计素材库 · 外层界面
 * 视觉语言沿用终末地式工业 HUD：深色 ink 底、单一信号黄（面积极小）、技术字标签、
 * 两端淡出的分隔线、点阵底纹。图形含义固定：
 *   斜纹 = 边界 / 限制说明；黄色短竖条 = 当前位置；三色谱条 = 装饰信号，不表达状态。
 * 只用可公开分发的字体：HarmonyOS Sans（华为许可，可商用）、Space Grotesk（OFL）。 */

@font-face { font-family: "HarmonyOS Sans"; src: url("ui-fonts/HarmonyOS_Sans_Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "HarmonyOS Sans"; src: url("ui-fonts/HarmonyOS_Sans_Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "HarmonyOS Sans"; src: url("ui-fonts/HarmonyOS_Sans_Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("ui-fonts/SpaceGrotesk-Variable.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }

:root {
  --yellow: #fffa00;
  --yellow-lit: #fdfd1f;
  --online: #00ffa2;
  --alert: #ff00f0;
  --danger: #ff4d5e;

  --ink-0: #0a0a0a;
  --ink-1: #111111;
  --ink-2: #161616;
  --ink-3: #1f1f1f;
  --ink-4: #2a2a2a;
  --ink-5: #383838;

  --text: #f2f2f2;
  --text-2: #b3b3b3;
  --text-3: #8a8a8a;
  --text-4: #5f5f5f;

  --line: rgba(255,255,255,.09);
  --line-2: rgba(255,255,255,.16);
  --line-strong: rgba(255,255,255,.42);

  --radius: 4px;
  --sidebar: 248px;
  --ease: cubic-bezier(.16,1,.3,1);

  --font-body: "HarmonyOS Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --font-tech: "Space Grotesk", "HarmonyOS Sans", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --hazard: repeating-linear-gradient(-45deg, var(--yellow) 0 6px, transparent 6px 12px);
  --spectrum: linear-gradient(90deg, var(--alert) 0 32%, var(--yellow) 32% 66%, var(--online) 66% 100%);
  --fade-line: linear-gradient(90deg, transparent, var(--line-2) 12%, var(--line-2) 88%, transparent);

  /* 旧变量名保留给 app.js 内联样式与历史引用 */
  --paper: var(--ink-0);
  --panel: var(--ink-2);
  --ink: var(--text);
  --muted: var(--text-3);

  color-scheme: dark;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--ink-0);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background-color: var(--ink-0);
  background-image:
    radial-gradient(ellipse 80% 60% at 70% -10%, rgba(255,255,255,.045), transparent 60%),
    radial-gradient(rgba(255,255,255,.045) 1px, transparent 1.2px);
  background-size: 100% 100%, 8px 8px;
}
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select { touch-action: manipulation; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; border: 1px solid var(--line-2); background: var(--ink-3); color: var(--text); }
button:disabled { cursor: not-allowed; opacity: .4; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--yellow); color: #111; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }

/* ---------------- 侧栏 ---------------- */
.sidebar {
  width: var(--sidebar);
  position: fixed; inset: 0 auto 0 0; z-index: 20;
  display: flex; flex-direction: column;
  padding: 28px 18px 24px;
  background: #0d0d0d;
  color: var(--text);
}
.sidebar::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 1px;
  background: linear-gradient(180deg, transparent, var(--line-2) 15%, var(--line-2) 85%, transparent);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand > span:last-child { display: flex; flex-direction: column; font-size: 19px; font-weight: 700; letter-spacing: .14em; line-height: 1.1; }
.brand small { font-family: var(--font-tech); font-size: 9px; font-weight: 500; letter-spacing: .26em; color: var(--text-3); margin-top: 6px; }
.brand-mark { position: relative; display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; color: var(--text); }
.brand-mark svg { display: block; width: 100%; height: 100%; }
.brand-mark::after { content: ""; position: absolute; right: -3px; top: -3px; width: 6px; height: 6px; background: var(--yellow); border-radius: 1px; }

.sidebar-label {
  display: flex; justify-content: space-between; align-items: center;
  margin: 40px 8px 14px;
  font-family: var(--font-tech); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--text-3);
}
.sidebar-label::before { content: ""; width: 14px; height: 1px; background: var(--line-strong); margin-right: 10px; }
.sidebar-label { justify-content: flex-start; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--online); box-shadow: 0 0 8px rgba(0,255,162,.6); margin-left: auto; animation: live-breath 2.4s ease-in-out infinite; }
@keyframes live-breath { 50% { opacity: .35; } }

nav { display: grid; gap: 2px; }
nav a {
  position: relative;
  display: grid; grid-template-columns: 26px 1fr auto; align-items: center; column-gap: 10px;
  min-height: 46px; padding: 7px 10px;
  border-radius: var(--radius);
  color: var(--text-2);
  transition: background-color .2s ease, color .2s ease;
}
nav a > span:first-child { font-family: var(--font-tech); font-size: 11px; font-weight: 500; color: var(--text-4); letter-spacing: .06em; transition: color .2s ease; }
nav a b { font-family: var(--font-tech); font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; line-height: 1.25; display: block; }
nav a i { font-style: normal; font-size: 12px; color: var(--text-3); display: block; line-height: 1.4; margin-top: 1px; }
nav a > span:first-child + * { min-width: 0; }
nav a:hover { background: rgba(255,255,255,.045); color: var(--text); }
nav a.active { background: rgba(255,255,255,.06); color: var(--text); }
nav a.active::before { content: ""; position: absolute; left: -18px; top: 9px; bottom: 9px; width: 3px; background: var(--yellow); border-radius: 0 2px 2px 0; box-shadow: 0 0 10px rgba(255,250,0,.4); }
nav a.active > span:first-child { color: var(--yellow); }
nav a.active i { color: var(--text-2); }
nav em { font-family: var(--font-tech); font-style: normal; font-size: 10px; color: var(--text-3); letter-spacing: .04em; font-variant-numeric: tabular-nums; }

.sidebar-bottom { margin-top: auto; padding: 22px 8px 0; font-size: 11px; color: var(--text-3); line-height: 1.8; position: relative; }
.sidebar-bottom::before { content: ""; position: absolute; top: 0; left: 8px; right: 8px; height: 1px; background: var(--fade-line); }
.sidebar-bottom p { margin: 10px 0 0; }
.sidebar-bottom a { color: var(--text-2); transition: color .2s ease; }
.sidebar-bottom a:hover { color: var(--yellow); }
.local-tag { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-tech); font-size: 10px; font-weight: 600; letter-spacing: .16em; color: var(--text); }
.local-tag::before { content: ""; width: 16px; height: 4px; background: var(--spectrum); border-radius: 1px; }

/* ---------------- 主区 ---------------- */
.shell { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 15;
  height: 64px; padding: 0 44px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(10,10,10,.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  font-family: var(--font-tech); font-size: 12px; letter-spacing: .08em; color: var(--text-2);
}
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--fade-line); }
#breadcrumb { font-family: var(--font-body); letter-spacing: .02em; color: var(--text); }
#breadcrumb::before { content: "DESIGN LIBRARY  /  "; font-family: var(--font-tech); font-size: 11px; letter-spacing: .18em; color: var(--text-4); white-space: pre; }
.topbar-right { display: flex; gap: 26px; align-items: center; }
.topbar-right > span { font-size: 10.5px; letter-spacing: .16em; color: var(--text-3); }
.quiet-button { background: none; border: 0; padding: 10px 0; font-family: var(--font-tech); font-size: 11.5px; letter-spacing: .12em; color: var(--text-2); transition: color .2s ease; }
.quiet-button:hover { color: var(--yellow); }

main { padding: 44px 44px 72px; flex: 1; min-width: 0; }
main > * { animation: page-in .32s var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------------- 页头 ---------------- */
.eyebrow { font-family: var(--font-tech); font-size: 10.5px; font-weight: 500; line-height: 1.4; letter-spacing: .22em; color: var(--text-3); text-transform: uppercase; }
.page-head { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 34px; padding-top: 10px; isolation: isolate; }
.page-head::before {
  content: attr(data-ghost);
  position: absolute; z-index: -1; left: -4px; top: -26px;
  font-family: var(--font-tech); font-weight: 700; font-size: clamp(64px, 9vw, 132px); line-height: 1; letter-spacing: -.03em;
  color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.07);
  white-space: nowrap; pointer-events: none; user-select: none;
}
.page-head .eyebrow { display: flex; align-items: center; gap: 12px; }
.page-head .eyebrow::before { content: ""; width: 22px; height: 8px; background: var(--hazard); border-radius: 1px; }
.page-head h1 { font-size: 38px; font-weight: 700; letter-spacing: -.01em; margin: 14px 0 12px; line-height: 1.22; }
.page-head p { font-size: 13.5px; line-height: 1.9; color: var(--text-2); max-width: 700px; margin: 0; }
.page-head .head-note { font-family: var(--font-tech); font-size: 11px; letter-spacing: .16em; color: var(--text-3); white-space: nowrap; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: var(--radius); }

/* ---------------- 首页主视觉 ---------------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: 1fr 1fr; min-height: 360px; margin-bottom: 24px;
  border-radius: var(--radius);
  background:
    linear-gradient(110deg, rgba(10,10,10,.96) 30%, rgba(10,10,10,.55) 70%, rgba(10,10,10,.85)),
    radial-gradient(rgba(255,255,255,.07) 1px, transparent 1.3px) 0 0 / 12px 12px,
    var(--ink-1);
  border: 1px solid var(--line);
}
.hero::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 3px; background: linear-gradient(90deg, var(--yellow) 0 64px, transparent 64px); }
.hero::after {
  content: ""; position: absolute; left: 34px; right: 34px; bottom: 18px; height: 10px; z-index: 1; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.28) 0 1px, transparent 1px 12px) bottom / 100% 5px no-repeat,
    repeating-linear-gradient(90deg, rgba(255,255,255,.5) 0 1px, transparent 1px 120px) bottom / 100% 10px no-repeat;
}
.hero-copy { padding: 46px 40px 54px; z-index: 2; align-self: center; }
.hero .eyebrow { color: var(--text-2); display: flex; align-items: center; gap: 12px; }
.hero .eyebrow::after { content: ""; width: 40px; height: 4px; background: var(--spectrum); border-radius: 1px; }
.hero h2 { font-size: 46px; line-height: 1.22; margin: 22px 0 18px; letter-spacing: -.02em; max-width: 480px; font-weight: 700; }
.hero h2 mark { background: none; color: var(--yellow); padding: 0; text-shadow: 0 0 22px rgba(255,250,0,.25); }
.hero p { color: var(--text-2); font-size: 12.5px; line-height: 2; max-width: 380px; }
.hero-art { position: relative; min-width: 0; overflow: hidden; }
.hero-art img { width: 66%; position: absolute; border: 4px solid #e9e9e9; border-radius: 2px; box-shadow: 0 18px 40px rgba(0,0,0,.6); object-fit: contain; aspect-ratio: 288/200; background: #111; }
.hero-art img:nth-of-type(1) { left: 6%; top: 18%; transform: rotate(-8deg); }
.hero-art img:nth-of-type(2) { left: 34%; top: 42%; transform: rotate(6deg); }
.hero-art .cross { position: absolute; right: 30px; top: 22px; color: var(--yellow); font-size: 30px; font-weight: 200; z-index: 2; }
.hero-art .art-label { position: absolute; bottom: 36px; right: 34px; z-index: 2; font-family: var(--font-tech); font-size: 9.5px; letter-spacing: .24em; color: var(--text-3); }

/* ---------------- 按钮 ---------------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  padding: 12px 18px; border: 1px solid var(--ink-5); border-radius: var(--radius);
  background: var(--ink-5); color: #eee;
  font-size: 12px; font-weight: 500; letter-spacing: .02em; line-height: 1.3; text-align: center;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.button:hover { background: var(--yellow); border-color: var(--yellow); color: #151515; }
.button.accent { background: var(--yellow); border-color: var(--yellow); color: #151515; font-weight: 700; }
.button.accent:hover { background: #fff; border-color: #fff; }
.button.secondary { background: transparent; border-color: var(--line-2); color: var(--text); }
.button.secondary:hover { border-color: var(--line-strong); background: rgba(255,255,255,.05); color: var(--text); }
.button.small { padding: 9px 13px; font-size: 11.5px; }
.button.disabled { opacity: .45; pointer-events: none; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- 统计 ---------------- */
.stats { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 36px; border-radius: var(--radius); background: rgba(22,22,22,.7); border: 1px solid var(--line); }
.stat { position: relative; padding: 22px 24px 20px; }
.stat + .stat::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 1px; background: linear-gradient(180deg, transparent, var(--line-2), transparent); }
.stat .stat-value { display: block; font-family: var(--font-tech); font-size: 32px; font-weight: 600; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat label { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11.5px; color: var(--text-3); }
.stat label::before { content: ""; width: 6px; height: 6px; border: 1px solid var(--text-3); border-radius: 1px; }
.stat:first-child label::before { background: var(--yellow); border-color: var(--yellow); }

/* ---------------- 区块标签 ---------------- */
.section-label { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 38px 0 16px; padding-bottom: 12px; }
.section-label::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, var(--line-strong), var(--line) 40%, transparent); }
.section-label h2 { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; margin: 0; letter-spacing: .02em; }
.section-label h2::before { content: ""; width: 3px; height: 14px; background: var(--yellow); border-radius: 1px; }
.section-label > span, .section-label > a { font-family: var(--font-tech); font-size: 10.5px; letter-spacing: .2em; color: var(--text-3); text-transform: uppercase; }

/* ---------------- 首页入口 ---------------- */
.entry-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.entry-card { position: relative; display: block; padding: 24px 24px 22px; border-radius: var(--radius); background: var(--ink-2); border: 1px solid var(--line); transition: border-color .2s ease, background-color .2s ease; }
.entry-card::before { content: ""; position: absolute; left: -1px; top: -1px; width: 18px; height: 2px; background: var(--text-4); border-top-left-radius: var(--radius); transition: background-color .2s ease, width .3s var(--ease); }
.entry-card:hover { border-color: var(--line-strong); background: var(--ink-3); }
.entry-card:hover::before { background: var(--yellow); width: 42px; }
.entry-card .entry-index { font-family: var(--font-tech); font-size: 10.5px; letter-spacing: .2em; color: var(--text-3); }
.entry-card h3 { font-size: 18px; margin: 20px 0 10px; }
.entry-card p { font-size: 12.5px; line-height: 1.85; color: var(--text-2); margin: 0; }
.entry-card .entry-arrow { display: block; margin-top: 22px; font-size: 16px; color: var(--text-3); transition: color .2s ease, transform .2s ease; }
.entry-card:hover .entry-arrow { color: var(--yellow); transform: translate(2px, -2px); }

/* 斜纹 = 边界与限制说明 */
.coverage-strip, .local-help {
  position: relative; margin-top: 24px; padding: 16px 20px 16px 30px;
  border-radius: var(--radius); background: rgba(255,250,0,.035); border: 1px solid rgba(255,250,0,.14);
  color: var(--text-2); font-size: 12.5px; line-height: 1.85;
}
.coverage-strip::before, .local-help::before { content: ""; position: absolute; left: 10px; top: 10px; bottom: 10px; width: 8px; background: var(--hazard); border-radius: 1px; opacity: .85; }
.coverage-strip a, .local-help a { color: var(--yellow); }
.local-help { margin: 0 0 22px; }
.local-help code { padding: 2px 5px; background: var(--ink-4); border-radius: 2px; }

/* ---------------- 素材库 ---------------- */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.search { position: relative; flex: 1; min-width: 240px; }
.search input { width: 100%; padding: 14px 16px 14px 42px; }
.search::before { content: ""; position: absolute; left: 16px; top: 50%; width: 12px; height: 12px; margin-top: -8px; border: 1.6px solid var(--text-3); border-radius: 50%; pointer-events: none; }
.search::after { content: ""; position: absolute; left: 27px; top: 50%; width: 6px; height: 1.6px; margin-top: 3px; background: var(--text-3); transform: rotate(45deg); pointer-events: none; }

input[type=search], input[type=text], select {
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: rgba(8,8,8,.8); color: var(--text);
  transition: border-color .2s ease, box-shadow .2s ease;
}
input[type=search]::placeholder, input[type=text]::placeholder { color: var(--text-4); }
input[type=search]:hover, input[type=text]:hover, select:hover { border-color: var(--line-strong); }
input[type=search]:focus, input[type=text]:focus, select:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255,250,0,.12); }
select {
  appearance: none; -webkit-appearance: none;
  padding: 13px 38px 13px 14px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0h10L5 6z' fill='%23b3b3b3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
select option { background: var(--ink-2); color: var(--text); }
input[type=checkbox] { accent-color: var(--yellow); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 22px; }
.chip { display: inline-flex; align-items: center; padding: 8px 12px; font-size: 12px; background: transparent; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text-2); transition: border-color .2s ease, color .2s ease, background-color .2s ease; }
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.active { background: #f2f2f2; color: #151515; border-color: #f2f2f2; font-weight: 500; }
.chip em { font-family: var(--font-tech); font-size: 10px; font-style: normal; opacity: .55; margin-left: 8px; font-variant-numeric: tabular-nums; }
.chip.active em { opacity: .7; }
.results-meta { font-family: var(--font-tech); font-size: 11px; letter-spacing: .08em; color: var(--text-3); display: flex; justify-content: space-between; margin-bottom: 14px; font-variant-numeric: tabular-nums; }

.asset-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.asset-card { display: flex; flex-direction: column; text-align: left; padding: 0; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; overflow: hidden; color: var(--text); transition: border-color .2s ease; }
.asset-card:hover { border-color: var(--line-strong); }
.asset-card:hover .asset-info h3 { color: var(--yellow); }
.asset-preview {
  height: 164px; width: 100%; display: grid; place-items: center; position: relative; overflow: hidden;
  background-color: #e9e9e7;
  background-image: linear-gradient(45deg, #dbdbd8 25%, transparent 25%), linear-gradient(-45deg, #dbdbd8 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #dbdbd8 75%), linear-gradient(-45deg, transparent 75%, #dbdbd8 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.asset-preview.dark { background-color: #1a1a1a; background-image: linear-gradient(45deg, #242424 25%, transparent 25%), linear-gradient(-45deg, #242424 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #242424 75%), linear-gradient(-45deg, transparent 75%, #242424 75%); }
.asset-preview img { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); min-width: 0; min-height: 0; object-fit: contain; object-position: center; display: block; }
.asset-preview .type-badge {
  position: absolute; top: 8px; right: 8px; padding: 4px 8px 4px 7px;
  background: rgba(10,10,10,.82); color: #f2f2f2;
  font-family: var(--font-tech); font-size: 9px; font-weight: 600; letter-spacing: .12em;
  clip-path: polygon(0 0, calc(100% - 5px) 0, 100% 5px, 100% 100%, 5px 100%, 0 calc(100% - 5px));
}
.asset-preview .media-icon { font-size: 34px; font-family: var(--font-tech); color: #8c8c8c; }
.asset-preview.dark .media-icon { color: #6a6a6a; }
.asset-info { padding: 12px 13px 13px; width: 100%; min-width: 0; }
.asset-info h3 { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0 0 8px; transition: color .2s ease; }
.asset-info p { font-family: var(--font-tech); font-size: 10px; letter-spacing: .04em; color: var(--text-3); display: flex; justify-content: space-between; margin: 0; gap: 6px; font-variant-numeric: tabular-nums; }
.empty { padding: 70px 20px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--radius); font-size: 13px; line-height: 2; color: var(--text-3); }
.pager { display: flex; justify-content: center; align-items: center; gap: 22px; margin-top: 30px; font-family: var(--font-tech); font-size: 11.5px; letter-spacing: .08em; color: var(--text-2); }
.pager button { padding: 11px 18px; border-radius: var(--radius); background: transparent; border-color: var(--line-2); transition: border-color .2s ease, color .2s ease; }
.pager button:not(:disabled):hover { border-color: var(--yellow); color: var(--yellow); }

/* ---------------- 排版模板 ---------------- */
.layout-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.layout-card { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; overflow: hidden; transition: border-color .2s ease; }
.layout-card:hover { border-color: var(--line-strong); }
.layout-thumb { height: 208px; background: #0d0d0d; overflow: hidden; display: flex; align-items: center; justify-content: center; position: relative; }
.layout-thumb img { height: 100%; width: 100%; min-width: 0; min-height: 0; object-fit: contain; object-position: center; }
.layout-thumb.tall img { object-fit: contain; }
.layout-thumb .template-number {
  position: absolute; bottom: 10px; left: 10px; padding: 5px 9px 5px 8px;
  background: rgba(10,10,10,.85); color: var(--text);
  font-family: var(--font-tech); font-size: 10px; font-weight: 600; letter-spacing: .14em;
  border-left: 2px solid var(--yellow);
}
.layout-body { padding: 18px; }
.layout-body h3 { font-size: 15px; margin: 0 0 9px; }
.layout-body p { font-size: 12px; color: var(--text-2); line-height: 1.8; min-height: 42px; margin: 0 0 14px; }
.layout-body .tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 16px; }
.tags span { font-size: 10.5px; padding: 3px 7px; background: rgba(255,255,255,.05); color: var(--text-3); border-radius: 2px; }
.font-demo { font-family: var(--font-tech); font-size: 38px; color: var(--text-4); letter-spacing: .06em; }

/* ---------------- 配色与字体 ---------------- */
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.swatch { border: 1px solid var(--line); border-radius: var(--radius); background: var(--ink-2); text-align: left; padding: 0; overflow: hidden; color: var(--text); transition: border-color .2s ease; }
.swatch:hover { border-color: var(--line-strong); }
.swatch > span { display: block; height: 100px; }
.swatch > div { padding: 13px; font-size: 12px; }
.swatch code { display: block; font-family: var(--font-tech); font-size: 10.5px; letter-spacing: .08em; margin-top: 7px; color: var(--text-3); }
.font-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.font-card { padding: 26px; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.font-card .specimen { font-size: 37px; line-height: 1.4; margin: 20px 0; word-break: break-word; }
.font-card h3 { font-size: 13px; margin: 0; font-family: var(--font-tech); letter-spacing: .06em; }
.font-card p { font-size: 12px; color: var(--text-2); line-height: 1.8; }
.font-download { font-family: var(--font-tech); font-size: 11px; letter-spacing: .04em; color: var(--yellow); }
.font-download:hover { text-decoration: underline; }
.rule-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.rule { position: relative; padding: 16px 0; font-size: 12.5px; line-height: 1.85; }
.rule::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, var(--text) 0 36px, var(--line) 36px, transparent); }
.rule strong { display: block; margin-bottom: 6px; }
.rule p { margin: 0; color: var(--text-2); }
.note { font-size: 12.5px; line-height: 1.9; color: var(--text-3); margin: 18px 0; }
.code-sample { background: #070707; color: #d8d8d8; font: 11.5px/1.85 var(--font-tech); padding: 20px 22px; border-radius: var(--radius); border: 1px solid var(--line); overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------------- 图层组装 ---------------- */
.assembly-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; }
.assembly-stage { background: #0d0d0d; position: relative; min-height: 340px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); }
.assembly-stage canvas { width: 100%; height: auto; display: block; }
.assembly-controls { background: rgba(22,22,22,.85); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.assembly-controls h3 { font-size: 14px; margin: 0 0 14px; }
.layer-control { position: relative; display: flex; align-items: center; gap: 12px; font-size: 12.5px; margin: 0; padding: 13px 2px; cursor: pointer; }
.layer-control + .layer-control::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--fade-line); }
.layer-control input { width: 15px; height: 15px; margin: 0; }
.layer-control small { margin-left: auto; font-family: var(--font-tech); font-size: 10px; letter-spacing: .1em; color: var(--text-4); }
.field-label { display: block; font-size: 11.5px; color: var(--text-3); margin: 18px 0 8px; }
.assembly-controls input[type=text] { width: 100%; padding: 11px 12px; }
.assembly-controls select { width: 100%; font-size: 12px; }
.assembly-description { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 22px; }
.assembly-step { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; position: relative; }
.assembly-step b { font-family: var(--font-tech); font-size: 12px; letter-spacing: .1em; color: var(--yellow); }
.assembly-step h3 { font-size: 13px; }
.assembly-step p { font-size: 12px; line-height: 1.8; color: var(--text-2); }

/* ---------------- 图形生成器 ---------------- */
.generator-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.generator-card { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; transition: border-color .2s ease; }
.generator-card:hover { border-color: var(--line-strong); }
.generator-art { position: relative; height: 150px; display: flex; align-items: center; justify-content: center; background: #0b0b0b; margin-bottom: 18px; overflow: hidden; border-radius: 2px; }
.generator-art::before, .generator-art::after { content: ""; position: absolute; width: 10px; height: 10px; border-color: var(--text-4); border-style: solid; transition: border-color .2s ease; }
.generator-art::before { left: 8px; top: 8px; border-width: 1px 0 0 1px; }
.generator-art::after { right: 8px; bottom: 8px; border-width: 0 1px 1px 0; }
.generator-card:hover .generator-art::before, .generator-card:hover .generator-art::after { border-color: var(--yellow); }
.generator-art svg { width: 145px; height: 125px; stroke: #d6d6d6; fill: none; stroke-width: 1; }
.generator-art svg [fill="#dce6cf"] { fill: #d6d6d6; }
.generator-card h3 { font-size: 15px; margin: 0 0 9px; }
.generator-card p { font-size: 12px; color: var(--text-2); line-height: 1.8; min-height: 42px; }
.generator-card .button { margin-top: 10px; }

/* ---------------- 动态立绘 ---------------- */
.motion-stage {
  position: relative; display: flex; align-items: center; justify-content: center;
  aspect-ratio: 16 / 9; min-height: 300px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  background-color: #141414;
  background-image: linear-gradient(45deg, #1c1c1c 25%, transparent 25%), linear-gradient(-45deg, #1c1c1c 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #1c1c1c 75%), linear-gradient(-45deg, transparent 75%, #1c1c1c 75%);
  background-size: 28px 28px; background-position: 0 0, 0 14px, 14px -14px, -14px 0;
}
/* 画布像素尺寸跟随视频；显示时等比放入舞台，避免拉伸变形 */
.motion-stage canvas { width: 100%; height: 100%; object-fit: contain; display: block; }
.motion-stage .empty { border: 0; color: var(--text-2); }
.motion-controls { margin-top: 12px; padding: 14px 16px; background: rgba(22,22,22,.85); border: 1px solid var(--line); border-radius: var(--radius); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.motion-controls select { max-width: 220px; padding-top: 10px; padding-bottom: 10px; }
.motion-controls .time { font-family: var(--font-tech); font-size: 11px; letter-spacing: .06em; color: var(--text-3); margin-left: auto; font-variant-numeric: tabular-nums; }
.split-explainer { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0; }
.explain-box { padding: 22px; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); font-size: 12.5px; line-height: 1.85; color: var(--text-2); }
.explain-box strong { display: block; color: var(--text); font-size: 14px; margin-bottom: 6px; }

/* ---------------- 归档状态 ---------------- */
.archive-table { width: 100%; border-collapse: collapse; background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); font-size: 12px; overflow: hidden; }
.archive-table td, .archive-table th { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: left; line-height: 1.7; overflow-wrap: anywhere; }
.archive-table tr:last-child td { border-bottom: 0; }
.archive-table th { font-family: var(--font-tech); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); font-weight: 500; background: rgba(255,255,255,.03); }
.archive-table td:nth-child(n+2) { font-variant-numeric: tabular-nums; }
.archive-table code { font-size: 10.5px; }
.status-good { color: var(--online); }
.status-bad { color: var(--danger); }
.archive-progress { height: 6px; background: var(--ink-4); margin: 18px 0 10px; overflow: hidden; border-radius: 1px; }
.archive-progress span { display: block; height: 100%; background: var(--yellow); }
.archive-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
details { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 18px; overflow: hidden; }
summary { padding: 17px 18px; cursor: pointer; font-size: 12.5px; color: var(--text); list-style: none; display: flex; align-items: center; gap: 10px; transition: background-color .2s ease; }
summary::-webkit-details-marker { display: none; }
summary::before { content: ""; width: 0; height: 0; border-left: 5px solid var(--text-3); border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .2s ease; }
details[open] > summary::before { transform: rotate(90deg); border-left-color: var(--yellow); }
summary:hover { background: rgba(255,255,255,.03); }
details > .archive-table, details > .code-sample { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.archive-note { line-height: 1.9; font-size: 12.5px; color: var(--text-3); max-width: 820px; }
.source-link { font-size: 11.5px; color: var(--text-2); text-decoration: underline; text-decoration-color: var(--text-4); text-underline-offset: 3px; transition: color .2s ease; }
.source-link:hover { color: var(--yellow); }
.inline-status { display: inline-block; padding: 4px 7px; font: 10px var(--font-tech); background: rgba(255,255,255,.06); color: var(--text-2); border-radius: 2px; }
.muted { color: var(--text-3); }
.notice-badge { padding: 6px 9px; background: rgba(255,255,255,.06); font-size: 10px; color: var(--text-2); border-radius: 2px; }

footer { position: relative; padding: 22px 44px; display: flex; justify-content: space-between; gap: 15px; font-family: var(--font-tech); font-size: 10px; letter-spacing: .2em; color: var(--text-4); }
footer::before { content: ""; position: absolute; left: 44px; right: 44px; top: 0; height: 1px; background: var(--fade-line); }
footer span { font-family: var(--font-body); font-size: 11px; letter-spacing: 0; color: var(--text-3); }

/* ---------------- 素材详情 ---------------- */
dialog { width: min(1040px, 92vw); max-height: 90vh; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 0; background: var(--ink-1); color: var(--text); box-shadow: 0 30px 90px rgba(0,0,0,.7); }
dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(4px); }
.dialog-top { position: relative; display: flex; justify-content: space-between; align-items: center; padding: 13px 18px 13px 22px; background: var(--ink-3); }
.dialog-top .eyebrow { display: flex; align-items: center; gap: 12px; color: var(--text-2); }
.dialog-top .eyebrow::before { content: ""; width: 22px; height: 8px; background: var(--hazard); border-radius: 1px; }
.icon-button { border: 0; background: transparent; font-size: 24px; width: 34px; height: 34px; border-radius: var(--radius); color: var(--text-2); transition: color .2s ease, background-color .2s ease; }
.icon-button:hover { color: var(--text); background: rgba(255,255,255,.07); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); }
.detail-preview {
  min-height: 380px; max-height: 65vh; display: flex; align-items: center; justify-content: center; overflow: auto; padding: 22px;
  background-color: #161616;
  background-image: linear-gradient(45deg, #1f1f1f 25%, transparent 25%), linear-gradient(-45deg, #1f1f1f 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #1f1f1f 75%), linear-gradient(-45deg, transparent 75%, #1f1f1f 75%);
  background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.detail-preview img, .detail-preview video { display: block; width: auto; height: auto; max-width: 100%; max-height: 60vh; min-width: 0; min-height: 0; object-fit: contain; object-position: center; }
.detail-meta { padding: 26px; overflow-wrap: anywhere; }
.detail-meta h2 { font-size: 20px; line-height: 1.5; margin: 0 0 20px; }
.detail-meta dl { font-size: 12px; line-height: 1.8; margin: 0; }
.detail-meta dt { font-family: var(--font-tech); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-4); margin-top: 14px; }
.detail-meta dd { margin: 3px 0 0; color: var(--text-2); }
.detail-meta .button-row { margin-top: 26px; }
.detail-font { font-size: 60px; color: var(--text-2); }
.detail-text { color: var(--text-2); font: 12px var(--font-tech); white-space: pre-wrap; word-break: break-all; }
.copy-field { font-family: var(--font-tech); font-size: 10.5px; }

/* ---------------- 提示与保存条 ---------------- */
#toast { position: fixed; bottom: 26px; left: 50%; z-index: 100; transform: translate(-50%, 10px); display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: var(--ink-3); border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--text); font-size: 12.5px; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
#toast::before { content: ""; width: 3px; height: 14px; background: var(--yellow); border-radius: 1px; }
#toast.visible { opacity: 1; transform: translate(-50%, 0); }
.export-ready { position: fixed; z-index: 99999; left: calc(var(--sidebar) + 24px); bottom: 24px; max-width: calc(100vw - var(--sidebar) - 48px); display: flex; align-items: center; gap: 18px; padding: 14px 18px 14px 20px; background: var(--ink-3); color: var(--text-2); border: 1px solid var(--line-2); border-left: 3px solid var(--yellow); border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0,0,0,.55); font-size: 12.5px; line-height: 1.5; }
.export-ready a { color: var(--yellow); font-weight: 600; overflow-wrap: anywhere; }
.export-ready button { background: none; border: 0; cursor: pointer; color: var(--text-3); white-space: nowrap; }
.export-ready button:hover { color: var(--text); }

/* ---------------- 编辑器框 ---------------- */
.editor-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 15px; font-size: 12.5px; }
.editor-toolbar > a:first-child { font-family: var(--font-tech); letter-spacing: .06em; color: var(--text-2); transition: color .2s ease; }
.editor-toolbar > a:first-child:hover { color: var(--yellow); }
.editor-toolbar strong { display: flex; align-items: center; gap: 10px; }
.editor-toolbar strong::before { content: ""; width: 3px; height: 14px; background: var(--yellow); border-radius: 1px; }
.editor-frame { height: calc(100vh - 190px); min-height: 580px; width: 100%; border: 1px solid var(--line-2); border-radius: var(--radius); background: #fafafa; }

/* ---------------- 响应式 ---------------- */
@media (min-width: 1550px) {
  .asset-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .layout-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .asset-preview { height: 190px; }
  main { max-width: 1760px; width: 100%; margin: 0 auto; }
  .hero-art img { width: 55%; }
}
@media (max-width: 1100px) {
  :root { --sidebar: 212px; }
  .sidebar { padding: 24px 14px; }
  nav a.active::before { left: -14px; }
  .topbar { padding: 0 26px; }
  main { padding: 34px 26px 54px; }
  footer { padding: 20px 26px; }
  footer::before { left: 26px; right: 26px; }
  .hero h2 { font-size: 36px; }
  .hero-copy { padding: 30px; }
  .hero-art img { width: 84%; left: 0 !important; }
  .hero-art img:nth-of-type(2) { left: 30% !important; }
  .asset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .swatches { grid-template-columns: repeat(3, 1fr); }
  .assembly-layout { grid-template-columns: minmax(0, 1fr) 250px; }
  .assembly-description { grid-template-columns: repeat(3, 1fr); }
  .generator-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 18px; }
  .stat .stat-value { font-size: 26px; }
}
@media (max-width: 760px) {
  :root { --sidebar: 0px; }
  .sidebar { position: relative; width: 100%; height: auto; padding: 18px 16px 0; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--ink-1); }
  .sidebar::after { display: none; }
  .brand > span:last-child { font-size: 17px; }
  .sidebar-label, .sidebar-bottom { display: none; }
  nav { display: flex; overflow-x: auto; gap: 2px; margin-top: 16px; padding-bottom: 8px; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav a { flex: 0 0 auto; display: flex; min-height: 0; padding: 10px 12px; }
  nav a > span:first-child, nav a b, nav em { display: none; }
  nav a i { font-size: 13px; color: inherit; margin: 0; }
  nav a.active::before { left: 10px; right: 10px; top: auto; bottom: 2px; width: auto; height: 2px; border-radius: 1px; }
  .shell { margin-left: 0; }
  .topbar { height: 48px; padding: 0 16px; }
  #breadcrumb::before { content: none; }
  .topbar-right > span { display: none; }
  main { padding: 26px 16px 38px; }
  footer { padding: 20px 16px; flex-direction: column; line-height: 1.7; }
  footer::before { left: 16px; right: 16px; }
  .page-head { display: block; }
  .page-head::before { font-size: 54px; top: -14px; }
  .page-head h1 { font-size: 28px; }
  .page-head .head-note { display: inline-block; margin-top: 14px; }
  .hero { grid-template-columns: 1fr; min-height: 490px; }
  .hero h2 { font-size: 34px; margin: 14px 0; }
  .hero-copy { padding: 26px 22px; }
  .hero-art { height: 215px; margin-top: -15px; }
  .hero-art img { width: 49%; left: 12% !important; top: 4% !important; }
  .hero-art img:nth-of-type(2) { left: 44% !important; top: 19% !important; }
  .hero-art .art-label { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3)::before { display: none; }
  .stat .stat-value { font-size: 26px; }
  .stat label { font-size: 10.5px; }
  .entry-grid { grid-template-columns: 1fr; }
  .entry-card { padding: 20px; }
  .entry-card h3 { margin-top: 12px; }
  .entry-card .entry-arrow { margin-top: 12px; }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .asset-preview { height: 145px; }
  .asset-info { padding: 10px; }
  .asset-info h3 { font-size: 11px; }
  .results-meta { gap: 12px; }
  .search { min-width: 180px; }
  .toolbar select { font-size: 12px; }
  .layout-grid { gap: 12px; }
  .layout-thumb { height: 130px; }
  .layout-body { padding: 12px; }
  .layout-body h3 { font-size: 13px; }
  .layout-body p { font-size: 11px; min-height: 55px; }
  .layout-body .tags { display: none; }
  .layout-body .button { padding: 9px; font-size: 11px; }
  .swatches { gap: 9px; }
  .swatch > span { height: 76px; }
  .font-list, .rule-grid { grid-template-columns: 1fr; }
  .assembly-layout { grid-template-columns: 1fr; }
  .assembly-stage { min-height: 230px; }
  .assembly-description { grid-template-columns: 1fr 1fr; }
  .generator-grid { gap: 12px; }
  .generator-card { padding: 14px; }
  .generator-art { height: 110px; }
  .generator-art svg { height: 95px; }
  .generator-card h3 { font-size: 13px; }
  .generator-card p { font-size: 11px; min-height: 55px; }
  .generator-card .button { font-size: 11px; padding: 9px 10px; }
  .split-explainer, .archive-columns { grid-template-columns: 1fr; }
  .motion-stage { min-height: 200px; }
  .motion-controls { padding: 12px; gap: 7px; }
  .motion-controls select { font-size: 12px; max-width: 150px; }
  .motion-controls .time { width: 100%; margin: 5px 0; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-preview { min-height: 240px; max-height: 42vh; }
  .detail-preview img, .detail-preview video { max-height: 37vh; }
  .detail-meta { padding: 22px; }
  .detail-meta h2 { font-size: 17px; }
  .detail-meta dl { display: grid; grid-template-columns: 76px 1fr; gap: 8px; }
  .detail-meta dt, .detail-meta dd { margin: 0; }
  .detail-meta .button-row { margin-top: 17px; }
  .editor-frame { min-height: 650px; }
  .archive-table { font-size: 11px; }
  .archive-table td, .archive-table th { padding: 10px 8px; }
  .assembly-controls { padding: 20px; }
  .chips { gap: 6px; }
  .chip { font-size: 11px; padding: 8px 10px; }
  .export-ready { left: 16px; max-width: calc(100vw - 32px); }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
