/* 手绘便签主题：/ops 组件样式。token 见 paper-tokens.css */

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  background-color: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
  /* 笔记本点阵纸纹 */
  background-image: radial-gradient(var(--line-soft) 1px, transparent 1px);
  background-size: 24px 24px;
  background-attachment: fixed;
}

a { color: var(--pen); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-style: wavy; text-underline-offset: 3px; }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--postit);
  color: var(--postit-ink);
  padding: 0.05em 0.4em;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
}

/* ---------------------------------------------------------- */
/* 布局外壳                                                    */
/* ---------------------------------------------------------- */

.ops-shell { display: flex; min-height: 100vh; }

.ops-side {
  width: 248px;
  flex-shrink: 0;
  background: var(--paper-2);
  border-right: 3px solid var(--ink);
  display: flex;
  flex-direction: column;
  padding: 1.1rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  /* 细墨迹滚动条，避免系统灰粗条 */
  scrollbar-width: thin;
  scrollbar-color: var(--line-soft) transparent;
  scrollbar-gutter: stable;
}
.ops-brand {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
  padding: 0.25rem 1.15rem 1.05rem;
  border-bottom: 3px dashed var(--ink);
  margin-bottom: 0.55rem;
  transform: rotate(-0.6deg);
}
.ops-brand em { font-style: normal; color: var(--accent); }
.ops-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0.7rem 0.4rem;
}
/* 顶部独立入口（仪表盘）与后续分区拉开一点间距 */
.ops-nav > a:first-child {
  margin-bottom: 0.35rem;
}
/* 分组标题：字号更大 + 墨色 + 虚线分界，形成便签分区感 */
.ops-nav .nav-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin: 0.95rem 0.2rem 0.4rem;
  padding: 0.55rem 0.4rem 0.35rem;
  border-top: 2.5px dashed var(--ink);
  line-height: 1.2;
}
.ops-nav .nav-group::before {
  content: "";
  width: 0.62rem;
  height: 0.62rem;
  flex-shrink: 0;
  background: var(--accent);
  border: 1.5px solid var(--ink);
  border-radius: 3px 8px 4px 7px / 7px 4px 8px 3px;
  box-shadow: 1px 1px 0 0 var(--ink);
}
.ops-nav a {
  display: block;
  margin-left: 0.2rem;
  padding: 0.48rem 0.8rem;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 1.02rem;
  text-decoration: none;
  transition: transform 0.1s ease, background 0.1s ease, box-shadow 0.1s ease;
}
.ops-nav a:hover {
  background: var(--card);
  border-color: var(--ink);
  color: var(--ink);
  text-decoration: none;
  transform: rotate(-0.8deg);
  box-shadow: var(--shadow-sm);
}
.ops-nav a.active {
  background: var(--postit);
  color: var(--postit-ink);
  font-weight: 700;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  transform: rotate(0.6deg);
}
.ops-side-foot {
  margin-top: auto;
  padding: 1rem 1.15rem 0.3rem;
  border-top: 3px dashed var(--ink);
  color: var(--muted);
  font-size: 0.92rem;
}

/* 手绘细滚动条：侧栏 / 文本域 / 表格溢出区 */
.ops-side::-webkit-scrollbar,
textarea::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.ops-side::-webkit-scrollbar-track,
textarea::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track {
  background: transparent;
}
.ops-side::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
  background: var(--line-soft);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: padding-box;
}
.ops-side::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
  border: 1px solid transparent;
  background-clip: padding-box;
}
.ops-side::-webkit-scrollbar-corner,
textarea::-webkit-scrollbar-corner,
.table-wrap::-webkit-scrollbar-corner {
  background: transparent;
}

.ops-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ops-topbar {
  min-height: 56px;
  border-bottom: 3px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 1.5rem;
  background: var(--topbar);
  color: var(--topbar-ink);
  position: sticky;
  top: 0;
  z-index: 20;
}
.ops-topbar .crumb { font-size: 0.95rem; color: var(--topbar-muted); }
.ops-topbar .crumb strong { color: var(--topbar-ink); font-weight: 700; font-family: var(--serif); }
.ops-topbar .who {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.95rem;
  color: var(--topbar-ink);
  line-height: 1.2;
}
.ops-topbar .who > span {
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}
.ops-topbar form {
  margin: 0;
  display: inline-flex;
  align-items: center;
}
.ops-help-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.15rem;
}
.ops-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 0;
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease, color 0.1s ease;
}
a.ops-icon-btn { color: var(--ink); }
.ops-icon-btn:hover {
  background: var(--postit);
  color: var(--postit-ink);
  text-decoration: none;
  transform: translate(1px, 1px);
  box-shadow: var(--shadow-sm);
}
.ops-icon-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 0 #2d2d2d;
}
.ops-icon-btn[aria-current="page"] {
  background: var(--postit);
  border-color: var(--ink);
  color: var(--postit-ink);
}
.ops-prefs {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.ops-prefs.is-open > .ops-icon-btn {
  background: var(--postit);
  color: var(--postit-ink);
}
.ops-prefs-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  min-width: 248px;
  padding: 0.85rem 0.95rem;
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  color: var(--ink);
}
.ops-prefs-panel[hidden] {
  display: none !important;
}
.ops-prefs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 36px;
}
.ops-prefs-row + .ops-prefs-row {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1.5px dashed var(--line-soft);
}
.ops-prefs-label {
  flex: 0 0 auto;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.ops-theme-seg {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
}
.ops-theme-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 28px;
  margin: 0;
  padding: 0;
  min-height: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  cursor: pointer;
  line-height: 1;
}
.ops-theme-opt:hover {
  background: var(--card);
  color: var(--ink);
  transform: none;
  box-shadow: none;
}
.ops-theme-opt.is-on {
  background: var(--postit);
  border-color: var(--ink);
  color: var(--postit-ink);
  box-shadow: var(--shadow-sm);
}
.ops-theme-opt:focus-visible {
  outline: 2px solid var(--pen);
  outline-offset: 1px;
}
.ops-prefs-select {
  flex: 1 1 auto;
  max-width: 9.5rem;
  min-height: 32px;
  margin: 0;
  padding: 0.25rem 1.8rem 0.25rem 0.55rem;
  font-size: 0.95rem;
}
.ops-prefs-version {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.ops-prefs-ver-text {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  max-width: 7.5rem;
  padding: 0.2rem 0.55rem;
  border: 2px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ops-prefs-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  min-height: 0;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.ops-prefs-refresh:hover {
  background: var(--postit);
  color: var(--postit-ink);
  transform: translate(1px, 1px);
  box-shadow: var(--shadow-sm);
}
.ops-prefs-refresh:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}
.ops-prefs-refresh.is-spinning svg {
  animation: ops-prefs-spin 0.8s linear infinite;
}
.ops-prefs-hint {
  margin: 0.65rem 0 0;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--muted);
}
.ops-prefs-hint[data-state="ok"] { color: var(--ok); }
.ops-prefs-hint[data-state="update"] { color: var(--warn); }
.ops-prefs-hint[data-state="err"] { color: var(--danger); }
.ops-prefs-hint[data-state="loading"],
.ops-prefs-hint[data-state="muted"] { color: var(--muted); }
@keyframes ops-prefs-spin {
  to { transform: rotate(360deg); }
}
.ops-username {
  display: inline-flex;
  align-items: center;
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-content { padding: 1.6rem 1.8rem 3rem; max-width: 1180px; width: 100%; margin: 0 auto; }

/* ---------------------------------------------------------- */
/* 标题                                                        */
/* ---------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.01em;
}
h1 { font-size: 1.9rem; margin: 0 0 0.35rem; transform: rotate(-0.4deg); }
h2 { font-size: 1.28rem; margin: 1.6rem 0 0.8rem; }
h3 { font-size: 1.08rem; margin: 1.1rem 0 0.5rem; }
.page-head { margin-bottom: 1.35rem; }
.page-head .sub { color: var(--muted); font-size: 1rem; margin: 0.25rem 0 0; max-width: 48ch; }

/* ---------------------------------------------------------- */
/* 卡片                                                        */
/* ---------------------------------------------------------- */

.card {
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.3rem;
  margin-bottom: 1.15rem;
  box-shadow: var(--shadow);
  position: relative;
}
.card.tight { padding: 0.9rem 1.1rem; }

/* 列表页统一外壳：筛选 / 批量 / 表格 / 分页包在同一张大卡里 */
.card.list-shell {
  padding: 1rem 1.15rem 1.05rem;
}
.card.list-shell > .toolbar,
.card.list-shell > form.toolbar {
  margin-bottom: 0.85rem;
}
.card.list-shell > .toolbar.toolbar-split {
  margin-bottom: 0.85rem;
}
.card.list-shell > .table-wrap {
  margin-bottom: 0;
}
.card.list-shell > .pager {
  margin-top: 0.9rem;
}
.card.list-shell > .help {
  margin: 0.65rem 0 0;
}
.card.list-shell > form:not(.toolbar):not(.pager-size) {
  margin: 0;
}
.card.list-shell > p:last-child {
  margin-bottom: 0;
}

.card.card-postit {
  background: var(--postit);
  color: var(--postit-ink);
  transform: rotate(-0.5deg);
}
.card.card-postit h1,
.card.card-postit h2,
.card.card-postit h3,
.card.card-postit h4,
.card.card-postit .help,
.card.card-postit .sub {
  color: var(--postit-ink);
}
.card.card-postit::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 72px;
  height: 18px;
  margin-left: -36px;
  background: rgba(180, 180, 180, 0.45);
  border: 1.5px solid rgba(45, 45, 45, 0.2);
  transform: rotate(1.5deg);
}

/* ---------------------------------------------------------- */
/* 指标块                                                      */
/* ---------------------------------------------------------- */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 1rem; }
.metric {
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.05rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.metric:nth-child(3n+1) { transform: rotate(-0.7deg); }
.metric:nth-child(3n+2) { transform: rotate(0.5deg); background: var(--card-2); }
.metric:nth-child(3n) { transform: rotate(-0.3deg); }
.metric:hover {
  transform: rotate(0deg) translateY(-2px);
  box-shadow: var(--shadow);
}
.metric .label {
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}
.metric .value {
  font-family: var(--serif);
  font-size: 1.85rem;
  font-weight: 700;
  margin-top: 0.35rem;
  line-height: 1;
  color: var(--ink);
}
.metric .value .unit {
  font-size: 0.9rem;
  font-family: var(--sans);
  color: var(--muted);
  margin-left: 0.2rem;
}

/* ---------------------------------------------------------- */
/* 表格                                                        */
/* ---------------------------------------------------------- */

.table-wrap {
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-md);
  overflow: auto;
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
  scrollbar-color: var(--line-soft) transparent;
}
table { border-collapse: collapse; width: 100%; background: transparent; font-size: 0.95rem; table-layout: auto; }
th, td { padding: 0.65rem 0.9rem; text-align: left; vertical-align: middle; border-bottom: 2px dashed var(--line-soft); }
th {
  background: var(--postit);
  color: var(--postit-ink);
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  font-weight: 700;
  font-family: var(--serif);
  border-bottom: 2.5px solid var(--ink);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255, 249, 196, 0.35); }
tr.inactive td { color: var(--faint); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td .mono, .mono { font-family: var(--mono); font-size: 0.86em; }
.masked { font-family: var(--mono); letter-spacing: 0.05em; color: var(--ink-2); }

/* ---------------------------------------------------------- */
/* 表单                                                        */
/* ---------------------------------------------------------- */

/* 标签永远在上、控件在下（禁止文字贴在输入框左侧/底部）
   用 block + 控件 display:block，避免 flex 把「描述 *」拆成多行 */
label {
  display: block;
  margin-top: 0.95rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-2);
  font-family: var(--serif);
  line-height: 1.3;
  letter-spacing: 0.01em;
}
label > .req { color: var(--accent); font-family: var(--sans); margin-left: 0.15rem; }

/* 复选/单选：安静文本行 + 手绘小方格，不抢工具栏视觉 */
label.label-check,
label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.42rem;
  width: fit-content;
  max-width: 100%;
  margin-top: 0.85rem;
  padding: 0.12rem 0.05rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.12s ease;
}
label.label-check:hover,
label:has(> input[type="checkbox"]):hover,
label:has(> input[type="radio"]):hover {
  color: var(--ink);
  background: transparent;
  border: 0;
}
label.label-check:has(> input:checked),
label:has(> input[type="checkbox"]:checked),
label:has(> input[type="radio"]:checked) {
  color: var(--ink);
  font-weight: 600;
  background: transparent;
  border: 0;
}
/* 手绘小勾选框：奶油纸底 + 墨线，勾选后便签黄 */
label.label-check > input[type="checkbox"],
label.label-check > input[type="radio"],
label:has(> input[type="checkbox"]) > input[type="checkbox"],
label:has(> input[type="radio"]) > input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  width: 1.05rem;
  height: 1.05rem;
  min-width: 1.05rem;
  min-height: 1.05rem;
  max-width: 1.05rem;
  margin: 0;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 3px 4px 3px 3px / 4px 3px 4px 3px;
  background: var(--paper-2);
  box-shadow: 1.5px 1.5px 0 0 var(--ink);
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.1s ease, box-shadow 0.1s ease;
}
label.label-check > input[type="radio"],
label:has(> input[type="radio"]) > input[type="radio"] {
  border-radius: 50%;
}
label.label-check > input[type="checkbox"]:checked,
label:has(> input[type="checkbox"]) > input[type="checkbox"]:checked {
  background: var(--postit);
}
label.label-check > input[type="checkbox"]:checked::after,
label:has(> input[type="checkbox"]) > input[type="checkbox"]:checked::after {
  content: "";
  width: 0.28rem;
  height: 0.5rem;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-0.04rem);
}
label.label-check > input[type="radio"]:checked,
label:has(> input[type="radio"]) > input[type="radio"]:checked {
  background: var(--postit);
}
label.label-check > input[type="radio"]:checked::after,
label:has(> input[type="radio"]) > input[type="radio"]:checked::after {
  content: "";
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: var(--ink);
}
label.label-check > input[type="checkbox"]:focus-visible,
label.label-check > input[type="radio"]:focus-visible,
label:has(> input[type="checkbox"]) > input[type="checkbox"]:focus-visible,
label:has(> input[type="radio"]) > input[type="radio"]:focus-visible {
  outline: 2px solid var(--pen);
  outline-offset: 2px;
}

/* 笔记纸字段：奶油纸底 + 墨线底边，不用系统白框/硬阴影 */
input[type=text], input[type=password], input[type=number], input[type=email],
input[type=url], input[type=date], input[type=datetime-local], select, textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 2.55rem;
  padding: 0.55rem 0.8rem;
  margin-top: 0.32rem;
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 400;
  font-family: var(--sans);
  line-height: 1.35;
  box-shadow: none;
  transition: border-color 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease, transform 0.1s ease;
}
/* 短字段限制可读宽度；长文区域占满卡片 */
label > input[type=text],
label > input[type=password],
label > input[type=number],
label > input[type=email],
label > input[type=url],
label > input[type=date],
label > input[type=datetime-local],
label > select {
  max-width: 36rem;
}
label > textarea {
  max-width: 100%;
}

input:not([type="checkbox"]):not([type="radio"]):hover,
select:hover,
textarea:hover {
  background: var(--card-2);
  border-color: var(--ink);
}
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--postit);
  color: var(--postit-ink);
  box-shadow: 3px 3px 0 0 var(--ink);
}
input:focus::placeholder,
textarea:focus::placeholder {
  color: color-mix(in srgb, var(--postit-ink) 45%, transparent);
}
input::placeholder,
textarea::placeholder {
  color: var(--faint);
  font-weight: 400;
  opacity: 1;
}
textarea {
  min-height: 7.5rem;
  padding-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.55;
  resize: vertical;
  scrollbar-width: thin;
  scrollbar-color: var(--line-soft) transparent;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent 28%),
    repeating-linear-gradient(
      transparent,
      transparent 1.45rem,
      rgba(45, 45, 45, 0.045) 1.45rem,
      rgba(45, 45, 45, 0.045) calc(1.45rem + 1px)
    ),
    var(--paper-2);
  background-attachment: local;
}
input[type=checkbox], input[type=radio] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.help { font-size: 0.88rem; color: var(--muted); margin-top: 0.15rem; font-weight: 400; font-family: var(--sans); }

/* 字段分组：中英分区、设置分区等 */
.field-group {
  margin: 1rem 0 0.15rem;
  padding: 0.75rem 0.9rem 0.95rem;
  border: 2px dashed var(--line-soft);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--card) 55%, transparent);
}
.field-group > label:first-of-type { margin-top: 0.35rem; }
.field-group-title {
  margin: 0 0 0.15rem;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.field-group-sub {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.1rem;
  padding-top: 0.85rem;
  border-top: 2px dashed var(--line-soft);
}
.form-actions > button,
.form-actions > .btn,
form:not(.toolbar) > .form-actions > button,
form:not(.toolbar) > .form-actions > .btn,
.card > form > .form-actions > button,
.card > form > .form-actions > .btn {
  margin-top: 0;
}

/* 暗色：输入框保持纸感底，聚焦用便签黄 */
html[data-theme="dark"] input[type=text],
html[data-theme="dark"] input[type=password],
html[data-theme="dark"] input[type=number],
html[data-theme="dark"] input[type=email],
html[data-theme="dark"] input[type=url],
html[data-theme="dark"] input[type=date],
html[data-theme="dark"] input[type=datetime-local],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: var(--paper-2);
  border-color: var(--line);
  color: var(--ink);
}
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):hover,
html[data-theme="dark"] select:hover,
html[data-theme="dark"] textarea:hover {
  background: var(--card-2);
}
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus {
  background: var(--postit);
  color: var(--postit-ink);
  border-color: var(--line);
  box-shadow: 3px 3px 0 0 var(--line);
}
html[data-theme="dark"] textarea {
  background-image:
    repeating-linear-gradient(
      transparent,
      transparent 1.45rem,
      rgba(255, 250, 240, 0.05) 1.45rem,
      rgba(255, 250, 240, 0.05) calc(1.45rem + 1px)
    ),
    var(--paper-2);
}
html[data-theme="dark"] select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%),
    var(--paper-2);
  background-position:
    calc(100% - 1.15rem) 50%,
    calc(100% - 0.75rem) 50%,
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
}
html[data-theme="dark"] select:focus {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--postit-ink) 50%),
    linear-gradient(135deg, var(--postit-ink) 50%, transparent 50%),
    var(--postit);
  background-position:
    calc(100% - 1.15rem) 50%,
    calc(100% - 0.75rem) 50%,
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
}
html[data-theme="dark"] label.label-check,
html[data-theme="dark"] label:has(> input[type="checkbox"]),
html[data-theme="dark"] label:has(> input[type="radio"]) {
  background: transparent;
  color: var(--ink-2);
}
html[data-theme="dark"] label.label-check > input[type="checkbox"],
html[data-theme="dark"] label.label-check > input[type="radio"],
html[data-theme="dark"] label:has(> input[type="checkbox"]) > input[type="checkbox"],
html[data-theme="dark"] label:has(> input[type="radio"]) > input[type="radio"] {
  background: var(--paper-2);
  border-color: var(--line);
  box-shadow: 1.5px 1.5px 0 0 var(--line);
}
html[data-theme="dark"] label.label-check > input[type="checkbox"]:checked,
html[data-theme="dark"] label:has(> input[type="checkbox"]) > input[type="checkbox"]:checked,
html[data-theme="dark"] label.label-check > input[type="radio"]:checked,
html[data-theme="dark"] label:has(> input[type="radio"]) > input[type="radio"]:checked {
  background: var(--postit);
}
html[data-theme="dark"] .field-group,
html[data-theme="dark"] .display-panel {
  background: color-mix(in srgb, var(--card-2) 70%, transparent);
}
html[data-theme="dark"] .card.list-shell > form.toolbar,
html[data-theme="dark"] .card.list-shell > .toolbar,
html[data-theme="dark"] form.toolbar,
html[data-theme="dark"] .toolbar.filters {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--postit) 12%, transparent), transparent 70%),
    color-mix(in srgb, var(--paper-2) 55%, transparent);
}
html[data-theme="dark"] .toolbar-split {
  background: transparent;
}
html[data-theme="dark"] .ops-select-btn {
  background: var(--paper-2);
  border-color: var(--line);
  box-shadow: none;
}
html[data-theme="dark"] .ops-select.is-open .ops-select-btn,
html[data-theme="dark"] .ops-select-btn:focus-visible {
  background: var(--postit);
  color: var(--postit-ink);
  box-shadow: 3px 3px 0 0 var(--line);
}

/* 手绘风 select 关闭态（未增强时的回退） */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 2.4rem;
  cursor: pointer;
  background-color: var(--paper-2);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%),
    var(--paper-2);
  background-position:
    calc(100% - 1.15rem) 50%,
    calc(100% - 0.75rem) 50%,
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
}
select:hover {
  background-color: var(--card-2);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%),
    var(--card-2);
}
select:focus {
  background-color: var(--postit);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--postit-ink) 50%),
    linear-gradient(135deg, var(--postit-ink) 50%, transparent 50%),
    var(--postit);
  color: var(--postit-ink);
}
select option {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--card);
}

/* 自定义下拉（ops-select.js）：彻底摆脱系统蓝底 option 列表 */
.ops-select {
  position: relative;
  display: block;
  width: 100%;
  max-width: 36rem;
  margin-top: 0.4rem;
}
.ops-select--toolbar {
  width: auto;
  max-width: 200px;
  min-width: 128px;
  margin-top: 0;
}
.ops-select--compact {
  width: auto;
  max-width: 9.5rem;
  min-width: 7.5rem;
  margin-top: 0;
  flex: 1 1 auto;
}
.ops-select-src {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  box-shadow: none !important;
  background: transparent !important;
}
.ops-select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  width: 100%;
  min-height: 2.55rem;
  margin: 0;
  padding: 0.5rem 0.75rem;
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 400;
  font-family: var(--sans);
  line-height: 1.25;
  text-align: left;
  box-shadow: none;
  cursor: pointer;
  transition: box-shadow 0.1s ease, border-color 0.1s ease, background-color 0.1s ease;
}
.ops-select--compact .ops-select-btn {
  min-height: 32px;
  padding: 0.25rem 0.55rem;
  font-size: 0.95rem;
}
.ops-select--toolbar .ops-select-btn {
  min-height: 2.4rem;
  font-size: 0.98rem;
}
.ops-select-btn:hover {
  background: var(--card-2);
  color: var(--ink);
  transform: none;
}
.ops-select.is-open .ops-select-btn,
.ops-select-btn:focus-visible {
  outline: none;
  border-color: var(--ink);
  background: var(--postit);
  color: var(--postit-ink);
  box-shadow: 3px 3px 0 0 var(--ink);
}
.ops-select.is-disabled .ops-select-btn,
.ops-select-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.ops-select-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ops-select-chevron {
  flex: 0 0 auto;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.1rem;
  border-right: 2.2px solid var(--ink);
  border-bottom: 2.2px solid var(--ink);
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.85;
}
.ops-select.is-open .ops-select-chevron {
  transform: rotate(225deg) translateY(-1px);
}
.ops-select-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  max-height: min(280px, 50vh);
  overflow: auto;
  padding: 0.3rem;
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  scrollbar-width: thin;
  scrollbar-color: var(--line-soft) transparent;
}
.ops-select-panel[hidden] {
  display: none !important;
}
.ops-select-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.ops-select-opt {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.48rem 0.65rem;
  min-height: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 500;
  font-family: var(--sans);
  text-align: left;
  box-shadow: none;
  cursor: pointer;
  line-height: 1.3;
}
.ops-select-opt:hover,
.ops-select-opt:focus-visible {
  background: var(--paper-2);
  color: var(--ink);
  transform: none;
  box-shadow: none;
  outline: none;
  border-color: var(--line-soft);
}
.ops-select-opt.is-selected {
  background: var(--postit);
  color: var(--postit-ink);
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}
.ops-select-opt.is-selected:hover,
.ops-select-opt.is-selected:focus-visible {
  background: var(--postit);
  color: var(--postit-ink);
  border-color: var(--ink);
}
.ops-select-opt.is-disabled,
.ops-select-opt:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.ops-select-panel::-webkit-scrollbar {
  width: 6px;
}
.ops-select-panel::-webkit-scrollbar-thumb {
  background: var(--line-soft);
  border-radius: 999px;
}
@media (prefers-reduced-motion: reduce) {
  .ops-select-btn,
  .ops-select-chevron {
    transition: none;
  }
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
}
.field-row label {
  flex: 1 1 220px;
  min-width: 0;
}

/* ---------------------------------------------------------- */
/* 商品表单 · 展示设置（图标 / 图片）                            */
/* ---------------------------------------------------------- */

.display-panel {
  margin: 0.9rem 0 0.3rem;
  padding: 0.8rem 0.95rem 0.9rem;
  border: 2px dashed var(--line-soft);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--card) 55%, transparent);
  box-shadow: none;
}
.display-panel-head {
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px dashed var(--line-soft);
}
.display-panel-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.display-panel-sub {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}
.display-panel.is-collapsible {
  padding-top: 0.6rem;
}
.display-panel-toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
  width: 100%;
  margin: 0 0 0.55rem;
  padding: 0 0 0.45rem;
  border: 0;
  border-bottom: 2px dashed var(--line-soft);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.display-panel-toggle:focus-visible {
  outline: 2px solid var(--pen);
  outline-offset: 3px;
  border-radius: 8px;
}
.display-panel-toggle-main {
  min-width: 0;
  flex: 1 1 auto;
}
.display-panel-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-top: 0.1rem;
  flex: 0 0 auto;
  color: var(--muted);
  border: 1.5px solid var(--line-soft);
  border-radius: 999px;
  background: var(--card);
  transition: transform 0.18s ease, color 0.15s ease, border-color 0.15s ease;
}
.display-panel-chevron svg {
  display: block;
  transition: transform 0.18s ease;
}
.display-panel-toggle[aria-expanded="false"] .display-panel-chevron svg {
  transform: rotate(-90deg);
}
.display-panel.is-collapsed {
  padding-bottom: 0.75rem;
}
.display-panel.is-collapsed .display-panel-toggle {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}
.display-panel-body {
  min-width: 0;
}
.display-grid {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 1.1rem 1.35rem;
  align-items: start;
}
.display-col-emoji {
  max-width: 240px;
}
.display-emoji-block {
  max-width: 220px;
  margin-bottom: 0.55rem;
}
.display-panel-body-compact .display-panel-sub {
  font-size: 0.86rem;
}
.field-block {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  margin: 0;
  font-family: var(--sans);
  font-weight: 500;
  color: var(--ink-2);
}
.field-block.nested {
  margin-top: 0;
}
.field-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--serif);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.field-label-with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  color: var(--pen);
  flex: 0 0 auto;
}
.field-label-with-icon svg {
  display: block;
}
.field-hint {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.35;
}
.field-block > input[type="text"],
.field-block > input[type="url"],
.field-block > input[type="number"] {
  width: 100%;
  max-width: 100%;
  margin-top: 0.05rem;
}
.media-section-head {
  margin: 0.1rem 0 0.45rem;
}
.media-section-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-family: var(--serif);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.media-section-sub {
  margin: 0.18rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}
.media-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0 0 0.7rem;
}
.media-slot {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.6rem 0.7rem 0.7rem;
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.media-slot-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.media-slot-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  padding: 0.05rem 0.4rem;
  font-family: var(--serif);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--postit);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  line-height: 1.25;
}
.media-slot-badge.en {
  background: color-mix(in srgb, var(--pen) 16%, var(--card));
}
.media-slot-title {
  font-family: var(--serif);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.media-slot-preview {
  margin: 0;
  padding: 0.35rem;
  background: var(--paper);
  border: 2px dashed var(--line-soft);
  border-radius: var(--radius-sm);
  text-align: center;
  min-height: 4.6rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.2rem;
}
.media-slot-preview img {
  display: block;
  width: 100%;
  max-width: 104px;
  max-height: 80px;
  margin: 0 auto;
  object-fit: contain;
  border-radius: calc(var(--radius-sm) - 2px);
  background: var(--card);
}
.media-slot-preview figcaption {
  margin-top: 0.1rem;
  font-size: 0.8rem;
}
.media-slot-empty {
  color: var(--muted);
  font-size: 0.8rem;
}
.media-drop {
  min-height: 0;
}
.file-drop-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  margin-bottom: 0;
  color: var(--pen);
}
.file-drop-icon svg {
  display: block;
}
.media-shared {
  margin-top: 0;
  padding-top: 0.55rem;
  border-top: 2px dashed var(--line-soft);
}
.media-shared-head {
  margin-bottom: 0.4rem;
}
.media-shared-head .field-hint {
  margin-top: 0.12rem;
}
.photo-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  margin-top: 0;
}
.photo-layout.has-preview {
  grid-template-columns: minmax(96px, 120px) minmax(0, 1fr);
  align-items: start;
}
.photo-preview {
  margin: 0;
  padding: 0.35rem;
  background: var(--card);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.photo-preview img {
  display: block;
  width: 100%;
  max-width: 104px;
  max-height: 88px;
  margin: 0 auto;
  object-fit: contain;
  border-radius: calc(var(--radius-sm) - 2px);
  background: var(--paper);
}
.photo-preview figcaption {
  margin-top: 0.25rem;
  font-size: 0.8rem;
}
.photo-controls {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}
.file-drop {
  position: relative;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin: 0;
  padding: 0.5rem 0.7rem;
  border: 2.5px dashed var(--ink);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(255, 248, 220, 0.55), rgba(255, 255, 255, 0.35)),
    var(--card);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
html[data-theme="dark"] .file-drop {
  background:
    linear-gradient(180deg, rgba(45, 93, 161, 0.12), rgba(255, 255, 255, 0.02)),
    var(--card);
}
.file-drop:hover {
  transform: rotate(-0.35deg);
  border-color: var(--pen);
  box-shadow: 0 0 0 3px rgba(45, 93, 161, 0.12), var(--shadow-sm);
}
.file-drop:focus-within {
  border-color: var(--pen);
  box-shadow: 0 0 0 3px rgba(45, 93, 161, 0.18), var(--shadow-sm);
}
.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}
.file-drop-title {
  font-family: var(--serif);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.file-drop-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.3;
}
.file-drop-name {
  margin-top: 0;
  padding: 0.12rem 0.4rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--postit);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
}
.photo-or {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: 0.06em;
  min-height: 0;
  margin: -0.05rem 0;
}
.photo-or::before,
.photo-or::after {
  content: "";
  flex: 1 1 auto;
  height: 0;
  border-top: 2px dashed var(--line-soft);
}
.photo-or span {
  flex: 0 0 auto;
}
@media (max-width: 860px) {
  .display-grid,
  .photo-layout.has-preview,
  .media-pair {
    grid-template-columns: 1fr;
  }
  .display-col-emoji,
  .display-emoji-block {
    max-width: none;
  }
}

/* 权限组等 fieldset：与 field-group 同语言，不用 hard shadow 小卡 */
fieldset {
  margin-top: 1.1rem;
  border: 2px dashed var(--line-soft);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.95rem 0.95rem;
  background: color-mix(in srgb, var(--card) 55%, transparent);
  box-shadow: none;
}
fieldset legend {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  padding: 0 0.4rem;
}

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

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0 0.4rem 0 0;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 3px solid var(--ink);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--sans);
  box-shadow: var(--shadow);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease, color 0.1s ease;
  line-height: 1.2;
  min-height: 40px;
  white-space: nowrap;
  vertical-align: middle;
}
/* 表单正文里的独立按钮保留上间距；工具栏/顶栏/表格内由容器控制 */
form:not(.toolbar) > button,
form:not(.toolbar) > .btn,
.card > form > button,
.card > form > .btn,
.auth-card button {
  margin-top: 0.9rem;
}
/* 必须写在正文 form 规则之后，否则等权选择器会被 margin-top 顶飞 */
.ops-topbar .ops-icon-btn {
  background: var(--topbar-control);
  color: var(--topbar-ink);
  border-color: var(--topbar-ink);
  box-shadow: 2px 2px 0 0 var(--topbar-ink);
}
.ops-topbar .ops-icon-btn svg {
  color: currentColor;
  stroke: currentColor;
}
.ops-topbar a.ops-icon-btn { color: var(--topbar-ink); }
.ops-topbar form > button,
.ops-topbar form > .btn {
  margin: 0;
  min-height: 30px;
  padding: 0.2rem 0.55rem;
  color: var(--topbar-ink);
  box-shadow: none;
  transform: none;
}
.ops-topbar form > button:hover,
.ops-topbar form > .btn:hover {
  transform: translate(1px, 1px);
  box-shadow: var(--shadow-sm);
}
/* 顶栏图标钮：压过通用 button 的 min-height / margin */
button.ops-icon-btn,
a.ops-icon-btn {
  margin: 0;
  min-height: 34px;
  padding: 0;
  width: 34px;
  height: 34px;
  font-weight: 600;
}
button:hover, .btn:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 0 #2d2d2d;
}
button:active, .btn:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 0 #2d2d2d;
}

button.primary, .btn.primary {
  background: var(--card);
  border-color: var(--ink);
  color: var(--ink);
  font-weight: 700;
}
button.primary:hover, .btn.primary:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--ink);
}

button.danger, .btn.danger {
  background: var(--danger-soft);
  border-color: var(--ink);
  color: var(--accent-ink);
}
button.danger:hover, .btn.danger:hover {
  background: var(--accent);
  color: #fff;
}

button.ghost, .btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-2);
  box-shadow: none;
}
button.ghost:hover, .btn.ghost:hover {
  background: var(--postit);
  color: var(--postit-ink);
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
  transform: translate(1px, 1px);
}

button.small, .btn.small {
  padding: 0.28rem 0.6rem;
  font-size: 0.88rem;
  margin: 0;
  min-height: 32px;
  border-width: 2px;
  box-shadow: var(--shadow-sm);
}
/* 写在 .small 之后：关闭态 ghost.small 必须无硬阴影，避免透明边框「飞起来」 */
button.ghost.small, .btn.ghost.small {
  box-shadow: none;
}
button.ghost.small:hover, .btn.ghost.small:hover {
  box-shadow: var(--shadow-sm);
}

/* ---------------------------------------------------------- */
/* 徽章                                                        */
/* ---------------------------------------------------------- */

.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--card-2);
  color: var(--ink-2);
  border: 2px solid var(--ink);
  white-space: nowrap;
}
.badge.on { background: var(--ok-soft); color: var(--ok); }
.badge.off { background: var(--danger-soft); color: var(--accent-ink); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--pen-soft); color: var(--pen); }

/* ---------------------------------------------------------- */
/* 提示文本                                                    */
/* ---------------------------------------------------------- */

.error, .flash-error {
  color: var(--accent-ink);
  background: var(--danger-soft);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  margin: 0.7rem 0;
  font-size: 0.98rem;
  box-shadow: var(--shadow-sm);
  transform: rotate(-0.4deg);
}
.ok, .flash-ok {
  color: var(--ok);
  background: var(--ok-soft);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  margin: 0.7rem 0;
  font-size: 0.98rem;
  box-shadow: var(--shadow-sm);
}
.muted { color: var(--muted); font-size: 0.92rem; }
.hint { color: var(--muted); font-size: 0.92rem; }

/* ---------------------------------------------------------- */
/* 工具栏 / 操作 / 分页                                        */
/* ---------------------------------------------------------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.5rem;
  align-items: flex-end;
  margin-bottom: 0.95rem;
}
/* 筛选条：坐在虚线纸托盘上，和表格区视觉分层 */
.card.list-shell > form.toolbar,
.card.list-shell > .toolbar,
form.toolbar,
.toolbar.filters {
  padding: 0.55rem 0.7rem 0.6rem;
  border: 2px dashed var(--line-soft);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--postit) 18%, transparent), transparent 70%),
    color-mix(in srgb, var(--paper-2) 72%, transparent);
}
.toolbar form.toolbar,
form.toolbar {
  margin-bottom: 0;
  flex: 1 1 auto;
  min-width: 0;
}
/* 字段均分剩余宽度，优先与操作按钮挤在同一行 */
.toolbar label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-top: 0;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--serif);
  color: var(--ink);
  gap: 0.2rem;
  flex: 1 1 0;
  min-width: 5.5rem;
  max-width: 11.5rem;
}
.toolbar input:not([type="checkbox"]):not([type="radio"]),
.toolbar select {
  display: block;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 2.2rem;
  margin-top: 0;
  padding: 0.32rem 0.55rem;
  font-weight: 400;
  font-family: var(--sans);
  font-size: 0.92rem;
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  box-shadow: none;
}
.toolbar input[type=text] { max-width: none; min-width: 0; }
.toolbar select { min-width: 0; padding-right: 1.9rem; }
.toolbar input:not([type="checkbox"]):not([type="radio"]):focus,
.toolbar select:focus {
  background: var(--postit);
  color: var(--postit-ink);
  box-shadow: 3px 3px 0 0 var(--ink);
}
.toolbar .ops-select {
  margin-top: 0;
  width: 100%;
  min-width: 0;
}
.toolbar .ops-select--toolbar {
  min-width: 0;
  max-width: none;
  width: 100%;
}
.toolbar .label-check {
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-end;
  min-height: 2.2rem;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0 0.05rem;
  font-family: var(--sans);
  font-weight: 500;
  color: var(--ink-2);
  background: transparent;
  border: 0;
}
.toolbar .label-check:has(> input:checked) {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
}
/* 筛选操作按钮组：靠右贴齐托盘，尽量与字段同行 */
.toolbar-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  margin-left: auto;
  align-self: flex-end;
  align-items: center;
  flex: 0 0 auto;
  white-space: nowrap;
}
.toolbar-actions > button,
.toolbar-actions > .btn,
.toolbar-actions > a {
  margin: 0;
}
/* 无 wrapper 时：首个操作按钮自动靠右（筛选/搜索） */
.toolbar:not(.batch-toolbar):not(.toolbar-split) > button:first-of-type,
.toolbar:not(.batch-toolbar):not(.toolbar-split) > a.btn:first-of-type {
  margin-left: auto;
}
.toolbar button,
.toolbar .btn {
  margin: 0;
  align-self: flex-end;
  min-height: 2.2rem;
  padding: 0.35rem 0.8rem;
  font-size: 0.92rem;
}
.toolbar .muted,
.toolbar > span {
  align-self: center;
}
.toolbar-split {
  justify-content: space-between;
  align-items: flex-end;
  /* 外层 split 本身不再双层托盘；由内部 form.filters 承担 */
  padding: 0;
  border: 0;
  background: transparent;
}
.toolbar-split .filters {
  flex: 1 1 auto;
}
.toolbar-split .toolbar-cta {
  flex: 0 0 auto;
  margin-left: auto;
  align-self: flex-end;
}

/* 批量操作分段胶囊（参考「全部/可用/禁用」分段控件） */
.batch-toolbar {
  align-items: center;
  gap: 0.85rem 1rem;
}
.batch-seg-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}
.batch-seg-label {
  font-size: 0.92rem;
  font-weight: 700;
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.2;
}
.ops-seg {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.22rem;
  border-radius: 999px;
  background: var(--paper-2);
  border: 2px solid var(--line-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.ops-seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  margin: 0 !important;
  padding: 0.28rem 1.05rem;
  border: 2px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: none !important;
  cursor: pointer;
  transform: none !important;
  white-space: nowrap;
}
.ops-seg-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.45);
  transform: none !important;
  box-shadow: none !important;
}
.ops-seg-btn:focus-visible {
  outline: 2px solid var(--pen);
  outline-offset: 1px;
}
.ops-seg-btn:active {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line-soft);
  box-shadow: var(--shadow-sm) !important;
}
.ops-seg-btn.ops-seg-danger {
  color: var(--danger, #b42318);
}
.ops-seg-btn.ops-seg-danger:hover,
.ops-seg-btn.ops-seg-danger:active {
  color: var(--danger, #b42318);
  background: color-mix(in srgb, var(--danger, #b42318) 10%, var(--card));
  border-color: color-mix(in srgb, var(--danger, #b42318) 35%, var(--line-soft));
}
.batch-hint {
  align-self: center;
  max-width: 34rem;
  line-height: 1.35;
}
html[data-theme="dark"] .ops-seg {
  background: color-mix(in srgb, var(--paper-2) 88%, #000);
  border-color: var(--line-soft);
  box-shadow: none;
}
html[data-theme="dark"] .ops-seg-btn:hover {
  background: color-mix(in srgb, var(--card) 70%, transparent);
}
html[data-theme="dark"] .ops-seg-btn:active {
  background: var(--card);
}

/* 表格行内操作：td 必须保持 table-cell，否则底边虚线与其它列错位 */
td.actions {
  display: table-cell;
  white-space: nowrap;
  vertical-align: middle;
  min-width: 220px;
}
/* 子元素横向排布；勿把 td 本身改成 flex/inline-flex */
td.actions > a,
td.actions > button,
td.actions > .btn,
td.actions > form {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin: 0 0.35rem 0 0 !important;
  flex: 0 0 auto;
}
td.actions > :last-child {
  margin-right: 0 !important;
}
td.actions form {
  gap: 0.35rem;
  flex-wrap: nowrap;
}
td.actions button,
td.actions .btn,
td.actions a.btn,
table .btn,
table button {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  flex: 0 0 auto;
}
/* 兼容少数非 td 的 .actions 容器（若有） */
.actions:not(td) {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  white-space: nowrap;
}
.actions:not(td) form {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  flex-wrap: nowrap;
}
.actions:not(td) button,
.actions:not(td) .btn,
.actions:not(td) a.btn {
  margin: 0 !important;
  flex: 0 0 auto;
}
.actions input[type=text],
.actions input[type=number],
td input[type=text],
td input[type=number] {
  width: auto;
  max-width: 150px;
  margin: 0;
  min-height: 32px;
  padding: 0.28rem 0.5rem;
  box-shadow: none;
}
td .badge { vertical-align: middle; }

.pager {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.7rem;
  align-items: center;
  justify-content: flex-end;
  font-size: 0.92rem;
  color: var(--muted);
}
.pager-nav {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  min-width: 0;
}
.pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.28rem 0.68rem;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--card);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
  line-height: 1;
  box-sizing: border-box;
}
a.pager-btn:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transform: translate(1px, 1px);
}
.pager-btn.is-current {
  background: var(--postit);
  color: var(--postit-ink, var(--ink));
  font-weight: 800;
}
.pager-btn.is-disabled {
  opacity: 0.38;
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}
.pager-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.05em;
  user-select: none;
}
.pager-meta {
  margin-left: 0.2rem;
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}
.pager .pager-size {
  margin-left: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
}
.pager .pager-size label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.pager .pager-size select {
  width: auto;
  min-width: 4.2rem;
  margin: 0;
  min-height: 34px;
  padding: 0.2rem 1.8rem 0.2rem 0.55rem;
}
@media (max-width: 640px) {
  .pager {
    flex-direction: column;
    align-items: flex-end;
  }
  .pager-nav {
    justify-content: flex-end;
  }
  .pager .pager-size {
    justify-content: flex-end;
  }
  .pager-meta {
    white-space: normal;
  }
}

/* ---------------------------------------------------------- */
/* 行内复选                                                    */
/* ---------------------------------------------------------- */

/* 仅表格行内 checkbox；勿把 class 挂到 <label> 上（会把标签挤成 15px 竖排） */
input.row-check,
input[type="checkbox"].row-check {
  width: 15px;
  height: 15px;
  margin: 0;
}

/* ---------------------------------------------------------- */
/* 顶部旧 header 兼容                                          */
/* ---------------------------------------------------------- */

header.top { display: none; }

/* ---------------------------------------------------------- */
/* 登录 / bootstrap 独立页                                     */
/* ---------------------------------------------------------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 2rem 2rem 1.6rem;
  box-shadow: var(--shadow-lg);
  transform: rotate(-0.5deg);
  position: relative;
}
.auth-card::before {
  /* 胶带装饰 */
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 88px;
  height: 22px;
  margin-left: -44px;
  background: rgba(180, 180, 180, 0.45);
  border: 1.5px solid rgba(45, 45, 45, 0.25);
  transform: rotate(-2deg);
}
.auth-card .logo {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 700;
  transform: rotate(0.6deg);
}
.auth-card .logo em { font-style: normal; color: var(--accent); }
.auth-card h1 { font-size: 1.4rem; margin: 1.1rem 0 0.3rem; }
.auth-card .hint { margin-bottom: 0.5rem; }
.auth-card button {
  width: 100%;
  justify-content: center;
  margin-top: 1.25rem;
  padding: 0.7rem;
  font-size: 1.1rem;
}

/* ---------------------------------------------------------- */
/* 使用引导 + 帮助页                                           */
/* ---------------------------------------------------------- */

html.ops-tour-active {
  overflow: hidden;
}
html.ops-tour-active body {
  /* 锁滚动，避免引导期间页面跳动；侧栏仍可被脚本滚动 */
  overflow: hidden;
}
.ops-tour {
  position: fixed;
  inset: 0;
  /* 高于 AI 悬浮球(1200)，整层一个 stacking context，卡片永远可点 */
  z-index: 2500;
  pointer-events: none;
}
.ops-tour[hidden] { display: none !important; }
.ops-tour-mask {
  position: absolute;
  inset: 0;
  background: rgba(45, 45, 45, 0.42);
  pointer-events: auto;
}
/* 有 spotlight 时遮罩透明，只靠挖孔 box-shadow 压暗，避免把高亮区也盖死 */
.ops-tour-mask.is-cutout {
  background: transparent;
}
.ops-tour-spotlight {
  position: fixed;
  z-index: 1;
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow:
    0 0 0 9999px rgba(45, 45, 45, 0.42),
    4px 4px 0 0 #2d2d2d;
  background: transparent;
  pointer-events: none;
}
/* 目标只做视觉标记，绝不抬 z-index（否则会盖住引导卡，导致点不了下一步） */
.ops-tour-target {
  pointer-events: none !important;
  outline: none;
}
.ops-tour-card {
  position: fixed;
  z-index: 2;
  width: min(380px, calc(100vw - 24px));
  max-height: min(72vh, 520px);
  overflow: auto;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 1rem 1.1rem 0.95rem;
  pointer-events: auto;
  color: var(--ink);
  scrollbar-width: thin;
  scrollbar-color: var(--line-soft) transparent;
}
.ops-tour-card.is-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-0.4deg);
}
.ops-tour-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.ops-tour-kicker {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
}
.ops-tour-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  min-height: 0;
}
.ops-tour-x:hover {
  background: var(--postit);
  border-color: var(--ink);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transform: none;
}
.ops-tour-title {
  font-family: var(--serif);
  font-size: 1.25rem;
  margin: 0.15rem 0 0.45rem;
  transform: none;
}
.ops-tour-body {
  margin: 0 0 0.85rem;
  color: var(--ink-2);
  font-size: 0.98rem;
  line-height: 1.55;
}
.ops-tour-dots {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}
.ops-tour-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: transparent;
  opacity: 0.45;
}
.ops-tour-dot.is-done {
  background: var(--line-soft);
  opacity: 0.8;
}
.ops-tour-dot.is-on {
  background: var(--accent);
  border-color: var(--ink);
  opacity: 1;
  width: 18px;
}
.ops-tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.ops-tour-link {
  margin: 0;
  padding: 0.2rem 0.1rem;
  border: none;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  min-height: 0;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.ops-tour-link:hover {
  background: transparent;
  color: var(--pen);
  border: none;
  box-shadow: none;
  transform: none;
}
.ops-tour-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}
.ops-tour-nav .btn,
.ops-tour-nav button {
  margin: 0;
}

/* 帮助页 */
.help-restart { margin-bottom: 1.1rem; }
.help-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.help-toc {
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.85rem 0.9rem;
  max-height: calc(100vh - 96px);
  overflow: auto;
  scrollbar-width: thin;
}
.help-toc-title {
  font-family: var(--serif);
  margin-bottom: 0.25rem;
}
.help-toc a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.93rem;
  padding: 0.22rem 0.3rem;
  border-radius: var(--radius-sm);
  line-height: 1.3;
}
.help-toc a:hover {
  color: var(--pen);
  background: var(--postit);
  text-decoration: none;
}
.help-body .card { margin-bottom: 0.9rem; }
.help-body h2 { margin-top: 0; }
.help-body h3 { margin-top: 1rem; }
.help-steps {
  margin: 0.4rem 0 0.8rem 1.1rem;
  padding: 0;
  line-height: 1.6;
}
.help-body ul {
  margin: 0.35rem 0 0.7rem 1.1rem;
  line-height: 1.55;
}
.help-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.2rem 0 0.75rem;
}
.help-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.55rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--postit);
  color: var(--postit-ink);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
}
.help-pill.muted {
  background: var(--paper-2);
  color: var(--ink-2);
}
.help-figure {
  margin: 0.75rem 0 1rem;
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--paper-2);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.help-figure-cap {
  margin: 0;
  padding: 0.45rem 0.75rem;
  border-top: 2px dashed var(--ink);
  font-size: 0.86rem;
  color: var(--muted);
  background: var(--card);
}
.help-mock {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem 0.9rem;
  font-size: 0.86rem;
  color: var(--ink-2);
}
.help-mock--shell {
  grid-template-columns: 92px minmax(0, 1fr);
  min-height: 148px;
  padding: 0;
  gap: 0;
}
.help-mock-side {
  border-right: 2px solid var(--ink);
  background: var(--card);
  padding: 0.55rem 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}
.help-mock-brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 0.78rem;
  margin-bottom: 0.2rem;
  color: var(--ink);
}
.help-mock-nav {
  height: 10px;
  border-radius: 999px;
  background: var(--line-soft);
  opacity: 0.85;
}
.help-mock-nav.is-on {
  background: var(--postit);
  border: 1.5px solid var(--ink);
  opacity: 1;
  height: 14px;
}
.help-mock-main {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem 0.7rem;
  background:
    radial-gradient(var(--line-soft) 1px, transparent 1px);
  background-size: 12px 12px;
  background-color: var(--paper);
}
.help-mock-top {
  height: 18px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--topbar);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.35rem;
}
.help-mock-ico {
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  background: var(--topbar-control, #fffef9);
}
.help-mock-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}
.help-mock-metric {
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: var(--card);
  padding: 0.35rem 0.4rem;
  min-height: 42px;
}
.help-mock-metric span {
  display: block;
  height: 6px;
  width: 55%;
  background: var(--line-soft);
  border-radius: 999px;
  margin-bottom: 0.35rem;
}
.help-mock-metric strong {
  display: block;
  height: 12px;
  width: 40%;
  background: var(--accent);
  border: 1px solid var(--ink);
  border-radius: 4px;
}
.help-mock-row {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 0.55rem;
  align-items: start;
}
.help-mock-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.help-mock-field {
  border: 1.5px solid var(--ink);
  border-radius: 7px;
  background: var(--card);
  padding: 0.35rem 0.45rem;
}
.help-mock-field em {
  display: block;
  font-style: normal;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.help-mock-field i {
  display: block;
  height: 10px;
  width: 70%;
  background: var(--line-soft);
  border-radius: 999px;
  font-style: normal;
}
.help-mock-field i.wide { width: 92%; height: 28px; border-radius: 6px; }
.help-mock-media {
  border: 2px dashed var(--ink);
  border-radius: 10px;
  min-height: 96px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
  padding: 0.5rem;
}
.help-mock-media b {
  font-size: 1.35rem;
  line-height: 1;
  color: var(--ink);
}
.help-mock-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.help-mock-step {
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  padding: 0.28rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
}
.help-mock-step.is-accent {
  background: var(--postit);
  color: var(--postit-ink);
}
.help-mock-arrow {
  color: var(--muted);
  font-weight: 700;
}
.help-mock-ai {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 0.55rem;
  align-items: end;
}
.help-mock-chat {
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: var(--card);
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-height: 110px;
}
.help-mock-bubble {
  max-width: 88%;
  border: 1.5px solid var(--ink);
  border-radius: 9px;
  padding: 0.28rem 0.4rem;
  font-size: 0.72rem;
  line-height: 1.3;
  background: rgba(90, 140, 255, 0.1);
}
.help-mock-bubble.ai {
  align-self: flex-start;
  background: var(--paper-2);
}
.help-mock-bubble.user {
  align-self: flex-end;
}
.help-mock-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.help-mock-chip {
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.12rem 0.4rem;
  font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.55);
}
.help-mock-orb {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.18);
  margin: 0 0 0.2rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}
.help-callout {
  margin: 0.55rem 0 0.2rem;
  padding: 0.55rem 0.75rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--postit);
  color: var(--postit-ink);
  font-size: 0.92rem;
  line-height: 1.45;
}
.help-callout strong { font-weight: 700; }
.help-kvs {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.25rem 0.6rem;
  margin: 0.4rem 0 0.7rem;
  font-size: 0.95rem;
}
.help-kvs dt {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
}
.help-kvs dd {
  margin: 0;
  color: var(--ink-2);
}
[data-theme="dark"] .help-mock-top {
  background: var(--topbar);
}
[data-theme="dark"] .help-mock-bubble {
  background: rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .help-mock-chip {
  background: rgba(255, 255, 255, 0.06);
}

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

@media (max-width: 920px) {
  body { background-attachment: scroll; }
  .ops-shell { flex-direction: column; }
  .ops-side {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.5rem 0.8rem;
    border-right: none;
    border-bottom: 3px solid var(--ink);
  }
  .ops-brand {
    border-bottom: none;
    margin-bottom: 0;
    padding: 0.3rem 0.5rem;
    transform: none;
  }
  .ops-nav { flex-direction: row; flex-wrap: wrap; padding: 0; }
  .ops-nav .nav-group { display: none; }
  .ops-nav a {
    padding: 0.3rem 0.55rem;
    font-size: 0.92rem;
    transform: none !important;
  }
  .ops-side-foot { display: none; }
  .ops-content { padding: 1.1rem 1rem 2.5rem; }
  .metric:nth-child(n) { transform: none; }
  .auth-card { transform: none; }
  .help-layout { grid-template-columns: 1fr; }
  .help-toc { position: static; flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 620px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  h1 { font-size: 1.5rem; }
  .ops-topbar { padding: 0.35rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  .metric:hover, button:hover, .btn:hover, .ops-nav a:hover {
    transform: none;
  }
  .ops-prefs-refresh.is-spinning svg {
    animation: none;
  }
}
