:root {
  --ink: #182727;
  --ink-soft: #52605e;
  --paper: #f3efe6;
  --surface: #fffdf8;
  --line: #d8d4ca;
  --accent: #bd5b3d;
  --accent-dark: #8f3e29;
  --sage: #dce4d9;
  --shadow: 0 18px 50px rgba(31, 43, 41, 0.09);
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 5%, rgba(189, 91, 61, 0.09), transparent 28rem),
    var(--paper);
  font-family: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  min-height: 100vh;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled, input:disabled, textarea:disabled { cursor: wait; opacity: 0.58; }

.hidden { display: none !important; }
.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;
}

.topbar {
  height: 72px;
  padding: 0 clamp(24px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(24, 39, 39, 0.12);
}

.brand {
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: Georgia, "Noto Serif SC", serif;
  font-weight: 700;
  font-size: 20px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--surface);
  background: var(--ink);
  border-radius: 50%;
}

.mode-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13px;
}

.mode-badge i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #668262;
  box-shadow: 0 0 0 4px rgba(102, 130, 98, 0.13);
}

main { width: min(1440px, 100%); margin: 0 auto; }

.welcome {
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(70px, 11vh, 130px) 28px 80px;
}

.eyebrow, .card-label {
  color: var(--accent-dark);
  letter-spacing: 0.16em;
  font-size: 11px;
  font-weight: 800;
}

.welcome h1 {
  max-width: 850px;
  margin: 18px 0 24px;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(44px, 7vw, 82px);
  line-height: 1.08;
  letter-spacing: -0.045em;
  font-weight: 500;
}

.welcome-copy {
  max-width: 670px;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.85;
}

.start-card {
  max-width: 720px;
  margin-top: 52px;
  padding: 24px;
  background: rgba(255, 253, 248, 0.8);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.start-card label { font-size: 13px; font-weight: 700; }
.start-row { display: flex; gap: 12px; }
.start-row input {
  min-width: 0;
  flex: 1;
  padding: 15px 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #bdb8ad;
  border-radius: 3px;
  outline: none;
}
.start-row input:focus, .composer textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(189, 91, 61, 0.12); }

.primary-button, .send-button {
  border: 0;
  color: white;
  background: var(--accent);
  font-weight: 750;
  border-radius: 3px;
}
.primary-button { min-height: 50px; padding: 0 24px; }
.primary-button:hover, .send-button:hover { background: var(--accent-dark); }
.privacy-note { margin: 12px 0 0; color: #777f7d; font-size: 12px; }

.consent-summary {
  padding: 18px 20px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
}

.consent-summary strong { display: block; margin-bottom: 10px; }
.consent-summary ul { margin: 0; padding-left: 20px; color: var(--ink-soft); line-height: 1.7; }
.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0;
  cursor: pointer;
}
.consent-check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); }
.restore-card, .access-code-panel, .my-assessments { max-width: 620px; margin: 18px auto 0; padding: 22px; background: white; border: 1px solid var(--line); box-shadow: var(--shadow); }
.restore-row { display: flex; gap: 8px; margin-top: 9px; }
.restore-row input { flex: 1; min-width: 0; padding: 11px; border: 1px solid var(--line); font: inherit; }
.restore-row button { padding: 0 13px; border: 0; background: var(--ink); color: white; font: inherit; }
.access-code-panel code { display: block; margin: 15px 0; padding: 12px; overflow-wrap: anywhere; color: var(--ink); background: var(--paper); }
.my-assessments { display: grid; gap: 16px; }
.attempt-list { display: grid; gap: 8px; }
.attempt-row { display: flex; justify-content: space-between; gap: 12px; padding: 13px; border: 1px solid var(--line); }
.attempt-row span { color: var(--ink-soft); font-size: 13px; }
.consent-check span { line-height: 1.5; }

.invite-field { display: grid; gap: 7px; margin-top: 18px; }
.invite-field input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 13px;
  font: inherit;
  background: white;
}
.invite-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(189, 91, 61, 0.12); outline: none; }
.invite-field small { color: #777f7d; font-weight: 400; line-height: 1.5; }

.assessment {
  display: grid;
  grid-template-columns: minmax(280px, 0.38fr) minmax(480px, 0.62fr);
  gap: 22px;
  min-height: calc(100vh - 72px);
  padding: 26px clamp(20px, 3vw, 42px) 36px;
}

.context-column { display: flex; flex-direction: column; gap: 22px; min-height: 0; }
.scenario-card, .information-panel, .conversation-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.scenario-card { padding: 26px; }
.scenario-card h2, .panel-heading h2, .conversation-heading h2 {
  font-family: Georgia, "Noto Serif SC", serif;
  font-weight: 600;
}
.scenario-card h2 { margin: 10px 0 22px; font-size: 25px; line-height: 1.35; }
.scenario-card p { color: var(--ink-soft); line-height: 1.75; white-space: pre-line; }
.role-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.role-line span { color: var(--ink-soft); }

.information-panel { flex: 1; padding: 24px; min-height: 250px; }
.panel-heading, .conversation-heading { display: flex; align-items: center; justify-content: space-between; }
.panel-heading h2, .conversation-heading h2 { margin: 5px 0 0; font-size: 21px; }
.panel-heading > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 12px;
}
.empty-information { margin-top: 28px; color: #7c8482; line-height: 1.7; font-size: 13px; }
.information-list { display: grid; gap: 12px; margin-top: 18px; }
.information-card { position: relative; padding: 18px 16px 16px 48px; background: #f0f2eb; border-left: 3px solid #73806e; }
.information-number { position: absolute; left: 14px; top: 20px; color: #73806e; font: 700 11px Georgia, serif; }
.information-card h3 { margin: 0 0 8px; font-size: 15px; }
.information-card p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.65; white-space: pre-line; }
.information-limitations { margin-top: 8px; color: #765b31; font-size: 12px; line-height: 1.55; }
.information-metadata { margin-top: 8px; color: var(--ink-faint); font-size: 11px; letter-spacing: .02em; }
.information-card small { display: block; margin-top: 10px; color: #75807c; font-size: 10px; }

.conversation-card { display: flex; flex-direction: column; min-height: 0; }
.conversation-heading { padding: 22px 26px; border-bottom: 1px solid var(--line); }
.session-actions { display: flex; align-items: center; gap: 10px; }
.session-status { padding: 6px 10px; color: #526a50; background: var(--sage); font-size: 12px; border-radius: 99px; }
.session-status.complete { color: white; background: var(--ink); }
.withdraw-button {
  padding: 7px 10px;
  color: #7b4133;
  background: transparent;
  border: 1px solid rgba(143, 62, 41, 0.34);
  border-radius: 3px;
  font-size: 11px;
}
.withdraw-button:hover { color: white; background: var(--accent-dark); }

.messages {
  flex: 1;
  min-height: 400px;
  max-height: calc(100vh - 320px);
  overflow-y: auto;
  padding: 30px clamp(20px, 4vw, 54px);
  scroll-behavior: smooth;
}
.message { max-width: 82%; margin-bottom: 28px; }
.message-label { display: block; margin-bottom: 8px; color: #76807e; font-size: 11px; font-weight: 750; letter-spacing: 0.08em; }
.message p { margin: 0; padding: 16px 18px; line-height: 1.75; white-space: pre-wrap; }
.host-message p { background: #ece9e1; border-radius: 3px 14px 14px 14px; }
.user-message { margin-left: auto; }
.user-message .message-label { text-align: right; }
.user-message p { color: white; background: var(--ink); border-radius: 14px 3px 14px 14px; }

.composer { margin: 0 24px 24px; border: 1px solid #bdb8ad; background: white; }
.composer textarea { width: 100%; resize: none; padding: 16px; color: var(--ink); border: 0; outline: 0; line-height: 1.6; }
.composer-footer { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 10px 16px; color: #8b918f; font-size: 11px; }
.send-button { padding: 9px 15px; }

.completion-banner { margin: 0 24px 24px; padding: 20px; text-align: center; background: var(--sage); }
.completion-banner strong, .completion-banner span { display: block; }
.completion-banner span { margin-top: 5px; color: var(--ink-soft); font-size: 13px; }

.notice {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  padding: 13px 18px;
  color: white;
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 13px;
}
.notice.error { background: #8f342b; }

@media (max-width: 900px) {
  .assessment { grid-template-columns: 1fr; }
  .context-column { display: grid; grid-template-columns: 1fr 1fr; }
  .conversation-card { min-height: 720px; }
  .messages { max-height: none; }
}

@media (max-width: 640px) {
  .topbar { height: 62px; padding: 0 18px; }
  .mode-badge { font-size: 0; }
  .welcome { padding: 58px 20px; }
  .welcome h1 { font-size: 43px; }
  .start-row { flex-direction: column; }
  .primary-button { min-height: 50px; }
  .assessment { padding: 14px; }
  .context-column { display: flex; }
  .conversation-card { min-height: calc(100vh - 90px); }
  .conversation-heading { padding: 18px; }
  .session-actions { align-items: flex-end; flex-direction: column; }
  .messages { padding: 24px 16px; }
  .message { max-width: 92%; }
  .composer { margin: 0 12px 12px; }
  .composer-footer > span { display: none; }
  .composer-footer { justify-content: flex-end; }
}
