:root {
  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --text: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, .12);
  --accent-ring: rgba(37, 99, 235, .3);
  --danger: #d92d20;
  --ok: #079455;
  --warn: #b54708;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, .07);
  --shadow-lg: 0 14px 34px rgba(16, 24, 40, .11);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
}

a { color: inherit; }
[hidden] { display: none !important; }

/* ================= 排版条目（预览 / 公开页共用） ================= */

.items { display: grid; gap: 12px; margin-bottom: 22px; }
.items--cols-1 { grid-template-columns: 1fr; }
.items--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.items--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.items--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 700px) {
  .items--cols-2, .items--cols-3, .items--cols-4 { grid-template-columns: 1fr; }
}

.item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  overflow: hidden;
  transition: transform .18s cubic-bezier(.2, .8, .3, 1), box-shadow .18s ease, border-color .18s ease;
}

.item::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity .18s ease;
}

.item--live:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-ring);
}

.item--live:hover::before { opacity: 1; }
.item--live:active { transform: translateY(0); }
.item--muted { opacity: .6; }

.item-num {
  flex: 0 0 26px;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.item-main { flex: 1 1 auto; min-width: 0; }

.item-text {
  font-size: 15px;
  font-weight: 550;
  letter-spacing: -.005em;
  word-break: break-word;
}

.item-link {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  word-break: break-all;
}

.item-arrow {
  flex: 0 0 auto;
  color: var(--line-strong);
  font-size: 15px;
  transition: transform .18s ease, color .18s ease;
}

.item--live:hover .item-arrow { transform: translateX(3px); color: var(--accent); }

.hero { text-align: center; margin-bottom: 30px; }

.hero-title {
  margin: 0;
  font-size: clamp(24px, 4.6vw, 34px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.28;
  word-break: break-word;
}

.hero-title:empty { display: none; }

.hero-title::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  margin: 15px auto 0;
  border-radius: 3px;
  background: var(--accent);
  opacity: .9;
}

.hero-sub { margin: 15px 0 0; font-size: 14.5px; color: var(--muted); word-break: break-word; }
.hero-sub:empty { display: none; }

.viewer-foot { margin-top: 8px; text-align: center; font-size: 12.5px; color: var(--muted); }
.viewer-foot p { margin: 0; word-break: break-word; }

/* ================= 公开页 ================= */

body.viewer {
  min-height: 100vh;
  background:
    radial-gradient(1100px 560px at 50% -180px, var(--accent-soft), transparent 72%),
    var(--bg);
  background-attachment: fixed;
}

.viewer-stage {
  max-width: 800px;
  margin: 0 auto;
  padding: 68px 22px 56px;
  animation: rise .5s cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.foot-admin {
  display: inline-block;
  margin-top: 26px;
  font-size: 12px;
  color: var(--muted);
  opacity: .5;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
  transition: opacity .18s ease;
}

.foot-admin:hover { opacity: 1; }

.placeholder-note {
  margin: 0 auto 20px;
  max-width: 520px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.empty-tip { padding: 40px 18px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* ================= 控件 ================= */

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, color .16s ease, filter .16s ease, opacity .16s ease;
}

.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover:not(:disabled) { background: var(--accent-ring); }
.btn-danger { background: transparent; color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: rgba(217, 45, 32, .08); }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-xs { padding: 3px 8px; font-size: 11.5px; border-radius: 7px; font-weight: 500; }
.btn-icon { padding: 5px 8px; font-size: 12.5px; border-radius: 8px; line-height: 1; }

.field { margin-bottom: 13px; }
.field > label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }

input[type="text"], input[type="email"], input[type="url"], input[type="number"], textarea, select {
  width: 100%;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 8px 11px;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}

textarea { resize: vertical; line-height: 1.6; }

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.msg { min-height: 17px; margin: 8px 0 0; font-size: 12.5px; color: var(--danger); }
.msg.is-ok { color: var(--ok); }
.msg.is-warn { color: var(--warn); }

.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; line-height: 1.6; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 11px; }
@media (max-width: 560px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.swatches { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }

.swatch {
  width: 28px; height: 28px;
  border-radius: 9px;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .12);
  cursor: pointer;
  padding: 0;
  transition: transform .14s ease;
}

.swatch:hover { transform: scale(1.09); }
.swatch[aria-pressed="true"] { border-color: var(--text); }

input[type="color"] {
  width: 42px; height: 28px;
  padding: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
}

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }

.seg button {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  padding: 5px 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}

.seg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  font-weight: 550;
}

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; user-select: none; }
.switch input { width: auto; margin: 0; accent-color: var(--accent); }

/* ================= 工作台 ================= */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 15px; letter-spacing: -.01em; }

.brand-mark {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}

.toolbar .spacer { flex: 1 1 auto; }

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 430px) minmax(0, 1fr);
  gap: 20px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 20px 80px;
  align-items: start;
}

@media (max-width: 1080px) { .tool-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 16px 16px 18px;
  margin-bottom: 14px;
}

.card > h2 {
  margin: 0 0 14px;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card > h2 .step {
  flex: 0 0 auto;
  width: 19px; height: 19px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  display: flex; align-items: center; justify-content: center;
}

.card > h2 .tail { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--muted); }

.item-row {
  padding: 12px 13px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  margin-bottom: 10px;
}

.item-row:last-child { margin-bottom: 0; }

.row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}

.row-head .idx {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 7px;
  padding: 3px 9px;
}

.row-head .spacer { flex: 1 1 auto; }

.item-row .mini {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 4px;
}

.item-row .ed-text { margin-bottom: 9px; }

.item-row .ed-link {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

.item-list { max-height: 460px; overflow: auto; margin: -4px -4px 0; padding: 0 4px; }

.preview-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.preview-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}

.preview-bar .spacer { flex: 1 1 auto; }

.preview-scroll { max-height: min(74vh, 900px); overflow: auto; }

.preview-inner {
  padding: 26px 22px 34px;
  background:
    radial-gradient(700px 340px at 50% -140px, var(--accent-soft), transparent 72%),
    var(--bg);
}

.group-block { position: relative; margin-bottom: 20px; }

.group-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 9px;
  font-size: 12px;
  color: var(--muted);
}

.group-head .tag {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.group-head .rule { flex: 1 1 auto; height: 1px; background: var(--line); }

.preview-inner .item { padding: 11px 13px; border-radius: 11px; }
.preview-inner .item-num { flex-basis: 23px; width: 23px; height: 23px; font-size: 11.5px; border-radius: 7px; }
.preview-inner .item-text { font-size: 14px; }
.preview-inner .hero-title { font-size: 23px; }
.preview-inner .hero-title::after { width: 30px; margin-top: 11px; }
.preview-inner .hero-sub { font-size: 13px; margin-top: 11px; }
.preview-inner .items { gap: 10px; margin-bottom: 0; }

/*
 * 保存条：固定在右栏底部，滚动时一直能点到。
 * 做成「贴底 + 细」两条：不透明背景、单行、只在右栏宽度内，
 * 后面再留一段空白（.savebar-spacer），保证最后一张卡片能整个滚上来，不会被它压住。
 */
.savebar {
  position: sticky;
  bottom: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -10px 20px -14px rgba(16, 24, 40, .35);
}

/* 给保存条让出高度，滚到底时最后一张卡片能完整露出来 */
.savebar-spacer { height: 56px; }

.savebar .status { flex: 1 1 auto; font-size: 12.5px; color: var(--muted); min-width: 90px; }
.savebar .status.is-dirty { color: var(--warn); }
.savebar .status.is-ok { color: var(--ok); }
.savebar .status.is-error { color: var(--danger); }

@media (max-width: 900px) {
  .savebar { border-radius: 12px; bottom: 8px; }
  .savebar-spacer { height: 64px; }
}

/* 登录浮层 */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(16, 24, 40, .38);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  animation: fade .18s ease both;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 372px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 24px 22px 20px;
  animation: rise .22s cubic-bezier(.2, .8, .3, 1) both;
}

.modal h3 { margin: 0 0 4px; font-size: 17px; letter-spacing: -.01em; }
.modal .sub { margin: 0 0 18px; font-size: 12.5px; color: var(--muted); }
.modal .actions { display: flex; gap: 9px; margin-top: 14px; }
.modal .actions .btn { flex: 1 1 auto; }

.row-inline { display: flex; gap: 8px; }
.row-inline input { flex: 1 1 auto; min-width: 0; }

/* ================= 逐组复制面板 ================= */

.seg-block { display: flex; margin-bottom: 13px; }
.seg-block button { flex: 1 1 auto; }

.copy-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.cp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

.cp-title { font-size: 13.5px; font-weight: 650; letter-spacing: -.01em; }
.cp-title b { color: var(--accent); font-size: 16px; font-variant-numeric: tabular-nums; }
.cp-range { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cp-head .spacer { flex: 1 1 auto; }

.cp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  max-height: 112px;
  overflow: auto;
}

.cp-chip {
  appearance: none;
  min-width: 30px;
  height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.cp-chip:hover { border-color: var(--accent-ring); color: var(--accent); }
.cp-chip.is-current { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 650; }
.cp-chip.is-done { background: rgba(7, 148, 85, .12); border-color: rgba(7, 148, 85, .32); color: var(--ok); }
.cp-chip.is-done.is-current { background: var(--accent); border-color: var(--accent); color: #fff; }

.cp-tip {
  padding: 9px 14px 0;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
}

.cp-stage {
  padding: 14px 18px 22px;
  min-height: 240px;
  background:
    radial-gradient(620px 300px at 50% -140px, var(--accent-soft), transparent 72%),
    var(--bg);
}

.cp-stage .items { margin-bottom: 0; align-items: stretch; }

/* 逐组复制里可编辑的条目 */
.cp-item {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 11px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.cp-item:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.cp-item-input {
  width: 100%;
  font-size: 14px;
  font-weight: 550;
  letter-spacing: -.005em;
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--line);
}

.cp-item-input:focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: none;
}

.cp-item-input::placeholder { color: var(--muted); font-weight: 400; }

.cp-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 1px;
}

.cp-item-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 2px 7px;
}

.cp-item-input--link {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.cp-item-input--link:focus { color: var(--text); }

.cp-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.cp-foot .spacer { flex: 1 1 auto; }
.cp-progress { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.cp-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.cp-actions--sub { border-top: 0; padding-top: 0; padding-bottom: 14px; }

.ver-badge {
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.cp-plain-wrap {
  border-top: 1px solid var(--line);
  padding: 11px 14px 14px;
}

.cp-plain-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}

.cp-plain-head b { font-weight: 600; color: var(--text); }
.cp-plain-head .spacer { flex: 1 1 auto; }

.cp-plain {
  width: 100%;
  min-height: 170px;
  max-height: 300px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.75;
  white-space: pre;
  overflow: auto;
  background: var(--surface-2);
  resize: vertical;
}

.cp-actions .btn { padding: 10px 14px; }
.cp-actions #cpCopy { flex: 1 1 200px; }

.cp-empty { padding: 46px 20px; text-align: center; color: var(--muted); font-size: 13.5px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  z-index: 90;
  max-width: min(88vw, 460px);
  padding: 11px 18px;
  border-radius: 11px;
  background: #101828;
  color: #fff;
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  animation: rise .22s ease both;
  text-align: center;
}

.skeleton {
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--line) 25%, var(--surface-2) 37%, var(--line) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}

@keyframes shimmer {
  from { background-position: 100% 50%; }
  to { background-position: 0 50%; }
}

/* 导入格式说明 */
.fmt-help {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 9px 12px;
  font-size: 12.5px;
}

.fmt-help > summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  list-style: none;
}

.fmt-help > summary::-webkit-details-marker { display: none; }
.fmt-help > summary::before { content: "\25B8  "; }
.fmt-help[open] > summary::before { content: "\25BE  "; }

.fmt-help ul { margin: 9px 0 2px; padding-left: 18px; }
.fmt-help li { margin-bottom: 5px; line-height: 1.6; color: var(--muted); word-break: break-word; }

.fmt-help code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--text);
}

/* 导入框条数提示 */
#rawCount {
  font-weight: 600;
  color: var(--accent);
}
#rawCount.is-empty {
  font-weight: 400;
  color: var(--muted);
}

/* 导入链接主卡 */
.card--primary {
  border-color: var(--accent-ring);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-md);
}

.import-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.import-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--muted);
  white-space: nowrap;
  font-weight: 500;
}

.import-size input {
  width: 66px;
  text-align: center;
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.import-go {
  flex: 1 1 auto;
  min-width: 170px;
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 600;
}

.import-result {
  margin: 12px 0 0;
  padding: 10px 13px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}

.import-result.is-ok {
  background: var(--accent-soft);
  border-style: solid;
  border-color: var(--accent-ring);
  color: var(--text);
  font-weight: 500;
}

/* 固定开头的链接 */
.fixed-box {
  margin-top: 4px;
  padding: 11px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.fixed-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.fixed-head .spacer { flex: 1 1 auto; }
.fixed-note { font-weight: 400; font-size: 11.5px; color: var(--muted); }

.fixed-box .import-size { margin-bottom: 8px; }
.fixed-box textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.fixed-box .hint { margin-top: 7px; }
.hint.is-ok { color: var(--accent); }
.hint.is-warn { color: var(--warn); }

/* 按组固定链接的表 */
.pair-list {
  max-height: 268px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 6px;
}

.pair-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  padding: 3px 2px;
}

.pair-row + .pair-row { border-top: 1px solid var(--line); }

.pair-no {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.pair-in {
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  padding: 6px 8px;
}

/* 末尾固定链接：每组最后一条 */
/* 每组的最后一条（末尾固定）：按组一行 */
.last-fixed {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
}

.last-fixed-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.last-fixed-head .spacer { flex: 1 1 auto; }

.last-list {
  max-height: 190px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 6px;
}

.last-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 0.62fr) minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  padding: 3px 2px;
}

.last-row + .last-row { border-top: 1px solid var(--line); }

.last-row input {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  font-size: 12px;
  padding: 6px 8px;
}

.last-row .last-in {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.last-fixed .hint { margin-top: 6px; }

/* 按钮里的条数小徽标 */
.btn-num {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .24);
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  vertical-align: 1px;
}
.btn-num:empty { display: none; }
