:root {
  --bg: #f5f8fc;
  --bg-elev: #ffffff;
  --bg-soft: #eef3fa;
  --text: #142033;
  --text-sub: #5b6b82;
  --border: #dde5f0;
  --primary: #2f6bff;
  --primary-hover: #1f56e0;
  --primary-soft: #e6eeff;
  --accent: #10b5a3;
  --warn: #c2410c;
  --warn-soft: #fff1e8;
  --danger: #dc2626;
  --ok: #059669;
  --ok-soft: #e7f8f1;
  --muted-badge: #eef1f5;
  --hero-from: #e9f1ff;
  --hero-to: #f5f8fc;
  --shadow: 0 10px 30px -12px rgba(20, 40, 80, 0.18);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1420;
    --bg-elev: #141d2c;
    --bg-soft: #1a2536;
    --text: #e6edf7;
    --text-sub: #9aabc3;
    --border: #26334a;
    --primary: #5b8cff;
    --primary-hover: #7aa2ff;
    --primary-soft: #1d2a46;
    --warn: #fb923c;
    --warn-soft: #2d1e14;
    --ok: #34d399;
    --ok-soft: #12291f;
    --muted-badge: #212c3e;
    --hero-from: #142240;
    --hero-to: #0d1420;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand svg { width: 30px; height: 30px; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { color: var(--text-sub); padding: 6px 10px; border-radius: 8px; font-size: 15px; }
.nav a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip { font-size: 14px; color: var(--text-sub); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 9px 16px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap; color: inherit; background: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-outline { border-color: var(--border); background: var(--bg-elev); color: var(--text); }
.btn-outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-ghost { color: var(--text-sub); }
.btn-ghost:hover { color: var(--text); background: var(--bg-soft); }
.btn-glow { background: linear-gradient(135deg, #2f6bff, #10b5a3); color: #fff; box-shadow: 0 6px 18px -6px rgba(47, 107, 255, .6); }
.btn-glow:hover { filter: brightness(1.06); }
.btn-sm { padding: 6px 12px; font-size: 14px; }
.btn-block { width: 100%; }

/* ---------- hero ---------- */
.hero { background: linear-gradient(180deg, var(--hero-from), var(--hero-to)); padding: 72px 0 56px; text-align: center; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.2; margin: 0 0 14px; letter-spacing: .5px; }
.hero h1 .grad { background: linear-gradient(135deg, #2f6bff, #10b5a3); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--text-sub); font-size: 18px; max-width: 640px; margin: 0 auto 28px; }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-points { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; margin-top: 30px; color: var(--text-sub); font-size: 14px; }
.hero-points span::before { content: "✓ "; color: var(--accent); font-weight: 700; }

/* ---------- sections ---------- */
section.block { padding: 56px 0; }
.section-title { text-align: center; margin: 0 0 8px; font-size: 30px; }
.section-sub { text-align: center; color: var(--text-sub); margin: 0 0 30px; }

/* ---------- period toggle ---------- */
.period-toggle { display: flex; justify-content: center; margin-bottom: 28px; }
.segmented { display: inline-flex; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 4px; }
.segmented button { border: 0; background: none; padding: 8px 20px; border-radius: 9px; cursor: pointer; color: var(--text-sub); font-weight: 600; }
.segmented button.active { background: var(--bg-elev); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.save-tag { font-size: 12px; color: var(--ok); margin-left: 4px; }

/* ---------- plan cards ---------- */
.plan-group-title { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 14px; }
.plan-group-title h3 { margin: 0; font-size: 20px; }
.plan-group-title p { margin: 0; color: var(--text-sub); font-size: 14px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-bottom: 34px; }
.plan-card {
  position: relative; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column;
  box-shadow: var(--shadow);
}
.plan-card.featured { border-color: var(--primary); }
.plan-card.unavailable { opacity: .82; }
.plan-ribbon { position: absolute; top: 14px; right: 14px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.ribbon-hot { background: var(--primary-soft); color: var(--primary); }
.ribbon-closed { background: var(--muted-badge); color: var(--text-sub); }
.plan-card h4 { margin: 0 0 4px; font-size: 19px; }
.plan-tagline { color: var(--text-sub); font-size: 14px; margin: 0 0 16px; min-height: 22px; }
.plan-price { display: flex; align-items: baseline; gap: 4px; margin-bottom: 4px; }
.plan-price .cur { font-size: 18px; font-weight: 700; }
.plan-price .num { font-size: 40px; font-weight: 800; line-height: 1; }
.plan-price .per { color: var(--text-sub); font-size: 14px; }
.plan-price { flex-wrap: wrap; }
.plan-price .list-price { color: var(--text-sub); text-decoration: line-through; font-size: 16px; margin-right: 6px; }
.plan-price .off-tag { margin-left: 8px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #fee2e2; color: #dc2626; align-self: center; }
.plan-monthly-eq { color: var(--text-sub); font-size: 13px; min-height: 20px; margin-bottom: 14px; }
.highlights { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.highlights span { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.features { list-style: none; padding: 0; margin: 0 0 20px; flex: 1; }
.features li { display: flex; gap: 8px; padding: 5px 0; font-size: 14px; border-bottom: 1px dashed var(--border); }
.features li:last-child { border-bottom: 0; }
.features li::before {
  content: ""; flex: 0 0 18px; height: 18px; margin-top: 2px; border-radius: 50%;
  background: var(--ok-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23059669'%3E%3Cpath d='M8.1 13.4 4.7 10l-1.2 1.2 4.6 4.6 9.4-9.4-1.2-1.2z'/%3E%3C/svg%3E") center / 13px no-repeat;
}
.features b { font-weight: 600; }

/* ---------- tutorial ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs button { border: 1px solid var(--border); background: var(--bg-elev); color: var(--text-sub); padding: 8px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.tabs button.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.panel { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.panel h4 { margin: 0 0 10px; }
.steps { padding-left: 20px; margin: 10px 0; }
.steps li { margin: 6px 0; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; font-size: 14px; margin: 12px 0; }
.notice-warn { background: var(--warn-soft); color: var(--warn); }
.notice-info { background: var(--primary-soft); color: var(--primary); }
.import-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.client-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.client-item { border: 1px solid var(--border); border-radius: 10px; padding: 14px; background: var(--bg-soft); }
.client-item h5 { margin: 0 0 4px; font-size: 15px; }
.client-item p { margin: 0 0 10px; font-size: 13px; color: var(--text-sub); }

/* ---------- dashboard ---------- */
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-head h2 { margin: 0; }
.sub-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.sub-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.sub-top h4 { margin: 0; font-size: 18px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-muted { background: var(--muted-badge); color: var(--text-sub); }
.badge-info { background: var(--primary-soft); color: var(--primary); }
.sub-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 14px 0; }
.meta-item small { display: block; color: var(--text-sub); font-size: 12px; }
.meta-item strong { font-size: 15px; }
.usage { height: 8px; background: var(--bg-soft); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.usage > div { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 99px; }
.usage.high > div { background: var(--warn); }
.copy-field { display: flex; gap: 8px; margin: 10px 0; }
.copy-field input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft); color: var(--text); font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.empty { text-align: center; padding: 40px 20px; color: var(--text-sub); background: var(--bg-elev); border: 1px dashed var(--border); border-radius: var(--radius); }
table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple th, table.simple td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.simple th { color: var(--text-sub); font-weight: 600; font-size: 13px; }
.table-wrap { overflow-x: auto; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); }

/* ---------- telegram ---------- */
.tg-block {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 18px; margin-bottom: 16px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(34, 158, 217, .12), rgba(47, 107, 255, .08));
  border: 1px solid rgba(34, 158, 217, .35);
}
.tg-icon {
  flex: 0 0 42px; height: 42px; border-radius: 50%; background: #229ed9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M9.8 15.2 9.6 19c.4 0 .6-.2.8-.4l2-1.9 4.1 3c.8.4 1.3.2 1.5-.7l2.7-12.8c.3-1.1-.4-1.6-1.1-1.3L3.7 10.6c-1.1.4-1.1 1-.2 1.3l4.1 1.3 9.4-5.9c.4-.3.9-.1.5.2z'/%3E%3C/svg%3E");
  background-size: 24px; background-position: center; background-repeat: no-repeat;
}
.tg-text { flex: 1; min-width: 200px; }
.tg-text strong { display: block; font-size: 16px; }
.tg-text p { margin: 2px 0 0; font-size: 14px; color: var(--text-sub); }
.btn-tg { background: #229ed9; color: #fff; }
.btn-tg:hover { background: #1b8bc0; text-decoration: none; }
.modal .tg-block { flex-direction: column; align-items: stretch; text-align: left; }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(8, 14, 26, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { width: 100%; max-width: 440px; background: var(--bg-elev); border-radius: 16px; padding: 26px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.4); max-height: calc(100vh - 32px); overflow-y: auto; }
.modal h3 { margin: 0 0 6px; }
.modal .sub { color: var(--text-sub); font-size: 14px; margin: 0 0 18px; }
.modal-close { float: right; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--text-sub); cursor: pointer; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input[type=email], .field input[type=text] { width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font-size: 15px; }
.field input:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; min-width: 0; }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay-method { border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.pay-method input { accent-color: var(--primary); }
.pay-method.selected { border-color: var(--primary); background: var(--primary-soft); }
.summary { background: var(--bg-soft); border-radius: 12px; padding: 14px; margin-bottom: 16px; font-size: 14px; }
.summary .row { display: flex; justify-content: space-between; padding: 3px 0; }
.summary .total { font-size: 18px; font-weight: 800; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 8px; }
.strike { text-decoration: line-through; color: var(--text-sub); font-weight: 400; margin-right: 6px; font-size: 14px; }
.msg { font-size: 14px; margin-top: 6px; min-height: 20px; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }
.code-input { letter-spacing: 8px; font-size: 22px !important; text-align: center; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #142033; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; z-index: 60; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--text-sub); font-size: 13px; text-align: center; }

@media (max-width: 720px) {
  .nav { display: none; }
  .user-chip { display: none; }
  .site-header .btn-glow { padding: 8px 12px; font-size: 14px; }
  .hero { padding: 48px 0 40px; }
  .pay-methods { grid-template-columns: 1fr; }
}
.wx-qr{display:flex;justify-content:center;padding:12px;background:#fff;border-radius:12px;margin:8px auto;width:fit-content}
.sub-top .inline { flex-wrap: wrap; justify-content: flex-end; }
