:root {
  color-scheme: light;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --ink: #202529;
  --muted: #676f78;
  --line: #deddd7;
  --teal: #2f6f5e;
  --coral: #c75d4d;
  --gold: #c89b35;
  --blue: #4c6f95;
  --plum: #7a526b;
  --shadow: 0 22px 80px rgba(32, 37, 41, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Noto Sans CJK SC",
    system-ui,
    sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 0 32px;
  background: rgba(251, 250, 247, 0.92);
  border-bottom: 1px solid rgba(222, 221, 215, 0.8);
  backdrop-filter: blur(14px);
}

.brand,
.top-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  min-width: 0;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #ffffff;
  background: var(--teal);
  border-radius: 8px;
}

.top-nav a {
  color: var(--muted);
  font-size: 14px;
}

.top-nav a:hover {
  color: var(--ink);
}

.hero {
  position: relative;
  display: flex;
  min-height: 280px;
  align-items: center;
  overflow: hidden;
  background: url("./assets/hero-writing-desk.png") center / cover no-repeat;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background: rgba(20, 26, 29, 0.5);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(860px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0;
  color: #ffffff;
}

.eyebrow {
  margin: 0 0 10px;
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.hero h1,
.section-heading h2,
.serial-layout h2,
.access-layout h2,
.modal-body h2 {
  margin: 0;
  line-height: 1.18;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 520px;
  font-size: clamp(30px, 5vw, 44px);
}

.hero-copy {
  max-width: 560px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 16px;
}

.hero h1,
.hero-copy,
.work-card h3,
.modal-body h2,
.modal-body p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero-actions,
.access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button,
.filter {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.button {
  padding: 10px 18px;
  font-weight: 700;
}

.button:hover,
.filter:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.primary {
  color: #ffffff;
  background: var(--coral);
}

.secondary {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.38);
}

.ghost {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}

.protected-entry {
  color: #ffffff;
  background: var(--teal);
  border-color: var(--teal);
}

.section {
  padding: 52px 24px;
}

.section-inner {
  width: min(1160px, 100%);
  margin: 0 auto;
}

.intro-band {
  padding: 26px 24px;
  background: var(--surface);
  border-block: 1px solid var(--line);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.metrics article {
  min-height: 112px;
  padding: 24px;
  background: var(--surface);
}

.metric-value {
  display: block;
  color: var(--teal);
  font-size: 28px;
  font-weight: 800;
}

.metric-label {
  color: var(--muted);
  font-size: 14px;
}

.section-heading,
.access-layout,
.serial-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
}

.section-heading h2,
.serial-layout h2,
.access-layout h2 {
  font-size: clamp(28px, 4vw, 44px);
}

.section-copy {
  max-width: 620px;
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.filter {
  min-width: 64px;
  padding: 8px 14px;
  color: var(--muted);
  background: var(--surface);
  border-color: var(--line);
}

.filter.is-active {
  color: #ffffff;
  background: var(--teal);
  border-color: var(--teal);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  width: min(860px, 100%);
  margin-top: 30px;
  margin-right: auto;
  margin-left: auto;
}

.work-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.work-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  background: #d7d9d3;
}

.work-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px;
}

.work-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--teal);
  background: rgba(47, 111, 94, 0.1);
  font-size: 12px;
  font-weight: 700;
}

.work-card h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.28;
}

.work-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.work-card .button {
  width: 100%;
}

.work-card-actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
}

.muted-band {
  background: #f0f3f0;
  border-block: 1px solid var(--line);
}

.route-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.route-list li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.route-list span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #ffffff;
  background: var(--blue);
  border-radius: 8px;
  font-weight: 800;
}

.route-list p {
  margin: 0;
  color: var(--muted);
}

.access-layout {
  align-items: center;
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 28px 32px;
  color: var(--muted);
  background: #202529;
}

.site-footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 22, 25, 0.62);
}

.modal-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(260px, 38%) minmax(0, 1fr);
  width: min(920px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.extra-modal {
  display: block;
  width: min(1040px, 100%);
}

.modal-cover {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
}

.modal-body {
  overflow: auto;
  padding: 34px;
}

.modal-body > p {
  color: var(--muted);
}

.icon-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(32, 37, 41, 0.16);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.excerpt {
  margin: 18px 0 24px;
  padding-left: 18px;
  border-left: 3px solid var(--gold);
}

.excerpt p {
  margin: 0 0 12px;
  color: var(--ink);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.button.is-disabled {
  color: rgba(32, 37, 41, 0.45);
  background: #ebe9e2;
  border-color: var(--line);
  cursor: not-allowed;
}

.button.is-disabled:hover {
  transform: none;
}

[hidden] {
  display: none !important;
}

.password-form {
  margin: 24px 0 0;
  padding: 18px;
  background: #f6f4ef;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.password-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 700;
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.password-row input {
  min-width: 0;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}

.form-message {
  min-height: 24px;
  margin: 10px 0 0;
  color: var(--coral);
  font-size: 14px;
}

.extra-library {
  display: grid;
  grid-template-columns: minmax(220px, 30%) minmax(0, 1fr);
  gap: 18px;
  margin-top: 22px;
}

.extra-list {
  display: grid;
  gap: 10px;
  align-content: start;
}

.empty-extra {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.extra-card {
  width: 100%;
  padding: 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
}

.extra-card:hover,
.extra-card.is-active {
  border-color: var(--teal);
}

.extra-card.is-active {
  background: rgba(47, 111, 94, 0.08);
}

.extra-card strong {
  display: block;
  line-height: 1.35;
}

.extra-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.reader-shell {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.reader-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.reader-head h3 {
  margin: 0;
  line-height: 1.28;
}

.reader-head .eyebrow {
  color: var(--muted);
}

#extraReader {
  display: block;
  width: 100%;
  height: min(52vh, 520px);
  border: 0;
  background: #fffdf8;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 920px) {
  .section-heading,
  .access-layout,
  .serial-layout {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .filters {
    justify-content: flex-start;
  }

  .work-grid,
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-panel {
    grid-template-columns: 1fr;
  }

  .modal-cover {
    max-height: 260px;
  }

  .extra-library {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-header {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 18px;
  }

  .top-nav {
    display: flex;
    width: 100%;
    gap: 8px;
  }

  .top-nav a {
    text-align: left;
  }

  .hero {
    min-height: 240px;
  }

  .hero-content {
    width: calc(100% - 40px);
    max-width: 320px;
    margin: 0 20px;
    padding: 38px 0;
  }

  .hero-copy {
    max-width: 300px;
    font-size: 16px;
    word-break: break-all;
  }

  .hero h1 {
    font-size: 30px;
    word-break: break-all;
  }

  .section {
    padding: 48px 18px;
  }

  .work-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .password-row,
  .reader-head {
    grid-template-columns: 1fr;
  }

  .password-row {
    display: grid;
  }

  .reader-head {
    display: grid;
  }

  .modal {
    padding: 12px;
  }

  .modal-body {
    padding: 24px;
  }
}
