/* 专利预审台 · 阅读、操作和摄影区域各使用自己的色阶。 */
:root {
  --font: "Noto Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --display: "Noto Serif SC", "Songti SC", "Microsoft YaHei", serif;
  --canvas: #eef1f2; --surface: #fff; --surface-2: #f5f7f8;
  --text: #152a38; --muted: #465d6a; --accent: #18547a; --accent-soft: #e8f2f6;
  --line: #b8c8cf; --line-soft: #d5dfe2; --ok: #17644f; --ok-soft: #e8f5ee;
  --ink: #122b3b; --brass: #d0ac74; --radius-s: 6px;
  --shadow-1: 0 2px 5px #10293408, 0 8px 24px #10293407;
  --page-gutter: 24px;
}
html { font-size: 100%; }
body { font: 400 1rem/1.65 var(--font); color: var(--text); -webkit-font-smoothing: auto; }
button:active:not(:disabled) { transform: none; }
button.primary, #btn-new { background: var(--accent); border-color: var(--accent); }
button.primary:hover:not(:disabled), #btn-new:hover { background: #103e5d; filter: none; }
button, input, select, textarea { font-family: var(--font); }
button:focus-visible, a:focus-visible, summary:focus-visible, .case-card:focus-visible {
  outline: 3px solid #2474a4; outline-offset: 2px;
}
#work-view { grid-template-columns: 248px minmax(0,1fr); grid-template-rows: 68px auto minmax(0,1fr); }
#topbar {
  min-height: 68px; padding: 0 var(--page-gutter); gap: 25px; background: #102633;
  border-bottom: 1px solid #39515b; box-shadow: none; backdrop-filter: none;
}
#topbar .sidebar-brand { min-width: 210px; gap: 11px; padding-right: 22px; border-color: #3a5059; }
#topbar .sidebar-brand strong { font: 700 1.45rem/1.2 var(--display); letter-spacing: .04em; }
#topbar .brand-mark { color: #ebc485; }
#topbar .sidebar-brand small { font-size: .75rem; color: #d1dfe3; letter-spacing: .08em; }
.portal-nav { align-self: stretch; align-items: stretch; font-size: .94rem; gap: 20px; }
.portal-nav a, .portal-nav .current { display: flex; align-items: center; padding: 0 2px; }
.portal-nav .current { background: none; border-bottom: 3px solid var(--brass); }
.portal-nav a:hover { text-decoration: underline; }
#topbar .compare-link { background: transparent; border-color: #768a94; border-radius: 5px; }
#topbar :focus-visible { outline-color: #ffdaa0; }
#topbar #who, #topbar .top-link, #logout-btn { font-size: .875rem; }

.sidebar { background: #f9fbfb; border-color: var(--line-soft); }
.sidebar-head { padding-top: 18px; gap: 12px; }
#case-search { font-size: .94rem; padding: 9px 10px; background: white; border-color: #bacbd1; }
.sidebar-section, #case-filters .chip, .case-meta, .case-id { font-size: .8125rem; }
#case-filters .chip { padding: 4px 7px; color: #435d6b; }
#case-filters .chip.is-active { background: #dfeef3; color: #154d68; }
.case-card { background: white; border-radius: 7px; padding: 12px; }
.case-card.is-selected { background: #eaf3f6; border-color: #aac4ce; box-shadow: inset 3px 0 #236280; }
.case-title { color: #1a3645; font-size: .94rem; line-height: 1.65; }
.case-id, .sidebar .case-meta, .sidebar-footer, .sidebar .hint { color: #486170; }
.sidebar-footer { font-size: .8125rem; }
.info-bar { padding: 18px var(--page-gutter) 0; }
.case-heading {
  position: relative; isolation: isolate; overflow: hidden; align-items: start; border-radius: 9px 9px 0 0;
  padding: 18px 23px; gap: 15px; color: white; background: var(--ink); border: 1px solid #213c4b;
}
.case-heading::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none; inset: 0 0 0 auto; width: min(28%, 300px); opacity: .55;
  background: linear-gradient(90deg, var(--ink) 2%, transparent 38%), url("patent-projection-mulerun.webp") right 16px bottom -5px / auto 95% no-repeat;
}
.case-heading > div { min-width: 0; }
#design-kicker {
  color: #ffdaa0; font-family: var(--font); font-size: .8125rem; font-weight: 650;
  letter-spacing: .06em; margin: 0 0 5px;
}
#design-title { color: white; font: 650 clamp(1.55rem,2vw,2.15rem)/1.42 var(--display); letter-spacing: 0; text-wrap: pretty; }
#goal-badge { color: #ffe3b3; background: #142c38; border: 1px solid #a08a66; font-size: .8125rem; border-radius: 4px; margin: 0; }
#info-fields, #info-empty {
  border: 1px solid var(--line-soft); border-top: 0; border-bottom: 0; margin: 0;
  background: #fff; padding: 10px 17px; max-width: none;
}
#info-empty, .info-label, .info-value { font-size: .875rem; }
#info-fields { gap: 5px 16px !important; }
.info-label { color: var(--muted); }
.info-value { color: #193748; font-weight: 550; }
.stage-rail { padding: 0 var(--page-gutter) 16px; }
.timeline { padding: 12px 5px; border-radius: 0 0 9px 9px; box-shadow: var(--shadow-1); }
.timeline li { padding: 0 10px; column-gap: 8px; }
.timeline .tl-name { font-size: .875rem; font-weight: 650; color: #28404e; white-space: normal; line-height: 1.45; }
.timeline .tl-state { font-size: .8125rem; line-height: 1.55; }
.timeline .tl-dot { border-radius: 50%; }
.timeline .tl-dot::before { font-size: .8125rem; }
.timeline li.tl-done .tl-dot { border-color: #98c4b0; }
.timeline li.tl-done .tl-dot::before { font-size: 1rem; }
.work { padding: 0 var(--page-gutter) 18px; gap: 16px; }
.review-col, .action-col { border: 1px solid var(--line-soft); border-radius: 9px; box-shadow: var(--shadow-1); }
#review-tabs { background: white; gap: 15px; padding: 0 17px; min-height: 50px; }
.tab { font-size: .9375rem; color: #445b68; padding: 11px 2px; }
.tab.is-active { color: #133f58; border-bottom: 3px solid #9c7036; }
.tab.is-active:hover:not(:disabled) { border-bottom-color: #9c7036; }
.tab-body, .is-new-case .tab-body { padding: 21px; }
.action-head { background: #f7f8f7; min-height: 50px; padding: 12px 16px; }
.action-title { color: #1c3947; font-weight: 650; font-size: 1.0625rem; }
.action-body { padding: 16px; }
.action-col { flex-basis: 330px; width: 330px; }
.is-new-case .action-col { flex-basis: clamp(345px,29vw,520px); width: clamp(345px,29vw,520px); }
.design-metrics { gap: 0; background: #f4f7f7; border: 1px solid #d6e1e3; border-radius: 7px; margin-bottom: 14px; }
.design-metric { background: transparent; border: 0; border-radius: 0; position: relative; padding: 12px 18px; }
.design-metric + .design-metric::before { content: ""; position: absolute; inset: 16% auto 16% 0; width: 1px; background: #c9d7da; }
.design-metric strong { font: 600 2.25rem/1.18 Georgia, var(--display); color: #163847; margin-top: 5px; }
.design-metric span, .design-metric small { color: #465f68; font: 500 .875rem/1.55 var(--font); }
.sec-title { font-size: 1.0625rem; color: #173644; padding-left: 12px; margin: 18px 0 10px; }
.sec-title::before { top: .3em; height: 1em; background: #a8793f; }
.kv { background: #f6f8f9; border-color: #d9e2e4; }
.kv b, .tag, .issue-no, .issue-sub, .adj-no, .adj-opt-desc,
#goal-badge, .upload-filenames, .design-checklist small { font-size: .8125rem; }
.kv span, .issue-body, .quote-block, .reason-list, pre, pre.doc, .warn-item,
.gate-sec, .adj-body, #status-line, .summary div, .design-result-task strong,
.design-intro > p, .design-checklist b, .design-checklist p, .adj-opt { font-size: 1rem; }
.issue-body, .quote-block, .reason-list, .warn-item, .gate-sec, pre, pre.doc { line-height: 1.85; }
.tab-pane > p, pre.doc, #stmt-text, .quote-block { overflow-wrap: anywhere; }
pre, pre.doc { font-family: var(--font); background: #f6f8f8; }
#result-panel h2, .design-intro h2 { font: 650 1.5rem/1.55 var(--display); color: #183644; }
.info-details, .info-details summary, details > summary, .fold > summary,
#form-panel label, #gate-panel label, .summary b, .anchor-table, .map-table,
#downloads button, #downloads a, .design-result-task p, .c-job-brief > div,
#audit-scope-box .audit-line, #audit-scope-box .audit-group, #audit-scope-box .audit-note { font-size: .9375rem; }
.hint, .text-entry > summary, .c-job-brief b { font-size: .875rem; color: #485e6b; }
#form-panel input, #form-panel textarea, #form-panel select, #gate-panel input, #gate-panel select,
#gate-panel textarea, .warn-item textarea, #run-btn, #resume-btn { font-size: 1rem; }
#form-panel label, #gate-panel label { color: #314a58; }
input:not([type="checkbox"],[type="radio"]), select, textarea { border-color: #b2c2ca; }
input[type=file] { color: #243e4c; background: #f3f7f8; }
input[type=file]::file-selector-button { color: #174b67; border-color: #b5cbd5; }
.design-result-task { background: #fcf6e9; border: 1px solid #dbc498; border-left: 3px solid #a7783b; }
.design-result-task button { border-color: #a98c5b; color: #59441e; font-weight: 550; }
#downloads { background: #eff5f6; border-color: #ccdddf; }
#downloads button { color: #164b64; }
.design-document-icon { color: #876633; background: #f5f0e7; }
.design-checklist { max-width: 670px; }
.design-checklist > div { border-bottom-color: var(--line-soft); }
button:disabled { opacity: .68; }

.auth-shell { display: none; }
.auth-shell:has(#login-view:not([hidden]), #setup-view:not([hidden])) {
  display: grid; grid-template-columns: minmax(0,1.3fr) minmax(335px,.85fr); align-items: stretch;
  max-width: 1280px; min-height: min(740px,86svh); margin: clamp(24px,7vh,80px) auto;
  background: white; border-radius: 13px; border: 1px solid #c9d5da; overflow: hidden;
  box-shadow: 0 20px 65px #12273916;
}
.auth-shell .auth-visual {
  position: relative; inset: auto; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 430px; padding: clamp(26px,3.7vw,58px); color: white;
  background-color: #0f2231;
  background-image: linear-gradient(0deg, #0a1c2be8, #0a1c2b38 33%, transparent 68%),
                    linear-gradient(90deg, #0b223659, transparent 65%), url("patent-assembly-mulerun.webp");
  background-position: center, center, 67% 43%; background-size: cover; background-repeat: no-repeat;
}
.auth-brand { display: flex; align-items: center; gap: 12px; font: 650 1.25rem/1.5 var(--display); letter-spacing: .08em; }
.auth-brand .brand-mark { margin: 0; color: #f4cd87; }
.auth-visual h2 { color: white; font: 650 clamp(2.4rem,4.2vw,4.4rem)/1.28 var(--display); letter-spacing: .025em; margin-bottom: 15px; }
.auth-visual p { color: #edf1f2; font-size: 1rem; max-width: none; margin: 0; }
#setup-view, #login-view {
  position: static; align-self: center; padding: clamp(26px,3.8vw,62px); margin: 0;
  width: 100%; max-width: none; background: white; border: 0; border-radius: 0; box-shadow: none;
}
#setup-view h1, #login-view h1 { color: #172f40; font: 650 2rem/1.5 var(--display); margin: 0 0 1.75rem; }
#setup-view label, #login-view label { font-size: .9375rem; color: #213c4a; }
#setup-view input, #login-view input { min-height: 46px; font-size: 1rem; }
#setup-view button, #login-view button { min-height: 46px; font-size: 1rem; }
#setup-msg:not(:empty), #login-msg:not(:empty) { color: #9b3325; margin-top: 12px; }
@media (min-width: 1800px) {
  html { font-size: 112.5%; }
  #work-view { grid-template-columns: 285px minmax(0,1fr); }
  .work { gap: 22px; }
  .action-col { width: 390px; flex-basis: 390px; }
  .tab-body { padding: 24px 28px; }
}
@media (max-width: 1320px) {
  :root { --page-gutter: 16px; }
  #work-view { grid-template-columns: 212px minmax(0,1fr); }
  #topbar .sidebar-brand { min-width: 178px; }
  .work { gap: 12px; }
  .action-col { width: 292px; flex-basis: 292px; }
  .timeline li { padding: 0 6px; gap: 0 6px; }
  .auth-shell:has(#login-view:not([hidden]), #setup-view:not([hidden])) { margin-inline: 4vw; }
}
@media (max-width: 1100px), (max-height: 660px) {
  #work-view { height: auto; min-height: 100dvh; }
  .main, .work, .tab-body, .action-body { overflow: visible; }
  .work { flex-direction: column; }
  .review-col { flex: none; min-height: 240px; }
  .action-col, .is-new-case .action-col { flex: none; width: 100%; }
  .action-col { order: -1; }
  .is-new-case .action-col { order: 0; }
  .timeline { grid-template-columns: repeat(3,minmax(0,1fr)); row-gap: 12px; }
  .timeline li:nth-child(3) { border: 0; }
}
@media (max-width: 800px) {
  #work-view { grid-template-columns: 190px minmax(0,1fr); }
  #topbar { gap: 12px; }
  #topbar .sidebar-brand { min-width: auto; }
  .case-heading { display: block; padding: 16px; }
  #goal-badge { display: inline-block; margin-top: 8px; }
  .auth-shell:has(#login-view:not([hidden]), #setup-view:not([hidden])) {
    grid-template-columns: minmax(0,1fr); max-width: 580px; margin: 24px auto; min-height: auto;
  }
  .auth-shell .auth-visual { min-height: 225px; background-position: center, center, right 25%; background-size: cover, cover, auto 117%; padding: 24px; gap: 28px; }
  .auth-visual h2 { font-size: 2rem; }
  #setup-view, #login-view { padding: 25px; }
}
@media (max-width: 720px) {
  :root { --page-gutter: 12px; }
  .case-heading::before { display: none; }
  #topbar { padding: 10px 14px; min-height: 86px; }
  #topbar .sidebar-brand { gap: 9px; }
  #topbar .sidebar-brand strong { font-size: 1.25rem; }
  #topbar .sidebar-brand small { font-size: .75rem; }
  .portal-nav { gap: 10px; }
  .portal-nav a, .portal-nav .current { padding: 4px 2px; font-size: .8125rem; }
  #topbar .compare-link, #topbar #logout-btn { font-size: .8125rem; }
  .info-bar { padding-top: 14px; }
  #design-title { font-size: 1.45rem; }
  .stage-rail { padding-bottom: 12px; }
  .timeline { row-gap: 13px; }
  .timeline li { grid-template-columns: 20px minmax(0, 1fr); }
  .timeline .tl-dot { width: 20px; height: 20px; }
  .timeline .tl-name { font-size: .8125rem; }
  .timeline .tl-state { font-size: .75rem; }
  #info-fields, #info-empty { padding: 10px; }
  #review-tabs { gap: 12px; }
  .tab { font-size: .875rem; }
  .tab-body, .is-new-case .tab-body { padding: 14px; }
  .design-metric { padding: 10px; }
  .design-metric strong { font-size: 1.75rem; }
  .design-metric span, .design-metric small { font-size: .8125rem; }
  .auth-shell:has(#login-view:not([hidden]), #setup-view:not([hidden])) { margin: 12px; }
}
@media (forced-colors: active) {
  .case-heading, .auth-shell .auth-visual { background: Canvas; color: CanvasText; }
  .case-heading::before { display: none; }
  .tab.is-active { border-bottom-color: Highlight; }
}
