/* 通用组件：按钮、表单、筛选条、卡片、网格、表格、徽标、提示框、空态 / 加载态、弹窗、提示（docs/reference/10 §2.3.2）。 */

/* 文字工具 */
/* 辅助文字：.sub = 次要信息（姓名下的邮箱），.note = 说明段落；同用 --fs-sub */
.sub { color: var(--muted); font-size: var(--fs-sub); }
.note { font-size: var(--fs-sub); color: var(--muted); }
.strong { font-weight: 600; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); }
.wrap-any { overflow-wrap: anywhere; }
.c-green { color: var(--green); font-weight: 600; } .c-blue { color: var(--blue); font-weight: 600; }
.c-purple { color: var(--purple); font-weight: 600; }
.c-red { color: var(--red); font-weight: 600; } .c-orange { color: var(--orange); font-weight: 600; } .c-muted { color: var(--muted); }
.c-ink { color: var(--ink); }
.fs-sub { font-size: var(--fs-sub); }

/* 布局工具 */
.row { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; min-width: 0; }
.row.gap-3 { gap: var(--sp-3); } .row.gap-4 { gap: var(--sp-4); }
.stack { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.stack.gap-2 { gap: var(--sp-2); } .stack.gap-4 { gap: var(--sp-4); }
.grow { flex: 1; min-width: 0; }

/* 按钮：每区最多一个实心主按钮（.primary），其余描边 */
.btn { height: var(--ctl-h); padding: 0 var(--sp-4); border-radius: var(--r-ctl); border: 1px solid var(--ctl-border); background: var(--surface); cursor: pointer; font-size: var(--fs-body); white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); color: var(--ink); }
.btn:hover { background: var(--hover); border-color: var(--ctl-border-strong); color: var(--ink); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-accent); font-weight: 600; box-shadow: var(--sh-1); }
.btn.primary:hover { opacity: .92; background: var(--brand); border-color: var(--brand); color: var(--on-accent); }
.btn.danger { color: var(--red); border-color: var(--red-line); }
.btn.danger.solid { background: var(--red); border-color: var(--red); color: var(--on-accent); font-weight: 600; }
.btn.sm { height: var(--ctl-h-sm); padding: 0 var(--sp-3); font-size: var(--fs-sub); }
.btn.lg { height: var(--ctl-h-lg); padding: 0 var(--sp-5); font-size: var(--fs-h3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.busy { opacity: .7; cursor: progress; pointer-events: none; }
.btn.link { border: none; background: none; color: var(--blue); padding: 0; height: auto; }
.btn.link.danger { color: var(--red); }
/* 图标按钮：正方形，内容只放 SVG，必须带 aria-label（ui.js iconBtn） */
.btn.icon { width: var(--ctl-h); padding: 0; }
.btn.icon.sm { width: var(--ctl-h-sm); }
.btn.icon svg { width: 16px; height: 16px; flex: none; }
/* 分段控件（.segctl）：天数 / 时段 / 表单与 JSON 切换等互斥选项；.seg 留给柱图分段 */
.segctl { display: inline-flex; padding: 3px; border-radius: calc(var(--r-ctl) + 2px); background: var(--surface-2); gap: 2px; }
.segctl button, .segctl a { flex: 1; height: var(--ctl-h-sm); padding: 0 var(--sp-3); border: none; border-radius: var(--r-tag); background: transparent; color: var(--ink-2); font-size: var(--fs-sub); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.segctl button:hover, .segctl a:hover { color: var(--ink); }
.segctl button.on, .segctl a.on { background: var(--pill); color: var(--ink); font-weight: 600; box-shadow: var(--sh-1); }

/* 表单 */
input[type=text], input[type=search], input[type=number], input[type=datetime-local], select, textarea { height: var(--ctl-h); border-radius: var(--r-ctl); border: 1px solid var(--ctl-border); padding: 0 var(--sp-3); font-size: var(--fs-body); background: var(--surface); min-width: 0; }
textarea { height: auto; padding: var(--sp-2) var(--sp-3); resize: vertical; font-family: var(--mono); }
/* 键盘聚焦才画轮廓（鼠标点击不出现）；用 outline 而不是只换边框色，对比度够，高对比模式下也看得见。 */
input:focus, select:focus, textarea:focus { border-color: var(--focus); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
input[readonly] { background: var(--ground); color: var(--ink-2); }
label.f { display: flex; flex-direction: column; gap: var(--sp-1); font-size: var(--fs-sub); min-width: 0; }
label.f > span:first-child { color: var(--muted); }
label.f[hidden] { display: none; }
label.chk { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sub); cursor: pointer; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
.form-stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.form-stack .note { margin-top: var(--sp-1); }
.checks { display: flex; gap: var(--sp-5); flex-wrap: wrap; }
.input-sm { width: 220px; }
/* 策略设置里的 DNS 列表：一行 = 传输方式 + 地址 + 端口 + DoH 路径 + 删除；窄屏自动换行。 */
.dns-list { display: flex; flex-direction: column; gap: var(--sp-2); align-items: flex-start; }
.dns-list > [data-dns-rows] { display: flex; flex-direction: column; gap: var(--sp-2); width: 100%; }
.dns-head { display: flex; align-items: baseline; gap: var(--sp-2); font-size: var(--fs-sub); }
.dns-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; min-width: 0; }
.dns-row select { width: 96px; }
.dns-row .addr { flex: 1 1 180px; }
.dns-row .port { width: 100px; }
.dns-row .path { flex: 1 1 140px; }
/* 域名解析页签：域名条件列可换行，操作列不换行。 */
.dns-rules .dns-cond { overflow-wrap: anywhere; min-width: 12em; }
.dns-rules td:last-child .btn + .btn { margin-left: var(--sp-1); }

/* 筛选条：控件 36px 高、间距 8，右侧计数灰字；窄屏换行 */
.filters { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.filters input[type=search] { width: 260px; }
.filters.bottom { align-items: flex-end; }
.filters .count { color: var(--muted); font-size: var(--fs-sub); white-space: nowrap; }

/* 卡片：避免卡中卡，卡内分段用 .section */
.card { background: var(--surface); box-shadow: var(--sh-2); border-radius: var(--r-card); padding: var(--sp-5) var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; gap: 0; }
.card.offline { margin: 48px auto; max-width: 420px; }
.card .retry { align-self: flex-start; }
.card ul.plain { margin: 0; padding-left: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2); }
.choices { display: flex; flex-direction: column; gap: var(--sp-2); }
.choices.row { flex-direction: row; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); }
.choice { display: flex; align-items: flex-start; gap: var(--sp-2); cursor: pointer; font-weight: 400; }
.choice input { margin-top: var(--sp-1); }
.choice.disabled { cursor: not-allowed; color: var(--muted); }
.choice .sub { display: block; }
.steps { display: flex; gap: var(--sp-2); margin: 0 0 var(--sp-1); padding: 0; list-style: none; }
.steps li { flex: 1; }
.steps button { width: 100%; display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2); border: 1px solid var(--border-mid); border-radius: var(--r-ctl); background: var(--surface); color: var(--muted); cursor: pointer; font: inherit; }
.steps button .n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ctl-border-strong); color: var(--surface); font-size: var(--fs-xs); }
.steps button.on { border-color: var(--brand); color: var(--ink); font-weight: 600; }
.steps button.on .n, .steps button.done .n { background: var(--brand); }
[data-step-error]:empty { display: none; }
details.adv { border-top: 1px solid var(--border); padding-top: var(--sp-3); }
details.adv > summary { cursor: pointer; color: var(--muted); margin-bottom: 8px; }
.block-reason { max-width: 280px; margin: 0 0 var(--sp-2) auto; text-align: left; white-space: normal; }
.card .head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.card .head .meta { color: var(--muted); font-size: var(--fs-sub); }
.card.flush .head { padding: var(--sp-4) var(--sp-6); border-bottom: 1px solid var(--border-soft); }
.card.flush > .note, .card.flush > .card-foot { padding: var(--sp-2) var(--sp-6) var(--sp-3); }
.card .card-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); border-top: 1px solid var(--border-soft); color: var(--muted); font-size: var(--fs-sub); }
.card.flush > .card-foot { padding: var(--sp-3) var(--sp-6); }
.card.pick { padding: var(--sp-4); gap: var(--sp-2); color: var(--ink); }
.card.pick:hover { box-shadow: 0 0 0 1px var(--faint), var(--sh-2); color: var(--ink); }
.card.pick.on { box-shadow: 0 0 0 1.5px var(--brand), var(--sh-2); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--sp-4); align-items: start; }
.stat { gap: var(--sp-1); }
.stat .label .kdot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--seg-direct); }
.stat .label .kdot.green { background: var(--green); } .stat .label .kdot.blue { background: var(--blue); } .stat .label .kdot.red { background: var(--red); } .stat .label .kdot.orange { background: var(--orange); }
.stat .label { font-size: var(--fs-sub); color: var(--muted); display: flex; align-items: center; gap: var(--sp-2); }
.stat .value { font-size: var(--fs-stat); font-weight: 650; letter-spacing: -.02em; line-height: 1.3; font-variant-numeric: tabular-nums; }
.stat .spark { display: block; width: 100%; height: 28px; margin-top: var(--sp-1); color: var(--blue); }
.stat .spark.green { color: var(--green); }
.stat .spark path.line { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.stat .spark path.area { fill: currentColor; opacity: .12; stroke: none; }
.stat .note { font-size: var(--fs-sub); }
.kv { display: flex; justify-content: space-between; gap: var(--sp-3); color: var(--ink-2); min-width: 0; }
.kv > span:first-child { color: var(--muted); flex: none; }
.kv > span:last-child { min-width: 0; overflow-wrap: anywhere; text-align: right; }
.kv.sep { padding-top: var(--sp-2); border-top: 1px solid var(--border-soft); }

/* 表格：单元格 15，默认密度 上下 12 / 左右 16（行高 ≥ 44），.dense 上下 8 / 左右 12；首尾列与卡片标题对齐 */
.table-wrap { overflow-x: auto; }
.table-wrap.scroll { max-height: 60vh; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-body); }
th { text-align: left; padding: var(--sp-2) var(--sp-4); background: none; border-bottom: 1px solid var(--border); color: var(--muted); font-weight: 500; white-space: nowrap; font-size: var(--fs-sub); letter-spacing: .02em; }
td { padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--border-soft); vertical-align: middle; }
tbody tr:first-child td { border-top: none; }
tbody tr:hover td { background: var(--hover); }
.card.flush th:first-child, .card.flush td:first-child { padding-left: var(--sp-6); }
.card.flush th:last-child, .card.flush td:last-child { padding-right: var(--sp-6); }
table.dense th, table.dense td { padding: var(--sp-2) var(--sp-3); }
table.dense th:first-child, table.dense td:first-child { padding-left: 0; }
table.dense th { background: none; border-bottom: 1px solid var(--border); }
th.center, td.center { text-align: center; }
tr.hl td { background: var(--row-hl); }
tr.sel td { background: var(--row-sel); }
tr.click { cursor: pointer; }
tr.click.noclick { cursor: default; }
tbody tr.click.noclick:hover td { background: transparent; }
tbody tr.hl:hover td { background: var(--row-hl); }
tbody tr.sel:hover td { background: var(--row-sel); }
tbody tr.hl.click:hover td, tbody tr.sel.click:hover td { background: var(--hover); }
/* 身份列：头像 + 双行（姓名 / 邮箱） */
.who { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.who > div { min-width: 0; line-height: 1.35; }
.who .sub { overflow: hidden; text-overflow: ellipsis; }
tr[draggable=true] { cursor: grab; }

/* 徽标、标签、横条 */
/* 徽标只表状态；.dot 前置语义色圆点（在线 / 离线、线路启用 / 停用） */
.badge { display: inline-block; padding: 0 var(--sp-2); border-radius: var(--r-pill); font-weight: 600; font-size: var(--fs-xs); white-space: nowrap; line-height: 20px; }
.badge.dot::before { content: ''; display: inline-block; width: 6px; height: 6px; margin: 0 var(--sp-1) 1px 0; border-radius: 50%; background: currentColor; vertical-align: middle; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.blue { background: var(--blue-bg); color: var(--blue); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.orange { background: var(--orange-bg); color: var(--orange); }
.badge.purple { background: var(--purple-bg); color: var(--purple); }
.badge.gray { background: var(--surface-2); color: var(--muted); }
/* 品牌红淡底：超级管理员等角色徽标（与顶栏的 .brand 标签区分，所以自带圆角与内边距） */
.badge.brand { padding: 0 var(--sp-2); border-radius: var(--r-pill); background: var(--brand-bg); color: var(--brand); }
.badges { display: inline-flex; flex-wrap: wrap; gap: var(--sp-1); }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip { padding: var(--sp-1) var(--sp-2); border-radius: var(--r-tag); background: var(--brand-bg); color: var(--brand); font-weight: 600; font-size: var(--fs-sub); display: inline-flex; gap: var(--sp-2); align-items: center; }
.chip.blue { background: var(--blue-bg); color: var(--blue); }
.chip button { border: none; background: none; cursor: pointer; color: inherit; padding: 0; font-size: var(--fs-sub); }
.bar { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sub); }
.bar .name { width: 160px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .track { flex: 1; height: 8px; border-radius: var(--r-tag); background: var(--surface-2); overflow: hidden; }
.bar .fill { display: block; height: 100%; background: var(--red); }
.bar .num { width: 44px; text-align: right; font-weight: 600; }

/* 提示框家族（docs/reference/10 §3.3.3）：左侧 3px 语义色条 + 16px 图标位 + 内容（可含 b 标题 / 正文 / .actions）。
   .notice.info / success / warning / danger 是标准写法（ui.js notice()）；.modal-alert 是弹窗顶部错误条（ui.js 按这个类名找），声明与 .notice.danger.compact 一致。 */
.notice, .modal-alert { padding: var(--sp-3) var(--sp-4); border-radius: var(--r-ctl); color: var(--ink); font-size: var(--fs-body); line-height: 1.5; min-width: 0; }
.notice, .notice.info { background: var(--blue-bg); box-shadow: inset 3px 0 0 var(--blue); }
.notice.success { background: var(--green-bg); box-shadow: inset 3px 0 0 var(--green); }
.notice.warning { background: var(--orange-bg); box-shadow: inset 3px 0 0 var(--orange); }
.notice.danger, .modal-alert { background: var(--red-bg); box-shadow: inset 3px 0 0 var(--red); }
.notice { display: flex; align-items: flex-start; gap: var(--sp-3); }
/* 图标位：16px 实心圆 + 一个字形 */
.notice::before, .modal-alert::before { content: "i"; flex: none; width: 16px; height: 16px; margin-top: 3px; border-radius: 50%; background: var(--blue); color: var(--on-accent); font-size: var(--fs-axis); font-weight: 700; line-height: 16px; text-align: center; }
.notice.success::before { content: "\2713"; background: var(--green); }
.notice.warning::before { content: "!"; background: var(--orange); }
.notice.danger::before, .modal-alert::before { content: "!"; background: var(--red); }
.notice > .notice-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.notice b { font-weight: 600; }
.notice .actions { margin-top: var(--sp-1); }
/* 紧凑：弹窗顶部错误、表单行内错误 */
.notice.compact, .modal-alert { padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sub); }
.notice.compact::before, .modal-alert::before { margin-top: 2px; }
.modal-alert { display: flex; align-items: flex-start; gap: var(--sp-2); }
.modal-alert:empty { display: none; }
/* 中性容器（设备状态等）：灰底、无语义色 */
.panel { padding: var(--sp-2) var(--sp-3); border-radius: var(--r-ctl); background: var(--ground); box-shadow: none; display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
pre.code { margin: 0; padding: var(--sp-3); border-radius: var(--r-ctl); background: var(--code-bg); color: var(--code-ink); font-size: var(--fs-xs); line-height: 1.5; overflow: auto; }

/* 空态：一句话 + 可选操作；「没有匹配的 X」用于筛选为空，「暂无 X」用于本来没有 */
.empty { padding: var(--sp-8) var(--sp-6); text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); }
td.empty { display: table-cell; padding: var(--sp-6); }
.empty .empty-icon { width: 24px; height: 24px; color: var(--faint); }
.empty .empty-icon svg { width: 24px; height: 24px; display: block; }
.empty .empty-title { color: var(--ink); font-size: var(--fs-h3); font-weight: 600; }
.empty .actions { margin-top: var(--sp-2); justify-content: center; }
/* 加载态：骨架条 */
.loading { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-4) 0; }
.loading .sk { height: 16px; border-radius: var(--r-tag); background: linear-gradient(90deg, var(--surface-2) 0%, var(--ground) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; }
.loading .sk:nth-child(1) { width: 40%; } .loading .sk:nth-child(2) { width: 85%; } .loading .sk:nth-child(3) { width: 65%; }
.card .loading, td .loading { padding: var(--sp-2) 0; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .loading .sk { animation: none; } }

/* 弹窗：可叠在抽屉之上 */
.modal-bg { position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: center; justify-content: center; z-index: var(--z-modal); padding: var(--sp-4); }
.modal { width: var(--modal-w); max-width: 100%; max-height: 90vh; overflow: auto; background: var(--surface); border-radius: var(--r-panel); padding: var(--sp-5) var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-3); box-shadow: var(--shadow-panel); }
.modal.w-720 { width: var(--modal-w-lg); } .modal.w-760 { width: var(--modal-w-xl); }
.modal h2 { font-size: var(--fs-h2); }
.modal .body { display: flex; flex-direction: column; gap: var(--sp-3); }
.modal .foot { display: flex; justify-content: flex-end; gap: var(--sp-2); padding-top: var(--sp-2); }

/* 提示 */
/* 提示容器 #toasts（index.html）：多条提示纵向堆叠，新的在下；容器本身不挡点击，只有提示可点。 */
.toasts { position: fixed; right: var(--sp-6); bottom: var(--sp-6); display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-2); max-width: calc(100vw - 48px); z-index: var(--z-toast); pointer-events: none; }
.toasts .toast { position: static; pointer-events: auto; cursor: pointer; }
.toast { position: fixed; right: var(--sp-6); bottom: var(--sp-6); max-width: calc(100vw - 48px); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-card); color: var(--on-accent); font-weight: 600; font-size: var(--fs-body); box-shadow: var(--shadow-toast); z-index: var(--z-toast); background: var(--green); }
.toast.err { background: var(--red); cursor: pointer; }
.toast.info { background: var(--ink-2); }

@media (max-width: 1200px) { .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1050px) {
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
  /* 宽表格保持可读列宽，放不下时横向滚动 */
  .table-wrap > table { min-width: 680px; }
}
@media (max-width: 760px) {
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .filters input[type=search] { width: 100%; }
  .modal { padding: var(--sp-4); }
  .card { padding: var(--sp-4); }
  .card.flush .head { padding: var(--sp-3) var(--sp-4); }
  .card.flush th:first-child, .card.flush td:first-child { padding-left: var(--sp-4); }
  .card.flush th:last-child, .card.flush td:last-child { padding-right: var(--sp-4); }
  .toast { right: var(--sp-4); bottom: var(--sp-4); }
  .toasts { right: var(--sp-4); bottom: var(--sp-4); }
}

/* 开始使用清单（总览） */
ol.setup { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.setup li { display: flex; gap: var(--sp-3); align-items: flex-start; }
.setup .mark { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: var(--fs-xs); font-weight: 600; border: 1px solid var(--border); color: var(--muted); }
.setup li.done .mark { background: var(--green-bg); color: var(--green); border-color: transparent; }
.setup .t { font-weight: 600; }
.setup li.done .t { color: var(--muted); font-weight: 400; }
/* 弹窗里的分段表单 */
.form-sec { display: flex; flex-direction: column; gap: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--border-soft); }
.form-sec:first-child { padding-top: 0; border-top: none; }
.form-sec h3 { font-size: var(--fs-h3); }
/* 角色说明 */
.role-desc .note { padding: var(--sp-2) var(--sp-3); border-radius: var(--r-ctl); background: var(--ground); color: var(--ink-2); font-size: var(--fs-sub); line-height: 1.5; }

/* 进度条（docs/reference/07 §2.5）：连通性检测进度；内层宽度由内联 width 百分比给出，组件函数 progressBar 在 ui.js */
.progress-row { display: flex; flex-direction: column; gap: var(--sp-1); font-size: var(--fs-sub); color: var(--muted); }
/* 进度条右侧放操作（如「取消」）时，条占满剩余宽度 */
.progress-line { display: flex; align-items: center; gap: var(--sp-3); }
.progress-line .progress { flex: 1; }
.progress { height: 6px; border-radius: var(--r-tag); background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: var(--blue); transition: width var(--dur); }
/* 拖放区：点击或键盘 Enter / 空格选文件，拖入文件时加 .over；子元素不接管鼠标事件，避免拖动时反复闪烁 */
.dropzone { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-4); border: 1px dashed var(--ctl-border); border-radius: var(--r-card); text-align: center; color: var(--muted); font-size: var(--fs-sub); cursor: pointer; }
.dropzone:hover { background: var(--hover); }
.dropzone:focus-visible, .dropzone.over { border-color: var(--focus); background: var(--blue-bg); }
.dropzone > * { pointer-events: none; }
/* 导入预览的数量卡片：每格复用 .stat 的字号刻度 */
.import-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: var(--sp-2); }
.import-stats .stat { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-ctl); background: var(--ground); }
.import-stats .stat .value { font-size: var(--fs-h1); }
.import-text { width: 100%; min-height: 96px; }
/* 弹窗里的明细列表（导入预览）：去掉浏览器默认外边距 */
.modal ul.plain { margin: 0; padding-left: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-1); }
/* 卡片里的进度条：与表头同样的左右留白 */
.card.flush > .progress-row { padding: var(--sp-3) var(--sp-6); border-bottom: 1px solid var(--border-soft); }
@media (max-width: 760px) { .card.flush > .progress-row { padding: var(--sp-3) var(--sp-4); } }

/* 行操作菜单（docs/reference/10 §3.3.3）：「…」图标按钮弹出，固定定位，位置由 ui.js menuBtn 计算（按钮下方，空间不足翻上）。
   role="menu"，项是 .menu-item[role=menuitem]；危险项红字放最后，用 .menu-sep 隔开。 */
.menu { position: fixed; z-index: var(--z-dp); min-width: 160px; max-width: calc(100vw - 32px); overflow: auto; padding: var(--sp-1); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-pop); }
.menu-item { width: 100%; height: var(--ctl-h); padding: 0 var(--sp-3); display: flex; align-items: center; gap: var(--sp-2); border: none; border-radius: var(--r-ctl); background: none; color: var(--ink); font-size: var(--fs-body); text-align: left; white-space: nowrap; cursor: pointer; }
.menu-item:hover, .menu-item:focus { background: var(--hover); }
.menu-item:focus-visible { outline-offset: -2px; }
.menu-item.danger { color: var(--red); }
.menu-item:disabled { opacity: .5; cursor: not-allowed; background: none; }
.menu-sep { height: 0; margin: var(--sp-1) 0; border-top: 1px solid var(--border-soft); flex: none; }

/* 定义列表（docs/reference/10 §3.3.3）：标签在上、值在下的两列网格，替代 .grid2 里的 .kv；.wide 的项跨两列，长值可任意处换行 */
.dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4) var(--sp-6); margin: 0; min-width: 0; }
.dl > div { min-width: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.dl dt { margin: 0; color: var(--muted); font-size: var(--fs-sub); }
.dl dd { margin: 0; font-size: var(--fs-body); overflow-wrap: anywhere; }
.dl .wide { grid-column: 1 / -1; }
@media (max-width: 760px) { .dl { grid-template-columns: minmax(0, 1fr); } }
