:root {
  --bg: #f4f6f4;
  --surface: #ffffff;
  --surface-2: #fafbfa;
  --ink: #16211c;
  --ink-2: #3c4a43;
  --muted: #6d7a74;
  --faint: #97a29c;
  --line: #e3e8e4;
  --line-strong: #d2dad4;
  --head-bg: #e5ece7;
  --accent: #2f7a52;
  --accent-ink: #235e3f;
  --accent-soft: #eaf3ed;
  --accent-line: #c3ddcd;
  --warn: #b4690e;
  --warn-soft: #fdf3e5;
  --danger: #b3382c;
  --danger-soft: #fceeec;
  --side: #12211a;
  --side-ink: #cfdcd4;
  --side-muted: #7f9188;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(18, 33, 26, .06), 0 8px 24px -16px rgba(18, 33, 26, .28);
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font: 400 13.5px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------------- 侧边栏 ---------------- */
.sidebar {
  background: var(--side);
  color: var(--side-ink);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 22px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(150deg, #3f9a68, #276b47);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  display: grid;
  place-items: center;
  letter-spacing: .5px;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 14px; font-weight: 600; color: #eef5f1; letter-spacing: .3px; }
.brand-text span { font-size: 10.5px; color: var(--side-muted); letter-spacing: .8px; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav a {
  display: block;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--side-ink);
  text-decoration: none;
  font-size: 13.5px;
  position: relative;
  transition: background .12s, color .12s;
}

.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: rgba(63, 154, 104, .18); color: #fff; font-weight: 500; }
.nav a.active::before {
  content: "";
  position: absolute;
  left: 0; top: 9px; bottom: 9px;
  width: 2px;
  border-radius: 2px;
  background: #56b381;
}

/* ---------------- 侧边栏二级菜单 ---------------- */
.nav-group { display: flex; flex-direction: column; gap: 2px; }

.nav-parent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--side-ink);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.nav-parent:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-parent.open { color: #fff; }
.nav-caret { flex: none; opacity: .65; transition: transform .15s; }
.nav-parent.open .nav-caret { transform: rotate(180deg); opacity: 1; }

.nav-sub {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-left: 9px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, .13);
}
/* display:flex 会盖掉浏览器对 [hidden] 的默认 display:none，收起时必须显式隐藏 */
.nav-sub[hidden] { display: none; }
.nav-sub a { padding: 7px 10px; font-size: 13px; }
.nav-sub a.active { background: rgba(63, 154, 104, .18); color: #fff; font-weight: 500; }
.nav-sub a.active::before { top: 7px; bottom: 7px; }

/* ---------------- 主区 ---------------- */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.crumb { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); }
.crumb .sep { color: var(--faint); }
.crumb strong { color: var(--ink); font-weight: 600; }

.content { padding: 24px 26px 72px; width: 100%; min-width: 0; }

/* ---------------- 通用元件 ---------------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.page-head h1 { font-size: 19px; font-weight: 600; margin: 0; letter-spacing: -.2px; }
.page-head h1 + p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.page-head p { margin: 0; color: var(--muted); font-size: 12.5px; }
.page-actions { display: flex; align-items: center; gap: 8px; }

.btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { border-color: var(--faint); background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 500;
}
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-quiet {
  background: transparent;
  border-color: rgba(255, 255, 255, .16);
  color: var(--side-ink);
}
.btn-quiet:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .26); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: #e6b7b1; }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-link {
  border: none; background: none; color: var(--accent); cursor: pointer;
  font: inherit; font-size: 12.5px; padding: 0;
}
.btn-link:hover { text-decoration: underline; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.card-head h2 { font-size: 13.5px; font-weight: 600; margin: 0; }
.card-body { padding: 16px; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 15px;
}
.stat .k { font-size: 11.5px; color: var(--muted); margin-bottom: 5px; }
.stat .v {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.4px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stat .v small { font-size: 11.5px; font-weight: 400; color: var(--faint); margin-left: 3px; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow: auto; border-radius: var(--radius); }
table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}
table.data th, table.data td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}
table.data thead th {
  background: var(--surface-2);
  font-weight: 600;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: .2px;
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--line-strong);
}
table.data tbody tr:hover { background: #f8faf8; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data td.num { font-variant-numeric: tabular-nums; text-align: right; }
table.data thead th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.mono, table.data .mono { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
table.data .col-check { width: 34px; }
table.data td.col-check, table.data th.col-check { padding-right: 2px; text-align: center; }
table.data input[type=checkbox] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
  vertical-align: middle;
}
table.data tr.selected { background: var(--accent-soft); }
table.data tr.selected:hover { background: #e2eee7; }

/* ---------------- 可展开的测试项目行 ---------------- */
.proj-cell { display: flex; align-items: flex-start; gap: 8px; }
.proj-name { font-weight: 500; white-space: normal; }
.row-toggle {
  flex: none;
  width: 20px;
  height: 20px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.row-toggle:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }
.row-toggle.open { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }

.link-num {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  cursor: pointer;
}
.link-num:hover { text-decoration: underline; }

/* ---------------- 数据管理：品种信息 + 明细合成一张表（单行表头） ---------------- */
.grid-wrap { max-height: calc(100vh - 272px); }

table.data.grid {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
  border-collapse: separate;
}
table.data.grid th,
table.data.grid td { padding: 8px 10px; }
table.data.grid thead th { white-space: nowrap; }
table.data.grid td.wrap { white-space: normal; }
table.data.grid td.num { text-align: right; }

/* 品种信息区与明细区之间的分界 */
table.data.grid th.detail-start,
table.data.grid td.detail-start { border-left: 1px solid var(--line-strong); }

/* 性状列 */
table.data.grid .t-no { color: var(--faint); font-size: 11px; margin-right: 6px; }
table.data.grid .t-unit { color: var(--faint); font-size: 11px; margin-left: 3px; }
table.data.grid .v-name { font-weight: 500; }

/* 合并分类的「类型」列：个体 / 群体、异株个体 / 异株群体 */
table.data.grid th.type-th,
table.data.grid td.type-cell,
table.data.tgrid th.type-th,
table.data.tgrid td.type-cell {
  text-align: center;
  white-space: nowrap;
}
table.data.grid .type-tag,
table.data.tgrid .type-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 9px;
  background: rgba(47, 122, 82, .1);
  color: var(--accent);
  font-size: 11.5px;
  line-height: 1.6;
}

/* 第 N 株列：偶数列铺一点点底色做纵向分隔（用渐变叠色，不挡行高亮） */
table.data.grid .band {
  background-image: linear-gradient(rgba(47, 122, 82, .045), rgba(47, 122, 82, .045));
}

/* 品种信息区：浅底 + 顶部对齐，读起来像贴在明细左侧的一块信息面板 */
table.data.grid td.sum,
table.data.grid td.cell-fix,
table.data.grid td.cell-fix2 {
  vertical-align: top;
  background-color: var(--surface-2);
}
table.data.grid td.cell-fix,
table.data.grid td.cell-fix2 {
  position: sticky;
  z-index: 1;
  box-shadow: 1px 0 0 var(--line);
}
table.data.grid td.cell-fix { left: 0; }
table.data.grid td.cell-fix2 { left: 36px; }
table.data.grid thead th.cell-fix,
table.data.grid thead th.cell-fix2 {
  position: sticky;
  z-index: 3;
}
table.data.grid thead th.cell-fix { left: 0; }
table.data.grid thead th.cell-fix2 { left: 36px; }

/* 操作列固定在右侧，横向滚动时编辑 / 删除始终可点 */
table.data.grid td.col-act,
table.data.grid thead th.col-act {
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--surface);
  box-shadow: -1px 0 0 var(--line);
}
table.data.grid thead th.col-act { z-index: 3; }

table.data.grid tbody tr.hover > td { background-color: #f1f6f2; }
table.data.grid tbody tr:hover > td { background-color: #f1f6f2; }
table.data.grid tbody tr.selected > td { background-color: var(--accent-soft); }
table.data.grid tbody tr.selected:hover > td { background-color: #e2eee7; }

/* 每个品种一块：块与块之间用一条实线分开 */
table.data.grid tbody tr.block-start > td { border-top: 1px solid var(--line-strong); }

/* 没有明细时的一句说明，横向占满明细区 */
table.data.grid td.grid-note {
  white-space: normal;
  color: var(--faint);
  font-size: 12px;
  vertical-align: top;
}

/* 操作列按钮：两列并排也要塞得进固定列宽 */
table.data.grid .col-act .row-acts { gap: 5px; }
table.data.grid .col-act .btn { padding: 4px 8px; font-size: 11.5px; }

/* ---------------- 采集表单：性状 × 第N株（与管理页同一套表格语言） ---------------- */
table.data.tgrid { table-layout: fixed; }
table.data.tgrid td.wrap { white-space: normal; }
table.data.tgrid td.num { text-align: right; }
table.data.tgrid .t-no { color: var(--faint); font-size: 11px; margin-right: 6px; }
table.data.tgrid .t-unit { color: var(--faint); font-size: 11px; margin-left: 3px; }
table.data.tgrid .band {
  background-image: linear-gradient(rgba(47, 122, 82, .045), rgba(47, 122, 82, .045));
}
/* 取值列：代码在前（括号外）、原始数值在括号里；一律黑色文字 */
table.data .p-code {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
table.data .p-val {
  color: var(--ink);
  font-size: 11.5px;
  margin-left: 1px;
}
/* 第 2 株起代码与第 1 株不一致：整格标红 */
table.data .p-diff,
table.data .p-diff .p-code,
table.data .p-diff .p-val {
  color: var(--danger);
}
/* 群体观测还没填代码时，表达状态列显示导入文件里的分级标准（详情页与管理页同款） */
table.data.grid .state-std,
table.data.tgrid .state-std {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}
table.data.tgrid th.col-act,
table.data.tgrid td.col-act { text-align: right; }
table.data.tgrid td.col-act .row-acts { gap: 5px; }
table.data.tgrid td.col-act .btn { padding: 4px 8px; font-size: 11.5px; }

/* 任务管理：列多，操作列固定在右侧，横向滚动时领种 / 明细 / 编辑 / 删除始终可点 */
table.data.tgrid.acts-fix td.col-act,
table.data.tgrid.acts-fix thead th.col-act {
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--surface);
  box-shadow: -1px 0 0 var(--line);
}
table.data.tgrid.acts-fix thead th.col-act { z-index: 3; background: var(--surface-2); }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.pager .pages { display: flex; gap: 4px; }
.pager button {
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.pager button:hover:not(:disabled) { border-color: var(--faint); }
.pager button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ---------------- 表单 ---------------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 13px; }
.field > label { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.field > label .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--faint); }

/* 只读值（如录入人员） */
.readonly-box {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 13px;
  color: var(--ink-2);
}
.warn-text { color: var(--warn); font-weight: 600; }

input[type=text], input[type=date], input[type=number], input[type=password], input[type=email], select, textarea {
  font: inherit;
  font-size: 13px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 122, 82, .12);
}
textarea { resize: vertical; min-height: 64px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------------- 可输入搜索的下拉（数据录入 → 关联任务） ---------------- */
.pick { position: relative; }
.pick input[type=text] { padding-right: 28px; }
/* 右侧箭头：收起朝下、展开朝上 */
.pick::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 11px;
  width: 6px;
  height: 6px;
  margin-top: -4px;
  border-right: 1.6px solid var(--faint);
  border-bottom: 1.6px solid var(--faint);
  transform: rotate(45deg);
  pointer-events: none;
  transition: transform .15s, margin-top .15s;
}
.pick.open::after { margin-top: -1px; transform: rotate(-135deg); }
.pick-drop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 70;
  max-height: 232px;
  overflow: auto;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 14px 34px -14px rgba(18, 33, 26, .38);
}
.pick-drop[hidden] { display: none; }
.pick-opt {
  display: block;
  width: 100%;
  padding: 7px 9px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  white-space: normal;
  cursor: pointer;
}
.pick-opt:hover, .pick-opt.active { background: var(--accent-soft); color: var(--accent-ink); }
.pick-none { padding: 8px 9px; font-size: 12px; color: var(--faint); }

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar .spacer { flex: 1; }
.toolbar input[type=text], .toolbar select { width: auto; min-width: 190px; }

/* ---------------- 多条件筛选工具条 ---------------- */
.toolbar.filter-bar { gap: 7px; align-items: flex-start; }
.toolbar.filter-bar select { min-width: 136px; max-width: 230px; }
.toolbar.filter-bar input[type=text] { min-width: 258px; }
/* 管理页筛选条：控件略窄 + 搜索框收窄，年份 / 分组 / 代码版本 / 日期 / 搜索与计数保持在同一行 */
.toolbar.filter-bar.manage-bar select { min-width: 126px; }
.toolbar.filter-bar.manage-bar input[type=date] { width: 140px; }
.toolbar.filter-bar.manage-bar input[type=text] { min-width: 0; width: 182px; }
.toolbar.filter-bar.manage-bar #m-count { white-space: nowrap; }
.toolbar.filter-bar input[type=number] { width: 96px; }
.toolbar.filter-bar input[type=date] { width: 148px; }
.toolbar.filter-bar .date-range {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.toolbar.filter-bar .range-sep { font-size: 12px; color: var(--faint); }
.toolbar.filter-bar #f-count, .toolbar.filter-bar #m-count { align-self: center; }

.seg {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}
.seg button {
  border: none;
  background: none;
  font: inherit;
  font-size: 12.5px;
  padding: 6px 12px;
  color: var(--muted);
  cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }

/* ---------------- 徽标 ---------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--muted);
  white-space: nowrap;
}
.tag-accent { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.tag-warn { background: var(--warn-soft); border-color: #ecd4b0; color: var(--warn); }
.tag-danger { background: var(--danger-soft); border-color: #e6b7b1; color: var(--danger); }

/* ---------------- 项目卡片 ---------------- */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(292px, 1fr));
  gap: 14px;
}
.proj-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px 13px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.proj-card:hover {
  border-color: var(--accent-line);
  box-shadow: 0 2px 4px rgba(18,33,26,.05), 0 12px 28px -18px rgba(18,33,26,.35);
  transform: translateY(-1px);
}
.proj-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.proj-card .meta { font-size: 11.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 0; }
.proj-card .meta span { display: inline-flex; align-items: center; gap: 4px; }
.proj-card .meta span + span::before { content: "·"; margin: 0 7px; color: var(--line-strong); }
.density { display: flex; flex-direction: column; gap: 5px; }
.density-row { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.density-row .lab { width: 62px; flex: none; }
.density-row .bar { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.density-row .bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.density-row .bar i.alt { background: #7aa88f; }
.density-row .val { font-variant-numeric: tabular-nums; width: 52px; text-align: right; flex: none; }
.proj-card .foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.proj-card .foot .acts { display: flex; gap: 6px; }

/* ---------------- 标签页 ---------------- */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  overflow-x: auto;
}
.tabs button {
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  padding: 9px 13px 10px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--accent-ink); border-bottom-color: var(--accent); font-weight: 500; }
.tabs button .cnt {
  font-size: 10.5px;
  color: var(--faint);
  margin-left: 5px;
  font-variant-numeric: tabular-nums;
}

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(18, 33, 26, .34);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 100;
  animation: fade .14s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--surface);
  border-radius: 12px;
  width: min(620px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px -24px rgba(18, 33, 26, .5);
  animation: pop .16s ease-out;
}
.modal.wide { width: min(920px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 14.5px; font-weight: 600; margin: 0; }
.modal-head .sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
/* 标题行最右侧的一段信息（例如查看图片时显示当前大图的名称） */
.modal-head .head-right {
  margin-left: auto;
  max-width: 46%;
  font-size: 12px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modal-head .head-right .iv-name { font-weight: 500; }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 12px 12px;
}
.modal-foot .left { margin-right: auto; }
.icon-btn {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* ---------------- 拖拽上传 ---------------- */
.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.dropzone:hover, .dropzone.over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone .dz-title { font-size: 13.5px; font-weight: 500; color: var(--ink); margin-bottom: 4px; }
.dropzone .dz-hint { font-size: 11.5px; color: var(--muted); }
/* 已选文件名：默认放在上传区下方、与上传区左对齐；仍放在上传区内部时（数据录入弹窗）保持居中 */
.dz-file {
  margin-top: 8px;
  font-size: 12px;
  color: var(--accent-ink);
  font-family: var(--mono);
  text-align: left;
  word-break: break-all;
}
.dz-file:empty { display: none; }
.dropzone .dz-file { margin-top: 10px; text-align: center; }

.tpl-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tpl-links a {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 10px;
}
.tpl-links a:hover { background: #dfeee5; }

/* ---------------- 导入预览 ---------------- */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 9px;
  margin-bottom: 14px;
}
.preview-cell {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  background: var(--surface-2);
}
.preview-cell .k { font-size: 11px; color: var(--muted); }
.preview-cell .v { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }

.alert {
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 12.5px;
  line-height: 1.5;
  border: 1px solid;
  margin-bottom: 12px;
}
.alert-info { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.alert-warn { background: var(--warn-soft); border-color: #ecd4b0; color: var(--warn); }
.alert-danger { background: var(--danger-soft); border-color: #e6b7b1; color: var(--danger); }
.alert ul { margin: 5px 0 0; padding-left: 18px; }

/* ---------------- 对比表 ---------------- */
.compare-wrap {
  overflow: auto;
  max-height: calc(100vh - 210px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
table.compare {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  width: max-content;
  min-width: 100%;
}
table.compare th, table.compare td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 7px 10px;
  vertical-align: top;
}
table.compare thead th {
  position: sticky;
  top: 0;
  background: var(--head-bg);
  z-index: 3;
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
  border-bottom: 1px solid var(--line-strong);
}
table.compare thead th .sub { display: block; font-weight: 400; color: var(--faint); font-size: 10.5px; }
table.compare thead th.pair-th { padding-right: 26px; }
table.compare thead th .pair-name { display: block; }
/* 品种列 hover 时出现的「从对比中移除」 */
table.compare .pair-del {
  position: absolute;
  top: 3px;
  right: 9px;
  width: 17px;
  height: 17px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--faint);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s, background .12s, border-color .12s, color .12s;
}
table.compare thead th.pair-th:hover .pair-del { opacity: 1; }
table.compare .pair-del:hover { background: var(--danger-soft); border-color: #e6b7b1; color: var(--danger); }
/* 表头右边缘的拖动条：调整列宽度 */
table.compare thead th .col-grip {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 7px;
  cursor: col-resize;
  z-index: 5;
}
table.compare thead th .col-grip:hover { background: var(--accent-line); }
body.col-resizing { cursor: col-resize; user-select: none; }
/* 拖过列宽后切固定布局，覆盖左侧固定列的尺寸限制 */
table.compare.fixed th.sticky, table.compare.fixed td.sticky { min-width: 0; max-width: none; }
table.compare.fixed td.cell { overflow: hidden; }
table.compare.fixed td.cell.wide { min-width: 0; max-width: none; }
table.compare.fixed td.cell:not(.wide) > span { overflow: hidden; text-overflow: ellipsis; }
table.compare td.empty-trait { color: var(--faint); font-size: 11.5px; white-space: normal; }
table.compare th.sticky, table.compare td.sticky {
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 2;
  min-width: 190px;
  max-width: 250px;
}
table.compare thead th.sticky { z-index: 4; background: var(--head-bg); }
table.compare tbody tr:hover td { background: #f8faf8; }
table.compare tbody tr:hover td.sticky { background: #f8faf8; }
table.compare .trait-cell { white-space: normal; }
table.compare .trait-cell .t-no { color: var(--faint); font-size: 10.5px; }
table.compare .trait-cell .unit { color: var(--faint); font-size: 10.5px; margin-left: 4px; }
table.compare .trait-cell .sub { display: block; color: var(--faint); font-size: 10.5px; margin-top: 2px; }
table.compare td.cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* 性状右侧的「类型」列（个体 / 群体 / 田间管理 …），随内容横向滚动 */
table.compare thead th.type-th,
table.compare td.type-cell {
  width: 62px;
  min-width: 62px;
  white-space: nowrap;
  font-size: 11.5px;
  color: var(--muted);
}
table.compare td.type-cell { background: var(--surface); }
table.compare tbody tr:hover td.type-cell { background: #f8faf8; }
table.compare td.cell.wide { white-space: normal; min-width: 220px; max-width: 380px; }
table.compare td.cell .mean { font-weight: 500; }
table.compare td.cell .rng { display: block; color: var(--faint); font-size: 10.5px; }
/* 个体观测数值：括号外是该值落入的代码，括号内是原始数值，每株一组（如 3（9） 3（10）） */
table.compare td.cell .put .raw { color: var(--faint); font-size: 10.5px; }
table.compare td.cell.empty { color: #cfd8d2; }
/* 第 2 株起代码与第 1 株不同 → 该株标红（与列表页同一套规则） */
table.compare td.cell .put.p-diff,
table.compare td.cell .put.p-diff .mean,
table.compare td.cell .put.p-diff .raw { color: var(--danger); }
table.compare .group-row td {
  background: #f0f4f1;
  font-weight: 600;
  font-size: 11.5px;
  color: var(--ink-2);
  position: sticky;
  left: 0;
}

/* 单条观测编辑弹窗的输入网格 */
.obs-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}
.obs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  max-width: 420px;
  margin-bottom: 9px;
}

/* 弹窗里的分组勾选列表（批量移动） */
.chk-list {
  display: grid;
  gap: 6px;
  max-height: 300px;
  overflow: auto;
}
.chk-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
}
.chk-item:hover { border-color: var(--accent-line); background: #f6faf7; }
.chk-item input[type=checkbox] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* 弹窗里的下拉多选（如上传模版的「模版类型」）：外观同 select，点开展开勾选列表 */
.mselect { display: flex; flex-direction: column; gap: 6px; }

.mselect-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.mselect-btn:hover { border-color: var(--faint); }
.mselect-btn.open { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 122, 82, .12); }
.mselect-val { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.mselect-val .placeholder { color: var(--faint); }
.mselect-caret { flex: none; opacity: .6; transition: transform .15s; }
.mselect-btn.open .mselect-caret { transform: rotate(180deg); opacity: 1; }
.mselect .chk-list { max-height: 208px; }
/* 展开后的列表盒：有边框才好看出是可滚动区域 */
.mselect-panel {
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
/* 同样要显式隐藏：.chk-list 的 display:grid 会盖掉 [hidden] 的默认 display:none */
.mselect-panel[hidden] { display: none; }

/* ---------------- 对比抽屉条 ---------------- */
.selection-bar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: var(--side);
  color: #eef5f1;
  border-radius: 999px;
  padding: 9px 12px 9px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 12px 36px -14px rgba(18, 33, 26, .6);
  z-index: 60;
  font-size: 12.5px;
  animation: rise .18s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 10px); } }
.selection-bar .cnt { font-variant-numeric: tabular-nums; }
.selection-bar .cnt b { color: #7ddba9; font-weight: 600; }

/* ---------------- 空状态 ---------------- */
.empty {
  padding: 52px 20px;
  text-align: center;
  color: var(--muted);
}
.empty .ico {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  font-size: 19px;
}
.empty h3 { font-size: 13.5px; font-weight: 600; color: var(--ink); margin: 0 0 5px; }
.empty p { font-size: 12.5px; margin: 0 0 14px; }

.skeleton {
  background: linear-gradient(90deg, #eef1ee 25%, #f6f8f6 50%, #eef1ee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.1s infinite;
  border-radius: 6px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------- Toast ---------------- */
#toast-root {
  position: fixed;
  top: 66px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px -14px rgba(18,33,26,.4);
  padding: 9px 14px;
  font-size: 12.5px;
  max-width: 380px;
  animation: slidein .16s ease-out;
}
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
@keyframes slidein { from { opacity: 0; transform: translateX(14px); } }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }

/* ---------------- 顶栏账号区（头像 + 昵称 + 下拉） ---------------- */
.user-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
  padding: 3px 5px 3px 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color .12s, box-shadow .12s;
}
.user-menu:hover { border-color: var(--line-strong); }

.user-ava-btn {
  display: flex;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  line-height: 0;
}
.user-menu .u-ava {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(150deg, #3f9a68, #276b47);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  flex: none;
}
.user-ava-btn:hover .u-ava,
.user-ava-btn:focus-visible .u-ava { box-shadow: 0 0 0 3px var(--accent-soft); }

.user-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 4px 2px 7px;
  border: 0;
  border-radius: 999px;
  background: none;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  min-width: 0;
}
.user-menu .u-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.25;
  min-width: 0;
  max-width: 132px;
}
.user-menu .u-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
}
.user-menu .u-role { font-size: 10px; color: var(--muted); }
.u-caret { color: var(--faint); flex: none; transition: transform .15s; }
.user-toggle[aria-expanded="true"] .u-caret { transform: rotate(180deg); }
.user-toggle:hover .u-name { color: var(--accent-ink); }

.user-drop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 208px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 14px 34px -14px rgba(18, 33, 26, .38);
  z-index: 60;
}
.user-drop[hidden] { display: none; }
.ud-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px 10px;
  margin-bottom: 5px;
  border-bottom: 1px solid var(--line);
}
.ud-ava {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(150deg, #3f9a68, #276b47);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex: none;
}
.ud-meta { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.ud-meta strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ud-meta span { font-size: 11.5px; color: var(--muted); }
.ud-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
}
.ud-item:hover { background: var(--surface-2); }
.ud-item.ud-danger { color: var(--danger); }
.ud-item.ud-danger:hover { background: var(--danger-soft); }

/* ---------------- 模版分组下载区 ---------------- */
.tpl-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface-2);
}
.tpl-group + .tpl-group { margin-top: 8px; }
.tpl-group .tg-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.tpl-group .hint { font-size: 11.5px; color: var(--faint); }

/* ---------------- 表格行内操作 ---------------- */
.row-acts { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.row-acts .tag { margin-left: 4px; }

/* ---------------- 品种图片 ---------------- */
.img-thumbs { display: flex; align-items: center; gap: 3px; }
.img-thumb {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  cursor: zoom-in;
  display: block;
}
.img-thumb:hover { border-color: var(--accent); }
/* 超过 4 张时第 4 格：底图 + 半透明遮罩 + 剩余张数（点开看全部） */
.img-thumb-more {
  position: relative;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
  cursor: zoom-in;
  display: block;
}
.img-thumb-more img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-thumb-more .mask {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(18, 33, 26, .56);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}
.img-thumb-more:hover { border-color: var(--accent); }
.img-thumb-more:hover .mask { background: rgba(18, 33, 26, .38); }

.img-grid { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
/* 一张图片 = 缩略图 + 下方可改的名称，拖动整块调整顺序 */
.img-item { width: 96px; display: flex; flex-direction: column; gap: 4px; }
.img-item[draggable="true"] { cursor: grab; }
.img-item.dragging { opacity: .45; }
.img-item.drag-over .img-tile {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.img-name {
  width: 96px;
  height: 22px;
  padding: 2px 5px;
  font-size: 11px;
  border-radius: 4px;
}
.img-tile {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  overflow: hidden;
}
.img-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-tile .rm {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(18, 33, 26, .62);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.img-tile .rm:hover { background: var(--danger); }
.img-item.is-new .img-tile { border-color: var(--accent-line); }
.img-item.is-new .img-tile::after {
  content: '新';
  position: absolute;
  left: 3px;
  bottom: 3px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
}
.img-add {
  width: 96px;
  height: 96px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.img-add:hover { border-color: var(--accent); color: var(--accent); }
.img-add .plus { font-size: 18px; line-height: 1; }

.img-view { text-align: center; }
.img-stage { display: grid; place-items: center; min-height: 120px; }
.img-full {
  max-width: 100%;
  max-height: 58vh;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  display: block;
}
.img-cap { color: var(--muted); font-size: 12px; margin-top: 10px; }
/* 图片区下方的缩略图条：点击切换查看 */
.img-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  max-height: 108px;
  overflow-y: auto;
}
.img-strip-item {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-2);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.img-strip-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-strip-item:hover { border-color: var(--accent-line); }
.img-strip-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* ---------------- 登录 / 注册页 ---------------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px 16px;
  background:
    radial-gradient(720px 320px at 18% -6%, rgba(63, 154, 104, .16), transparent 62%),
    radial-gradient(640px 300px at 88% 108%, rgba(47, 122, 82, .12), transparent 60%),
    var(--bg);
}

.auth-card {
  width: 400px;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 30px 32px 26px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.auth-brand .brand-mark { width: 36px; height: 36px; border-radius: 10px; font-size: 16px; }
.auth-brand strong { display: block; font-size: 15.5px; color: var(--ink); letter-spacing: .3px; }
.auth-brand span { font-size: 10.5px; color: var(--faint); letter-spacing: .8px; text-transform: uppercase; }

.auth-card h2 { margin: 0 0 4px; font-size: 19px; font-weight: 600; color: var(--ink); }
.auth-sub { margin: 0 0 18px; font-size: 12.5px; color: var(--muted); }

.auth-card .btn-block { margin-top: 4px; padding: 9px 0; font-size: 14px; letter-spacing: 4px; }

.auth-switch {
  margin-top: 16px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}
.auth-switch a { color: var(--accent-ink); text-decoration: none; font-weight: 500; }
.auth-switch a:hover { text-decoration: underline; }

.auth-done { text-align: center; padding: 8px 0 4px; }
.auth-done-ico {
  width: 52px; height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-ink);
  font-size: 24px;
  display: grid;
  place-items: center;
}
.auth-done h2 { margin-bottom: 8px; }
.auth-done p { margin: 0 0 18px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.auth-done .btn-block { letter-spacing: 0; }

.auth-foot { font-size: 11.5px; color: var(--faint); }

/* ---------------- 账号弹窗 / 用户卡片 ---------------- */
.acct-info { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.acct-ava {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(150deg, #3f9a68, #276b47);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.acct-name { font-size: 15px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.sep-line { border: none; border-top: 1px solid var(--line); margin: 14px 0; }

@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 10px 14px;
    gap: 14px;
  }
  .brand { padding: 0; }
  .brand-text { display: none; }
  .nav { flex-direction: row; align-items: center; flex-wrap: wrap; }
  /* 窄屏下父菜单和子菜单并排显示，子菜单不再缩进 */
  .nav-group { flex-direction: row; align-items: center; gap: 2px; flex-wrap: wrap; }
  .nav-sub { flex-direction: row; margin-left: 0; padding-left: 0; border-left: none; }
  /* 一行放不下时换行，而不是把「模版列表」挤成一字一列 */
  .nav a, .nav-parent { flex: none; width: auto; white-space: nowrap; }
  .content { padding: 16px 14px 72px; }
  .topbar { padding: 0 14px; }
}
