:root {
  --bg: #eef6f5;
  --bg2: #ffffff;
  --card: #ffffff;
  --text: #0f1c24;
  --muted: #5e7a80;
  --line: #cfe3e1;
  --primary: #2aa7a0;
  --primary2: #1f8b85;
  --primary-soft: rgba(42, 167, 160, 0.14);
  --ok: #12b76a;
  --danger: #f04438;
  --warn: #f79009;
  --radius: 16px;
  --shadow: 0 8px 28px rgba(31, 139, 133, 0.12);
  --tab-h: 64px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: "PingFang SC", "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(900px 420px at 10% -10%, #cfeeee 0%, transparent 55%),
    radial-gradient(700px 360px at 100% 0%, #d9f3ef 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--tab-h) + 28px);
}
.wrap.narrow-pad { padding-top: 12px; }

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: url(/favicon.png) center/cover no-repeat, linear-gradient(145deg, var(--primary), var(--primary2));
  color: transparent;
  font-size: 0;
  box-shadow: 0 6px 16px rgba(42, 167, 160, 0.35);
}
.top-link {
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-soft);
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}
.hero {
  background: linear-gradient(160deg, #2aa7a0 0%, #1f8b85 55%, #0f1c24 100%);
  color: #fff;
  border-radius: 22px;
  padding: 22px 20px 24px;
  box-shadow: 0 14px 36px rgba(26, 95, 212, 0.28);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
}
.hero h1 {
  margin: 0 0 8px;
  font-size: 1.55rem;
  position: relative;
  z-index: 1;
}
.hero p {
  margin: 0;
  opacity: 0.92;
  font-size: 0.95rem;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}
.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}
.hero-stat {
  background: rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 12px;
}
.hero-stat .k { font-size: 0.75rem; opacity: 0.85; }
.hero-stat .v { font-size: 1.05rem; font-weight: 700; margin-top: 4px; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
}
.muted { color: var(--muted); font-size: 0.9rem; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 10px 0;
  box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; }
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.action-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  min-height: 92px;
}
.action-tile .ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.85rem;
}
.action-tile b { font-size: 0.98rem; }
.action-tile span { color: var(--muted); font-size: 0.8rem; }
.dl-list { display: flex; flex-direction: column; gap: 10px; }
.dl-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.dl-item b { display: block; font-size: 1rem; }
.dl-item span { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 3px; }
.dl-item .btn { width: auto; padding: 10px 16px; flex-shrink: 0; }

button, .btn, .nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 650;
  width: 100%;
  box-shadow: 0 8px 18px rgba(43, 127, 255, 0.25);
}
button.secondary, .btn.secondary, a.btn.secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--line);
  box-shadow: none;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
input, select {
  width: 100%;
  padding: 12px 14px;
  margin: 8px 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font: inherit;
  outline: none;
}
input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
label { font-size: 0.88rem; color: var(--muted); font-weight: 600; }
.err { color: var(--danger); white-space: pre-wrap; font-size: 0.9rem; }
.ok { color: var(--ok); font-size: 0.9rem; }
.hidden { display: none !important; }
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.price { color: var(--primary); font-weight: 800; }

/* 套餐卡片：把「折合每月」「省多少」直接摆出来，避免用户自己做除法 */
.per-month { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.per-month b { color: var(--primary); font-size: 14.5px; }
.save {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  color: #fff;
  background: var(--ok);
}
.tag-best {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #7a4b00;
  background: linear-gradient(135deg, #ffd479, #ffb347);
  vertical-align: middle;
}
.card.is-best { border: 1.5px solid #ffd479; }

/* 「常用软件」页：每条一行，右边一个「打开」，点整行即可跳转 */
.notice-warn { border-left: 4px solid var(--warn); }
.app-list { padding: 0; }
.app-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.app-list .app-row:last-child { border-bottom: 0; }
.app-row:active { background: var(--primary-soft); }
.app-main { min-width: 0; }
.app-name { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.app-desc { font-size: 12.5px; margin-top: 2px; }
.app-host { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.app-go {
  flex: none;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
}
.badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
}
.badge.ok { color: #fff; background: var(--ok); }
.badge.warn { color: #7a4b00; background: #ffe0a3; }

/* 客服浮标：默认只占右下角一个小圆钮，点开才展开面板。
   定位要用 --tab-h 抬到底部导航栏之上，否则会压住导航。
   没有导航栏的页面（如支付结果页）靠 --tab-h 留出一点余量也无妨。 */
.support-fab {
  position: fixed;
  right: 14px;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 14px);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.support-btn {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 6px 20px rgba(31, 139, 133, 0.38);
  cursor: pointer;
}
.support-btn:active { background: var(--primary2); }
.support-fab.open .support-btn { background: var(--primary2); }

.support-panel {
  width: min(76vw, 260px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  text-align: left;
}
.support-panel[hidden] { display: none; }
.support-panel-title { margin: 0 0 8px; font-weight: 700; }
.support-qq { margin: 0 0 10px; color: var(--muted); }
.support-qq b { color: var(--text); letter-spacing: 1px; font-size: 1.05rem; }
.support-copy { width: 100%; }
.support-help-link {
  display: block;
  margin-top: 10px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--primary);
  text-decoration: none;
}
.support-tip {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--ok);
  min-height: 1em;
  text-align: center;
}
.chip {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 16px;
  padding: 4px;
  background: #e8f1fb;
  border-radius: 14px;
}
.tabs button {
  margin: 0;
  width: 100%;
  box-shadow: none;
  background: transparent;
  color: var(--muted);
}
.tabs button.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(26, 95, 212, 0.12);
}

/* Bottom tab bar — 白鲸式底部导航 */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  z-index: 50;
}
.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  width: auto;
  padding: 6px 4px;
}
.tabbar a .ti {
  font-size: 1.15rem;
  line-height: 1;
}
.tabbar a.active {
  color: var(--primary);
  background: var(--primary-soft);
}
.page-title {
  margin: 0 0 6px;
  font-size: 1.45rem;
  font-weight: 800;
}
textarea.export-box {
  width: 100%;
  min-height: 140px;
  margin-top: 10px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f7fbff;
  color: var(--text);
}
@media (min-width: 720px) {
  .wrap { padding-top: 28px; }
}
