:root {
  --bg: #05070d;
  --card: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #e8ecf4;
  --text-dim: #94a0b8;
  --blue-bright: #4d8dff;
  --cyan: #35c8f5;
  --glow: rgba(47, 107, 255, 0.35);
  --header-bg: rgba(5, 7, 13, 0.72);
  --glow1: rgba(47, 107, 255, 0.18);
  --btn-grad: linear-gradient(135deg, #2f6bff, #1d4fd8);
  --grad-text: linear-gradient(120deg, #4d8dff, #35c8f5);
}
html[data-theme="light"] {
  --bg: #f6f8fc;
  --card: rgba(15, 23, 42, 0.04);
  --card-border: rgba(15, 23, 42, 0.1);
  --text: #16202f;
  --text-dim: #5b6a85;
  --blue-bright: #2563eb;
  --cyan: #0891b2;
  --glow: rgba(47, 107, 255, 0.18);
  --header-bg: rgba(246, 248, 252, 0.8);
  --glow1: rgba(47, 107, 255, 0.1);
  --btn-grad: linear-gradient(135deg, #3b7bff, #1f5ae0);
  --grad-text: linear-gradient(120deg, #2563eb, #0891b2);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", -apple-system, "Segoe UI", Roboto, sans-serif;
  /* 兼容回退：不支持 CSS 变量的老浏览器兜底暗色 */
  background: #05070d;
  background:
    radial-gradient(700px 420px at 10% -10%, var(--glow1), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: #e8ecf4;
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-bright); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

header {
  position: sticky; top: 0; z-index: 20;
  background: #05070d;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; width: 92%; max-width: 880px; margin: 0 auto; }
.brand { display: flex; align-items: center; font-weight: 700; font-size: 19px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; margin-right: 10px; }
.brand .n3 { color: var(--cyan); }
.nav-r { display: flex; align-items: center; font-size: 14px; color: var(--text-dim); }
.nav-r > * + * { margin-left: 16px; }
.nav-r a { color: var(--text-dim); }
.nav-r a:hover { color: var(--text); text-decoration: none; }
.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--card-border); color: var(--text-dim);
  transition: transform .2s, color .2s, background .3s;
}
.theme-toggle:hover { transform: rotate(15deg); color: var(--blue-bright); }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html[data-theme="dark"] .icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle { background: #fff; }

main { width: 92%; max-width: 760px; margin: 0 auto; padding: 56px 0 80px; }
.doc-head { margin-bottom: 34px; }
.doc-head h1 { font-size: 28px; font-size: clamp(26px, 4vw, 34px); font-weight: 800; line-height: 1.3; }
.doc-head .meta { margin-top: 12px; font-size: 13.5px; color: var(--text-dim); }
.doc-head .draft {
  margin-top: 18px; padding: 12px 16px; border-radius: 12px; font-size: 13.5px;
  color: var(--text); background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.35);
}
article section { margin-bottom: 30px; }
article h2 {
  font-size: 18px; font-weight: 700; margin-bottom: 10px;
  padding-left: 12px; border-left: 3px solid var(--blue-bright);
}
article h3 { font-size: 15.5px; font-weight: 600; margin: 16px 0 6px; }
article p, article li { font-size: 15px; color: var(--text); }
article p { margin-bottom: 10px; }
article p.dim, article li.dim { color: var(--text-dim); }
article ul, article ol { margin: 6px 0 12px 22px; }
article li { margin-bottom: 6px; }
article strong { color: var(--text); }
.tag {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px;
  background: var(--card); border: 1px solid var(--card-border); color: var(--text-dim); margin-right: 6px;
}
table { width: 100%; border-collapse: collapse; margin: 12px 0 16px; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--card-border); vertical-align: top; }
th { color: var(--text-dim); font-weight: 600; background: var(--card); }
footer { border-top: 1px solid var(--card-border); padding: 28px 0; }
.foot { width: 92%; max-width: 760px; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; font-size: 13.5px; color: var(--text-dim); }
.foot > * + * { margin-left: 12px; }
.foot a { color: var(--text-dim); }
.foot a:hover { color: var(--text); text-decoration: none; }

/* 微信环境提示（整页） */
html[data-env="wechat"] header,
html[data-env="wechat"] main,
html[data-env="wechat"] footer { display: none !important; }
.wx-guard {
  position: relative; min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(560px 380px at 50% 0%, var(--glow1), transparent 70%),
    var(--bg);
}
.wx-guard[hidden] { display: none; }
html[data-env="wechat"] .wx-guard[hidden] { display: flex; }
.wx-card {
  width: 100%; max-width: 400px; border-radius: 22px; padding: 34px 28px 26px; text-align: center;
  background: #0a0f1c;
  background: var(--bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}
.wx-card img { width: 60px; height: 60px; border-radius: 15px; margin: 0 auto 16px; }
.wx-card h2 { font-size: 20px; font-weight: 800; }
.wx-card > p { margin-top: 10px; font-size: 14px; color: var(--text-dim); }
.wx-steps { list-style: none; margin: 20px 0; }
.wx-steps li {
  display: flex; align-items: center; text-align: left; font-size: 14.5px;
  background: var(--card); border: 1px solid var(--card-border); border-radius: 12px; padding: 10px 14px;
}
.wx-steps li + li { margin-top: 10px; }
.wx-steps .n {
  flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
  color: #fff; background: var(--btn-grad); margin-right: 10px;
}
.wx-copy {
  width: 100%; border: 0; cursor: pointer; color: #fff; font-size: 15px; font-weight: 600;
  padding: 13px 20px; border-radius: 13px; background: var(--btn-grad);
  font-family: inherit; transition: transform .2s;
}
.wx-copy:active { transform: scale(.98); }
.wx-copy.done { background: #16a34a; }

@media (max-width: 560px) {
  main { padding: 36px 0 60px; }
  article p, article li { font-size: 14.5px; }
  .nav-r .nav-home { display: none; }
}
