:root {
  color-scheme: light;
  --paper: #f0f4f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff6ff;
  --ink: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --quiet: #94a3b8;
  --line: #e2e8f0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 8px 22px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: Inter, "DM Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, calc(100% - 32px));
  margin: 14px auto 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand,
.nav,
.hero-kicker,
.hero-actions,
.tag-row {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  font-size: 12px;
}

.nav {
  gap: 4px;
}

.nav a {
  min-width: 44px;
  padding: 8px 11px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.nav a:hover,
.nav a.active {
  background: var(--blue-soft);
  color: var(--blue);
}

.section-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 104px 0;
}

.hero {
  display: flex;
  min-height: calc(100vh - 72px);
  flex-direction: column;
  justify-content: center;
  padding-top: 72px;
}

.hero-kicker {
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 38px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-kicker span {
  padding: 7px 11px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: var(--blue-soft);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 48px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 980px;
  margin-bottom: 26px;
  color: var(--ink);
  font-size: clamp(44px, 7.4vw, 92px);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero-title {
  max-width: 900px;
}

.hero-title span {
  display: block;
}

h2 {
  margin-bottom: 18px;
  color: var(--ink);
  font-size: clamp(32px, 4.7vw, 56px);
  line-height: 1.1;
}

h3 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.35;
}

.hero-lede,
.large-copy {
  max-width: 790px;
  color: var(--muted);
  font-size: clamp(20px, 2.25vw, 27px);
  line-height: 1.58;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.button.primary:hover {
  background: var(--blue-dark);
}

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

.principle-card {
  display: block;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.principle-card span {
  display: inline-flex;
  margin-bottom: 20px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.principle-card p {
  margin-bottom: 18px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.42;
}

.principle-card:focus-visible,
.belief-trigger:focus-visible,
.note-pending-trigger:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 3px;
}

.split-section {
  display: grid;
  grid-template-columns: 0.45fr 1fr;
  gap: 72px;
  border-top: 1px solid var(--line);
}

.section-body p:last-child {
  margin-bottom: 0;
}

.identity-grid,
.project-grid,
.notes-grid,
.tools-grid {
  display: grid;
  gap: 16px;
}

.identity-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 40px;
}

.identity-grid article,
.project-card,
.notes-grid article,
.note-card,
.tools-grid article,
.timeline-item > div,
.contact-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.identity-grid article,
.notes-grid article,
.note-card,
.tools-grid article,
.timeline-item > div {
  padding: 24px;
}

.identity-grid span,
.card-meta,
.notes-grid span,
.timeline-item > span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.identity-grid p,
.project-card p,
.notes-grid p,
.tools-grid p,
.timeline p,
.section-heading p,
.contact-section p {
  color: var(--muted);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(270px, 0.35fr);
  gap: 52px;
  align-items: end;
  margin-bottom: 36px;
  border-top: 1px solid var(--line);
  padding-top: 80px;
}

.section-heading.compact {
  border-top: 0;
  padding-top: 0;
}

.section-heading .eyebrow,
.section-heading h2 {
  grid-column: 1;
}

.section-heading p:last-child {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin-bottom: 6px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.project-grid {
  grid-template-columns: repeat(3, 1fr);
}

.project-card {
  display: flex;
  min-height: 320px;
  flex-direction: column;
  padding: 26px;
  color: inherit;
  font: inherit;
  text-align: left;
}

.diagnosis-trigger,
.mini-program-trigger {
  width: 100%;
  cursor: pointer;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 36px;
}

.tag-row {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 24px;
}

.tag-row span {
  padding: 6px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.notes-grid,
.tools-grid {
  grid-template-columns: repeat(3, 1fr);
}

.notes-grid article {
  min-height: 210px;
}

.note-card {
  display: block;
  min-height: 210px;
  color: inherit;
  cursor: default;
  font: inherit;
  text-align: left;
}

.note-card-link {
  cursor: pointer;
}

.note-card-link:hover {
  border-color: #bfdbfe;
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.tools-grid article {
  min-height: 190px;
}

.timeline {
  border-left: 1px solid var(--line);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 28px;
  padding: 0 0 26px 28px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 29px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue);
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1fr);
  gap: 56px;
  align-items: center;
  border-top: 1px solid var(--line);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.contact-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 74px;
  padding: 18px;
  width: 100%;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.contact-card:hover {
  border-color: #bfdbfe;
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.contact-card span {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.qr-modal.is-open {
  z-index: 45;
  opacity: 1;
  pointer-events: auto;
}

.account-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.account-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.belief-modal {
  position: fixed;
  inset: 0;
  z-index: 42;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.belief-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.pending-modal {
  position: fixed;
  inset: 0;
  z-index: 42;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.pending-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.diagnosis-modal {
  position: fixed;
  inset: 0;
  z-index: 43;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.diagnosis-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mini-program-modal {
  position: fixed;
  inset: 0;
  z-index: 43;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.mini-program-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.qr-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(6px);
}

.qr-modal-shell {
  position: relative;
  z-index: 1;
  width: min(360px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(37, 99, 235, 0.42) transparent;
  transform: translateY(10px) scale(0.98);
  transition: transform 180ms ease;
}

.qr-modal.has-multiple .qr-modal-shell {
  width: min(980px, 100%);
}

.qr-modal.is-open .qr-modal-shell {
  transform: translateY(0) scale(1);
}

.qr-modal-close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.qr-modal-panel h2 {
  margin-bottom: 6px;
  font-size: 28px;
}

.qr-modal-subtitle {
  margin-bottom: 10px;
  color: var(--muted);
}

.qr-jump-link {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 900;
}

.qr-jump-link:hover {
  text-decoration: underline;
}

.qr-modal-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.qr-modal.is-dense .qr-modal-shell {
  width: min(880px, 100%);
}

.qr-modal.is-dense .qr-modal-panels {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qr-modal.is-dense .qr-modal-panel {
  padding: 20px;
}

.qr-modal.is-dense .qr-modal-panel h2 {
  font-size: 24px;
}

.qr-modal.is-dense .qr-modal-image {
  max-width: 230px;
  max-height: 300px;
  object-fit: contain;
}

.qr-modal-panel {
  position: relative;
  z-index: 1;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  text-align: center;
}

.qr-modal-image {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.belief-modal-panel {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  transform: translateY(10px) scale(0.98);
  transition: transform 180ms ease;
}

.pending-modal-panel {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  text-align: center;
  transform: translateY(10px) scale(0.98);
  transition: transform 180ms ease;
}

.diagnosis-modal-panel,
.mini-program-modal-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  transform: translateY(10px) scale(0.98);
  transition: transform 180ms ease;
}

.belief-modal.is-open .belief-modal-panel {
  transform: translateY(0) scale(1);
}

.pending-modal.is-open .pending-modal-panel {
  transform: translateY(0) scale(1);
}

.diagnosis-modal.is-open .diagnosis-modal-panel {
  transform: translateY(0) scale(1);
}

.mini-program-modal.is-open .mini-program-modal-panel {
  transform: translateY(0) scale(1);
}

.belief-modal-panel h2 {
  padding-right: 44px;
  font-size: clamp(28px, 4vw, 42px);
}

.pending-modal-panel h2 {
  margin-bottom: 10px;
  font-size: clamp(28px, 4vw, 40px);
}

.pending-modal-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.diagnosis-hero,
.mini-program-hero {
  max-width: 720px;
  padding-right: 44px;
}

.diagnosis-hero h2,
.mini-program-hero h2 {
  margin-bottom: 12px;
  font-size: clamp(32px, 4.8vw, 54px);
}

.diagnosis-hero p,
.diagnosis-grid p,
.mini-program-hero p,
.mini-program-grid p {
  color: var(--muted);
}

.mini-program-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.mini-program-item {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.mini-program-item.is-live {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}

.mini-program-item span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mini-program-item h3 {
  margin-bottom: 8px;
}

.mini-program-item p {
  margin-bottom: 0;
}

.diagnosis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.diagnosis-grid article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.diagnosis-grid span,
.diagnosis-flow span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.diagnosis-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.diagnosis-flow div {
  display: grid;
  gap: 6px;
  min-height: 88px;
  align-content: center;
  padding: 16px;
  background: var(--surface);
}

.diagnosis-flow strong {
  color: var(--ink);
  font-size: 17px;
}

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

.belief-modal-subtitle {
  margin-bottom: 20px;
  color: var(--muted);
}

.belief-quote-list {
  display: grid;
  gap: 12px;
}

.belief-quote-card {
  display: grid;
  gap: 0;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.belief-quote-card blockquote {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.65;
}

.account-modal-panel {
  width: min(420px, 100%);
}

.account-modal-links {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.account-modal-links a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 800;
}

.account-swatch {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.account-swatch.rose {
  background: #fb7185;
}

.account-swatch.amber {
  background: #f59e0b;
}

.account-swatch.green {
  background: #22c55e;
}

.account-swatch.blue {
  background: #3b82f6;
}

.account-swatch.xhs {
  background: #fb7185;
}

.account-swatch.douyin {
  background: #111827;
}

.account-modal-links small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

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

.essays-page {
  padding-top: 104px;
}

.ai-notes-page {
  padding-top: 58px;
}

.essays-hero {
  padding-bottom: 54px;
}

.ai-notes-page .essays-hero {
  padding-top: 40px;
  padding-bottom: 28px;
}

.ai-notes-page h1 {
  margin-bottom: 16px;
  font-size: clamp(40px, 5.2vw, 68px);
}

.ai-notes-page .hero-lede {
  max-width: 760px;
  font-size: clamp(18px, 2vw, 22px);
}

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 900;
}

.essays-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 24px;
  padding-top: 0;
}

.essays-sidebar,
.essay-reader {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.essays-sidebar {
  position: sticky;
  top: 104px;
  align-self: start;
  max-height: calc(100vh - 128px);
  overflow: hidden;
}

.essays-tools {
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.essays-tools input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  outline: none;
  padding: 0 14px;
}

.essays-tools input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.essay-count {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.essay-list {
  display: grid;
  max-height: calc(100vh - 230px);
  overflow-y: auto;
  padding: 10px;
}

.essay-list-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 8px;
  color: var(--ink);
}

.essay-list-item:hover,
.essay-list-item.active {
  background: var(--blue-soft);
}

.essay-list-item span {
  overflow-wrap: anywhere;
  font-weight: 900;
  line-height: 1.45;
}

.essay-list-item small,
.essay-reader-meta time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.empty-state {
  padding: 14px;
  color: var(--muted);
}

.essay-reader {
  min-height: 640px;
  padding: 36px;
  scroll-margin-top: 110px;
}

.essay-reader-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.essay-reader h2 {
  overflow-wrap: anywhere;
  font-size: clamp(30px, 4vw, 52px);
}

.essay-content {
  margin-top: 28px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.9;
}

.essay-content h2,
.essay-content h3,
.essay-content h4 {
  margin: 34px 0 12px;
}

.essay-content p,
.essay-content ul,
.essay-content blockquote {
  margin-bottom: 18px;
}

.essay-content ul {
  padding-left: 22px;
}

.essay-content blockquote {
  border-left: 3px solid var(--blue);
  padding: 12px 16px;
  background: var(--blue-soft);
  color: var(--ink);
}

.essay-content code {
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--blue);
  font-size: 0.9em;
  padding: 2px 6px;
}

.essay-content a {
  color: var(--blue);
  font-weight: 800;
}

.ai-notes-grid-section {
  width: min(1280px, calc(100% - 32px));
  padding-top: 0;
}

.ai-notes-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.ai-note-card {
  display: flex;
  min-height: 230px;
  flex-direction: column;
  align-items: flex-start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.ai-note-card:hover {
  border-color: #bfdbfe;
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.ai-note-card span {
  margin-bottom: 18px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ai-note-card h2 {
  margin-bottom: 12px;
  font-size: clamp(24px, 2.3vw, 31px);
}

.ai-note-card p {
  color: var(--muted);
}

.ai-note-card strong {
  margin-top: auto;
  color: var(--blue);
  font-size: 14px;
  font-weight: 900;
}

.ai-note-card-featured {
  grid-column: auto;
  min-height: 230px;
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}

.ai-note-card:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 3px;
}

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

.chat-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
}

.chat-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-hover);
  color: white;
  cursor: pointer;
}

.chat-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.chat-pulse {
  position: absolute;
  right: 11px;
  top: 11px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  animation: chat-pulse 1.8s infinite;
}

.chat-panel {
  position: absolute;
  right: 0;
  bottom: 84px;
  display: flex;
  width: min(430px, calc(100vw - 32px));
  max-height: min(700px, calc(100vh - 132px));
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-hover);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(0.98);
  transform-origin: bottom right;
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.chat-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.chat-eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chat-header h2 {
  margin-bottom: 6px;
  font-size: 24px;
}

.chat-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.chat-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.quick-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-questions button {
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 8px 12px;
}

.chat-messages {
  display: flex;
  min-height: 220px;
  max-height: 310px;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 8px 4px 8px 0;
}

.message {
  max-width: 88%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-line;
}

.message.bot {
  align-self: flex-start;
  background: var(--surface-soft);
  color: var(--text);
}

.message.user {
  align-self: flex-end;
  border-color: var(--blue);
  background: var(--blue);
  color: white;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.chat-form input {
  min-width: 0;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  outline: none;
  padding: 0 14px;
}

.chat-form input::placeholder {
  color: var(--quiet);
}

.chat-form button {
  height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 0 16px;
}

.project-card,
.identity-grid article,
.notes-grid article,
.note-card,
.tools-grid article,
.timeline-item > div,
.contact-card,
.principle-card,
.button,
.tag-row span,
.hero-kicker span,
.quick-questions button,
.chat-close,
.chat-toggle,
.chat-form button,
.qr-modal-close,
.ai-note-card,
.diagnosis-grid article,
.diagnosis-flow div {
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease,
    background 220ms ease;
}

.project-card:hover,
.identity-grid article:hover,
.notes-grid article:hover,
.note-card:hover,
.tools-grid article:hover,
.timeline-item > div:hover,
.diagnosis-grid article:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.tag-row span:hover,
.hero-kicker span:hover,
.quick-questions button:hover,
.chat-close:hover,
.chat-form button:hover {
  transform: translateY(-1px);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
}

.reveal.is-visible {
  animation: reveal-up 620ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes chat-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

@media (max-width: 980px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero-grid,
  .split-section,
  .section-heading,
  .essays-layout,
  .contact-section,
  .diagnosis-grid,
  .diagnosis-flow {
    grid-template-columns: 1fr;
  }

  .principle-card {
    max-width: 560px;
  }

  .section-heading p:last-child,
  .section-heading .eyebrow,
  .section-heading h2 {
    grid-column: auto;
    grid-row: auto;
  }

  .identity-grid,
  .project-grid,
  .notes-grid,
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .essays-sidebar {
    position: static;
    max-height: none;
  }

  .essay-list {
    max-height: 420px;
  }
}

@media (max-width: 640px) {
  .site-header,
  .section-shell,
  .footer {
    width: min(100% - 24px, 1180px);
  }

  .section-shell {
    padding: 72px 0;
  }

  .hero {
    min-height: auto;
    padding-top: 58px;
  }

  h1 {
    font-size: 42px;
  }

  .hero-lede,
  .large-copy {
    font-size: 19px;
  }

  .principle-card p {
    font-size: 21px;
  }

  .identity-grid,
  .project-grid,
  .notes-grid,
  .tools-grid,
  .ai-notes-grid,
  .timeline-item,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    gap: 8px;
    padding-left: 22px;
  }

  .button,
  .hero-actions {
    width: 100%;
  }

  .footer {
    flex-direction: column;
  }

  .chat-widget {
    right: 16px;
    bottom: 16px;
  }

  .chat-panel {
    bottom: 78px;
    max-height: calc(100vh - 104px);
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .essays-page {
    padding-top: 92px;
  }

  .ai-notes-page {
    padding-top: 86px;
  }

  .ai-notes-page .essays-hero {
    padding-top: 28px;
    padding-bottom: 24px;
  }

  .essay-reader {
    min-height: 480px;
    padding: 24px;
  }

  .essay-reader-meta {
    flex-direction: column;
    gap: 4px;
  }

  .qr-modal {
    align-items: start;
    padding: 16px;
  }

  .qr-modal-shell {
    max-height: calc(100vh - 32px);
  }

  .qr-modal.is-dense .qr-modal-panels {
    grid-template-columns: 1fr;
  }

  .belief-modal {
    align-items: start;
    padding: 16px;
  }

  .belief-modal-panel {
    max-height: calc(100vh - 32px);
    padding: 24px;
  }

  .pending-modal {
    align-items: start;
    padding: 16px;
  }

  .pending-modal-panel {
    padding: 24px;
  }

  .diagnosis-modal {
    align-items: start;
    padding: 16px;
  }

  .mini-program-modal {
    align-items: start;
    padding: 16px;
  }

  .diagnosis-modal-panel,
  .mini-program-modal-panel {
    max-height: calc(100vh - 32px);
    padding: 24px;
  }

  .diagnosis-hero,
  .mini-program-hero {
    padding-right: 36px;
  }

  .mini-program-grid,
  .mini-program-item.is-live {
    grid-template-columns: 1fr;
  }

  .diagnosis-actions,
  .diagnosis-actions .button,
  .mini-program-item.is-live .button {
    width: 100%;
  }

}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* AI视频制作流程模态框样式 */
.ai-video-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.ai-video-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.ai-video-modal-panel {
  position: relative;
  background: var(--surface);
  border-radius: 16px;
  max-width: 900px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.ai-video-modal-content h2 {
  font-size: 2em;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #ff6b6b, #ffa500);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ai-video-subtitle {
  color: var(--muted);
  margin-bottom: 30px;
}

.ai-video-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ai-video-step {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: var(--surface-soft);
  border-radius: 12px;
  border: 1px solid var(--line);
  transition: transform 0.2s, box-shadow 0.2s;
}

.ai-video-step:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.ai-video-step-number {
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: linear-gradient(135deg, #ff6b6b, #ffa500);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2em;
  color: white;
}

.ai-video-step-content {
  flex: 1;
}

.ai-video-step-content h3 {
  margin: 0 0 10px 0;
  font-size: 1.2em;
  color: var(--ink);
}

.ai-video-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.ai-video-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85em;
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.ai-video-tag.auto {
  background: rgba(76, 175, 80, 0.1);
  color: #4caf50;
  border-color: rgba(76, 175, 80, 0.2);
}

.ai-video-tag.manual {
  background: rgba(255, 152, 0, 0.1);
  color: #ff9800;
  border-color: rgba(255, 152, 0, 0.2);
}

.ai-video-prompt {
  background: rgba(0, 0, 0, 0.05);
  border-left: 3px solid var(--blue);
  padding: 12px 15px;
  margin: 12px 0;
  border-radius: 0 8px 8px 0;
  font-size: 0.9em;
  line-height: 1.6;
  max-height: 60px;
  overflow: hidden;
  cursor: pointer;
  transition: max-height 0.3s ease;
}

.ai-video-prompt.expanded {
  max-height: 500px;
}

.ai-video-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.9em;
}

.ai-video-table th,
.ai-video-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.ai-video-table th {
  background: rgba(37, 99, 235, 0.1);
  color: var(--blue);
  font-weight: 600;
}

.ai-video-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.ai-video-links a {
  display: block;
  padding: 10px 15px;
  background: rgba(37, 99, 235, 0.05);
  border-radius: 8px;
  color: var(--blue);
  text-decoration: none;
  transition: background 0.2s;
}

.ai-video-links a:hover {
  background: rgba(37, 99, 235, 0.1);
}

@media (max-width: 600px) {
  .ai-video-modal-panel {
    padding: 20px;
  }
  
  .ai-video-step {
    flex-direction: column;
    gap: 12px;
  }
  
  .ai-video-step-number {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 1em;
  }
}
