/* =========================================================================
 * merit.css — 综测算分器样式
 * 依赖 /ui/colors_and_type.css 的 dsk-* 设计令牌（深色为默认，浅色走 [data-theme=light]）
 * ========================================================================= */

/* ----------------------------------------------------------- 基础 */
* { box-sizing: border-box; }

/* 次级文字提亮一档：站点默认的 subtle 在卡片上只有 3.4:1，
   11px 的小字读起来偏灰，这里按页面作用域覆盖（不影响其它页面） */
:root[data-theme="dark"] { --dsk-foreground-subtle: #8f94ab; }
:root[data-theme="light"] { --dsk-foreground-subtle: #5f6379; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	padding-top: var(--site-nav-height, 44px);
	min-height: 100vh;
	background-image: var(--dsk-page-bg);
	background-attachment: fixed;
	color: var(--dsk-foreground);
	font-family: var(--dsk-font-sans);
	font-size: var(--dsk-text-base);
	line-height: var(--dsk-leading-normal);
	-webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
mark { background: var(--dsk-accent-soft); color: var(--dsk-accent); border-radius: 3px; padding: 0 2px; }
:focus-visible { outline: 2px solid var(--dsk-ring); outline-offset: 2px; }

.ico { flex: none; display: block; }

.pos { color: var(--dsk-success); }
.neg { color: var(--dsk-danger); }
.na { color: var(--dsk-foreground-subtle); }
.muted { color: var(--dsk-foreground-muted); font-size: var(--dsk-text-sm); }
.flag { color: var(--dsk-warning); font-style: normal; }
code {
	font-family: var(--dsk-font-mono);
	font-size: 12px;
	padding: 1px 5px;
	border-radius: 4px;
	background: var(--dsk-muted);
}

/* ----------------------------------------------------------- 布局 */
.shell {
	display: grid;
	grid-template-columns: 236px minmax(0, 1fr);
	align-items: start;
	min-height: calc(100vh - var(--site-nav-height, 44px));
}

.side {
	position: sticky;
	top: var(--site-nav-height, 44px);
	height: calc(100vh - var(--site-nav-height, 44px));
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 18px 12px 14px;
	border-right: 1px solid var(--dsk-border-subtle);
	background: linear-gradient(180deg, rgba(107, 93, 194, 0.07), transparent 42%);
	overflow: hidden;
}

.side-top { padding: 0 6px 14px; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 10px;
	color: #fff;
	background: linear-gradient(135deg, var(--dsk-purple-400), var(--dsk-accent));
	box-shadow: 0 4px 14px rgba(107, 93, 194, 0.35);
}
.brand-txt { display: flex; flex-direction: column; min-width: 0; }
.brand-txt b { font-size: 15px; letter-spacing: -0.01em; }
.brand-txt i {
	font-style: normal;
	font-size: 11px;
	color: var(--dsk-foreground-subtle);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.side-nav { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 8px; }
.side-nav::-webkit-scrollbar { width: 4px; }
.side-nav::-webkit-scrollbar-thumb { background: var(--dsk-border); border-radius: 4px; }

.nav-group { margin-bottom: 12px; }
.nav-group-t {
	display: block;
	padding: 0 10px 6px;
	font-size: 11px;
	letter-spacing: 0.08em;
	color: var(--dsk-foreground-subtle);
}
.nav-item {
	position: relative;
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 8px 10px;
	margin-bottom: 2px;
	border-radius: 9px;
	color: var(--dsk-foreground-muted);
	transition: background .16s ease, color .16s ease, transform .16s ease;
}
.nav-item:hover { background: var(--dsk-primary-soft); color: var(--dsk-foreground); }
.nav-item.is-on {
	background: linear-gradient(100deg, var(--dsk-primary-soft), rgba(36, 240, 234, 0.08));
	color: var(--dsk-foreground);
	font-weight: 600;
}
.nav-item.is-on::before {
	content: "";
	position: absolute;
	left: -12px;
	top: 8px;
	bottom: 8px;
	width: 3px;
	border-radius: 0 3px 3px 0;
	background: linear-gradient(180deg, var(--dsk-purple-300), var(--dsk-accent));
}
.nav-ico { color: var(--dsk-purple-300); transition: color .16s ease; }
.nav-item.is-on .nav-ico { color: var(--dsk-accent); }
.nav-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-score {
	font-family: var(--dsk-font-mono);
	font-size: 12px;
	color: var(--dsk-foreground-subtle);
}

.side-foot {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 8px 0;
	border-top: 1px solid var(--dsk-border-subtle);
	font-size: 11px;
	color: var(--dsk-foreground-subtle);
}
.cloud-tag {
	flex: none;
	padding: 2px 7px;
	border-radius: 999px;
	font-size: 11px;
	border: 1px solid var(--dsk-border);
	background: var(--dsk-muted);
	color: var(--dsk-foreground-muted);
}
.cloud-tag[data-state="cloud"] { color: var(--dsk-success); border-color: rgba(36, 240, 234, 0.35); background: var(--dsk-accent-soft); }
.cloud-tag[data-state="sync"] { color: var(--dsk-info); border-color: rgba(107, 140, 255, 0.4); }
.cloud-tag[data-state="err"] { color: var(--dsk-danger); border-color: rgba(232, 93, 106, 0.4); }
.side-note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .2s ease; }
.side-note.is-flash { color: var(--dsk-accent); }

.main { min-width: 0; display: flex; flex-direction: column; min-height: calc(100vh - var(--site-nav-height, 44px)); }

/* ----------------------------------------------------------- 顶栏 */
.topbar {
	position: sticky;
	top: var(--site-nav-height, 44px);
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 22px;
	border-bottom: 1px solid var(--dsk-border-subtle);
	background: color-mix(in srgb, var(--dsk-background) 82%, transparent);
	backdrop-filter: blur(14px) saturate(140%);
}
.tb-profile {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 5px 12px 5px 6px;
	border: 1px solid var(--dsk-card-border);
	border-radius: 999px;
	background: var(--dsk-card);
	cursor: pointer;
	max-width: 42%;
	transition: border-color .16s ease, transform .16s ease;
}
.tb-profile:hover { border-color: var(--dsk-accent-ring); transform: translateY(-1px); }
.tb-avatar {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--dsk-primary-soft);
	color: var(--dsk-purple-200);
}
.tb-pname { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-pyear { font-size: 11px; color: var(--dsk-foreground-subtle); white-space: nowrap; }

.tb-score { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.tb-seg, .tb-total {
	display: flex;
	align-items: baseline;
	gap: 4px;
	padding: 4px 9px;
	border-radius: 8px;
	border: 1px solid transparent;
	background: var(--dsk-muted);
	white-space: nowrap;
	transition: border-color .16s ease, background .16s ease;
}
.tb-seg:hover, .tb-total:hover { border-color: var(--dsk-accent-ring); }
.tb-seg span, .tb-total span { font-size: 11px; color: var(--dsk-foreground-subtle); }
.tb-seg b, .tb-total b { font-family: var(--dsk-font-mono); font-size: 13px; }
.tb-seg i, .tb-total i { font-style: normal; font-size: 10px; color: var(--dsk-foreground-subtle); }
.tb-seg .bar { display: none; }
.tb-total { background: linear-gradient(120deg, var(--dsk-primary-soft), var(--dsk-accent-soft)); }
.tb-total b { font-size: 15px; color: var(--dsk-accent); }
.tb-gap {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 11px;
	padding: 3px 8px;
	border-radius: 999px;
	background: var(--dsk-muted);
}
.tb-gap.is-neg { color: var(--dsk-warning); }
.tb-gap.is-pos { color: var(--dsk-success); }

.tb-acts { display: flex; align-items: center; gap: 4px; }

/* 档案切换菜单 */
.tb-wrap { position: relative; display: inline-flex; max-width: 42%; }
.tb-menu {
	display: none;
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 60;
	min-width: 252px;
	max-width: min(320px, 84vw);
	padding: 6px;
	border-radius: 11px;
	border: 1px solid var(--dsk-popover-border);
	background: var(--dsk-popover);
	box-shadow: var(--dsk-shadow-lg);
}
.tb-menu[data-open="1"] { display: block; }
.tb-mi {
	width: 100%;
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-areas: "name score" "meta score";
	gap: 0 10px;
	padding: 7px 9px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	text-align: left;
	cursor: pointer;
}
.tb-mi:hover { background: var(--dsk-primary-soft); }
.tb-mi.is-on { background: var(--dsk-accent-soft); }
.tb-mi-name { grid-area: name; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-mi-meta { grid-area: meta; font-size: 10.5px; color: var(--dsk-foreground-subtle); }
.tb-mi-score { grid-area: score; align-self: center; font-family: var(--dsk-font-mono); font-size: 13px; color: var(--dsk-accent); }
.tb-mi.is-plain {
	display: flex;
	align-items: center;
	gap: 7px;
	grid-template-columns: none;
	font-size: 12px;
	color: var(--dsk-foreground-muted);
}
.tb-mi-sep { height: 1px; margin: 5px 4px; background: var(--dsk-border-subtle); }

.view { flex: 1; padding: 22px 22px 40px; }
.foot {
	padding: 18px 22px 26px;
	border-top: 1px solid var(--dsk-border-subtle);
	font-size: 11px;
	color: var(--dsk-foreground-subtle);
	line-height: 1.7;
}
.foot-w { opacity: .8; }

/* ----------------------------------------------------------- 页面 */
.page { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.page-head { position: relative; padding: 2px 0 4px; }
.page-title { font-size: var(--dsk-text-2xl); font-weight: 650; letter-spacing: -0.02em; }
.page-sub { margin-top: 4px; font-size: var(--dsk-text-sm); color: var(--dsk-foreground-muted); max-width: 66ch; }
.page-metric {
	position: absolute;
	right: 0;
	top: 0;
	display: flex;
	align-items: baseline;
	gap: 4px;
	font-family: var(--dsk-font-mono);
}
.page-metric b { font-size: 26px; color: var(--dsk-accent); }
.page-metric span { font-size: 11px; color: var(--dsk-foreground-subtle); }

.grid2 { display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* ----------------------------------------------------------- 卡片 */
.card {
	border-radius: var(--dsk-radius-lg);
	border: 1px solid var(--dsk-card-border);
	background: linear-gradient(168deg, rgba(107, 93, 194, 0.055), transparent 46%), var(--dsk-card);
	box-shadow: var(--dsk-shadow-sm);
	overflow: hidden;
}
.card-head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 13px 16px 0;
}
.card-title { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.card-ico { display: grid; place-items: center; color: var(--dsk-purple-300); }
.card-acts { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.card-sub { padding: 4px 16px 0; font-size: 11px; color: var(--dsk-foreground-subtle); }
.card-body { padding: 12px 16px 16px; }

/* ----------------------------------------------------------- 主视觉 */
.hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 14px;
	padding: 18px;
	border-radius: var(--dsk-radius-xl);
	border: 1px solid var(--dsk-card-border);
	background:
		radial-gradient(120% 130% at 0% 0%, rgba(107, 93, 194, 0.24), transparent 55%),
		radial-gradient(110% 120% at 100% 0%, rgba(36, 240, 234, 0.13), transparent 52%),
		var(--dsk-card);
	box-shadow: var(--dsk-shadow-md);
}
.hero-main { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.hero-info { min-width: 0; flex: 1; }
.hero-kicker { font-size: 11px; letter-spacing: 0.14em; color: var(--dsk-accent); }
.hero-name { margin-top: 2px; font-size: var(--dsk-text-3xl); font-weight: 650; letter-spacing: -0.025em; line-height: 1.15; }
.hero-meta { margin-top: 4px; font-size: var(--dsk-text-sm); color: var(--dsk-foreground-muted); }
.hero-target { margin-top: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero-target-label { font-size: 12px; color: var(--dsk-foreground-subtle); }
.hero-gap {
	font-size: 12px;
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--dsk-muted);
	font-family: var(--dsk-font-mono);
}
.hero-gap.is-pos { color: var(--dsk-success); }
.hero-gap.is-neg { color: var(--dsk-warning); }

.hero-segs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.seg-card {
	display: flex;
	flex-direction: column;
	gap: 7px;
	padding: 11px 12px;
	border-radius: 11px;
	border: 1px solid var(--dsk-card-border);
	background: rgba(42, 40, 64, 0.32);
	transition: transform .16s ease, border-color .16s ease;
}
.seg-card:hover { transform: translateY(-2px); border-color: var(--dsk-accent-ring); }
:root[data-theme="light"] .seg-card { background: rgba(236, 238, 246, 0.55); }
.seg-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.seg-head span { font-size: 12px; color: var(--dsk-foreground-muted); }
.seg-head b { font-family: var(--dsk-font-mono); font-size: 17px; }
.seg-head i { font-style: normal; font-size: 11px; color: var(--dsk-foreground-subtle); }
.seg-rows { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.seg-rows span { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--dsk-foreground-subtle); }
.seg-rows b { font-family: var(--dsk-font-mono); color: var(--dsk-foreground-muted); font-weight: 500; }

/* 环形进度 */
.ring { position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring-track { stroke: var(--dsk-border-subtle); }
.ring-fill {
	stroke: var(--dsk-accent);
	stroke-linecap: round;
	transition: stroke-dashoffset .5s cubic-bezier(.4, 0, .2, 1);
	filter: drop-shadow(0 0 6px rgba(36, 240, 234, 0.45));
}
.hero .ring-fill { stroke: var(--dsk-purple-300); }
.ring-text {
	position: absolute;
	inset: 0;
	display: grid;
	place-content: center;
	text-align: center;
}
.ring-text b { font-family: var(--dsk-font-mono); font-size: 26px; line-height: 1; letter-spacing: -0.02em; }
.ring-text i { font-style: normal; font-size: 11px; color: var(--dsk-foreground-subtle); }

/* ----------------------------------------------------------- 进度条 */
.bar {
	display: block;
	position: relative;
	height: 5px;
	border-radius: 999px;
	background: var(--dsk-border-subtle);
	overflow: hidden;
}
.bar-fill {
	position: absolute;
	inset: 0 auto 0 0;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--dsk-purple-400), var(--dsk-accent));
	transition: width .35s cubic-bezier(.4, 0, .2, 1);
}
.bar-fill.is-full { background: linear-gradient(90deg, var(--dsk-accent), var(--dsk-success)); }
.bar-xs { height: 3px; }

/* ----------------------------------------------------------- 封顶小卡 */
.chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 8px; }
.chip {
	display: flex;
	flex-direction: column;
	gap: 5px;
	padding: 9px 10px;
	border-radius: 9px;
	border: 1px solid var(--dsk-card-border);
	background: rgba(42, 40, 64, 0.3);
}
:root[data-theme="light"] .chip { background: rgba(236, 238, 246, 0.5); }
.chip.is-over { border-color: rgba(230, 184, 74, 0.45); }
.chip-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.chip-head b { font-size: 12px; font-weight: 600; }
.chip-head i { font-style: normal; font-family: var(--dsk-font-mono); font-size: 12px; }
.chip-head i em { font-style: normal; color: var(--dsk-foreground-subtle); font-size: 10px; }
.chip-foot { font-size: 10px; color: var(--dsk-foreground-subtle); }
.space-sum { margin-top: 10px; font-size: 12px; color: var(--dsk-foreground-muted); }
.space-sum b { font-family: var(--dsk-font-mono); color: var(--dsk-accent); font-size: 14px; }

.sub-cap { margin-top: 12px; }
.cap-line { display: flex; align-items: center; gap: 10px; }
.cap-line .bar { flex: 1; }
.cap-text { flex: none; font-family: var(--dsk-font-mono); font-size: 12px; color: var(--dsk-foreground-muted); }
.cap-text em { font-style: normal; color: var(--dsk-warning); font-size: 11px; }

/* ----------------------------------------------------------- 行 / 控件 */
.rows { display: flex; flex-direction: column; }
.row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 0;
	border-bottom: 1px solid var(--dsk-border-subtle);
}
.row:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-label { font-size: 13px; }
.row-sub { font-size: 11px; color: var(--dsk-foreground-subtle); }
.row-ctl { flex: none; display: flex; align-items: center; gap: 8px; }
.row-val {
	flex: none;
	min-width: 46px;
	text-align: right;
	font-family: var(--dsk-font-mono);
	font-size: 13px;
	color: var(--dsk-foreground-subtle);
}
.row-val.is-on { color: var(--dsk-accent); }
.row-val.is-neg { color: var(--dsk-danger); }

.row-check {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 0;
	border-bottom: 1px solid var(--dsk-border-subtle);
	cursor: pointer;
}
.row-check:last-child { border-bottom: 0; }
.row-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.row-check .chk-box {
	flex: none;
	width: 16px;
	height: 16px;
	border-radius: 5px;
	border: 1.5px solid var(--dsk-border);
	background: var(--dsk-input);
	position: relative;
	transition: background .15s ease, border-color .15s ease;
}
.row-check input:checked + .chk-box,
.chk input:checked + .chk-box {
	background: var(--dsk-accent);
	border-color: var(--dsk-accent);
}
.row-check input:checked + .chk-box::after,
.chk input:checked + .chk-box::after {
	content: "";
	position: absolute;
	left: 4.5px;
	top: 1.5px;
	width: 4px;
	height: 8px;
	border: solid #0a2524;
	border-width: 0 2px 2px 0;
	transform: rotate(42deg);
}

.chk {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	padding: 7px 0;
	font-size: 12px;
	color: var(--dsk-foreground-muted);
	cursor: pointer;
}
.chk input { position: absolute; opacity: 0; width: 0; height: 0; }
.chk .chk-box {
	flex: none;
	margin-top: 1px;
	width: 16px;
	height: 16px;
	border-radius: 5px;
	border: 1.5px solid var(--dsk-border);
	background: var(--dsk-input);
	position: relative;
}

.sw { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; }
.sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw-track {
	flex: none;
	position: relative;
	width: 38px;
	height: 21px;
	border-radius: 999px;
	background: var(--dsk-border);
	transition: background .18s ease;
}
.sw-knob {
	position: absolute;
	top: 2.5px;
	left: 2.5px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	transition: transform .18s cubic-bezier(.4, 0, .2, 1);
}
.sw input:checked + .sw-track { background: linear-gradient(90deg, var(--dsk-purple-400), var(--dsk-accent)); }
.sw input:checked + .sw-track .sw-knob { transform: translateX(17px); }
.sw-text { color: var(--dsk-foreground-muted); }

.stepper {
	display: inline-flex;
	align-items: stretch;
	height: 30px;
	border: 1px solid var(--dsk-border);
	border-radius: 8px;
	overflow: hidden;
	background: var(--dsk-input);
}
.step-btn {
	width: 30px;
	border: 0;
	background: transparent;
	color: var(--dsk-foreground-muted);
	cursor: pointer;
	font-size: 15px;
	line-height: 1;
	transition: background .14s ease, color .14s ease;
}
.step-btn:hover { background: var(--dsk-primary-soft); color: var(--dsk-foreground); }
.step-in {
	width: 40px;
	height: 100%;
	border: 0;
	border-left: 1px solid var(--dsk-border-subtle);
	border-right: 1px solid var(--dsk-border-subtle);
	background: transparent;
	color: var(--dsk-foreground);
	text-align: center;
	font-family: var(--dsk-font-mono);
	font-size: 13px;
	-moz-appearance: textfield;
}
.step-in::-webkit-outer-spin-button,
.step-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step-in:focus { outline: none; background: var(--dsk-muted); }

.inp {
	width: 100%;
	padding: 7px 10px;
	border-radius: 8px;
	border: 1px solid var(--dsk-border);
	background: var(--dsk-input);
	color: var(--dsk-input-foreground);
	font-family: inherit;
	font-size: 13px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.inp:focus { outline: none; border-color: var(--dsk-accent-ring); box-shadow: 0 0 0 3px var(--dsk-accent-soft); }
.inp-num { width: 84px; font-family: var(--dsk-font-mono); text-align: right; }
.inp-date { width: 152px; font-family: var(--dsk-font-mono); font-size: 12px; }
.inp-sel { width: auto; min-width: 96px; max-width: 100%; cursor: pointer; }
.inp-ta { width: 100%; resize: vertical; line-height: 1.65; font-size: 12.5px; }
.inp::placeholder { color: var(--dsk-foreground-subtle); opacity: .75; }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-label { font-size: 11px; color: var(--dsk-foreground-subtle); }
.field-hint { font-size: 10.5px; color: var(--dsk-foreground-subtle); line-height: 1.5; }
.field.full { grid-column: 1 / -1; }

.entry-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
	gap: 10px 12px;
	padding: 4px 0 2px;
}
.entry-grid .field.full { grid-column: 1 / -1; }

.seg {
	display: inline-flex;
	padding: 2px;
	border-radius: 9px;
	border: 1px solid var(--dsk-border);
	background: var(--dsk-input);
	gap: 2px;
}
.seg-btn {
	border: 0;
	background: transparent;
	padding: 5px 11px;
	border-radius: 7px;
	font-size: 12px;
	color: var(--dsk-foreground-muted);
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
	white-space: nowrap;
}
.seg-btn:hover { color: var(--dsk-foreground); }
.seg-btn.is-on {
	background: linear-gradient(120deg, var(--dsk-primary), var(--dsk-purple-400));
	color: #fff;
	box-shadow: 0 2px 8px rgba(107, 93, 194, 0.35);
}

/* ----------------------------------------------------------- 按钮 */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 7px 13px;
	border-radius: 8px;
	border: 1px solid var(--dsk-border);
	background: var(--dsk-card);
	color: var(--dsk-foreground);
	font-size: 12.5px;
	cursor: pointer;
	transition: transform .14s ease, border-color .14s ease, background .14s ease;
	white-space: nowrap;
}
.btn:hover { border-color: var(--dsk-accent-ring); transform: translateY(-1px); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-primary {
	background: linear-gradient(120deg, var(--dsk-primary), var(--dsk-purple-400));
	border-color: transparent;
	color: #fff;
	box-shadow: 0 3px 12px rgba(107, 93, 194, 0.32);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-danger { color: var(--dsk-danger); border-color: rgba(232, 93, 106, 0.4); }
.btn-danger.is-armed { background: rgba(232, 93, 106, 0.16); }

.icon-btn {
	display: inline-grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 7px;
	border: 1px solid transparent;
	background: transparent;
	color: var(--dsk-foreground-muted);
	cursor: pointer;
	transition: background .14s ease, color .14s ease;
}
.icon-btn:hover { background: var(--dsk-primary-soft); color: var(--dsk-foreground); }
.icon-btn.is-danger:hover { background: rgba(232, 93, 106, 0.14); color: var(--dsk-danger); }
.icon-btn:disabled { opacity: .35; cursor: default; }

.link {
	border: 0;
	background: transparent;
	color: var(--dsk-accent);
	font-size: 12px;
	cursor: pointer;
	padding: 4px 4px;
	margin: -4px 0;
	display: inline-flex;
	align-items: center;
	gap: 2px;
}
.link:hover { text-decoration: underline; }

.add-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }

/* ----------------------------------------------------------- 药丸 */
.pill {
	display: inline-flex;
	align-items: center;
	padding: 1px 7px;
	border-radius: 999px;
	font-size: 10.5px;
	line-height: 1.7;
	border: 1px solid var(--dsk-border);
	background: var(--dsk-muted);
	color: var(--dsk-foreground-muted);
	font-weight: 500;
}
.pill-ok { color: var(--dsk-success); border-color: rgba(36, 240, 234, 0.35); background: var(--dsk-accent-soft); }
.pill-warn { color: var(--dsk-warning); border-color: rgba(230, 184, 74, 0.35); background: rgba(230, 184, 74, 0.1); }
.pill-info { color: var(--dsk-info); border-color: rgba(107, 140, 255, 0.35); background: rgba(107, 140, 255, 0.1); }
.pill-danger { color: var(--dsk-danger); border-color: rgba(232, 93, 106, 0.35); background: rgba(232, 93, 106, 0.1); }
.pill-muted { color: var(--dsk-foreground-subtle); }

/* ----------------------------------------------------------- 条目 */
.entry {
	padding: 10px 12px;
	margin-bottom: 8px;
	border-radius: 10px;
	border: 1px solid var(--dsk-card-border);
	background: rgba(42, 40, 64, 0.22);
	transition: border-color .16s ease;
}
:root[data-theme="light"] .entry { background: rgba(236, 238, 246, 0.42); }
.entry:hover { border-color: var(--dsk-primary-ring); }
.entry.is-off { opacity: .62; }
.entry.is-bad { border-color: rgba(232, 93, 106, 0.4); }
.entry-head { display: flex; align-items: center; gap: 10px; }
.entry-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.entry-pts { font-family: var(--dsk-font-mono); font-size: 14px; color: var(--dsk-accent); }
.entry-pts.is-off { color: var(--dsk-foreground-subtle); }
.entry-ops { display: flex; gap: 2px; flex: none; }
.entry-meta { margin-top: 3px; font-size: 11px; color: var(--dsk-foreground-subtle); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.entry-body { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--dsk-border-subtle); }

/* 品行：基准分 */
.base-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.base-row .sw { flex: 1; min-width: 220px; }
.base-val { font-family: var(--dsk-font-mono); font-size: 24px; color: var(--dsk-foreground-subtle); flex: none; }
.base-val.is-on { color: var(--dsk-accent); }
.base-val i { font-style: normal; font-size: 12px; color: var(--dsk-foreground-subtle); }

.vol { padding: 2px 0 8px; }
.vol-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: 13px; }
.vol-input { display: inline-flex; align-items: center; gap: 5px; }
.vol-input i { font-style: normal; font-size: 11px; color: var(--dsk-foreground-subtle); }
.vol-note { margin-top: 6px; font-size: 11px; color: var(--dsk-foreground-subtle); }

.rows-ded .ded-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 0;
	border-bottom: 1px solid var(--dsk-border-subtle);
	flex-wrap: wrap;
}
.rows-ded .ded-row:last-child { border-bottom: 0; }
.ded-row.is-hit .row-label { color: var(--dsk-danger); }
.ded-extra { flex: 1 0 100%; display: flex; gap: 10px; flex-wrap: wrap; padding: 0 0 4px 2px; }
.ded-extra .field { min-width: 160px; flex: 1; }
.ded-sum { margin-top: 10px; font-family: var(--dsk-font-mono); font-size: 12px; color: var(--dsk-foreground-muted); }
.ded-sum b { color: var(--dsk-danger); font-size: 14px; }
.hint-strong { display: flex; align-items: flex-start; gap: 6px; color: var(--dsk-warning) !important; }

/* ----------------------------------------------------------- 提示 */
.tips-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.fbtn {
	border: 1px solid var(--dsk-border);
	background: var(--dsk-card);
	border-radius: 999px;
	padding: 3px 10px;
	font-size: 11.5px;
	color: var(--dsk-foreground-muted);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	transition: border-color .14s ease, color .14s ease;
}
.fbtn:hover { color: var(--dsk-foreground); border-color: var(--dsk-accent-ring); }
.fbtn.is-on { color: var(--dsk-foreground); border-color: var(--dsk-accent-ring); background: var(--dsk-accent-soft); }
.fbtn b { font-family: var(--dsk-font-mono); font-size: 10px; color: var(--dsk-accent); }

.tips { display: flex; flex-direction: column; gap: 8px; }
.tip {
	display: flex;
	gap: 9px;
	padding: 9px 11px;
	border-radius: 9px;
	border: 1px solid var(--dsk-border-subtle);
	border-left-width: 3px;
	background: rgba(42, 40, 64, 0.24);
}
:root[data-theme="light"] .tip { background: rgba(236, 238, 246, 0.45); }
.tip--danger { border-left-color: var(--dsk-danger); }
.tip--warn { border-left-color: var(--dsk-warning); }
.tip--good { border-left-color: var(--dsk-success); }
.tip--info { border-left-color: var(--dsk-info); }
.tip-ico { flex: none; margin-top: 1px; }
.tip--danger .tip-ico { color: var(--dsk-danger); }
.tip--warn .tip-ico { color: var(--dsk-warning); }
.tip--good .tip-ico { color: var(--dsk-success); }
.tip--info .tip-ico { color: var(--dsk-info); }
.tip-main { flex: 1; min-width: 0; }
.tip-main h4 { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tip-main p { margin-top: 2px; font-size: 11.5px; color: var(--dsk-foreground-muted); line-height: 1.65; }
.tip-tag {
	font-size: 10px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--dsk-muted);
	color: var(--dsk-foreground-subtle);
	font-weight: 400;
}
.tip-go {
	flex: none;
	align-self: flex-start;
	border: 1px solid var(--dsk-border);
	background: var(--dsk-card);
	border-radius: 7px;
	padding: 3px 9px;
	font-size: 11px;
	color: var(--dsk-foreground-muted);
	cursor: pointer;
}
.tip-go:hover { color: var(--dsk-accent); border-color: var(--dsk-accent-ring); }

/* 推荐 */
.rec { display: flex; flex-direction: column; gap: 6px; }
.rec li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--dsk-border-subtle); }
.rec li:last-child { border-bottom: 0; }
.rec-gain { flex: none; font-family: var(--dsk-font-mono); font-size: 13px; color: var(--dsk-accent); min-width: 42px; }
.rec-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rec-main b { font-size: 12.5px; font-weight: 500; }
.rec-main em { font-style: normal; font-size: 11px; color: var(--dsk-foreground-subtle); }
.rec-roi { flex: none; font-family: var(--dsk-font-mono); font-size: 11px; color: var(--dsk-foreground-subtle); }

/* 计算过程 */
.trace { display: flex; flex-direction: column; }
.trace-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) 76px;
	gap: 10px;
	align-items: baseline;
	padding: 6px 0;
	border-bottom: 1px dashed var(--dsk-border-subtle);
	font-size: 12px;
}
.trace-row:last-child { border-bottom: 0; }
.trace-row.lv0 { font-weight: 600; }
.trace-row.lv1 .trace-label { padding-left: 14px; color: var(--dsk-foreground-muted); }
.trace-label { color: var(--dsk-foreground); }
.trace-note { font-size: 11px; color: var(--dsk-foreground-subtle); }
.trace-val { text-align: right; font-family: var(--dsk-font-mono); }
.trace-row.is-sum { border-top: 1px solid var(--dsk-border); border-bottom: 0; margin-top: 6px; padding-top: 9px; }
.trace-row.is-sum .trace-label { font-weight: 600; }
.trace-row.is-sum .trace-val { color: var(--dsk-accent); font-size: 15px; }

/* 注释块 */
.note {
	padding: 11px 13px;
	border-radius: 9px;
	border: 1px solid var(--dsk-border-subtle);
	border-left: 3px solid var(--dsk-border);
	background: rgba(42, 40, 64, 0.24);
	font-size: 12px;
	color: var(--dsk-foreground-muted);
	line-height: 1.7;
}
:root[data-theme="light"] .note { background: rgba(236, 238, 246, 0.48); }
.note b { color: var(--dsk-foreground); }
.note p { margin-top: 3px; }
.note ul { margin: 5px 0 0; padding-left: 16px; list-style: disc; }
.note ul li { margin-top: 2px; }
.note-info { border-left-color: var(--dsk-info); }
.note-warn { border-left-color: var(--dsk-warning); }
.note-danger { border-left-color: var(--dsk-danger); }
.note-ok { border-left-color: var(--dsk-success); }
.note-sim { border-left-color: var(--dsk-accent); background: var(--dsk-accent-soft); }
.note-muted { border-left-color: var(--dsk-border); }

.hint { margin-top: 8px; font-size: 11.5px; color: var(--dsk-foreground-subtle); line-height: 1.7; }
.sub-title { margin: 14px 0 4px; font-size: 12px; color: var(--dsk-foreground-muted); font-weight: 600; }

/* ----------------------------------------------------------- 综合成绩 */
.comp { display: flex; flex-direction: column; gap: 8px; }
.comp-val { font-family: var(--dsk-font-mono); font-size: 34px; line-height: 1; letter-spacing: -0.03em; color: var(--dsk-accent); }
.comp.big .comp-val { font-size: 44px; }
.comp-val.is-part { color: var(--dsk-warning); }
.comp-val em { display: block; margin-top: 5px; font-style: normal; font-size: 11px; color: var(--dsk-foreground-subtle); font-family: var(--dsk-font-sans); }
.comp-formula { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11.5px; color: var(--dsk-foreground-muted); }
.comp-formula span { padding: 3px 8px; border-radius: 7px; background: var(--dsk-muted); }
.comp-formula span.is-empty { opacity: .55; }
.comp-formula b { font-family: var(--dsk-font-mono); color: var(--dsk-foreground); }
.comp-formula i { font-style: normal; color: var(--dsk-foreground-subtle); }
.comp-note { font-size: 11px; color: var(--dsk-foreground-subtle); }

.preset-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.preset {
	text-align: left;
	padding: 10px 12px;
	border-radius: 9px;
	border: 1px solid var(--dsk-card-border);
	background: rgba(42, 40, 64, 0.24);
	cursor: pointer;
	display: flex;
	flex-direction: column;
	gap: 3px;
	transition: border-color .15s ease, transform .15s ease;
}
:root[data-theme="light"] .preset { background: rgba(236, 238, 246, 0.45); }
.preset:hover { transform: translateY(-1px); border-color: var(--dsk-accent-ring); }
.preset.is-on { border-color: var(--dsk-accent); background: var(--dsk-accent-soft); }
.preset b { font-size: 12.5px; }
.preset span { font-size: 11px; color: var(--dsk-foreground-subtle); line-height: 1.55; }

/* ----------------------------------------------------------- 表格 */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th, .tbl td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--dsk-border-subtle); white-space: nowrap; }
.tbl th { font-weight: 600; font-size: 11px; color: var(--dsk-foreground-subtle); background: rgba(42, 40, 64, 0.28); }
:root[data-theme="light"] .tbl th { background: rgba(236, 238, 246, 0.6); }
.tbl .tr { text-align: right; }
.tbl tbody tr:hover { background: rgba(107, 93, 194, 0.06); }
.tbl-cmp .is-sum td { font-weight: 600; border-top: 1px solid var(--dsk-border); }

/* ----------------------------------------------------------- 材料清单 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.stat {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid var(--dsk-card-border);
	background: var(--dsk-card);
	cursor: pointer;
	transition: border-color .15s ease, transform .15s ease;
}
.stat:hover { transform: translateY(-1px); border-color: var(--dsk-accent-ring); }
.stat.is-on { border-color: var(--dsk-accent); background: var(--dsk-accent-soft); }
.stat b { font-family: var(--dsk-font-mono); font-size: 19px; }
.stat span { font-size: 11px; color: var(--dsk-foreground-subtle); }
.tone-ok { color: var(--dsk-success); }
.tone-warn { color: var(--dsk-warning); }
.tone-info { color: var(--dsk-info); }
.tone-danger { color: var(--dsk-danger); }
.tone-muted { color: var(--dsk-foreground-muted); }

.mat-list { display: flex; flex-direction: column; }
.mat-row {
	display: flex;
	gap: 12px;
	align-items: center;
	padding: 10px 0;
	border-bottom: 1px solid var(--dsk-border-subtle);
	flex-wrap: wrap;
}
.mat-row:last-child { border-bottom: 0; }
.mat-row.is-bad { background: rgba(232, 93, 106, 0.05); }
.mat-row.is-ok { background: rgba(36, 240, 234, 0.035); }
.mat-main { flex: 1 1 240px; min-width: 0; }
.mat-title { display: flex; align-items: center; gap: 7px; font-size: 12.5px; flex-wrap: wrap; }
.mat-pts { font-family: var(--dsk-font-mono); font-size: 12px; color: var(--dsk-accent); }
.mat-pts.is-neg { color: var(--dsk-danger); }
.mat-note { margin-top: 2px; font-size: 11px; color: var(--dsk-foreground-subtle); }
.mat-ctl { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.mat-ctl .inp-num { width: 100px; }
.mat-ctl > .inp { width: 170px; }

.guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)); gap: 10px; }
.guide-item { padding: 9px 11px; border-radius: 9px; border: 1px solid var(--dsk-card-border); background: rgba(42, 40, 64, 0.22); }
:root[data-theme="light"] .guide-item { background: rgba(236, 238, 246, 0.42); }
.guide-item b { font-size: 12px; }
.guide-item p { margin-top: 3px; font-size: 11px; color: var(--dsk-foreground-muted); line-height: 1.65; }

/* ----------------------------------------------------------- 模拟 */
.sim-chip {
	position: absolute;
	right: 0;
	top: 2px;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 11.5px;
	color: var(--dsk-accent);
	border: 1px solid var(--dsk-accent-ring);
	background: var(--dsk-accent-soft);
}
.qk { display: flex; flex-direction: column; gap: 12px; }
.qk-group h4 { font-size: 11.5px; color: var(--dsk-foreground-subtle); margin-bottom: 6px; }
.qk-body { display: flex; flex-wrap: wrap; gap: 6px; }
.qbtn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 5px 10px;
	border-radius: 999px;
	border: 1px solid var(--dsk-border);
	background: var(--dsk-card);
	font-size: 11.5px;
	color: var(--dsk-foreground-muted);
	cursor: pointer;
	transition: border-color .14s ease, color .14s ease, transform .14s ease;
}
.qbtn:hover { color: var(--dsk-foreground); border-color: var(--dsk-accent-ring); transform: translateY(-1px); }
.plan h4 { font-size: 12.5px; margin-bottom: 8px; }
.plan ol { display: flex; flex-direction: column; gap: 6px; }
.plan li { display: flex; align-items: center; gap: 9px; font-size: 12px; padding: 6px 0; border-bottom: 1px dashed var(--dsk-border-subtle); }
.plan li:last-child { border-bottom: 0; }
.plan li b { flex: 1; min-width: 0; font-weight: 500; }
.plan li em { font-style: normal; font-size: 11px; color: var(--dsk-foreground-subtle); }
.plan-acc { font-family: var(--dsk-font-mono); font-size: 11px; color: var(--dsk-foreground-muted); }

/* ----------------------------------------------------------- 班级对比 */
.rankbox { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.rank-num { font-family: var(--dsk-font-mono); font-size: 38px; line-height: 1; color: var(--dsk-accent); }
.rank-num span { font-size: 13px; color: var(--dsk-foreground-subtle); margin-left: 4px; }
.rank-body { flex: 1; min-width: 220px; }
.rank-bar { position: relative; height: 6px; border-radius: 999px; background: var(--dsk-border-subtle); }
.rank-bar i {
	position: absolute;
	top: -4px;
	width: 14px;
	height: 14px;
	margin-left: -7px;
	border-radius: 50%;
	background: var(--dsk-accent);
	box-shadow: 0 0 0 4px var(--dsk-accent-soft);
}
.rank-meta { margin-top: 8px; font-size: 11.5px; color: var(--dsk-foreground-muted); }
.dist { display: flex; align-items: flex-end; gap: 3px; height: 64px; margin-top: 10px; }
.dist-bar { flex: 1; min-width: 3px; border-radius: 3px 3px 0 0; background: var(--dsk-border); }
.dist-bar.is-me { background: linear-gradient(180deg, var(--dsk-accent), var(--dsk-purple-400)); }
.cm-list { display: flex; flex-direction: column; gap: 7px; }
.cm-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cm-row .inp { width: 120px; }
.cm-row .inp:first-child { flex: 1; min-width: 120px; }
.paste { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--dsk-border-subtle); }

/* ----------------------------------------------------------- 时效 */
.tl { position: relative; margin-top: 14px; padding-left: 16px; }
.tl::before {
	content: "";
	position: absolute;
	left: 3px;
	top: 8px;
	bottom: 8px;
	width: 1px;
	background: var(--dsk-border);
}
.tl-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 0; flex-wrap: wrap; }
.tl-dot {
	position: absolute;
	left: -16px;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--dsk-border);
	border: 1px solid var(--dsk-background);
}
.tl-item.is-urgent .tl-dot { background: var(--dsk-warning); }
.tl-item.is-past .tl-dot { background: var(--dsk-foreground-subtle); }
.tl-main { flex: 1; min-width: 160px; display: flex; flex-direction: column; }
.tl-main b { font-size: 12.5px; font-weight: 500; }
.tl-main em { font-style: normal; font-size: 11px; color: var(--dsk-foreground-subtle); }
.tl-date { font-family: var(--dsk-font-mono); font-size: 12px; text-align: right; }
.tl-date span { display: block; font-size: 10.5px; color: var(--dsk-foreground-subtle); }
.tl-item.is-urgent .tl-date span { color: var(--dsk-warning); }
.tl-item.is-past { opacity: .55; }

.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr)); gap: 10px; }
.flow-item { display: flex; gap: 9px; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--dsk-card-border); background: rgba(42, 40, 64, 0.22); }
:root[data-theme="light"] .flow-item { background: rgba(236, 238, 246, 0.42); }
.flow-num {
	flex: none;
	display: grid;
	place-items: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--dsk-primary-soft);
	color: var(--dsk-purple-200);
	font-family: var(--dsk-font-mono);
	font-size: 11px;
}
.flow-item b { font-size: 12px; }
.flow-item p { margin-top: 2px; font-size: 11px; color: var(--dsk-foreground-muted); line-height: 1.6; }

/* ----------------------------------------------------------- 规则手册 */
.searchbar {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 8px 12px;
	border-radius: 10px;
	border: 1px solid var(--dsk-card-border);
	background: var(--dsk-card);
	color: var(--dsk-foreground-subtle);
}
.searchbar .inp { border: 0; background: transparent; padding: 2px 0; flex: 1; }
.searchbar .inp:focus { box-shadow: none; }
.rb-group {
	border-radius: 11px;
	border: 1px solid var(--dsk-card-border);
	background: var(--dsk-card);
	overflow: hidden;
}
.rb-head {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 12px 15px;
	border: 0;
	background: transparent;
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	text-align: left;
}
.rb-head:hover { background: var(--dsk-primary-soft); }
.rb-head span { flex: 1; }
.rb-head i { font-style: normal; font-family: var(--dsk-font-mono); font-size: 11px; color: var(--dsk-foreground-subtle); }
.rb-body { padding: 0 15px 12px; }
.rb-item { padding: 10px 0; border-top: 1px solid var(--dsk-border-subtle); }
.rb-item h4 { font-size: 12.5px; font-weight: 600; }
.rb-text { margin-top: 3px; font-size: 11.5px; color: var(--dsk-foreground-muted); line-height: 1.75; }
.rb-text b { color: var(--dsk-foreground); }

/* ----------------------------------------------------------- 设置 */
.cloud-row { display: flex; align-items: center; gap: 10px; }
.cloud-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dsk-foreground-subtle); flex: none; }
.cloud-dot.is-ok { background: var(--dsk-success); box-shadow: 0 0 0 4px var(--dsk-accent-soft); }
.cloud-dot.is-info { background: var(--dsk-info); }
.cloud-dot.is-danger { background: var(--dsk-danger); }
.cloud-dot.is-warn { background: var(--dsk-warning); }
.cloud-main { flex: 1; min-width: 0; }
.cloud-main b { font-size: 13px; }
.cloud-main p { font-size: 11px; color: var(--dsk-foreground-subtle); }
.cloud-meta { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0 4px; font-size: 11px; color: var(--dsk-foreground-subtle); }

.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(152px, 1fr)); gap: 8px; }
.quick-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border-radius: 9px;
	border: 1px solid var(--dsk-card-border);
	background: rgba(42, 40, 64, 0.22);
	color: var(--dsk-foreground-muted);
	font-size: 12px;
	cursor: pointer;
	text-align: left;
	transition: border-color .15s ease, color .15s ease, transform .15s ease;
}
:root[data-theme="light"] .quick-item { background: rgba(236, 238, 246, 0.42); }
.quick-item:hover { color: var(--dsk-foreground); border-color: var(--dsk-accent-ring); transform: translateY(-1px); }
.quick-item .ico { color: var(--dsk-purple-300); }
.quick-item.is-danger .ico { color: var(--dsk-danger); }
.quick-item.is-armed { border-color: var(--dsk-danger); background: rgba(232, 93, 106, 0.12); }

.pf {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 11px;
	border-radius: 9px;
	border: 1px solid var(--dsk-card-border);
	margin-bottom: 7px;
	flex-wrap: wrap;
}
.pf.is-on { border-color: var(--dsk-accent); background: var(--dsk-accent-soft); }
.pf-main { flex: 1; min-width: 160px; display: flex; flex-direction: column; }
.pf-main b { font-size: 12.5px; }
.pf-main em { font-style: normal; font-size: 11px; color: var(--dsk-foreground-subtle); }
.pf-score { font-family: var(--dsk-font-mono); font-size: 13px; color: var(--dsk-accent); }
.pf-ops { display: flex; align-items: center; gap: 2px; }

.about-list { margin: 8px 0 0; padding-left: 16px; list-style: disc; font-size: 12px; color: var(--dsk-foreground-muted); line-height: 1.8; }
.about-list b { color: var(--dsk-foreground); }

/* ----------------------------------------------------------- 空状态 / Toast */
.empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 26px 14px;
	text-align: center;
	border-radius: 10px;
	border: 1px dashed var(--dsk-border);
	background: rgba(42, 40, 64, 0.18);
	color: var(--dsk-foreground-subtle);
}
:root[data-theme="light"] .empty { background: rgba(236, 238, 246, 0.4); }
.empty-ico { color: var(--dsk-purple-300); opacity: .8; }
.empty b { font-size: 12.5px; color: var(--dsk-foreground-muted); }
.empty p { font-size: 11.5px; max-width: 42ch; }

#toast {
	position: fixed;
	left: 50%;
	bottom: 26px;
	z-index: 3000;
	transform: translate(-50%, 12px);
	opacity: 0;
	pointer-events: none;
	max-width: min(88vw, 460px);
	padding: 9px 16px;
	border-radius: 999px;
	border: 1px solid var(--dsk-card-border);
	background: color-mix(in srgb, var(--dsk-card) 94%, transparent);
	backdrop-filter: blur(12px);
	color: var(--dsk-foreground);
	font-size: 12.5px;
	box-shadow: var(--dsk-shadow-lg);
	transition: opacity .2s ease, transform .2s ease;
	text-align: center;
}
#toast.is-show { opacity: 1; transform: translate(-50%, 0); }
#toast.is-ok { border-color: var(--dsk-accent-ring); color: var(--dsk-accent); }
#toast.is-warn { border-color: rgba(230, 184, 74, 0.5); color: var(--dsk-warning); }
#toast.is-danger { border-color: rgba(232, 93, 106, 0.5); color: var(--dsk-danger); }
#toast.is-info { border-color: rgba(107, 140, 255, 0.5); color: var(--dsk-info); }

/* ----------------------------------------------------------- 响应式 */
@media (max-width: 1080px) {
	.grid2 { grid-template-columns: minmax(0, 1fr); }
	.tb-pyear { display: none; }
	.tb-seg span, .tb-total span { display: none; }
}

@media (max-width: 979px) {
	body { padding-top: calc(var(--site-nav-height, 44px) + 0px); }
	.shell { grid-template-columns: minmax(0, 1fr); }
	.side {
		position: sticky;
		top: var(--site-nav-height, 44px);
		z-index: 30;
		height: auto;
		padding: 8px 10px;
		border-right: 0;
		border-bottom: 1px solid var(--dsk-border-subtle);
		background: color-mix(in srgb, var(--dsk-background) 92%, transparent);
		backdrop-filter: blur(14px) saturate(140%);
		flex-direction: column;
		gap: 0;
	}
	.side-top, .side-foot { display: none; }
	.side-nav {
		display: flex;
		gap: 6px;
		overflow-x: auto;
		overflow-y: hidden;
		padding: 0 0 2px;
		scrollbar-width: none;
	}
	.side-nav::-webkit-scrollbar { display: none; }
	.nav-group {
		display: flex;
		gap: 4px;
		margin: 0;
		align-items: center;
	}
	.nav-group-t { display: none; }
	.nav-item {
		flex: none;
		padding: 7px 11px;
		margin: 0;
		border-radius: 999px;
		border: 1px solid var(--dsk-border-subtle);
		background: var(--dsk-card);
		font-size: 12px;
	}
	.nav-item.is-on { border-color: var(--dsk-accent-ring); }
	.nav-item.is-on::before { display: none; }
	.nav-score { font-size: 11px; margin-left: 2px; }
	.topbar {
		position: static;
		flex-wrap: wrap;
		gap: 8px;
		padding: 10px 14px;
		backdrop-filter: none;
		background: transparent;
	}
	.tb-wrap { order: 1; max-width: 62%; }
	.tb-profile { max-width: 100%; }
	.tb-acts { order: 2; margin-left: auto; }
	.tb-score { order: 3; flex: 1 0 100%; overflow-x: auto; }
	.view { padding: 16px 14px 32px; }
	.foot { padding: 14px 14px 22px; }
	.hero { padding: 14px; }
	.hero-main { gap: 14px; }
	.hero-name { font-size: var(--dsk-text-2xl); }
	.hero-segs { grid-template-columns: minmax(0, 1fr); }
	.hero .ring { width: 104px !important; height: 104px !important; }
	.ring-text b { font-size: 21px; }
	.page-metric { position: static; margin-top: 6px; }
	.page-title { font-size: var(--dsk-text-xl); }
	.sim-chip { position: static; display: inline-flex; margin-top: 6px; }
	.mat-ctl { flex: 1 0 100%; }
	.mat-ctl > .inp { width: 100%; flex: 1; }
	.trace-row { grid-template-columns: minmax(0, 1fr) 70px; }
	.trace-note { display: none; }
	.entry-grid { grid-template-columns: minmax(0, 1fr); }
	.inp-num { width: 72px; }
	.comp-val { font-size: 30px; }
	.card-body { padding: 12px 13px 14px; }
	.card-head { padding: 12px 13px 0; }
	.card-sub { padding: 4px 13px 0; }
	.ded-extra .field { min-width: 120px; }
}

@media (max-width: 560px) {
	.tb-pname { max-width: 96px; }
	.tb-seg, .tb-total { padding: 4px 7px; }
	.rank-num { font-size: 30px; }
	.cm-row .inp { width: 100%; }
	.mat-row { gap: 8px; }
	/* 三块分区卡在手机上排成 2 + 1，避免首屏被三张卡撑满 */
	.hero-segs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
	.hero-segs .seg-card:last-child { grid-column: 1 / -1; }
	.seg-rows span { font-size: 10.5px; }
	.hero { gap: 10px; }
}

/* ----------------------------------------------------------- 打印 */
@media print {
	body { padding-top: 0; background: #fff; color: #111; }
	.side, .topbar, .foot, #toast, .card-acts, .add-row, .entry-ops, .tips-filter,
	.flash, .sim-chip, .qk, .page-head .page-metric { display: none !important; }
	.shell { display: block; }
	.view { padding: 0; }
	.card, .note, .entry, .hero { break-inside: avoid; box-shadow: none; }
	.card { margin-bottom: 10px; }
	.hero { background: #fff; }
	.inp, .step-in, .seg { border-color: #ccc; color: #111; background: #fff; }
	.entry-pts, .comp-val, .trace-val, .cap-text { color: #111 !important; }
}
