:root {
  --bg: #0d1117;
  --bg-2: #131a24;
  --card: rgba(22, 30, 40, 0.9);
  --border: #22303f;
  --text: #e6edf3;
  --text-dim: #8b98a5;
  --gold: #d4af37;
  --gold-2: #f0d889;
  --green: #3fb950;
  --blue: #58a6ff;
  --purple: #bc8cff;
  --red: #f85149;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.bg-deco {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(212, 175, 55, 0.08), transparent),
    radial-gradient(900px 500px at 10% 110%, rgba(88, 166, 255, 0.08), transparent);
  pointer-events: none;
  z-index: 0;
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 24px;
  background: linear-gradient(180deg, rgba(19, 26, 36, 0.98), rgba(19, 26, 36, 0.55));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  font-size: 23px; font-weight: 700;
  color: #1a1a1a;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.35);
}
.brand-text h1 { font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.brand-text p { font-size: 12px; color: var(--text-dim); }

.token-box { display: flex; gap: 8px; flex: 1; max-width: 680px; min-width: 300px; }
.token-box input, .token-box select {
  padding: 11px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
}
.token-box input { flex: 1; min-width: 120px; }
.token-box select { max-width: 200px; cursor: pointer; }
.token-box input:focus, .token-box select:focus { border-color: var(--gold); }
.token-box button {
  padding: 11px 20px;
  background: linear-gradient(135deg, #e8c96a, var(--gold));
  border: none;
  border-radius: 10px;
  color: #1a1a1a;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .1s, box-shadow .15s;
}
.token-box button:hover { box-shadow: 0 4px 18px rgba(212, 175, 55, 0.4); transform: translateY(-1px); }
.token-box button:active { transform: translateY(0); }

/* ---------------- Tab ---------------- */
.tabs {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 4px;
  padding: 0 24px;
  background: rgba(13, 17, 23, 0.6);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.tab {
  position: relative;
  padding: 14px 20px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold); font-weight: 700; }
.tab.active::after {
  content: "";
  position: absolute;
  left: 16px; right: 16px; bottom: -1px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

/* ---------------- 容器 ---------------- */
.container {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 22px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tab-panel { display: flex; flex-direction: column; gap: 16px; }

.panel { padding: 44px 24px; text-align: center; border-radius: 14px; border: 1px dashed var(--border); }
.empty { color: var(--text-dim); font-size: 14px; }
.hidden { display: none !important; }

.loading { background: var(--card); color: var(--text-dim); border-style: solid; }
.spinner {
  width: 36px; height: 36px;
  margin: 0 auto 16px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error {
  background: rgba(248, 81, 73, 0.08);
  color: #ffb4ae;
  border: 1px solid rgba(248, 81, 73, 0.4);
  border-style: solid;
  font-size: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title::before { content: ""; width: 4px; height: 14px; background: var(--gold); border-radius: 2px; }

.placeholder-text, .hint { font-size: 13px; color: var(--text-dim); line-height: 1.8; }
.hint code { background: var(--bg-2); padding: 2px 6px; border-radius: 4px; color: var(--gold); font-size: 12px; }

/* ---------------- 角色头部 ---------------- */
.hero { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.hero-left { display: flex; align-items: center; gap: 16px; }
.avatar {
  width: 72px; height: 72px;
  border-radius: 16px;
  background: linear-gradient(160deg, #1d2735, #121821);
  border: 2px solid var(--gold);
  display: grid; place-items: center;
  font-size: 28px; font-weight: 700; color: var(--gold);
  overflow: hidden;
}
.hero-name { font-size: 23px; font-weight: 800; letter-spacing: 1px; }
.hero-meta { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.tag {
  font-size: 12px;
  padding: 3px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-dim);
}
.hero-right { display: flex; gap: 20px; }
.stat-mini { text-align: center; }
.stat-mini-label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.stat-mini-value { font-size: 20px; font-weight: 700; color: var(--gold); }

/* ---------------- 状态条 ---------------- */
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; color: var(--text-dim); }
.bar-track { height: 10px; background: var(--bg-2); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; transition: width .4s ease; }
.fill-green { background: linear-gradient(90deg, #2ea043, var(--green)); }
.fill-blue { background: linear-gradient(90deg, #1f6feb, var(--blue)); }
.fill-purple { background: linear-gradient(90deg, #8250df, var(--purple)); }

/* ---------------- 人物属性 ---------------- */
.attr-sec { margin-bottom: 16px; }
.attr-sec:last-child { margin-bottom: 0; }
.attr-sec-title {
  font-size: 12px;
  font-weight: 700;
  color: #c9b58a;
  letter-spacing: 1px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.attr-sec-title::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  opacity: .7;
}

/* ---------------- 数值网格 ---------------- */
.grid-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.stat-cell {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
}
.stat-label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.stat-num { font-size: 20px; font-weight: 700; }

/* ---------------- 武学 ---------------- */
.kongfu-box { display: flex; flex-direction: column; gap: 10px; }
.kongfu-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
}
.kongfu-name { font-size: 15px; font-weight: 600; }
.kongfu-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.kongfu-level { font-size: 13px; color: var(--gold); font-weight: 700; }

/* ---------------- chips ---------------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}
.chip .lv { color: var(--gold); font-weight: 700; }

/* ---------------- 装备卡片（对齐游戏内样式） ---------------- */
.equip-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }

.eq-card {
  position: relative;
  border-radius: 10px;
  padding: 14px 14px 10px;
  background:
    linear-gradient(180deg, rgba(58, 46, 24, 0.55), rgba(30, 26, 18, 0.85));
  border: 1px solid rgba(196, 158, 74, 0.55);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
  color: #efe6d2;
}
.eq-card.q-5 { border-color: rgba(226, 186, 92, 0.75); box-shadow: 0 0 18px rgba(200, 160, 60, 0.12), inset 0 0 0 1px rgba(0,0,0,.3); }
.eq-card.q-4 { border-color: rgba(168, 120, 210, 0.6); background: linear-gradient(180deg, rgba(48, 36, 62, 0.6), rgba(24, 20, 30, 0.85)); }
.eq-card.q-3 { border-color: rgba(88, 140, 210, 0.55); background: linear-gradient(180deg, rgba(28, 42, 62, 0.62), rgba(18, 24, 34, 0.85)); }
.eq-card.q-2 { border-color: rgba(90, 150, 110, 0.5); background: linear-gradient(180deg, rgba(26, 46, 36, 0.6), rgba(18, 26, 22, 0.85)); }
.eq-card.q-1 { border-color: rgba(140, 140, 140, 0.4); background: linear-gradient(180deg, rgba(38, 38, 40, 0.6), rgba(22, 22, 24, 0.85)); }

.eq-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(196, 158, 74, 0.28);
  margin-bottom: 10px;
}
.eq-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.eq-icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(196, 158, 74, 0.35);
  object-fit: cover;
  flex: none;
}
.eq-name { font-size: 16px; font-weight: 700; letter-spacing: .5px; color: #fdf3dd; }
.eq-lv { font-size: 12px; color: #c9b58a; white-space: nowrap; }

.eq-banner {
  font-size: 12px;
  line-height: 1.5;
  color: #ffdf9e;
  background: rgba(120, 88, 24, 0.28);
  border: 1px solid rgba(226, 186, 92, 0.45);
  border-radius: 6px;
  padding: 7px 10px;
  margin-bottom: 10px;
}

.eq-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.eq-chips span {
  font-size: 12px;
  color: #d9c9a4;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(196, 158, 74, 0.3);
  border-radius: 4px;
  padding: 3px 9px;
}

.eq-sec { font-size: 12px; font-weight: 700; color: #e6c983; letter-spacing: .5px; margin: 10px 0 7px; }

.eq-base { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.eq-base .kv { display: flex; justify-content: space-between; font-size: 13px; color: #cfc2a4; }
.eq-base .kv b { color: #f4e9cd; font-weight: 700; }

.eq-dingyin { font-size: 13px; color: #cfc2a4; }

.eq-affixes { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.eq-affixes li {
  display: grid;
  grid-template-columns: 18px 1fr auto 46px;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 2px 0;
}
.eq-affixes li:has(.eq-zhuanlv) { grid-template-columns: 18px 1fr auto 46px 42px; }
.eq-zhuanlv {
  font-size: 11px;
  text-align: center;
  color: #d9c9a4;
  border: 1px solid rgba(196, 158, 74, 0.5);
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  padding: 2px 0;
}
.eq-affixes .idx {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px;
  color: #e7d9b6;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(196, 158, 74, 0.45);
}
.eq-affixes .nm { color: #efe4cb; font-weight: 600; }
.eq-affixes .val { color: #fdf3dd; font-weight: 700; }
.eq-affixes .pct {
  font-size: 11px;
  text-align: center;
  border-radius: 4px;
  padding: 2px 0;
  border: 1px solid;
}
.lv-0 { color: #8fd18f; border-color: rgba(120, 200, 120, .5); background: rgba(60, 120, 60, .18); }
.lv-1 { color: #8fbcf0; border-color: rgba(90, 150, 220, .5); background: rgba(40, 80, 140, .18); }
.lv-2 { color: #c9a4f0; border-color: rgba(160, 120, 220, .5); background: rgba(90, 60, 130, .18); }
.lv-3 { color: #f0d888; border-color: rgba(220, 180, 80, .55); background: rgba(120, 90, 25, .22); }

.eq-recommend {
  font-size: 10px;
  color: #1a1a1a;
  background: #e2ba5c;
  border-radius: 3px;
  padding: 0 4px;
  margin-left: 5px;
  vertical-align: 1px;
}

.eq-mount { font-size: 13px; color: #cfc2a4; }

/* ---------------- 词条统计（胶囊） ---------------- */
.affix-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.affix-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px 6px 14px;
  font-size: 13px;
  line-height: 1;
}
.affix-pill-name { color: var(--text); }
.affix-pill-num {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------------- 调率 ---------------- */
.tl-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
}
.tl-field { display: flex; flex-direction: column; gap: 6px; min-width: 140px; }
.tl-field > span { font-size: 12px; color: var(--text-dim); letter-spacing: .5px; }
.tl-field select {
  padding: 9px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  min-width: 150px;
}
.tl-field select:focus { border-color: var(--gold); }
.tl-field-wide { flex: 1; min-width: 220px; }
.tl-field-wide select { width: 100%; }
.tl-actions { display: flex; gap: 8px; margin-left: auto; }

/* 方案摘要 */
.tl-summary { border-color: rgba(196, 158, 74, .35); }
.tl-summary-title {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 16px; font-weight: 700; color: #fdf3dd;
  margin-bottom: 10px;
}
.tl-badge {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid rgba(226, 186, 92, .55);
  color: #f0d888;
  background: rgba(120, 90, 25, .2);
  font-weight: 400;
}
.tl-summary-meta { font-size: 13px; color: var(--text-dim); line-height: 1.9; }
.tl-summary-meta b { color: var(--text); font-weight: 600; }
.tl-path {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: .5px;
  margin-bottom: 2px;
}

/* 命中总览 */
.tl-total {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-dim);
}
.tl-total .num { color: var(--gold); font-weight: 800; font-size: 20px; }
.tl-total .sep { color: var(--border); }
.tl-total .note { font-size: 12px; color: #6f7b87; margin-left: auto; }

/* 槽位卡片 */
.tl-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.tl-slots.collapsed .tl-affixes { display: none; }
.tl-slot {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.tl-slot-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.tl-slot-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.tl-slot-title img {
  width: 30px; height: 30px; border-radius: 6px;
  background: rgba(0,0,0,.3);
  border: 1px solid var(--border);
  object-fit: cover;
}
.tl-slot-meta { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.tl-chip {
  font-size: 11px;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
}
.tl-hit {
  font-size: 12px;
  font-weight: 700;
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
  border: 1px solid;
}
.tl-hit.ok { color: #7ee787; border-color: rgba(63,185,80,.45); background: rgba(63,185,80,.12); }
.tl-hit.part { color: #f0d888; border-color: rgba(226,186,92,.5); background: rgba(120,90,25,.18); }
.tl-hit.none { color: #ff9a94; border-color: rgba(248,81,73,.4); background: rgba(248,81,73,.1); }

.tl-affixes { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.tl-affixes li {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(0,0,0,.18);
}
.tl-affixes li.dy { background: rgba(120, 88, 24, .16); }
.tl-affixes .idx {
  width: 18px; height: 18px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.tl-affixes .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-affixes .dy-tag {
  font-size: 10px;
  color: #d9c9a4;
  border: 1px solid rgba(196,158,74,.45);
  border-radius: 3px;
  padding: 1px 5px;
  flex: none;
}
.tl-affixes .hit-ok, .tl-affixes .hit-no {
  font-size: 11px;
  border-radius: 4px;
  padding: 2px 8px;
  flex: none;
}
.tl-affixes .hit-ok { color: #7ee787; background: rgba(63,185,80,.12); border: 1px solid rgba(63,185,80,.3); }
.tl-affixes .hit-no { color: #8b98a5; background: rgba(139,152,165,.08); border: 1px solid rgba(139,152,165,.2); }
.tl-affixes .exp {
  font-size: 11px;
  color: #c9b58a;
  border: 1px solid rgba(196,158,74,.35);
  background: rgba(120,90,25,.12);
  border-radius: 4px;
  padding: 1px 6px;
  flex: none;
  white-space: nowrap;
}
.tl-affixes .extra {
  font-size: 11px;
  color: #6f7b87;
  border: 1px dashed rgba(139,152,165,.3);
  border-radius: 4px;
  padding: 1px 6px;
  flex: none;
  white-space: nowrap;
}

/* 未命中详情 */
.tl-unmatched { border-color: rgba(248, 81, 73, 0.35); }
.um-table { display: flex; flex-direction: column; gap: 6px; }
.um-head, .um-row {
  display: grid;
  grid-template-columns: 1fr 70px 70px 70px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.um-head {
  color: var(--text-dim);
  font-size: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.um-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-expect { color: var(--text-dim); }
.um-actual { color: #f0d888; font-weight: 700; }
.um-actual.zero { color: #6f7b87; }
.um-miss {
  color: #ff9a94;
  font-weight: 700;
  text-align: right;
  justify-self: end;
}

/* ---------------- 公式管理 ---------------- */
.plan-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.plan-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}
.plan-row .pname { font-weight: 700; }
.plan-row .pmeta { color: var(--text-dim); font-size: 12px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-row button {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 6px; padding: 3px 9px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.plan-row button:hover { color: var(--gold); border-color: var(--gold); }
.plan-row button.del:hover { color: var(--red); border-color: rgba(248,81,73,.5); }

.plan-form { border-top: 1px solid var(--border); padding-top: 18px; }
.form-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 150px; }
.form-field-wide { flex: 2; }
.form-field > span { font-size: 12px; color: var(--text-dim); }
.form-field input, .form-field select {
  padding: 9px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.form-field input:focus, .form-field select:focus { border-color: var(--gold); }

.plan-items-head {
  display: flex; align-items: baseline; gap: 10px;
  font-size: 13px; font-weight: 700; color: var(--gold);
  margin: 6px 0 10px;
}
.hint-inline { font-size: 12px; color: var(--text-dim); font-weight: 400; }
.plan-items { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.plan-item-row { display: flex; gap: 8px; align-items: center; }
.plan-item-row input[type="text"] {
  flex: 1;
  padding: 8px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.plan-item-row input[type="number"] {
  width: 78px;
  padding: 8px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.plan-item-row input:focus { border-color: var(--gold); }
.plan-item-row .item-del {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 6px; width: 32px; height: 34px; cursor: pointer; flex: none;
}
.plan-item-row .item-del:hover { color: var(--red); border-color: rgba(248,81,73,.5); }

.form-actions { display: flex; gap: 10px; margin-top: 16px; }
.btn-primary {
  background: linear-gradient(135deg, #e8c96a, var(--gold));
  border: none; border-radius: 8px;
  color: #1a1a1a; font-size: 13px; font-weight: 700;
  padding: 10px 20px; cursor: pointer; font-family: inherit;
}
.btn-primary:hover { box-shadow: 0 4px 18px rgba(212,175,55,.35); }

/* ---------------- 装备库 ---------------- */
.lib-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
}
.lib-toolbar .label { font-size: 13px; color: var(--text-dim); }
.lib-toolbar select {
  padding: 8px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  min-width: 140px;
}
.lib-toolbar select:focus { border-color: var(--gold); }
.lib-toolbar .spacer { margin-left: auto; }

.lib-rank-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.lib-rank-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 16px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.lib-rank-row:hover { border-color: var(--gold); }
.lib-rank-row.active { box-shadow: 0 0 0 1px var(--gold); border-color: var(--gold); }
.lib-rank-row.best { border-color: rgba(63,185,80,.45); }

.lib-rank-no {
  width: 28px; height: 28px; flex: none;
  display: grid; place-items: center;
  border-radius: 8px;
  font-size: 14px; font-weight: 700;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.lib-rank-row.best .lib-rank-no {
  background: rgba(63,185,80,.15);
  border-color: rgba(63,185,80,.4);
  color: #7ee787;
}
.lib-rank-info { flex: 1; min-width: 0; }
.lib-rank-name { font-size: 15px; font-weight: 700; }
.lib-rank-meta { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.lib-rank-rate {
  font-size: 20px; font-weight: 800; color: var(--gold);
  font-variant-numeric: tabular-nums;
  flex: none;
}
.lib-rank-row.best .lib-rank-rate { color: #7ee787; }

.lib-detail-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 16px; font-weight: 700;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.lib-detail-head .badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-weight: 400;
}
.lib-detail-head .badge.best {
  border-color: rgba(63,185,80,.4);
  color: #7ee787;
  background: rgba(63,185,80,.1);
}

.lib-plan-items { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.lib-plan-items .pi {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  color: var(--text-dim);
}
.lib-plan-items .pi b { color: var(--gold); font-weight: 700; }

/* ---------------- 我的仓库 ---------------- */
.wh-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.wh-actions { display: flex; gap: 8px; }

.wh-list { display: flex; flex-direction: column; gap: 8px; }
.wh-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}
.wh-row.in-use { border-color: rgba(63,185,80,.45); }
.wh-row .wh-slot {
  font-size: 11px;
  color: #c9b58a;
  border: 1px solid rgba(196,158,74,.4);
  border-radius: 4px;
  padding: 2px 7px;
  flex: none;
}
.wh-row .wh-name { font-weight: 700; }
.wh-row .wh-q { font-size: 11px; padding: 1px 7px; border-radius: 4px; }
.wh-row .wh-affixes {
  flex: 1; min-width: 160px;
  color: var(--text-dim); font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wh-row .wh-dy { font-size: 11px; color: #d9c9a4; }
.wh-row .wh-badge {
  font-size: 10px; color: #7ee787;
  border: 1px solid rgba(63,185,80,.4);
  background: rgba(63,185,80,.1);
  border-radius: 4px; padding: 1px 6px;
}
.wh-row button {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 6px; padding: 3px 9px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.wh-row button:hover { color: var(--gold); border-color: var(--gold); }
.wh-row button.del:hover { color: var(--red); border-color: rgba(248,81,73,.5); }

.wh-form { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 14px; }
.wh-empty { font-size: 13px; color: var(--text-dim); padding: 8px 0; }

@media (max-width: 640px) {
  .tl-toolbar { flex-direction: column; align-items: stretch; }
  .tl-actions { margin-left: 0; }
  .tl-slots { grid-template-columns: 1fr; }
  .tl-field select { width: 100%; }
}

.token-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.token-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}
.token-row .nm { font-weight: 700; min-width: 90px; }
.token-row .tk { color: var(--text-dim); font-size: 11px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, monospace; }
.token-row .st { font-size: 11px; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.st-ok { color: #7ee787; background: rgba(63, 185, 80, .14); }
.st-bad { color: #ff9a94; background: rgba(248, 81, 73, .14); }
.st-wait { color: var(--text-dim); background: rgba(139, 152, 165, .12); }
.token-row button {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.token-row button:hover { color: var(--red); border-color: rgba(248, 81, 73, .5); }

.row-actions { margin-top: 14px; }
.btn-ghost {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-ghost:disabled { opacity: .55; cursor: not-allowed; }

.add-form { display: flex; gap: 8px; flex-wrap: wrap; }
.add-form input {
  flex: 1; min-width: 140px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  font-family: inherit;
}
.add-form input:focus { border-color: var(--gold); }

/* ---------------- toast ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: rgba(22, 30, 40, 0.97);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 10px;
  z-index: 50;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .45);
  max-width: 90vw;
}

.foot {
  position: relative; z-index: 1;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  padding: 18px 20px 26px;
}

@media (max-width: 640px) {
  .topbar { padding: 14px; }
  .token-box { flex-wrap: wrap; }
  .token-box select { max-width: 100%; width: 100%; }
  .hero-right { gap: 12px; width: 100%; justify-content: space-between; }
  .stat-mini-value { font-size: 16px; }
  .equip-list { grid-template-columns: 1fr; }
  .tabs { padding: 0 12px; }
}
