:root {
  --paper: #f3efe5;
  --panel: #fcfaf4;
  --ink: #232820;
  --muted: #62665c;
  --red: #8d2d25;
  --red-hover: #75271f;
  --line: #c4c2b7;
  --line-dark: #a8a99a;
  --select: #f1e7df;
  --disabled: #d5d1c6;
  color: var(--ink);
  background: #e7e4db;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; overflow-x: hidden; background: #e7e4db; }
body { -webkit-tap-highlight-color: rgba(141,45,37,.18); }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 20; top: 8px; left: 8px; transform: translateY(-160%); border-radius: 8px; background: var(--ink); color: var(--paper); padding: 10px 14px; text-decoration: none; }
.skip-link:focus-visible { transform: translateY(0); }
.page-shell { min-height: 100vh; overflow: hidden; background: var(--paper); }
.site-header, .site-footer, .login-layout, .entry-view, .reader-view, .reports-view { width: min(1184px, calc(100% - 48px)); margin-inline: auto; }
.site-header { height: 111px; display: flex; align-items: flex-start; gap: 28px; padding-top: 32px; border-bottom: 1px solid var(--line-dark); }
.brand { display: inline-flex; align-items: center; width: 264px; height: 52px; color: var(--ink); font: 700 34px/42px STSong, SimSun, serif; letter-spacing: 2px; text-decoration: none; white-space: nowrap; }
.brand b { display: inline-flex; width: 32px; height: 32px; margin-left: 5px; align-items: center; justify-content: center; background: var(--red); color: var(--paper); font: 700 22px/32px SimSun, serif; letter-spacing: 0; }
.brand-note { width: 232px; margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 20px; }
.header-reading { width: 200px; margin: 6px 0 0 auto; color: var(--muted); font-size: 14px; line-height: 20px; text-align: right; }
.account-nav { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.account-menu-wrap { position: relative; }
.account-menu { position: absolute; z-index: 11; top: calc(100% + 10px); right: 0; width: 156px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 10px 24px rgba(35,40,32,.14); padding: 6px; }
.account-menu button { display: block; width: 100%; min-height: 40px; border: 0; background: transparent; color: var(--ink); padding: 0 10px; text-align: left; }
.account-menu button:hover, .account-menu button:focus-visible { background: var(--select); color: var(--red); outline-offset: -2px; }
.text-button { min-height: 44px; border: 0; padding: 0 8px; background: transparent; color: var(--red); }
.text-button:hover { text-decoration: underline; text-underline-offset: 4px; }
.avatar { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--disabled); color: var(--ink); font-weight: 700; }
.avatar:hover { background: #c6c2b6; }
.primary-button, .outline-button { min-height: 48px; border-radius: 8px; padding: 0 20px; font-weight: 700; }
.primary-button { border: 1px solid var(--red); background: var(--red); color: var(--paper); }
.primary-button:hover { background: var(--red-hover); }
.primary-button:active { background: #63221c; }
.primary-button:disabled { border-color: var(--disabled); background: var(--disabled); color: #79796f; cursor: not-allowed; }
.outline-button { border: 1px solid var(--line); background: transparent; color: var(--red); }
.outline-button:hover { background: #f1ede3; }
.form-status, .helper, .brand-note { color: var(--muted); font-size: 14px; line-height: 20px; }
.field-error { min-height: 18px; margin: 4px 0; color: var(--red); font-size: 12px; line-height: 18px; }
label, .form-label { display: block; margin: 18px 0 8px; font-size: 16px; line-height: 24px; }
input { width: 100%; height: 52px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 0 14px; color: var(--ink); }
input:hover { border-color: #8b8d83; }
input:focus-visible { border: 2px solid var(--red); outline: 0; }

/* Login pre-state: DB-01..22 on the 1920 x 1080 logical canvas. */
.login-layout { position: relative; display: grid; grid-template-columns: 672px 448px; gap: 64px; height: 787px; }
.welcome-copy { padding-top: 55px; }
.eyebrow { display: none; margin: 0; color: var(--red); font-size: 14px; line-height: 20px; }
.welcome-copy h1, .entry-view h1, .reports-view h1 { margin: 16px 0 10px; font: 700 64px/80px STSong, SimSun, serif; letter-spacing: 1px; text-wrap: balance; }
.welcome-copy h1 { margin: 0 0 18px; }
.lede { margin: 0; color: var(--muted); font-size: 16px; line-height: 28px; }
.paper-illustration { position: relative; width: 748px; height: 438px; margin: 26px 0 0 -48px; overflow: hidden; }
.paper-illustration img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; }
.paper-card { background: rgba(252,250,244,.96); border: 1px solid var(--line); box-shadow: 0 16px 34px rgba(35,40,32,.09); }
.login-card { position: relative; height: 680px; margin-top: 45px; overflow: hidden; padding: 34px 32px; border-radius: 16px; }
.login-card > :not(.login-mountain) { position: relative; z-index: 1; }
.login-mountain { position: absolute; z-index: 0; left: 26px; bottom: 12px; width: 244px; height: 84px; object-fit: contain; opacity: .52; pointer-events: none; }
.login-card h2 { margin: 0; font: 700 28px/38px STSong, SimSun, serif; }
.rule { height: 1px; margin: 22px 0 25px; background: var(--line-dark); }
.code-row { display: grid; grid-template-columns: 256px 128px; }
.code-row input { border-radius: 8px 0 0 8px; }
.code-row button { border-radius: 0 8px 8px 0; }
.login-card .primary-button { width: 100%; margin-top: 15px; }
.login-card .form-status { margin: 12px 0; text-align: center; }
.sample-link { display: block; width: 100%; margin: 0 auto; }
.login-card::after { content: "山不言，报自有声"; position: absolute; right: 32px; bottom: 22px; color: var(--muted); font: 12px/20px STSong, SimSun, serif; letter-spacing: 1px; }
.site-footer { height: 182px; border-top: 1px solid var(--line-dark); padding-top: 16px; }
.site-footer p { margin: 0; color: var(--muted); font-size: 14px; line-height: 20px; }
.site-footer .footer-sentence { margin-top: 20px; text-align: center; }
.site-footer p:last-child { margin-top: 12px; text-align: center; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Logged-in v2 main page. */
.entry-view { padding-top: 40px; min-height: 787px; }
.greeting { margin: 0; font: 700 28px/38px STSong, SimSun, serif; }
.entry-view h1 { margin: 25px 0 16px; font-size: 48px; line-height: 64px; }
.entry-grid { display: grid; grid-template-columns: 552px 552px; gap: 80px; margin-top: 38px; }
.generate-form { min-height: 488px; padding-right: 40px; border-right: 1px solid var(--line-dark); }
.counter-input { position: relative; }
.counter-input input { padding-right: 72px; }
.counter-input span { position: absolute; top: 16px; right: 14px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.counter-input.over-limit span { color: var(--red); }
.industry-entry { display: grid; grid-template-columns: minmax(0,1fr) auto auto; width: 100%; min-height: 52px; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 10px 14px; color: var(--ink); text-align: left; }
.industry-entry:hover { border-color: var(--red); }
.industry-entry span:first-child { overflow: hidden; text-overflow: ellipsis; }
.industry-entry span:last-child { font-size: 21px; line-height: 1; }
.helper { margin: 8px 0 0; }
.report-preview { min-height: 244px; margin-top: 64px; padding: 24px 32px; background: var(--panel); box-shadow: 0 4px 16px rgba(35,40,32,.08); }
.report-preview p { margin: 0; color: var(--muted); font-size: 14px; }
.report-preview h2 { margin: 30px 0 12px; overflow-wrap: anywhere; text-align: center; font: 700 40px/52px STSong, SimSun, serif; text-wrap: balance; }
.report-preview time { display: block; color: var(--muted); font-size: 14px; text-align: center; }
.ink-rule { height: 4px; margin: 22px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.report-preview .preview-note { text-align: center; }
.generate-actions { width: 552px; margin: -144px 0 0 auto; }
.generate-actions .primary-button { width: 100%; min-height: 56px; }
.generate-actions .form-status { text-align: center; }
.generation-progress { display: block; min-height: 5px; margin: 12px 0 2px; }
.generation-progress-rail { position: relative; height: 5px; overflow: hidden; background: #d7d0c1; }
.generation-progress-ink { position: absolute; inset: 0; transform: scaleX(var(--generation-progress-scale, 0)); transform-origin: left center; background: var(--red); transition: transform .24s ease-out; }
.generation-activity { display: inline-block; width: 12px; height: 12px; margin-left: 8px; border: 1.5px solid rgba(159, 52, 43, .28); border-top-color: var(--red); border-radius: 50%; vertical-align: -1px; animation: generation-activity-spin .8s linear infinite; }
@keyframes generation-activity-spin { to { transform: rotate(1turn); } }

/* v2 industry chooser: DS-02 704 x 592 centered at the desktop baseline. */
.overlay { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; padding: 24px; overscroll-behavior: contain; background: rgba(35,40,32,.42); }
.industry-dialog, .share-dialog, .nickname-dialog { position: relative; display: flex; flex-direction: column; width: min(704px, calc(100vw - 48px)); max-height: calc(100dvh - 48px); border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: 0 16px 48px rgba(35,40,32,.18); padding: 28px 32px; }
.dialog-handle { display: none; }
.dialog-head { display: flex; justify-content: space-between; gap: 16px; }
.dialog-head h2, .share-dialog h2 { margin: 0; font: 700 32px/40px STSong, SimSun, serif; }
.dialog-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 20px; }
.icon-button { width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 32px; line-height: 1; }
.icon-button:hover { background: #f1ede3; }
.search-field { position: relative; margin: 18px 0 24px; }
.search-field span { position: absolute; top: 12px; left: 16px; color: var(--muted); font-size: 20px; }
.search-field input { height: 48px; padding-left: 48px; }
.industry-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; min-height: 0; max-height: 260px; overflow: auto; padding: 0 2px; }
.industry-option { display: flex; min-height: 56px; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 8px 14px; color: var(--ink); line-height: 20px; text-align: left; }
.industry-option:hover { border-color: var(--red); background: #f1ede3; }
.industry-option[aria-selected="true"] { border: 2px solid var(--red); background: var(--select); color: var(--red); }
.industry-option .tick { font-size: 16px; }
.empty-state { height: 260px; place-content: center; gap: 4px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--ink); font-size: 16px; }
.empty-state span { font-size: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 16px; margin-top: 28px; border-top: 1px solid var(--line-dark); padding-top: 20px; }
.dialog-actions .outline-button { min-width: 120px; }
.dialog-actions .primary-button { min-width: 140px; }

.reader-view, .reports-view { padding-top: 32px; }
.reader-nav, .reader-actions { display: flex; align-items: center; }
.reader-nav { justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.reader-actions { gap: 8px; }
.newspaper { width: 100%; max-width: 1120px; margin: auto; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 4px 16px rgba(35,40,32,.08); padding: 52px; }
.newspaper header { border-bottom: 4px double var(--ink); padding-bottom: 20px; text-align: center; }
.newspaper h1 { margin: 12px 0; font: 700 40px/1.25 STSong, SimSun, serif; }
.newspaper .issue-meta { color: var(--muted); font-size: 14px; }
.reading-group { margin-top: 38px; }
.reading-group-title { margin: 0 0 14px; border-bottom: 1px solid var(--ink); padding-bottom: 8px; font: 700 24px/1.4 STSong, SimSun, serif; }
.reading-group-stories { display: grid; align-items: start; gap: 24px; }
.reading-group-stories--front-page { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.reading-group-stories--industry { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.reading-group-stories--briefs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.reader-story { min-width: 0; border-top: 1px solid var(--line); padding-top: 16px; }
.reader-story h3 { margin: 6px 0 8px; font: 700 24px/1.45 STSong, SimSun, serif; overflow-wrap: anywhere; }
.reader-story > p { margin: 0; max-width: 72ch; overflow-wrap: anywhere; }
.reader-story .story-tags { color: var(--red); font-size: 13px; line-height: 20px; }
.reader-story .editor-note { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.source-link { display: inline-block; margin-top: 12px; color: var(--red); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.newspaper .reader-story.reader-story--lead { grid-column: 1 / -1; border-top: 0; padding-top: 0; }
.newspaper .reader-story.reader-story--lead h3 { margin-top: 8px; font-size: 42px; line-height: 1.28; }
.newspaper .reader-story.reader-story--lead > p:not(.story-tags):not(.editor-note) { font-size: 17px; line-height: 1.9; }
.newspaper .reader-story.reader-story--secondary h3 { font-size: 28px; line-height: 1.35; }
.newspaper .reader-story.reader-story--brief { padding-top: 12px; }
.newspaper .reader-story.reader-story--brief h3 { font-size: 20px; line-height: 1.45; }
.newspaper .reader-story.reader-story--brief > p:not(.story-tags):not(.editor-note) { font-size: 14px; line-height: 1.7; }
.newspaper p { line-height: 1.8; }
.report-link { display: block; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 20px; color: inherit; text-align: left; text-decoration: none; }
.report-link + .report-link { margin-top: 12px; }
.report-link:hover { border-color: var(--red); }
.report-link h2 { margin: 0; font: 700 23px/1.4 STSong, SimSun, serif; }
.report-link p { margin: 8px 0 0; color: var(--muted); }
.share-dialog { width: min(420px, calc(100vw - 48px)); align-items: center; text-align: center; }
.share-dialog > p { color: var(--muted); line-height: 1.6; }
.share-preview { position: relative; width: min(280px, 100%); aspect-ratio: 3 / 4; margin: 12px auto; overflow: hidden; border: 1px solid var(--line); background: #e8e2d6; }
.share-preview img { display: block; width: 100%; height: 100%; margin: 0; object-fit: contain; background: var(--paper); }
.share-preview-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 9px; background: rgba(248,245,235,.72); color: var(--muted); font-size: 14px; backdrop-filter: blur(5px); }
.share-spinner { width: 16px; height: 16px; border: 2px solid rgba(141,45,37,.24); border-top-color: var(--red); border-radius: 50%; animation: share-spinner-spin .8s linear infinite; }
@keyframes share-spinner-spin { to { transform: rotate(1turn); } }
.share-actions .outline-button[aria-disabled="true"] { pointer-events: none; opacity: .5; }
.share-close { position: absolute; top: 12px; right: 12px; }
.share-actions { display: grid; width: 100%; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-actions a { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.share-dialog .form-status { min-height: 20px; margin: 12px 0 0; overflow-wrap: anywhere; word-break: break-all; }
.nickname-dialog { width: min(448px, calc(100vw - 48px)); }
.nickname-dialog .dialog-kicker { margin: 0 0 8px; color: var(--red); font: 700 12px/18px "Microsoft YaHei", sans-serif; letter-spacing: .16em; }
.nickname-dialog h2 { margin: 0; font: 700 32px/40px STSong, SimSun, serif; }
.nickname-dialog > p:not(.dialog-kicker) { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 22px; }
.nickname-dialog-actions { justify-content: flex-end; }

@media (max-width: 1023px) {
  .login-layout, .entry-grid { grid-template-columns: 1fr; }
  .login-layout { height: auto; gap: 24px; }
  .paper-illustration { width: 100%; margin-left: 0; }
  .login-card { margin-top: 0; }
  .generate-form { min-height: 0; padding: 0; border: 0; }
  .report-preview { margin-top: 0; }
  .generate-actions { width: 100%; margin: 20px 0 0; }
}
@media (max-width: 767px) {
  .site-header, .site-footer, .login-layout, .entry-view, .reader-view, .reports-view { width: calc(100% - 48px); }
  .login-layout, .welcome-copy, .login-card, .code-row, .code-row input, .code-row button { min-width: 0; }
  .site-header { height: 79px; padding-top: 24px; }
  .brand { width: auto; height: 36px; font-size: 27px; line-height: 34px; }
  .brand b { width: 27px; height: 27px; font-size: 18px; line-height: 27px; }
  .brand-note { display: none; }
  .header-reading { display: none; }
  .account-nav { gap: 4px; }
  .account-nav .text-button { font-size: 14px; }
  .account-menu { width: 148px; }
  .welcome-copy { padding-top: 3px; }
  .eyebrow { display: none; }
  .welcome-copy h1, .entry-view h1, .reports-view h1 { margin: 12px 0 8px; font-size: 32px; line-height: 42px; }
  .paper-illustration { width: 342px; max-width: 100%; height: 176px; margin-top: 18px; }
  .paper-illustration span { padding: 35px 0 0 24px; }
  .paper-illustration strong { margin: 6px 0 0 24px; font-size: 29px; }
  .paper-illustration i { margin: 8px 0 0 24px; font-size: 12px; }
  .login-card { height: auto; min-height: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; padding: 0 0 70px; }
  .login-card h2 { font-size: 20px; line-height: 28px; }
  .login-card .rule { display: none; }
  .login-card label { margin: 14px 0 4px; font-size: 16px; line-height: 20px; }
  .login-card label[for="phoneInput"] { margin-top: 12px; }
  .login-card .field-error:empty { display: none; }
  .login-card .primary-button { margin-top: 28px; }
  .code-row { grid-template-columns: minmax(0,1fr) 124px; }
  .login-card::before { left: 0; right: 0; }
  .login-card::after { right: 0; }
  .site-footer { height: 84px; padding-top: 14px; }
  .site-footer .footer-sentence { display: none; }
  .entry-view { min-height: auto; padding-top: 16px; }
  .greeting { font-size: 25px; line-height: 34px; }
  .entry-grid { gap: 20px; margin-top: 18px; }
  .report-preview { min-height: 130px; padding: 16px; }
  .report-preview h2 { margin: 18px 0 8px; font-size: 26px; line-height: 34px; }
  .industry-dialog { align-self: end; width: 100%; max-height: min(624px, 84dvh); border-bottom: 0; border-radius: 20px 20px 0 0; padding: 24px 24px max(20px, env(safe-area-inset-bottom)); box-shadow: 0 -8px 32px rgba(35,40,32,.12); }
  .dialog-handle { display: block; width: 36px; height: 4px; margin: 0 auto 14px; border-radius: 4px; background: var(--line-dark); }
  .dialog-head h2 { font-size: 24px; line-height: 32px; }
  .search-field { margin: 14px 0 16px; }
  .industry-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; max-height: calc(84dvh - 298px); }
  .industry-option { min-height: 46px; padding: 6px 12px; font-size: 14px; }
  .empty-state { height: calc(84dvh - 298px); }
  .dialog-actions { margin-top: 20px; padding-top: 16px; }
  .dialog-actions .outline-button { display: none; }
  .dialog-actions .primary-button { width: 100%; }
  .newspaper { padding: 28px 18px; }
  .newspaper h1 { font-size: 30px; }
  .reading-group { margin-top: 30px; }
  .reading-group-stories--front-page, .reading-group-stories--industry, .reading-group-stories--briefs { grid-template-columns: 1fr; gap: 20px; }
  .newspaper .reader-story.reader-story--lead { grid-column: auto; }
  .newspaper .reader-story.reader-story--lead h3 { font-size: 32px; line-height: 1.32; }
  .newspaper .reader-story.reader-story--secondary h3 { font-size: 25px; }
  .newspaper .reader-story.reader-story--brief h3 { font-size: 22px; }
  .share-actions { grid-template-columns: 1fr; }
  .share-preview { width: min(248px, 100%); }
  .share-dialog, .nickname-dialog { padding: 32px 20px 24px; }
}
@media (max-width: 480px) {
}
@media (prefers-reduced-motion: reduce) {
  .generation-progress-ink { transition: none; }
  .generation-activity { animation: none; }
  .share-spinner { animation: none; }
}
@media (max-width: 359px) {
  .site-header, .site-footer, .login-layout, .entry-view, .reader-view, .reports-view { width: calc(100% - 32px); }
  .code-row { grid-template-columns: minmax(0,1fr) 110px; }
  .code-row .outline-button { padding-inline: 4px; font-size: 14px; }
}
