:root {
  color-scheme: light;
  --ink: #20283b;
  --muted: #605b52;
  --paper: #f8f4e9;
  --white: #fffcf5;
  --line: #dfd6c6;
  --red: #9a3328;
  --night: #202a42;
  --gold: #e6bc6a;
  font-family: "Inter", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.shell { max-width: 1220px; min-height: 100dvh; display: flex; flex-direction: column; margin: auto; padding: 0 clamp(18px, 5vw, 70px); }
.masthead { min-height: 88px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wordmark { display: flex; align-items: center; gap: 10px; font-size: 23px; font-weight: 750; white-space: nowrap; }
.seal { display: grid; place-items: center; color: #fff5dc; background: var(--red); width: 35px; height: 35px; font-family: "Noto Serif CJK SC", "Songti SC", SimSun, serif; font-size: 23px; box-shadow: inset 0 0 0 2px var(--red), inset 0 0 0 3px #df9b6b; }
.wordmark small, .region { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: .06em; }
main { flex: 1; }
.gate { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 7vw, 106px); align-items: center; padding: clamp(40px, 9vw, 116px) 0; }
.kicker { color: var(--red); font-weight: 700; font-size: 13px; letter-spacing: .15em; display: flex; align-items: center; gap: 12px; }
.kicker::before { content: ""; width: 28px; height: 1px; background: var(--red); }
h1 { font-family: "Noto Serif CJK SC", "Songti SC", SimSun, serif; font-weight: 800; margin: 16px 0; }
.gate h1 { font-size: clamp(37px, 5.6vw, 68px); letter-spacing: -.055em; line-height: 1.17; }
.gate h1 span { color: var(--red); }
.lede, .panel p { color: var(--muted); line-height: 1.8; }
.lede { font-size: 16px; max-width: 28em; margin: 0 0 34px; }
label { display: block; margin-bottom: 8px; font-weight: 700; font-size: 13px; }
.access-row, .compose-row { display: flex; align-items: stretch; gap: 8px; }
input, textarea { min-width: 0; border: 1px solid #bdb4a6; border-radius: 8px; background: #fffefa; width: 100%; padding: 13px; color: var(--ink); font-size: 16px; }
textarea { resize: vertical; }
.primary { min-height: 46px; border: 0; border-radius: 8px; padding: 0 16px; background: var(--red); color: #fff; font-weight: 700; white-space: nowrap; }
.primary:hover:not(:disabled) { background: #7e281f; }
.feedback { margin: 7px 0 0; font-size: 13px; min-height: 20px; color: var(--red) !important; }
.cover { min-height: 420px; aspect-ratio: 1.02; position: relative; overflow: hidden; display: grid; place-items: center; border-radius: 14px; background: var(--night); isolation: isolate; }
.cover::after { content: ""; position: absolute; inset: 12px; border: 1px solid #e6bc6a6b; border-radius: 8px; pointer-events: none; }
.cover-pattern { position: absolute; inset: 0; height: 100%; width: 100%; object-fit: cover; opacity: .23; mix-blend-mode: screen; z-index: -1; filter: grayscale(1); }
.portrait { width: 59%; max-width: 248px; aspect-ratio: 1; border-radius: 50%; padding: 6px; border: 1px solid var(--gold); background: var(--night); box-shadow: 0 0 0 13px #e6bc6a19; }
.portrait img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.cover > span { position: absolute; bottom: 32px; color: #ffe0a4; font-family: "Noto Serif CJK SC", "Songti SC", SimSun, serif; letter-spacing: .12em; font-size: 12px; }
footer { border-top: 1px solid var(--line); padding: 19px 0 22px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.workbench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(228px, 28%); gap: 20px 26px; margin: 32px 0 46px; align-items: start; }
.mode-bar { grid-column: 1/-1; display: flex; align-items: center; gap: 5px; }
.mode, .quiet { border: 1px solid transparent; border-radius: 8px; min-height: 44px; background: transparent; color: var(--ink); padding: 0 11px; font-size: 14px; }
.mode[aria-pressed="true"] { background: var(--night); color: #fff; }
.quiet:hover, .mode[aria-pressed="false"]:hover { border-color: var(--line); background: var(--white); }
.reset { margin-left: auto; }
.panel, .topics { background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.conversation { min-height: 268px; max-height: min(56vh, 540px); overflow: auto; padding: 25px; overflow-wrap: anywhere; }
.welcome { text-align: center; padding: 23px 0 15px; }
.avatar { width: 58px; height: 58px; object-fit: cover; border-radius: 50%; border: 1px solid var(--gold); }
.welcome h1, .image-panel h1 { font-size: clamp(25px, 4vw, 36px); }
.welcome p { margin: 0; }
.composer { padding: 15px 20px 7px; border-top: 1px solid var(--line); }
.message { max-width: 92%; border-radius: 12px; padding: 12px 15px; margin: 0 0 11px; line-height: 1.7; white-space: pre-wrap; background: #f2ebdc; }
.message.user { margin-left: auto; background: var(--night); color: #fff; width: fit-content; }
.speaker { display: block; font-size: 12px; font-weight: 750; color: var(--red); }
.topics { padding: 16px; }
.topics h2 { font-size: 16px; margin: 0 0 12px; }
.topics p { margin: 13px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.topic { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; margin-top: 8px; text-align: left; border: 1px solid var(--line); color: var(--ink); padding: 4px 9px 4px 4px; border-radius: 8px; background: #fffdf7; font-weight: 600; }
.topic:hover { border-color: var(--red); }
.topic img { width: 44px; height: 44px; border-radius: 5px; object-fit: cover; }
.topic i { margin-left: auto; color: var(--red); font-style: normal; }
.image-panel { padding: clamp(16px, 5vw, 32px); }
.image-panel h1 { margin-top: 0; }
.image-panel button { margin-top: 12px; }
figure { margin: 12px 0 0; }
figure img { width: 100%; max-width: 560px; display: block; border-radius: 10px; }
figcaption { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 10px; font-size: 13px; color: var(--muted); }
figcaption a { color: var(--red); }
@media (max-width: 720px) {
  .masthead { min-height: 65px; }
  .gate { grid-template-columns: 1fr; padding: 32px 0; gap: 19px; }
  .cover { min-height: 0; aspect-ratio: 2.25; }
  .cover > span { bottom: 21px; font-size: 11px; }
  .portrait { width: 29%; }
  .lede { margin-bottom: 21px; }
  .workbench { grid-template-columns: minmax(0, 1fr); margin: 18px 0 26px; gap: 13px; }
  .conversation { padding: 15px 12px; min-height: 195px; }
  .composer { padding: 12px 11px 5px; }
  .welcome { padding: 10px 0; }
}
@media (max-width: 370px) {
  .wordmark small { display: none; }
  .primary { padding-inline: 10px; }
}
