:root {
  --brand: #14507a;
  --brand-2: #1d7fb8;
  --accent: #e8873a;
  --bg: #f4f6f9;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #1f2937;
  --text-2: #64748b;
  --ok: #15803d;
  --warn: #b91c1c;
  --radius: 10px;
}

* { box-sizing: border-box; }

html {
  background: #05070f;
}

body {
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* ---------- 页头 ---------- */
.topbar {
  background: linear-gradient(120deg, rgba(10,32,52,.94) 0%, rgba(16,58,88,.92) 45%, rgba(24,96,150,.9) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  padding: 0;
  border-bottom: 1px solid rgba(120,190,255,.22);
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px 0;
}
.brand-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 12px;
}
.brand-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .5px;
  margin: 0;
}
.brand-sub { font-size: 12.5px; color: rgba(255,255,255,.72); }

.mainnav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-bottom: 0;
}
.mainnav a {
  padding: 10px 13px;
  font-size: 13.5px;
  color: rgba(255,255,255,.82);
  border-radius: 8px 8px 0 0;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.mainnav a:hover { color: #fff; background: rgba(255,255,255,.09); }
.mainnav a.on { color: #fff; background: rgba(255,255,255,.14); border-bottom-color: var(--accent); font-weight: 600; }
.mainnav a.pending::after {
  content: "待配置";
  font-size: 10px;
  margin-left: 5px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(232,135,58,.9);
  color: #fff;
  vertical-align: 2px;
}

/* ---------- 子页面分类导航 ---------- */
.subnav {
  background: rgba(255,255,255,.93);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(120,190,255,.28);
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.subnav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
}
.subnav a {
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-2);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.subnav a:hover { color: var(--brand); }
.subnav a.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ---------- 通用容器 ---------- */
.wrap {
  max-width: 1280px;
  margin: 26px auto 40px;
  padding: 22px 26px 40px;
  background: rgba(255,255,255,.965);
  border: 1px solid rgba(140,200,255,.25);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.04) inset;
  backdrop-filter: blur(4px);
}
.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 20px; margin: 0 0 6px; }
.page-head p { margin: 0; color: var(--text-2); font-size: 13px; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
}

/* ---------- 首页入口 ---------- */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.entry {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  transition: .15s;
  display: block;
}
.entry:hover { border-color: var(--brand-2); box-shadow: 0 4px 14px rgba(20,80,122,.1); transform: translateY(-1px); }
.entry h3 { margin: 0 0 6px; font-size: 16px; color: var(--brand); }
.entry p { margin: 0; font-size: 13px; color: var(--text-2); }
.entry .tag {
  display: inline-block; margin-top: 10px; font-size: 11px;
  padding: 2px 7px; border-radius: 4px; background: #eef4fa; color: var(--brand);
}
.entry .tag.pending { background: #fdf1e5; color: #b06010; }
.entry .tag.ext { background: #e6f4ec; color: #137a4a; }

/* ---------- 分类卡片（title.html） ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.cat-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: block; transition: .15s;
}
.cat-card:hover { border-color: var(--brand-2); box-shadow: 0 4px 14px rgba(20,80,122,.1); transform: translateY(-1px); }
.cat-card h3 { margin: 0 0 4px; font-size: 17px; }
.cat-card .cn { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.cat-card .num { font-size: 12px; color: var(--brand); background: #eef4fa; display: inline-block; padding: 3px 8px; border-radius: 4px; }

/* ---------- 词槽 ---------- */
.slot { margin-bottom: 14px; }
.slot-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.slot-name {
  font-size: 14px; font-weight: 600; color: var(--brand);
  padding-left: 9px; border-left: 3px solid var(--brand-2);
}
.slot-count { font-size: 12px; color: var(--text-2); }
.slot-toggle { margin-left: auto; font-size: 12px; color: var(--brand-2); cursor: pointer; user-select: none; }
.slot-toggle:hover { text-decoration: underline; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  border: 1px solid var(--line); background: #fbfcfe; color: var(--text);
  padding: 5px 11px; border-radius: 15px; font-size: 13px; cursor: pointer;
  transition: .12s; user-select: none; line-height: 1.4;
}
.chip:hover { border-color: var(--brand-2); color: var(--brand); }
.chip.on {
  background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500;
}
.chip .star { color: var(--accent); margin-left: 3px; font-size: 11px; }
.chip.on .star { color: #ffd7b0; }
.chip .cnt { font-size: 10px; opacity: .55; margin-left: 4px; }

/* ---------- 底部操作条 ---------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(15,61,94,.08);
}
.actionbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 11px 24px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.sel-info { font-size: 13px; color: var(--text-2); }
.sel-info b { color: var(--brand); font-size: 15px; }

.btn {
  border: none; border-radius: 8px; padding: 9px 20px; font-size: 14px;
  cursor: pointer; font-family: inherit; transition: .15s;
}
.btn-main { background: var(--brand); color: #fff; font-weight: 600; }
.btn-main:hover { background: var(--brand-2); }
.btn-main:disabled { background: #b9c6d2; cursor: not-allowed; }
.btn-ghost { background: #eef2f7; color: var(--text-2); }
.btn-ghost:hover { background: #e2e8f0; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

.opt { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.opt input { accent-color: var(--brand); }

/* ---------- 生成结果 ---------- */
.results { margin-top: 6px; }
.result {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand-2);
  border-radius: 8px; padding: 14px 16px; margin-bottom: 11px;
}
.result.bad { border-left-color: var(--warn); }
.result-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 7px; flex-wrap: wrap;
}
.result-no {
  font-size: 12px; font-weight: 700; color: #fff; background: var(--brand-2);
  width: 20px; height: 20px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center;
}
.result-len { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #eef4fa; color: var(--brand); }
.result-len.warn { background: #fdeaea; color: var(--warn); }
.result-text {
  font-size: 15px; line-height: 1.65; word-break: break-word;
  font-family: "Segoe UI", Arial, sans-serif;
}
.result-text mark { background: #fff3d6; padding: 0 1px; border-radius: 2px; }
.result-foot { margin-top: 9px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.auto-note { font-size: 12px; color: var(--text-2); }

.empty {
  text-align: center; color: var(--text-2); font-size: 13px;
  padding: 34px 10px; border: 1px dashed var(--line); border-radius: 8px; background: #fbfcfe;
}
.hint { font-size: 12px; color: var(--text-2); margin-top: 8px; }
.alert {
  background: #fdf1e5; border: 1px solid #f3d0ab; color: #8a4a08;
  padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px;
}

/* ---------- 占位页 ---------- */
.placeholder {
  text-align: center; padding: 70px 20px; color: var(--text-2);
}
.placeholder h2 { color: var(--text); font-size: 18px; margin: 0 0 10px; }
.placeholder .badge {
  display: inline-block; background: #fdf1e5; color: #b06010;
  padding: 3px 10px; border-radius: 4px; font-size: 12px; margin-bottom: 16px;
}

footer.site-foot {
  text-align: center; font-size: 12px; color: rgba(200,225,255,.62);
  padding: 4px 24px 34px;
}

@media (max-width: 720px) {
  .brand-title { font-size: 19px; }
  .wrap { padding: 16px 14px 150px; }
  .mainnav a, .subnav a { padding: 9px 11px; font-size: 13px; }
  .chip { font-size: 12px; padding: 4px 9px; }
}



/* ---------- 动态星空背景 ---------- */
#space-bg {
  position: fixed;
  left: 0; top: 0;
  width: 100%; height: 100%;
  z-index: -1;
  pointer-events: none;
  display: block;
}

/* ---------- 点击红心 ---------- */
.click-heart {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
  animation: heartPop 1s cubic-bezier(.22,.61,.36,1) forwards;
  filter: drop-shadow(0 3px 8px rgba(225,29,72,.55));
}
@keyframes heartPop {
  0%   { transform: translate(-50%,-50%) scale(.35) rotate(var(--rot, 0deg)); opacity: 0; }
  18%  { transform: translate(-50%,-58%) scale(1.18) rotate(var(--rot, 0deg)); opacity: 1; }
  60%  { transform: translate(calc(-50% + var(--dx, 0px)), -110%) scale(1.02) rotate(var(--rot, 0deg)); opacity: .92; }
  100% { transform: translate(calc(-50% + var(--dx, 0px)), -190%) scale(.72) rotate(var(--rot, 0deg)); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .click-heart { animation-duration: .45s; }
}

/* 深色背景下的细节修正 */
.page-head h1 { color: #0f3d5e; }
.panel { background: rgba(255,255,255,.9); }
.chip { background: rgba(248,251,255,.95); }
.placeholder h2 { color: #0f3d5e; }



/* ---------- 必选核心词 ---------- */
.chip.locked {
  background: #14507a;
  border-color: #14507a;
  color: #fff;
  font-weight: 600;
  cursor: not-allowed;
  box-shadow: 0 0 0 2px rgba(20,80,122,.12);
}
.chip.locked:hover { background: #14507a; color: #fff; }
.chip.locked .reqb {
  font-size: 10px;
  margin-left: 5px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255,255,255,.92);
  color: #14507a;
  vertical-align: 1px;
  font-weight: 700;
}
.chip.locked .cnt { opacity: .55; }
.chip.flash { animation: chipShake .3s ease; }
@keyframes chipShake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

/* ---------- 运费查询 ---------- */
.fx-form {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}
.fx-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.fx-field span { font-weight: 600; color: var(--brand); }
.fx-field select, .fx-field input {
  min-width: 220px;
  padding: 9px 11px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}
.fx-field input { min-width: 130px; }
.fx-field select:focus, .fx-field input:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(29,127,184,.12);
}
.fx-notes {
  font-size: 12.5px;
  color: var(--text-2);
  background: #f6f9fc;
  border-left: 3px solid #c9dcf0;
  border-radius: 6px;
  padding: 10px 12px;
  margin: 6px 0 14px;
  line-height: 1.7;
}
.fx-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.fx-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fbfdff;
}
.fx-card.fx-na { background: #f8f9fa; opacity: .72; }
.fx-name { font-size: 13px; font-weight: 600; color: var(--brand); margin-bottom: 6px; }
.fx-price { font-size: 24px; font-weight: 700; color: var(--accent); line-height: 1.2; }
.fx-card.fx-na .fx-price { color: #9aa7b4; }
.fx-desc { font-size: 12px; color: var(--text-2); margin-top: 6px; line-height: 1.6; }
.fx-note { font-size: 11.5px; color: #8a97a5; margin-top: 6px; line-height: 1.6; }
.fx-fee {
  margin-top: 12px;
  font-size: 12.5px;
  color: #8a4a08;
  background: #fdf1e5;
  padding: 8px 12px;
  border-radius: 6px;
}

/* 欧元手续费角标 */
.fx-eur {
  font-size: 12px;
  font-weight: 600;
  color: #8a4a08;
  background: #fdf1e5;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: 4px;
}
