/*
 * Personal site visual system
 *
 * The personal space is a deep, calm Bento layout. Product landing pages keep
 * their own CSS; this file is only for the personal-content surface.
 */

:root {
  color-scheme: light;
  --paper: #f3f0e8;
  --paper-deep: #e9e3d7;
  --paper-warm: #fbf9f4;
  --ink: #191815;
  --ink-soft: #37342f;
  --muted: #746f65;
  --faint: #a7a094;
  --rule: #cfc7b8;
  --rule-dark: #8a8378;
  --rust: #b24e2e;
  --rust-dark: #87381f;
  --blue: #2b527c;
  --blue-dark: #1d3b5b;
  --green: #315d4c;
  --font-serif: Iowan Old Style, Palatino Linotype, Book Antiqua, Georgia,
    "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Arial,
    sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "PingFang SC", monospace;
  --page: min(1160px, calc(100% - 56px));
  --reading: min(760px, calc(100% - 56px));
  --ease: 160ms ease;
}

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

html {
  background: var(--paper);
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--rust-dark);
  text-decoration-color: currentColor;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

::selection {
  background: #d8d0bd;
  color: var(--ink);
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 9px 13px;
  transform: translateY(-170%);
  border: 1px solid var(--ink);
  background: var(--paper-warm);
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
  transition: transform var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Shared frame */

.site-header {
  border-bottom: 1px solid var(--rule-dark);
}

.site-nav {
  width: var(--page);
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.site-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
  text-decoration: none;
}

.site-brand::after {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--rust);
  content: "";
}

.site-nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 20px;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.015em;
  list-style: none;
}

.site-nav-links a {
  display: inline-block;
  padding: 6px 0;
  color: var(--muted);
  text-decoration: none;
}

.site-nav-links a:hover,
.site-nav-links a[aria-current="page"] {
  color: var(--ink);
}

.site-nav-links a[aria-current="page"]::before {
  margin-right: 5px;
  color: var(--rust);
  content: "/";
}

.site-main {
  min-height: calc(100vh - 224px);
}

.site-shell {
  width: var(--page);
  margin: 0 auto;
}

.reading-shell {
  width: var(--reading);
  margin: 0 auto;
}

.page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.32fr);
  gap: 32px;
  padding: clamp(56px, 9vw, 116px) 0 clamp(42px, 6vw, 72px);
  border-bottom: 1px solid var(--rule-dark);
}

.page-header--compact {
  padding-bottom: 36px;
}

.page-kicker,
.section-kicker,
.entry-kicker,
.meta-label {
  margin: 0 0 12px;
  color: var(--rust-dark);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}

.page-heading {
  max-width: 800px;
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(42px, 7vw, 82px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.page-lede {
  max-width: 630px;
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.62;
}

.page-aside {
  align-self: end;
  margin: 0;
  padding: 16px 0 0 18px;
  border-left: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.page-aside p:first-child {
  margin-top: 0;
}

.page-aside p:last-child {
  margin-bottom: 0;
}

.section {
  padding: clamp(42px, 7vw, 86px) 0;
  border-bottom: 1px solid var(--rule);
}

.section:last-child {
  border-bottom: 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
}

.section-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.section-count,
.section-link {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
}

.section-link {
  color: var(--blue);
  text-decoration: none;
}

.section-link::after,
.text-link::after,
.entry-link::after {
  margin-left: 6px;
  content: "↗";
}

.section-link:hover,
.text-link:hover,
.entry-link:hover {
  color: var(--rust-dark);
}

/* Home */

.home-intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(210px, 0.48fr);
  gap: clamp(28px, 7vw, 112px);
  padding: clamp(68px, 11vw, 150px) 0 clamp(60px, 8vw, 102px);
  border-bottom: 1px solid var(--rule-dark);
}

.home-intro::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 68px;
  height: 4px;
  background: var(--rust);
  content: "";
}

.home-kicker {
  margin: 0 0 18px;
  color: var(--rust-dark);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.home-title {
  max-width: 890px;
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(50px, 8.3vw, 104px);
  font-weight: 700;
  letter-spacing: -0.07em;
  line-height: 0.94;
}

.home-title em {
  color: var(--rust);
  font-style: normal;
}

.home-deck {
  max-width: 630px;
  margin: 28px 0 0;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: clamp(19px, 2.1vw, 25px);
  letter-spacing: -0.018em;
  line-height: 1.58;
}

.home-meta {
  align-self: end;
  padding: 14px 0 0 18px;
  border-left: 1px solid var(--rule-dark);
}

.home-meta-title {
  display: block;
  margin-bottom: 9px;
  color: var(--rust-dark);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.home-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.72;
}

.home-meta a {
  color: var(--blue);
}

.home-links,
.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 30px 0 0;
}

.text-link,
.entry-link {
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(260px, 0.62fr);
  gap: clamp(42px, 8vw, 118px);
}

.home-side-note {
  align-self: start;
  padding-top: 7px;
}

.home-side-note p {
  max-width: 340px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.home-side-note p + p {
  margin-top: 18px;
}

.now-note {
  position: relative;
  padding: 25px 0 26px 23px;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}

.now-note::before {
  position: absolute;
  top: 29px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rust);
  content: "";
}

.now-note-label {
  display: block;
  margin-bottom: 11px;
  color: var(--rust-dark);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.now-note h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(24px, 2.8vw, 34px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.16;
}

.now-note p {
  max-width: 650px;
  margin: 12px 0 0;
  color: var(--ink-soft);
}

/* Reusable editorial lists */

.writing-list,
.tool-list,
.build-log,
.notes-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule-dark);
  list-style: none;
}

.writing-item,
.tool-row,
.build-entry,
.note-row {
  border-bottom: 1px solid var(--rule);
}

.writing-item {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) minmax(170px, 0.35fr);
  gap: 20px;
  padding: 24px 0 25px;
}

.writing-date,
.tool-number,
.build-date,
.note-date,
.entry-date,
.article-date {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.015em;
  line-height: 1.65;
}

.writing-item h3,
.tool-row h3,
.build-entry h3,
.note-row h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(21px, 2.5vw, 29px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.writing-item h3 a,
.tool-row h3 a,
.build-entry h3 a,
.note-row h3 a {
  color: var(--ink);
  text-decoration: none;
}

.writing-item h3 a:hover,
.tool-row h3 a:hover,
.build-entry h3 a:hover,
.note-row h3 a:hover {
  color: var(--rust-dark);
}

.writing-summary,
.entry-summary,
.tool-copy,
.build-copy,
.note-copy {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.68;
}

.writing-side {
  align-self: start;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 9px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.tag,
.entry-tag {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.4;
}

.tag::before,
.entry-tag::before {
  margin-right: 3px;
  color: var(--rust);
  content: "#";
}

.tool-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) minmax(190px, 0.42fr) auto;
  gap: 22px;
  align-items: start;
  padding: 27px 0 29px;
}

.tool-number {
  padding-top: 4px;
  color: var(--rust-dark);
}

.tool-copy {
  margin: 0;
}

.tool-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.055em;
  line-height: 1.45;
  text-transform: uppercase;
}

.tool-status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.tool-status--internal::before,
.tool-status--private::before {
  background: var(--rust);
}

.tool-status--archived::before {
  background: var(--faint);
}

.tool-action {
  padding-top: 5px;
  white-space: nowrap;
}

.tool-action .entry-link {
  display: inline-block;
}

.build-entry {
  position: relative;
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr);
  gap: 24px;
  padding: 26px 0 28px;
}

.build-entry::before {
  position: absolute;
  top: 34px;
  left: 111px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rust);
  content: "";
}

.build-date {
  padding-right: 20px;
  text-align: right;
}

.build-body {
  min-width: 0;
  padding-left: 14px;
}

.build-entry h3 {
  font-size: clamp(20px, 2.25vw, 27px);
}

.note-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 20px;
  padding: 23px 0 24px;
}

.note-row h3 {
  font-size: 20px;
}

.empty-state {
  max-width: 680px;
  padding: 26px 0 27px 22px;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
}

.empty-state p {
  margin: 0;
}

.empty-state p + p {
  margin-top: 12px;
}

/* Building page */

.building-intro {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(260px, 0.55fr);
  gap: clamp(36px, 8vw, 118px);
  padding: clamp(42px, 6vw, 80px) 0;
  border-bottom: 1px solid var(--rule);
}

.building-intro h2,
.about-block h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.12;
}

.building-intro p,
.about-block p {
  max-width: 690px;
  color: var(--ink-soft);
}

.building-intro p:first-of-type,
.about-block p:first-of-type {
  margin-top: 16px;
}

.building-aside {
  align-self: end;
  padding: 18px 0 0 18px;
  border-left: 1px solid var(--rule-dark);
}

.building-aside p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.building-aside .text-link {
  display: inline-block;
  margin-top: 15px;
}

/* About */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.38fr);
  gap: clamp(44px, 9vw, 138px);
  padding: clamp(50px, 8vw, 96px) 0;
}

.about-block + .about-block {
  margin-top: 50px;
  padding-top: 45px;
  border-top: 1px solid var(--rule);
}

.about-block p {
  margin: 0;
  font-size: 16px;
}

.about-block p + p {
  margin-top: 16px;
}

.about-note {
  align-self: start;
  padding: 21px 0 0 20px;
  border-left: 2px solid var(--rust);
}

.about-note h2 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}

.about-note p {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.contact-list {
  margin: 19px 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  list-style: none;
}

.contact-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
}

.contact-list span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.contact-list a {
  color: var(--blue);
}

/* Article */

.article-header {
  width: var(--reading);
  margin: 0 auto;
  padding: clamp(60px, 10vw, 130px) 0 clamp(36px, 6vw, 64px);
  border-bottom: 1px solid var(--rule-dark);
}

.article-back {
  display: inline-block;
  margin-bottom: clamp(32px, 5vw, 52px);
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 12px;
  text-decoration: none;
}

.article-back::before {
  margin-right: 6px;
  content: "←";
}

.article-title {
  max-width: 900px;
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(38px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: -0.058em;
  line-height: 1.03;
}

.article-summary {
  max-width: 690px;
  margin: 24px 0 0;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: clamp(18px, 2.15vw, 24px);
  line-height: 1.62;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 26px 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
}

.article-meta span + span::before {
  margin-right: 18px;
  color: var(--faint);
  content: "/";
}

.article-content,
.article-body,
.prose {
  width: var(--reading);
  margin: 0 auto;
  padding: clamp(42px, 7vw, 82px) 0 clamp(70px, 10vw, 130px);
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.92;
}

.article-content > :first-child,
.article-body > :first-child,
.prose > :first-child {
  margin-top: 0;
}

.article-content > :last-child,
.article-body > :last-child,
.prose > :last-child {
  margin-bottom: 0;
}

.article-content p,
.article-body p,
.prose p {
  margin: 0 0 1.55em;
}

.article-content h2,
.article-body h2,
.prose h2 {
  margin: 2.45em 0 0.65em;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(27px, 3.4vw, 39px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.2;
}

.article-content h3,
.article-body h3,
.prose h3 {
  margin: 2em 0 0.6em;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.7vw, 30px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.25;
}

.article-content h4,
.article-body h4,
.prose h4 {
  margin: 1.75em 0 0.55em;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.45;
}

.article-content a,
.article-body a,
.prose a {
  color: var(--blue);
}

.article-content strong,
.article-body strong,
.prose strong {
  color: var(--ink);
  font-weight: 700;
}

.article-content em,
.article-body em,
.prose em {
  font-family: var(--font-serif);
}

.article-content ul,
.article-content ol,
.article-body ul,
.article-body ol,
.prose ul,
.prose ol {
  margin: 0 0 1.5em;
  padding-left: 1.35em;
}

.article-content li + li,
.article-body li + li,
.prose li + li {
  margin-top: 0.38em;
}

.article-content li::marker,
.article-body li::marker,
.prose li::marker {
  color: var(--rust);
}

.article-content blockquote,
.article-body blockquote,
.prose blockquote {
  margin: 2em 0;
  padding: 0.15em 0 0.15em 1.25em;
  border-left: 2px solid var(--rust);
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 1.09em;
  line-height: 1.72;
}

.article-content blockquote p:last-child,
.article-body blockquote p:last-child,
.prose blockquote p:last-child {
  margin-bottom: 0;
}

.article-content hr,
.article-body hr,
.prose hr {
  height: 1px;
  margin: 2.7em 0;
  border: 0;
  background: var(--rule);
}

.article-content figure,
.article-body figure,
.prose figure {
  width: min(900px, 100%);
  margin: 2.2em auto;
}

.article-content figure img,
.article-body figure img,
.prose figure img,
.article-content > img,
.article-body > img,
.prose > img {
  border: 1px solid var(--rule);
  background: var(--paper-warm);
}

.article-content figcaption,
.article-body figcaption,
.prose figcaption {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.article-content code,
.article-body code,
.prose code {
  padding: 0.08em 0.3em;
  border: 1px solid var(--rule);
  background: var(--paper-deep);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.82em;
}

.article-content pre,
.article-body pre,
.prose pre {
  margin: 1.9em 0;
  padding: 18px 20px;
  overflow-x: auto;
  border: 1px solid var(--rule-dark);
  background: #eeeadf;
  color: var(--ink);
  font-size: 0.83em;
  line-height: 1.72;
}

.article-content pre code,
.article-body pre code,
.prose pre code {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: inherit;
}

.article-content table,
.article-body table,
.prose table {
  display: block;
  width: 100%;
  margin: 2em 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.9em;
  line-height: 1.6;
}

.article-content th,
.article-content td,
.article-body th,
.article-body td,
.prose th,
.prose td {
  min-width: 120px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.article-content th,
.article-body th,
.prose th {
  color: var(--ink);
  background: var(--paper-deep);
  font-weight: 700;
}

.article-footer {
  width: var(--reading);
  margin: 0 auto;
  padding: 25px 0 clamp(54px, 8vw, 92px);
  border-top: 1px solid var(--rule-dark);
}

.article-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* Footer */

.site-footer {
  width: var(--page);
  margin: 0 auto;
  padding: 28px 0 34px;
  border-top: 1px solid var(--rule-dark);
}

.footer-grid {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.footer-copy,
.footer-meta {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px 16px;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  list-style: none;
}

.footer-links a {
  color: var(--blue);
  text-decoration: none;
}

/* Small standalone elements */

.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.025em;
  text-decoration: none;
  transition: background-color var(--ease), color var(--ease), border-color var(--ease);
}

.button-link:hover {
  border-color: var(--rust-dark);
  background: var(--rust-dark);
  color: var(--paper-warm);
}

.button-link--quiet {
  border-color: var(--rule-dark);
  color: var(--blue);
}

.button-link--quiet:hover {
  border-color: var(--blue);
  background: var(--blue);
}

.rule-note {
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
}

.not-found {
  width: var(--reading);
  min-height: calc(100vh - 230px);
  margin: 0 auto;
  padding: clamp(72px, 14vw, 170px) 0;
}

.not-found h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(48px, 9vw, 100px);
  letter-spacing: -0.07em;
  line-height: 0.9;
}

.not-found p {
  max-width: 480px;
  margin: 24px 0 0;
  color: var(--muted);
}

/* Responsive */

@media (max-width: 820px) {
  :root {
    --page: min(100% - 38px, 680px);
    --reading: min(100% - 38px, 680px);
  }

  .site-nav {
    min-height: 68px;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 16px 0;
  }

  .site-nav-links {
    width: 100%;
    justify-content: flex-start;
    gap: 5px 17px;
  }

  .page-header,
  .home-intro,
  .home-grid,
  .building-intro,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .page-aside,
  .home-meta,
  .building-aside,
  .about-note {
    max-width: 540px;
  }

  .home-intro {
    gap: 32px;
  }

  .home-meta {
    padding-top: 15px;
  }

  .writing-item {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  .writing-side {
    grid-column: 2;
  }

  .tool-row {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .tool-copy,
  .tool-action {
    grid-column: 2;
  }

  .tool-action {
    padding-top: 0;
  }

  .build-entry {
    grid-template-columns: 98px minmax(0, 1fr);
  }

  .build-entry::before {
    left: 88px;
  }

  .build-body {
    padding-left: 12px;
  }
}

@media (max-width: 560px) {
  :root {
    --page: calc(100% - 30px);
    --reading: calc(100% - 30px);
  }

  body {
    font-size: 15px;
  }

  .site-brand {
    font-size: 23px;
  }

  .site-nav-links {
    gap: 3px 13px;
    font-size: 11px;
  }

  .site-nav-links a {
    padding: 3px 0;
  }

  .page-header,
  .home-intro {
    padding-top: 53px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .home-title {
    font-size: clamp(46px, 14vw, 68px);
    letter-spacing: -0.075em;
  }

  .writing-item,
  .note-row {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .writing-side {
    grid-column: auto;
  }

  .writing-date,
  .note-date {
    order: -1;
  }

  .tool-row {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 13px;
  }

  .tool-row h3,
  .writing-item h3,
  .build-entry h3 {
    font-size: 23px;
  }

  .build-entry {
    grid-template-columns: 1fr;
    gap: 9px;
    padding-left: 18px;
  }

  .build-entry::before {
    top: 31px;
    left: 0;
  }

  .build-date {
    padding: 0;
    text-align: left;
  }

  .build-body {
    padding-left: 0;
  }

  .article-content,
  .article-body,
  .prose {
    font-size: 16px;
    line-height: 1.85;
  }

  .article-content pre,
  .article-body pre,
  .prose pre {
    padding: 14px 15px;
    margin-right: -2px;
    margin-left: -2px;
  }

  .article-meta {
    display: block;
  }

  .article-meta span {
    display: block;
  }

  .article-meta span + span::before {
    display: none;
  }

  .footer-grid {
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  :root {
    --paper: #fff;
  }

  body {
    background: #fff;
    color: #000;
  }

  .site-header,
  .site-footer,
  .article-back,
  .home-links,
  .button-link {
    display: none;
  }

  .article-header,
  .article-content,
  .article-body,
  .prose,
  .article-footer {
    width: 100%;
  }
}

/* Bento content hub */

.site-brand span {
  color: var(--rust);
  font-family: var(--font-mono);
  font-size: 0.42em;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.site-brand::after {
  background: var(--rust);
}

.bento-main {
  padding: clamp(22px, 4vw, 54px) 0 clamp(58px, 8vw, 100px);
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(172px, auto);
  gap: 16px;
}

.bento-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(20px, 2.3vw, 28px);
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 17px;
  background: var(--paper-warm);
  box-shadow: 0 18px 42px rgb(0 0 0 / 0.15);
}

.bento-card h1,
.bento-card h2,
.bento-card h3,
.content-detail h1,
.lesson-detail h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.bento-card h2 {
  font-size: clamp(24px, 2.45vw, 35px);
}

.bento-card h2 a,
.bento-card h3 a,
.bento-list-item a,
.bento-tool-item a,
.now-stack a {
  color: inherit;
  text-decoration: none;
}

.bento-card h2 a:hover,
.bento-card h3 a:hover,
.bento-list-item a:hover,
.bento-tool-item a:hover,
.now-stack a:hover {
  color: var(--rust);
}

.card-kicker,
.card-date,
.card-meta,
.bento-list-item time,
.bento-tool-item p,
.bento-tool-item span,
.now-stack time,
.preview-marker {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.065em;
  line-height: 1.55;
  text-transform: uppercase;
}

.card-kicker {
  margin-bottom: 14px;
  color: var(--rust);
}

.card-heading {
  width: 100%;
}

.bento-card > p:not(.card-kicker):not(.card-date):not(.card-meta):not(.preview-marker):not(.bento-empty),
.bento-card > div > p:not(.card-kicker):not(.card-date):not(.card-meta):not(.preview-marker):not(.bento-empty) {
  color: var(--ink-soft);
}

.bento-card--identity {
  grid-column: span 2;
  grid-row: span 2;
  justify-content: center;
  border-color: #3a5a6f;
  background:
    radial-gradient(circle at 12% 0%, rgb(123 198 178 / 0.16), transparent 42%),
    linear-gradient(145deg, #152330, #101923 66%);
}

.bento-card--identity h1 {
  max-width: 620px;
  font-size: clamp(39px, 5.35vw, 78px);
  letter-spacing: -0.065em;
}

.identity-copy {
  max-width: 530px;
  margin: 22px 0 0;
  font-family: var(--font-serif);
  font-size: clamp(17px, 1.85vw, 23px);
  line-height: 1.65;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.button-link,
.globe-controls button,
.player-controls button,
.sentence-button,
.text-button {
  min-height: 44px;
  border: 1px solid var(--rule-dark);
  border-radius: 10px;
  background: var(--paper-deep);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  transition: border-color var(--ease), background-color var(--ease), color var(--ease), transform var(--ease);
}

.button-link {
  padding: 11px 15px;
}

.button-link:hover,
.globe-controls button:hover,
.player-controls button:hover,
.sentence-button:hover,
.text-button:hover {
  border-color: var(--rust);
  background: var(--rust);
  color: #07110f;
  transform: translateY(-1px);
}

.button-link--quiet {
  color: var(--blue);
}

.bento-card--daily {
  grid-column: span 2;
  background: linear-gradient(140deg, #152530, #121c27 72%);
}

.bento-card--daily h2,
.bento-card--english h2 {
  margin-top: 8px;
}

.bento-card--daily p:not(.card-kicker):not(.preview-marker),
.bento-card--english p:not(.card-kicker):not(.preview-marker) {
  margin: 13px 0 0;
  color: var(--ink-soft);
  line-height: 1.72;
}

.bento-card--english {
  grid-column: span 1;
  background: linear-gradient(160deg, #1a2733, #121c27 78%);
}

.bento-card--tools {
  grid-column: span 1;
}

.bento-card--writing {
  grid-column: span 2;
}

.bento-card--globe {
  grid-column: span 2;
  grid-row: span 2;
  background:
    radial-gradient(circle at 72% 28%, rgb(146 203 255 / 0.13), transparent 34%),
    #101a25;
}

.bento-card--now,
.bento-card--contact {
  grid-column: span 1;
}

.bento-card--contact {
  justify-content: space-between;
  background: linear-gradient(160deg, #162432, #121c27 80%);
}

.bento-card--contact > p:not(.card-kicker) {
  margin: 16px 0 0;
  color: var(--ink-soft);
}

.bento-empty {
  max-width: 460px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.card-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-top: auto;
  padding-top: 22px;
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.card-link::after {
  margin-left: 8px;
  content: "→";
}

.card-link:hover {
  color: var(--rust);
}

.preview-marker {
  margin-top: 15px;
  color: #ffd191;
  font-size: 10px;
  text-transform: none;
}

.bento-tool-list,
.bento-list,
.now-stack {
  width: 100%;
  margin-top: 20px;
}

.bento-tool-item,
.bento-list-item,
.now-stack article {
  padding: 13px 0;
  border-top: 1px solid var(--rule);
}

.bento-tool-item:first-child,
.bento-list-item:first-child,
.now-stack article:first-child {
  border-top-color: var(--rule-dark);
}

.bento-tool-item p,
.bento-tool-item span {
  font-size: 10px;
}

.bento-tool-item h3,
.bento-list-item h3,
.now-stack h3 {
  margin: 5px 0 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.bento-list-item p {
  display: -webkit-box;
  margin: 7px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.now-stack time {
  color: var(--rust);
  font-size: 10px;
}

.globe-intro {
  max-width: 430px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.globe-stage {
  width: min(100%, 480px);
  margin: auto;
}

.globe-canvas {
  width: 100%;
  min-height: 250px;
  margin: 4px auto 0;
  cursor: grab;
  touch-action: pan-y pinch-zoom;
  user-select: none;
}

.globe-canvas:active {
  cursor: grabbing;
}

.globe-sphere {
  fill: #112433;
  stroke: #5f90ad;
  stroke-width: 1.15;
}

.globe-grid {
  fill: none;
  stroke: #456b80;
  stroke-dasharray: 2 5;
  stroke-width: 0.7;
}

.globe-land {
  fill: #6fbaa8;
  fill-opacity: 0.86;
  stroke: #badfd6;
  stroke-opacity: 0.55;
  stroke-width: 0.45;
}

.globe-outline {
  fill: none;
  stroke: #8cc6d6;
  stroke-width: 1.25;
}

.globe-status {
  min-height: 2.4em;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.globe-controls {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.globe-controls button {
  min-width: 44px;
  padding: 8px 11px;
}

.content-shell {
  padding-bottom: clamp(48px, 8vw, 96px);
}

.content-list {
  margin-top: clamp(38px, 6vw, 72px);
  border-top: 1px solid var(--rule-dark);
}

.content-list-item {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  padding: 25px 0;
  border-bottom: 1px solid var(--rule);
}

.content-list-item > time,
.content-meta,
.source-list time {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.content-list-item h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.04em;
  line-height: 1.18;
}

.content-list-item h2 a {
  color: inherit;
  text-decoration: none;
}

.content-list-item h2 a:hover {
  color: var(--rust);
}

.content-list-item p:not(.entry-kicker) {
  margin: 10px 0 0;
  color: var(--ink-soft);
}

.content-list-item .card-link,
.content-list-item .entry-link {
  margin: 0;
  padding: 3px 0;
  white-space: nowrap;
}

.empty-state {
  padding: clamp(50px, 9vw, 100px) 0;
  text-align: center;
}

.empty-state h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(30px, 5vw, 52px);
  letter-spacing: -0.05em;
}

.empty-state > p:last-child {
  max-width: 520px;
  margin: 16px auto 0;
  color: var(--muted);
}

.content-detail,
.lesson-detail {
  padding: clamp(52px, 8vw, 96px) 0;
}

.content-detail > h1,
.lesson-detail > h1 {
  margin-top: 14px;
  font-size: clamp(39px, 6vw, 67px);
  letter-spacing: -0.06em;
}

.content-summary {
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.62;
}

.content-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 20px;
}

.content-detail > section,
.lesson-detail > section {
  margin-top: clamp(40px, 6vw, 70px);
  padding-top: clamp(26px, 4vw, 38px);
  border-top: 1px solid var(--rule);
}

.content-detail > section h2,
.lesson-detail > section h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: -0.045em;
}

.content-detail > section > p,
.lesson-detail > section > p {
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.85;
}

.finding-list,
.source-list,
.expression-list,
.dialogue-list,
.practice-list {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.finding-list > li,
.source-list > li,
.expression-list > li,
.dialogue-list > li {
  padding: 20px 0;
  border-top: 1px solid var(--rule);
}

.finding-list h3,
.expression-list h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 21px;
}

.finding-list p {
  margin: 10px 0 0;
  color: var(--ink-soft);
}

.finding-list strong,
.source-references,
.lesson-context strong {
  color: var(--rust);
}

.finding-list .source-references {
  color: var(--muted);
  font-size: 13px;
}

.source-list > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px 18px;
  align-items: center;
}

.source-list span {
  color: var(--ink-soft);
}

.source-list a,
.content-pagination a {
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 650;
}

.source-list em {
  color: var(--muted);
  font-size: 12px;
}

.content-detail > section.community-recommendation {
  margin-top: clamp(40px, 6vw, 70px);
  padding: 24px 28px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--paper-warm);
}

.content-detail > section.community-recommendation h2 {
  margin: 0 0 12px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.6vw, 26px);
  letter-spacing: -0.035em;
}

.content-detail > section.community-recommendation p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.75;
}

.content-detail > section.community-recommendation a {
  color: var(--rust-dark);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: currentColor;
}

/* 风向标 AI 商业研判专用容器 */
.daily-ai-view {
  /* 采用与品牌锈红相衬的左侧高亮边线 */
  border-left: 3px solid var(--rust);
  /* 浅色温润纸质背景 */
  background: var(--paper-warm);
  /* 细微内边距 */
  padding: clamp(20px, 3vw, 28px);
  /* 圆角适配 */
  border-radius: 0 10px 10px 0;
  /* 细致边框隔离 */
  border-top: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

/* AI 研判段落文字 */
.daily-ai-content p {
  /* 段落外边距 */
  margin: 0 0 12px;
  /* 舒适字号 */
  font-size: 15.5px;
  /* 适度行高便于长文阅读 */
  line-height: 1.85;
  /* 柔和文字颜色 */
  color: var(--ink-soft);
}

/* AI 研判中的加粗标记，强化关键词可读性 */
.daily-ai-content strong {
  /* 深黑醒目 */
  color: var(--ink);
  /* 半粗体增强对比 */
  font-weight: 600;
}

/* AI 研判中的要点列表容器 */
.daily-ai-content ul {
  /* 列表缩进 */
  padding-left: 20px;
  /* 列表外边距 */
  margin: 0 0 16px;
}

/* AI 研判列表条目 */
.daily-ai-content li {
  /* 列表项间距 */
  margin-bottom: 8px;
  /* 字号与行高 */
  font-size: 14.5px;
  line-height: 1.8;
  /* 柔和字色 */
  color: var(--ink-soft);
}

/* 主题分布表格外层横向滚动包裹器 */
.daily-table-wrapper {
  /* 宽度占满父容器 */
  width: 100%;
  /* 移动端支持平滑横向滚动 */
  overflow-x: auto;
  /* 上下间距 */
  margin-top: 16px;
  /* 优雅边框与圆角 */
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper-warm);
}

/* 主题分布大盘数据表格 */
.daily-table-wrapper .iv-table {
  /* 表格占满包裹器 */
  width: 100%;
  /* 合并边框 */
  border-collapse: collapse;
  /* 数据字号 */
  font-size: 14px;
}

/* 表头与表格单元格公用内边距与底边线 */
.daily-table-wrapper .iv-table th,
.daily-table-wrapper .iv-table td {
  /* 单元格呼吸内边距 */
  padding: 10px 14px;
  /* 默认左对齐 */
  text-align: left;
  /* 细分割线 */
  border-bottom: 1px solid var(--rule);
}

/* 表头样式增强 */
.daily-table-wrapper .iv-table th {
  /* 深底色表头 */
  background: var(--paper-deep);
  /* 表头字号与加粗 */
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  /* 微弱字间距 */
  letter-spacing: 0.02em;
}

/* 斑马纹行交替背景 */
.daily-table-wrapper .iv-table tbody tr:nth-child(even) {
  /* 极淡的灰度衬底 */
  background: rgba(0, 0, 0, 0.02);
}

/* 表格中的数字列专用排版 */
.daily-table-wrapper .iv-table th.num,
.daily-table-wrapper .iv-table td.num {
  /* 右对齐 */
  text-align: right;
  /* 等宽数字排版，避免跳字 */
  font-variant-numeric: tabular-nums;
  /* 等宽字体 */
  font-family: var(--font-mono);
  /* 高亮数据色彩 */
  color: var(--rust-dark);
  font-weight: 600;
}

/* 商业线索卡片垂直列表容器 */
.daily-items-list {
  /* 纵向弹性流式布局 */
  display: flex;
  flex-direction: column;
  /* 卡片间隙 */
  gap: 14px;
  /* 顶部留白 */
  margin-top: 20px;
}

/* 单张商业线索实战卡片 */
.daily-items-list .item {
  /* 暖白底色 */
  background: var(--paper-warm);
  /* 精致边框与圆角 */
  border: 1px solid var(--rule);
  border-radius: 10px;
  /* 内边距 */
  padding: 18px 20px;
  /* 悬停平滑渐变过渡 */
  transition: border-color var(--ease), box-shadow var(--ease);
}

/* 卡片悬停微交互 */
.daily-items-list .item:hover {
  /* 激活边框高亮 */
  border-color: var(--rust);
  /* 投射极柔和的微阴影 */
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

/* 线索卡片标题 */
.daily-items-list .item h3 {
  /* 紧凑外边距 */
  margin: 0 0 8px;
  /* 醒目字号与行高 */
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--ink);
}

/* 线索元信息栏（时间、阅读量等） */
.daily-items-list .item .meta {
  /* 小字号弱化视觉层级 */
  font-size: 12px;
  color: var(--muted);
  /* 下间距 */
  margin-bottom: 10px;
  /* 水平流式排布 */
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* 元信息中的线索标签丸子 */
.daily-items-list .item .meta .au {
  /* 品牌锈红色 */
  color: var(--rust);
  /* 加粗 */
  font-weight: 600;
  /* 微底色泡泡 */
  background: rgba(178, 78, 46, 0.08);
  padding: 1px 7px;
  border-radius: 4px;
}

/* 线索摘要提炼正文 */
.daily-items-list .item .body {
  /* 舒适字号与行高 */
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.75;
  /* 允许保留换行并安全换行 */
  white-space: pre-wrap;
  word-break: break-word;
}

/* 标签容器 */
.daily-items-list .item .tags {
  /* 顶部留白 */
  margin-top: 12px;
  /* 水平流式排列 */
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* 单个赛道标签丸子 */
.daily-items-list .item .tag {
  /* 紧凑微型字号 */
  font-size: 11.5px;
  /* 浅色纸质底色 */
  background: var(--paper-deep);
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 2px 8px;
  font-weight: 500;
}

.content-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  margin-top: clamp(54px, 8vw, 90px);
  padding-top: 24px;
  border-top: 1px solid var(--rule-dark);
}

.content-pagination a:last-child {
  text-align: right;
}

.lesson-context {
  margin-top: 30px;
  padding: 18px 20px;
  border: 1px solid var(--rule);
  border-radius: 13px;
  background: var(--paper-deep);
}

.lesson-context p {
  margin: 6px 0;
  color: var(--ink-soft);
}

.lesson-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.lesson-section-head .card-kicker {
  margin-bottom: 8px;
}

.expression-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
}

.expression-list p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.65;
}

.expression-list p[data-translation] {
  color: var(--rust);
}

.sentence-button {
  margin-top: 14px;
  padding: 7px 11px;
  font-size: 12px;
}

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

.player-controls label {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.player-controls select {
  min-height: 38px;
  padding: 0 7px;
  border: 1px solid var(--rule-dark);
  border-radius: 8px;
  background: var(--paper-deep);
  color: var(--ink);
}

.player-controls button {
  padding: 8px 11px;
}

.player-status {
  min-height: 1.5em;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.english-sentence {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.english-sentence.is-playing {
  margin: 0 -14px;
  padding-right: 14px;
  padding-left: 14px;
  border-color: #4c8a7c;
  background: rgb(123 198 178 / 0.08);
}

.english-sentence.was-last {
  border-left: 2px solid var(--blue);
  padding-left: 14px;
}

.speaker {
  margin: 0;
  color: var(--rust);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sentence-text {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
}

.translation {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.practice-list {
  padding-left: 1.3em;
  color: var(--ink-soft);
}

.practice-list li + li {
  margin-top: 12px;
}

.practice-list li::marker {
  color: var(--rust);
}

.practice-list p {
  margin: 0;
}

.practice-list details {
  margin-top: 10px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--paper-deep);
}

.practice-list summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--rust);
  font-size: 14px;
  font-weight: 700;
}

.practice-reference,
.practice-explanation {
  padding: 0 12px 12px;
  color: var(--ink);
  line-height: 1.65;
}

.practice-explanation {
  color: var(--muted);
  font-size: 14px;
}

.article-content pre,
.article-body pre,
.prose pre {
  background: #0d171f;
}

.article-content code,
.article-body code,
.prose code,
.article-content th,
.article-body th,
.prose th {
  background: var(--paper-deep);
}

@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bento-card--identity,
  .bento-card--daily,
  .bento-card--globe {
    grid-column: span 2;
  }

  .bento-card--writing,
  .bento-card--tools,
  .bento-card--english,
  .bento-card--now,
  .bento-card--contact {
    grid-column: span 1;
  }

  .bento-card--globe {
    grid-row: span 1;
  }
}

@media (max-width: 700px) {
  .site-nav {
    gap: 14px;
  }

  .site-nav-links {
    gap: 6px 15px;
  }

  .bento-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .bento-card,
  .bento-card--identity,
  .bento-card--daily,
  .bento-card--english,
  .bento-card--tools,
  .bento-card--writing,
  .bento-card--globe,
  .bento-card--now,
  .bento-card--contact {
    grid-column: span 1;
  }

  .bento-card--identity {
    min-height: 390px;
  }

  .bento-card--identity h1 {
    font-size: clamp(39px, 12vw, 56px);
  }

  .content-list-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .content-list-item .card-link,
  .content-list-item .entry-link {
    padding-top: 8px;
  }

  .source-list > li {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .lesson-section-head {
    flex-direction: column;
  }

  .expression-list {
    grid-template-columns: 1fr;
  }

  .player-controls {
    justify-content: flex-start;
  }

  .english-sentence {
    grid-template-columns: 1fr;
  }

  .content-pagination {
    grid-template-columns: 1fr;
  }

  .content-pagination a,
  .content-pagination a:last-child {
    text-align: left;
  }

  .content-pagination span {
    display: none;
  }
}

/* Inner pages visual unification: consistent dark tech aesthetic, quiet reading flow */

html[data-theme="paper"] {
  color-scheme: dark;
  background: #111111;
}

html[data-theme="paper"] body,
body:not(.page-home) {
  --paper: #111111;
  --paper-deep: #161616;
  --paper-warm: #1a1a1c;
  --ink: #f5f5f3;
  --ink-soft: #d5d5d0;
  --muted: #a2a29d;
  --faint: #74746f;
  --rule: #262626;
  --rule-dark: #3a3a3a;
  --rust: #d95b36;
  --rust-dark: #ff724b;
  --blue: #5b9ee3;
  --blue-dark: #7cb5f2;
  --font-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Arial,
    sans-serif;
  background: #111111;
  color: #f5f5f3;
}

html[data-theme="paper"] ::selection {
  background: var(--rust);
  color: #fff;
}

html[data-theme="paper"] .skip-link {
  background: #1a1a1c;
  border-color: #3a3a3a;
  color: #f5f5f3;
}

html[data-theme="paper"] .site-header {
  background: #111111;
  border-bottom: 1px solid var(--rule-dark);
}

html[data-theme="paper"] .site-brand {
  color: #ffffff;
}

html[data-theme="paper"] .site-nav-links a {
  color: var(--muted);
}

html[data-theme="paper"] .site-nav-links a:hover {
  color: #ffffff;
}

html[data-theme="paper"] .site-nav-links a[aria-current="page"] {
  color: #ffffff;
}

html[data-theme="paper"] .site-footer {
  border-top: 1px solid var(--rule-dark);
}

/* Card clickability & stretched-link interaction (solves unclickable dead zones) */

.page-home .bento-card--daily,
.page-home .bento-card--english,
.page-home .bento-card--now,
.page-home .bento-card--writing,
.page-home .bento-card--about,
.page-home .bento-card--rss,
.content-list-item,
.writing-item,
.tool-row {
  cursor: pointer;
}

.page-home .bento-card--daily .primary-cta::after,
.page-home .bento-card--english .primary-cta::after,
.page-home .bento-card--now h2 a::after,
.page-home .bento-card--writing h2 a::after,
.page-home .bento-card--about h2 a::after,
.page-home .bento-card--rss h2 a::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
}

.page-home .bento-card--daily .card-actions a:not(.primary-cta),
.page-home .bento-card--daily .card-kicker a,
.page-home .bento-card--english .lesson-actions a:not(.primary-cta),
.page-home .bento-card--english .card-kicker a,
.page-home .bento-card--writing .card-link,
.page-home .bento-card--writing .card-kicker a {
  position: relative;
  z-index: 2;
}

.page-home .bento-tool-item {
  position: relative;
  cursor: pointer;
  padding: 6px 8px;
  margin: -2px -8px;
  border-radius: 8px;
  transition: background-color 150ms ease;
}

.page-home .bento-tool-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.page-home .bento-tool-item h3 a::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
}

.page-home .bento-card--tools .card-link {
  position: relative;
  z-index: 2;
}

.content-list-item,
.writing-item,
.tool-row {
  position: relative;
}

.content-list-item h2 a::after,
.writing-item h3 a::after,
.tool-row h3 a::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
}

.content-list-item .tag-list,
.content-list-item .entry-link,
.content-list-item .card-link,
.writing-item .tag-list,
.writing-item .entry-link,
.writing-item .writing-side,
.tool-row .entry-link {
  position: relative;
  z-index: 2;
}

/* Homepage visual correction: a compact, reference-inspired bento surface. */

html[data-theme="home"] {
  color-scheme: dark;
  background: #111;
}

body.page-home {
  --paper: #111;
  --paper-deep: #0e0e0e;
  --paper-warm: #171717;
  --ink: #f5f5f3;
  --ink-soft: #d5d5d0;
  --muted: #a2a29d;
  --faint: #74746f;
  --rule: #393939;
  --rule-dark: #50504b;
  --rust: #a11c2e;
  --rust-dark: #f06a7d;
  --blue: #e9e9e4;
  --blue-dark: #fff;
  --green: #a3c68a;
  --page: min(1152px, calc(100% - 48px));
  position: relative;
  background: #111;
  color: var(--ink);
}

body.page-home::before {
  position: fixed;
  z-index: 0;
  inset: 0;
  background-image:
    linear-gradient(rgb(255 255 255 / 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  content: "";
  pointer-events: none;
}

.page-home ::selection {
  background: var(--rust);
  color: #fff;
}

.page-home .bento-main {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  padding: 24px 0;
}

.page-home .bento-grid {
  height: auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  /* Four content rows must expand with their cards instead of clipping them. */
  grid-template-rows: repeat(4, auto);
  grid-auto-rows: auto;
  gap: 16px;
}

.page-home .bento-card {
  position: relative;
  isolation: isolate;
  align-items: stretch;
  padding: 20px;
  overflow: hidden;
  border: 1px solid #393939;
  border-radius: 28px 11px 28px 11px;
  background: #171717;
  box-shadow: 0 14px 28px rgb(0 0 0 / 0.18);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.page-home .bento-card::before,
.page-home .bento-card::after {
  position: absolute;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.page-home .bento-card::before {
  inset: 0;
  opacity: 0.42;
  background-image: radial-gradient(circle, rgb(255 255 255 / 0.16) 1px, transparent 1.2px);
  background-position: right 13px top 13px;
  background-size: 8px 8px;
}

.page-home .bento-card::after {
  inset: 4px;
  border: 1px solid rgb(255 255 255 / 0.045);
  border-radius: 23px 7px 23px 7px;
}

.page-home .bento-card:hover {
  z-index: 2;
  border-color: var(--rust);
  box-shadow: 0 18px 36px rgb(0 0 0 / 0.3);
  transform: translateY(-2px);
}

.page-home .bento-card h1,
.page-home .bento-card h2,
.page-home .bento-card h3 {
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.page-home .bento-card h2 {
  font-size: clamp(18px, 1.55vw, 21px);
  line-height: 1.2;
}

.page-home .bento-card h2 a,
.page-home .bento-card h3 a,
.page-home .bento-list-item a,
.page-home .bento-tool-item a,
.page-home .now-stack a {
  color: inherit;
}

.page-home .bento-card h2 a:hover,
.page-home .bento-card h3 a:hover,
.page-home .bento-list-item a:hover,
.page-home .bento-tool-item a:hover {
  color: var(--rust-dark);
}

.page-home .card-kicker,
.page-home .card-date,
.page-home .card-meta,
.page-home .bento-list-item time,
.page-home .bento-tool-item p,
.page-home .bento-tool-item span,
.page-home .now-stack time,
.page-home .preview-marker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.055em;
  line-height: 1.35;
}

.page-home .card-kicker {
  margin-bottom: 8px;
  color: var(--rust-dark);
}

.page-home .card-link {
  min-height: 0;
  margin-top: auto;
  padding-top: 12px;
  color: var(--rust-dark);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 650;
}

/* 首页自我介绍主卡片：占第 1 行左侧 3 列 */
.page-home .bento-card--identity {
  /* 跨越第 1 至第 3 列 */
  grid-column: 1 / span 3;
  /* 位于第 1 行 */
  grid-row: 1;
  /* 弹性纵向流式排布 */
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* 呼吸感内边距 */
  padding: 26px 30px;
  /* 深灰边框与深黑底色 */
  border-color: #4a4a45;
  background: #171717;
}

/* 首页自我介绍文本容器 */
.page-home .identity-copy {
  /* 相对定位 */
  position: relative;
  /* 占满可用空间 */
  width: 100%;
  margin: 0;
}

/* 自我介绍人设简介段落 */
.page-home .identity-bio {
  /* 段落上间距 */
  margin: 10px 0 0;
  /* 柔和文字颜色 */
  color: var(--ink-soft);
  /* 适度字号 */
  font-size: 15.5px;
  /* 舒适行高 */
  line-height: 1.68;
}

/* 自我介绍底部社交与导航外链流 */
.page-home .identity-links {
  /* 弹性流式排布 */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  /* 顶部留白 */
  margin-top: 18px;
}

/* 自我介绍中的导航与社交链接 */
.page-home .identity-links a {
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: color var(--ease);
}

/* 链接悬停高亮 */
.page-home .identity-links a:hover {
  color: var(--rust-dark);
}

/* 外跳小箭头标记 */
.page-home .identity-links a::after {
  margin-left: 5px;
  color: var(--rust-dark);
  content: "↗";
}

/* 预留自媒体社交渠道灰色弱化标签 */
.page-home .social-pending {
  /* 弱化字号与颜色 */
  font-size: 13px;
  color: var(--muted);
  /* 居中对齐 */
  align-self: center;
  /* 虚线提示 */
  opacity: 0.75;
}

/* 产品与工具矩阵卡片：占第 1 行第 4 列 */
.page-home .bento-card--tools {
  /* 位于第 4 列 */
  grid-column: 4;
  /* 位于第 1 行 */
  grid-row: 1;
  /* 紧凑内边距 */
  padding: 22px 20px;
  /* 弹性纵向布局 */
  display: flex;
  flex-direction: column;
}

/* 工具卡片标题 */
.page-home .bento-card--tools h2 {
  font-size: 18px;
}

/* 工具列表流式容器 */
.page-home .bento-tool-list {
  /* 上间距 */
  margin-top: 10px;
  display: flex;
  flex-direction: column;
}

/* 单个工具条目项 */
.page-home .bento-tool-item {
  /* 紧凑内边距 */
  padding: 9px 0;
  /* 浅色细边框分隔 */
  border-top-color: #343434;
}

/* 风向标日报核心卡片：占第 2 行左侧 2 列 */
.page-home .bento-card--daily {
  /* 跨越第 1、2 列 */
  grid-column: 1 / span 2;
  /* 位于第 2 行 */
  grid-row: 2;
  /* 舒适内边距 */
  padding: 22px 24px;
  /* 科技深灰背景 */
  background: #191919;
  /* 弹性纵向排布 */
  display: flex;
  flex-direction: column;
}

/* 日报内部包裹层 */
.page-home .bento-card--daily > div {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

/* 日报标题样式 */
.page-home .bento-card--daily h2 {
  margin-top: 7px;
  font-size: 19px;
  line-height: 1.35;
}

/* 日报核心摘要正文 */
.page-home .bento-card--daily p:not(.card-kicker):not(.preview-marker) {
  display: -webkit-box;
  margin: 10px 0 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* 英语学习核心卡片：占第 2 行右侧 2 列（彻底解决此前卡片过小被挤爆的问题） */
.page-home .bento-card--english {
  /* 跨越第 3、4 列 */
  grid-column: 3 / span 2;
  /* 位于第 2 行 */
  grid-row: 2;
  /* 充裕内边距 */
  padding: 22px 24px;
  /* 弹性纵向排布 */
  display: flex;
  flex-direction: column;
}

/* 英语卡片小眉题 */
.page-home .bento-card--english .card-kicker {
  margin-bottom: 4px;
}

/* 英语卡片主标题 */
.page-home .bento-card--english h2 {
  margin-top: 7px;
  font-size: 19px;
  line-height: 1.35;
}

/* 课程一句话目标简介 */
.page-home .lesson-goal {
  margin-top: 6px;
  color: #aab2bc;
  font-size: 13.5px;
  line-height: 1.5;
}

/* 静态表达预览面板：在 2 列宽度下完整舒展显示 */
.page-home .lesson-preview-box {
  margin: 12px 0;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

/* 表达预览顶部小标题 */
.page-home .preview-box-label {
  margin: 0 0 5px;
  color: var(--rust-dark);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* 表达预览中的英文句子 */
.page-home .preview-en {
  margin: 0 0 4px;
  color: #f3f4f6;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.45;
}

/* 表达预览中的中文翻译 */
.page-home .preview-zh {
  margin: 0;
  color: #8c96a4;
  font-size: 12.5px;
  line-height: 1.45;
}

/* 思考与写作卡片：占第 3 行左侧 2 列 */
.page-home .bento-card--writing {
  /* 跨越第 1、2 列 */
  grid-column: 1 / span 2;
  /* 位于第 3 行 */
  grid-row: 3;
  /* 舒适内边距 */
  padding: 22px 24px;
  /* 弹性纵向排布 */
  display: flex;
  flex-direction: column;
}

/* 文章精选列表容器 */
.page-home .bento-writing-items {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 单篇精选文章列表项 */
.page-home .bento-writing-items .bento-list-item {
  padding: 0 0 10px;
  border-bottom: 1px solid #2e2e2e;
}

/* 文章日期微标签 */
.page-home .bento-writing-items .bento-list-item time {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 3px;
}

/* 精选文章标题 */
.page-home .bento-writing-items h2,
.page-home .bento-writing-items h3 {
  font-size: 16.5px;
  line-height: 1.35;
  margin: 0;
}

/* 地球卡片：占第 3 行右侧 2 列（居中大气舒展） */
.page-home .bento-card--globe {
  /* 跨越第 3、4 列 */
  grid-column: 3 / span 2;
  /* 位于第 3 行 */
  grid-row: 3;
  /* 居中弹性展示 */
  padding: 18px 24px;
  background: #151515;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 地球紧凑容器 */
.page-home .globe-compact {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-around;
  gap: 20px;
}

/* 地球渲染画布 */
.page-home .globe-stage {
  width: 88px;
  height: 88px;
  margin: 0;
}

/* 地球 SVG 尺寸 */
.page-home .globe-canvas {
  width: 88px;
  height: 88px;
  min-height: 0;
}

/* 地球文案区 */
.page-home .globe-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 通栏底部导航栏卡片：通栏占满第 4 行 4 列 */
.page-home .bento-card--footer {
  /* 跨越整整 4 列 */
  grid-column: 1 / span 4;
  /* 位于第 4 行 */
  grid-row: 4;
  /* 水平居中且两端对齐 */
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  /* 扁平底栏紧凑内边距 */
  padding: 16px 26px;
  min-height: 0;
  border-radius: 12px;
  background: #141414;
}

/* 页脚版权与品牌标语 */
.page-home .bento-card--footer .footer-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

/* 页脚右侧链接群（整合 GitHub、X、RSS、关于） */
.page-home .bento-card--footer .footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

/* 页脚链接样式 */
.page-home .bento-card--footer .footer-links a {
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--ease);
}

/* 页脚链接悬停高亮 */
.page-home .bento-card--footer .footer-links a:hover {
  color: var(--rust-dark);
}

@media (max-width: 1024px) {
  body.page-home {
    --page: min(900px, calc(100% - 44px));
  }

  .page-home .bento-main {
    min-height: 0;
    padding: 22px 0 42px;
  }

  /* 平板端 2 列网格容器 */
  .page-home .bento-grid {
    /* 自适应高度 */
    height: auto;
    /* 采用 2 等分列 */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    /* 行高自适应内容 */
    grid-auto-rows: auto;
    gap: 16px;
  }

  /* 平板端重置所有卡片的网格跨度为自动 */
  .page-home .bento-card--identity,
  .page-home .bento-card--tools,
  .page-home .bento-card--daily,
  .page-home .bento-card--english,
  .page-home .bento-card--writing,
  .page-home .bento-card--globe,
  .page-home .bento-card--footer {
    /* 默认跨整整 2 列以保证内容可读性 */
    grid-column: span 2;
    grid-row: auto;
  }

  /* 自我介绍卡片平板端内边距 */
  .page-home .bento-card--identity {
    min-height: 0;
    padding: 24px;
  }

  /* 地球卡片平板端高度适度收拢 */
  .page-home .bento-card--globe {
    min-height: 110px;
  }
}

@media (max-width: 700px) {
  /* 移动端页面主容器宽度填满视口边距 */
  body.page-home {
    --page: calc(100% - 24px);
  }

  /* 移动端单列流式布局 */
  .page-home .bento-grid {
    /* 彻底采用单列模式 */
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: auto;
    gap: 14px;
  }

  /* 移动端重置所有卡片为单列全宽 */
  .page-home .bento-card--identity,
  .page-home .bento-card--tools,
  .page-home .bento-card--daily,
  .page-home .bento-card--english,
  .page-home .bento-card--writing,
  .page-home .bento-card--globe,
  .page-home .bento-card--footer {
    grid-column: span 1;
    grid-row: auto;
  }

  /* 自我介绍移动端呼吸感排版 */
  .page-home .bento-card--identity {
    min-height: 0;
    padding: 22px;
  }

  /* 地球卡片移动端自适应 */
  .page-home .bento-card--globe {
    min-height: 100px;
    padding: 16px;
  }

  /* 页脚在移动端垂直流式排布 */
  .page-home .bento-card--footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-home .bento-card {
    transition: none;
  }

  .page-home .bento-card:hover {
    transform: none;
  }
}

/* ==========================================================================
   原生英语自动化课件科技暗黑深度适配样式 (Native Courseware Dark Tech)
   ========================================================================== */

.lesson-courseware-container {
  padding: 32px 0 80px;
}

.lesson-courseware {
  --bg: #111111;
  --panel: #161616;
  --line: rgba(255, 255, 255, 0.09);
  --ink: #f0f0f0;
  --ink-soft: #a0a0a0;
  --ink-faint: #666666;
  --accent: #e56a42;
  --accent-soft: rgba(229, 106, 66, 0.15);
  --ref: #1c1c1c;
  --you: #4edcd0;
  --guest: #c7a7ea;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", sans-serif;
  line-height: 1.65;
}

.lesson-courseware h1 {
  font-size: 26px;
  line-height: 1.3;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.lesson-courseware h1 .en {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-top: 6px;
}

.lesson-courseware .meta {
  font-size: 13px;
  color: var(--ink-faint);
  margin: 6px 0 16px;
  line-height: 1.5;
}

.lesson-courseware .task {
  font-size: 14.5px;
  color: #ffd2c2;
  margin: 0 0 24px;
  padding: 12px 16px;
  background: rgba(229, 106, 66, 0.12);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
}

.lesson-courseware section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px 24px;
  margin: 0 0 20px;
}

.lesson-courseware h2 {
  font-size: 18px;
  margin: 0 0 14px;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.lesson-courseware .setup-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 0;
}

@media (min-width: 640px) {
  .lesson-courseware .setup-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.lesson-courseware .setup-item {
  background: var(--ref);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px 14px;
}

.lesson-courseware .setup-item h3 {
  margin: 0 0 6px;
  font-size: 12.5px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.lesson-courseware .setup-item .en {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}

.lesson-courseware .setup-item .cn {
  margin: 8px 0 0;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.lesson-courseware .controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  align-items: center;
}

.lesson-courseware .controls button,
.lesson-courseware .controls select {
  font-size: 13px;
  padding: 7px 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: #202020;
  color: #f0f0f0;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.lesson-courseware .controls button:hover {
  background: #2a2a2a;
  border-color: rgba(255, 255, 255, 0.25);
}

.lesson-courseware .controls button.primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.lesson-courseware .controls button.primary:hover {
  background: #f07b55;
}

.lesson-courseware .controls label {
  font-size: 12.5px;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lesson-courseware .dialogue {
  list-style: none;
  padding: 0;
  margin: 0;
}

.lesson-courseware .line {
  padding: 14px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.lesson-courseware .line:first-child {
  border-top: 0;
  padding-top: 4px;
}

.lesson-courseware .line-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.lesson-courseware .speaker {
  font-weight: 600;
  font-size: 12.5px;
  padding: 3px 8px;
  border-radius: 4px;
}

.lesson-courseware .speaker.you {
  color: #4edcd0 !important;
  background: rgba(78, 220, 208, 0.15) !important;
}

.lesson-courseware .speaker.guest {
  color: #d1a8f8 !important;
  background: rgba(209, 168, 248, 0.15) !important;
}

.lesson-courseware .line-btns {
  display: flex;
  gap: 6px;
  align-items: center;
}

.lesson-courseware .play-line,
.lesson-courseware .cn-line-btn {
  font-size: 12.5px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #202020;
  border-radius: 5px;
  cursor: pointer;
  color: #d0d0d0;
  font-family: inherit;
  transition: all 0.15s ease;
}

.lesson-courseware .play-line:hover,
.lesson-courseware .cn-line-btn:hover {
  background: #2c2c2c;
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.lesson-courseware .play-line.playing {
  background: var(--accent) !important;
  color: #ffffff !important;
  border-color: var(--accent) !important;
}

.lesson-courseware .cn-line-btn.on {
  background: rgba(229, 106, 66, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.lesson-courseware .en-line {
  margin: 6px 0;
  font-size: 15.5px;
  color: #ffffff;
  line-height: 1.6;
}

.lesson-courseware .cn-line {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.lesson-courseware .hidden {
  display: none !important;
}

.lesson-courseware .expr,
.lesson-courseware .pat,
.lesson-courseware .my-turn-body {
  background: var(--ref);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 0 0 12px;
}

.lesson-courseware .expr h3 {
  font-size: 15px;
  margin: 0 0 8px;
  color: #ffffff;
}

.lesson-courseware .expr .ipa {
  font-family: var(--font-sans);
  color: var(--ink-faint);
  font-weight: normal;
  font-size: 13px;
  margin-left: 6px;
}

.lesson-courseware .expr .def {
  margin: 6px 0;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.lesson-courseware .expr .def strong {
  color: #ffffff;
}

.lesson-courseware .pat strong {
  color: var(--accent);
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.lesson-courseware .pat .use {
  color: var(--ink-faint);
  font-size: 13px;
  display: block;
  margin-top: 6px;
}

.lesson-courseware .my-turn-body p {
  margin: 8px 0;
  font-size: 14px;
}

.lesson-courseware .my-turn-body p strong {
  color: #ffffff;
  display: inline-block;
  min-width: 70px;
}

.lesson-courseware .reveal {
  background: var(--accent);
  color: #ffffff;
  border: 0;
  padding: 9px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13.5px;
  margin-top: 10px;
  font-family: inherit;
  font-weight: 500;
  transition: background 0.15s ease;
}

.lesson-courseware .reveal:hover {
  background: #f07b55;
}

.lesson-courseware .answer {
  margin-top: 14px;
  padding: 14px;
  border-left: 3px solid var(--accent);
  background: #202020;
  border-radius: 6px;
}

.lesson-courseware .answer p {
  margin: 6px 0;
  font-size: 14px;
  color: #f0f0f0;
}

.lesson-courseware .answer .note {
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: 10px;
}

.lesson-courseware .footer-tip {
  font-size: 13px;
  color: var(--ink-faint);
  text-align: center;
  padding: 24px 8px 0;
}

.lesson-courseware .footer-tip b {
  color: var(--ink-soft);
}

.lesson-courseware .voice-warn {
  color: var(--accent);
  font-size: 13px;
  margin-top: 8px;
}

.lesson-courseware button:not(.primary) {
  color: inherit;
  background: var(--surface-elevated, #222);
  border: 1px solid var(--border, #444);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font: inherit;
}

.lesson-progress-actions { margin-top: 20px; }
.lesson-courseware [hidden] { display: none !important; }

body.blind .lesson-courseware .expressions,
body.blind .lesson-courseware .patterns,
body.blind .lesson-courseware .my-turn,
body.blind .lesson-courseware .setup {
  display: none !important;
}

body.blind .lesson-courseware .dialogue-section .dialogue {
  display: none !important;
}

body.blind .lesson-courseware .dialogue-section .controls .play-all,
body.blind .lesson-courseware .dialogue-section .controls .stop,
body.blind .lesson-courseware .dialogue-section .controls .speed,
body.blind .lesson-courseware .dialogue-section .controls .voice,
body.blind .lesson-courseware .dialogue-section .controls .toggle-dialogue {
  display: none !important;
}

