/* Luming Studio 操作手册 · 视觉升级版 */

/* ── Tokens ─────────────────────────────────────────────────────────── */
:root {
  /* base */
  --bg: #0b0d12;
  --bg-1: #0f1218;
  --bg-2: #131722;
  --panel: #161b27;
  --panel-2: #1c2230;
  --border: #232a3a;
  --border-strong: #2c3447;
  --text: #e6eaf3;
  --text-2: #c5cbda;
  --muted: #7e879c;
  --muted-2: #5a6376;

  /* accents */
  --accent: #6d7cff;
  --accent-2: #8ea0ff;
  --accent-soft: rgba(109, 124, 255, 0.12);
  --accent-ring: rgba(109, 124, 255, 0.35);
  --cyan: #5ec1d9;
  --violet: #a98bff;

  /* states */
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.12);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);

  /* code */
  --code-bg: #0a0d14;
  --code-border: #232a3a;

  /* effects */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.45), 0 6px 16px rgba(0, 0, 0, 0.35);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  /* spacing */
  --gutter: 56px;
  --content-max: 920px;

  /* typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Helvetica Neue", "Inter", system-ui, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ── Reset & base ───────────────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(900px 460px at 12% -8%, rgba(109, 124, 255, 0.10), transparent 60%),
    radial-gradient(900px 460px at 100% 110%, rgba(94, 193, 217, 0.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

a {
  color: var(--accent-2);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: #b8c2ff; }

::selection { background: rgba(109, 124, 255, 0.35); color: #fff; }

/* Scrollbar (subtle, dark) */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.12); background-clip: padding-box; }

/* ── Layout ─────────────────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: 288px 1fr;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────────────── */
.sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)) ,
    var(--bg-1);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 0 32px;
}

.sidebar-brand {
  position: relative;
  padding: 0 22px 22px;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand::after {
  content: "";
  position: absolute;
  left: 22px;
  bottom: -1px;
  width: 36px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  border-radius: 999px;
}

.sidebar-brand .eyebrow {
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 6px;
}

.sidebar-brand h1 {
  font-size: 19px;
  margin: 0 0 6px;
  letter-spacing: 0.2px;
  background: linear-gradient(90deg, #fff 30%, #cdd4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sidebar-brand p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.sidebar-nav { padding: 0 12px; }

.nav-section { margin-bottom: 14px; }

.nav-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-2);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 10px 12px 6px;
  margin: 0;
  user-select: none;
  cursor: pointer;
}

.nav-section-title::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(109, 124, 255, 0.18);
  flex: 0 0 auto;
}

.nav-sub {
  display: none;
  margin: 2px 0 4px 8px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}

.nav-section.expanded .nav-sub { display: block; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.nav-item::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: transparent;
  flex: 0 0 auto;
  transition: background 0.15s ease, transform 0.15s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  text-decoration: none;
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(109, 124, 255, 0.20), rgba(109, 124, 255, 0.06));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(109, 124, 255, 0.30);
}

.nav-item.active::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(109, 124, 255, 0.20);
}

.nav-sub .nav-item { font-size: 12.5px; padding: 6px 10px; color: var(--muted); }
.nav-sub .nav-item:hover { color: #fff; }
.nav-sub .nav-item.active { color: #fff; }

/* ── Content ────────────────────────────────────────────────────────── */
.content {
  padding: 40px var(--gutter) 96px;
  max-width: calc(var(--content-max) + var(--gutter) * 2);
  width: 100%;
}

.page {
  display: none;
  animation: pageFade 0.28s ease-out both;
}
.page.active { display: block; }

@keyframes pageFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Crumbs */
.crumbs {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.05em;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.crumbs::before {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--accent);
  border-radius: 999px;
}

/* Headings */
h1.page-title {
  font-size: 30px;
  line-height: 1.25;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
  background: linear-gradient(180deg, #fff 0%, #d8def0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-subtitle {
  color: var(--muted);
  font-size: 14.5px;
  margin: 0 0 36px;
  max-width: 720px;
}

h2 {
  font-size: 19px;
  letter-spacing: -0.005em;
  margin: 40px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 28px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--violet));
}

h3 {
  font-size: 15.5px;
  margin: 22px 0 8px;
  color: var(--text);
}

h4 {
  font-size: 12px;
  margin: 18px 0 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

p { margin: 0 0 12px; color: var(--text-2); }

ul, ol { padding-left: 22px; margin: 0 0 16px; }
ul li::marker { color: var(--muted); }
ol li::marker { color: var(--muted); }
li { margin-bottom: 4px; color: var(--text-2); }

/* Code */
code {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 5px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #f5c97f;
}

pre {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)) ,
    var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  padding: 14px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.8px;
  line-height: 1.65;
  margin: 0 0 18px;
  position: relative;
  box-shadow: var(--shadow-sm);
}
pre::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: inherit;
}

/* ── Notes / callouts ───────────────────────────────────────────────── */
.note {
  position: relative;
  border-radius: var(--radius);
  padding: 12px 14px 12px 44px;
  margin: 14px 0 20px;
  background: var(--accent-soft);
  border: 1px solid rgba(109, 124, 255, 0.22);
  color: var(--text-2);
  font-size: 13.4px;
}

.note::before {
  content: "i";
  position: absolute;
  left: 12px;
  top: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.note strong { color: var(--text); margin-right: 4px; }

.note.tip {
  background: var(--success-soft);
  border-color: rgba(52, 211, 153, 0.28);
}
.note.tip::before {
  content: "✓";
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-soft);
  font-family: var(--font-sans);
  font-size: 13px;
  font-style: normal;
}

.note.warning {
  background: var(--warning-soft);
  border-color: rgba(251, 191, 36, 0.28);
}
.note.warning::before {
  content: "!";
  background: var(--warning);
  color: #1a1300;
  box-shadow: 0 0 0 4px var(--warning-soft);
  font-family: var(--font-sans);
  font-style: normal;
  font-weight: 800;
}

.note.danger {
  background: var(--danger-soft);
  border-color: rgba(248, 113, 113, 0.28);
}
.note.danger::before {
  content: "!";
  background: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
  font-family: var(--font-sans);
  font-style: normal;
  font-weight: 800;
}

/* ── Steps ──────────────────────────────────────────────────────────── */
.steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
  margin: 18px 0 26px;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding: 2px 0 18px 44px;
  margin-bottom: 0;
  color: var(--text-2);
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent), #5163e6);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 3px rgba(109, 124, 255, 0.18), 0 4px 12px rgba(0, 0, 0, 0.35);
}

.steps > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 32px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(109, 124, 255, 0.40), rgba(109, 124, 255, 0.04));
}

.steps > li strong { color: var(--text); }

/* ── Tables ─────────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 12px 0 22px;
  font-size: 13.4px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--border);
  background: var(--panel);
}

thead th {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--text);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-strong);
  letter-spacing: 0.02em;
}

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-2);
}

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* ── Figures (screenshots) ──────────────────────────────────────────── */
figure {
  margin: 20px 0 26px;
  text-align: center;
}

figure img {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: block;
  margin: 0 auto;
}

figure.placeholder {
  position: relative;
  padding: 26px 22px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)) ,
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.018) 0,
      rgba(255, 255, 255, 0.018) 12px,
      transparent 12px,
      transparent 24px
    ),
    var(--panel);
  border: 1px dashed var(--border-strong);
  text-align: left;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

figure.placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(109, 124, 255, 0.07), transparent 60%);
}

figure.placeholder .ph-tag {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  box-shadow: 0 4px 12px rgba(109, 124, 255, 0.32);
}
figure.placeholder .ph-tag::before {
  content: "";
  width: 5px;
  height: 5px;
  background: #fff;
  border-radius: 50%;
}

figure.placeholder .ph-name {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: #f5c97f;
}

figure.placeholder .ph-desc {
  font-size: 13px;
  color: var(--muted);
}

figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

/* ── Section anchor offset ──────────────────────────────────────────── */
section.subsection { scroll-margin-top: 24px; }

/* ── Hero (overview) ────────────────────────────────────────────────── */
.hero {
  position: relative;
  margin: 0 0 36px;
  padding: 28px 30px 26px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(800px 360px at 0% 0%, rgba(109, 124, 255, 0.18), transparent 60%),
    radial-gradient(700px 360px at 100% 100%, rgba(94, 193, 217, 0.12), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)) ,
    var(--panel);
  border: 1px solid var(--border-strong);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(109, 124, 255, 0.45), rgba(169, 139, 255, 0.05) 40%, rgba(94, 193, 217, 0.30));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

.hero .eyebrow {
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.25;
  background: linear-gradient(180deg, #fff 0%, #c8cfe6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p { color: var(--text-2); margin: 0; max-width: 660px; }

.quick-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.quick-card {
  display: block;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)) , var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.quick-card:hover {
  border-color: var(--accent-ring);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.quick-card .qc-eyebrow {
  color: var(--accent-2);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 4px;
}
.quick-card strong { display: block; font-size: 15px; margin-bottom: 4px; }
.quick-card p { font-size: 12.5px; color: var(--muted); margin: 0; }

/* ── Tag chips ──────────────────────────────────────────────────────── */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-2);
  border: 1px solid var(--border);
  letter-spacing: 0.02em;
}

.chip.accent { background: var(--accent-soft); color: var(--accent-2); border-color: var(--accent-ring); }
.chip.success { background: var(--success-soft); color: var(--success); border-color: rgba(52, 211, 153, 0.32); }
.chip.warning { background: var(--warning-soft); color: var(--warning); border-color: rgba(251, 191, 36, 0.32); }
.chip.danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(248, 113, 113, 0.32); }

/* ── Page nav (prev / next) ─────────────────────────────────────────── */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 56px 0 0;
}

.pager-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 64px;
}
.pager-card:hover {
  border-color: var(--accent-ring);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.pager-card .pager-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.pager-card strong { font-size: 14.5px; }

.pager-card.prev { text-align: left; }
.pager-card.next { text-align: right; align-items: flex-end; }
.pager-card.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.pager-card.prev .pager-label::before { content: "← "; }
.pager-card.next .pager-label::after  { content: " →"; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  :root { --gutter: 36px; }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .content { padding: 24px; }
  .quick-cards { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
}
