:root {
  --bg: #F1F3F0;
  --surface: #FFFFFF;
  --ink: #1D2420;
  --muted: #7C857E;
  --rule: #E5E8E3;
  --accent: #41604E;
  --on-accent: #F5F8F4;
  --accent-soft: #E8EEE7;
  --danger: #A65B4B;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- 导航 ---- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 960px; margin: 0 auto; padding: 20px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--ink); }
.brand img { width: 30px; height: 30px; }
.brand:hover { text-decoration: none; }
.navlinks { display: flex; gap: 22px; font-size: 14.5px; }
.navlinks a { color: var(--muted); font-weight: 500; }

/* ---- 首页 ---- */
.hero { max-width: 760px; margin: 0 auto; padding: 72px 24px 56px; text-align: center; }
.hero .mark { width: 76px; height: 76px; margin-bottom: 22px; }
.hero h1 { font-size: 44px; font-weight: 800; letter-spacing: .01em; line-height: 1.2; }
.hero .sub { color: var(--muted); font-size: 17px; margin-top: 14px; }
.cta { margin-top: 34px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 13px 34px; border-radius: 15px;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 16px;
  border: 1px solid var(--accent);
}
.btn:hover { text-decoration: none; opacity: .92; }
.btn.ghost { background: transparent; color: var(--accent); }
.feat { max-width: 880px; margin: 0 auto 72px; padding: 0 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feat .card { background: var(--surface); border: 1px solid var(--rule); border-radius: 18px; padding: 26px 22px; }
.feat .card b { display: block; font-size: 16.5px; margin-bottom: 8px; }
.feat .card p { color: var(--muted); font-size: 14px; line-height: 1.65; }
.footnote { text-align: center; color: var(--muted); font-size: 13px; padding: 0 24px 26px; }
.footnote a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* ---- 协议文档 ---- */
.doc { max-width: 720px; margin: 0 auto; padding: 46px 24px 80px; }
.doc h1 { font-size: 30px; font-weight: 800; margin-bottom: 6px; }
.doc .meta { color: var(--muted); font-size: 13.5px; margin-bottom: 34px; }
.doc h2 { font-size: 19px; font-weight: 700; margin: 34px 0 10px; padding-top: 22px; border-top: 1px solid var(--rule); }
.doc h2:first-of-type { border-top: none; padding-top: 0; }
.doc p, .doc li { color: #3c443f; font-size: 15px; }
.doc ul { padding-left: 22px; margin: 8px 0; }
.doc li { margin: 4px 0; }
.doc strong { color: var(--ink); }

/* ---- 回调页 ---- */
body.cb { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.cbcard {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 18px;
  padding: 44px 40px; width: min(400px, calc(100vw - 40px)); text-align: center;
}
.cblogo img { width: 44px; height: 44px; margin-bottom: 14px; }
.cbcard h1 { font-size: 21px; font-weight: 800; margin-bottom: 12px; }
.muted { color: var(--muted); font-size: 14px; }
.pairbox { margin-top: 22px; padding: 18px 16px; background: var(--accent-soft); border-radius: 15px; }
.pairlabel { font-size: 13px; color: var(--muted); }
.paircode { font-size: 34px; font-weight: 800; letter-spacing: .12em; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.pairexpire { font-size: 12px; color: var(--muted); }

/* ---- 管理后台 ---- */
.adm { max-width: 980px; margin: 0 auto; padding: 30px 24px 80px; }
.adm h1 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.adm .row { display: flex; gap: 10px; margin: 18px 0; flex-wrap: wrap; }
.adm input[type="text"], .adm input[type="password"] {
  padding: 10px 14px; border: 1px solid var(--rule); border-radius: 12px; font-size: 14px; background: var(--surface); color: var(--ink);
}
.adm button {
  padding: 10px 20px; border-radius: 12px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 14px; cursor: pointer;
}
.adm button.ghost { background: transparent; color: var(--accent); }
.adm button.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.statgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin: 20px 0 30px; }
.statgrid .st { background: var(--surface); border: 1px solid var(--rule); border-radius: 15px; padding: 16px 14px; }
.statgrid .st b { display: block; font-size: 22px; font-weight: 800; }
.statgrid .st span { font-size: 12px; color: var(--muted); }
.adm table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--rule); border-radius: 15px; overflow: hidden; font-size: 13.5px; }
.adm th { text-align: left; padding: 11px 14px; background: var(--accent-soft); font-size: 12.5px; color: var(--ink); }
.adm td { padding: 10px 14px; border-top: 1px solid var(--rule); color: #3c443f; word-break: break-all; }
.adm h2 { font-size: 16px; font-weight: 700; margin: 30px 0 12px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tag.warn { background: #F3E9E5; color: var(--danger); }

@media (max-width: 640px) {
  .feat { grid-template-columns: 1fr; }
  .hero { padding: 48px 20px 40px; }
  .hero h1 { font-size: 34px; }
  .statgrid { grid-template-columns: repeat(3, 1fr); }

  /* 导航：窄屏收紧间距，允许换行，避免挤压品牌 */
  .nav { padding: 16px 18px; gap: 12px; }
  .brand { font-size: 17px; }
  .navlinks { gap: 14px; font-size: 13.5px; flex-wrap: wrap; justify-content: flex-end; }

  /* 协议正文：缩小内边距与字号，长链接强制换行防溢出 */
  .doc { padding: 30px 18px 64px; }
  .doc h1 { font-size: 24px; line-height: 1.3; }
  .doc .meta { margin-bottom: 26px; }
  .doc h2 { font-size: 17.5px; margin: 28px 0 10px; padding-top: 18px; }
  .doc p, .doc li { font-size: 14.5px; overflow-wrap: anywhere; }
  .doc ul { padding-left: 20px; }

  .feat .card { padding: 20px 18px; }
  .btn { padding: 12px 26px; font-size: 15px; }
  .footnote { padding: 0 18px 22px; }
}
