/* PLANTOMIX 科研情报平台 */
:root {
  --bg: #F5F6F2; --surface: #FFFFFF; --surface-2: #EEF0EA; --line: #DDE1D6; --line-2: #CBD1C3;
  --ink: #1C2419; --ink-2: #3F4A3B; --muted: #66725F;
  --accent: #2F6B3A; --accent-ink: #FFFFFF; --accent-soft: #E3EEE2;
  --hot: #B42318; --hot-soft: #FDECEA; --warm: #9A5B00; --warm-soft: #FFF3DC;
  --blue: #23508F; --blue-soft: #E7EEF8; --violet: #5B3D8F; --violet-soft: #EFE9F7;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121611; --surface: #1A1F18; --surface-2: #222821; --line: #2E362B; --line-2: #3A4436;
    --ink: #E4E9E0; --ink-2: #C3CBBE; --muted: #96A28F;
    --accent: #7FC08A; --accent-ink: #0F1A10; --accent-soft: #1F3322;
    --hot: #FF8A80; --hot-soft: #3A1D1A; --warm: #F2B45A; --warm-soft: #33270F;
    --blue: #8DB4EA; --blue-soft: #1C2737; --violet: #BBA2E6; --violet-soft: #2A2238;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.6; font-size: 15px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.35; margin: 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.inline { display: inline; }

/* 顶栏 */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-in { display: flex; align-items: center; gap: 24px; min-height: 56px; }
.brand { display: flex; align-items: baseline; gap: 8px; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.mark { font-weight: 800; letter-spacing: .16em; font-size: 13px; color: var(--accent); }
.brand-sub { font-weight: 600; font-size: 15px; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--ink-2); padding: 7px 12px; border-radius: 8px; white-space: nowrap; font-size: 14.5px; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
@media (max-width: 640px) {
  .top-in { flex-direction: column; align-items: stretch; gap: 0; padding-top: 10px; }
  .brand { padding-bottom: 4px; }
  .nav { margin: 0 -16px; padding: 0 12px 8px; }
}

main.wrap { padding-top: 24px; padding-bottom: 40px; }
.foot { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; color: var(--muted);
  font-size: 12.5px; padding-top: 18px; padding-bottom: 32px; border-top: 1px solid var(--line); }

.notice { background: var(--warm-soft); color: var(--warm); border-radius: var(--radius); padding: 10px 14px;
  margin-bottom: 20px; font-size: 14px; }
.notice b { font-weight: 700; }

/* 首页 */
.hero h1 { font-size: 24px; margin-bottom: 16px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  color: var(--ink); display: flex; flex-direction: column; gap: 2px; }
.stat:hover { border-color: var(--accent); text-decoration: none; }
.stat b { font-size: 28px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat span { color: var(--muted); font-size: 13.5px; display: flex; flex-direction: column; }
.stat small { font-size: 12px; }
.stat-hot b { color: var(--hot); }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr; } .stat { flex-direction: row; align-items: baseline; gap: 12px; } }

.cols3 { display: grid; grid-template-columns: 1fr 1.3fr 1.3fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .cols3 { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.panel h2 { font-size: 16px; margin-bottom: 8px; }
.panel-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.panel-h a { font-size: 13.5px; }
.mini-list { list-style: none; padding: 0; margin: 0; }
.mini-list li { padding: 10px 0; border-top: 1px solid var(--line); }
.mini-list li:first-child { border-top: 0; }
.mini-list a { color: var(--ink); font-weight: 500; }
.mini-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 4px; font-size: 12.5px; color: var(--muted); }

/* 标签 */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.tag { display: inline-block; font-size: 12px; line-height: 1.6; padding: 0 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.tag-core { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tag-rel { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.tag-edge { background: var(--surface-2); color: var(--muted); }
.tag-sub { background: transparent; border: 1px solid var(--line-2); color: var(--ink-2); line-height: 1.5; }
.tag-level { background: var(--violet-soft); color: var(--violet); font-weight: 600; }
.tag-new { background: var(--warm-soft); color: var(--warm); font-weight: 600; }
.tag-warn { background: var(--hot-soft); color: var(--hot); }
.tag-sample { background: var(--warm-soft); color: var(--warm); border: 1px dashed var(--warm); line-height: 1.5; }

.due { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.due-warm { color: var(--warm); font-weight: 600; }
.due-hot { color: var(--hot); font-weight: 700; }
.due-past { color: var(--muted); text-decoration: line-through; }
.due-open { color: var(--muted); }

/* 列表页 */
.page-h { margin-bottom: 16px; }
.page-h h1 { font-size: 24px; }
.page-h p { margin: 4px 0 0; }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.f-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.f-row input[type=search], .f-row input[type=email], .f-row input:not([type]) { flex: 1 1 220px; }
input, select, button { font: inherit; }
input[type=search], input[type=email], input:not([type]), select, .save-note {
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); border-radius: 8px;
  padding: 7px 10px; min-height: 36px; font-size: 16px; }
@media (min-width: 641px) { input[type=search], input[type=email], input:not([type]), select, .save-note { font-size: 14px; } }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: 8px 16px; cursor: pointer;
  font-weight: 600; min-height: 36px; display: inline-flex; align-items: center; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn-line { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-size: inherit; }
.chips { border: 0; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chips legend { float: left; font-size: 12.5px; color: var(--muted); margin-right: 6px; padding: 0; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 3px 11px; border-radius: 999px; border: 1px solid var(--line-2);
  font-size: 13px; cursor: pointer; user-select: none; color: var(--ink-2); }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.f-toggles { margin-top: 12px; font-size: 13.5px; color: var(--ink-2); gap: 6px 18px; }
.clear { font-size: 13px; }
.count { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.empty { background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); }

.cards { display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  display: grid; grid-template-columns: 1fr 200px; gap: 16px; }
.card:hover { border-color: var(--line-2); }
.card-title { font-size: 17px; margin: 2px 0 2px; }
.card-title a { color: var(--ink); }
.orig { color: var(--muted); font-size: 13px; }
.meta { color: var(--ink-2); font-size: 13.5px; margin-top: 4px; }
.summary { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }
.card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; }
.pay b { font-size: 16px; font-variant-numeric: tabular-nums; }
.pay span { display: block; font-size: 12px; color: var(--muted); }
@media (max-width: 640px) {
  .card { grid-template-columns: 1fr; gap: 10px; }
  .card-side { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; text-align: left; border-top: 1px solid var(--line); padding-top: 10px; }
}

/* 收藏 */
.save { display: inline-flex; gap: 6px; align-items: center; }
.save-btn { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); border-radius: 8px;
  padding: 5px 12px; cursor: pointer; min-height: 34px; display: inline-flex; gap: 4px; align-items: center; font-size: 13.5px; }
.save-btn:hover { border-color: var(--accent); color: var(--accent); }
.save-btn.is-saved { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.save-status { min-height: 34px; padding: 4px 8px; }

/* 项目列表 */
.calls { display: flex; flex-direction: column; gap: 14px; }
.call { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.call-h { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.call-h h2 { font-size: 17px; margin: 2px 0; }
.dues { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0 4px; }
.items { list-style: none; margin: 0; padding: 0; }
.item { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item-title { font-weight: 600; margin-bottom: 4px; }
.item-title a { color: var(--ink); }
.code { display: inline-block; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; margin-right: 8px; font-size: .9em; }
.item .tags { margin-bottom: 2px; }
.item .meta { margin-top: 0; font-size: 13px; }
@media (max-width: 640px) { .item { flex-direction: column; align-items: flex-start; } }

/* 详情页 */
.back { display: inline-block; margin-bottom: 12px; font-size: 14px; }
.detail { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.detail h1 { font-size: 22px; margin: 4px 0 2px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 16px 0; }
.facts div { background: var(--surface); padding: 10px 12px; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; align-items: center; }
.actions .btn { min-height: 34px; padding: 5px 14px; font-size: 13.5px; }
.brief { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
.brief h2 { font-size: 16px; margin-bottom: 6px; }
.brief h2 small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.brief h3 { font-size: 14px; color: var(--muted); margin: 12px 0 2px; font-weight: 600; }
.brief p { margin: 0; }
.original { white-space: pre-wrap; color: var(--ink-2); font-size: 14px; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.sibs { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
@media (max-width: 640px) { .detail { padding: 16px; } }

/* 我的 / 管理 */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--accent); }
.tabs .n { font-size: 12px; color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.track { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.track th, .track td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.track th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.track tbody tr:last-child td { border-bottom: 0; }
.save-note { width: 100%; min-width: 140px; }
.copy-row { display: flex; gap: 8px; margin: 10px 0; }
.copy-row input { flex: 1; font-size: 13px; }

.health { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 10px; }
.h-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.h-item b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.h-item span { font-size: 12.5px; color: var(--muted); }
.h-异常 b { color: var(--hot); } .h-正常 b { color: var(--accent); } .h-未核验 b { color: var(--warm); }
@media (max-width: 640px) { .health { grid-template-columns: repeat(3, 1fr); } }
.hb { font-size: 12px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.hb-正常 { background: var(--accent-soft); color: var(--accent); }
.hb-异常 { background: var(--hot-soft); color: var(--hot); font-weight: 600; }
.hb-未核验 { background: var(--warm-soft); color: var(--warm); }

.denied { max-width: 520px; margin: 60px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.denied h1 { font-size: 20px; margin-bottom: 12px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg);
  padding: 8px 16px; border-radius: 8px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: .95; }

/* 登录 */
.auth-box { max-width: 420px; margin: 40px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.auth-box h1 { font-size: 22px; margin-bottom: 6px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin: 18px 0 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); }
.auth-form label.check { flex-direction: row; align-items: center; gap: 8px; }
.auth-form input[type=email], .auth-form input[type=password] { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  border-radius: 8px; padding: 9px 12px; font-size: 16px; min-height: 42px; }
.btn-block { justify-content: center; width: 100%; min-height: 42px; }
.form-error { background: var(--hot-soft); color: var(--hot); border-radius: 8px; padding: 9px 12px; font-size: 14px; margin-top: 12px; }
.form-ok { background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 9px 12px; font-size: 14px; margin-top: 8px; }
.panel.narrow { max-width: 480px; }
.panel-ok { border-color: var(--accent); }
.logout { margin-left: auto; }
.logout .link-btn { color: var(--muted); font-size: 14px; }
.row-actions { white-space: nowrap; }
.row-actions form + form { margin-left: 12px; }
@media (max-width: 640px) { .logout { position: absolute; right: 16px; top: 12px; } .top-in { position: relative; } }
