/* SPDX-FileCopyrightText: 2026 北京公富信息技术有限公司 and AI WorkDeck contributors */
/* SPDX-License-Identifier: AGPL-3.0-or-later */
/* Visual language follows the firm's site: tracked capitals in a flared serif, hairline rules,
   painted hero under a dark veil, grey bands, bronze small-caps labels, square corners. */
@font-face { font-family: "Marcellus"; src: url("fonts/Marcellus.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("fonts/SourceSans3.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }

:root {
  --ink: #121212;
  --ink-2: #4A4A4A;
  --ink-3: #7D7D7D;
  --bronze: #7E694F;
  --band: #E9E9E9;
  --band-2: #F2F2F2;
  --rule: #121212;
  --rule-soft: #D4CFC9;
  --display: Optima, "Marcellus", "Songti SC", "STSong", "Noto Serif SC", serif;
  --text: "Source Sans 3", "Source Sans Pro", -apple-system, "PingFang SC", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  font-family: var(--text);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* author display rules must never override the hidden attribute */
html, body { margin: 0; background: #fff; }
body { min-height: 100dvh; display: flex; flex-direction: column; font-size: 17px; line-height: 1.55; }
h1, h2, h3, p { margin: 0; font-weight: 400; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }

/* ---------- Bar & wordmark ---------- */
.bar { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: 18px 20px; padding-top: max(18px, env(safe-area-inset-top)); border-bottom: 1px solid var(--rule-soft); background: #fff; }
.is-home .bar { position: absolute; inset-inline: 0; top: 0; z-index: 2; background: transparent; border-color: transparent; color: #fff; }
.wordmark { grid-column: 2; justify-self: center; text-align: center; line-height: 1.1; text-decoration: none; color: inherit; }
.wordmark .wm-1 { display: block; font-family: var(--display); font-size: 21px; letter-spacing: .06em; }
.wordmark .wm-2 { display: block; font-size: 13px; letter-spacing: .32em; margin-top: 3px; padding-inline-start: .32em; }
.wordmark img { height: 40px; display: block; }
.lang { grid-column: 3; justify-self: end; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 12px; letter-spacing: .04em; }

/* ---------- Home hero ---------- */
.hero { position: relative; min-height: 64dvh; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 120px 28px 56px;
  color: #fff; text-align: center; background: #2C2A33 url("hero.jpg") center / cover no-repeat; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(18,18,18,.55) 0%, rgba(18,18,18,.38) 45%, rgba(18,18,18,.55) 100%); }
.hero > * { position: relative; }
.framed { width: 100%; max-width: 520px; border-top: 1px solid currentColor; border-bottom: 1px solid currentColor; padding: 44px 0; }
.hero h1 { font-family: var(--display); font-size: clamp(22px, 6.2vw, 40px); line-height: 1.6; letter-spacing: .24em; text-transform: uppercase; padding-inline-start: .24em; white-space: pre-line; }
.hero h1:lang(zh) { letter-spacing: .28em; font-size: clamp(24px, 6.6vw, 38px); }
.hero .event { margin-top: 26px; font-size: 12.5px; letter-spacing: .28em; text-transform: uppercase; opacity: .92; }

/* ---------- Statement ---------- */
.statement { padding: 48px 28px; display: flex; justify-content: center; }
.statement .framed { border-color: var(--rule); padding: 34px 0; text-align: center; }
.statement p { font-size: 19px; line-height: 1.75; color: var(--ink); }

/* ---------- Band with practice rows ---------- */
.band { background: var(--band); padding: 44px 24px 52px; display: flex; flex-direction: column; align-items: center; }
.eyebrow { color: var(--bronze); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; text-align: center; }
.rows { width: 100%; max-width: 560px; margin-top: 26px; border-top: 1px solid var(--rule); }
.row { width: 100%; display: grid; grid-template-columns: 34px 1fr 20px; gap: 12px; align-items: center; text-align: start; padding: 24px 2px; border-bottom: 1px solid var(--rule); transition: background .2s; }
.row:active { background: rgba(126,105,79,.08); }
.row .num { font-family: var(--display); color: var(--bronze); font-size: 14px; letter-spacing: .08em; align-self: start; padding-top: 4px; }
.row strong { display: block; font-family: var(--display); font-weight: 400; font-size: 19px; letter-spacing: .14em; text-transform: uppercase; }
.row strong:lang(zh) { letter-spacing: .2em; }
.row span.sub { display: block; color: var(--ink-2); font-size: 15px; margin-top: 4px; letter-spacing: .01em; }
.row .arrow { color: var(--ink); font-size: 18px; }

/* ---------- Inner pages ---------- */
main { flex: 1; width: 100%; max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; }
.page { padding: 30px 24px 40px; display: flex; flex-direction: column; gap: 26px; }
.progress { display: flex; gap: 6px; }
.progress i { flex: 1; height: 2px; background: var(--rule-soft); }
.progress i.on { background: var(--bronze); }
.title { text-align: center; }
.title .framed { padding: 26px 0; border-color: var(--rule); }
.title h2 { font-family: var(--display); font-size: 25px; line-height: 1.4; letter-spacing: .02em; }
.title h2.caps { text-transform: uppercase; letter-spacing: .24em; font-size: 22px; padding-inline-start: .24em; }
.title h2:lang(zh) { letter-spacing: .1em; }
.title .eyebrow { margin-bottom: 18px; }

.options { border-top: 1px solid var(--rule-soft); }
.opt { width: 100%; text-align: start; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 19px 4px; border-bottom: 1px solid var(--rule-soft); font-size: 17px; transition: background .15s, color .15s, padding .15s; }
.opt::after { content: "→"; color: var(--ink-3); }
.opt:active, .opt.sel { background: var(--ink); color: #fff; padding-inline: 14px; }
.opt.sel::after, .opt:active::after { color: #fff; }

.link { align-self: center; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); padding: 10px 6px; }
.link.bronze { color: var(--bronze); }

/* ---------- Chat ---------- */
.starters { border-top: 1px solid var(--rule-soft); }
.starter { width: 100%; text-align: start; display: flex; justify-content: space-between; gap: 14px; padding: 16px 4px; border-bottom: 1px solid var(--rule-soft); font-size: 16px; color: var(--ink); }
.starter::after { content: "→"; color: var(--bronze); flex: none; }
.chat { display: flex; flex-direction: column; gap: 18px; }
.chat:empty { display: none; }
.msg { font-size: 16.5px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; max-width: 86%; background: var(--band-2); padding: 12px 16px; }
.msg.assistant { border-inline-start: 2px solid var(--bronze); padding: 2px 0 2px 16px; color: var(--ink); }
.msg.typing { color: var(--ink-3); letter-spacing: .3em; }
.msg .who { display: block; font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--bronze); margin-bottom: 6px; }
.composer { display: flex; align-items: stretch; border-bottom: 1px solid var(--ink); }
.composer input { flex: 1; min-width: 0; border: 0; padding: 14px 2px; }
.composer input:focus { outline: none; }
.send { flex: none; width: 52px; display: grid; place-items: center; font-size: 20px; color: var(--ink); }
.send:disabled { opacity: .35; }

/* ---------- Buttons ---------- */
.primary { width: 100%; background: var(--ink); color: #fff; padding: 19px 20px; font-size: 14px; letter-spacing: .24em; text-transform: uppercase; }
.primary:lang(zh) { letter-spacing: .3em; font-size: 15px; }
.primary:active { background: #2E2E2E; }
.primary:disabled { opacity: .5; }
.actions { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin-top: 6px; }

/* ---------- Form ---------- */
form.fields { display: flex; flex-direction: column; gap: 22px; }
label.field { display: flex; flex-direction: column; gap: 6px; }
label.field > span { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--bronze); }
input, textarea { font: inherit; font-size: 17px; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--rule-soft); border-radius: 0; padding: 8px 0 10px; width: 100%; -webkit-appearance: none; appearance: none; }
input:focus, textarea:focus { outline: none; border-bottom-color: var(--ink); }
textarea { min-height: 76px; resize: vertical; }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.consent input { -webkit-appearance: auto; appearance: auto; width: 18px; height: 18px; flex: none; margin: 2px 0 0; accent-color: var(--ink); border: 0; padding: 0; }
.err { color: #A3261B; font-size: 14px; min-height: 1em; }

/* ---------- Done ---------- */
.done { text-align: center; padding-top: 24px; display: flex; flex-direction: column; gap: 22px; align-items: center; }
.done .framed { padding: 34px 0; border-color: var(--rule); }
.done h2 { font-family: var(--display); font-size: 22px; letter-spacing: .2em; text-transform: uppercase; padding-inline-start: .2em; }
.done h2:lang(zh) { letter-spacing: .12em; }
.done p { color: var(--ink-2); font-size: 17px; line-height: 1.7; }

/* ---------- Footer ---------- */
.disclaimer { max-width: 600px; margin: 0 auto; padding: 22px 24px calc(22px + env(safe-area-inset-bottom)); font-size: 12px; line-height: 1.6; color: var(--ink-3); text-align: center; }
.is-home .disclaimer { background: var(--band); max-width: none; border-top: 1px solid rgba(18,18,18,.12); }

.fade { animation: fade .45s ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fade { animation: none; } }

/* Typographic polish: no orphaned last words in statements and titles. */
.statement p, .title h2, .done p, .hero h1 { text-wrap: balance; }
.row strong { font-size: 18px; letter-spacing: .12em; }

/* Assistant replies: structured paragraphs and lists instead of pre-wrapped text. */
.msg.assistant { white-space: normal; }
.msg.assistant p + p, .msg.assistant p + ul, .msg.assistant ul + p { margin-top: 10px; }
.msg.assistant ul { margin: 8px 0 0; padding-inline-start: 18px; }
.msg.assistant li { margin: 4px 0; }
.msg.assistant li::marker { color: var(--bronze); }
.msg.assistant strong { font-weight: 600; }

/* ---------- Complimentary briefing: home feature ---------- */
.feature { background: var(--ink); color: #fff; text-align: center; padding: 56px 28px 60px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.feature .eyebrow { color: #B8A27F; }
.feature h2 { font-family: var(--display); font-size: clamp(22px, 6.4vw, 32px); line-height: 1.45; letter-spacing: .16em; text-transform: uppercase; white-space: pre-line; text-wrap: balance; }
.feature h2:lang(zh) { letter-spacing: .14em; }
.feature .teaser { max-width: 460px; color: rgba(255,255,255,.78); font-size: 16px; line-height: 1.75; text-wrap: balance; }
.ghost { margin-top: 8px; border: 1px solid currentColor; padding: 15px 22px; font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: #fff; }
.ghost:lang(zh) { letter-spacing: .26em; font-size: 14px; }
.ghost:active { background: rgba(255,255,255,.1); }
.ghost.dark { color: var(--ink); width: 100%; margin-top: 0; }
a.ghost { display: block; text-align: center; text-decoration: none; } /* "Save as PDF" links to the server-rendered PDF */

/* Chat screen link to the briefing */
.card-link { display: grid; grid-template-columns: 1fr 20px; gap: 6px 12px; align-items: center; text-align: start; border: 1px solid var(--rule-soft); padding: 16px 18px; background: var(--band-2); }
.card-link .eyebrow { grid-column: 1 / -1; text-align: start; font-size: 11.5px; }
.card-link .arrow { grid-row: 2; grid-column: 2; color: var(--bronze); }

/* ---------- Briefing article ---------- */
.read-progress { position: fixed; top: 0; inset-inline: 0; height: 2px; background: var(--bronze); transform-origin: left; transform: scaleX(0); z-index: 5; }
.briefing .cover { position: relative; color: #fff; text-align: center; padding: 52px 28px 40px; background: #2C2A33 url("hero.jpg") center / cover no-repeat; }
.briefing .cover::before { content: ""; position: absolute; inset: 0; background: rgba(18,18,18,.58); }
.briefing .cover > * { position: relative; }
.briefing .cover .framed { margin: 22px auto 0; padding: 30px 0; }
.briefing .cover h1 { font-family: var(--display); font-size: clamp(22px, 6.2vw, 32px); line-height: 1.4; letter-spacing: .04em; text-wrap: balance; }
.briefing .cover h1:lang(zh) { font-size: clamp(21px, 6vw, 30px); letter-spacing: .08em; }
.briefing .cover .meta { margin-top: 20px; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; opacity: .85; }
.eyebrow.light { color: #D9C7A6; }
.print-firm { display: none; }
.article { max-width: 640px; margin: 0 auto; padding: 34px 26px 48px; }
.article .status { color: var(--bronze); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; text-align: center; padding: 30px 0; }
.dots::after { content: ""; display: inline-block; width: 1.5em; text-align: start; animation: dots 1.4s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.article-body { font-size: 17.5px; line-height: 1.8; color: #1E1E1E; }
.article-body > p:first-child { font-size: 20px; line-height: 1.7; color: var(--ink); }
.article-body p + p { margin-top: 14px; }
.article-body h2 { font-family: var(--display); font-size: 15px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink); margin: 38px 0 14px; padding-top: 18px; border-top: 1px solid var(--ink); }
.article-body h2:lang(zh) { letter-spacing: .16em; font-size: 16px; }
.article-body h3 { font-family: var(--display); font-size: 18px; margin: 24px 0 8px; }
.article-body ul, .article-body ol { margin: 12px 0; padding-inline-start: 20px; }
.article-body li { margin: 8px 0; }
.article-body li::marker { color: var(--bronze); }
.article-body strong { font-weight: 600; }
.article-body blockquote { margin: 30px 0; padding: 4px 0 4px 20px; border-inline-start: 2px solid var(--bronze); font-family: var(--display); font-size: 21px; line-height: 1.55; color: var(--ink); }
.article-body hr { border: 0; border-top: 1px solid var(--rule-soft); margin: 28px 0; }
.article-end { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--ink); display: flex; flex-direction: column; gap: 22px; }
.article-end .notice { font-size: 13px; line-height: 1.65; color: var(--ink-3); }
.article-end .actions { gap: 10px; }

/* ---------- Print / Save as PDF: the briefing only ---------- */
@media print {
  @page { margin: 18mm 16mm; }
  .bar, .disclaimer, .read-progress, .article-end .actions, .article .status { display: none !important; }
  body { display: block; }
  .briefing .cover { background: none; color: var(--ink); padding: 0 0 12px; }
  .briefing .cover::before { display: none; }
  .briefing .cover .framed { border-color: var(--ink); }
  .eyebrow.light { color: var(--bronze); }
  .print-firm { display: block; font-family: var(--display); font-size: 16pt; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 14px; }
  .article { padding: 8px 0 0; max-width: none; }
  .article-body { font-size: 11pt; }
  .article-body > p:first-child { font-size: 12.5pt; }
  .article-body h2 { break-after: avoid; }
  .article-body blockquote, .article-body li { break-inside: avoid; }
}

/* Present in the HTML for WeChat's link-card heuristic; never shown. */
.share-thumb { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Official white logo over the painted hero; text wordmark elsewhere. */
.wordmark .logo-on-dark { display: none; height: 44px; width: auto; margin: 0 auto; }
.wordmark .wm-text { display: block; }
.is-home .wordmark .logo-on-dark { display: block; }
.is-home .wordmark .wm-text { display: none; }
