/* =========================================================
   DSF (Digital Service Finder) — Overseas digital tools & virtual services
   First-version static site styles
   ========================================================= */

:root {
  --bg: #f5f6fb;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e5e9f2;
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --brand-soft: #eef0fe;
  --cyan: #06b6d4;
  --ok: #15803d;
  --ok-soft: #ecfdf3;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --risk: #dc2626;
  --risk-soft: #fef2f2;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .16);
  --header-h: 64px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

/* 视觉隐藏（供屏幕阅读器 / SEO 使用） */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 9px 16px; font-size: 14px; font-weight: 600;
  transition: all .18s ease; white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(79, 70, 229, .35); }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover { background: #e2e5fd; }
.btn-danger-soft { background: var(--risk-soft); color: var(--risk); }
.btn-danger-soft:hover { background: #fee2e2; }
.btn-block { width: 100%; }
.btn-lg { padding: 12px 22px; font-size: 15px; border-radius: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 18px; height: var(--header-h); }

.logo { display: flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 17px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(79, 70, 229, .35);
}
.logo b { color: var(--brand); }

.main-nav { display: flex; gap: 4px; margin-left: 8px; }
.main-nav a {
  padding: 7px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: #334155;
}
.main-nav a:hover { background: var(--brand-soft); color: var(--brand); }

.header-search { flex: 1; max-width: 360px; margin-left: auto; position: relative; }
.header-search input {
  width: 100%; padding: 8px 12px 8px 34px;
  border: 1px solid var(--line); border-radius: 10px; background: #f8fafc;
  outline: none; transition: border .15s;
}
.header-search input:focus { border-color: var(--brand); background: #fff; }
.header-search .s-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 14px; pointer-events: none;
}

.header-actions { display: flex; align-items: center; gap: 10px; }

.lang-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 7px 11px; font-size: 13px; font-weight: 600; color: #334155;
  transition: all .15s;
}
.lang-btn:hover { border-color: var(--brand); color: var(--brand); }

.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 5px; border-radius: 999px;
  background: var(--brand-soft); font-size: 13px; font-weight: 600; color: var(--brand);
}
.user-chip .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--cyan));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
}

/* ---------- Demo notice ---------- */
.demo-bar {
  background: #0f172a; color: #cbd5e1; font-size: 12.5px; text-align: center;
  padding: 6px 14px;
}
.demo-bar b { color: #fff; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 400px at 15% -10%, rgba(79, 70, 229, .5), transparent 60%),
    radial-gradient(700px 400px at 95% 10%, rgba(6, 182, 212, .35), transparent 60%),
    linear-gradient(160deg, #0b1023 0%, #171b3d 55%, #1d1a4b 100%);
  color: #fff;
  padding: 72px 0 84px;
}
.hero h1 {
  font-size: clamp(28px, 4.4vw, 46px); font-weight: 800; letter-spacing: -1px;
  line-height: 1.18; max-width: 720px; margin: 0 auto 16px; text-align: center;
}
.hero .sub {
  color: #c7d0e8; font-size: clamp(14px, 1.6vw, 17px); text-align: center;
  max-width: 640px; margin: 0 auto 32px;
}
.hero-search { display: flex; max-width: 620px; margin: 0 auto 18px; gap: 10px; }
.hero-search input {
  flex: 1; padding: 14px 18px; border-radius: 13px; border: none;
  font-size: 15px; outline: none; box-shadow: var(--shadow-lg); min-width: 0;
}
.hero-search .btn { border-radius: 13px; }

.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 36px; }
.hero-chips a {
  font-size: 12.5px; font-weight: 500; color: #dbe4ff;
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px;
  padding: 5px 13px; transition: all .15s;
}
.hero-chips a:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.hero-stats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 44px;
  max-width: 860px; margin: 0 auto;
}
.hero-stats .stat { text-align: center; }
.hero-stats .num { font-size: 22px; font-weight: 800; color: #fff; }
.hero-stats .lab { font-size: 12.5px; color: #9aa7cc; margin-top: 2px; }

/* ---------- Sections ---------- */
.section { padding: 52px 0 8px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 22px;
}
.section-head h2 { font-size: 22px; font-weight: 800; letter-spacing: -.4px; }
.section-head .more { font-size: 13.5px; font-weight: 600; color: var(--brand); }
.section-head .more:hover { text-decoration: underline; }
.section-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ---------- Category grid ---------- */
.cat-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px;
}
.cat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px; box-shadow: var(--shadow); cursor: pointer;
  transition: transform .18s ease, border-color .18s ease; position: relative;
}
.cat-card:hover { transform: translateY(-3px); border-color: #c7cdf8; }
.cat-icon {
  width: 42px; height: 42px; border-radius: 12px; font-size: 21px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.tint-1 { background: #eef0fe; } .tint-2 { background: #ecfeff; } .tint-3 { background: #f0fdf4; }
.tint-4 { background: #fff7ed; } .tint-5 { background: #fdf2f8; } .tint-6 { background: #fef2f2; }
.cat-card h3 { font-size: 14.5px; font-weight: 700; line-height: 1.35; }
.cat-card p { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.cat-hot {
  position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 700;
  color: var(--warn); background: var(--warn-soft); border-radius: 999px; padding: 2px 8px;
}

/* ---------- Service cards ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.svc-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .18s ease, border-color .18s ease; cursor: pointer;
}
.svc-card:hover { transform: translateY(-3px); border-color: #c7cdf8; }
.svc-thumb {
  height: 128px; display: flex; align-items: center; justify-content: center;
  font-size: 44px; position: relative;
}
.g1 { background: linear-gradient(135deg, #6366f1, #a5b4fc); }
.g2 { background: linear-gradient(135deg, #06b6d4, #67e8f9); }
.g3 { background: linear-gradient(135deg, #f59e0b, #fcd34d); }
.g4 { background: linear-gradient(135deg, #ec4899, #f9a8d4); }
.g5 { background: linear-gradient(135deg, #10b981, #6ee7b7); }
.g6 { background: linear-gradient(135deg, #8b5cf6, #c4b5fd); }
.svc-body { padding: 14px 16px 12px; display: flex; flex-direction: column; flex: 1; }
.svc-body h3 {
  font-size: 14.5px; font-weight: 700; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.8em;
}
.svc-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip {
  font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 9px;
  background: var(--brand-soft); color: var(--brand);
}
.chip-gray { background: #f1f5f9; color: var(--muted); }
.svc-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line);
}
.svc-price { font-size: 15px; font-weight: 800; color: var(--ink); }
.svc-price .free { color: var(--ok); }
.like-btn {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 4px 11px; font-size: 12.5px; font-weight: 600; color: #475569;
  transition: all .15s;
}
.like-btn:hover { border-color: #fda4af; color: var(--risk); }
.like-btn.liked { background: var(--risk-soft); border-color: #fecdd3; color: var(--risk); }

.sec-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; border-radius: 6px; padding: 2px 8px;
}
.sec-ok { background: var(--ok-soft); color: var(--ok); }
.sec-watch { background: var(--warn-soft); color: var(--warn); }

/* ---------- 服务板块滚动框：最多三行，内部滚轮滚动（带可见面板边框） ---------- */
:root { --svc-row: 278px; --svc-panel: #f7f8fd; }

.svc-scroll-wrap {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--svc-panel);
  padding: 14px 10px 14px 12px;
  box-shadow: var(--shadow);
}
.svc-scroll {
  height: calc(3 * var(--svc-row) + 2 * 16px);  /* 固定三行高：内容不足时下方留空，超出时内部滚动 */
  overflow-y: auto;
  padding: 0 14px 0 2px;   /* 右侧给自绘滚动条留位 */
  scrollbar-width: none;   /* 隐藏原生滚动条，用自绘条（始终可见） */
  overscroll-behavior: contain;
}
.svc-scroll::-webkit-scrollbar { display: none; }
.svc-scroll .svc-grid { grid-auto-rows: var(--svc-row); }

/* 类目子页面：滚动框占满一屏（减去头部与标题区高度） */
.svc-scroll.full {
  height: calc(100vh - 265px);
  min-height: 420px;
}

/* 自绘滚动条：轨道常驻右侧，滑块可拖动 */
.svc-bar {
  position: absolute; top: 14px; bottom: 14px; right: 5px; width: 6px;
  background: #e8ebf8; border-radius: 6px;
}
.svc-bar-thumb {
  position: absolute; left: 0; top: 0; width: 100%;
  background: #a5b4fc; border-radius: 6px; cursor: pointer;
}
.svc-bar-thumb:hover, .svc-bar-thumb.dragging { background: #818cf8; }

/* 底部渐隐提示（可滚动且未到底时显示） */
.svc-fade {
  position: absolute; left: 12px; right: 20px; bottom: 14px; height: 38px;
  background: linear-gradient(180deg, rgba(247, 248, 253, 0), var(--svc-panel));
  pointer-events: none; opacity: 0; transition: opacity .2s;
}
.svc-scroll-wrap.can-scroll .svc-fade { opacity: 1; }
.svc-scroll-wrap.at-bottom .svc-fade { opacity: 0; }

@media (max-width: 640px) {
  :root { --svc-row: 264px; }  /* 小屏卡片略矮（thumb 相同，字号更紧凑） */
}
/* ---------- Search results ---------- */
.results-wrap { display: none; }
.results-wrap.show { display: block; }
.results-count { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.empty {
  background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 42px 20px; text-align: center; color: var(--muted);
}

/* ---------- Safety section ---------- */
.safety-band { padding: 60px 0; }
.safety-panel {
  background: linear-gradient(160deg, #10143a, #1b1f52);
  border-radius: 22px; color: #fff; padding: 44px 40px;
}
.safety-panel h2 { font-size: 24px; font-weight: 800; letter-spacing: -.4px; }
.safety-panel .lead { color: #b9c3e6; font-size: 14.5px; margin: 10px 0 28px; max-width: 640px; }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.step {
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px; padding: 16px 14px;
}
.step .n {
  display: inline-flex; width: 26px; height: 26px; border-radius: 8px;
  background: rgba(99, 102, 241, .35); color: #c7d2fe;
  align-items: center; justify-content: center; font-size: 12.5px; font-weight: 800;
  margin-bottom: 10px;
}
.step h4 { font-size: 13.5px; font-weight: 700; margin-bottom: 5px; }
.step p { font-size: 12px; color: #aab4d8; line-height: 1.55; }

.disclaimer {
  margin: 34px 0 0; padding: 14px 16px; border-radius: 12px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
  color: #aab4d8; font-size: 12.5px; line-height: 1.7;
}

/* ---------- 类目子页面 ---------- */
.sub-hero { padding: 34px 0 4px; }
.sub-hero .crumb { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.sub-hero .crumb a { color: var(--brand); font-weight: 600; }
.sub-hero .crumb a:hover { text-decoration: underline; }
.sub-hero h1 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -.5px; }
.sub-hero .sub-desc { color: var(--muted); font-size: 14px; margin-top: 6px; }
.sub-hero .sub-count { display: inline-block; margin-top: 10px; font-size: 12.5px; font-weight: 700; color: var(--brand); background: var(--brand-soft); border-radius: 999px; padding: 3px 12px; }

.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 24px; }
.cat-chips a {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 6px 13px; font-size: 13px; font-weight: 600; color: #334155;
  transition: all .15s;
}
.cat-chips a:hover { border-color: var(--brand); color: var(--brand); }
.cat-chips a.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 3px 10px rgba(79, 70, 229, .3); }

/* 分批显示：加载更多 */
.svc-card.hidden-batch { display: none; }
.load-more { display: flex; justify-content: center; margin: 26px 0 54px; }

/* ---------- Detail page ---------- */
.page-title { font-size: 24px; font-weight: 800; letter-spacing: -.4px; margin: 30px 0 20px; }
.detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; padding-bottom: 50px; }

.detail-main { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.detail-hero { height: 240px; display: flex; align-items: center; justify-content: center; font-size: 84px; }
.detail-body { padding: 26px 28px; }
.detail-body h1 { font-size: 22px; font-weight: 800; letter-spacing: -.4px; line-height: 1.35; }
.detail-body .desc { color: var(--muted); font-size: 14.5px; margin-top: 14px; }
.detail-body .long { margin-top: 18px; font-size: 14.5px; color: #334155; line-height: 1.8; }
.detail-body .long p + p { margin-top: 10px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }

.detail-side { display: flex; flex-direction: column; gap: 16px; }
.price-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.price-card .price { font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.price-card .price .free { color: var(--ok); }
.price-card .btns { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.meta-list { display: grid; gap: 9px; margin-top: 16px; }
.meta-list .row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.meta-list .k { color: var(--muted); }
.meta-list .v { font-weight: 600; text-align: right; }

.side-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; }
.side-card h3 { font-size: 14.5px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 7px; }
.side-card p { font-size: 13px; color: var(--muted); }

.not-found { padding: 80px 20px; text-align: center; color: var(--muted); }

/* ---------- Forms (publish / login) ---------- */
.form-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; padding-bottom: 50px; }
.form-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; }
.form-card h1 { font-size: 21px; font-weight: 800; letter-spacing: -.4px; margin-bottom: 6px; }
.form-card .hint { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field label .req { color: var(--risk); }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: #f8fafc; outline: none;
  transition: border .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); background: #fff; }
.field textarea { min-height: 110px; resize: vertical; }
.field .err { display: none; color: var(--risk); font-size: 12px; margin-top: 5px; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--risk); }
.field.invalid .err { display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-note { font-size: 12px; color: var(--muted); margin-top: 6px; }

.tips-card h3 { font-size: 14.5px; font-weight: 700; margin-bottom: 12px; }
.tips-card ul { list-style: none; display: grid; gap: 12px; }
.tips-card li { font-size: 13px; color: var(--muted); padding-left: 26px; position: relative; line-height: 1.6; }
.tips-card li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  width: 18px; height: 18px; border-radius: 6px; background: var(--ok-soft); color: var(--ok);
  font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.success-box { text-align: center; padding: 40px 20px; }
.success-box .big { font-size: 52px; margin-bottom: 12px; }
.success-box h2 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.success-box p { color: var(--muted); font-size: 14px; max-width: 440px; margin: 0 auto 20px; }
.pending-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--warn-soft); color: var(--warn); font-weight: 700; font-size: 13px;
  border-radius: 999px; padding: 7px 16px; margin-bottom: 18px;
}

.login-wrap { max-width: 430px; margin: 46px auto 70px; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 34px 32px; }
.login-tabs { display: flex; background: #f1f5f9; border-radius: 11px; padding: 4px; margin-bottom: 24px; }
.login-tabs button {
  flex: 1; border: none; background: transparent; border-radius: 8px;
  padding: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted);
}
.login-tabs button.active { background: #fff; color: var(--brand); box-shadow: 0 1px 4px rgba(15, 23, 42, .12); }
.login-alt { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 16px; }

/* ---------- 注册协议与隐私政策 ---------- */
.agree-box {
  margin-top: 16px; padding: 16px 18px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow);
}
.agree-box .agree-title { font-size: 13.5px; font-weight: 700; margin-bottom: 10px; }
.agree-line {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 13px; color: #334155; padding: 5px 0; cursor: pointer; line-height: 1.55;
}
.agree-line input { width: 16px; height: 16px; margin-top: 1px; flex: none; accent-color: var(--brand); cursor: pointer; }
.agree-line a { color: var(--brand); font-weight: 600; }
.agree-line a:hover { text-decoration: underline; }
.agree-note { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.6; }

.legal-sec {
  margin-top: 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
}
.legal-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #fff; border: none; padding: 15px 18px;
  font-size: 14px; font-weight: 700; color: var(--ink); text-align: left;
}
.legal-toggle:hover { color: var(--brand); }
.legal-toggle .arrow { transition: transform .18s; color: var(--muted); font-size: 12px; }
.legal-sec.open .legal-toggle .arrow { transform: rotate(90deg); }
.legal-body {
  display: none; max-height: 460px; overflow-y: auto;
  padding: 4px 20px 20px; border-top: 1px solid var(--line);
}
.legal-sec.open .legal-body { display: block; }
.legal-body h4 { font-size: 15px; font-weight: 800; margin: 14px 0 4px; }
.legal-body .legal-meta { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.legal-body h5 { font-size: 13.5px; font-weight: 700; margin: 16px 0 6px; color: var(--brand-dark); }
.legal-body p { font-size: 13px; color: #334155; line-height: 1.75; margin: 6px 0; }
.legal-body ul { margin: 6px 0 6px 18px; }
.legal-body li { font-size: 13px; color: #334155; line-height: 1.7; }
.legal-body .legal-contact { margin-top: 14px; padding: 10px 12px; background: var(--brand-soft); border-radius: 10px; font-size: 13px; }

/* ---------- Redirect (leaving site) page ---------- */
.redirect-wrap { max-width: 560px; margin: 60px auto 90px; }
.redirect-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-lg); padding: 38px 36px; text-align: center;
}
.redirect-card .warn-ico {
  width: 62px; height: 62px; margin: 0 auto 18px; border-radius: 18px;
  background: var(--warn-soft); color: var(--warn); font-size: 30px;
  display: flex; align-items: center; justify-content: center;
}
.redirect-card h1 { font-size: 20px; font-weight: 800; margin-bottom: 10px; }
.redirect-card p { color: var(--muted); font-size: 14px; }
.target-box {
  margin: 20px 0; padding: 13px 16px; border-radius: 12px; background: #f8fafc;
  border: 1px solid var(--line); font-size: 14px; font-weight: 700;
  word-break: break-all; color: var(--brand);
}
.redirect-note { font-size: 12.5px; color: var(--muted); text-align: left; background: var(--warn-soft); border-radius: 10px; padding: 12px 14px; margin: 18px 0 22px; line-height: 1.7; }
.redirect-btns { display: flex; gap: 12px; }
.redirect-btns .btn { flex: 1; }

/* ---------- Footer ---------- */
.site-footer { background: #0b1023; color: #94a0c4; margin-top: 60px; }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 30px;
  padding: 46px 0 34px;
}
.footer-grid h4 { color: #fff; font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.footer-grid ul { list-style: none; display: grid; gap: 9px; }
.footer-grid a { font-size: 13px; }
.footer-grid a:hover { color: #fff; }
.footer-about p { font-size: 13px; line-height: 1.7; margin-top: 12px; max-width: 320px; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .08); padding: 18px 0;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12.5px;
}

/* ---------- Modal & toast ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(10, 14, 34, .55);
  display: none; align-items: center; justify-content: center; z-index: 90; padding: 18px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg);
  width: min(480px, 100%); max-height: 86vh; overflow: auto; padding: 28px;
}
.modal h3 { font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.modal .modal-sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.modal-close {
  float: right; border: none; background: #f1f5f9; color: var(--muted);
  width: 30px; height: 30px; border-radius: 9px; font-size: 14px; line-height: 1;
}
.modal-close:hover { background: #e2e8f0; color: var(--ink); }
.modal-btns { display: flex; gap: 10px; margin-top: 20px; }
.modal-btns .btn { flex: 1; }

#dm-toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%) translateY(-8px);
  background: #0f172a; color: #fff; font-size: 13.5px; font-weight: 600;
  border-radius: 999px; padding: 9px 20px; z-index: 200;
  opacity: 0; pointer-events: none; transition: all .25s ease;
  box-shadow: var(--shadow-lg); max-width: calc(100vw - 40px); text-align: center;
}
#dm-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================
   翻译球（右上角） Translation ball — top-right corner
   位置可通过 --tb-top / --tb-right 调整
   ========================================================= */
:root {
  --tb-top: calc(var(--header-h) + 14px);  /* 头部下方 */
  --tb-right: 20px;
  --tb-size: 54px;
}

#dm-tranball {
  position: fixed; top: var(--tb-top); right: var(--tb-right);
  width: var(--tb-size); height: var(--tb-size); z-index: 120;
  border-radius: 50%; border: none;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(79, 70, 229, .45), 0 0 0 4px rgba(79, 70, 229, .12);
  transition: transform .18s ease, box-shadow .18s ease;
}
#dm-tranball:hover { transform: scale(1.07); }
#dm-tranball svg { width: 26px; height: 26px; }
#dm-tranball.spin svg { animation: tb-rotate 1.1s linear infinite; }
@keyframes tb-rotate { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #dm-tranball.spin svg { animation: none; } }

#dm-tranball .tb-code {
  position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%);
  background: #fff; color: #1e293b; font-size: 10px; font-weight: 800;
  border-radius: 999px; padding: 1px 7px; box-shadow: 0 1px 4px rgba(15, 23, 42, .25);
  letter-spacing: .3px;
}

#dm-tranpanel {
  position: fixed; top: calc(var(--tb-top) + var(--tb-size) + 14px); right: var(--tb-right);
  width: min(344px, calc(100vw - 28px)); max-height: min(560px, calc(100vh - 160px));
  background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg);
  z-index: 120; display: none; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line);
  animation: tb-pop .18s ease;
}
#dm-tranpanel.open { display: flex; }
@keyframes tb-pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.tbp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--line);
}
.tbp-head .t { font-size: 14.5px; font-weight: 800; }
.tbp-head .t small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.tbp-close {
  border: none; background: #f1f5f9; color: var(--muted); width: 28px; height: 28px;
  border-radius: 8px; font-size: 13px;
}
.tbp-close:hover { background: #e2e8f0; color: var(--ink); }

.tbp-search { padding: 12px 14px 4px; }
.tbp-search input {
  width: 100%; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 9px; outline: none; background: #f8fafc; font-size: 13px;
}
.tbp-search input:focus { border-color: var(--brand); background: #fff; }

.tbp-list { overflow-y: auto; padding: 10px 12px 6px; }
.tbp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tbp-item {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid transparent; background: #f8fafc; border-radius: 10px;
  padding: 8px 10px; font-size: 13px; font-weight: 600; color: #334155;
  text-align: left; transition: all .12s;
}
.tbp-item:hover { background: var(--brand-soft); color: var(--brand); }
.tbp-item.active { background: var(--brand); color: #fff; box-shadow: 0 3px 10px rgba(79, 70, 229, .35); }
.tbp-item .code {
  flex: none; width: 30px; height: 22px; border-radius: 6px;
  background: #e8ecf7; color: #475569; font-size: 10.5px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; letter-spacing: .3px;
}
.tbp-item.active .code { background: rgba(255, 255, 255, .25); color: #fff; }
.tbp-item .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbp-empty { text-align: center; color: var(--muted); font-size: 12.5px; padding: 14px 0; }

.tbp-foot { border-top: 1px solid var(--line); padding: 10px 14px 12px; display: grid; gap: 8px; }
.tbp-reset {
  border: 1px dashed var(--line); background: #fff; border-radius: 9px;
  padding: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.tbp-reset:hover { color: var(--brand); border-color: var(--brand); }
.tbp-tip { font-size: 11px; color: #94a3b8; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .svc-grid { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .main-nav { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .detail-grid { grid-template-columns: 1fr; }
  .form-wrap { grid-template-columns: 1fr; }
  .header-search { display: none; }
  .lang-btn span { display: none; }
}
@media (max-width: 640px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .svc-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr 1fr; }
  .hero { padding: 48px 0 60px; }
  .hero-search { flex-direction: column; }
  .hero-search .btn { width: 100%; }
  .header-actions .btn-ghost { display: none; }
  .safety-panel { padding: 30px 20px; }
  .form-row { grid-template-columns: 1fr; }
  .redirect-btns { flex-direction: column; }
  :root { --tb-size: 48px; --tb-right: 12px; }
  #dm-tranpanel { top: calc(var(--tb-top) + var(--tb-size) + 10px); }
}
@media (max-width: 420px) {
  .svc-grid { grid-template-columns: 1fr; }
}
