/* ============================================================
   项目管理 · 视觉系统
   基调：Apple 风（大留白 / 发丝线 / 柔和阴影 / 胶囊状态）
   ============================================================ */

:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --side: #fafafc;
  --paper: #ffffff;
  --ink: #1d1d1f;
  --ink-soft: #424245;
  --muted: #86868b;
  --line: rgba(0, 0, 0, 0.07);
  --line-strong: rgba(0, 0, 0, 0.14);
  --fill: rgba(0, 0, 0, 0.045);
  --fill-strong: rgba(0, 0, 0, 0.07);
  --accent: #0071e3;
  --accent-deep: #0060c9;
  --accent-ink: #ffffff;
  --ok: #248a3d;
  --wait: #b25000;
  --stop: #6e6e73;
  --danger: #d02c3c;
  --ring: 0 0 0 0.5px rgba(0, 0, 0, 0.055);
  --shadow-card: 0 0 0 0.5px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03), 0 6px 18px rgba(0, 0, 0, 0.04);
  --shadow-pop: 0 0 0 0.5px rgba(0, 0, 0, 0.06), 0 6px 20px rgba(0, 0, 0, 0.1), 0 24px 64px rgba(0, 0, 0, 0.14);
  --shadow: var(--shadow-card);
  --r-s: 9px;
  --r-m: 12px;
  --r-l: 16px;
  /* 全站列表节奏：所有列表（漏洞/通知/邮件/账号/项目/用户/审计/库存）共用同一套
     行内边距、标题字号与副标题间距。用 rem/em 而不是写死 px，缩放和换浏览器都按比例走。 */
  --row-y: 0.875rem;          /* 行上下内边距（14px @16px 根字号） */
  --row-x: 1.25rem;           /* 行首/行尾内边距（20px） */
  --col-gap: 1.25rem;         /* 列间距 */
  --row-title: 0.84375rem;    /* 主标题 13.5px */
  --row-text: 0.8125rem;      /* 正文单元格 13px */
  --row-sub: 0.75rem;         /* 副标题 12px */
  --row-lh: 1.45;             /* 统一行高，主副标题共用 */
  --sub-gap: 0.1875rem;       /* 主标题到副标题 3px */
  --head-y: 0.6875rem;        /* 表头上下内边距 11px */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "Menlo", monospace;
}

body.theme-dark {
  color-scheme: dark;
  --bg: #131315;
  --side: #17171a;
  --paper: #1e1e21;
  --ink: #f5f5f7;
  --ink-soft: #d6d6da;
  --muted: #98989d;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.17);
  --fill: rgba(255, 255, 255, 0.06);
  --fill-strong: rgba(255, 255, 255, 0.1);
  --accent: #0a84ff;
  --accent-deep: #3395ff;
  --ok: #30d158;
  --wait: #ffd60a;
  --stop: #98989d;
  --danger: #ff453a;
  --ring: 0 0 0 0.5px rgba(255, 255, 255, 0.08);
  --shadow-card: 0 0 0 0.5px rgba(255, 255, 255, 0.07), 0 1px 2px rgba(0, 0, 0, 0.24), 0 6px 18px rgba(0, 0, 0, 0.2);
  --shadow-pop: 0 0 0 0.5px rgba(255, 255, 255, 0.09), 0 6px 20px rgba(0, 0, 0, 0.4), 0 24px 64px rgba(0, 0, 0, 0.5);
  --shadow: var(--shadow-card);
}

/* 主题色（平台设置 → 外观）：只改 accent 三个变量，浅色/深色各一套，其它颜色不动。 */
body.accent-teal { --accent: #0a7f8f; --accent-deep: #086b78; }
body.accent-green { --accent: #248a3d; --accent-deep: #1d7233; }
body.accent-orange { --accent: #c4501a; --accent-deep: #a84414; }
body.accent-graphite { --accent: #3a3a3c; --accent-deep: #1d1d1f; }
body.theme-dark.accent-teal { --accent: #40c8e0; --accent-deep: #6ad4e8; --accent-ink: #0b2a30; }
body.theme-dark.accent-green { --accent: #30d158; --accent-deep: #5cdb7b; --accent-ink: #062a10; }
body.theme-dark.accent-orange { --accent: #ff9f0a; --accent-deep: #ffb340; --accent-ink: #2e1a00; }
body.theme-dark.accent-graphite { --accent: #d6d6da; --accent-deep: #f5f5f7; --accent-ink: #1d1d1f; }

/* 列表密度：只改行节奏变量，所有表格一起变 */
body.density-compact { --row-y: 0.5625rem; --head-y: 0.5rem; --sub-gap: 0.125rem; }

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.47;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }
button { margin: 0; }

:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent);
  outline-offset: 2px;
  border-radius: 4px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ink) 18%, transparent);
  border: 3px solid transparent;
  border-radius: 99px;
  background-clip: content-box;
}
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 布局骨架 ---------- */

.shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
  /* 让侧栏列的底色一直延伸到页面底部，長页面不再出现色差缝。 */
  background: linear-gradient(90deg, var(--side) 0 236px, var(--bg) 236px);
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 14px;
  background: var(--side);
  border-right: 1px solid var(--line);
}

/* 品牌区 */
.mark {
  display: flex;
  align-items: center;
  padding: 4px 10px 18px;
  color: inherit;
  text-decoration: none;
}
.mark:hover { text-decoration: none; }
.mark-text { display: flex; flex-direction: column; min-width: 0; }
.mark-title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mark-sub { margin-top: 2px; color: var(--muted); font-size: 12px; white-space: nowrap; }

/* 导航 */
.nav { display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow: auto; padding-bottom: 6px; }
.nav-label {
  margin: 16px 10px 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.nav > a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 480;
  text-decoration: none;
  transition: background-color 0.13s ease, color 0.13s ease;
}
.nav > a svg {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--muted);
  transition: color 0.13s ease;
}
.nav > a.nav-split { margin-top: 14px; }
.nav > a:hover { background: var(--fill); color: var(--ink); text-decoration: none; }
.nav > a:hover svg { color: var(--ink-soft); }
.nav > a.is-on {
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  color: var(--accent);
  font-weight: 590;
}
.nav > a.is-on svg { color: var(--accent); }

.menu { border: 0; margin: 0; padding: 0; }
.menu summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary::marker { content: ""; }
.menu summary .chev { transition: transform 0.15s ease; }
.menu[open] summary .chev { transform: rotate(90deg); }
.menu a {
  display: block;
  margin-left: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
}
.menu a:hover { background: var(--fill); text-decoration: none; }
.menu a.is-on { background: var(--fill); color: var(--ink); font-weight: 600; }

/* 侧栏底部用户区 */
.bell, .gear {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--muted);
  flex: none;
  transition: background-color 0.13s ease, color 0.13s ease;
}
.bell:hover, .gear:hover { background: var(--fill); color: var(--ink); text-decoration: none; }
.bell { position: relative; }
.bell .dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px var(--side);
}

.side-foot {
  margin-top: auto;
  padding: 10px 6px 0;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 4px;
}
.who-menu { position: relative; min-width: 0; flex: 1; }
.who {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 5px 6px;
  margin-left: -6px;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
}
.who:hover { background: var(--fill); }
.who-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--fill-strong);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.who-pop {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 6;
  width: 224px;
  padding: 12px;
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-pop);
  display: grid;
  gap: 6px;
}
.pop-label { margin: 2px 4px 0; color: var(--muted); font-size: 11.5px; font-weight: 500; }
.seg {
  display: flex;
  gap: 2px;
  margin: 0 0 4px;
  padding: 2px;
  border-radius: 8px;
  background: var(--fill);
}
.seg button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  border-radius: 6px;
  padding: 5px 4px;
  font-size: 12.5px;
  cursor: pointer;
  transition: background-color 0.13s ease;
}
.seg button.is-on {
  background: var(--paper);
  color: var(--ink);
  font-weight: 590;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.08);
}
body.theme-dark .seg button.is-on { box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.08), 0 1px 2px rgba(0, 0, 0, 0.4); }
.seg button:not(.is-on):hover { color: var(--ink); }
.who-pop .logout {
  width: 100%;
  margin-top: 4px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--danger);
  text-align: left;
  padding: 9px 8px 4px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.who-pop .logout:hover { background: var(--fill); }
.who::-webkit-details-marker { display: none; }
.who::marker { content: ""; }
.who strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 590;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 主区域 ---------- */

.main {
  width: 100%;
  min-width: 0;
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px clamp(22px, 3vw, 48px) 80px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.page-head > div { min-width: 0; }
.page-head .btn { flex: none; }
.head-actions { display: flex; align-items: center; gap: 8px; flex: none; }

h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.035em;
}
.lede { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; }

/* ---------- 统计卡片 ---------- */

.meter {
  display: grid;
  gap: 12px;
}
.meter-1 { grid-template-columns: minmax(0, 1fr); max-width: 300px; }
.meter-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.meter-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.meter div {
  padding: 15px 18px 16px;
  border-right: 0;
  background: var(--paper);
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  box-shadow: none;
}
.meter span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 7px;
}
.meter strong {
  display: block;
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 个人中心概况：轻量三格，和 .meter 同调但更紧凑 */
.mini-meter {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 4px 22px 18px;
}
.mini-meter div {
  padding: 13px 16px 14px;
  background: var(--fill);
  border-radius: var(--r-m);
  border: 1px solid var(--line);
}
.mini-meter span { display: block; color: var(--muted); font-size: 12px; font-weight: 500; margin-bottom: 6px; }
.mini-meter strong {
  display: block;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.mini-meter em { display: block; margin-top: 4px; color: var(--muted); font-size: 11.5px; font-style: normal; }
@media (max-width: 640px) { .mini-meter { grid-template-columns: 1fr; margin: 4px 16px 16px; } }

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
section + section, .main form + section, .main .sheet + section { margin-top: 30px; }

/* ---------- 卡片容器与表格 ---------- */

.sheet {
  background: var(--paper);
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.02);
  overflow: auto;
}
body.theme-dark .sheet { box-shadow: none; }

table { width: 100%; border-collapse: collapse; table-layout: fixed; }

th, td {
  text-align: left;
  padding: var(--row-y) calc(var(--col-gap) / 2);
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
  overflow-wrap: normal;
  font-size: var(--row-text);
  line-height: var(--row-lh);
}
th:first-child, td:first-child { padding-left: var(--row-x); }
th:last-child, td:last-child { padding-right: var(--row-x); }
th {
  color: var(--muted);
  font-size: 0.71875rem;
  font-weight: 590;
  letter-spacing: 0.02em;
  background: transparent;
  white-space: nowrap;
  padding-top: var(--head-y);
  padding-bottom: var(--head-y);
}
tr:last-child td { border-bottom: 0; }

/* 所有列表行共用同一悬停反馈 */
.sheet table tbody tr { transition: background-color 0.12s ease; }
.sheet table:not(.mail-table) tbody tr:hover > td { background: var(--fill); }

.row-title {
  display: block;
  font-weight: 590;
  font-size: var(--row-title);
  line-height: var(--row-lh);
  color: var(--ink);
  text-decoration: none;
}
a.row-title:hover { text-decoration: underline; color: var(--accent); }
.title-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.title-line .row-title { min-width: 0; }

.accounts-table .col-name { width: 20%; }
.accounts-table .col-owner { width: 12%; }
.accounts-table .col-type { width: 18%; }
.accounts-table .col-interval { width: 9%; }
.accounts-table .col-claim { width: 8%; }
.accounts-table .col-state { width: 15%; }
.accounts-table .col-slots { width: 8%; white-space: nowrap; }
.accounts-table .col-ops { width: 10%; white-space: nowrap; }
.accounts-table .col-name .row-title,
.accounts-table .col-name .quiet,
.accounts-table .col-type { overflow-wrap: anywhere; }
.account-projects th:nth-child(1), .account-projects td:nth-child(1) { width: 34%; overflow-wrap: anywhere; }
.account-projects th:nth-child(2), .account-projects td:nth-child(2) { width: 14%; }
.account-projects th:nth-child(3), .account-projects td:nth-child(3) { width: 8%; }
.account-projects th:nth-child(4), .account-projects td:nth-child(4) { width: 14%; }
.account-projects th:nth-child(5), .account-projects td:nth-child(5) { width: 12%; }
.account-projects th:nth-child(6), .account-projects td:nth-child(6) { width: 18%; }
.project-table th:nth-child(1), .project-table td:nth-child(1) { width: 18%; }
.project-table th:nth-child(2), .project-table td:nth-child(2) { width: 16%; }
.project-table th:nth-child(3), .project-table td:nth-child(3) { width: 12%; }
.project-table th:nth-child(4), .project-table td:nth-child(4) { width: 10%; white-space: nowrap; }
.project-table th:nth-child(5), .project-table td:nth-child(5) { width: 14%; white-space: nowrap; }
.project-table th:nth-child(6), .project-table td:nth-child(6) { width: 16%; white-space: nowrap; }
.project-table th:last-child, .project-table td:last-child { width: 14%; text-align: left; }
.project-table td:nth-child(1) { overflow-wrap: anywhere; }

/* 漏洞记录表
   和其它列表用同一套行节奏（普通 table + 同样的 padding/行高/副标题间距）。
   标题列宽用百分比，不写死 px；标题最多两行，超出用省略号，
   这样每行高度只有“一行标题”或“两行标题”两种，不会上密下疏。 */
.bug-table col.bug-name { width: 40%; }
.bug-table col.bug-project { width: 18%; }
.bug-table col.bug-grade { width: 7%; }
.bug-table col.bug-status { width: 8%; }
.bug-table col.bug-bonus { width: 7%; }
.bug-table col.bug-time { width: 13%; }
.bug-table col.bug-account { width: 7%; }
.bug-table .row-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
/* 每行等高：高度按“两行标题 + 一行编号 + 上下内边距”算，内容垂直居中。
   分隔线间距因此完全一致，不会因为标题长短徽密徽疏。 */
.bug-table tbody td {
  height: calc(2 * var(--row-y) + 2 * var(--row-title) * var(--row-lh) + var(--sub-gap) + var(--row-sub) * var(--row-lh));
}
.bug-table td:nth-child(2) { overflow-wrap: anywhere; }
.bug-table th:nth-child(n + 3), .bug-table td:nth-child(n + 3) { white-space: nowrap; }

/* 其它列表的列宽：按内容分配，而不是等分（等分会让短内容列留出大片空白，列间距看起来徽宽徽窄）。 */
table.notices th:nth-child(1) { width: 17%; }
table.notices th:nth-child(2) { width: 14%; }
table.notices th:nth-child(4) { width: 12%; }
table.users th:nth-child(1) { width: 16%; }
table.users th:nth-child(2) { width: 17%; }
table.users th:nth-child(3) { width: 10%; }
table.users th:nth-child(5) { width: 16%; }
table.users th:nth-child(6) { width: 20%; }
table.audit th:nth-child(1) { width: 14%; }
table.audit th:nth-child(2) { width: 17%; }
table.audit th:nth-child(3) { width: 18%; }
table.audit td:nth-child(4) { overflow-wrap: anywhere; }
table.dash-accounts th:nth-child(1) { width: 23%; }
table.dash-accounts th:nth-child(2) { width: 13%; }
table.dash-accounts th:nth-child(3) { width: 9%; }
table.dash-accounts th:nth-child(4) { width: 18%; }
table.dash-accounts th:nth-child(5) { width: 11%; }
table.dash-accounts th:nth-child(6) { width: 15%; }
table.recent th:nth-child(1) { width: auto; }
table.recent td:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.recent th:nth-child(2), table.recent td:nth-child(2) { width: 6.5em; }
table.recent th:last-child, table.recent td:last-child { width: 8.5em; text-align: right; }

/* 漏洞等级 / 审核状态：和 .state 一样的彩点 + 彩色文字 */
.grade, .bstate {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: var(--row-text);
  font-weight: 540;
  white-space: nowrap;
}
.bstate::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
/* 等级只用文字色（红 → 橙 → 深灰 → 浅灰），状态用彩点；两列色系错开，不会一片黄。 */
.grade { color: var(--ink-soft); }
.grade.g-urgent { color: var(--danger); }
.grade.g-high { color: #c4501a; }
.grade.g-middle { color: var(--ink-soft); }
.grade.g-low { color: var(--muted); font-weight: 500; }
body.theme-dark .grade.g-high { color: #ff9f0a; }
.bstate { color: var(--muted); }
.bstate.s-verifying, .bstate.s-confirming { color: var(--accent); }
.bstate.s-arbitrationing, .bstate.s-appeal { color: var(--danger); }
.bstate.s-paying, .bstate.s-paid { color: var(--ok); }
.bstate.s-end { color: var(--stop); }

/* 状态汇总条：可点击的筛选片，数字对齐 */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2rem;
  padding: 0 0.875rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: var(--row-text);
  font-weight: 530;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.13s ease, border-color 0.13s ease, color 0.13s ease;
}
.chip b { font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.chip:hover { background: var(--fill); text-decoration: none; }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip.is-on b { color: var(--paper); }

/* 项目列表（可展开行） */
.plist-line {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr 0.6fr 1fr 1.1fr 0.8fr 0.7fr;
  column-gap: 18px;
  align-items: center;
  min-height: 56px;
  padding: 0 20px;
  font-size: 13px;
  line-height: 20px;
  font-weight: 400;
}
.plist-line.head {
  min-height: 38px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 590;
  letter-spacing: 0.02em;
}
.plist-line > * { min-width: 0; }
.plist-line > :nth-child(2) { padding-left: 18px; }
.plist-line .end, .plist-line .more, .plist-line .join { white-space: nowrap; }
.plist-line .end, .plist-line .more { justify-self: start; text-align: left; }
.plist-item { border-top: 1px solid var(--line); }
.plist-item summary {
  display: block;
  list-style: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: background-color 0.12s ease;
}
.plist-item summary::-webkit-details-marker { display: none; }
.plist-item summary:hover { background: var(--fill); }
.plist-item[open] > summary { background: var(--fill); }
.more {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  width: auto;
  height: 20px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 20px;
  font-weight: 400;
}
.more i {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  flex: none;
  transition: transform 0.15s ease;
}
.plist-item[open] .more i { transform: rotate(45deg); }
.plist-line .life { width: auto; justify-content: flex-start; }
.plist-accounts {
  padding: 13px 20px 15px;
  display: grid;
  gap: 7px;
  background: color-mix(in srgb, var(--ink) 2.5%, transparent);
  border-top: 1px solid var(--line);
}
.plist-accounts div {
  display: grid;
  grid-template-columns: 120px 96px minmax(0, 1fr) 88px;
  gap: 12px;
  align-items: center;
  min-height: 28px;
  font-size: 12.5px;
}
.plist-accounts div > * { min-width: 0; overflow-wrap: anywhere; }
.plist-accounts div.head { min-height: 0; color: var(--muted); font-size: 11.5px; }
.plist-accounts a { color: var(--ink); font-weight: 500; text-decoration: none; }
.plist-accounts a:hover { color: var(--accent); }

/* ---------- 状态标识：彩点 + 彩色文字，无底色块 ---------- */

.state, .life, .join {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: transparent;
  font-size: 12.5px;
  font-weight: 540;
  line-height: 1.3;
  white-space: nowrap;
}
.state::before, .join::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.life i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.state.run, .state.recorded { color: var(--ok); }
.state.wait, .state.noticed { color: var(--wait); }
.state.stop, .state.skipped { color: var(--stop); }

.life { color: var(--stop); }
.life-doing { color: var(--ok); }
.life-apply, .life-pause { color: var(--wait); }
.life-stop { color: var(--danger); }

.join { color: var(--muted); }
.join.joined { color: var(--ok); }
.join.applied, .join.reviewing, .join.all_applied { color: var(--wait); }
.join.rejected { color: var(--danger); }
.join.unknown, .join.need_password, .join.bad_password { color: var(--muted); }
.joins { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.joins li { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.joins a { color: var(--ink); text-decoration: none; }

/* ---------- 工具栏（筛选） ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--paper);
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.02);
}
.filters label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 15px;
}
.filters label > span { line-height: 15px; white-space: nowrap; }
.filters label > select, .filters label > input { font-size: 13.5px; color: var(--ink); font-weight: 400; }
.filters input[name="q"] {
  height: 36px;
  width: 13rem;
  padding: 0 12px 0 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.8-3.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 11px center;
}
.filters .btn { height: 36px; min-width: 72px; }
.filters .btn.primary { margin-left: auto; }
.filters select { min-width: 168px; }

/* ---------- 输入控件 ---------- */

input, select, textarea {
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-s);
  padding: 8px 12px;
  min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

select {
  appearance: none;
  -webkit-appearance: none;
  height: 36px;
  line-height: 36px;
  padding: 0 34px 0 12px;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%2386868b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  cursor: pointer;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent) 18%, transparent);
}
textarea { resize: vertical; width: 100%; }

.field {
  display: grid;
  grid-template-rows: 16px 36px;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.field:has(> small) { grid-template-rows: 16px 36px 16px; }
.field > span { line-height: 16px; }
.field > input, .field > select {
  width: 100%;
  height: 36px;
  padding: 0 12px;
}
.field > select { padding-right: 34px; }
.field > small { min-height: 16px; line-height: 16px; }
.fields-3 { grid-template-columns: 1fr 1fr 1fr; align-items: end; }

.pair, .inline-form {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
}
.pair input, .inline-form input {
  height: 36px;
  width: 220px;
  max-width: 100%;
  padding: 0 12px;
  flex: 1 1 160px;
  min-width: 0;
}
.pair .btn, .inline-form .btn { height: 36px; flex: none; }
td.end .inline-form { justify-content: flex-end; }
.user-table { margin-top: 20px; }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  margin: 0;
  padding: 0 15px;
  border-radius: var(--r-s);
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 530;
  line-height: 14px;
  white-space: nowrap;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: background-color 0.13s ease, box-shadow 0.13s ease, transform 0.08s ease, border-color 0.13s ease, filter 0.13s ease;
}
.btn > span {
  display: block;
  height: 14px;
  line-height: 14px;
  font-size: 13.5px;
  font-weight: 530;
}
button.btn::-moz-focus-inner { border: 0; padding: 0; }
.btn:hover { background: color-mix(in srgb, var(--ink) 3%, var(--paper)); text-decoration: none; }
.btn:active { transform: scale(0.985); }
.btn.primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--accent) 35%, transparent);
}
.btn.primary:hover { background: var(--accent-deep); filter: none; }
.btn.danger {
  margin: 0;
  padding: 0 15px;
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
}

/* ---------- 表单卡片 ---------- */

.form { padding: 22px 22px 10px; }
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 22px;
  align-items: start;
}
.fields.fields-3 { grid-template-columns: 1fr 1fr 1fr; }
.field.wide { grid-column: 1 / -1; }
.field:has(textarea), .field.grow { grid-template-rows: 16px auto; }
.field textarea { min-height: 96px; height: auto; padding: 9px 12px; line-height: 1.6; }

.steps { margin: 0 0 24px; padding: var(--row-y) var(--row-x) var(--row-y) calc(var(--row-x) + 1.25rem); font-size: var(--row-text); color: var(--ink-soft); }
.steps li { margin: 0.5rem 0; line-height: var(--row-lh); }
.steps li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.form-note { margin: 14px 0 0; color: var(--muted); font-size: var(--row-sub); line-height: var(--row-lh); }

/* 主题色色块：单选框藏起来，用圆点 + 文字做选择器 */
.field:has(.swatches) { display: block; margin-bottom: 18px; }
.field:has(.swatches) > span { display: block; margin-bottom: 8px; }
.field:has(.swatches) > small { display: block; margin-top: 8px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0 0.875rem 0 0.625rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: var(--row-text);
  cursor: pointer;
  transition: border-color 0.13s ease, background-color 0.13s ease;
}
.swatch:hover { background: var(--fill); }
.swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch i, .swatch-dot { width: 0.875rem; height: 0.875rem; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.swatch-dot { display: inline-block; margin-right: 0.4rem; vertical-align: -0.1em; }
.swatch:has(input:checked) { border-color: var(--ink); color: var(--ink); font-weight: 590; box-shadow: 0 0 0 1px var(--ink); }
.swatch:has(input:focus-visible) { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.sw-blue i, .swatch-dot.sw-blue { background: #0071e3; }
.sw-teal i, .swatch-dot.sw-teal { background: #0a7f8f; }
.sw-green i, .swatch-dot.sw-green { background: #248a3d; }
.sw-orange i, .swatch-dot.sw-orange { background: #c4501a; }
.sw-graphite i, .swatch-dot.sw-graphite { background: #3a3a3c; }
body.theme-dark .sw-graphite i, body.theme-dark .swatch-dot.sw-graphite { background: #d6d6da; }

/* 审计动作：普通动作用正文色，安全告警类标红 */
.act { color: var(--ink); }
.act.act-warn { color: var(--danger); font-weight: 540; }

.actions { display: flex; align-items: center; gap: 8px; padding: 10px 0 16px; }
.form > .actions, .form .actions {
  margin-top: 16px;
  padding: 0 0 6px;
  justify-content: flex-end;
}
.btn.file-btn { cursor: pointer; }
.file-row { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.icon-form { padding: 0 22px 16px; }
.icon-form .actions { margin-top: 12px; padding-bottom: 0; }

/* ---------- 库存（vault） ---------- */

/* 对照/提交：白框和其他页一样占满整宽；只给输入控件本身一个可读上限，
   避免单条输入被拉得过长。宽度用 clamp，缩放/换浏览器都按比例自适应。 */
.composer { max-width: none; }
.composer .entry > input:not([type="hidden"]):not([type="file"]),
.composer .entry > select { max-width: 42rem; }
.vault-page { width: min(100%, 960px); }
.vault-sheet .fields { align-items: stretch; }
.vault-sheet textarea { min-height: 132px; resize: vertical; }
.vault-sheet .writer { min-height: 360px; }
.vault-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 0 4px;
}
.vault-actions .btn.primary { margin-left: auto; }

.grade-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.grade-picks label {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 13.5px;
  cursor: pointer;
  transition: background-color 0.13s ease, border-color 0.13s ease, color 0.13s ease;
}
.grade-picks label:hover { background: var(--fill); }
.grade-picks input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.grade-picks label:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.grade-picks label:has(input:focus-visible) { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); }

.entry {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.entry:first-of-type { border-top: 0; }
.entry > span { color: var(--muted); font-size: 13px; line-height: 36px; }
.entry input:not([type="hidden"]):not([type="file"]),
.entry select,
.entry textarea { width: 100%; }
.entry input[type="file"] { margin-top: 6px; border: 0; background: transparent; padding-left: 0; }
.composer > .actions { margin: 8px 0 8px 104px; }

.grades { display: flex; flex-wrap: wrap; gap: 8px 16px; min-height: 36px; align-items: center; }
.grades label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 14px; }
.grades input { width: auto; }

.filters.vault-pick { margin-bottom: 18px; }
.filters.vault-pick select[name="project"] { width: min(36rem, 100%); min-width: min(28rem, 100%); }
.filters.vault-pick select[name="account"] { width: 16rem; min-width: min(14rem, 100%); }

.vault-cats { align-items: end; margin-bottom: 16px; }
.vault-cats > label { flex: 1 1 0; min-width: 0; }
.vault-cats select,
.vault-cats .vault-project select { width: 100%; min-width: 0; }
.vault-cats .btn.primary { margin-left: 0; flex: none; }

.ask.manage-ask { width: min(520px, calc(100vw - 32px)); }
.cat-add { display: flex; align-items: end; gap: 8px; margin-bottom: 14px; }
.cat-add label { flex: 1; }
.ask label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 500; }
.ask label input { width: 100%; height: 36px; }
.cat-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.cat-row form:not([hidden]) { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cat-row form[hidden] { display: none; }
.cat-row input { min-width: 0; height: 36px; }
.grip { color: var(--muted); cursor: grab; letter-spacing: -2px; user-select: none; }
.cat-row.dragging { opacity: 0.45; }

/* 库存表：网格行布局，列宽精确、表头数据严格对齐 */
.vault-table { display: block; width: 100%; }
.vault-table colgroup { display: none; }
.vault-table thead, .vault-table tbody { display: block; }
.vault-table tr {
  display: grid;
  grid-template-columns: 44px minmax(0, 2.8fr) minmax(88px, 0.7fr) 72px minmax(72px, 0.6fr);
  column-gap: 18px;
  align-items: start;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}
.vault-table:not(.has-owner) tr {
  grid-template-columns: 44px minmax(0, 3fr) minmax(88px, 0.7fr) 72px;
}
.vault-table thead tr { align-items: center; }
.vault-table tbody tr:last-child { border-bottom: 0; }
.vault-table tbody tr { transition: background-color 0.12s ease; }
.vault-table tbody tr:hover { background: var(--fill); }
.vault-table th, .vault-table td {
  width: auto;
  min-width: 0;
  padding: 13px 0;
  border-bottom: 0;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}
.vault-table th { padding: 11px 0; }
.vault-table th:first-child, .vault-table td:first-child { padding-left: 4px; padding-right: 0; }
.vault-table td { color: var(--ink); line-height: 1.5; }
.vault-table td:nth-child(n+3) { color: var(--muted); }
.vault-table .row-title { line-height: 1.5; overflow-wrap: anywhere; }
.vault-table input[type="checkbox"] { width: 16px; height: 16px; margin: 3px 0 0; display: block; }

/* ---------- 对话框 ---------- */

.ask {
  width: min(440px, calc(100vw - 32px));
  border: 0;
  border-radius: var(--r-l);
  padding: 24px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-pop);
}
.ask::backdrop { background: rgba(0, 0, 0, 0.3); backdrop-filter: blur(6px); }
.ask h2 { margin: 0 0 8px; font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }
.ask ul { margin: 8px 0 16px; padding-left: 18px; }
.ask .actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0; }
.ask .btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.ask .btn.danger:hover { filter: brightness(1.06); }

.modal-back {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(6px);
}
.modal {
  width: min(400px, 100%);
  margin: 0;
  padding: 24px;
  border-radius: var(--r-l);
  background: var(--paper);
  box-shadow: var(--shadow-pop);
}
.modal h2 { margin: 0 0 8px; font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }
.modal p { margin: 0 0 12px; color: var(--muted); }
.modal input { width: 100%; height: 36px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}
.modal-actions .btn {
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  min-width: 72px;
  margin: 0;
  padding: 0 14px;
  line-height: 14px;
}

/* ---------- 提示条 ---------- */

.flashes {
  position: fixed;
  z-index: 40;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  width: min(420px, calc(100vw - 32px));
  margin: 0;
  transform: translateX(-50%);
  pointer-events: none;
}
.flash {
  margin: 0 0 8px;
  padding: 11px 14px;
  overflow: hidden;
  border-radius: 12px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-pop);
  font-size: 13px;
  font-weight: 530;
  animation: flash-fade 5s ease forwards;
}
@keyframes flash-fade {
  0%, 72% { opacity: 1; max-height: 120px; }
  100% { opacity: 0; max-height: 0; margin: 0; padding-top: 0; padding-bottom: 0; }
}
.flash.error { color: var(--danger); }
.flash.ok { color: var(--ok); }

/* ---------- 分页 ---------- */

.pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 16px;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* ---------- 杂项元素 ---------- */

.quiet { display: block; color: var(--muted); font-size: var(--row-sub); margin-top: var(--sub-gap); line-height: var(--row-lh); }
.quiet.inline { display: inline; margin-top: 0; }
td.quiet { display: table-cell; vertical-align: middle; margin-top: 0; font-size: var(--row-sub); }
th.end, td.end { text-align: right; white-space: nowrap; }
.end a { margin-left: 12px; }
.num { font-variant-numeric: tabular-nums; }

.pool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  color: var(--muted);
}
.pool i {
  display: block;
  width: 84px;
  height: 5px;
  border-radius: 99px;
  background: var(--fill-strong);
  position: relative;
  overflow: hidden;
  flex: none;
}
.pool i::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
}
.pool i.p0::before { width: 0%; }
.pool i.p1::before { width: 1%; }
.pool i.p2::before { width: 2%; }
.pool i.p3::before { width: 3%; }
.pool i.p4::before { width: 4%; }
.pool i.p5::before { width: 5%; }
.pool i.p6::before { width: 6%; }
.pool i.p7::before { width: 7%; }
.pool i.p8::before { width: 8%; }
.pool i.p9::before { width: 9%; }
.pool i.p10::before { width: 10%; }
.pool i.p11::before { width: 11%; }
.pool i.p12::before { width: 12%; }
.pool i.p13::before { width: 13%; }
.pool i.p14::before { width: 14%; }
.pool i.p15::before { width: 15%; }
.pool i.p16::before { width: 16%; }
.pool i.p17::before { width: 17%; }
.pool i.p18::before { width: 18%; }
.pool i.p19::before { width: 19%; }
.pool i.p20::before { width: 20%; }
.pool i.p21::before { width: 21%; }
.pool i.p22::before { width: 22%; }
.pool i.p23::before { width: 23%; }
.pool i.p24::before { width: 24%; }
.pool i.p25::before { width: 25%; }
.pool i.p26::before { width: 26%; }
.pool i.p27::before { width: 27%; }
.pool i.p28::before { width: 28%; }
.pool i.p29::before { width: 29%; }
.pool i.p30::before { width: 30%; }
.pool i.p31::before { width: 31%; }
.pool i.p32::before { width: 32%; }
.pool i.p33::before { width: 33%; }
.pool i.p34::before { width: 34%; }
.pool i.p35::before { width: 35%; }
.pool i.p36::before { width: 36%; }
.pool i.p37::before { width: 37%; }
.pool i.p38::before { width: 38%; }
.pool i.p39::before { width: 39%; }
.pool i.p40::before { width: 40%; }
.pool i.p41::before { width: 41%; }
.pool i.p42::before { width: 42%; }
.pool i.p43::before { width: 43%; }
.pool i.p44::before { width: 44%; }
.pool i.p45::before { width: 45%; }
.pool i.p46::before { width: 46%; }
.pool i.p47::before { width: 47%; }
.pool i.p48::before { width: 48%; }
.pool i.p49::before { width: 49%; }
.pool i.p50::before { width: 50%; }
.pool i.p51::before { width: 51%; }
.pool i.p52::before { width: 52%; }
.pool i.p53::before { width: 53%; }
.pool i.p54::before { width: 54%; }
.pool i.p55::before { width: 55%; }
.pool i.p56::before { width: 56%; }
.pool i.p57::before { width: 57%; }
.pool i.p58::before { width: 58%; }
.pool i.p59::before { width: 59%; }
.pool i.p60::before { width: 60%; }
.pool i.p61::before { width: 61%; }
.pool i.p62::before { width: 62%; }
.pool i.p63::before { width: 63%; }
.pool i.p64::before { width: 64%; }
.pool i.p65::before { width: 65%; }
.pool i.p66::before { width: 66%; }
.pool i.p67::before { width: 67%; }
.pool i.p68::before { width: 68%; }
.pool i.p69::before { width: 69%; }
.pool i.p70::before { width: 70%; }
.pool i.p71::before { width: 71%; }
.pool i.p72::before { width: 72%; }
.pool i.p73::before { width: 73%; }
.pool i.p74::before { width: 74%; }
.pool i.p75::before { width: 75%; }
.pool i.p76::before { width: 76%; }
.pool i.p77::before { width: 77%; }
.pool i.p78::before { width: 78%; }
.pool i.p79::before { width: 79%; }
.pool i.p80::before { width: 80%; }
.pool i.p81::before { width: 81%; }
.pool i.p82::before { width: 82%; }
.pool i.p83::before { width: 83%; }
.pool i.p84::before { width: 84%; }
.pool i.p85::before { width: 85%; }
.pool i.p86::before { width: 86%; }
.pool i.p87::before { width: 87%; }
.pool i.p88::before { width: 88%; }
.pool i.p89::before { width: 89%; }
.pool i.p90::before { width: 90%; }
.pool i.p91::before { width: 91%; }
.pool i.p92::before { width: 92%; }
.pool i.p93::before { width: 93%; }
.pool i.p94::before { width: 94%; }
.pool i.p95::before { width: 95%; }
.pool i.p96::before { width: 96%; }
.pool i.p97::before { width: 97%; }
.pool i.p98::before { width: 98%; }
.pool i.p99::before { width: 99%; }
.pool i.p100::before { width: 100%; }

.empty { margin: 0; padding: 56px 20px; color: var(--muted); font-size: 13.5px; text-align: center; }

/* 对照页 */
.name-row {
  display: grid;
  grid-template-columns: minmax(200px, 0.7fr) minmax(0, 1.3fr);
  gap: 16px 24px;
  align-items: center;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}
.name-row:first-child { border-top: 0; padding-top: 12px; }
.name-main strong { display: block; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.name-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.name-pick input { height: 36px; flex: 1 1 180px; }
.pick {
  height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: var(--fill-strong);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 530;
  cursor: pointer;
  transition: background-color 0.13s ease, color 0.13s ease;
}
.pick:hover { background: color-mix(in srgb, var(--accent) 14%, var(--fill-strong)); color: var(--accent); }
.add-known { margin-top: 22px; }
.add-known summary { cursor: pointer; color: var(--muted); font-size: 13px; }

/* 存货匹配（对照页） */
.vault-match .section-label { margin-bottom: 2px; }
.vm-list { display: grid; gap: 4px; margin-top: 8px; }
.vm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--ink);
  transition: background-color 0.12s ease;
}
.vm-row:hover { background: var(--fill); text-decoration: none; }
.vm-title {
  flex: 1;
  min-width: 0;
  font-weight: 530;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vm-grade { flex: none; font-size: 12px; color: var(--muted); }
.vm-grade.g-urgent { color: var(--danger); }
.vm-grade.g-high { color: var(--wait); }
.vm-grade.g-middle { color: var(--muted); }
.vm-grade.g-low { color: var(--stop); }
.vm-tag { flex: none; font-size: 12px; font-weight: 540; color: var(--ok); }
.vm-where {
  flex: none;
  max-width: 42%;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vm-second { margin-top: 16px; }

.match { display: grid; gap: 8px; padding: 16px 0; border-top: 1px solid var(--line); }
.match:first-child { border-top: 0; }
.match form.inline, .match form { display: flex; gap: 8px; align-items: center; }

.shots { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.shots img { width: 160px; height: 120px; object-fit: cover; border-radius: var(--r-s); border: 1px solid var(--line); }

label small, .fine { color: var(--muted); font-size: 12px; font-weight: 400; }

.stack {
  display: grid;
  grid-template-rows: 16px auto;
  gap: 6px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
}
fieldset { border: 0; margin: 16px 0 0; padding: 0; }
legend { color: var(--muted); font-size: 12px; margin-bottom: 8px; }

.check {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  height: 32px;
  margin: 0 16px 0 0;
  color: var(--ink);
  font-size: 14px;
}
.check input { width: 16px; height: 16px; margin: 0; }
.check-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 16px; margin: 4px 0 8px; }

.ops { white-space: nowrap; }
.ops a { margin-right: 14px; font-size: 13px; }
.ops a:last-child { margin-right: 0; }
.ops a.danger { color: var(--danger); }

/* 双栏（个人设置） */
.split { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 16px; }
.profile { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.profile-card { padding: 26px 20px; text-align: center; }
.profile-card .avatar { width: 84px; height: 84px; margin: 0 auto 14px; font-size: 30px; }
.profile-card strong { font-size: 16px; font-weight: 650; letter-spacing: -0.015em; }
.profile-card form { margin-top: 16px; }
.tabs {
  display: flex;
  gap: 22px;
  padding: 4px 20px 0;
  border-bottom: 1px solid var(--line);
}
.tabs a {
  padding: 11px 2px 12px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.13s ease;
}
.tabs a:hover { color: var(--ink); }
.tabs a.is-on { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); font-weight: 590; }

.facts dl { margin: 0; }
.facts div {
  display: grid;
  grid-template-columns: 6.5em minmax(0, 1fr);
  gap: var(--col-gap);
  align-items: center;
  padding: var(--row-y) var(--row-x);
  border-bottom: 1px solid var(--line);
  font-size: var(--row-text);
  line-height: var(--row-lh);
}
.facts dd .quiet { margin-top: var(--sub-gap); }
.facts div:last-child { border-bottom: 0; }
.facts { padding: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.facts-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: var(--row-y) var(--row-x); border-top: 1px solid var(--line); }
.facts dl + .facts-actions { border-top: 1px solid var(--line); }
.facts-actions .ghost-link { margin-left: auto; color: var(--muted); font-size: var(--row-sub); }
.facts-actions .ghost-link:hover { color: var(--accent); }

.controls {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px 16px;
}
.controls form { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; }

.log ul { list-style: none; margin: 0; padding: 4px 0; max-height: 460px; overflow: auto; }
.log li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--line);
}
.log li:last-child { border-bottom: 0; }
.log time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; padding-top: 2px; }

/* 日历 */
.calendar { padding: 18px; }
.cal-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-grid > form { min-width: 0; }
.cal-grid > form .day { width: 100%; }
.cal-grid.head { margin-bottom: 6px; color: var(--muted); font-size: 11.5px; font-weight: 590; text-align: center; }
.cal-grid.head > span:nth-child(n + 6) { color: color-mix(in srgb, var(--danger) 55%, var(--muted)); }
.day {
  width: 100%;
  min-height: 64px;
  border: 0;
  border-radius: var(--r-s);
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  gap: 4px;
  text-align: center;
  transition: background-color 0.12s ease;
}
.day:hover { background: var(--fill); }
.day.out { color: var(--muted); }
.day.off { background: var(--fill); }
.day.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.day small { color: var(--muted); font-size: 11px; }
.day .narrow { display: none; }

/* 外观 / 平台设置 */
.appearance { padding: 4px 0 12px; }
.appearance dl { margin: 0 0 8px; }
.appearance div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  padding: 11px 20px;
}
.appearance dt { color: var(--muted); }
.appearance dd { margin: 0; }
.appearance form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 0 20px 8px; }
.site-facts div { grid-template-columns: 7.5em minmax(0, 1fr); }
.site-facts .actions { padding: 12px 20px 16px; }

.review-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 22px;
  border-bottom: 1px solid var(--line);
}
.review-line:last-child { border-bottom: 0; }
.review-line img { width: 40px; height: 40px; border-radius: var(--r-s); object-fit: cover; }
.review-line img.icon-preview {
  width: 44px;
  height: 44px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  object-fit: contain;
}
.review-line form { display: flex; gap: 8px; margin-left: auto; }

/* 邮件
   和其它列表同一套行节奏：行内边距、行首缩进、字号都走变量。
   主题列收窄，预览紧跟其后，时间和“详情”靠右但不挤，整体不再偏右。 */
.mail-box, .mail-read { width: 100%; }
.mail-table { width: 100%; table-layout: fixed; }
.mail-table col.c-subject { width: 16%; }
.mail-table col.c-preview { width: auto; }
.mail-table col.c-when { width: 8.5em; }
.mail-table col.c-act { width: 5em; }
.mail-table td { padding: 0; overflow-wrap: normal; }
.mail-table td.mail-toggle { padding: 0; }
.mail-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
  padding: var(--row-y) var(--row-x);
  color: inherit;
  font-size: var(--row-title);
  line-height: var(--row-lh);
  text-decoration: none;
}
.mail-table tr:hover td,
.mail-acc.is-open > tr:first-child td.mail-toggle { background: var(--fill); }
.mail-head:hover { background: transparent; text-decoration: none; }
.mail-name { flex: 1 1 auto; min-width: 0; font-weight: 590; }
.mail-count { margin: 0 0 0 auto; width: auto; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.mail-acc .chev { flex: 0 0 1rem; width: 1rem; font-size: 1.15em; line-height: 1; text-align: center; color: var(--muted); transition: transform 0.15s ease; }
.mail-acc.is-open .chev { transform: rotate(90deg); }
.mail-line td {
  padding: var(--row-y) calc(var(--col-gap) / 2);
  font-size: var(--row-text);
  white-space: nowrap;
}
.mail-line td:nth-child(-n + 2) {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mail-line td.quiet,
.mail-line td.end {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}
/* 展开后的邮件行和账号名对齐（箭头宽度 + 间距），层级一眼能看出来 */
.mail-line td:first-child { padding-left: calc(var(--row-x) + 1.75rem); color: var(--ink); }
/* 每个账号分组之间一条发丝线，折叠状态下也和其它列表一样有分隔 */
.mail-acc + .mail-acc > tr:first-child > td { border-top: 1px solid var(--line); }
.mail-line td:last-child { padding-right: var(--row-x); }
.mail-line td.quiet { font-size: var(--row-sub); text-align: right; font-variant-numeric: tabular-nums; }
.mail-table .end a { margin-left: 0; }
.mail-preview { color: var(--muted); }
.mail-body pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  margin: 0;
  padding: clamp(16px, 2vw, 28px);
  line-height: 1.7;
}

/* 移动端菜单按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  border-radius: var(--r-s);
  background: var(--paper);
  box-shadow: var(--shadow-card);
  cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--ink);
  position: relative;
}
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -5px; }
.nav-toggle span::after { top: 5px; }

/* ---------- 登录页 ---------- */

.gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 16px calc(max(24px, env(safe-area-inset-bottom)) + 56px);
  background: var(--bg);
}
.login-sheet {
  width: min(400px, 100%);
  padding: 36px 32px 30px;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 30px rgba(0, 0, 0, 0.05);
  text-align: center;
}
body.theme-dark .login-sheet { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px rgba(0, 0, 0, 0.4); }
.login-sheet h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.login-mark {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 15px;
  background: var(--fill);
  border: 1px solid var(--line);
}
.login-mark img { width: 40px; height: 40px; border-radius: 9px; object-fit: contain; }
.login-sheet .lede { margin-top: 7px; }
.login-sheet form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 26px;
  text-align: left;
}
.login-sheet .field { display: flex; flex-direction: column; gap: 7px; }
.fields-3 .field { grid-template-rows: 16px 36px; }
.login-sheet .field input { width: 100%; height: 42px; }
.login-sheet .btn { width: 100%; height: 42px; font-size: 14.5px; font-weight: 590; border-radius: 10px; }
.captcha-line {
  display: grid;
  grid-template-columns: 1fr 148px;
  gap: 8px;
  align-items: center;
}
.captcha-line input { width: 100%; min-width: 0; }
.captcha {
  display: block;
  width: 100%;
  height: 42px;
  border-radius: var(--r-s);
  border: 1px solid var(--line);
  background: #f5f5f7;
  object-fit: cover;
}
.login-sheet .fine { margin: 16px 0 0; }

.site-foot {
  margin-top: 36px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}
.site-foot p {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 12px;
  margin: 0;
}
.site-foot a { color: inherit; text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.login-foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  margin: 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: transparent;
}

/* 富文本编辑器 */
.writer {
  min-height: 240px;
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-m);
  background: var(--paper);
  line-height: 1.65;
  white-space: pre-wrap;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.writer:empty::before { content: attr(data-placeholder); color: var(--muted); }
.writer:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent) 18%, transparent);
}
.writer img { display: block; max-width: min(100%, 520px); margin: 10px 0; border-radius: 10px; }

/* ---------- 响应式 ---------- */

@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: var(--bg); }
  .nav-toggle { display: inline-flex; }
  .side {
    position: fixed;
    z-index: 30;
    left: 0;
    top: 0;
    width: min(280px, 86vw);
    height: 100vh;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }
  .shell.nav-open .side { transform: none; }
  .shell.nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(0, 0, 0, 0.35);
  }

  .entry { grid-template-columns: 1fr; gap: 6px; }
  .composer > .actions { margin-left: 0; }
  .entry > span { line-height: 16px; }
  .name-row { grid-template-columns: 1fr; }
  .main { padding: 20px 4% calc(36px + env(safe-area-inset-bottom)); overflow-x: hidden; }
  h1 { font-size: 1.55rem; }
  .meter { gap: 10px; }
  .meter div { padding: 12px 14px 13px; border-radius: 11px; }
  .meter strong { font-size: 20px; white-space: normal; overflow-wrap: anywhere; }
  .meter-1 { width: 100%; max-width: none; }
  .meter-4, .meter-7 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* 邮件行：主题整行 + 预览两行 + 时间/详情同行 */
  .mail-box, .mail-read { width: 100%; }
  .mail-table, .mail-table tbody, .mail-table tr, .mail-table td { display: block; width: 100%; }
  .mail-table col { display: none; }
  .mail-table tr.mail-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 10px;
    row-gap: 3px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
  }
  .mail-table tr.mail-line td {
    display: block;
    width: auto;
    max-width: none;
    padding: 0;
    border: 0;
  }
  .mail-table tr.mail-line td:first-child {
    grid-column: 1 / -1;
    grid-row: 1;
    font-weight: 590;
    font-size: 13.5px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .mail-line td.mail-preview {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    max-width: none;
    overflow: hidden;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .mail-line td.quiet {
    grid-column: 1;
    grid-row: 3;
    padding: 0;
    text-align: left;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
  }
  .mail-line td.end {
    grid-column: 2;
    grid-row: 3;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
  }
  .page-head { align-items: flex-start; flex-wrap: wrap; }
  .page-head .btn { margin-left: 0; }
  .fields, .fields.fields-3, .split, .profile { grid-template-columns: minmax(0, 1fr); }
  .filters, .appearance form, .controls, .controls form, .actions, .modal-actions { flex-wrap: wrap; }
  .filters { padding: 12px; gap: 10px 12px; }
  .filters label {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .filters label > span { flex: none; }
  .filters label > select, .filters label > input[name="q"] {
    flex: 1 1 110px;
    width: auto;
    max-width: 100%;
    min-width: 0;
  }
  .filters label > input[name="q"] { flex-basis: 100%; }
  .vault-cats > label,
  .vault-cats .vault-project { flex: 1 1 100%; max-width: none; }
  .filters .btn { flex: 0 1 auto; min-width: 84px; }
  .filters .btn.primary { margin-left: 0; }
  .page-head .head-actions { gap: 8px; }
  .pair, .inline-form { flex-wrap: wrap; }
  .pair input, .inline-form input { width: 100%; flex: 1 1 12rem; }
  .check-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  table { min-width: 0; }
  th { white-space: normal; }
  td { overflow-wrap: anywhere; }

  .plist-line.head { display: none; }
  .plist-line {
    grid-template-columns: minmax(0, 1fr) max-content;
    column-gap: 12px;
    row-gap: 0.55em;
    min-height: 0;
    padding: 0.85em 4%;
  }
  .plist-line > :nth-child(1) { grid-column: 1; min-width: 0; overflow-wrap: anywhere; }
  .plist-line > :nth-child(2) { padding-left: 0; }
  .plist-line > .more { grid-column: 2; grid-row: 1; justify-self: end; align-self: start; height: auto; min-width: max-content; }
  .plist-line > [data-label] { min-width: max-content; }
  .plist-line > [data-label] {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .plist-line > [data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.2;
  }
  .plist-accounts div {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    column-gap: 4%;
    row-gap: 0.35em;
  }
  .plist-accounts div > :nth-child(3) { grid-column: 1 / -1; overflow-wrap: anywhere; }

  table.cards colgroup { display: none; }
  /* 卡片布局下取消桌面端的“等高行”，否则每个字段都被撑开 */
  .bug-table tbody td { height: auto; }
  .bug-table td:nth-child(2) { grid-column: 1 / -1; }
  .bug-table td:nth-child(n + 3) { white-space: normal; }

  table.cards, table.cards thead, table.cards tbody, table.cards tr { display: block; width: 100%; }
  table.cards thead { display: none; }
  table.cards tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
  }
  table.cards td {
    display: block;
    width: auto !important;
    max-width: none;
    min-width: 0;
    padding: 0;
    border: 0;
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
  }
  table.cards td:first-child { grid-column: 1 / -1; }
  table.cards td.end { grid-column: 1 / -1; text-align: left; }
  table.cards td.end a:first-child { margin-left: 0; }
  table.cards td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.2;
  }
  table.notices td:first-child { grid-column: auto; }
  table.notices td:nth-child(3) { grid-column: 1 / -1; order: -1; }
  table.cards td.ops { grid-column: 1 / -1; white-space: normal; }
  table.audit td:first-child { grid-column: auto; }
  table.audit td:nth-child(4) { grid-column: 1 / -1; order: -1; }

  /* 库存表：卡片化，勾选框放右上角 */
  table.vault-table, table.vault-table tbody, table.vault-table tr, table.vault-table td { display: block; width: 100%; }
  table.vault-table thead, table.vault-table colgroup { display: none; }
  table.vault-table tr {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 7px 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
  }
  table.vault-table tr:last-child { border-bottom: 0; }
  table.vault-table td {
    display: block;
    width: auto !important;
    max-width: none;
    min-width: 0;
    padding: 0;
    border: 0;
    overflow: visible;
    color: var(--ink);
    line-height: 1.45;
  }
  table.vault-table td:first-child {
    position: absolute;
    top: 16px;
    right: 14px;
    width: auto;
    text-align: right;
  }
  table.vault-table td:first-child input[type="checkbox"] { width: 18px; height: 18px; }
  table.vault-table td:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 1;
    padding-right: 34px;
  }
  table.vault-table td:nth-child(2) .row-title {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  table.vault-table td[data-label] {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    color: var(--ink);
    font-size: 13px;
  }
  table.vault-table td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 590;
    line-height: 1.2;
  }
  table.vault-table td[data-label="用户"] { grid-column: 1 / -1; }

  .pool i { width: 56px; }
  .day { min-height: 3.2em; padding: 0.2em; }
  .day .wide { display: none; }
  .day .narrow { display: inline; }
  .cal-grid { gap: 0.35em; }
  .log li { grid-template-columns: 6.8em minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .login-sheet { padding: 26px 20px 24px; }
  .captcha-line { grid-template-columns: 1fr; gap: 6px; }
  .captcha-line .captcha { height: 42px; }
  .facts div, .appearance div { grid-template-columns: minmax(4.5em, 32%) minmax(0, 1fr); gap: 0.6em; }
  .facts dd, .appearance dd { min-width: 0; overflow-wrap: anywhere; }
}
