/* ==========================================================================
   淘客转链工具箱 · 工作台样式
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --accent: #e8342f;
  --accent-2: #ff7a45;
  --accent-soft: rgba(232, 52, 47, .08);
  --accent-line: rgba(232, 52, 47, .22);
  --accent-glow: rgba(232, 52, 47, .30);
  --grad: linear-gradient(135deg, #e8342f, #ff7a45);

  --bg: #f5f6fa;
  --panel: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #7b8794;
  --muted-2: #9aa4b2;
  --line: #e9ecf2;
  --line-2: #f1f3f8;

  --green: #12b76a;
  --green-soft: #eafaf1;
  --blue: #3b82f6;
  --blue-soft: #eff5ff;
  --gold: #f5a524;
  --gold-soft: #fff8ea;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .05), 0 6px 16px -10px rgba(15, 23, 42, .18);
  --shadow: 0 2px 4px rgba(15, 23, 42, .04), 0 16px 32px -18px rgba(15, 23, 42, .22);
  --shadow-lg: 0 32px 64px -24px rgba(15, 23, 42, .3);

  --sidebar-w: 236px;
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "HarmonyOS Sans SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font-family: inherit; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
img { display: block; max-width: 100%; }
svg { width: 18px; height: 18px; flex: 0 0 auto; }

::selection { background: rgba(232, 52, 47, .16); }

/* hidden 属性优先级高于组件自身的 display 设定 */
[hidden] { display: none !important; }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d6dae3; border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #c2c8d4; }

/* ==========================================================================
   骨架布局
   ========================================================================== */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 16px;
}
.brand-logo {
  width: 36px; height: 36px;
  border-radius: 11px;
  background: var(--grad);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px -8px var(--accent-glow);
  flex: 0 0 36px;
}
.brand-logo svg { width: 20px; height: 20px; }
.brand-txt { display: flex; flex-direction: column; min-width: 0; }
.brand-txt b { font-size: 14px; font-weight: 700; letter-spacing: .2px; }
.brand-txt span { font-size: 11px; color: var(--muted-2); margin-top: 1px; white-space: nowrap; }

.nav { flex: 1; padding: 4px 10px; overflow-y: auto; }
.nav-group {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #b6bdc9;
  padding: 14px 10px 6px;
  text-transform: uppercase;
}
.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9.5px 11px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: background .16s ease, color .16s ease;
}
.nav-item svg { color: #98a1b0; transition: color .16s ease; }
.nav-item:hover { background: #f6f7fb; }
.nav-item.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}
.nav-item.is-active svg { color: var(--accent); }
.nav-item.is-active::before {
  content: "";
  position: absolute; left: -10px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.nav-badge {
  margin-left: auto;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
}
.nav-badge.alt { background: var(--blue-soft); color: var(--blue); }

.side-foot {
  padding: 12px 14px 16px;
  border-top: 1px solid var(--line-2);
}
.api-status {
  display: flex;
  gap: 9px;
  align-items: center;
  background: #f8f9fc;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 9px 11px;
}
.api-status .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #cfd5e0;
  flex: 0 0 8px;
  box-shadow: 0 0 0 3px rgba(207, 213, 224, .3);
}
.api-status.is-ok .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(18, 183, 106, .18); }
.api-status.is-warn .dot { background: var(--gold); box-shadow: 0 0 0 3px rgba(245, 165, 36, .18); }
.api-status.is-err .dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(232, 52, 47, .18); }
.api-status div { display: flex; flex-direction: column; min-width: 0; }
.api-status b { font-size: 11.5px; color: var(--ink-2); font-weight: 600; }
.api-status span { font-size: 10.5px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ver { font-size: 10.5px; color: #b8bfca; text-align: center; margin-top: 10px; }

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 26px;
  background: rgba(245, 246, 250, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(233, 236, 242, .9);
}
.tb-left h1 { font-size: 19px; font-weight: 700; letter-spacing: -.2px; }
.tb-left p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tb-right { display: flex; align-items: center; gap: 10px; }
.tb-divider { width: 1px; height: 22px; background: var(--line); }
.storage-tag {
  font-size: 11.5px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 7px;
}

.views { padding: 20px 26px 56px; max-width: 1440px; width: 100%; }
.view { display: none; }
.view.is-active { display: block; animation: fadeUp .28s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.layout-2col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 306px;
  gap: 16px;
  align-items: start;
}
.col-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.col-side { min-width: 0; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }

/* ==========================================================================
   卡片
   ========================================================================== */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-xs);
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.card-head h2 { font-size: 15.5px; font-weight: 700; letter-spacing: -.1px; }
.card-head p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.card-title-sm { font-size: 13.5px; font-weight: 700; margin-bottom: 12px; }

.chip {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 7px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.chip-soft { background: #f3f5f9; color: var(--muted); }
.chip-warn { background: var(--gold-soft); color: #b87610; border: 1px solid #ffe9bf; }
.chip-ok { background: var(--green-soft); color: #0d8f52; }
.chip-err { background: var(--accent-soft); color: var(--accent); }

/* ==========================================================================
   按钮
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .18s ease, background .16s ease, border-color .16s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 18px -10px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 12px 24px -10px var(--accent-glow); }
.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink-2);
}
.btn-ghost:hover { border-color: #d9dee8; background: #fbfcfe; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { padding: 13px 22px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; }

.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-ghost.is-loading::after { border-color: rgba(15, 23, 42, .2); border-top-color: var(--ink-2); }
@keyframes spin { to { transform: rotate(360deg); } }

.mini-btn {
  white-space: nowrap;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: all .15s ease;
}
.mini-btn:hover { border-color: #d6dbe5; background: #fafbfe; color: var(--ink); }
.mini-btn.is-done { background: var(--green-soft); border-color: #c7f0da; color: #0d8f52; }
.link-btn {
  border: 0; background: transparent;
  color: var(--blue);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.link-btn:hover { text-decoration: underline; }

/* ==========================================================================
   平台切换
   ========================================================================== */
.plat-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.plat-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s ease;
}
.plat-tab:hover { color: var(--ink-2); border-color: #d9dee8; }
.plat-tab.is-active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}

/* ==========================================================================
   输入区
   ========================================================================== */
.input-wrap { position: relative; }
textarea, input[type="text"], input[type="url"], input[type="search"], select {
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 13px;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
  resize: vertical;
}
textarea { line-height: 1.65; min-height: 96px; }
textarea::placeholder, input::placeholder { color: #b3bac6; }
textarea:focus, input:focus, select:focus {
  border-color: var(--accent-line);
  background: #fff;
  box-shadow: 0 0 0 3.5px rgba(232, 52, 47, .07);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b8794' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
  cursor: pointer;
}

.input-tools {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
}
.input-tools .mini-btn:first-child { margin-left: 1px; }
.input-count {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted-2);
}

.opt-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 15px 0;
  padding: 11px 13px;
  background: #fafbfe;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
}
.opt-select { display: flex; align-items: center; gap: 8px; }
.opt-select > span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.opt-select select { width: auto; min-width: 132px; padding: 6px 30px 6px 10px; font-size: 12.5px; border-radius: 8px; }
.opt-select.full { flex-direction: column; align-items: stretch; gap: 6px; }
.opt-select.full select { width: 100%; }

/* 开关 */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 500;
  user-select: none;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i {
  width: 36px; height: 20px;
  border-radius: 99px;
  background: #dfe3ec;
  position: relative;
  transition: background .2s ease;
  flex: 0 0 36px;
}
.switch i::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .2);
  transition: transform .2s cubic-bezier(.3, 1.4, .6, 1);
}
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px var(--accent-soft); }

/* ==========================================================================
   侧栏小卡
   ========================================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line-2);
  padding: 0;
  overflow: hidden;
}
.stat {
  background: #fff;
  padding: 15px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat span { font-size: 11.5px; color: var(--muted); }
.stat b { font-size: 21px; font-weight: 800; letter-spacing: -.4px; color: var(--ink); }

.tip-card h3, .guide-card h3 { font-size: 13.5px; font-weight: 700; margin-bottom: 10px; }
.tip-card ul { display: flex; flex-direction: column; gap: 9px; }
.tip-card li {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
  padding-left: 15px;
  position: relative;
}
.tip-card li::before {
  content: "";
  position: absolute;
  left: 3px; top: 8px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #ccd2dd;
}
.tip-card li b { color: var(--ink-2); font-weight: 600; }
.guide-card { background: linear-gradient(160deg, #fffaf7, #fff); border-color: #fbe8dd; }
.guide-card p { font-size: 12.5px; color: var(--muted); line-height: 1.65; margin-bottom: 12px; }

.steps { display: flex; flex-direction: column; gap: 10px; counter-reset: s; }
.steps li {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
  padding-left: 24px;
  position: relative;
  counter-increment: s;
}
.steps li::before {
  content: counter(s);
  position: absolute;
  left: 0; top: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.steps li b { color: var(--ink-2); }
.steps code { font-size: 11.5px; background: #f4f5f9; padding: 1px 5px; border-radius: 4px; }
.muted { font-size: 11.5px; color: var(--muted-2); line-height: 1.6; margin-top: 12px; }

/* ==========================================================================
   结果区
   ========================================================================== */
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 0;
}
.result-head h2 { font-size: 15px; font-weight: 700; }
.result-head h2 span { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.result-tools { display: flex; gap: 7px; }

.result-area { display: flex; flex-direction: column; gap: 13px; }

.res-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.res-card:hover { box-shadow: var(--shadow-sm); border-color: #e2e6ee; }

.res-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line-2);
  background: #fcfdff;
}
.plat-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2.5px 8px;
  border-radius: 6px;
  letter-spacing: .2px;
}
.plat-taobao, .plat-tmall { background: #fff1f0; color: #e8342f; }
.plat-jd { background: #fff0f0; color: #d81e06; }
.plat-pdd { background: #fff1f0; color: #e02e24; }
.plat-vip { background: #fdf0f8; color: #c2006a; }
.plat-suning { background: #fff7e6; color: #d68a00; }
.plat-meituan { background: #fff8e8; color: #c98a00; }
.plat-unknown { background: #f4f5f9; color: var(--muted); }

.res-id { font-size: 11.5px; color: var(--muted-2); }
.res-flag {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: #0d8f52;
  background: var(--green-soft);
  padding: 2.5px 9px;
  border-radius: 6px;
}
.res-flag.warn { color: #b87610; background: var(--gold-soft); }

.res-main { display: flex; gap: 14px; padding: 15px; }
.res-pic {
  flex: 0 0 92px;
  width: 92px; height: 92px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #f4f5f9;
}
.res-pic img { width: 100%; height: 100%; object-fit: cover; }
.res-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.res-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.res-sub {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.res-price {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.res-price b { font-size: 22px; font-weight: 800; color: var(--accent); letter-spacing: -.5px; }
.res-price s { font-size: 11.5px; color: var(--muted-2); }
.res-coupon {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  padding: 1.5px 7px;
  border-radius: 5px;
}
.res-comm { font-size: 11.5px; color: #0d8f52; font-weight: 600; margin-left: auto; }

.out-list {
  padding: 0 15px 15px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.out-row {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #f9fafd;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 7px 8px 7px 11px;
}
.out-label {
  flex: 0 0 56px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.out-val {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.out-val.is-tkl { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .3px; }
.out-act { display: flex; gap: 5px; flex: 0 0 auto; }
.out-act .mini-btn { padding: 3px 9px; font-size: 11px; }

.res-actions {
  display: flex;
  gap: 8px;
  padding: 0 15px 15px;
  flex-wrap: wrap;
}
.res-actions .btn { flex: 1; min-width: 128px; }

/* 空状态 */
.empty {
  text-align: center;
  padding: 46px 20px;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
}
.empty-ico {
  width: 46px; height: 46px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: #f5f7fb;
  display: flex; align-items: center; justify-content: center;
  color: #b9c0cd;
}
.empty h3 { font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.empty p { font-size: 12px; color: var(--muted-2); }

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, #f3f5f9 25%, #e9edf4 37%, #f3f5f9 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ==========================================================================
   批量
   ========================================================================== */
.batch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px;
  gap: 16px;
  align-items: start;
}
.batch-side { display: flex; flex-direction: column; gap: 13px; }

.progress { display: flex; flex-direction: column; gap: 6px; }
.progress-bar { height: 6px; background: #eef0f6; border-radius: 99px; overflow: hidden; }
.progress-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: var(--grad);
  transition: width .3s ease;
}
.progress-text { font-size: 11.5px; color: var(--muted); text-align: center; }

/* 表格 */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  min-width: 760px;
}
.data-table th {
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  color: var(--muted);
  padding: 9px 10px;
  background: #fafbfd;
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.data-table th:first-child { border-radius: 8px 0 0 8px; }
.data-table th:last-child { border-radius: 0 8px 8px 0; }
.data-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink-2);
  vertical-align: middle;
}
.data-table tbody tr:hover td { background: #fcfdff; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.td-title {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
.td-price { font-weight: 700; color: var(--accent); }
.td-mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--muted); }
.td-ops { display: flex; gap: 5px; }

/* ==========================================================================
   中间页识别
   ========================================================================== */
.recognize-input {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.recognize-input input { flex: 1; padding: 12px 14px; }
.recognize-input .btn { flex: 0 0 auto; }
.recognize-hint {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--muted-2);
  display: flex;
  align-items: center;
  gap: 7px;
}
.recognize-hint::before {
  content: "i";
  width: 15px; height: 15px;
  border-radius: 50%;
  background: #eef1f7;
  color: #98a1b0;
  font-size: 10px;
  font-weight: 700;
  font-style: italic;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 15px;
}

.rec-panel { margin-top: 16px; }
.rec-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.rec-head h3 { font-size: 14.5px; font-weight: 700; }

.evidence {
  position: relative;
  padding-left: 6px;
}
.ev-item {
  position: relative;
  padding: 0 0 16px 22px;
  border-left: 1.5px dashed #e5e9f1;
  margin-left: 4px;
}
.ev-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.ev-item::before {
  content: "";
  position: absolute;
  left: -5.5px; top: 5px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #ccd4e0;
}
.ev-item.is-hit::before { border-color: var(--green); background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.ev-step { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.ev-detail { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.6; word-break: break-all; }
.ev-hit {
  display: inline-block;
  margin-top: 5px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px;
  background: #f4f6fa;
  color: #4a5568;
  padding: 2px 7px;
  border-radius: 5px;
}

.rec-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.rec-cell {
  background: #fafbfd;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 10px 12px;
}
.rec-cell span { font-size: 11px; color: var(--muted); display: block; }
.rec-cell b { font-size: 14px; font-weight: 700; margin-top: 2px; display: block; word-break: break-all; }

/* ==========================================================================
   中间页资产
   ========================================================================== */
.pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 13px;
}
.page-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: #fff;
  transition: box-shadow .2s ease, transform .2s ease;
}
.page-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.page-thumb {
  height: 118px;
  background: #f4f5f9 center/cover no-repeat;
  position: relative;
}
.page-thumb-tag {
  position: absolute;
  left: 8px; top: 8px;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  background: rgba(15, 23, 42, .62);
  padding: 2px 7px;
  border-radius: 5px;
  backdrop-filter: blur(4px);
}
.page-body { padding: 11px 12px 12px; }
.page-title {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}
.page-meta {
  display: flex;
  gap: 10px;
  margin-top: 7px;
  font-size: 11px;
  color: var(--muted-2);
}
.page-meta b { color: var(--ink-2); font-weight: 600; }
.page-link {
  margin-top: 9px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--muted);
  background: #f8f9fc;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 4px 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-ops { display: flex; gap: 5px; margin-top: 9px; }
.page-ops .mini-btn {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  padding: 4px 4px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page-ops .mini-btn.danger { color: #d64545; }
.page-ops .mini-btn.danger:hover { background: #fff5f5; border-color: #ffd9d9; }

/* ==========================================================================
   设置表单
   ========================================================================== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field small { font-size: 11px; color: var(--muted-2); line-height: 1.5; }
.field input, .field textarea { font-size: 13px; padding: 9px 12px; }
.form-actions { display: flex; gap: 9px; margin-top: 18px; }

.diag-list { display: flex; flex-direction: column; gap: 1px; background: var(--line-2); border-radius: 10px; overflow: hidden; }
.diag-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  background: #fff;
  font-size: 12px;
}
.diag-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; flex: 0 0 7px; background: #cfd5e0; }
.diag-row.ok .diag-dot { background: var(--green); }
.diag-row.err .diag-dot { background: var(--accent); }
.diag-name { font-weight: 600; color: var(--ink-2); flex: 0 0 96px; }
.diag-msg { color: var(--muted); flex: 1; word-break: break-all; }

.search-box input { width: 190px; padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }

/* ==========================================================================
   弹窗
   ========================================================================== */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(4px);
  animation: fadeIn .18s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: #fff;
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 880px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn .22s cubic-bezier(.2, .9, .3, 1) both;
  overflow: hidden;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
}
.modal-head h3 { font-size: 15px; font-weight: 700; }
.modal-close {
  border: 0;
  background: #f4f5f9;
  width: 28px; height: 28px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: #eceef4; color: var(--ink); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 13px 20px;
  border-top: 1px solid var(--line-2);
  background: #fcfdff;
}

/* 手机预览框 */
.device-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0;
}
.device {
  width: 390px;
  max-width: 100%;
  height: 720px;
  max-height: 72vh;
  border-radius: 30px;
  border: 9px solid #14161c;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 24px 50px -20px rgba(15, 23, 42, .4);
  position: relative;
}
.device iframe { width: 100%; height: 100%; border: 0; display: block; }

/* 二维码 */
.qr-box { text-align: center; padding: 6px 0; }
.qr-box img { width: 220px; height: 220px; margin: 0 auto 12px; border-radius: 12px; border: 1px solid var(--line); }
.qr-url {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: var(--muted);
  word-break: break-all;
  background: #f8f9fc;
  padding: 8px 12px;
  border-radius: 8px;
}

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 14px);
  background: rgba(15, 23, 42, .93);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: all .24s ease;
  z-index: 200;
  max-width: 70vw;
  text-align: center;
  box-shadow: 0 12px 28px -12px rgba(15, 23, 42, .5);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 模板说明表 */
.tpl-list { display: flex; flex-direction: column; gap: 9px; }
.tpl-row {
  display: flex;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #fcfdff;
}
.tpl-row .tpl-name { font-size: 12.5px; font-weight: 700; flex: 0 0 96px; }
.tpl-row .tpl-tag {
  flex: 0 0 auto;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: 4px;
  height: 18px;
  line-height: 16px;
  align-self: center;
}
.tpl-row .tpl-desc { font-size: 11.5px; color: var(--muted); flex: 1; line-height: 1.55; }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1180px) {
  .layout-2col { grid-template-columns: minmax(0, 1fr) 276px; }
}

@media (max-width: 1024px) {
  :root { --sidebar-w: 74px; }
  .brand { justify-content: center; padding: 16px 8px; }
  .brand-txt, .nav-group, .nav-badge, .side-foot .api-status div, .ver { display: none; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .nav-item span { display: none; }
  .nav-item.is-active::before { left: -6px; }
  .side-foot { padding: 10px 8px 14px; display: flex; justify-content: center; }
  .api-status { padding: 8px; }
  .layout-2col { grid-template-columns: 1fr; }
  .col-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .col-side > * { flex: 1 1 240px; }
}

@media (max-width: 860px) {
  .topbar { padding: 13px 16px; }
  .views { padding: 16px 16px 48px; }
  .tb-left p { display: none; }
  .batch-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .recognize-input { flex-direction: column; }
  .recognize-input .btn { width: 100%; }
}

@media (max-width: 720px) {
  :root { --sidebar-w: 58px; }
  .brand-logo { width: 32px; height: 32px; border-radius: 10px; }
  .nav-item svg { width: 17px; height: 17px; }
  .views { padding: 12px 12px 44px; }
  .topbar { padding: 11px 12px; gap: 8px; }
  .tb-left h1 { font-size: 16px; }
  .storage-tag { display: none; }
  .res-pic { flex: 0 0 76px; width: 76px; height: 76px; }
  .card { padding: 14px; border-radius: 14px; }
  .pages-grid { grid-template-columns: 1fr; }
}
