:root {
  --ink: #17202a;
  --ink-soft: #53606d;
  --paper: #f4f1e9;
  --surface: #fffdf8;
  --surface-2: #ece8de;
  --line: #d9d3c6;
  --accent: #d54b2f;
  --accent-dark: #9e301d;
  --teal: #176b64;
  --navy: #1c3048;
  --gold: #a87916;
  --shadow: 0 18px 50px rgba(35, 30, 23, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 28px 18px 20px; color: #e9edf1; background:
  radial-gradient(circle at 5% 10%, rgba(213, 75, 47, .22), transparent 32%),
  linear-gradient(155deg, #17283c, #111c2b 72%);
}
.brand { display: flex; align-items: center; gap: 12px; margin: 0 8px 38px; }
.brand strong { display: block; font-family: Georgia, "Noto Serif SC", serif; font-size: 21px; letter-spacing: .04em; }
.brand span { display: block; margin-top: 3px; color: #8090a3; font-size: 9px; letter-spacing: .18em; }
.brand-mark {
  display: grid; width: 58px; height: 58px; place-items: center; color: white; background: var(--accent);
  border-radius: 50% 50% 50% 12px; font: 700 28px Georgia, serif; box-shadow: 0 12px 28px rgba(213, 75, 47, .3);
}
.brand-mark.small { width: 40px; height: 40px; border-radius: 50% 50% 50% 9px; font-size: 21px; }
.sidebar-label { margin: 26px 12px 8px; color: #728297; font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.nav-list, .topic-nav { display: grid; gap: 4px; }
.nav-item {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border: 0; border-radius: 9px; color: #aeb9c7; background: transparent;
  text-align: left; cursor: pointer; transition: .16s ease;
}
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.active { color: white; background: rgba(255,255,255,.11); box-shadow: inset 3px 0 var(--accent); }
.nav-item b { min-width: 25px; padding: 2px 7px; color: #c3ced9; background: rgba(255,255,255,.08); border-radius: 99px; font-size: 11px; text-align: center; }
.nav-item.subtle { justify-content: flex-start; color: #8796a7; margin-top: 5px; }
.topic-nav .nav-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid rgba(255,255,255,.09); color: #7f8fa2; font-size: 11px; }
.provider-state { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #8796a7; }
.status-dot.on { background: #64c7a3; box-shadow: 0 0 0 4px rgba(100,199,163,.1); }
.text-button { padding: 0; border: 0; color: #8fa0b3; background: none; cursor: pointer; }
.text-button:hover { color: white; }

.workspace { width: 100%; max-width: 1440px; padding: 40px clamp(24px, 4vw, 64px) 70px; overflow: hidden; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .2em; }
h1, h2, h3 { font-family: Georgia, "Noto Serif SC", "Songti SC", serif; }
h1 { margin: 0; font-size: clamp(31px, 4vw, 47px); font-weight: 500; line-height: 1.08; }
h2 { margin: 0; font-size: 25px; }
.top-actions, .dialog-buttons { display: flex; gap: 10px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px;
  padding: 9px 15px; border: 1px solid transparent; border-radius: 8px; font-weight: 700;
  text-decoration: none; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button.primary { color: white; background: var(--accent); box-shadow: 0 8px 20px rgba(213,75,47,.2); }
.button.primary:hover { background: var(--accent-dark); }
.button.ghost { border-color: var(--line); color: var(--ink); background: rgba(255,253,248,.62); }
.button.compact { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.button.full { width: 100%; }
.sync-icon { display: inline-block; font-size: 18px; }
.is-spinning .sync-icon { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); border: 1px solid var(--line); border-radius: 13px; background: rgba(255,253,248,.66); overflow: hidden; }
.stats article { position: relative; min-height: 114px; padding: 20px 22px; border-right: 1px solid var(--line); }
.stats article:last-child { border: 0; }
.stats span, .stats small { display: block; color: var(--ink-soft); font-size: 11px; }
.stats strong { display: block; margin: 5px 0 2px; font: 500 30px Georgia, serif; }
.stats article::after { content: ""; position: absolute; left: 22px; bottom: 0; width: 34px; height: 3px; background: var(--accent); }
.stats article:nth-child(3)::after { background: var(--gold); }
.stats article:nth-child(4)::after { background: var(--teal); }

.toolbar { display: flex; align-items: center; gap: 14px; margin: 24px 0 16px; }
.toolbar > select { max-width: 150px; padding: 10px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); background: var(--surface); font-size: 11px; }
.search-box { flex: 1; display: flex; align-items: center; gap: 9px; min-width: 200px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.search-box span { color: var(--ink-soft); font-size: 21px; }
.search-box input { width: 100%; padding: 12px 0; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-box button { padding: 7px 10px; border: 1px solid #d8a89a; border-radius: 7px; color: var(--accent); background: #fff6f2; font-size: 10px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.search-box button:hover { color: white; background: var(--accent); }
.search-box button:disabled { opacity: .55; cursor: wait; }
.switch-label { display: flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 12px; white-space: nowrap; }
.export-menu { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.export-menu a { padding: 10px 12px; color: var(--ink-soft); border-right: 1px solid var(--line); font-size: 11px; font-weight: 700; text-decoration: none; }
.export-menu a:last-child { border: 0; }
.export-menu a:hover { color: var(--accent); }

.sync-notice, .alert { padding: 11px 14px; margin-bottom: 14px; border: 1px solid #b8d0cc; border-radius: 8px; color: #165a54; background: #e8f4f1; font-size: 12px; }
.alert.success { border-color: #9fc9b0; color: #155c38; background: #e8f6ed; }
.alert.danger { color: #832b21; border-color: #e3afa6; background: #fce9e5; }
.paper-list { display: grid; gap: 10px; }
.external-search-results { margin: 0 0 16px; padding: 18px; border: 1px solid #b7cec9; border-radius: 11px; background: #eff7f5; }
.external-search-results > header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.external-search-results h2 { margin-top: 3px; font-size: 20px; }
.external-search-warning { margin: -3px 0 12px; padding: 8px 10px; border-radius: 7px; color: #765119; background: #fff3d8; font-size: 10px; }
.external-result-list { display: grid; gap: 8px; }
.external-paper-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 15px; align-items: center; padding: 14px; border: 1px solid #c8d9d5; border-radius: 9px; background: white; }
.external-paper-card h3 { margin: 3px 0 6px; font-size: 14px; line-height: 1.4; }
.external-paper-card h3 a { color: var(--ink); text-decoration: none; }
.external-paper-card h3 a:hover { color: var(--accent); }
.external-paper-card p { margin: 5px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.55; }
.external-paper-card .external-meta { color: #37746d; font-size: 9px; }
.compact-empty { padding: 25px; }
.paper-card {
  position: relative; display: grid; grid-template-columns: 86px minmax(0,1fr) auto; gap: 19px;
  align-items: center; padding: 19px 20px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface); cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.paper-card:hover { border-color: #b9afa0; box-shadow: 0 9px 30px rgba(42,35,27,.08); transform: translateY(-1px); }
.score-ring {
  --sweep: 0%; display: grid; width: 67px; height: 67px; place-items: center; border-radius: 50%;
  background: radial-gradient(closest-side, var(--surface) 78%, transparent 80% 100%), conic-gradient(var(--accent) var(--sweep), var(--surface-2) 0);
}
.score-tier-0 { --sweep: 0%; } .score-tier-1 { --sweep: 10%; }
.score-tier-2 { --sweep: 20%; } .score-tier-3 { --sweep: 30%; }
.score-tier-4 { --sweep: 40%; } .score-tier-5 { --sweep: 50%; }
.score-tier-6 { --sweep: 60%; } .score-tier-7 { --sweep: 70%; }
.score-tier-8 { --sweep: 80%; } .score-tier-9 { --sweep: 90%; }
.score-tier-10 { --sweep: 100%; }
.score-ring strong { display: block; margin-top: 5px; font: 700 18px Georgia,serif; text-align: center; line-height: 1; }
.score-ring small { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 8px; letter-spacing: .08em; }
.paper-title { margin: 0 0 7px; font: 600 17px/1.35 Georgia, "Noto Serif SC", serif; }
.paper-meta { display: flex; flex-wrap: wrap; gap: 5px 11px; color: var(--ink-soft); font-size: 11px; }
.paper-abstract { display: -webkit-box; overflow: hidden; margin: 10px 0 0; color: #59636b; font-size: 12px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { padding: 3px 7px; border: 1px solid #d6d0c5; border-radius: 99px; color: #59636b; background: #f7f4ed; font-size: 9px; font-weight: 700; }
.chip.code { color: var(--teal); border-color: #a8c9c4; background: #edf7f5; }
.chip.publication { color: #714d08; border-color: #d9c28d; background: #fff7df; }
.chip.reproduction { color: #405e95; border-color: #b7c5df; background: #f0f4fb; }
.chip.code-status-link_only { color: #8a2f21; border-color: #e2afa6; background: #fcece8; }
.chip.code-status-partial { color: #7a5a13; border-color: #dac692; background: #fff8e5; }
.chip.code-status-usable, .chip.code-status-verified { color: var(--teal); border-color: #a8c9c4; background: #edf7f5; }
.card-actions { display: grid; gap: 7px; min-width: 95px; }
.quick-state { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-soft); background: transparent; font-size: 10px; cursor: pointer; }
.quick-state:hover { color: var(--accent); border-color: #dba092; }
.star-button { position: absolute; top: 12px; right: 13px; border: 0; color: #a79f92; background: transparent; font-size: 19px; cursor: pointer; }
.star-button.active { color: #c58d20; }
.empty-state { padding: 70px 20px; border: 1px dashed #c8c0b2; border-radius: 12px; text-align: center; }
.empty-state p { color: var(--ink-soft); }
.empty-orbit { color: var(--accent); font-size: 50px; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(18,22,27,.42); backdrop-filter: blur(2px); }
.drawer {
  position: fixed; top: 0; right: 0; z-index: 21; width: min(860px, 96vw); height: 100vh;
  background: var(--surface); box-shadow: -20px 0 60px rgba(16,22,29,.22); transform: translateX(102%);
  transition: transform .22s ease; overflow: auto;
}
.drawer.open { transform: translateX(0); }
.drawer-header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; padding: 15px 22px; border-bottom: 1px solid var(--line); background: rgba(255,253,248,.94); backdrop-filter: blur(10px); }
.drawer-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--surface); font-size: 20px; cursor: pointer; }
.drawer-content { padding: 30px clamp(24px,5vw,54px) 70px; }
.drawer-content h1 { font-size: clamp(28px,4vw,39px); line-height: 1.16; }
.drawer-content h3 { margin: 29px 0 10px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 18px; }
.detail-meta { margin: 14px 0 20px; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.abstract-box { padding: 18px; border-left: 3px solid var(--accent); color: #3e4851; background: #f3efe6; font: 14px/1.72 Georgia, "Noto Serif SC", serif; }
.detail-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0; }
.detail-controls label { display: grid; gap: 5px; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.detail-controls select, .wide-input, .topic-row input, .topic-row textarea {
  width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; outline: 0;
}
.analysis-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 30px; }
.analysis-header h2 { font-size: 23px; }
.analysis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.analysis-card { padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: #faf8f2; }
.analysis-card.wide { grid-column: 1/-1; }
.analysis-card label { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.analysis-card p, .analysis-card li { color: #49545e; font-size: 12px; line-height: 1.65; }
.analysis-card ul { margin: 8px 0 0; padding-left: 18px; }
.analysis-notice { margin-top: 14px; padding: 15px 17px; border: 1px solid #b8d0cc; border-radius: 9px; color: #165a54; background: #e8f4f1; font-size: 12px; line-height: 1.65; }
.analysis-notice.warning { border-color: #e2bd82; color: #704912; background: #fff5df; }
.legacy-analysis { opacity: .82; }
.deep-analysis { margin-top: 10px; }
.analysis-section { padding: 30px 0 26px; border-bottom: 1px solid var(--line); }
.analysis-section h3 { margin: 4px 0 16px; padding: 0; border: 0; font-size: 22px; }
.analysis-section .analysis-grid { margin-top: 12px; }
.section-kicker { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.hero-analysis { padding-top: 20px; }
.hero-analysis > p { max-width: 74ch; color: #38444d; font: 14px/1.78 Georgia, "Noto Serif SC", serif; }
.lead-sentence { margin: 0 0 15px; color: #25323c; font: 600 16px/1.6 Georgia, "Noto Serif SC", serif; }
.io-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.io-grid > div { padding: 13px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.io-grid small, .module-operation > small { color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.io-grid p { margin: 6px 0 0; color: #3e4952; font-size: 12px; line-height: 1.6; }
.io-grid.prominent { margin-bottom: 10px; }
.io-grid.prominent > div:first-child { border-top: 3px solid #b95e45; }
.io-grid.prominent > div:last-child { border-top: 3px solid #397d75; }
.pipeline-flow { display: grid; gap: 8px; counter-reset: step; }
.pipeline-step { position: relative; display: grid; grid-template-columns: 38px 1fr; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #faf8f2; }
.pipeline-step:not(:last-child)::after { content: "↓"; position: absolute; left: 27px; bottom: -13px; z-index: 1; color: var(--accent); font-weight: 800; }
.pipeline-step > span { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 50%; color: white; background: var(--accent); font: 700 12px Georgia,serif; }
.pipeline-step strong { font-size: 13px; }
.pipeline-step p { margin: 5px 0; color: #4a555e; font-size: 11px; line-height: 1.55; }
.pipeline-step p b { color: #22303a; }
.pipeline-step small { color: var(--ink-soft); font-size: 10px; }
.module-list { display: grid; gap: 13px; }
.module-card { padding: 19px; border: 1px solid #d8d0c3; border-radius: 10px; background: linear-gradient(140deg,#fff 0%,#faf7f0 100%); box-shadow: 0 3px 10px rgba(31,38,43,.04); }
.module-card header { display: flex; align-items: baseline; gap: 11px; margin-bottom: 8px; }
.module-card header span { color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.module-card h4, .figure-card h4, .innovation-list h4 { margin: 0; font-size: 15px; }
.module-card > p, .module-operation p { color: #46525b; font-size: 12px; line-height: 1.68; }
.module-motivation { padding-left: 11px; border-left: 2px solid #dca08f; }
.module-operation { margin: 11px 0; padding: 13px 14px; border-radius: 8px; background: #f1eee6; }
.evidence-line { margin-bottom: 0; color: #7b6e60 !important; font-size: 10px !important; }
.figure-gallery { display: grid; gap: 18px; }
.figure-card { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.figure-card > a { display: block; padding: 10px; background: #e9e6df; }
.figure-card img { display: block; width: 100%; max-height: 660px; object-fit: contain; border-radius: 5px; background: white; }
.figure-copy { padding: 17px 19px 19px; }
.figure-copy > span { color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.figure-copy h4 { margin: 5px 0 10px; line-height: 1.45; }
.figure-copy p, .figure-copy li { color: #46525b; font-size: 12px; line-height: 1.65; }
.figure-disclaimer { color: var(--ink-soft); font-size: 10px; line-height: 1.55; }
.innovation-list { display: grid; gap: 9px; }
.innovation-list article { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #faf8f2; }
.innovation-list article > span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: var(--accent); background: #f4dfd8; font-weight: 800; }
.innovation-list p { margin: 6px 0; color: #46525b; font-size: 12px; line-height: 1.6; }
.innovation-list small { color: #7b6e60; font-size: 10px; }
.analysis-card em { display: block; color: #7b6e60; font-size: 10px; }
.evidence-footer { border-bottom: 0; }
.evidence-footer p, .evidence-footer li { color: #69737a; font-size: 11px; line-height: 1.6; }
.score-large { color: var(--accent); font: 600 35px Georgia,serif; }
.notes-area { width: 100%; min-height: 130px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
.notes-area.compact-notes { min-height: 82px; }
.quality-flags { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #faf8f2; }
.quality-flags label { color: var(--ink-soft); font-size: 11px; }

dialog { width: min(740px, 94vw); max-height: 86vh; padding: 0; border: 0; border-radius: 14px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(17,23,29,.54); backdrop-filter: blur(3px); }
.dialog-card { padding: 28px; overflow: auto; }
.dialog-card.narrow { max-width: 560px; margin: auto; }
.dialog-card.narrow > label { display: grid; gap: 6px; margin: 13px 0; }
.dialog-card.narrow > label.switch-label { display: flex; }
.dialog-card.narrow > label > select { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.topic-row { display: grid; grid-template-columns: 1fr 2fr; gap: 9px; margin: 13px 0; padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: #faf8f2; }
.topic-ai-builder { margin: 15px 0 18px; padding: 16px; border: 1px solid #b8d0cc; border-radius: 10px; background: #eef7f5; }
.topic-ai-builder > label { color: #286a63; font-size: 11px; font-weight: 800; }
.topic-ai-builder textarea { width: 100%; min-height: 92px; margin: 8px 0 10px; padding: 11px; border: 1px solid #b8d0cc; border-radius: 8px; resize: vertical; background: white; }
.topic-ai-builder > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.topic-ai-builder p { margin: 0; font-size: 10px; line-height: 1.5; }
.topic-row .wide { grid-column: 1/-1; }
.topic-row label, .dialog-card > label { color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.topic-row label { display: grid; gap: 5px; }
.topic-actions { grid-column: 1/-1; display: flex; align-items: center; justify-content: space-between; }
.dialog-buttons { justify-content: flex-end; margin-top: 18px; }
.muted { color: var(--ink-soft); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: 400px; padding: 12px 16px; border-radius: 8px; color: white; background: #1d2b37; box-shadow: var(--shadow); font-size: 12px; }
.current-user { display: grid; gap: 2px; margin-bottom: 10px; color: #e9edf0; }
.current-user strong { font-size: 11px; }
.current-user span { color: #82909c; font-size: 9px; }
.login-page { display: grid; min-height: 100vh; place-items: center; padding: 20px; background: radial-gradient(circle at 60% 15%, #fbe1d7, transparent 30%), var(--paper); }
.login-card { width: min(420px, 100%); padding: 43px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); }
.login-card.register-card { width: min(480px, 100%); }
.login-card .brand-mark { margin-bottom: 25px; }
.login-card h1 { font-size: 39px; }
.login-card > .muted { margin: 12px 0 27px; line-height: 1.65; }
.login-form { display: grid; gap: 9px; }
.login-form label { color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.login-form input { padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 8px; }
.login-form small { margin: -6px 0 7px; color: var(--ink-soft); font-size: 9px; }
.auth-switch { margin: 20px 0 0; color: var(--ink-soft); text-align: center; font-size: 11px; }
.auth-switch a { color: var(--accent); font-weight: 700; }
.user-admin-dialog { width: min(920px, 94vw); }
.user-admin-card { width: auto; }
.user-admin-list { display: grid; gap: 9px; }
.user-admin-row { display: grid; grid-template-columns: minmax(220px,1fr) 135px 135px auto; gap: 10px; align-items: end; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #faf8f2; }
.user-admin-row.status-pending { border-left: 3px solid #d99a2b; background: #fff9eb; }
.user-admin-row.status-disabled { opacity: .68; }
.user-identity { display: grid; gap: 3px; }
.user-identity strong { font-size: 13px; }
.user-identity span, .user-identity small { color: var(--ink-soft); font-size: 9px; }
.user-admin-row label { display: grid; gap: 5px; color: var(--ink-soft); font-size: 9px; font-weight: 700; }
.user-admin-row select { padding: 9px; border: 1px solid var(--line); border-radius: 7px; background: white; }

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 76px minmax(0,1fr); }
  .sidebar { padding-inline: 10px; }
  .brand { margin-inline: 7px; justify-content: center; }
  .brand > div:last-child, .nav-item span, .sidebar-label, .sidebar-footer, .nav-item.subtle { display: none; }
  .nav-item { justify-content: center; padding-inline: 6px; }
  .nav-item b { min-width: 30px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats article:nth-child(2) { border-right: 0; }
  .stats article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 660px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 13px 14px; flex-direction: row; align-items: center; overflow-x: auto; }
  .brand { margin: 0 8px 0 0; }
  .brand-mark.small { width: 34px; height: 34px; }
  .nav-list { display: flex; }
  .nav-list .nav-item span { display: inline; }
  .nav-list .nav-item b { display: none; }
  .nav-item { width: auto; white-space: nowrap; }
  .topic-nav, .sidebar > .nav-item, .sidebar-footer { display: none; }
  .workspace { padding: 25px 16px 55px; }
  .topbar { align-items: flex-start; }
  .top-actions { flex-direction: column-reverse; align-items: stretch; }
  .stats article { min-height: 96px; padding: 16px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar > select { flex: 1 1 140px; max-width: none; }
  .search-box { flex-basis: 100%; }
  .external-paper-card { grid-template-columns: 1fr; }
  .external-paper-card button { width: 100%; }
  .paper-card { grid-template-columns: 57px minmax(0,1fr); padding: 15px; gap: 12px; }
  .score-ring { width: 54px; height: 54px; }
  .card-actions { grid-column: 1/-1; grid-template-columns: repeat(3,1fr); }
  .star-button { top: 8px; right: 8px; }
  .paper-title { padding-right: 18px; font-size: 15px; }
  .analysis-grid { grid-template-columns: 1fr; }
  .analysis-card.wide { grid-column: auto; }
  .io-grid { grid-template-columns: 1fr; }
  .figure-card img { max-height: 480px; }
  .detail-controls { grid-template-columns: 1fr; }
  .quality-flags { grid-template-columns: 1fr; }
  .topic-row { grid-template-columns: 1fr; }
  .topic-row .wide, .topic-actions { grid-column: auto; }
  .topic-ai-builder > div { align-items: stretch; flex-direction: column; }
  .user-admin-row { grid-template-columns: 1fr 1fr; }
  .user-identity { grid-column: 1/-1; }
}
