:root {
  --paper: #ecf0f5;
  --sheet: #ffffff;
  --sheet-muted: #f5f7fa;
  --ink: #132238;
  --ink-soft: #4a5b73;
  --ink-faint: #6b7d96;
  --cobalt: #1d4ed8;
  --cobalt-deep: #153baa;
  --cobalt-tint: #ebf1fe;
  --rule: #d3dce6;
  --rule-strong: #b9c6d6;

  --font-serif: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  --font-sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-outer: 14px;
  --radius-inner: 8px;
  --radius-control: 6px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--sheet);
  border-radius: var(--radius-control);
  text-decoration: none;
  font-size: 14px;
}

.skip-link:focus {
  left: 16px;
}

.container {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(236, 240, 245, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-seal {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--ink);
  color: var(--sheet);
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 1.5px rgba(147, 180, 248, 0.5);
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-shrink: 0;
}

.site-nav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 6px 2px;
  white-space: nowrap;
  transition: color 0.16s ease;
}

.site-nav a:hover {
  color: var(--cobalt);
}

/* Intro */
.intro {
  padding-top: 52px;
  padding-bottom: 36px;
}

.intro-title {
  margin: 0;
  max-width: 24em;
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.6vw, 42px);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.intro-desc {
  margin: 18px 0 0;
  max-width: 44em;
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink-soft);
}

/* Workbench */
.workbench-section {
  padding-bottom: 72px;
}

.workbench {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: var(--radius-outer);
  overflow: hidden;
  animation: folioReveal 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes folioReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Left Catalog Rail */
.catalog {
  background: var(--sheet-muted);
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.catalog-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--rule);
}

.catalog-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.catalog-count {
  font-size: 13px;
  color: var(--ink-faint);
}

.catalog-groups {
  padding: 12px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.catalog-group-label {
  margin: 0;
  padding: 6px 22px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-faint);
}

.catalog-item {
  position: relative;
  display: block;
  width: 100%;
  padding: 13px 22px;
  border: 0;
  background: transparent;
  text-align: left;
  transition: background-color 0.14s ease;
}

.catalog-item:hover {
  background: rgba(29, 78, 216, 0.05);
}

.catalog-item[aria-selected="true"] {
  background: var(--sheet);
}

.catalog-item[aria-selected="true"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3.5px;
  border-radius: 0 3px 3px 0;
  background: var(--cobalt);
}

.catalog-item-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}

.catalog-item[aria-selected="true"] .catalog-item-title {
  color: var(--cobalt);
}

.catalog-item-sub {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* Right Stage */
.stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stage-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #0f172a;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}

.stage-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.stage-curtain {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(19, 34, 56, 0) 64%, rgba(19, 34, 56, 0.48) 100%);
  cursor: pointer;
}

.stage-launch {
  padding: 7px 14px;
  border-radius: var(--radius-control);
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(19, 34, 56, 0.78);
  backdrop-filter: blur(8px);
  color: var(--sheet);
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.stage-curtain:hover .stage-launch {
  background: rgba(19, 34, 56, 0.94);
  border-color: rgba(255, 255, 255, 0.6);
}

.stage-curtain[hidden],
.stage-live-bar[hidden],
.stage-iframe[hidden] {
  display: none;
}

.stage-live-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  height: 40px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(19, 34, 56, 0.94);
  color: var(--sheet);
  font-size: 13px;
}

.stage-live-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-live-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.bar-link,
.bar-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: transparent;
  color: var(--sheet);
  transition: background-color 0.14s ease;
}

.bar-link:hover,
.bar-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.stage-iframe {
  position: absolute;
  left: 0;
  right: 0;
  top: 40px;
  width: 100%;
  height: calc(100% - 40px);
  border: 0;
  background: var(--sheet);
}

.stage-body {
  padding: 28px 32px 32px;
}

.stage-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.stage-category {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--cobalt);
}

.stage-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.stage-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--cobalt);
  color: var(--sheet);
}

.btn-primary:hover {
  background: var(--cobalt-deep);
}

.btn-secondary {
  background: var(--sheet);
  border-color: var(--rule-strong);
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--sheet-muted);
  border-color: var(--ink-faint);
}

.stage-summary {
  margin: 16px 0 0;
  max-width: 46em;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink);
}

.stage-meta-grid {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.meta-label {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.meta-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-soft);
}

.stage-tags {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stage-tags li {
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--sheet-muted);
  border: 1px solid var(--rule);
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* Notes Section */
.notes-section {
  padding-top: 12px;
  padding-bottom: 84px;
}

.section-head {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule-strong);
}

.section-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
}

.section-lead {
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--ink-soft);
}

.notes-list {
  display: flex;
  flex-direction: column;
}

.note-item {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 28px;
  padding: 28px 0;
  border-bottom: 1px solid var(--rule);
}

.note-topic {
  font-size: 14px;
  font-weight: 600;
  color: var(--cobalt);
  padding-top: 3px;
}

.note-content h3 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
}

.note-content p {
  margin: 0;
  max-width: 44em;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-soft);
}

/* Footer */
.site-footer {
  background: var(--ink);
  color: #dce4ef;
  padding: 48px 0 56px;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--sheet);
}

.footer-copy {
  margin: 12px 0 0;
  max-width: 32em;
  font-size: 14px;
  line-height: 1.8;
  color: #a8b7cc;
}

.footer-links-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: #93b4f8;
}

.footer-links ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 20px;
}

.footer-links a {
  font-size: 14px;
  color: #dce4ef;
  text-decoration: none;
  transition: color 0.14s ease;
}

.footer-links a:hover {
  color: var(--sheet);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Responsive */
@media (max-width: 960px) {
  .workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .catalog {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .catalog-groups {
    flex-direction: row;
    overflow-x: auto;
    padding: 12px 16px;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
  }

  .catalog-group {
    display: contents;
  }

  .catalog-group-label {
    display: none;
  }

  .catalog-item {
    flex: 0 0 auto;
    width: auto;
    min-width: 176px;
    padding: 10px 14px;
    border: 1px solid var(--rule);
    border-radius: var(--radius-inner);
    background: var(--sheet);
  }

  .catalog-item[aria-selected="true"] {
    border-color: var(--cobalt);
    background: var(--cobalt-tint);
  }

  .catalog-item[aria-selected="true"]::before {
    display: none;
  }

  .stage-body {
    padding: 22px 20px 26px;
  }

  .stage-meta-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

@media (max-width: 680px) {
  .container {
    width: calc(100% - 28px);
  }

  .header-inner {
    min-height: 58px;
    gap: 12px;
  }

  .brand {
    gap: 8px;
  }

  .brand-seal {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .brand-name {
    font-size: 15.5px;
  }

  .site-nav {
    gap: 12px;
  }

  .site-nav a {
    font-size: 13px;
  }

  .intro {
    padding-top: 36px;
    padding-bottom: 24px;
  }

  .stage-viewport {
    aspect-ratio: 4 / 3;
  }

  .stage-actions {
    width: 100%;
  }

  .stage-actions .btn {
    flex: 1;
  }

  .note-item {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 22px 0;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-links ul {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .workbench {
    animation: none;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}
