/* 管理端 TDesign 浅色主题。独立于农户端，保留现有 DOM 和业务交互。
 * Token 参考：https://github.com/Tencent/tdesign-common/tree/develop/style/web/theme
 */
.admin-body {
  --td-brand-color: #0052d9;
  --td-brand-color-hover: #366ef4;
  --td-brand-color-active: #003cab;
  --td-brand-color-light: #f2f3ff;
  --td-brand-color-focus: #d9e1ff;
  --td-success-color: #2ba471;
  --td-success-color-light: #e3f9e9;
  --td-success-text: #006c45;
  --td-warning-color: #e37318;
  --td-warning-color-light: #fff1e9;
  --td-warning-text: #954500;
  --td-error-color: #d54941;
  --td-error-color-light: #fff0ed;
  --td-error-text: #ad352f;
  --td-bg-color-page: #eee;
  --td-bg-color-container: #fff;
  --td-bg-color-secondarycontainer: #f3f3f3;
  --td-bg-color-component: #e8e8e8;
  --td-component-border: #dcdcdc;
  --td-component-stroke: #e7e7e7;
  --td-text-color-primary: rgba(0, 0, 0, .9);
  --td-text-color-secondary: rgba(0, 0, 0, .6);
  --td-text-color-placeholder: #767676;
  --td-radius-default: 3px;
  --td-radius-medium: 6px;
  --td-shadow-1: 0 1px 5px rgba(0, 0, 0, .08);
  --td-shadow-2: 0 6px 30px rgba(0, 0, 0, .12);
  --sans: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --serif: var(--sans);
  --ink: var(--td-text-color-primary);
  --ink-2: var(--td-text-color-primary);
  --muted: var(--td-text-color-secondary);
  --muted-2: var(--td-text-color-placeholder);
  --line: var(--td-component-stroke);
  --line-2: var(--td-component-stroke);
  --blue: var(--td-brand-color);
  --blue-soft: var(--td-brand-color-light);
  --green: var(--td-success-text);
  --green-soft: var(--td-success-color-light);
  --amber: var(--td-warning-text);
  --amber-soft: var(--td-warning-color-light);
  --danger: var(--td-error-text);
  --danger-soft: var(--td-error-color-light);
  --gray-soft: var(--td-bg-color-secondarycontainer);
  --red-700: var(--td-brand-color);
  --red-800: var(--td-brand-color-active);
  --gold-100: var(--td-brand-color-light);
  --gold-500: var(--td-brand-color);
  --gold-600: var(--td-brand-color);
  --gold-700: var(--td-brand-color);
  --chart-neutral: #a6a6a6;
  --admin-sidebar-width: 232px;
  background: var(--td-bg-color-page);
  color: var(--td-text-color-primary);
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 22px;
}
.admin-body ::selection { background: var(--td-brand-color-focus); color: var(--ink); }
.admin-body :focus-visible { outline: 2px solid var(--td-brand-color); outline-offset: 3px; }
.admin-body svg.ic { stroke-width: 1.6; }
.no-scroll { overflow: hidden; }

/* 导航与顶部工具栏 */
.admin-sidebar { position: fixed; z-index: 60; inset: 0 auto 0 0; width: var(--admin-sidebar-width); background: var(--td-bg-color-container); border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow-y: auto; }
.admin-brand { min-height: 72px; padding: 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.admin-brand-icon { width: 36px; height: 36px; color: #fff; background: #0052d9; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; }
.admin-brand-icon .ic { width: 26px; height: 26px; stroke-width: 1.8; }
.admin-brand strong { display: block; font-size: 18px; line-height: 26px; font-weight: 600; }
.admin-brand div > span { display: block; font-size: 12px; line-height: 20px; color: var(--muted); }
.sidebar-section { padding: 20px 12px 0; }
.sidebar-label { margin: 0 16px 8px; color: var(--muted); font-size: 12px; font-weight: 400; }
.admin-nav { width: 100%; min-height: 44px; margin: 4px 0; padding: 10px 16px; display: flex; align-items: center; gap: 12px; border: 0; border-radius: var(--td-radius-default); background: transparent; color: var(--ink-2); text-align: left; font-size: 14px; line-height: 24px; transition: background-color .16s, color .16s; }
.admin-nav .ic { width: 20px; height: 20px; }
.admin-nav > span { flex: 1; }
.admin-nav b { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 10px; background: var(--td-error-color); color: #fff; font-size: 12px; line-height: 18px; text-align: center; font-weight: 400; }
.admin-nav:hover { background: var(--td-bg-color-secondarycontainer); }
.admin-nav.active { color: var(--td-brand-color); background: var(--td-brand-color-light); font-weight: 500; }
.sidebar-foot { margin-top: auto; padding: 24px; }
.env-badge { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); padding-top: 20px; margin-bottom: 12px; }
.env-badge span { width: 6px; height: 6px; border-radius: 50%; background: var(--td-success-color); }
.farmer-link { display: flex; align-items: center; gap: 8px; color: var(--td-brand-color); font-size: 14px; }
.farmer-link:hover { color: var(--td-brand-color-hover); }
.farmer-link .ic { width: 16px; height: 16px; }
.admin-shell { margin-left: var(--admin-sidebar-width); min-height: 100vh; }
.admin-topbar { height: 72px; position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 24px; background: var(--td-bg-color-container); border-bottom: 1px solid var(--line); }
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-left h1 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 500; }
.topbar-left p { margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 20px; }
.mobile-menu { display: none; place-items: center; border: 0; background: transparent; color: var(--ink); border-radius: var(--td-radius-default); width: 40px; height: 40px; flex: 0 0 auto; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.admin-search { position: relative; width: 280px; }
.admin-search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; pointer-events: none; }
.admin-search input { width: 100%; height: 36px; padding: 6px 52px 6px 36px; border: 1px solid transparent; border-radius: var(--td-radius-default); background: var(--td-bg-color-secondarycontainer); color: var(--ink); font-size: 14px; outline: none; transition: border-color .16s, box-shadow .16s; }
.admin-search input:focus { background: #fff; border-color: var(--td-brand-color); box-shadow: 0 0 0 2px var(--td-brand-color-focus); }
.admin-search input::placeholder { color: var(--muted-2); }
.admin-search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: var(--td-radius-default); padding: 0 4px; font: 11px/18px var(--sans); }
.icon-btn { width: 36px; height: 36px; border: 0; border-radius: var(--td-radius-default); display: grid; place-items: center; background: transparent; color: var(--ink-2); }
.icon-btn:hover, .mobile-menu:hover { background: var(--td-bg-color-secondarycontainer); }
.notification-btn { position: relative; }
.notification-btn .ic { width: 20px; height: 20px; }
.notification-btn span { position: absolute; right: 7px; top: 6px; width: 6px; height: 6px; background: var(--td-error-color); border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
.admin-user { display: flex; align-items: center; gap: 10px; padding-left: 16px; border-left: 1px solid var(--line); }
.admin-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--td-brand-color-light); color: var(--td-brand-color); display: grid; place-items: center; font-size: 16px; font-weight: 500; }
.admin-user strong { display: block; font-size: 14px; font-weight: 400; line-height: 22px; }
.admin-user small { display: block; color: var(--muted); font-size: 12px; line-height: 18px; }
.admin-user > .ic { width: 16px; height: 16px; color: var(--muted); }
.admin-main { padding: 24px 24px 40px; max-width: 1920px; margin: auto; }

/* TDesign 控件：32px 标准高度、轻圆角、蓝色交互状态 */
.admin-body .btn { min-height: 32px; padding: 4px 16px; border-radius: var(--td-radius-default); border: 1px solid var(--td-brand-color); background: var(--td-brand-color); font-size: 14px; font-weight: 400; line-height: 22px; gap: 8px; box-shadow: none; transition: background-color .16s, border-color .16s, color .16s; }
.admin-body .btn:hover { background: var(--td-brand-color-hover); border-color: var(--td-brand-color-hover); transform: none; }
.admin-body .btn:active { background: var(--td-brand-color-active); border-color: var(--td-brand-color-active); }
.admin-body .btn .ic { width: 16px; height: 16px; }
.admin-body .btn.ghost { background: #fff; border-color: var(--td-component-border); color: var(--ink); }
.admin-body .btn.ghost:hover { background: var(--td-bg-color-secondarycontainer); }
.admin-body .btn.secondary { background: #fff; color: var(--td-brand-color); }
.admin-body .btn.secondary:hover { background: var(--td-brand-color-light); }
.admin-body .btn.green { background: var(--td-success-color); border-color: var(--td-success-color); }
.admin-body .btn.green:hover { background: var(--td-success-text); border-color: var(--td-success-text); }
.admin-body .btn.xs { min-height: 28px; padding: 2px 8px; font-size: 12px; }
.admin-body .input, .admin-body .select, .admin-body .textarea { padding: 5px 12px; min-height: 32px; border: 1px solid var(--td-component-border); border-radius: var(--td-radius-default); font-size: 14px; line-height: 22px; background-color: #fff; }
.admin-body .input:hover, .admin-body .select:hover, .admin-body .textarea:hover { border-color: var(--td-brand-color); }
.admin-body .input:focus, .admin-body .select:focus, .admin-body .textarea:focus { border-color: var(--td-brand-color); box-shadow: 0 0 0 2px var(--td-brand-color-focus); }
.admin-body .input::placeholder, .admin-body .textarea::placeholder { color: var(--muted-2); }
.admin-body .field { gap: 8px; }
.admin-body .field > label { font-size: 14px; font-weight: 400; }
.admin-body .textarea { min-height: 96px; }
.admin-body .tag { padding: 1px 8px; border-radius: var(--td-radius-default); font-size: 12px; line-height: 20px; font-weight: 400; }
.admin-body .tag.red { color: var(--td-brand-color); background: var(--td-brand-color-light); }
.admin-body .tag.gold { color: var(--td-brand-color); background: var(--td-brand-color-light); }
.admin-body .outline-tag { border-radius: var(--td-radius-default); font-size: 12px; }
.admin-body .progress { height: 6px; background: var(--td-bg-color-component); }
.admin-body .progress > span { background: var(--td-brand-color); }
.admin-body .notice { background: var(--td-brand-color-light); border: 1px solid var(--td-brand-color-focus); color: var(--td-text-color-primary); padding: 12px 16px; border-radius: var(--td-radius-default); font-size: 14px; line-height: 24px; }
.admin-body .tiny { font-size: 12px; }
.admin-body .close-btn { width: 32px; height: 32px; border-radius: var(--td-radius-default); background: transparent; color: var(--muted); }
.admin-body .close-btn:hover { background: var(--td-bg-color-secondarycontainer); color: var(--ink); }

/* 概览与数据可视化 */
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 24px; }
.page-heading h2 { margin: 0 0 8px; font-size: 24px; line-height: 32px; font-weight: 600; }
.page-heading p { margin: 0; color: var(--muted); font-size: 14px; line-height: 22px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.panel { min-width: 0; background: #fff; border: 1px solid transparent; border-radius: var(--td-radius-medium); }
.panel-head { padding: 24px 24px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-head h3 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 20px; }
.panel-body { padding: 0 24px 24px; }
.panel-body.padded { padding-top: 4px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi-card { min-width: 0; background: #fff; border: 1px solid transparent; border-radius: var(--td-radius-medium); padding: 20px 24px; min-height: 140px; }
.kpi-label { color: var(--muted); font-size: 14px; line-height: 22px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-value { margin-top: 8px; font-size: 32px; line-height: 40px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi-sub { color: var(--muted); font-size: 12px; line-height: 20px; margin-top: 4px; }
.kpi-sub strong { color: var(--green); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: stretch; }
.dashboard-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
.chart-bars { display: grid; gap: 16px; }
.chart-bar-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 28px; align-items: center; gap: 12px; font-size: 12px; line-height: 20px; }
.chart-bar-row > span:first-child { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-track { height: 8px; border-radius: 2px; background: var(--td-bg-color-secondarycontainer); overflow: hidden; }
.chart-track i { display: block; height: 100%; border-radius: inherit; background: var(--td-brand-color); }
.chart-bar-row:nth-child(2n) .chart-track i { background: #618dff; }
.chart-bar-row:nth-child(3n) .chart-track i { background: #8eabff; }
.chart-bar-row > b { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.panel:has(.result-summary) { display: flex; flex-direction: column; }
.panel:has(.result-summary) > .panel-body { display: flex; flex-direction: column; flex: 1; }
.result-summary { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-content: center; justify-items: center; flex: 1; padding: 24px 0; }
.donut { width: 224px; height: 224px; border-radius: 50%; background: conic-gradient(var(--td-success-color) 0 32%, var(--td-warning-color) 32% 66%, var(--td-brand-color) 66% 80%, var(--chart-neutral) 80% 100%); position: relative; }
.donut::after { content: "128"; position: absolute; inset: 30px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 36px; line-height: 44px; font-weight: 600; }
.result-legend { width: 100%; max-width: 360px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; font-size: 14px; line-height: 22px; }
.result-legend div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.result-legend span { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.result-legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.result-legend strong { font-weight: 500; font-variant-numeric: tabular-nums; }
.overview-list { display: grid; }
.overview-item { display: flex; align-items: flex-start; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.overview-item:last-child { border-bottom: 0; padding-bottom: 0; }
.overview-icon { width: 32px; height: 32px; border-radius: var(--td-radius-default); background: var(--td-brand-color-light); color: var(--td-brand-color); display: grid; place-items: center; flex: 0 0 auto; }
.overview-icon .ic { width: 18px; height: 18px; }
.overview-item > div { min-width: 0; }
.overview-item strong { display: block; font-size: 14px; line-height: 22px; font-weight: 400; }
.overview-item div > span { display: block; color: var(--muted); font-size: 12px; line-height: 20px; margin-top: 4px; }
.overview-item time { margin-left: auto; color: var(--muted); font-size: 12px; line-height: 22px; white-space: nowrap; }
.overview-item > .status, .overview-item > .table-link { margin-left: auto; flex-shrink: 0; }

/* 筛选、表格、状态标签 */
.filter-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 24px; }
.filter-search { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.filter-search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; pointer-events: none; }
.filter-search .input { padding-left: 36px; }
.filter-bar .select { width: auto; min-width: 144px; padding-right: 28px; }
.filter-result { margin-left: auto; color: var(--muted); font-size: 14px; }
.table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.admin-table { width: 100%; min-width: 1000px; border-collapse: collapse; font-size: 14px; line-height: 22px; }
.admin-table th { color: var(--muted); background: var(--td-bg-color-secondarycontainer); font-weight: 400; text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 14px; }
.admin-table td { padding: 16px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
.admin-table tbody tr { transition: background-color .16s; }
.admin-table tbody tr:hover { background: var(--td-brand-color-light); }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table th:first-child, .admin-table td:first-child { padding-left: 24px; }
.admin-table th:last-child, .admin-table td:last-child { padding-right: 24px; }
.table-title { min-width: 240px; }
.table-title strong { display: block; color: var(--ink); font-size: 14px; line-height: 24px; font-weight: 500; }
.table-title span { display: block; color: var(--muted); font-size: 12px; line-height: 20px; margin-top: 4px; }
.table-actions { display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.table-link { display: inline-flex; align-items: center; gap: 4px; color: var(--td-brand-color); border: 0; background: transparent; padding: 3px 0; font-size: 14px; line-height: 22px; font-weight: 400; text-align: left; }
.table-link:hover { color: var(--td-brand-color-hover); }
.table-link.danger { color: var(--td-error-text); }
.table-link .ic { width: 16px; height: 16px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px; border-radius: var(--td-radius-default); font-size: 12px; line-height: 20px; font-weight: 400; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.status.green { color: var(--td-success-text); background: var(--td-success-color-light); }
.status.amber { color: var(--td-warning-text); background: var(--td-warning-color-light); }
.status.blue { color: var(--td-brand-color); background: var(--td-brand-color-light); }
.status.gray { color: var(--muted); background: var(--td-bg-color-secondarycontainer); }
.status.red { color: var(--td-error-text); background: var(--td-error-color-light); }
.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.score-mini { width: 80px; }
.score-mini .progress { margin-top: 6px; }
.score-mini strong { font-size: 12px; font-weight: 500; }
.empty-row { padding: 64px 24px !important; text-align: center; color: var(--muted); }
.table-tabs { display: flex; gap: 24px; padding: 0 24px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.table-tab { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 16px 0; color: var(--muted); font-size: 14px; line-height: 22px; white-space: nowrap; }
.table-tab:hover { color: var(--td-brand-color); }
.table-tab.active { color: var(--td-brand-color); border-bottom-color: var(--td-brand-color); }
.table-tab b { background: var(--td-bg-color-secondarycontainer); color: var(--muted); border-radius: 10px; padding: 1px 6px; font-size: 12px; font-weight: 400; margin-left: 4px; }
.table-tab.active b { color: var(--td-brand-color); background: var(--td-brand-color-light); }

/* 审核、规则与详情 */
.review-drawer { width: min(1040px, 96vw); }
.review-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 24px; }
.review-form .field, #reviewForm .field { margin-bottom: 16px; }
.review-form .textarea { min-height: 88px; }
.field-required { color: var(--td-error-color); margin-left: 4px; }
.original-column { background: var(--td-bg-color-secondarycontainer); border-radius: var(--td-radius-medium); padding: 16px; max-height: 660px; overflow: auto; }
.original-column h4 { margin: 0 0 16px; font-size: 14px; font-weight: 500; }
.original-clause { background: #fff; border: 1px solid var(--line); border-radius: var(--td-radius-default); padding: 12px 16px; margin-bottom: 12px; }
.original-clause strong { display: block; color: var(--td-brand-color); font-size: 12px; font-weight: 500; margin-bottom: 8px; }
.original-clause p { margin: 0; font-size: 14px; line-height: 26px; color: var(--ink-2); }
.review-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.review-warning { border: 1px solid #ffd9c2; background: var(--td-warning-color-light); color: var(--td-warning-text); border-radius: var(--td-radius-default); padding: 12px 16px; font-size: 14px; line-height: 24px; }
.rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rule-card { border: 1px solid var(--line); border-radius: var(--td-radius-medium); padding: 16px; background: #fff; }
.rule-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rule-code { font-family: Consolas, monospace; font-size: 12px; color: var(--td-brand-color); background: var(--td-brand-color-light); border-radius: var(--td-radius-default); padding: 2px 8px; }
.rule-card h4 { margin: 0; font-size: 14px; font-weight: 500; }
.rule-card p { margin: 12px 0; color: var(--muted); font-size: 14px; line-height: 24px; }
.rule-flags { display: flex; flex-wrap: wrap; gap: 8px; }
.rule-flag { border: 1px solid var(--line); color: var(--muted); background: #fff; padding: 1px 8px; border-radius: var(--td-radius-default); font-size: 12px; line-height: 20px; }
.rule-flag.on { color: var(--td-brand-color); border-color: var(--td-brand-color-focus); background: var(--td-brand-color-light); }
.rule-flag.sensitive.on { color: var(--td-error-text); border-color: #ffd8d2; background: var(--td-error-color-light); }
.dimension-note { margin-top: 16px; color: var(--muted); font-size: 12px; line-height: 22px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.condition-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; color: var(--muted); font-size: 12px; line-height: 22px; }
.condition-list li::before { content: "·"; margin-right: 8px; color: var(--td-brand-color); }
.detail-section { margin-bottom: 24px; }
.detail-section:last-child { margin-bottom: 0; }
.detail-section h3 { margin: 0 0 16px; font-size: 16px; font-weight: 500; line-height: 24px; display: flex; align-items: center; gap: 8px; }
.detail-section h3::before { content: ""; width: 3px; height: 16px; background: var(--td-brand-color); }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.info-cell { background: var(--td-bg-color-secondarycontainer); border-radius: var(--td-radius-default); padding: 12px 16px; min-width: 0; }
.info-cell span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.info-cell strong { display: block; font-size: 14px; font-weight: 400; line-height: 24px; overflow-wrap: anywhere; }
.answer-box { background: var(--td-brand-color-light); border-left: 3px solid var(--td-brand-color); border-radius: var(--td-radius-default); padding: 16px; font-size: 14px; line-height: 26px; color: var(--ink-2); }
.source-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.source-chip { display: inline-block; background: #fff; border: 1px solid var(--td-brand-color-focus); color: var(--td-brand-color); border-radius: var(--td-radius-default); padding: 2px 8px; font-size: 12px; }
.timeline { position: relative; display: grid; gap: 24px; padding-left: 24px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.timeline-item { position: relative; }
.timeline-item::before { content: ""; position: absolute; left: -24px; top: 7px; width: 9px; height: 9px; border: 2px solid var(--td-brand-color); border-radius: 50%; background: #fff; }
.timeline-item strong { display: block; font-size: 14px; font-weight: 400; }
.timeline-item span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.service-section + .service-section { margin-top: 16px; }
.service-section .table-title { min-width: 160px; }
.service-section .admin-table td:first-child { white-space: nowrap; }
.service-section .admin-table td:nth-child(2) { min-width: 128px; }
.service-section:first-of-type .admin-table td:nth-child(5) { min-width: 184px; }
.service-section:first-of-type .admin-table td:nth-child(6) { min-width: 152px; }
#ticketStatusFilter { font-size: 14px !important; padding: 5px 28px 5px 12px !important; }
.sample-star { color: var(--td-warning-color); font-size: 16px; }
.log-actor { display: flex; align-items: center; gap: 8px; }
.actor-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--td-brand-color-light); color: var(--td-brand-color); display: grid; place-items: center; font-size: 12px; flex: 0 0 auto; }
.code-note { background: var(--td-bg-color-secondarycontainer); border-radius: var(--td-radius-default); padding: 12px 16px; font-family: var(--sans); font-size: 12px; line-height: 24px; color: var(--muted); overflow-wrap: anywhere; }
.section-divider { height: 1px; background: var(--line); margin: 24px 0; }

/* 抽屉、对话框与消息提示 */
.admin-drawer-mask { position: fixed; z-index: 800; inset: 0; background: rgba(0, 0, 0, .4); }
.admin-drawer { position: fixed; z-index: 801; top: 0; right: 0; width: min(640px, 95vw); height: 100vh; height: 100dvh; background: #fff; box-shadow: var(--td-shadow-2); display: flex; flex-direction: column; animation: slideIn .2s ease; }
.admin-drawer.wide { width: min(1040px, 96vw); }
.admin-drawer-head { padding: 24px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.admin-drawer-head .flex-between { align-items: flex-start; }
.admin-drawer .flex-center { flex-wrap: wrap; }
.admin-drawer .detail-section > .flex-between { flex-wrap: wrap; align-items: flex-start; }
.admin-drawer-head h2 { margin: 8px 0; font-size: 20px; line-height: 28px; font-weight: 500; }
.admin-drawer-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 20px; }
.admin-drawer-body { flex: 1; min-height: 0; padding: 24px; overflow: auto; }
.admin-drawer-foot { padding: 16px 24px; border-top: 1px solid var(--line); background: #fff; display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0; }
.admin-drawer-foot .left { margin-right: auto; }
.admin-body .modal-mask { background: rgba(0, 0, 0, .4); backdrop-filter: none; }
.admin-body .modal { border-radius: var(--td-radius-medium); box-shadow: var(--td-shadow-2); }
.modal-small { width: min(560px, 100%); }
.admin-body .modal-head { padding: 24px 24px 16px; border-bottom: 0; }
.admin-body .modal-head h2 { font-size: 20px; line-height: 28px; font-weight: 500; }
.admin-body .modal-body { padding: 8px 24px 24px; }
.admin-body .modal-foot { padding: 0 24px 24px; border-top: 0; }
.confirm-copy { color: var(--ink-2); font-size: 14px; line-height: 26px; margin: 0; }
.import-drop { border: 1px dashed var(--td-component-border); background: var(--td-bg-color-secondarycontainer); border-radius: var(--td-radius-default); padding: 32px; text-align: center; color: var(--muted); margin-bottom: 24px; }
.import-drop .ic { margin: 0 auto 12px; width: 32px; height: 32px; color: var(--td-brand-color); }
.import-drop strong { display: block; font-size: 14px; color: var(--ink-2); font-weight: 500; }
.import-drop span { font-size: 12px; }
.switch { position: relative; display: inline-block; width: 40px; height: 20px; vertical-align: middle; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; }
.switch span { position: absolute; inset: 0; border-radius: 12px; background: var(--td-component-border); transition: background-color .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.switch input:checked + span { background: var(--td-brand-color); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--td-brand-color); outline-offset: 3px; }
.admin-body #toast { top: 88px; bottom: auto; display: flex; align-items: center; gap: 8px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: var(--td-radius-default); box-shadow: var(--td-shadow-2); padding: 12px 16px; font-size: 14px; }
.admin-body #toast::before { content: ""; width: 8px; height: 8px; background: var(--td-brand-color); border-radius: 50%; flex-shrink: 0; }
.admin-body #toast.success::before { background: var(--td-success-color); }
.admin-body #toast.error::before { background: var(--td-error-color); }
.sidebar-mask { display: none; position: fixed; z-index: 55; inset: 0; background: rgba(0, 0, 0, .4); }

/* 小屏保留所有模块；数据表格仅在自身容器内横向滚动。 */
@media (max-width: 1280px) {
  .admin-search { width: 220px; }
  .kpi-card { padding: 20px; }
  .panel-head { padding: 20px 20px 16px; }
  .panel-body { padding: 0 20px 20px; }
  .donut { width: 200px; height: 200px; }
  .donut::after { inset: 28px; }
  .dashboard-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid.three > :last-child { grid-column: 1 / -1; }
  .rule-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-search { width: 200px; }
  .admin-user > div, .admin-user > .ic { display: none; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .result-summary { grid-template-columns: 160px minmax(0, 1fr); gap: 32px; }
  .result-legend { grid-template-columns: 1fr; font-size: 12px; line-height: 20px; }
  .donut { width: 160px; height: 160px; }
  .donut::after { inset: 24px; }
}
@media (max-width: 860px) {
  .admin-sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .admin-sidebar.open { transform: none; }
  .admin-shell { margin-left: 0; }
  .sidebar-mask.show { display: block; }
  .mobile-menu { display: grid; }
  .admin-topbar { padding: 0 16px; height: 64px; gap: 12px; }
  .admin-main { padding: 20px 16px 32px; }
  .topbar-right { gap: 8px; }
  .admin-user { padding-left: 12px; }
  .review-grid { grid-template-columns: 1fr; }
  .original-column { max-height: 400px; }
}
@media (max-width: 560px) {
  .admin-search { display: none; }
  .topbar-left { gap: 4px; }
  .topbar-left h1 { font-size: 14px; }
  .topbar-left p { display: none; }
  .admin-user { padding-left: 8px; }
  .admin-avatar { width: 32px; height: 32px; }
  .page-heading h2 { font-size: 22px; line-height: 30px; }
  .page-heading p { font-size: 12px; line-height: 20px; }
  .page-actions { width: 100%; }
  .kpi-grid { gap: 12px; }
  .kpi-card { padding: 16px; min-height: 148px; }
  .kpi-label { font-size: 12px; }
  .kpi-value { font-size: 28px; line-height: 36px; }
  .dashboard-grid.three { grid-template-columns: minmax(0, 1fr); }
  .panel-head { padding: 20px 16px 16px; }
  .panel-body { padding: 0 16px 20px; }
  .result-summary { grid-template-columns: 128px minmax(0, 1fr); gap: 20px; }
  .donut { width: 128px; height: 128px; }
  .donut::after { inset: 20px; font-size: 28px; }
  .overview-item { gap: 8px; flex-wrap: wrap; }
  .overview-item > div { flex: 1; }
  .overview-item time { margin-left: 40px; }
  .overview-item > .status, .overview-item > .table-link { margin-left: 40px; }
  .filter-bar { padding: 16px; gap: 12px; align-items: stretch; }
  .filter-search { max-width: none; width: 100%; flex-basis: 100%; min-width: 0; }
  .filter-bar .select { flex: 1; min-width: 45%; }
  .filter-result { flex-basis: 100%; margin-left: 0; }
  .info-grid { grid-template-columns: 1fr; }
  .admin-drawer, .admin-drawer.wide, .review-drawer { width: 100vw; }
  .admin-drawer-head, .admin-drawer-body { padding: 20px 16px; }
  .admin-drawer-foot { padding: 16px; flex-wrap: wrap; }
  .admin-drawer-foot .btn { flex: 1; }
  .admin-body .modal-mask { padding: 16px; align-items: center; }
  .admin-body .modal { max-height: calc(100dvh - 32px); }
  .admin-body .modal-head { padding: 20px 16px 16px; }
  .admin-body .modal-body { padding: 0 16px 20px; }
  .admin-body .modal-foot { padding: 0 16px 20px; flex-wrap: wrap; }
}
@media (pointer: coarse) {
  .admin-body .btn, .admin-body .input, .admin-body .select, .icon-btn, .mobile-menu, .admin-body .close-btn { min-height: 44px; }
  .icon-btn, .mobile-menu, .admin-body .close-btn { min-width: 44px; }
  .table-link { min-height: 44px; }
}
