/* Scientific Data 知识库全站样式。使用说明：无需构建工具，由 Django staticfiles 直接发布。 */
:root {
  --ink: #13231f;
  --muted: #68746f;
  --paper: #f5f3ed;
  --surface: #fffefa;
  --line: #dcded8;
  --green: #0d6b55;
  --green-dark: #07503f;
  --mint: #dff0e9;
  --lime: #d6eb75;
  --amber: #b67526;
  --red: #a33c36;
  --shadow: 0 12px 30px rgba(21, 42, 35, .07);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 5%, rgba(214, 235, 117, .18), transparent 24rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.62;
}
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }
button, input, select, textarea { font: inherit; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 76px; display: flex; align-items: center; gap: 34px;
  padding: 0 max(28px, calc((100vw - 1440px) / 2));
  background: rgba(255, 254, 250, .92); backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(19, 35, 31, .09);
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand-mark, .login-emblem {
  display: grid; place-items: center; background: var(--green); color: white; font-family: Georgia, serif;
  font-weight: 700; letter-spacing: -.06em;
}
.brand-mark { width: 39px; height: 39px; border-radius: 11px 11px 11px 3px; }
.brand span:last-child { display: flex; flex-direction: column; line-height: 1.12; }
.brand strong { font-family: Georgia, "Times New Roman", serif; font-size: 18px; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .12em; margin-top: 3px; }
.topbar nav { display: flex; height: 100%; align-items: center; gap: 6px; }
.topbar nav a { color: #4c5a55; padding: 9px 13px; border-radius: 10px; font-size: 14px; }
.topbar nav a:hover, .topbar nav a.active { color: var(--green); background: var(--mint); }
.logout-form { margin: 0; }
.link-button { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 8px; }

.page-shell { width: min(1380px, calc(100% - 48px)); margin: 0 auto; padding: 50px 0 80px; }
.auth-shell { width: 100%; min-height: 100vh; padding: 40px 20px; display: grid; place-items: center; }
.page-heading { margin-bottom: 28px; }
.page-heading h1 { font-family: Georgia, "Songti SC", serif; font-size: clamp(34px, 4vw, 54px); line-height: 1.12; margin: 5px 0 8px; letter-spacing: -.025em; }
.page-heading > p:last-child { color: var(--muted); margin: 0; max-width: 720px; }
.heading-with-action { display: flex; justify-content: space-between; align-items: end; gap: 30px; }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .18em; margin: 0 0 4px; text-transform: uppercase; }
.muted, .english-title { color: var(--muted); }
.english-title { font-family: Georgia, "Times New Roman", serif; font-size: 15px; line-height: 1.45; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 17px;
  border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-weight: 700; font-size: 14px;
  transition: transform .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--green); box-shadow: 0 7px 16px rgba(13, 107, 85, .18); }
.button.primary:hover { background: var(--green-dark); }
.button.ghost { color: var(--green); border-color: #b8c9c2; background: transparent; }
.button.wide { width: 100%; }

.messages { margin-bottom: 20px; }
.message { padding: 12px 15px; border-radius: 10px; background: var(--mint); border: 1px solid #b5d5c9; }
.message.error { color: #772b27; background: #fbe8e6; border-color: #efc2be; }

.login-card {
  width: min(460px, 100%); padding: 48px; border: 1px solid var(--line); border-radius: 26px;
  background: rgba(255, 254, 250, .95); box-shadow: 0 24px 80px rgba(18, 51, 41, .12);
}
.login-emblem { width: 58px; height: 58px; border-radius: 16px 16px 16px 4px; font-size: 22px; margin-bottom: 28px; }
.login-card h1 { font-family: Georgia, "Songti SC", serif; font-size: 38px; line-height: 1.1; margin: 8px 0 14px; }
.stack-form { display: grid; gap: 8px; margin-top: 28px; }
.stack-form label { font-size: 13px; font-weight: 700; margin-top: 7px; }
.stack-form input { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 10px; padding: 0 13px; background: white; }
.stack-form .button { margin-top: 15px; }

.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card { min-height: 150px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.stat-card span { color: var(--muted); font-size: 13px; }
.stat-card strong { font-family: Georgia, serif; font-size: 40px; line-height: 1.1; margin: auto 0 3px; }
.stat-card small { color: #8a938f; font-size: 11px; letter-spacing: .04em; }
.stat-card.accent { color: white; background: var(--green); border-color: var(--green); }
.stat-card.accent span, .stat-card.accent small { color: rgba(255,255,255,.72); }
.stat-card.warning strong { color: var(--amber); }
.dashboard-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; margin-bottom: 20px; }
.lower-grid { grid-template-columns: 1fr 1fr; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 15px; margin-bottom: 18px; }
.panel h2, .content-section h2 { font-family: Georgia, "Songti SC", serif; margin: 0; font-size: 24px; }
.panel-heading a { font-size: 13px; }
.chart-panel { min-height: 390px; }
.bar-chart { display: grid; gap: 9px; }
.scroll-chart { max-height: 315px; overflow: auto; padding-right: 7px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 46px; gap: 12px; align-items: center; font-size: 12px; }
.bar-row > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #53605b; }
.bar-row > div { height: 9px; border-radius: 5px; background: #e9ece8; overflow: hidden; }
.bar-row i { display: block; height: 100%; width: var(--bar); border-radius: inherit; background: linear-gradient(90deg, var(--green), #4ca083); }
.bar-row b { text-align: right; }
.rank-list { list-style: none; padding: 0; margin: 0; }
.rank-list li { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid #e8e9e4; }
.rank-list li:last-child { border-bottom: 0; }
.rank-list li b { font-family: Georgia, serif; }

.filter-panel { background: var(--surface); border: 1px solid var(--line); padding: 18px; border-radius: var(--radius); box-shadow: var(--shadow); }
.search-row { display: flex; gap: 10px; }
.search-row input { flex: 1; min-width: 0; height: 48px; padding: 0 15px; border: 1px solid #cfd5d1; border-radius: 11px; background: #fff; }
.search-row input:focus, select:focus, textarea:focus, input:focus { outline: 3px solid rgba(13, 107, 85, .14); border-color: var(--green); }
.filter-grid { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 12px; margin-top: 15px; align-items: end; }
.filter-grid label { color: var(--muted); font-size: 11px; font-weight: 700; }
.filter-grid select { display: block; width: 100%; height: 39px; margin-top: 5px; border: 1px solid var(--line); border-radius: 9px; background: white; padding: 0 8px; color: var(--ink); }
.filter-grid .check-label { display: flex; align-items: center; gap: 6px; height: 39px; color: var(--ink); }
.results-toolbar { display: flex; justify-content: space-between; align-items: center; margin: 28px 2px 14px; color: var(--muted); }
.results-toolbar p { margin: 0; }
.results-toolbar div { display: flex; gap: 16px; font-size: 13px; }
.paper-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.paper-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; min-height: 320px; display: flex; flex-direction: column; box-shadow: 0 5px 18px rgba(22, 45, 37, .035); transition: transform .18s, box-shadow .18s; }
.paper-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.paper-card h2 { font-family: Georgia, "Songti SC", serif; font-size: 21px; line-height: 1.3; margin: 16px 0 8px; }
.paper-card h2 a { color: var(--ink); }
.paper-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.abstract-preview { color: #46534e; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 15px; }
.chips span, .status { background: #edf1ee; color: #50605a; border-radius: 999px; padding: 4px 9px; font-size: 10px; font-weight: 700; }
.status.approved { color: var(--green-dark); background: var(--mint); }
.status.needs_review { color: #7b4a12; background: #f7e7c9; }
.repository-line { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 12px; color: var(--green); }
.pagination { margin-top: 28px; display: flex; align-items: center; justify-content: center; gap: 25px; font-size: 14px; }

.detail-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.detail-actions > div { display: flex; gap: 8px; }
.inline-form { display: inline; }
.detail-hero { padding: 42px; color: white; background: linear-gradient(130deg, #074c3e, #10735b 70%, #3b826d); border-radius: 24px; box-shadow: 0 22px 50px rgba(4, 65, 50, .18); }
.detail-hero h1 { font-family: Georgia, "Songti SC", serif; font-size: clamp(32px, 4vw, 52px); line-height: 1.16; margin: 18px 0 12px; max-width: 1050px; }
.detail-en-title { color: rgba(255,255,255,.75); font-family: Georgia, serif; font-size: 19px; max-width: 1000px; }
.authors { color: rgba(255,255,255,.83); }
.hero-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 22px; }
.hero-links a { color: var(--lime); font-size: 13px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; margin-top: 25px; align-items: start; }
.detail-main { display: grid; gap: 18px; }
.content-section { padding: 31px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.content-section > p:last-child { color: #34423d; }
.content-section.secondary { background: #eef2ee; }
.content-section.source-section p:last-child { font-size: 14px; color: #53605c; }
.dataset-card { margin-top: 20px; padding: 24px; border: 1px solid #cfdad5; border-radius: 15px; background: #fbfcf8; }
.dataset-head { display: flex; justify-content: space-between; gap: 15px; }
.dataset-head > div > span { font-size: 10px; color: var(--green); font-weight: 800; letter-spacing: .14em; }
.dataset-card h3 { font-family: Georgia, "Songti SC", serif; font-size: 23px; line-height: 1.25; margin: 5px 0; }
.confidence { color: var(--muted); font-size: 11px; white-space: nowrap; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; margin: 22px 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.field-grid > div { padding: 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.field-grid dt, .detail-sidebar dt { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.field-grid dd { margin: 3px 0 0; font-size: 13px; }
.repo-stack h4 { margin: 0 0 8px; font-size: 13px; }
.repo-stack a { display: grid; grid-template-columns: 130px minmax(0, 1fr) 20px; gap: 10px; padding: 10px 12px; border-radius: 9px; background: var(--mint); margin: 6px 0; font-size: 12px; }
.repo-stack a span { color: #50605a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.repo-stack a i { font-style: normal; text-align: right; }
details { margin-top: 18px; }
summary { color: var(--green); cursor: pointer; font-size: 12px; font-weight: 700; }
.evidence-list div { margin: 10px 0; }.evidence-list dt { font-weight: 700; }.evidence-list dd { margin: 2px 0; color: var(--muted); font-size: 12px; }
.detail-sidebar { position: sticky; top: 96px; display: grid; gap: 16px; }
.detail-sidebar section { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; }
.detail-sidebar h3 { font-family: Georgia, "Songti SC", serif; margin: 0 0 13px; }
.detail-sidebar dl { display: grid; grid-template-columns: 90px 1fr; gap: 9px; margin: 0; }
.detail-sidebar dd { margin: 0; font-size: 12px; overflow-wrap: anywhere; }

.edit-form { display: grid; gap: 20px; max-width: 1050px; }
.form-section h2 { margin-bottom: 17px; }
.form-section form { display: block; }
.form-section > div, .dataset-form > div { display: grid; gap: 5px; margin-bottom: 14px; }
.form-section label { font-size: 12px; font-weight: 800; color: #4f5c57; }
.form-section input:not([type="checkbox"]), .form-section select, .form-section textarea { width: 100%; border: 1px solid #cbd2ce; border-radius: 9px; padding: 9px 11px; background: white; }
.form-section input[type="checkbox"] { width: 18px; height: 18px; }
.form-section .errorlist { color: var(--red); margin: 0; font-size: 12px; }
.dataset-form { margin-top: 13px; }
.dataset-form h3 { font-family: Georgia, serif; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.sticky-actions { position: sticky; bottom: 15px; display: flex; justify-content: flex-end; gap: 9px; padding: 12px; background: rgba(255,254,250,.92); border: 1px solid var(--line); border-radius: 13px; backdrop-filter: blur(14px); }

.quality-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.quality-card { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); display: flex; flex-direction: column; }
.quality-card:hover, .quality-card.active { border-color: var(--green); box-shadow: 0 0 0 2px rgba(13,107,85,.08); }
.quality-card span { color: var(--muted); font-size: 12px; }
.quality-card strong { font-family: Georgia, serif; font-size: 32px; margin-top: 10px; }
.table-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 10px; letter-spacing: .08em; color: var(--muted); background: #eef1ed; }
th, td { padding: 13px 15px; border-bottom: 1px solid #e5e7e2; vertical-align: top; }
td:first-child { min-width: 360px; }td:first-child a { color: var(--ink); font-weight: 700; }td:first-child small { display: block; color: var(--muted); margin-top: 4px; }
.empty { color: var(--muted); text-align: center; padding: 25px; }
.empty-state { grid-column: 1 / -1; padding: 70px 20px; text-align: center; border: 1px dashed #bbc5c0; border-radius: 16px; color: var(--muted); }
.empty-state strong { color: var(--ink); font-size: 20px; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .paper-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-grid { grid-template-columns: repeat(3, 1fr); }
  .quality-grid { grid-template-columns: repeat(3, 1fr); }
  .topbar nav a { padding-inline: 8px; }
}
@media (max-width: 760px) {
  .topbar { height: auto; min-height: 68px; padding: 12px 18px; flex-wrap: wrap; gap: 8px; }
  .brand { width: calc(100% - 55px); }.topbar nav { order: 3; width: 100%; overflow-x: auto; }.topbar nav a { white-space: nowrap; }
  .page-shell { width: min(100% - 28px, 1380px); padding-top: 30px; }
  .heading-with-action { align-items: start; flex-direction: column; }
  .stat-grid, .dashboard-grid, .lower-grid, .paper-grid, .quality-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 120px; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .search-row { flex-wrap: wrap; }.search-row input { flex-basis: 100%; }
  .detail-hero { padding: 28px 22px; }.detail-layout { grid-template-columns: 1fr; }.detail-sidebar { position: static; }
  .field-grid { grid-template-columns: 1fr; }.repo-stack a { grid-template-columns: 100px minmax(0,1fr) 18px; }
  .detail-actions { align-items: start; gap: 12px; }.detail-actions > div { flex-wrap: wrap; justify-content: end; }
  .login-card { padding: 30px 24px; }
  .bar-row { grid-template-columns: 80px 1fr 38px; }
}
