:root {
  --border: #e2e2e2;
  --bg: #f7f7f8;
  --accent: #2563eb;
  --text: #1f2328;
  --muted: #6b7280;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.brand { font-weight: 600; font-size: 16px; flex-shrink: 0; white-space: nowrap; }
.system-switch { color: #2858a1; text-decoration: none; display: grid; gap: 3px; }
.system-switch span { font-size: 11px; font-weight: 400; color: #7889a2; }
.system-switch:hover span { color: var(--accent); }

.tabs { display: flex; gap: 20px; min-width: 0; }

.tab {
  text-decoration: none;
  color: var(--muted);
  padding: 6px 4px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.tab.active, .tab:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.content { padding: 20px 24px; }

/* Public system selector; deliberately contains no business data. */
.portal-page { min-height: 100vh; background: radial-gradient(ellipse at 10% 5%, #e7efff 0, transparent 48%), #f5f7fb; color: #223650; }
.portal-shell { width: min(100%, 1120px); margin: 0 auto; padding: 48px 32px 32px; }
.portal-brand { display: flex; gap: 14px; align-items: center; }
.portal-monogram { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: #285de2; color: white; font-weight: 700; font-size: 18px; letter-spacing: .03em; }
.portal-brand strong { display: block; font-size: 19px; letter-spacing: .12em; }
.portal-brand div > span { display: block; font-size: 11px; color: #8090a7; margin-top: 4px; letter-spacing: .08em; }
.portal-intro { margin: 64px 0 36px; }
.portal-eyebrow { color: #537abb; font-size: 11px; font-weight: 600; letter-spacing: .16em; }
.portal-intro h1 { font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -.025em; font-weight: 650; margin: 14px 0 16px; }
.portal-intro > p:last-child { margin: 0; color: #798aa3; font-size: 15px; line-height: 1.7; }
.portal-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 24px; }
.portal-card { display: flex; flex-direction: column; min-width: 0; background: white; border: 1px solid #dce5f3; border-radius: 20px; padding: 32px; box-shadow: 0 10px 30px #1e3e7405; }
.portal-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.portal-icon { width: 54px; height: 54px; display: grid; place-items: center; background: #ecf3ff; color: #2e66d8; border-radius: 14px; }
.portal-icon svg { width: 30px; height: 30px; }
.portal-status { font-size: 11px; color: #357f62; background: #edf7f1; border-radius: 20px; padding: 5px 10px; }
.portal-status-pending { color: #7b8799; background: #f0f3f7; }
.portal-card h2 { font-size: 23px; margin: 0 0 13px; }
.portal-card > p { margin: 0; font-size: 14px; line-height: 1.85; color: #7a8aa1; }
.portal-tags { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 24px 0 30px; font-size: 12px; color: #6880a1; }
.portal-enter { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 48px; padding: 12px 18px; text-decoration: none; font: inherit; font-size: 14px; font-weight: 550; color: white; background: #2862e8; border: 1px solid #2862e8; border-radius: 10px; margin-top: auto; }
.portal-enter:hover { background: #1e52cb; }
.portal-enter:focus-visible { outline: 3px solid #89abff; outline-offset: 4px; }
.portal-card-pending .portal-icon { background: #f1f4f8; color: #8697b0; }
.portal-enter:disabled { justify-content: center; background: #f5f7fa; border-color: #e6ebf2; color: #8d9ab0; cursor: not-allowed; font-weight: 400; }
.portal-footer { margin: 40px 0 12px; color: #8c9ab0; font-size: 12px; line-height: 1.8; text-align: center; }
@media(max-width: 680px) {
  .portal-shell { padding: 28px 20px; }
  .portal-intro { margin: 40px 0 26px; }
  .portal-grid { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .portal-card { padding: 24px; }
  .portal-card h2 { font-size: 21px; }
  .portal-footer { margin-top: 28px; }
}

/* Login and account chrome share the console's restrained blue/white palette. */
.environment-label { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; white-space: nowrap; }
.environment-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.environment-banner {
  display: flex; justify-content: center; align-items: center; gap: 12px;
  padding: 7px 20px; color: #826324; background: #fff9e9;
  border-bottom: 1px solid #f2ead4; font-size: 12px; line-height: 1.5;
}
.account { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.account-avatar {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 50%; background: #edf3ff; color: #406cbb;
  border: 1px solid #e0eaff; flex-shrink: 0;
}
.account-avatar svg { width: 21px; height: 21px; }
.account-identity { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.account-name { max-width: 144px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; line-height: 1.3; }
.account-role { padding: 1px 6px; border-radius: 4px; background: #f0f5ff; color: #526f9f; font-size: 10px; line-height: 1.4; }
.account-logout { margin: 0 0 0 4px; padding-left: 14px; border-left: 1px solid #e9edf3; }
.logout-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 7px 10px; border: 1px solid transparent; border-radius: 7px;
  color: #697586; background: transparent; font: inherit; font-size: 13px;
  cursor: pointer; white-space: nowrap; transition: background .15s, color .15s;
}
.logout-button svg { width: 16px; height: 16px; }
.logout-button:hover { color: var(--accent); background: #f0f5ff; }
.logout-button:focus-visible, .login-action:focus-visible, .topbar .tab:focus-visible {
  outline: 3px solid #93b8fa; outline-offset: 3px;
}
.login-page {
  min-height: 100vh; min-height: 100svh; display: grid; place-items: center;
  padding: 40px 20px; background: #f4f7fc;
}
.login-card {
  width: 100%; max-width: 448px; padding: 38px; border: 1px solid #e5ebf4;
  border-radius: 18px; background: #fff; box-shadow: 0 16px 50px rgba(41, 65, 109, .06);
}
.login-heading { display: flex; align-items: center; gap: 15px; }
.login-mark {
  display: grid; place-items: center; width: 52px; height: 52px; flex-shrink: 0;
  color: #fff; background: var(--accent); border-radius: 14px;
  font-size: 16px; font-weight: 700; letter-spacing: 1px;
}
.login-eyebrow { margin: 0 0 5px; color: #7b8798; font-size: 12px; letter-spacing: 1px; }
.login-card h1 { margin: 0; color: #20304a; font-size: 25px; font-weight: 650; line-height: 1.4; letter-spacing: -.5px; }
.login-description { margin: 26px 0 22px; color: #64748b; font-size: 14px; line-height: 1.7; }
.login-environment {
  display: flex; flex-direction: column; gap: 7px; padding: 13px 15px; margin-bottom: 24px;
  color: #758198; background: #f6f8fc; border: 1px solid #edf1f7; border-radius: 9px; font-size: 12px;
}
.login-environment .environment-label { color: #5574a3; }
.login-action {
  display: flex; align-items: center; justify-content: space-between; min-height: 48px;
  width: 100%; padding: 12px 18px; border-radius: 9px; color: #fff;
  background: var(--accent); text-decoration: none; font-size: 15px; font-weight: 500;
  transition: background .15s, box-shadow .15s;
}
.login-action svg { width: 19px; height: 19px; }
.login-action:hover { background: #1d4ed8; box-shadow: 0 4px 12px rgba(37, 99, 235, .15); }
.login-footnote { margin: 18px 0 0; text-align: center; color: #8490a2; font-size: 12px; line-height: 1.6; }
.login-error { margin: 0 0 20px; padding: 12px 14px; border: 1px solid #fecaca; border-radius: 8px; color: #b42318; background: #fff6f5; font-size: 13px; line-height: 1.6; }
@media (max-width: 1050px) {
  .topbar { flex-wrap: wrap; gap: 14px 20px; }
  .topbar .tabs { order: 3; flex-basis: 100%; overflow-x: auto; padding-bottom: 2px; }
}
@media (max-width: 600px) {
  .topbar { padding: 12px 16px; gap: 12px; }
  .brand { font-size: 14px; }
  .topbar .tabs { gap: 18px; font-size: 13px; }
  .account { gap: 7px; }
  .account-avatar { width: 30px; height: 30px; }
  .account-avatar svg { width: 18px; height: 18px; }
  .account-name { max-width: 78px; font-size: 12px; }
  .account-logout { margin-left: 0; padding-left: 7px; }
  .logout-button { min-height: 36px; padding: 7px 4px; font-size: 12px; }
  .logout-button svg { display: none; }
  .environment-banner { flex-wrap: wrap; gap: 2px 10px; padding: 7px 16px; text-align: center; font-size: 11px; }
  .login-page { padding: 24px 16px; }
  .login-card { padding: 28px 24px; border-radius: 14px; }
  .login-heading { gap: 12px; }
  .login-mark { width: 44px; height: 44px; border-radius: 11px; font-size: 14px; }
  .login-card h1 { font-size: 21px; }
  .login-description { font-size: 13px; }
}

.search-layout {
  display: grid;
  grid-template-columns: 240px 1fr 420px;
  gap: 20px;
  align-items: start;
}

.sidebar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 16px;
}

.filter-group label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }

.filter-group input[type="text"],
.filter-group input[type="number"],
.filter-group select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
}

.checkbox-list {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.option-filter {
  width: 100%;
  padding: 5px 8px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
}

.checkbox-item { font-size: 13px; display: flex; align-items: center; gap: 6px; }

.range-inputs { display: flex; align-items: center; gap: 6px; }

.empty-hint { font-size: 12px; color: var(--muted); }

.results-header { margin-bottom: 12px; color: var(--muted); font-size: 13px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.card-thumb {
  aspect-ratio: 1 / 1;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-thumb img { width: 100%; height: 100%; object-fit: cover; }

.card-thumb-placeholder { color: var(--muted); font-size: 12px; }

.card-body { padding: 10px; display: flex; flex-direction: column; gap: 4px; }

.card-article { font-weight: 600; font-size: 13px; }

.card-spec, .card-ingredients, .card-shop { font-size: 12px; color: var(--muted); }

.card-status {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  background: #eef2ff;
  color: var(--accent);
  width: fit-content;
}

.empty-state { color: var(--muted); padding: 40px; text-align: center; grid-column: 1 / -1; }

.drawer {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  overflow-y: auto;
  max-height: calc(100vh - 120px);
  position: sticky;
  top: 16px;
}

.card-code { font-size: 11px; color: var(--muted); }

.drawer:empty {
  display: none;
}

.card:hover {
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ---------- 详情抽屉：卡片式 ---------- */
.detail-drawer { display: flex; flex-direction: column; gap: 12px; }

.detail-topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.detail-title { margin: 0; font-size: 16px; line-height: 1.4; word-break: break-all; }
.detail-close {
  background: none; border: none; font-size: 15px; color: var(--muted);
  cursor: pointer; padding: 2px 6px; flex-shrink: 0; line-height: 1;
}
.detail-close:hover { color: var(--text); }

.detail-card {
  background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 12px;
}
.detail-card-title {
  font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 8px;
}
summary.detail-card-title { cursor: pointer; margin-bottom: 0; list-style: revert; }
.detail-collapsible[open] > summary.detail-card-title { margin-bottom: 8px; }

/* 图片：自适应抽屉宽度的两列网格 */
.detail-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.detail-gallery-link { display: block; }
.detail-gallery-img {
  width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--border); display: block;
}
.detail-gallery-empty { color: var(--muted); font-size: 13px; }

/* 键值表（基本信息 / 元信息）*/
.detail-kv {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 13px;
}
.detail-kv dt { color: var(--muted); white-space: nowrap; }
.detail-kv dd { margin: 0; word-break: break-all; }
.source-link { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--accent); }

/* 参数行 */
.param-row { padding: 8px 0; border-top: 1px solid var(--border); }
.param-row:first-child { border-top: none; padding-top: 0; }
.param-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.param-label { color: var(--muted); font-size: 13px; flex-shrink: 0; }
.param-value { font-size: 13px; text-align: right; word-break: break-all; }
.param-row.is-overridden .param-value { color: var(--accent); font-weight: 600; }
.badge-override {
  font-size: 11px; background: #eef2ff; color: var(--accent);
  padding: 1px 6px; border-radius: 8px; font-weight: 400;
}
.param-edit { margin-top: 6px; }
.param-edit > summary { font-size: 12px; color: var(--accent); cursor: pointer; }
.param-raw { font-size: 12px; color: var(--muted); margin: 6px 0; }
.param-edit form { display: flex; gap: 6px; margin-top: 6px; align-items: center; flex-wrap: wrap; }
.param-edit input[type="text"] {
  flex: 1; min-width: 120px; padding: 5px 8px; border: 1px solid var(--border);
  border-radius: 4px; font-size: 13px;
}
.param-edit button {
  padding: 5px 12px; border: 1px solid var(--accent); background: var(--accent);
  color: #fff; border-radius: 4px; font-size: 13px; cursor: pointer;
}
.param-edit .btn-link {
  background: none; border: none; color: var(--muted); padding: 4px 0;
  text-decoration: underline; font-size: 12px;
}

.detail-raw-pre {
  max-height: 200px; overflow: auto; background: var(--bg); padding: 8px;
  border-radius: 6px; font-size: 11px; white-space: pre-wrap; word-break: break-all; margin: 0;
}

/* ---------- 检索加载指示 ---------- */
.search-loading {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff; padding: 6px 18px; border-radius: 20px;
  font-size: 13px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18); z-index: 200;
  display: none;
}
/* htmx 在请求期间给 hx-indicator 目标加 .htmx-request */
.search-loading.htmx-request { display: block; }
/* 结果区在检索期间变暗，明确「正在检索」 */
.results.htmx-request { opacity: 0.5; transition: opacity 0.15s; pointer-events: none; }

/* ---------- 可折叠筛选组 + 分类树 ---------- */
.fg { border: 1px solid var(--border); border-radius: 6px; background: #fff; overflow: hidden; }
.fg > summary {
  cursor: pointer; padding: 8px 10px; font-size: 13px; font-weight: 500;
  color: var(--text); user-select: none;
}
.fg > summary:hover { background: #fafafa; }
.fg-count { color: var(--accent); font-size: 12px; font-weight: 600; }
.fg .option-filter { margin: 0 10px 6px; width: calc(100% - 20px); }
.fg .checkbox-list { padding: 0 10px 10px; max-height: 240px; }

.type-group { margin-bottom: 6px; }
.type-top { font-size: 13px; }
.type-all { color: var(--muted); font-size: 11px; }
.type-child { padding-left: 20px; font-size: 12px; color: var(--muted); }
.checkbox-item input:disabled { opacity: 0.5; }

/* ---------- 采集监控仪表盘 ---------- */
.monitor { max-width: 1180px; }
.monitor-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; }
.monitor-head h1 { font-size: 20px; margin: 0; }
.monitor-ts { color: var(--muted); font-size: 12px; }

.platform-card {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 18px 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.platform-card-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.platform-id { display: flex; align-items: baseline; gap: 12px; }
.platform-badge {
  background: #eef2ff; color: var(--accent); font-weight: 700; font-size: 13px;
  letter-spacing: 0.5px; padding: 4px 10px; border-radius: 6px; text-transform: uppercase;
}
.mon-sub { color: var(--muted); font-size: 12px; }
.section-label {
  font-size: 12px; font-weight: 600; color: var(--muted);
  margin: 4px 0 10px; padding-left: 10px; position: relative;
}
.section-label::before {
  content: ""; position: absolute; left: 0; top: 1px; bottom: 1px;
  width: 3px; border-radius: 2px; background: var(--accent);
}
/* 平台卡内的子面板用浅底以和白色卡面区分 */
.platform-card .mon-card { background: var(--bg); }

/* 更新按钮 + 后台任务状态 */
.jobbox { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.btn-update {
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  border-radius: 6px; padding: 6px 14px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.btn-update:hover { filter: brightness(1.05); }
.btn-update:disabled { background: #9ca3af; border-color: #9ca3af; cursor: not-allowed; }
.job-meta { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.job-ok { color: #15803d; }
.job-err { color: #dc2626; }
.job-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #16a34a;
  display: inline-block; animation: jobpulse 1.1s ease-in-out infinite;
}
@keyframes jobpulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.job-log-wrap { flex-basis: 100%; margin-top: 6px; }
.job-log-wrap > summary { font-size: 12px; color: var(--accent); cursor: pointer; }
.job-log {
  margin: 6px 0 0; padding: 8px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; font-size: 11px; max-height: 150px; overflow: auto;
  white-space: pre-wrap; word-break: break-all;
}

/* 语义色（数字/文字） */
.lvl-good { color: #15803d; }
.lvl-ok { color: var(--accent); }
.lvl-warn { color: #b45309; }
.lvl-bad { color: #dc2626; }

/* KPI 概览 */
.kpi-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 18px; }
.kpi {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 10px; text-align: center;
}
.kpi-num { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1.1; }
.kpi-label { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* 字段覆盖率：4 个并排仪表卡 */
.cov-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.cov-card { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.cov-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.cov-label { font-size: 13px; color: var(--text); }
.cov-pct { font-size: 18px; font-weight: 700; color: var(--accent); }
.cov-bar { height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
.cov-fill { height: 100%; border-radius: 3px; background: var(--accent); }
.cov-sub { font-size: 11px; color: var(--muted); margin-top: 6px; }
.cov-card.lvl-good .cov-pct { color: #15803d; } .cov-card.lvl-good .cov-fill { background: #16a34a; }
.cov-card.lvl-ok   .cov-pct { color: var(--accent); } .cov-card.lvl-ok .cov-fill { background: var(--accent); }
.cov-card.lvl-warn .cov-pct { color: #b45309; } .cov-card.lvl-warn .cov-fill { background: #d97706; }
.cov-card.lvl-bad  .cov-pct { color: #dc2626; } .cov-card.lvl-bad .cov-fill { background: #dc2626; }

/* OCR / 近7天：等宽两栏 */
.mon-2col-even { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mon-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.mon-card-title { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.mon-kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 0; font-size: 13px; }
.mon-kv dt { color: var(--muted); }
.mon-kv dd { margin: 0; font-weight: 600; text-align: right; }
.mon-good { color: #15803d; }
.mon-bad { color: #dc2626; }
.mon-empty { color: var(--muted); font-size: 13px; }

/* 异常与数据质量：通栏，左统计 + 右店铺条形 */
.anomaly-grid { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: start; }
.astat { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 18px; text-align: center; }
.astat-num { font-size: 30px; font-weight: 700; line-height: 1; }
.astat-bad .astat-num { color: #dc2626; }
.astat-good .astat-num { color: #15803d; }
.astat-label { font-size: 12px; color: var(--muted); margin-top: 6px; }
.mon-sub2 { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.shopbar-list { display: flex; flex-direction: column; gap: 8px; }
.shopbar { display: grid; grid-template-columns: 130px 1fr 36px; align-items: center; gap: 12px; font-size: 13px; }
.shopbar-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shopbar-track { height: 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.shopbar-fill { display: block; height: 100%; background: #f59e0b; border-radius: 7px; }
.shopbar-num { text-align: right; font-weight: 600; color: var(--muted); }

/* OCR 补全按钮 + 任务提示 */
.btn-ocr { background: #0d9488; border-color: #0d9488; }
.btn-backfill { background: #7c5cd6; border-color: #7c5cd6; }
.ocr-action { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.ocr-action .jobbox { justify-content: flex-start; }
.shop-update-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.shop-update-form select { flex: 1 1 auto; min-width: 120px; max-width: 100%; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: 6px; background: #fff; font-size: 13px; }
.shop-update-form select[name="kind"] { flex: 0 0 auto; }
.shopjob-result:not(:empty) { margin-top: 10px; }
.job-pending { color: var(--accent); font-weight: 600; }
.job-sep { color: var(--border); }
.job-error { flex-basis: 100%; margin-top: 6px; color: #b45309; font-size: 12px; }

/* ---- 来源角标（手工 vs 采集）---- */
.src-badge {
  display: inline-block; font-size: 11px; line-height: 1; padding: 3px 6px;
  border-radius: 4px; vertical-align: middle; font-weight: 600;
}
.src-manual { background: #fef3c7; color: #92400e; }

/* 来源筛选：并排小勾选 */
.inline-checks { display: flex; gap: 14px; }
.filter-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---- 样本录入页 ---- */
.muted { color: var(--muted); font-weight: 400; font-size: 0.85em; }
.manual-layout {
  display: grid; grid-template-columns: minmax(360px, 460px) 1fr; gap: 20px; align-items: start;
}
.manual-entry-layout { display: block; max-width: 1120px; }
.manual-left-col { display: flex; flex-direction: column; gap: 20px; }
.manual-form-card, .manual-list-card {
  background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 16px;
}
.manual-h { font-size: 15px; margin: 0 0 14px; }
.manual-form-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  position: sticky; top: 0; z-index: 5; margin: -16px -16px 14px; padding: 14px 16px;
  background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
}
.manual-form-toolbar .manual-h { margin: 0; }
.manual-form-toolbar-actions { display: flex; align-items: center; gap: 14px; }
.manual-form-toolbar .template-manage-link { margin-bottom: 0; }
.mf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.manual-entry-layout .mf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.entry-sections { display: flex; flex-direction: column; gap: 16px; }
.entry-section {
  border-top: 1px solid var(--border); padding-top: 12px;
}
.entry-section-main { border-top: none; padding-top: 0; }
.entry-section-title {
  margin-bottom: 9px; font-size: 13px; font-weight: 600; color: var(--text);
}
.entry-main-grid { align-items: start; }
.entry-main-grid .mf-item-no { grid-column: span 1; }
.entry-main-grid .mf-item-no input {
  font-size: 16px; font-weight: 600; letter-spacing: 0;
}
.mf-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.mf-field.mf-wide { grid-column: 1 / -1; }
.manual-form input, .manual-form textarea, .manual-form select {
  width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 13px; color: var(--text); background: #fff; font-family: inherit;
}
.manual-form input:focus, .manual-form textarea:focus, .manual-form select:focus {
  outline: none; border-color: var(--accent);
}
.manual-form textarea { resize: vertical; }
.field-warning { min-height: 16px; color: #b91c1c; font-size: 12px; line-height: 1.3; }
.mf-existing { margin-top: 12px; font-size: 12px; }
.mf-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mf-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 5px; border: 1px solid var(--border); }
.mf-actions { margin-top: 16px; display: flex; align-items: center; gap: 14px; }
.btn-primary {
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  padding: 9px 20px; border-radius: 6px; font-size: 14px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-link { color: var(--muted); font-size: 13px; text-decoration: none; }
.btn-link:hover { color: var(--text); }

.manual-grid { display: flex; flex-direction: column; gap: 10px; }
.manual-item {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center;
  background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px;
}
.manual-item.is-editing { border-color: var(--accent); box-shadow: 0 0 0 2px #dbeafe; }
.mi-thumb { width: 56px; height: 56px; border-radius: 6px; overflow: hidden; background: var(--bg); }
.mi-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mi-noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }
.mi-name { font-size: 14px; font-weight: 600; }
.mi-spec, .mi-supplier { font-size: 12px; color: var(--muted); margin-top: 2px; }
.mi-edit { color: var(--accent); font-size: 13px; text-decoration: none; white-space: nowrap; }
.mi-edit:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .manual-layout { grid-template-columns: 1fr; }
  .manual-entry-layout .mf-grid,
  .mf-grid { grid-template-columns: 1fr; }
  .manual-form-toolbar { align-items: flex-start; flex-direction: column; position: static; }
  .manual-form-toolbar-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; }
}

/* ---- 运行参数面板 ---- */
.settings-panel { margin-top: 16px; }
.settings-form { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin: 12px 0; }
.settings-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.settings-form input { width: 130px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; }
.settings-secrets { border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.settings-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.settings-row input { flex: 1; min-width: 240px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; }
.settings-label { font-size: 13px; font-weight: 600; }
.settings-test-result { font-size: 12px; }

/* ---- 打印标签库页 ---- */
.print-page { display: flex; flex-direction: column; gap: 14px; }
.print-head { display: flex; align-items: center; justify-content: space-between; }
.print-head h1 { margin: 0; font-size: 18px; }
.print-head-actions { display: flex; align-items: center; gap: 14px; }
.print-filters { display: flex; align-items: flex-end; gap: 12px; background: #fff;
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
.print-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.print-filters input[type="text"], .print-filters select {
  padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; min-width: 200px;
}
.print-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; }
.print-table th, .print-table td { padding: 8px 10px; border-bottom: 1px solid var(--border);
  font-size: 13px; text-align: left; vertical-align: middle; }
.print-table th { color: var(--muted); font-weight: 500; background: var(--bg); }
.print-table tbody tr:last-child td { border-bottom: none; }
.print-row-actions { display: flex; gap: 10px; white-space: nowrap; align-items: center; }
.print-row-actions button.btn-link { background: none; border: none; padding: 0; cursor: pointer; font: inherit; }
.print-export-bar { display: flex; justify-content: flex-end; }
.print-item-no { font-weight: 600; white-space: nowrap; }
.print-item-sub { margin-top: 2px; color: var(--muted); font-size: 12px; }
.print-status-cell { min-width: 112px; }
.print-status-badge {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 8px; border-radius: 999px; font-size: 12px; line-height: 1.2;
  border: 1px solid var(--border); background: #f8fafc; color: #475569; white-space: nowrap;
}
.ps-none { background: #f8fafc; color: #64748b; }
.ps-sent { background: #eef2ff; color: #405179; border-color: #dbe5fb; }
.ps-pending { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.ps-done { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.ps-failed { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.print-status-meta { margin-top: 3px; color: var(--muted); font-size: 11px; white-space: nowrap; }

/* ---------- 历史 BTW 试跑审核 ---------- */
.btw-review-page { max-width: 1480px; display: flex; flex-direction: column; gap: 14px; }
.sample-history-card { padding:24px; background:#fff; border:1px solid var(--border); border-radius:14px; overflow-wrap:anywhere; }
.sample-history-card > header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.sample-history-card h2 { margin:6px 0; font-size:19px; }.sample-history-card p { color:var(--muted); }
.sample-history-card details { margin-top:12px; }.sample-history-card summary { cursor:pointer; min-height:44px; display:flex; align-items:center; color:#254d86; font-weight:600; }
.sample-history-fields { border:0; padding:0; min-width:0; }.sample-history-fields > button { min-height:44px; margin-top:16px; }
.sample-history-source { border-top:1px solid var(--border); padding:16px 0; }.sample-history-source dl { display:grid; grid-template-columns:auto 1fr; gap:8px 16px; font-size:13px; }.sample-history-source dd { margin:0; }
.btw-filters select { min-height:40px; border:1px solid var(--border); border-radius:6px; background:#fff; padding:7px; }
@media(max-width:640px) { .sample-history-card { padding:14px; }.sample-history-card > header { flex-direction:column; }.sample-history-source dl { grid-template-columns:1fr; } }
.btw-entry-card, .btw-review-head, .btw-filters, .btw-review-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.btw-entry-card { padding: 20px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.btw-entry-card h1 { width: 100%; margin: 0; font-size: 20px; }
.btw-entry-card p { width: 100%; margin: 0; color: var(--muted); }
.btw-review-head { padding: 14px 16px; display: flex; gap: 14px; justify-content: space-between; align-items: flex-start; }
.btw-review-head h1 { margin: 0; font-size: 19px; }.btw-review-head p { color: var(--muted); margin: 5px 0 0; font-size: 13px; }
.btw-summary { position: sticky; top: 12px; z-index: 3; display: flex; flex-wrap: wrap; gap: 7px 11px; max-width: 570px; padding: 9px 11px; border-radius: 8px; background: #f8fafc; font-size: 12px; }
.btw-summary small { flex-basis: 100%; color: var(--muted); }
.btw-filters { padding: 11px 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }.btw-filters label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }.btw-filters input { min-width: 140px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 6px; }
.btw-card-list { display: flex; flex-direction: column; gap: 14px; }.btw-review-card { display: grid; grid-template-columns: minmax(260px, .9fr) minmax(320px, 1.1fr) minmax(260px, .9fr); overflow: hidden; }.btw-column { padding: 16px; min-width: 0; border-left: 1px solid var(--border); }.btw-column:first-child { border-left: 0; }.btw-column h2 { margin: 0 0 12px; font-size: 15px; }.btw-column h3 { margin: 16px 0 7px; font-size: 13px; color: var(--muted); }.btw-original img { width: 100%; max-height: 440px; object-fit: contain; border: 1px solid var(--border); border-radius: 7px; background: var(--bg); }.btw-column dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 9px; margin: 11px 0 0; font-size: 12px; }.btw-column dt { color: var(--muted); }.btw-column dd { margin: 0; overflow-wrap: anywhere; }.btw-fields form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }.btw-fields label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }.btw-fields input { width: 100%; padding: 7px 8px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); }.btw-fields input:focus { outline: 2px solid #bfdbfe; border-color: var(--accent); }.btw-actions { grid-column: 1 / -1; display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }.btw-actions .btn-link { border: 0; background: transparent; cursor: pointer; padding: 6px 3px; }.btw-actions button:disabled { opacity: .55; cursor: not-allowed; }.btw-confidence, .btw-reasons ul { font-size: 12px; line-height: 1.55; }.btw-status { display: inline-block; padding: 3px 8px; margin: 0; border-radius: 999px; background: #eef2ff; color: var(--accent); font-size: 12px; }

@media (max-width: 980px) { .btw-review-head { flex-direction: column; }.btw-summary { position: static; max-width: none; }.btw-review-card { grid-template-columns: 1fr; }.btw-column { border-left: 0; border-top: 1px solid var(--border); }.btw-column:first-child { border-top: 0; } }
@media (max-width: 640px) { .btw-fields form { grid-template-columns: 1fr; }.btw-review-head, .btw-filters, .btw-column { padding: 12px; }.btw-filters label, .btw-filters input { width: 100%; } }

/* ---------- 录入业务库弹卡片 ---------- */
button { font-family: inherit; }

.modal-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 28px 20px;
  animation: pm-fade .16s ease;
}
@keyframes pm-fade { from { opacity: 0 } to { opacity: 1 } }

.pm-card {
  background: #fff; border-radius: 14px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .28);
  width: min(780px, 100%); max-height: calc(100vh - 72px);
  overflow-y: auto;
  animation: pm-pop .2s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes pm-pop {
  from { opacity: 0; transform: translateY(12px) scale(.97) }
  to   { opacity: 1; transform: none }
}

.pm-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: #fff; z-index: 1;
  border-radius: 14px 14px 0 0;
}
.pm-head h3 { margin: 0; font-size: 15px; }
.pm-head-sub { font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 8px; }
.pm-close {
  background: none; border: none; font-size: 15px; color: var(--muted);
  cursor: pointer; padding: 4px 9px; border-radius: 6px; line-height: 1;
}
.pm-close:hover { background: var(--bg); color: var(--text); }

.pm-body { display: grid; grid-template-columns: 250px 1fr; }

.pm-source {
  padding: 18px 20px; border-right: 1px solid var(--border);
  background: #fafbfc; border-radius: 0 0 0 14px;
}
.pm-thumb {
  aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden;
  background: #eef0f3; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
}
.pm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pm-noimg { color: var(--muted); font-size: 12px; }
.pm-src-name { margin-top: 10px; font-weight: 600; font-size: 13px; word-break: break-all; }
.pm-src-specs {
  display: grid; grid-template-columns: auto 1fr; gap: 5px 12px;
  font-size: 12px; margin: 10px 0 0;
}
.pm-src-specs dt { color: var(--muted); white-space: nowrap; }
.pm-src-specs dd { margin: 0; word-break: break-all; }
.pm-src-hint {
  margin-top: 14px; font-size: 11px; line-height: 1.6; color: #4c5d94;
  background: #eef2ff; padding: 7px 10px; border-radius: 8px;
}

.pm-form { padding: 18px 20px; }
.pm-actions { justify-content: flex-end; }

/* 成功卡 */
.pm-done {
  width: min(420px, 100%); padding: 36px 32px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.pm-done-icon {
  width: 54px; height: 54px; border-radius: 50%;
  background: #dcfce7; color: #16a34a; font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.pm-done-text { font-size: 14px; }
.pm-done-text b { margin-left: 6px; }
.pm-done-actions { display: flex; align-items: center; gap: 16px; margin-top: 4px; }

@media (max-width: 640px) {
  .pm-body { grid-template-columns: 1fr; }
  .pm-source { border-right: none; border-bottom: 1px solid var(--border); border-radius: 0; }
}

/* ---------- 样本录入结果页 ---------- */
.record-result-page { max-width: 640px; }
.record-result-card {
  display: flex; align-items: flex-start; gap: 18px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 22px;
}
.record-result-card.is-ok { border-color: #bbf7d0; }
.record-result-card.is-error { border-color: #fecaca; }
.record-result-icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; flex-shrink: 0;
}
.record-result-card.is-ok .record-result-icon { background: #dcfce7; color: #16a34a; }
.record-result-card.is-error .record-result-icon { background: #fee2e2; color: #dc2626; }
.record-result-main h1 { margin: 0; font-size: 18px; }
.record-result-main p { margin: 8px 0 0; color: var(--text); font-size: 14px; line-height: 1.6; }
.record-result-actions { display: flex; align-items: center; gap: 16px; margin-top: 18px; }

/* 详情抽屉里的「录入业务库」：通栏块级，与基本信息隔开——行内按钮的
   垂直 padding 不撑行高，曾压到上一行「状态」文字上（错位根因）。 */
.detail-card .btn-update {
  display: block; width: 100%; margin-top: 12px; text-align: center;
}

/* ---------- 检索结果卡片美化 ---------- */
.card {
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .10);
  border-color: #c7d4f2;
}
.card-body { padding: 11px 12px 12px; }
.card-article { font-size: 13.5px; line-height: 1.4; }
.card-spec { color: #3f4854; }
.card-ingredients, .card-shop {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-status { background: #f1f5f9; color: #64748b; }
.card-actions { margin-top: 7px; }
.btn-mini {
  display: block; width: 100%; text-align: center;
  padding: 6px 10px; font-size: 12px;
  color: var(--accent); background: #fff;
  border: 1px solid #c9d8f8; border-radius: 8px;
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.btn-mini:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- 打印页：发送/导出横幅 ---------- */
.print-banner {
  margin: 0 0 14px; padding: 10px 14px; border-radius: 8px; font-size: 13px;
}
.print-banner-ok { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.print-banner-err { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.print-export-bar { display: flex; gap: 10px; }

/* ---------- 克重后缀输入组 ---------- */
.input-suffix-group {
  display: flex; align-items: stretch;
  border: 1px solid var(--border); border-radius: 6px; background: #fff; overflow: hidden;
}
.input-suffix-group input[type="number"] {
  flex: 1; border: none !important; border-radius: 0 !important; min-width: 0;
}
.input-suffix-group input[type="number"]:focus { outline: none; }
.input-suffix-group:focus-within { border-color: var(--accent); }
.input-suffix {
  display: flex; align-items: center; padding: 0 10px;
  background: #f4f6f9; color: var(--muted); font-size: 12px;
  border-left: 1px solid var(--border); white-space: nowrap;
}

/* ---------- 打印确认弹卡片 ---------- */
.pm-confirm { width: min(440px, 100%); }
.pm-confirm-body { padding: 18px 20px; }
.pm-confirm-specs { margin-bottom: 14px; }
.pm-copies { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.pm-copies input {
  width: 90px; padding: 6px 8px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px;
}
.pm-confirm-form { border-top: 1px solid var(--border); padding-top: 14px; }
.pm-err-icon { background: #fee2e2; color: #dc2626; }

/* ---------- 对客选品管理：右侧详情抽屉 ---------- */
.print-body { display: flex; gap: 16px; align-items: flex-start; }
.print-table-form { flex: 1; min-width: 0; }
.print-drawer { width: 390px; flex-shrink: 0; position: sticky; top: 16px; }
.print-drawer:empty { display: none; }
.pd-panel {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; display: flex; flex-direction: column; gap: 12px;
  max-height: calc(100vh - 100px); overflow-y: auto;
}
.pd-head { display: flex; justify-content: space-between; align-items: center; }
.pd-head h3 { margin: 0; font-size: 14px; word-break: break-all; }
.pd-thumb {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--border); margin-bottom: 10px;
}
.pd-actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.pd-actions .btn-update { display: inline-block; width: auto; margin-top: 0; }
.print-row:hover td { background: #f6f8fc; }
.btn-print-row { display: inline-block; width: auto; padding: 4px 10px; margin-right: 6px; }
.print-row-actions { white-space: nowrap; }
.print-export-hint { font-size: 12px; margin-left: 10px; }

/* ---------- 样本录入：可选折叠区 ---------- */
.manual-optional {
  border: 1px dashed var(--border); border-radius: 8px; background: #fbfbfc;
  margin-top: 14px; padding: 0;
}
.manual-optional-summary {
  cursor: pointer; padding: 10px 14px; font-size: 13px; color: var(--muted);
  user-select: none;
}
.manual-optional-summary:hover { color: var(--text); }
.manual-optional[open] { background: transparent; border-style: solid; }
.manual-optional[open] .manual-optional-summary { border-bottom: 1px solid var(--border); }
.manual-optional .manual-form-card { border: none; box-shadow: none; margin: 0; }

/* 备注列：截断显示，悬停看全文(title) */
.print-note-cell { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.pf-market { margin-top: 4px; margin-bottom: 14px; }
.pf-market-grid { padding: 12px 14px; }

/* 打印页收尾打磨 */
.print-head-add { display: inline-block; text-decoration: none; }
.print-export-btn { background: none; border: none; cursor: pointer; padding: 4px 0; }
.pd-del { display: inline; margin: 0; }
.pd-del-btn { background: none; border: none; cursor: pointer; padding: 0; font: inherit;
  color: #b91c1c; }
.pd-del-btn:hover { text-decoration: underline; }
.print-history-summary, .print-history-empty {
  color: var(--muted); font-size: 12px; margin-bottom: 8px;
}
.print-history-list { display: flex; flex-direction: column; gap: 7px; }
.print-history-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center;
  font-size: 12px; color: var(--text);
}
.print-history-time { color: var(--muted); }
.print-history-copies { color: var(--muted); white-space: nowrap; }
/* 业务录入表单：备注与市场信息折叠区拉开距离，加分隔线 */
.pf-market { margin-top: 20px; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px;
  padding-top: 6px; border-left: none; border-right: none; border-bottom: none; background: transparent; }
.pf-market[open] { border: 1px dashed var(--border); border-radius: 8px; margin-top: 20px;
  padding-top: 0; background: #fbfbfc; }

/* ---------- 录入样本模板 ---------- */
.sample-template-picker {
  display: flex; align-items: flex-end; gap: 12px; margin-bottom: 12px;
  padding: 10px 12px; border: 1px solid #dbe5fb; border-radius: 8px; background: #f7f9ff;
}
.sample-template-picker .mf-field { flex: 1; }
.template-manage-link { white-space: nowrap; margin-bottom: 7px; color: var(--accent); }
#sample-template-fields > .mf-grid { margin-top: 12px; }
.template-hint {
  padding: 11px 14px; border: 1px solid #dbe5fb; border-radius: 8px;
  background: #f7f9ff; color: #405179; font-size: 13px; line-height: 1.6;
}
.template-layout { grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); }
.template-layout > section { min-width: 0; }
.template-source-hint, .template-error {
  margin: -4px 0 12px; padding: 8px 10px; border-radius: 6px; font-size: 12px;
}
.template-source-hint { background: #eef2ff; color: #405179; }
.template-error { background: #fee2e2; color: #b91c1c; }
.template-list { display: flex; flex-direction: column; gap: 10px; }
.template-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
.template-item.is-editing { border-color: var(--accent); box-shadow: 0 0 0 2px #dbeafe; }
.template-item-main { min-width: 0; }
.template-item-name { font-size: 14px; font-weight: 600; }
.template-item-spec, .template-item-supplier {
  margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45;
  overflow-wrap: anywhere;
}
.template-layout .template-item { flex-wrap: wrap; }
.template-item-actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.template-item-actions form { margin: 0; }
.template-delete {
  padding: 0; border: none; background: none; color: #b91c1c; cursor: pointer; font-size: 13px;
}
.template-delete:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .template-layout { grid-template-columns: 1fr; }
  .print-head { align-items: flex-start; gap: 10px; flex-wrap: wrap; }
  .print-head-actions { flex-wrap: wrap; }
  .sample-template-picker { align-items: stretch; flex-direction: column; }
  .template-manage-link { margin-bottom: 0; }
}

/* Print queue demo — scoped additions, existing table geometry is unchanged. */
.queue-demo-bar { display:flex; align-items:center; justify-content:space-between; gap:20px; background:#fff9e9; border:1px solid #f1dfb8; border-radius:12px; padding:14px 18px; margin:0 0 18px; color:#735019; }
.queue-demo-bar p { margin:5px 0 0; font-size:13px; color:#8a744d; }
.queue-demo-bar form { margin:0; flex-shrink:0; }
.queue-task-link { display:inline-block; font-size:12px; margin-top:5px; color:#4566a0; text-decoration:none; }
.queue-task-link:hover { text-decoration:underline; }
.queue-error { color:#b42318; background:#fff3f0; border:1px solid #f9d0c8; padding:10px 12px; border-radius:8px; }
.queue-simulation-note { color:#89682a; font-size:13px; }
.queue-result-state { margin:12px 0; }
.queue-id { word-break:break-all; font:12px ui-monospace,monospace; }
.queue-explanation { font-size:13px; line-height:1.7; }
.queue-check { display:flex; align-items:flex-start; gap:8px; margin:14px 0; font-size:13px; line-height:1.6; }
.queue-event { font-size:13px; line-height:1.65; }
.queue-event .muted { display:block; font-size:11px; }
.ps-queued,.ps-claimed,.ps-received,.ps-published,.ps-processing { color:#2c63a6; background:#edf5ff; border-color:#cee1fa; }
.ps-submitted { color:#6957a0; background:#f2effb; border-color:#e3daf7; }
.ps-needs_review { color:#8a5d13; background:#fff4db; border-color:#efd89f; }
.ps-confirmed { color:#237653; background:#eaf7f0; border-color:#c8e8d8; }
.ps-closed { color:#647080; background:#f1f3f5; border-color:#e2e5e9; }
#print-status-network-note:not(:empty) { display:block; margin:0 0 12px; font-size:12px; color:#967320; }
@media(max-width:700px) { .queue-demo-bar { align-items:flex-start; flex-direction:column; gap:10px; } }
.queue-demo-controls,.queue-demo-actions form { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.queue-demo-actions .btn-mini { margin:3px 0; }
:root { --maintenance-bg: #fff8e6; --maintenance-text: #77530e; }
.maintenance-banner { margin: 16px 24px 0; padding: 12px 16px; border: 1px solid #ecdbaa; border-radius: 10px; background: var(--maintenance-bg); color: var(--maintenance-text); display: flex; gap: 10px; align-items: center; }
.maintenance-banner[hidden] { display: none; }
.maintenance-dot { width: 7px; height: 7px; border-radius: 50%; background: #c49324; flex: none; }
[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
.history-page { max-width: 1180px; margin: 0 auto; }
.history-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.history-heading h1 { margin: 6px 0 10px; font-size: 27px; }
.history-eyebrow { color: #617798; font-size: 13px; letter-spacing: .06em; margin: 0; }
.history-search { padding: 22px 24px; border: 1px solid #e1e6ee; background: white; border-radius: 14px; }
.history-search label { display: block; color: #52627a; font-size: 13px; margin-bottom: 8px; }
.history-search > div { display: flex; gap: 12px; }
.history-search input { flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid #cdd6e3; border-radius: 8px; font-size: 16px; }
.history-search p { margin: 12px 0 0; font-size: 13px; }
.history-results { display: grid; gap: 14px; }
.history-file { display: flex; align-items: center; gap: 24px; padding: 20px; background: #fff; border: 1px solid #e1e6ee; border-radius: 14px; }
.history-preview { width: 152px; height: 138px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: #f4f6fa; border-radius: 9px; color: #7d889b; text-align: center; }
.history-preview img { width: 152px; height: 138px; object-fit: contain; }
.history-file-info { min-width: 0; flex: 1; }
.history-download.btn-mini { width: auto; flex: 0 0 auto; white-space: nowrap; text-decoration: none; padding: 9px 12px; }
.history-pagination .btn-mini { width: auto; text-decoration: none; padding: 8px 14px; }
.history-file-info h2 { margin: 0 0 8px; font-size: 17px; overflow-wrap: anywhere; }
.history-path { color: #788497; font-size: 13px; overflow-wrap: anywhere; margin: 0 0 8px; }
.history-file-info > .muted { font-size: 12px; }
.history-badge { display: inline-block; border-radius: 6px; padding: 4px 8px; background: #edf3ff; color: #3e629d; font-size: 12px; }
.history-file details { margin-top: 10px; font-size: 12px; color: #6d788b; }
.history-file summary { cursor: pointer; }
.history-pagination { display: flex; justify-content: center; gap: 16px; margin-top: 24px; }
@media (max-width: 650px) {
  .history-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .history-search { padding: 16px; }
  .history-file { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 14px; padding: 14px; }
  .history-preview, .history-preview img { width: 105px; height: 112px; }
  .history-download { grid-column: 1 / -1; margin-left: auto; }
}
/* Bounded three-shop collection; retain the existing monitor for legacy deployments. */
.refresh-monitor { max-width: 1200px; margin: 0 auto; }
.refresh-shop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 24px 0; }
.refresh-shop-grid .platform-card { margin: 0; }
.refresh-shop-grid h2 { font-size: 19px; margin: 0; }
.refresh-shop-grid .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.refresh-shop-grid .shop-update-form { display: flex; flex-wrap: wrap; gap: 12px; }
.refresh-shop-grid button.btn-link { border: 1px solid var(--border); background: #fff; border-radius: 6px; padding: 7px 10px; cursor: pointer; }
.refresh-shop-grid button.btn-link:disabled { opacity: .6; cursor: not-allowed; }
.refresh-status-head { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.refresh-status .mon-sub { line-height: 1.9; }
@media (max-width: 900px) { .refresh-shop-grid { grid-template-columns: 1fr; } }
/* Shared standard sample form: same entry points, one compact vocabulary. */
.sample-fields { display: grid; gap: 20px; min-width: 0; color: #22334d; container-type: inline-size; container-name: sample-form; }
.sf-intro { border-bottom: 1px solid #e6ecf4; padding-bottom: 16px; }
.sf-eyebrow { color: #285fe3; font-size: 12px; letter-spacing: .08em; font-weight: 650; }
.sf-intro h3 { font-size: 20px; margin: 6px 0; }
.sf-intro p, .sf-notice { font-size: 13px; line-height: 1.7; color: #62738c; margin: 6px 0; }
.sf-notice { border-radius: 10px; background: #eff5ff; padding: 12px 16px; }
.sf-basic, .sf-core-grid, .sf-extra-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.sf-attribute { min-width: 0; border: 1px solid #e1e8f2; border-radius: 12px; padding: 16px; margin: 0; }
.sf-attribute legend { font-size: 14px; font-weight: 600; padding: 0 6px; }
.sf-core { font-weight: 400; color: #8a99ae; font-size: 11px; margin-left: 8px; }
.sf-options { display: flex; flex-wrap: wrap; gap: 8px; }
.sf-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 12px; border: 1px solid #e2e8f2; background: #fff; border-radius: 8px; font-size: 13px; cursor: pointer; box-sizing: border-box; }
.sf-chip:has(input:checked) { background: #edf3ff; color: #245be0; border-color: #9bb8fa; }
.sample-fields input, .sample-fields select, .sample-fields textarea { box-sizing: border-box; max-width: 100%; min-width: 0; font: inherit; border: 1px solid #d8e1ee; border-radius: 8px; padding: 10px; background: white; color: inherit; min-height: 44px; }
.sample-fields input[type=radio], .sample-fields input[type=checkbox] { min-height: auto; width: 15px; height: 15px; accent-color: #2864f0; }
.sample-fields :focus-visible { outline: 3px solid #80a8ff; outline-offset: 2px; }
.sample-fields [hidden] { display: none !important; }
.sf-fiber-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto; align-items: center; gap: 10px; margin-bottom: 8px; }
.sf-fiber-row:has([data-fiber-other]:not([hidden])) { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
.sf-range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) minmax(60px, .8fr); gap: 8px; align-items: center; }
.sf-range input, .sf-range select { width: 100%; }
.sf-measure-toolbar { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.sf-mode { display: inline-flex; border-radius: 8px; background: #f3f6fb; border: 1px solid #e1e8f2; padding: 3px; gap: 3px; }
.sf-mode label { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 0 10px; min-height: 44px; font-size: 12px; cursor: pointer; border-radius: 6px; color: #72819a; }
.sf-mode label:has(:checked) { color: #225de1; background: white; box-shadow: 0 1px 4px #1b365518; }
.sf-mode label:has(:focus-visible) { outline: 2px solid #80a8ff; }
.sf-mode input { position: absolute; opacity: 0; pointer-events: none; }
.sf-measure-toolbar [data-unit-display] { width: 108px; min-width: 108px; flex-shrink: 0; font-size: 13px; }
.sf-unit { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; color: #617691; background: #f6f8fc; border-radius: 8px; white-space: nowrap; }
.sf-measure-inputs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; }
.sf-measure-inputs[data-interval=fixed] { grid-template-columns: minmax(0, 1fr); }
.sf-measure-inputs input { width: 100%; font-variant-numeric: tabular-nums; }
.sf-measure-inputs > span { color: #7b8aa0; font-size: 13px; }
.sf-specification { border: 1px solid #dce5f3; border-radius: 12px; padding: 18px; background: #f9fbfe; min-width: 0; }
.sf-spec-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.sf-spec-heading h3 { margin: 0; font-size: 16px; }
.sf-spec-heading > span { color: #8493aa; font-size: 12px; }
.sf-specification [name=construction] { width: 100%; font-variant-numeric: tabular-nums; }
.sf-spec-help { color: #7788a1; font-size: 12px; line-height: 1.7; margin: 8px 0; }
.sf-ai-toolbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 14px 0 6px; }
.sf-ai-toolbar button, .sf-ai-footer button { min-height: 44px; }
.sf-ai-toolbar button { padding: 10px 16px; border: 1px solid #b7cbec; border-radius: 8px; background: #fff; color: #2458a7; font: inherit; font-weight: 600; cursor: pointer; }
.sf-ai-toolbar button:hover { background: #edf4ff; border-color: #7fa6e4; }
.sf-ai-toolbar button:focus-visible { outline: 3px solid #a9c9fa; outline-offset: 2px; }
.sf-ai-toolbar button:disabled { cursor: wait; color: #8c9bb1; background: #f3f6fa; border-color: #dce4ef; }
.sf-ai-toolbar > span { font-size: 12px; color: #71829a; line-height: 1.6; }
.sf-ai-status { font-size: 13px; line-height: 1.65; color: #536d94; margin: 8px 0; overflow-wrap: anywhere; }
.sf-ai-status:empty { display: none; }
.sf-ai-results { border: 1px solid #cddff8; border-radius: 12px; overflow: hidden; background: #fff; margin: 14px 0; }
.sf-ai-results[hidden] { display: none; }
.sf-ai-heading { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 14px 16px; background: #edf4ff; color: #254f89; }
.sf-ai-heading > span { font-size: 12px; color: #7288aa; }
.sf-ai-row { display: grid; grid-template-columns: minmax(106px, .8fr) minmax(140px, 1.7fr) minmax(130px, 1fr); gap: 10px; align-items: start; padding: 14px 16px; border-top: 1px solid #edf1f7; }
.sf-ai-check { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; min-height: 44px; }
.sf-ai-check input { width: 17px; height: 17px; accent-color: #2563eb; }
.sf-ai-detail { min-width: 0; padding: 8px 0; }
.sf-ai-detail code { font: 600 14px/1.5 ui-monospace, monospace; color: #28456b; overflow-wrap: anywhere; }
.sf-ai-detail small { display: block; font-size: 12px; line-height: 1.6; color: #7889a0; margin-top: 4px; overflow-wrap: anywhere; }
.sf-ai-detail .sf-ai-replace { color: #9d6426; }
.sf-ai-row select { width: 100%; min-width: 0; min-height: 44px; font-size: 13px; }
.sf-yarn-toolbar { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:12px; }
.sf-unit-hint { color:#71839e; font-size:12px; }
.sq-yarn > select, .sq-yarn > input { width:100%; min-width:0; margin-bottom:10px; min-height:44px; }
.sq-yarn .sf-range { grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); }
.sq-yarn [hidden] { display:none; }
.sq-yarn small { display:block; color:#71839e; margin-top:10px; line-height:1.6; }
.sq-yarn summary { color:#617590; font-size:12px; padding:10px 0; cursor:pointer; }
.sf-yarn-row { display:grid; grid-template-columns:minmax(90px,1fr) auto; gap:8px; align-items:center; margin:8px 0; position:relative; }
.sf-yarn-row input { width:100%; min-width:0; font-variant-numeric:tabular-nums; }
.sf-yarn-plus { grid-column:1/-1; color:#71839e; font-weight:600; }
.sf-yarn-opaque { grid-column:1/-1; color:#71839e; overflow-wrap:anywhere; }
.sf-units summary { cursor:pointer; color:#617590; font-size:12px; padding:8px 0; }
.sf-units select { min-width:96px; max-width:100%; }
.sf-units summary span { display:block; color:#25456e; }
.sf-ai-unit-summary { color:#315c9a; line-height:1.6; background:#f1f6fd; border-radius:8px; padding:8px; overflow-wrap:anywhere; }
.sf-binding-warning strong { display:block; margin-bottom:8px; }
.sf-binding-warning .btn-outline { margin-top:10px; min-height:44px; }
@media(max-width:480px){.sf-yarn-row{grid-template-columns:minmax(90px,1fr) minmax(90px,110px)}.sf-binding-warning .btn-outline{display:block;width:100%}}
.sf-ai-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid #e6edf8; background: #fafcff; }
.sf-ai-footer small { font-size: 12px; line-height: 1.6; color: #7c8da4; }
@container sample-form (max-width: 620px) {
  .sf-ai-row { grid-template-columns: 1fr; gap: 2px; padding: 12px; }
  .sf-ai-detail { padding: 0 0 8px 25px; }
  .sf-ai-footer button { width: 100%; }
}
.sf-construction-choice { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; font-size: 12px; }
.sf-spec-details { border-top: 1px solid #e4ebf5; margin-top: 12px; }
.sf-spec-details summary { cursor: pointer; padding: 14px 0; min-height: 44px; font-size: 13px; font-weight: 550; }
.sf-spec-details summary span { display: block; color: #8190a6; font-size: 12px; font-weight: 400; margin: 6px 0 0 16px; }
/* Follow the actual form width, including modal/template/sidebar contexts. */
@container sample-form (max-width: 660px) {
  .sf-core-grid, .sf-extra-grid { grid-template-columns: minmax(0, 1fr); }
}
@container sample-form (max-width: 380px) {
  .sf-basic { grid-template-columns: minmax(0, 1fr); }
  .sf-attribute, .sf-specification { padding: 12px; }
  .sf-mode label { padding: 0 8px; }
  .sf-measure-toolbar { gap: 6px; }
  .sf-measure-inputs { gap: 6px; }
  .sf-measure-inputs input { padding: 10px 8px; }
}
.sf-fiber-summary { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: #657a99; }
.sample-fields button { min-height: 44px; }
.sf-provenance { display: block; color: #8190a6; font-size: 11px; line-height: 1.6; margin-top: 10px; }
.sf-extra { border: 1px solid #e1e8f2; border-radius: 12px; padding: 0 16px 16px; }
.sf-extra summary { min-height: 44px; padding-top: 12px; cursor: pointer; font-weight: 550; }
.sf-extra summary span { color: #7b8aa0; font-size: 12px; font-weight: 400; margin-left: 8px; }
.sf-extra:not([open]) { padding-bottom: 0; }
.sf-extra > input { display: block; width: 100%; margin-top: 12px; }
.sf-extra-grid { margin-top: 12px; }
.sf-item-check { display: block; font-size: 12px; line-height: 1.7; color: #657a99; }
.sf-item-check:empty { display: none; }
.sf-item-check[data-state=duplicate] { color: #b13830; }
.sf-item-check[data-state=available] { color: #34725d; }
.sf-item-check a { color: #245be0; display: inline-flex; align-items: center; min-height: 32px; }
.sample-fields [name=item_no][aria-invalid=true] { border-color: #cf655f; }
/* Four editable specification rows; less-used controls stay available in-place. */
.sf-spec-details > summary { padding: 10px 0; min-height: 44px; box-sizing: border-box; }
.sf-spec-details > summary span { display: inline; margin-left: 12px; }
.sf-spec-grid { display: grid; gap: 0; }
.sf-spec-row { display: grid; grid-template-columns: 80px minmax(0, 1fr); align-items: start; gap: 12px; padding: 8px 0; border: 0; border-top: 1px solid #e5ebf5; border-radius: 0; }
.sf-spec-label { font-size: 13px; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.sf-spec-label:has([data-density-unit]) { flex-direction: column; align-items: start; justify-content: center; gap: 3px; }
.sf-spec-label [data-density-unit] { font-size: 11px; font-weight: 400; color: #71839e; }
.sf-spec-control, .sf-spec-row .sf-yarn-editor { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; min-width: 0; }
.sf-spec-control > .sf-yarn-editor, .sf-spec-control > .sf-notice { grid-column: 1/-1; }
.sf-spec-control > .sf-measure-inputs, .sf-yarn-values { grid-column: 1; grid-row: 1; }
.sf-field-options { grid-column: 2; min-width: 0; }
.sf-spec-details .sf-field-options > summary { min-height: 44px; padding: 10px 6px; box-sizing: border-box; color: #617590; font-weight: 400; }
.sf-field-options[open] { grid-column: 1/-1; grid-row: 2; padding: 0 10px 10px; background: #f1f5fc; border-radius: 8px; }
.sf-field-options .sf-yarn-toolbar, .sf-field-options .sf-measure-toolbar { margin: 4px 0 8px; }
.sf-field-options .sf-unit-hint { margin: 6px; display: inline-block; }
.sf-field-options .sf-provenance { margin-top: 8px; }
.sf-yarn-values { display: flex; flex-wrap: wrap; gap: 8px 18px; min-width: 0; }
.sf-spec-row .sf-yarn-row { grid-template-columns: minmax(90px,1fr) auto; flex: 1 1 150px; margin: 0; min-width: 0; }
.sf-spec-row .sf-yarn-plus { position: absolute; left: -13px; top: 14px; font-size: 12px; }
.sf-spec-row .sf-yarn-opaque:empty { display: none; }
.sf-spec-row .sf-units { min-width: 40px; }
.sf-spec-row .sf-units > summary { white-space: nowrap; }
.sf-spec-row .sf-units summary { padding: 10px 0; min-height: 44px; font-weight: 400; box-sizing: border-box; }
.sf-spec-row .sf-units[open] { grid-column: 1/-1; }
.sf-spec-row .sf-units select { width: 100%; }
@container sample-form (max-width: 480px) {
  .sf-spec-row { grid-template-columns: minmax(0,1fr); gap: 4px; }
  .sf-spec-label { min-height: 20px; }
  .sf-spec-label:has([data-density-unit]) { flex-direction: row; align-items: center; justify-content: start; gap: 8px; }
  .sf-spec-details > summary span { display: block; margin: 4px 0 0; }
}
.sf-other { width: 100%; margin-top: 10px; }
.sf-function { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; margin-bottom: 12px; }
.sf-function input[data-reference] { grid-column: 1/-1; width: 100%; }
.sf-errors { padding: 16px; border: 1px solid #f2c5c3; background: #fff5f4; color: #b13830; border-radius: 10px; font-size: 13px; }
.sf-errors ul { padding-left: 20px; }
.sf-errors li, .sf-errors p { margin: 6px 0; }
.sf-errors pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.pm-card.standard-edit-card { width: min(980px, 96vw); max-width: 96vw; }
@media(max-width: 680px) {
  .sf-basic, .sf-core-grid, .sf-extra-grid { grid-template-columns: minmax(0, 1fr); }
  .sf-attribute { padding: 12px; }
  .sf-extra summary span { display: block; margin: 4px 0 8px; }
  .sf-fiber-row:has([data-fiber-other]:not([hidden])) { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto; }
  .sf-fiber-row [data-fiber-other] { grid-column: 1/3; grid-row: 2; }
  .sf-range { gap: 5px; }
  .sf-range input, .sf-range select { padding: 8px 4px; }
}
.sample-query { padding: 22px; background: white; border: 1px solid #e1e8f2; border-radius: 14px; margin-bottom: 20px; color: #263b58; }
.sq-toolbar { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; }
.sq-toolbar label { display: grid; gap: 8px; font-size: 12px; color: #6b7d96; }
.sq-keyword { flex: 1; min-width: 180px; }
.sample-query input, .sample-query select, .sample-query button, .sample-query a { box-sizing: border-box; min-width: 0; min-height: 44px; max-width: 100%; font: inherit; }
.sample-query input, .sample-query select { border: 1px solid #dce5f1; border-radius: 8px; padding: 10px; background: #f9fbfe; color: #243a57; }
.sample-query [hidden] { display: none; }
.sample-query input[type=checkbox] { min-height: auto; width: 15px; accent-color: #2864f0; }
.sq-primary { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 20px; margin-top: 22px; }
.sq-range, .sq-composition { border: 0; padding: 0; margin: 0; min-width: 0; }
.sq-range legend, .sq-composition legend { font-size: 12px; color: #6b7d96; margin-bottom: 9px; }
.sq-fiber-row { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr) auto minmax(0,1fr) 44px; gap: 5px; align-items: center; margin-bottom: 6px; }
.sq-fiber-row input, .sq-fiber-row select { width: 100%; padding: 9px 5px; }
.sq-fiber-row button { border: 0; background: #f3f6fb; border-radius: 8px; cursor: pointer; }
.sample-query button.btn-link, .sample-fields button.btn-link { border: 1px solid #d6e2f5; border-radius: 8px; background: #f7faff; color: #3768ae; padding: 8px 12px; cursor: pointer; }
.sq-more { margin-top: 18px; border-top: 1px solid #edf0f6; }
.sq-more summary { cursor: pointer; padding: 14px 0; min-height: 44px; box-sizing: border-box; font-weight: 550; }
.sq-more summary span { color: #8998ad; font-size: 12px; font-weight: 400; margin-left: 10px; }
.sq-more .sf-extra-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.sq-footer { font-size: 12px; line-height: 1.7; color: #8190a6; margin: 8px 0 0; }
.sq-footer span { display: block; color: #bb7c16; }
.standard-sample-page .print-body { display: block; }
.standard-sample-page .print-drawer { width: min(390px, 100%); }
.standard-sample-page .print-table-form { max-width: 100%; overflow-x: auto; border: 1px solid #e1e8f2; border-radius: 12px; }
.standard-sample-page .print-table { min-width: 960px; }
.standard-sample-page .print-row-actions button, .standard-sample-page .print-row-actions a { min-height: 44px; display: inline-flex; align-items: center; }
.standard-sample-page .print-item-no { color: #223754; font-weight: 650; }
.sf-pagination { display: flex; gap: 18px; align-items: center; justify-content: end; padding: 14px 0; font-size: 13px; color: #72839a; }
.sf-pagination a { display: inline-flex; align-items: center; min-height: 44px; }
.sf-evidence { border-bottom: 1px solid #e8edf4; padding: 8px 0; overflow-wrap: anywhere; }
.sf-evidence summary { cursor: pointer; min-height: 44px; font-size: 13px; }
.sf-evidence summary span { display: block; margin-top: 5px; color: #566e8e; }
.sf-evidence-body { font-size: 12px; background: #f6f8fc; border-radius: 8px; padding: 10px; margin: 8px 0; }
@media(max-width:1000px){.sq-primary,.sq-more .sf-extra-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.sq-composition{grid-column:1/-1}}
@media(max-width:680px){
  .sample-query { padding: 14px; }.sq-primary,.sq-more .sf-extra-grid{grid-template-columns:minmax(0,1fr)}
  .sq-toolbar { gap: 10px; }.sq-toolbar label:first-child{flex-basis:100%}.sq-more summary span{display:block;margin:6px 0 0}
  .standard-sample-page .print-head { align-items: start; }.standard-sample-page .print-head-actions { flex-wrap: wrap; }
  .standard-sample-page .print-head h1 { font-size: 20px; }.standard-sample-page .print-head-actions a { min-height: 44px; display: inline-flex; align-items: center; }
}
