:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1419;
  --panel: #1a2332;
  --surface: #121a26;
  --surface-2: #152030;
  --surface-active: #1a3a5c;
  --line: #2a3548;
  --line-soft: #243247;
  --text: #e7eef8;
  --muted: #8b9bb4;
  --accent: #3d9cf0;
  --accent-text: #fff;
  --ok: #3ecf8e;
  --warn: #f0b429;
  --bad: #f07178;
  --input-bg: #0f1722;
  --btn-secondary: #2d3a4f;
  --top-bg: rgba(15, 20, 25, 0.92);
  --body-glow-1: #1d3a5f55;
  --body-glow-2: #164a3a33;
  --error-bg: #3a1d24;
  --error-text: #ffb4ba;
  --badge-bg: #243247;
  --badge-ok-bg: #173528;
  --badge-fail-bg: #3a1d24;
  --radius: 12px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --pad: 1.4rem;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f7;
  --panel: #ffffff;
  --surface: #f8fafc;
  --surface-2: #eef3f9;
  --surface-active: #dbeafe;
  --line: #cfd8e6;
  --line-soft: #d8e0ea;
  --text: #1a2332;
  --muted: #5a6b82;
  --accent: #1877d2;
  --accent-text: #fff;
  --ok: #0d9f6e;
  --warn: #c58a00;
  --bad: #d64550;
  --input-bg: #ffffff;
  --btn-secondary: #e3eaf3;
  --top-bg: rgba(255, 255, 255, 0.94);
  --body-glow-1: #93c5fd44;
  --body-glow-2: #86efac33;
  --error-bg: #fde8ea;
  --error-text: #b42333;
  --badge-bg: #e8eef5;
  --badge-ok-bg: #dcf5ea;
  --badge-fail-bg: #fde8ea;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 10% -10%, var(--body-glow-1), transparent),
    radial-gradient(900px 400px at 90% 0%, var(--body-glow-2), transparent),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
code {
  word-break: break-all;
  font-size: 0.88em;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem var(--pad);
  border-bottom: 1px solid var(--line);
  background: var(--top-bg);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand a {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
}
.icon-btn:hover {
  background: var(--surface-active);
  border-color: var(--accent);
}
.theme-toggle .theme-icon { display: none; }
[data-theme-pref="auto"] .theme-toggle .theme-icon-auto,
html:not([data-theme-pref]) .theme-toggle .theme-icon-auto { display: inline; }
[data-theme-pref="light"] .theme-toggle .theme-icon-sun { display: inline; }
[data-theme-pref="dark"] .theme-toggle .theme-icon-moon { display: inline; }
.theme-toggle-float {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.nav-toggle-bar {
  display: block;
  width: 1.15rem;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.top.is-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.top.is-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.top.is-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
.top-nav-wrap {
  flex: 1 1 auto;
  min-width: 0;
}
.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  align-items: center;
  max-width: 100%;
}
.top-nav a { color: var(--muted); white-space: nowrap; }
.top-nav a:hover { color: var(--text); }
.top-nav .muted { opacity: 0.7; word-break: break-all; }

.pay-methods {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.75rem;
}
.pay-method-btn {
  background: var(--btn-secondary);
  color: var(--text);
  flex: 1 1 120px;
  min-width: 0;
}
.pay-method-btn.active {
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 0 0 2px rgba(61, 156, 240, 0.35);
}

.container {
  width: min(1100px, calc(100% - 2 * var(--pad)));
  margin: 1.4rem auto 3rem;
}
.foot {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 1.5rem var(--pad);
}

h1 { font-size: 1.5rem; margin: 0 0 1rem; line-height: 1.3; }
h2 { font-size: 1.15rem; margin: 0 0 0.8rem; line-height: 1.3; }
.panel > h2:first-child { margin-top: 0; }
.muted { color: var(--muted); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.9rem;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.card .label { color: var(--muted); font-size: 0.85rem; }
.card .value { font-size: 1.6rem; font-weight: 700; margin-top: 0.35rem; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.15rem;
  padding: 0 0.15rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 560px;
}
th, td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
td { word-break: break-word; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 0.95rem;
  min-height: 2.4rem;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.secondary { background: var(--btn-secondary); color: var(--text); }
.btn.danger { background: #8b3a45; }
.btn.small { padding: 0.35rem 0.65rem; font-size: 0.85rem; min-height: 2rem; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0;
  align-items: flex-end;
}
.actions label {
  flex: 1 1 140px;
  min-width: 120px;
  max-width: 100%;
}
.actions .btn,
.actions button,
.actions a.btn {
  flex: 0 0 auto;
}

form.inline { display: inline; }
form.stack { display: grid; gap: 0.7rem; max-width: 560px; width: 100%; }
label { display: grid; gap: 0.3rem; color: var(--muted); font-size: 0.9rem; }
input, select, textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  font-size: 1rem; /* 避免 iOS 缩放 */
}
select option,
select optgroup {
  background: var(--input-bg);
  color: var(--text);
}
textarea { resize: vertical; min-height: 5rem; }

.cat-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.cat-pick label.cat-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}
.cat-pick label.cat-opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--surface-active);
  color: var(--text);
}
.cat-pick input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

.login-wrap {
  min-height: 80vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.login-box {
  width: min(380px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.6rem;
}
.error {
  background: var(--error-bg);
  color: var(--error-text);
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  margin-bottom: 0.8rem;
  word-break: break-word;
}
.badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--badge-bg);
  color: var(--muted);
}
.badge.ok { background: var(--badge-ok-bg); color: var(--ok); }
.badge.fail { background: var(--badge-fail-bg); color: var(--bad); }
.badge.vip-lg {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #1a1000;
  font-weight: 700;
  font-size: 0.72rem;
  vertical-align: middle;
  margin-left: 0.35rem;
}
.nav-vip-tag {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.3;
  vertical-align: middle;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1a1000;
  letter-spacing: 0.02em;
}
.top-nav a:not(.muted) .nav-vip-tag { pointer-events: none; }
.links li { margin: 0.4rem 0; word-break: break-all; }

/* ---------- 手机端 ---------- */
@media (max-width: 820px) {
  :root { --pad: 0.85rem; }

  .top {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand actions"
      "nav nav";
    align-items: center;
    gap: 0.55rem 0.65rem;
    padding: 0.65rem var(--pad);
  }
  .brand {
    grid-area: brand;
    font-size: 1.05rem;
    min-width: 0;
  }
  .top-actions {
    grid-area: actions;
    justify-self: end;
  }
  .nav-toggle { display: inline-flex; }
  .top-nav-wrap {
    grid-area: nav;
    display: none;
    width: 100%;
  }
  .top.is-open .top-nav-wrap {
    display: block;
    padding-top: 0.55rem;
    border-top: 1px solid var(--line);
  }
  .top-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0.35rem;
    width: 100%;
  }
  .top-nav a,
  .top-nav .muted {
    display: block;
    font-size: 0.92rem;
    padding: 0.62rem 0.75rem;
    border-radius: 8px;
    background: var(--surface-2);
    border: 1px solid var(--line-soft);
    text-decoration: none;
  }
  .top-nav a:active {
    background: var(--surface-active);
    border-color: var(--accent);
    color: var(--text);
  }
  .top-nav .muted {
    max-width: none;
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    word-break: break-all;
    font-size: 0.85rem;
  }

  .container {
    width: calc(100% - 2 * var(--pad));
    margin: 0.9rem auto 2.2rem;
  }

  h1 { font-size: 1.28rem; }
  h2 { font-size: 1.05rem; }

  .panel {
    padding: 0.85rem;
    border-radius: 10px;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }
  .card { padding: 0.8rem; }
  .card .value { font-size: 1.35rem; }

  .actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }
  .actions label {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
  }
  .actions .btn,
  .actions button,
  .actions a.btn,
  .actions > select,
  .actions > input {
    width: 100%;
  }
  form.stack { max-width: none; }

  table {
    min-width: 640px;
    font-size: 0.86rem;
  }
  th, td { padding: 0.5rem 0.4rem; }

  .btn { width: auto; }
  .login-box { padding: 1.25rem; }

  /* 分享页支付区 */
  #payBox .actions { flex-direction: row; flex-wrap: wrap; }
  #qrWrap img {
    width: min(220px, 70vw) !important;
    max-width: 100%;
  }
  .pay-methods {
    flex-direction: column;
    gap: 0.5rem;
  }
  .pay-method-btn {
    width: 100%;
    flex: 1 1 auto;
  }
}

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 1.18rem; }
  .top-nav a { font-size: 0.88rem; padding: 0.58rem 0.7rem; }
  .foot { font-size: 0.8rem; padding: 1.1rem var(--pad); }
}

/* ---------- 软件下载 / 常见问题 ---------- */
.page-head { margin-bottom: 0.4rem; }
.page-head h1 { margin-bottom: 0.35rem; }
.site-section > h2 { margin-bottom: 1rem; }

.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
}
.player-card {
  display: flex;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.player-icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  font-size: 1.15rem;
}
.player-body { min-width: 0; flex: 1; }
.player-body h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  line-height: 1.3;
}
.player-platform {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--badge-bg);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  margin-bottom: 0.45rem;
}
.player-body p {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.tool-group { margin-top: 1.1rem; }
.tool-group:first-of-type { margin-top: 0.2rem; }
.tool-group-title {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  color: var(--text);
}
.tool-list { display: grid; gap: 0.55rem; }
.tool-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.tool-info { min-width: 0; flex: 1; }
.tool-info strong { display: block; margin-bottom: 0.25rem; }
.tool-info p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}
.tool-item .btn { flex: 0 0 auto; white-space: nowrap; }

.faq-list { display: grid; gap: 0.55rem; }
.faq-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 0.15rem 0.2rem;
}
.faq-question {
  cursor: pointer;
  list-style: none;
  padding: 0.85rem 1rem;
  font-weight: 600;
  line-height: 1.4;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::before {
  content: "+";
  display: inline-block;
  width: 1.1rem;
  color: var(--accent);
  font-weight: 700;
}
.faq-item[open] .faq-question::before { content: "−"; }
.faq-answer {
  padding: 0 1rem 0.95rem 2.1rem;
  color: var(--muted);
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 0.92rem;
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-box {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem 1.2rem 1.2rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}
.modal-box h2 {
  margin: 0 0 0.55rem;
  font-size: 1.15rem;
}
.modal-box .actions { margin-top: 0.75rem; }
.modal-box label { display: block; width: 100%; }
.modal-box input { width: 100%; max-width: none; }

@media (max-width: 640px) {
  .tool-item {
    flex-direction: column;
    align-items: stretch;
  }
  .tool-item .btn { width: 100%; }
}
