:root {
  --ink: #18201d;
  --muted: #6f7773;
  --line: #e6e7e2;
  --paper: #f7f6f1;
  --card: #ffffff;
  --accent: #ff6b35;
  --accent-dark: #df4e1c;
  --nav: #17201d;
  --green: #2e8b6a;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.app-shell { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 244px; z-index: 2;
  display: flex; flex-direction: column; padding: 32px 20px 24px;
  color: #fff; background: var(--nav);
}
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; margin: 0 8px 44px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--accent); font: 700 20px Georgia, serif; }
.brand strong { display: block; font-size: 17px; }
.brand small { display: block; margin-top: 4px; font-size: 8px; letter-spacing: 1.6px; color: #87908c; }
nav { display: grid; gap: 8px; }
.nav-item { border: 0; border-radius: 10px; padding: 13px 14px; text-align: left; color: #aeb6b2; background: transparent; }
.nav-item span { margin-right: 12px; }
.nav-item.active { color: white; background: #2a3430; }
.nav-item:disabled { cursor: default; opacity: .7; }
.nav-item em { float: right; font-size: 9px; font-style: normal; color: #66716c; }
.privacy-note { margin-top: auto; display: flex; gap: 10px; padding: 14px; border: 1px solid #34413c; border-radius: 12px; background: #202b27; }
.privacy-note > span { color: #62c79c; font-size: 10px; }
.privacy-note strong, .privacy-note small { display: block; }
.privacy-note strong { font-size: 12px; }
.privacy-note small { margin-top: 5px; color: #7e8984; font-size: 10px; line-height: 1.4; }

main { grid-column: 2; width: min(1180px, calc(100vw - 244px)); padding: 44px 52px 72px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: 2px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font: 700 32px Georgia, "Songti SC", serif; }
.primary-button, .secondary-button, .text-button, .icon-button { border: 0; }
.primary-button { padding: 12px 18px; border-radius: 10px; color: white; background: var(--accent); font-weight: 700; box-shadow: 0 8px 18px #ff6b3526; }
.primary-button:hover { background: var(--accent-dark); }
.primary-button:disabled { cursor: wait; opacity: .6; }
.primary-button span { margin-right: 6px; }
.secondary-button { padding: 11px 18px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stats article { display: flex; align-items: center; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.stat-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; font-weight: 800; }
.stat-icon.amber { color: #a86b00; background: #fff0cb; }
.stat-icon.green { color: #187453; background: #dff4e9; }
.stat-icon.blue { color: #315da8; background: #e4ecfb; }
.stats small, .stats strong { display: block; }
.stats small { color: var(--muted); font-size: 11px; }
.stats strong { margin-top: 4px; font-size: 23px; }

.library-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; }
.library-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 26px; border-bottom: 1px solid var(--line); }
.library-toolbar h2 { margin-bottom: 6px; font-size: 17px; }
.library-toolbar p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.search-box { display: flex; align-items: center; gap: 8px; width: 280px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; color: #929894; background: #fafaf8; }
.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; }
.interview-list { display: grid; }
.interview-row { display: grid; grid-template-columns: 1fr auto; gap: 18px; padding: 20px 26px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s ease; }
.interview-row:last-child { border-bottom: 0; }
.interview-row:hover { background: #faf9f5; }
.interview-row h3 { margin-bottom: 8px; font-size: 15px; }
.interview-row p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.row-meta { display: flex; gap: 10px; align-items: center; }
.badge { display: inline-flex; padding: 5px 8px; border-radius: 999px; color: #29654f; background: #e4f3ec; font-size: 10px; }
.badge.pending { color: #98651b; background: #fff1d6; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { padding: 3px 7px; border-radius: 5px; color: #68716d; background: #f0f1ed; font-size: 10px; }
.empty-state { padding: 66px 20px; text-align: center; }
.empty-state > span { display: block; margin-bottom: 15px; color: var(--accent); font-size: 28px; }
.empty-state h3 { margin-bottom: 8px; font: 700 19px Georgia, serif; }
.empty-state p { color: var(--muted); font-size: 12px; }
.text-button { color: var(--accent); background: transparent; font-weight: 700; }

.detail-panel { margin-top: 24px; padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.detail-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.detail-head h2 { margin-bottom: 8px; font: 700 24px Georgia, "Songti SC", serif; }
.detail-head p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.detail-actions { display: flex; align-items: start; gap: 8px; }
.source-box { margin: 22px 0; padding: 16px; border-radius: 12px; background: #f7f7f3; }
.source-box strong { display: block; margin-bottom: 6px; font-size: 12px; }
.source-box p, .source-box a { margin: 0; color: var(--muted); font-size: 12px; word-break: break-all; }
.qa-title { display: flex; justify-content: space-between; align-items: end; margin: 25px 0 14px; }
.qa-title h3 { margin: 0; font-size: 15px; }
.qa-title small { color: var(--muted); }
.qa-list { display: grid; gap: 12px; }
.qa-card { padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
.qa-card.needs-review { border-left: 3px solid #e9a637; }
.qa-card label { display: block; margin-bottom: 13px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .8px; }
.qa-card input, .qa-card textarea { display: block; width: 100%; margin-top: 6px; padding: 9px 0; border: 0; border-bottom: 1px solid var(--line); outline: 0; color: var(--ink); background: transparent; }
.qa-card textarea { min-height: 84px; resize: vertical; line-height: 1.65; }
.original-copy { margin-top: 24px; }
.original-copy summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.original-copy pre { overflow: auto; max-height: 320px; padding: 16px; border-radius: 10px; background: #f7f7f3; white-space: pre-wrap; font: 12px/1.7 ui-monospace, monospace; }

#detail-panel[hidden], #empty-state[hidden] { display: none; }
dialog { width: min(680px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 30px 80px #10151255; }
dialog::backdrop { background: #10151299; backdrop-filter: blur(3px); }
dialog form { padding: 28px; }
.dialog-header, .dialog-actions { display: flex; justify-content: space-between; align-items: center; }
.dialog-header { margin-bottom: 24px; }
.dialog-header h2 { margin: 0; font: 700 24px Georgia, serif; }
.icon-button { width: 34px; height: 34px; border-radius: 50%; color: var(--muted); background: #f2f2ee; font-size: 21px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: block; color: #4f5753; font-size: 11px; font-weight: 700; }
.form-grid input, .form-grid textarea, .form-grid select { width: 100%; margin-top: 7px; padding: 11px 12px; border: 1px solid #dfe1dc; border-radius: 9px; outline: 0; background: #fbfbf9; }
.form-grid input:focus, .form-grid textarea:focus, .form-grid select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #ff6b3514; }
.form-grid textarea { resize: vertical; line-height: 1.6; }
.form-grid small { display: block; margin-top: 6px; color: var(--muted); font-weight: 400; }
.dialog-actions { justify-content: flex-end; gap: 10px; margin-top: 24px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; transform: translateY(20px); padding: 12px 16px; border-radius: 9px; color: white; background: #26322e; opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: #a53b31; }

.muted { color: var(--muted); font-size: 12px; }
@media (max-width: 880px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 18px 20px; flex-direction: row; align-items: center; }
  .brand { margin: 0; }
  .sidebar nav, .privacy-note { display: none; }
  main { width: 100%; padding: 28px 20px 60px; }
  .stats { grid-template-columns: 1fr; }
  .library-toolbar { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
}

@media (max-width: 560px) {
  .topbar { align-items: flex-start; gap: 18px; }
  h1 { font-size: 25px; }
  .primary-button { padding: 11px 13px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .detail-head { flex-direction: column; }
  .detail-actions { flex-wrap: wrap; }
  .interview-row { grid-template-columns: 1fr; }
}

.processing-box { display: flex; align-items: flex-start; gap: 11px; margin: -8px 0 22px; padding: 14px 16px; border: 1px solid #dbe9e2; border-radius: 11px; background: #f0f8f4; }
.processing-box.failed { border-color: #f0d2cc; background: #fff4f1; }
.processing-box strong { display: block; margin-bottom: 4px; font-size: 12px; }
.processing-box p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.processing-dot { flex: 0 0 auto; width: 9px; height: 9px; margin-top: 3px; border-radius: 50%; background: var(--green); }
.processing-box.failed .processing-dot { background: #c65043; }
.processing-dot.pulse { animation: processing-pulse 1.3s ease-in-out infinite; }
@keyframes processing-pulse { 50% { transform: scale(1.5); opacity: .45; } }
.nav-link { display: block; text-decoration: none; }
.detail-page { max-width: 1180px; }
.detail-page-topbar { margin-bottom: 18px; }
.back-link { display: inline-flex; align-items: center; color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: none; }
.back-link:hover { color: var(--accent); }
.detail-panel-page { margin-top: 0; padding: 34px; }
.qa-card { padding: 24px; }
.qa-card label { font-size: 12px; }
.qa-card .qa-question, .qa-card .qa-answer { padding: 12px 0; font-size: 16px; line-height: 1.8; }
.qa-card .qa-question { min-height: 104px; font-size: 17px; font-weight: 650; line-height: 1.7; }
.qa-card .qa-answer { min-height: 150px; }
@media (max-width: 560px) {
  .detail-panel-page { padding: 22px 16px; }
  .qa-card { padding: 18px 15px; }
  .qa-card .qa-question, .qa-card .qa-answer { font-size: 16px; }
}
.topbar-actions, .detail-page-topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.user-chip { max-width: 150px; overflow: hidden; color: #45504b; font-size: 13px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.logout-button { padding: 8px; color: var(--muted); }
.dialog-tip { margin: -12px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.user-list { display: grid; gap: 8px; max-height: 180px; margin-bottom: 20px; overflow: auto; }
.user-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 13px; border-radius: 9px; background: #f7f7f3; }
.user-row strong, .user-row small { display: block; }
.user-row strong { font-size: 13px; }
.user-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.user-row em { color: var(--green); font-size: 10px; font-style: normal; font-weight: 800; }
.auth-body { min-height: 100vh; background: radial-gradient(circle at 75% 10%, #ffe8dd 0, transparent 30%), var(--paper); }
.auth-shell { display: grid; min-height: 100vh; place-items: center; padding: 28px; }
.auth-card { width: min(460px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: 0 24px 70px #18201d14; }
.auth-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 38px; }
.auth-brand strong, .auth-brand small { display: block; }
.auth-brand strong { font-size: 17px; }
.auth-brand small { margin-top: 4px; color: var(--muted); font-size: 8px; letter-spacing: 1.4px; }
.auth-form h1 { margin-bottom: 10px; font-size: 28px; }
.auth-form > p:not(.eyebrow) { margin-bottom: 24px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.auth-form label { display: block; margin-top: 15px; color: #4f5753; font-size: 12px; font-weight: 700; }
.auth-form input { width: 100%; margin-top: 7px; padding: 12px 13px; border: 1px solid #dfe1dc; border-radius: 10px; outline: 0; background: #fbfbf9; }
.auth-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #ff6b3514; }
.auth-submit { width: 100%; margin-top: 24px; }
.auth-switch { margin: 18px 0 0 !important; color: var(--muted); font-size: 12px !important; text-align: center; }
.auth-switch button { padding: 0; border: 0; color: var(--accent); background: transparent; font-weight: 800; cursor: pointer; }
.auth-switch button:hover { color: var(--accent-dark); text-decoration: underline; }
.auth-security { margin: 26px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; text-align: center; }
.auth-error { color: #a53b31; }
@media (max-width: 700px) {
  .topbar, .topbar-actions { align-items: flex-start; flex-wrap: wrap; }
  .topbar-actions { justify-content: flex-end; }
  .auth-card { padding: 28px 22px; }
}
.detail-summary { min-width: 0; }
.metadata-form { margin: 20px 0 24px; padding: 20px; border: 1px solid #f0d5ca; border-radius: 12px; background: #fffaf7; }
.metadata-form[hidden] { display: none; }
.metadata-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

@media (max-width: 700px) {
  .metadata-form { padding: 16px; }
  .metadata-actions { align-items: stretch; flex-direction: column-reverse; }
  .metadata-actions button { width: 100%; }
}
.save-status { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.save-status > span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.save-status.saved { color: #23795c; background: #e4f3ec; }
.save-status.unsaved { color: #98651b; background: #fff1d6; }
.save-status.saving { color: #315da8; background: #e4ecfb; }
.save-status.saving > span { animation: processing-pulse 1.2s ease-in-out infinite; }
.save-status.failed { color: #a53b31; background: #fdeae7; }

.detail-panel.has-unsaved .qa-card:focus-within { border-color: #e9c9a0; }
.metadata-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.metadata-facts span { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fafaf8; font-size: 12px; }
.metadata-facts small { color: var(--muted); font-size: 10px; }
.metadata-facts a { align-self: center; color: var(--accent); font-size: 12px; font-weight: 700; text-decoration: none; }
.metadata-facts a:hover { text-decoration: underline; }

.qa-review { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.qa-review summary { cursor: pointer; color: var(--ink); font-size: 13px; font-weight: 700; }
.qa-review summary span { margin-left: 8px; color: var(--muted); font-size: 11px; font-weight: 400; }
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.review-grid .full { grid-column: 1 / -1; }
.review-grid label { display: block; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .6px; }
.review-grid textarea { min-height: 92px; margin-top: 8px; padding: 11px 12px; border: 1px solid #e2e3de; border-radius: 9px; outline: 0; background: #fbfbf9; font-size: 14px; line-height: 1.7; resize: vertical; }
.review-grid select { margin-top: 8px; padding: 10px 12px; border: 1px solid #e2e3de; border-radius: 9px; outline: 0; background: #fbfbf9; }
.review-grid textarea:focus, .review-grid select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #ff6b3514; }
.review-grid textarea, .review-grid select { width: 100%; color: var(--ink); font-weight: 400; letter-spacing: normal; }

@media (max-width: 700px) {
  .review-grid { grid-template-columns: 1fr; }
  .save-status { width: 100%; justify-content: center; }
}
.qa-title { align-items: center; gap: 16px; }
.qa-title-actions { display: flex; align-items: center; gap: 10px; }
.metadata-actions { align-items: center; }
.metadata-actions .save-status { margin-right: auto; }

@media (max-width: 700px) {
  .qa-title { align-items: stretch; flex-direction: column; }
  .qa-title-actions { flex-direction: column; align-items: stretch; }
  .qa-title-actions button { width: 100%; }
  .metadata-actions .save-status { margin-right: 0; }
}

/* 投递追踪 */
.application-stats { grid-template-columns: repeat(4, 1fr); }
.stat-icon.violet { color: #704aa0; background: #eee6f8; }
.application-toolbar { align-items: flex-end; }
.application-tools { display: flex; align-items: center; gap: 10px; }
.filter-box { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #fafaf8; font-size: 11px; font-weight: 700; white-space: nowrap; }
.filter-box select { border: 0; outline: 0; color: var(--ink); background: transparent; }
.source-strip { display: flex; align-items: center; gap: 10px; padding: 12px 26px; border-bottom: 1px solid var(--line); background: #fffaf7; font-size: 11px; }
.source-strip > span { padding: 3px 7px; border-radius: 5px; color: #9a512e; background: #ffe9de; font-weight: 800; }
.source-strip a { color: var(--accent); font-weight: 800; text-decoration: none; }
.source-strip small { color: var(--muted); }
.application-list { display: grid; }
.application-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; padding: 22px 26px; border-bottom: 1px solid var(--line); }
.application-row:last-child { border-bottom: 0; }
.application-row:hover { background: #fdfcf9; }
.application-row-main { min-width: 0; }
.application-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.application-heading h3 { margin-bottom: 7px; font-size: 16px; }
.application-heading p { max-width: 760px; margin-bottom: 0; color: #46504c; font-size: 13px; line-height: 1.65; white-space: pre-line; }
.status-control { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; }
.status-control select { max-width: 116px; border: 0; outline: 0; color: inherit; background: transparent; font-size: 11px; font-weight: 800; }
.status-control.pending { color: #98651b; background: #fff1d6; }
.status-control.active-status { color: #315da8; background: #e4ecfb; }
.status-control.success { color: #187453; background: #dff4e9; }
.status-control.muted-status { color: #717773; background: #eceeeb; }
.application-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.application-meta span { display: inline-flex; gap: 5px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; color: #47504c; background: white; font-size: 11px; }
.application-meta small { color: var(--muted); }
.application-industry { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.application-notes { max-width: 820px; margin: 11px 0 0; padding: 9px 11px; border-left: 3px solid #e9d4c8; color: #59615d; background: #faf7f4; font-size: 11px; line-height: 1.6; white-space: pre-line; }
.application-row-actions { display: flex; flex: 0 0 118px; align-items: flex-end; flex-direction: column; gap: 5px; }
.compact-button { display: inline-flex; justify-content: center; min-width: 82px; padding: 7px 9px; font-size: 11px; text-decoration: none; }
.danger-button { color: #a53b31; }
.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; }
#application-empty[hidden] { display: none; }
#application-dialog textarea { width: 100%; }
@media (max-width: 1100px) {
  .application-stats { grid-template-columns: repeat(2, 1fr); }
  .application-toolbar { align-items: stretch; flex-direction: column; }
  .application-tools { align-items: stretch; }
}
@media (max-width: 700px) {
  .application-tools { flex-direction: column; }
  .filter-box, .application-tools .search-box { width: 100%; }
  .filter-box select { flex: 1; }
  .source-strip { align-items: flex-start; flex-wrap: wrap; padding: 12px 18px; }
  .source-strip small { flex-basis: 100%; }
  .application-row { grid-template-columns: 1fr; padding: 20px 18px; }
  .application-heading { align-items: stretch; flex-direction: column; }
  .status-control { align-self: flex-start; }
  .application-row-actions { align-items: stretch; flex-basis: auto; flex-direction: row; flex-wrap: wrap; }
  .compact-button { min-width: auto; }
}
@media (max-width: 480px) {
  .application-stats { grid-template-columns: 1fr; }
}
/* 备案号页脚 */
.site-footer { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; padding: 24px 16px 20px; font-size: 12px; color: #8a8a80; background: #fbfbf9; border-top: 1px solid #e2e3de; }
.site-footer i { color: #cfd0ca; margin: 0 4px; font-style: normal; }
.site-footer a { color: #8a8a80; text-decoration: none; font-weight: 600; }
.site-footer a:hover { color: #ff6b35; text-decoration: underline; }
.site-footer span { color: #8a8a80; font-weight: 600; }
