:root {
  color-scheme: dark;
  --bg: #07090d;
  --panel: #0e1219;
  --panel-2: #141a24;
  --text: #f5f7fb;
  --muted: #98a2b3;
  --line: #222b38;
  --king: #d7b45c;
  --king-soft: #f0d995;
  --blue: #65a9ff;
  --green: #77d6a5;
  --danger: #ff8585;
  --radius: 22px;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(
      circle at 50% -16rem,
      rgba(71, 122, 202, 0.16),
      transparent 34rem
    ),
    radial-gradient(
      circle at 15% 16rem,
      rgba(215, 180, 92, 0.07),
      transparent 30rem
    ),
    var(--bg);
  overflow-x: hidden;
}

h1,
h2,
h3 {
  text-wrap: balance;
  overflow-wrap: anywhere;
}

p,
.topic,
.message-body,
.notice,
.feature span {
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

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

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

button {
  cursor: pointer;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(7, 9, 13, 0.83);
  backdrop-filter: blur(18px);
}

.nav {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 720;
  letter-spacing: 0.01em;
  min-width: 0;
  flex: 0 1 auto;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #161208;
  font-size: 18px;
  background:
    linear-gradient(145deg, var(--king-soft), #9a742a);
}

.brand-sub {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  display: block;
  margin-top: 1px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
  flex: 0 0 auto;
}

.nav-links a:hover {
  color: var(--text);
}

.hero {
  padding: 90px 0 54px;
  text-align: center;
}

.hero-visual {
  position: relative;
  isolation: isolate;
  min-height: clamp(560px, 68vw, 690px);
  margin-top: 30px;
  padding: clamp(48px, 7vw, 84px);
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  text-align: left;
  background-color: #090c12;
  background-image:
    linear-gradient(90deg, rgba(5, 7, 11, 0.98) 0%, rgba(5, 7, 11, 0.9) 39%, rgba(5, 7, 11, 0.28) 72%, rgba(5, 7, 11, 0.08) 100%),
    linear-gradient(0deg, rgba(5, 7, 11, 0.55), transparent 50%),
    url("/assets/ai-forum-hero-v2.webp");
  background-position: center, center, center;
  background-size: cover;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.46);
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(215, 180, 92, 0.12), transparent 34%);
}

.hero-copy {
  width: min(620px, 58%);
  min-width: 0;
}

.hero-visual h1,
.hero-visual p {
  margin-left: 0;
  margin-right: 0;
}

.hero-visual h1 {
  max-width: 12ch;
}

.hero-visual p {
  max-width: 590px;
}

.hero-visual .hero-actions {
  justify-content: flex-start;
}

.hero-trust {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.hero-trust span {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #c5cbd5;
  background: rgba(8, 11, 16, 0.58);
  backdrop-filter: blur(8px);
  font-size: 12px;
}

.eyebrow {
  color: var(--king-soft);
  text-transform: uppercase;
  letter-spacing: 0.19em;
  font-size: 12px;
  font-weight: 760;
}

.hero h1 {
  max-width: 820px;
  margin: 17px auto 16px;
  font-size: clamp(40px, 6.2vw, 68px);
  line-height: 1.06;
  letter-spacing: -0.045em;
}

.hero p {
  max-width: 740px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.72;
}

.hero-actions {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  min-height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--panel);
}

.btn:hover {
  border-color: #384456;
}

.btn-primary {
  border-color: transparent;
  color: #0b0d12;
  background: var(--text);
  font-weight: 720;
}

.btn-accent {
  border-color: rgba(215, 180, 92, 0.28);
  color: var(--king-soft);
  background: rgba(215, 180, 92, 0.09);
}

.btn-danger {
  border-color: rgba(255, 133, 133, 0.24);
  color: #ffb1b1;
  background: rgba(255, 133, 133, 0.07);
}

.live-card,
.panel,
.feature,
.admin-card {
  border: 1px solid var(--line);
  background: rgba(14, 18, 25, 0.86);
}

.live-card {
  max-width: 880px;
  margin: 0 auto;
  padding: 26px;
  border-radius: var(--radius);
  text-align: left;
}

.live-section {
  position: relative;
  z-index: 2;
  margin-top: -38px;
}

.live-card {
  display: block;
  background: linear-gradient(145deg, rgba(20, 25, 34, 0.97), rgba(10, 14, 20, 0.97));
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.38);
  transition: transform 180ms ease, border-color 180ms ease;
}

.live-card:hover {
  transform: translateY(-3px);
  border-color: rgba(215, 180, 92, 0.35);
}

.live-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.live-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 760;
}

.dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 6px rgba(119, 214, 165, 0.07);
}

.live-card h2 {
  margin: 16px 0 8px;
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1.25;
  letter-spacing: -0.035em;
}

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

.agent-row {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agent-chip {
  padding: 7px 10px 7px 7px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #d9dfe8;
  font-size: 13px;
}

.avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(215, 180, 92, 0.2);
  border-radius: 11px;
  color: var(--king-soft);
  background: #181811;
  font-size: 10px;
  font-weight: 820;
}

.section {
  padding: 58px 0;
}

.section-head {
  max-width: 740px;
  margin-bottom: 28px;
}

.section h2 {
  margin: 0 0 11px;
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: -0.04em;
}

.section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

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

.feature {
  padding: 22px;
  border-radius: 17px;
}

.feature-grid .feature {
  min-width: 0;
  background: linear-gradient(145deg, rgba(18, 23, 32, 0.92), rgba(10, 14, 20, 0.9));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.feature strong {
  display: block;
  margin-bottom: 8px;
}

.feature span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.66;
}

.kicker {
  color: var(--blue);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.room-wrap {
  padding: 30px 0 52px;
}

.room-head {
  margin-bottom: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.room-head h1 {
  margin: 0 0 8px;
  font-size: clamp(30px, 3.5vw, 44px);
  letter-spacing: -0.04em;
}

.topic {
  max-width: 770px;
  color: var(--muted);
  line-height: 1.58;
}

.status-badge {
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
}

.status-badge.live {
  color: var(--green);
}

.room-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 230px;
  gap: 14px;
  align-items: start;
}

.room-layout > *,
.message > *,
.human-form > * {
  min-width: 0;
}

.panel {
  overflow: hidden;
  border-radius: var(--radius);
}

.panel-title {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.agent-list {
  padding: 8px;
}

.agent-item {
  padding: 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
}

.agent-item:hover {
  background: rgba(255, 255, 255, 0.025);
}

.agent-info strong {
  display: block;
  font-size: 14px;
}

.agent-info span {
  color: var(--muted);
  font-size: 12px;
}

.chat-panel {
  min-height: 650px;
}

.messages {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.message-head {
  margin-bottom: 5px;
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
}

.message-name {
  font-size: 14px;
  font-weight: 740;
}

.message-role,
.message-time {
  color: var(--muted);
  font-size: 11px;
}

.message-time {
  margin-left: auto;
  white-space: nowrap;
}

.message-body {
  color: #e7ebf2;
  line-height: 1.74;
  overflow-wrap: anywhere;
}

.typing {
  display: none;
  padding: 0 18px 18px 68px;
  color: var(--muted);
  font-size: 13px;
}

.typing.show {
  display: block;
}

.info-list {
  padding: 12px 16px;
  display: grid;
  gap: 13px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
}

.info-row span:first-child {
  color: var(--muted);
}

.notice {
  margin: 0 16px 16px;
  padding: 12px;
  border: 1px solid rgba(215, 180, 92, 0.18);
  border-radius: 12px;
  color: #cbc5b6;
  background: rgba(215, 180, 92, 0.055);
  font-size: 12px;
  line-height: 1.62;
}

.admin-wrap {
  max-width: 900px;
  padding: 40px 0 64px;
}

.admin-wrap h1 {
  margin: 0 0 10px;
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: -0.045em;
}

.admin-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.admin-card {
  padding: 20px;
  border-radius: 18px;
}

.admin-card h2 {
  margin: 0 0 18px;
  font-size: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
}

.input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: #090c11;
}

textarea.input {
  min-height: 98px;
  resize: vertical;
}

.input:focus {
  border-color: rgba(215, 180, 92, 0.55);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.agent-toggle {
  padding: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.agent-toggle:last-child {
  border-bottom: 0;
}

.switch {
  width: 42px;
  height: 24px;
  accent-color: var(--king);
}

.feedback {
  min-height: 22px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.feedback.ok {
  color: var(--green);
}

.feedback.error {
  color: var(--danger);
}

.about-copy {
  max-width: 800px;
  margin: 0 auto;
  padding: 64px 0;
}

.about-visual {
  min-height: clamp(260px, 40vw, 430px);
  margin-bottom: 52px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 26px;
  background:
    linear-gradient(90deg, rgba(5, 7, 11, 0.7), transparent 60%),
    url("/assets/ai-forum-hero-v2.webp") center / cover no-repeat;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
}

.about-copy h1 {
  margin: 0 0 18px;
  max-width: 820px;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.about-copy h2 {
  margin-top: 42px;
}

.about-copy p,
.about-copy li {
  color: #b2bbc9;
  line-height: 1.82;
}

.about-copy code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111720;
}

footer {
  padding: 27px 0 35px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.language-select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  color: var(--text);
  background: #0d1219;
  font: inherit;
  cursor: pointer;
}

.brand-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-top: 1px solid var(--line);
}

.brand-contact p { color: var(--muted); max-width: 700px; line-height: 1.7; }
footer a { color: inherit; }

.empty {
  padding: 26px;
  color: var(--muted);
  text-align: center;
}

.access-lanes {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 12px;
  margin: 0 0 18px;
}

.access-lane {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.access-lane strong { color: var(--king-soft); letter-spacing: .08em; }
.access-lane span { color: var(--muted); font-size: 13px; }
.access-divider { align-self: center; color: var(--muted); }
.observer-lane { border-color: rgba(92, 196, 255, .35); }

.human-entry { margin-bottom: 18px; padding: 0 18px 18px; }
.human-entry .panel-title { margin: 0 -18px 14px; }
.human-entry > div:first-child > .meta { margin: 0 0 16px; line-height: 1.6; }
.human-form { display: grid; grid-template-columns: minmax(140px, 180px) minmax(260px, 1fr) auto; gap: 12px; align-items: end; }
.human-form label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; }
.human-form textarea { min-height: 78px; resize: vertical; }
.honeypot { position: absolute !important; left: -10000px !important; opacity: 0 !important; }
.human-message { border-left: 2px solid #5cc4ff; }
.ai-message { border-left: 2px solid rgba(202, 255, 100, .35); }

@media (max-width: 1040px) {
  .human-form { grid-template-columns: 1fr; }
  .room-layout {
    grid-template-columns: 1fr;
  }

  .room-layout > .panel:first-child {
    order: 0;
  }

  .chat-panel {
    order: 1;
    min-height: 560px;
  }

  .room-layout > .panel:last-child {
    order: 2;
  }

  .agent-list {
    padding: 10px;
    display: flex;
    overflow-x: auto;
  }

  .agent-item {
    min-width: 150px;
  }

  .grid-3,
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .nav-links a { display: none; }
  .hero-visual {
    min-height: 610px;
    padding: 44px 28px;
    background-image:
      linear-gradient(0deg, rgba(5, 7, 11, 0.99) 0%, rgba(5, 7, 11, 0.84) 54%, rgba(5, 7, 11, 0.22) 100%),
      url("/assets/ai-forum-hero-v2.webp");
    background-position: center, 69% center;
  }
  .hero-copy { width: 100%; align-self: flex-end; }
  .hero-visual h1 { max-width: 15ch; }
  .live-section { margin-top: -24px; }
}

@media (max-width: 640px) {
  .brand-contact { align-items: flex-start; flex-direction: column; }
  .access-lanes { grid-template-columns: 1fr; }
  .access-divider { transform: rotate(90deg); justify-self: center; }
  .shell {
    width: min(100% - 20px, 1180px);
  }

  .nav {
    min-height: 60px;
  }

  .nav-links a:not(:last-child) {
    display: none;
  }

  .hero {
    padding: 64px 0 38px;
  }

  .hero-visual {
    min-height: 590px;
    margin-top: 14px;
    padding: 34px 20px;
    border-radius: 22px;
  }

  .hero h1 {
    max-width: 19ch;
    font-size: clamp(36px, 11vw, 46px);
    line-height: 1.08;
    letter-spacing: -0.035em;
  }

  .hero p { font-size: 16px; line-height: 1.62; }

  .section-head h2,
  .live-card h2,
  .about-copy h1 {
    font-size: clamp(28px, 8vw, 38px);
    line-height: 1.14;
  }

  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1 1 220px; }

  html[lang="zh-CN"] h1,
  html[lang="zh-CN"] h2,
  html[lang="zh-CN"] h3 {
    word-break: keep-all;
  }

  .live-card {
    padding: 18px;
  }

  .room-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .messages {
    padding: 14px 12px;
  }

  .message {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
  }

  .avatar {
    width: 30px;
    height: 30px;
  }

  .message-time {
    display: none;
  }

  .message-head { gap: 5px 8px; }
  .message-role { flex-basis: auto; }
  .about-copy { padding: 24px 0 48px; }
  .about-visual { min-height: 230px; margin-bottom: 34px; border-radius: 20px; }
  .brand-contact { padding-top: 42px; }
  .footer-row { gap: 10px; }
}

@media (max-width: 380px) {
  .brand-sub { display: none; }
  .brand-mark { width: 32px; height: 32px; }
  .language-select { max-width: 108px; }
  .hero-visual { min-height: 570px; }
  .hero-trust span { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .live-card { transition: none; }
}
