:root {
  color-scheme: light;
  --canvas: #fbf7ee;
  --paper: #fffdf6;
  --ink: #17231d;
  --muted: #66736b;
  --line: rgba(23, 35, 29, 0.14);
  --jade: #1c7f68;
  --jade-dark: #0f5948;
  --shadow: 0 24px 80px rgba(54, 42, 28, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    linear-gradient(90deg, rgba(23, 35, 29, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(23, 35, 29, 0.045) 1px, transparent 1px),
    var(--canvas);
  background-size: 34px 34px, 34px 34px, auto;
  color: var(--ink);
  font-family: "Aptos", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.site-shell {
  position: relative;
  min-height: 100vh;
}

.top-nav {
  position: absolute;
  z-index: 20;
  top: 18px;
  left: 50%;
  width: min(1120px, calc(100% - 36px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.78);
  box-shadow: 0 12px 36px rgba(54, 42, 28, 0.09);
  backdrop-filter: blur(18px);
  padding: 10px 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: "Songti SC", "STSong", serif;
  font-weight: 800;
}

.brand strong {
  font-size: 0.98rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 10px 12px;
}

.hero-section {
  position: relative;
  min-height: min(720px, calc(100vh - 64px));
  display: grid;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  padding: 108px max(24px, calc((100vw - 1120px) / 2)) 58px;
}

.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(251, 247, 238, 0.95) 0%, rgba(251, 247, 238, 0.82) 34%, rgba(251, 247, 238, 0.3) 62%, rgba(251, 247, 238, 0.08) 100%),
    linear-gradient(180deg, rgba(251, 247, 238, 0.55), rgba(251, 247, 238, 0.18) 46%, rgba(251, 247, 238, 0.82));
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(650px, 100%);
  display: grid;
  gap: 18px;
}

.eyebrow,
.section-kicker {
  color: var(--jade-dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: "Songti SC", "STSong", "SimSun", serif;
  line-height: 1.18;
}

h1 {
  font-size: 5rem;
  line-height: 1;
  font-weight: 900;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.16rem;
  line-height: 1.35;
}

.tagline {
  color: var(--jade-dark);
  font-size: 1.72rem;
  line-height: 1.45;
  font-weight: 750;
}

.summary {
  max-width: 620px;
  color: #3f5147;
  font-size: 1.06rem;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 8px;
}

.primary-action,
.secondary-action {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 800;
  padding: 0 18px;
}

.primary-action {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 18px 38px rgba(23, 35, 29, 0.2);
}

.secondary-action {
  border: 1px solid rgba(23, 35, 29, 0.18);
  background: rgba(255, 253, 246, 0.78);
}

.profile-band,
.section-block,
.split-band,
.contact-band {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.profile-band {
  padding: 24px 0 34px;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.fact-item,
.work-item,
.timeline-panel,
.chat-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.88);
  box-shadow: var(--shadow);
}

.fact-item {
  min-height: 118px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: 18px;
}

.fact-item span,
.work-item span,
.message span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.fact-item strong {
  font-size: 1rem;
  line-height: 1.5;
}

.section-block {
  display: grid;
  gap: 24px;
  padding: 58px 0;
}

.section-heading {
  display: grid;
  gap: 8px;
  max-width: 680px;
}

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

.work-item {
  min-height: 250px;
  display: grid;
  align-content: start;
  gap: 18px;
  overflow: hidden;
  padding: 24px;
}

.work-item:nth-child(1) {
  background: linear-gradient(135deg, rgba(28, 127, 104, 0.12), transparent 44%), rgba(255, 253, 246, 0.9);
}

.work-item:nth-child(2) {
  background: linear-gradient(135deg, rgba(217, 148, 40, 0.14), transparent 44%), rgba(255, 253, 246, 0.9);
}

.work-item:nth-child(3) {
  background: linear-gradient(135deg, rgba(85, 110, 188, 0.13), transparent 44%), rgba(255, 253, 246, 0.9);
}

.work-item p {
  color: var(--muted);
  line-height: 1.8;
}

.split-band {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 18px;
  align-items: stretch;
  padding: 38px 0 72px;
}

.timeline-panel,
.chat-panel {
  padding: 26px;
}

.timeline-panel {
  align-content: start;
  display: grid;
  gap: 20px;
}

.timeline-panel ol {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: plan;
}

.timeline-panel li {
  position: relative;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #35483e;
  line-height: 1.5;
}

.timeline-panel li::before {
  counter-increment: plan;
  content: counter(plan);
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(28, 127, 104, 0.25);
  border-radius: 50%;
  color: var(--jade-dark);
  font-weight: 850;
}

.chat-panel {
  display: grid;
  gap: 16px;
}

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

.chat-header > div {
  display: grid;
  gap: 6px;
}

.chat-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(28, 127, 104, 0.22);
  border-radius: 999px;
  background: rgba(28, 127, 104, 0.1);
  color: var(--jade-dark);
  font-size: 0.86rem;
  font-weight: 800;
  padding: 8px 12px;
}

.chat-window {
  height: 346px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(rgba(255, 253, 246, 0.88), rgba(255, 253, 246, 0.88)), linear-gradient(135deg, rgba(28, 127, 104, 0.14), rgba(85, 110, 188, 0.12));
  padding: 16px;
}

.message {
  width: min(88%, 440px);
  display: grid;
  gap: 6px;
}

.message p {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: #24372d;
  line-height: 1.7;
  box-shadow: 0 10px 28px rgba(54, 42, 28, 0.08);
  padding: 12px 14px;
}

.message.visitor {
  align-self: flex-end;
}

.message.visitor span {
  text-align: right;
}

.message.visitor p {
  border-color: rgba(15, 89, 72, 0.3);
  background: var(--jade-dark);
  color: var(--paper);
}

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

.quick-questions button {
  border: 1px solid rgba(23, 35, 29, 0.14);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 750;
  padding: 9px 12px;
}

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

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

.chat-form button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 850;
  padding: 0 18px;
}

.contact-band {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
  border-top: 1px solid var(--line);
  padding: 54px 0 70px;
}

.contact-band > div {
  display: grid;
  gap: 8px;
}

.contact-band p {
  color: #3f5147;
  font-size: 1rem;
  line-height: 1.9;
}

@media (max-width: 980px) {
  .hero-section {
    min-height: 680px;
    padding-right: 24px;
    padding-left: 24px;
  }

  h1 {
    font-size: 4rem;
  }

  h2 {
    font-size: 1.72rem;
  }

  .tagline {
    font-size: 1.42rem;
  }

  .fact-grid,
  .work-grid,
  .split-band,
  .contact-band {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .top-nav {
    top: 10px;
    width: min(100% - 20px, 520px);
    padding: 8px;
  }

  .brand strong {
    display: none;
  }

  .nav-links {
    gap: 2px;
  }

  .nav-links a {
    font-size: 0.86rem;
    padding: 9px 8px;
  }

  .hero-section {
    min-height: auto;
    padding: 94px 18px 250px;
  }

  .hero-image {
    top: auto;
    height: 235px;
    object-position: 64% center;
  }

  .hero-overlay {
    background:
      linear-gradient(180deg, rgba(251, 247, 238, 0.97) 0%, rgba(251, 247, 238, 0.88) 56%, rgba(251, 247, 238, 0.2) 78%, rgba(251, 247, 238, 0.04) 100%),
      linear-gradient(90deg, rgba(251, 247, 238, 0.94), rgba(251, 247, 238, 0.36));
  }

  h1 {
    font-size: 3.05rem;
  }

  h2 {
    font-size: 1.48rem;
  }

  .tagline {
    font-size: 1.2rem;
  }

  .summary,
  .contact-band p {
    font-size: 0.98rem;
  }

  .hero-actions {
    display: grid;
  }

  .profile-band,
  .section-block,
  .split-band,
  .contact-band {
    width: min(100% - 22px, 520px);
  }

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

  .section-block {
    padding: 42px 0;
  }

  .split-band {
    padding: 28px 0 52px;
  }

  .timeline-panel,
  .chat-panel,
  .work-item {
    padding: 18px;
  }

  .chat-header {
    display: grid;
  }

  .chat-window {
    height: 330px;
  }

  .message {
    width: 100%;
  }
}

.kb-shell {
  width: min(1120px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 0 72px;
}

.plain-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.86);
  box-shadow: 0 12px 36px rgba(54, 42, 28, 0.08);
  backdrop-filter: blur(18px);
  padding: 10px 12px;
}

.kb-hero {
  display: grid;
  gap: 14px;
  max-width: 780px;
  padding: 72px 0 38px;
}

.kb-hero p:not(.eyebrow) {
  color: #3f5147;
  font-size: 1.08rem;
  line-height: 1.9;
}

.kb-chat-panel,
.kb-list-section,
.admin-panel {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.88);
  box-shadow: var(--shadow);
  padding: 26px;
}

.kb-list-section,
.admin-panel {
  margin-top: 22px;
}

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

.kb-search input,
.admin-form input,
.admin-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
  padding: 13px 14px;
}

.kb-search input:focus,
.admin-form input:focus,
.admin-form textarea:focus {
  border-color: rgba(28, 127, 104, 0.46);
  box-shadow: 0 0 0 4px rgba(28, 127, 104, 0.12);
}

.kb-search button,
.admin-form button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 850;
  padding: 0 18px;
}

.answer-box {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 253, 246, 0.9), rgba(255, 253, 246, 0.9)),
    linear-gradient(135deg, rgba(28, 127, 104, 0.14), rgba(85, 110, 188, 0.12));
  color: #24372d;
  line-height: 1.8;
  padding: 18px;
}

.answer-box h3 {
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 1.36rem;
}

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

.citation-list li,
.source-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 14px;
}

.citation-list strong,
.source-card strong {
  display: block;
  margin-bottom: 8px;
}

.citation-list p,
.source-card p {
  color: var(--muted);
  line-height: 1.75;
}

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

.source-grid.compact {
  grid-template-columns: 1fr;
}

.source-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.source-meta span {
  border: 1px solid rgba(28, 127, 104, 0.2);
  border-radius: 999px;
  color: var(--jade-dark);
  font-size: 0.82rem;
  font-weight: 750;
  padding: 5px 9px;
}

.admin-panel {
  grid-template-columns: 0.9fr 1.1fr;
  align-items: start;
}

.admin-form {
  display: grid;
  gap: 14px;
}

.admin-form h2 {
  font-size: 1.55rem;
}

.admin-form label {
  display: grid;
  gap: 7px;
  color: #3f5147;
  font-weight: 750;
}

.form-note {
  color: var(--muted);
  line-height: 1.7;
}

.hidden {
  display: none !important;
}

.danger-button {
  margin-top: 12px;
  border: 1px solid rgba(160, 48, 48, 0.25);
  border-radius: 8px;
  background: rgba(160, 48, 48, 0.08);
  color: #8f2424;
  font-weight: 800;
  padding: 8px 10px;
}

@media (max-width: 760px) {
  .kb-shell {
    width: min(100% - 22px, 520px);
    padding-top: 10px;
  }

  .plain-nav {
    padding: 8px;
  }

  .kb-hero {
    padding: 42px 0 28px;
  }

  .kb-search,
  .source-grid,
  .admin-panel {
    grid-template-columns: 1fr;
  }

  .kb-chat-panel,
  .kb-list-section,
  .admin-panel {
    padding: 18px;
  }
}
