/* v2rayNG 订阅导入教程（安卓） — 移动优先，无外部资源 */

:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #171b24;
  --muted: #5a6072;
  --border: #e2e6f0;
  --accent: #3f66e6;       /* 主色（白字对比 4.9:1） */
  --accent-soft: #edf1ff;
  --link: #3358cc;
  --code-bg: #f0f3fa;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06);
  --radius: 14px;
  /* 警告块（不要外传订阅链接） */
  --warn-fg: #8a4b00;
  --warn-bg: #fff6e8;
  --warn-border: #e9a13b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --card: #171d27;
    --text: #e9edf6;
    --muted: #a7b0c2;
    --border: #2a3242;
    --accent: #4f7cff;
    --accent-soft: #1c2536;
    --link: #8fabff;
    --code-bg: #111722;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    --warn-fg: #ffd9a8;
    --warn-bg: #2a2013;
    --warn-border: #b87a1e;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0 auto;
  max-width: 720px;
  padding: 20px 16px 40px;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "PingFang SC", "Noto Sans CJK SC",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 标题 ---------- */

h1, h2, h3 {
  line-height: 1.35;
  margin: 0 0 .5em;
  font-weight: 700;
}

h1 {
  font-size: 1.55rem;
  letter-spacing: .01em;
}

h2 {
  font-size: 1.22rem;
  margin-top: 0;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--accent-soft);
}

h3 {
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: .55rem;
}

p { margin: 0 0 .85rem; }
p:last-child, ul:last-child { margin-bottom: 0; }

/* ---------- 页头与三步速览 ---------- */

.site-header {
  padding: 8px 4px 22px;
}

.lede {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 1.1rem;
}

.quick-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--muted);
  border: 0;
  margin: 0 0 .5rem;
  padding: 0;
}

.quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.quick li {
  display: flex;
  align-items: center;
  gap: .4rem;
  min-height: 44px;
  padding: 8px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.3;
}

.q-num {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- 卡片 ---------- */

.card,
.step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
  margin: 0 0 16px;
}

main > section + section { margin-top: 26px; }

.step + .step { margin-top: 12px; }

.step { margin-bottom: 12px; }

.step-no {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- 正文里的小标签 ---------- */

.tag {
  display: inline-block;
  margin-right: .4em;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
  vertical-align: 1px;
}

.note {
  margin-top: .85rem;
  padding: .65rem .8rem;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  font-size: .95rem;
}

.small {
  font-size: .9rem;
  color: var(--muted);
  margin-top: .7rem;
}

.callout {
  padding: .75rem .85rem;
  border: 1px dashed var(--accent);
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: .95rem;
}

.plain {
  margin: 0 0 .6rem;
  padding-left: 1.2rem;
}

.plain li { margin-bottom: .35rem; }

/* ---------- 警告块：不要外传订阅链接 ---------- */

.warn {
  margin-top: 18px;
  padding: 1rem 1.1rem;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-left: 5px solid var(--warn-border);
  border-radius: var(--radius);
  color: var(--warn-fg);
}

.warn h2 {
  margin: 0 0 .5em;
  font-size: 1.08rem;
  color: var(--warn-fg);
}

.warn p {
  margin: 0 0 .6em;
  font-size: .97rem;
}

.warn .plain {
  margin: 0;
  font-size: .95rem;
}

.warn .plain li { margin-bottom: .3rem; }

.warn strong { font-weight: 700; }

/* ---------- 下载按钮 ---------- */

.dl-list {
  list-style: none;
  margin: 14px 0 4px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid var(--accent);
  background: var(--card);
  color: var(--accent);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .06s ease, box-shadow .15s ease;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(63, 102, 230, .28);
}

.btn:active { transform: translateY(1px); }

.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.btn-title {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.4;
}

.btn-meta {
  font-size: .85rem;
  font-weight: 500;
  opacity: .9;
  line-height: 1.4;
}

.btn-primary .btn-meta { opacity: .95; }

/* ---------- 代码块与行内代码 ---------- */

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
  background: var(--code-bg);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--text);
}

.code-block {
  margin: 0 0 .9rem;
  padding: 10px 12px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.code-block code {
  display: block;
  background: none;
  padding: 0;
  white-space: nowrap;
  font-size: .88rem;
  line-height: 1.6;
  color: var(--text);
}

.code-hint {
  margin: 0 0 6px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- 纯符号图标 ---------- */

.sym {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6em;
  height: 1.6em;
  padding: 0 .2em;
  margin: 0 .1em;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--code-bg);
  color: var(--text);
  font-size: .95em;
  line-height: 1;
  vertical-align: -1px;
}

/* ---------- 手机界面示意 ---------- */

.mock {
  margin: 1.1rem 0 0;
}

.mock-phone {
  width: 100%;
  max-width: 300px;
  border: 2px solid var(--border);
  border-radius: 18px;
  background: var(--bg);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.mock-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 44px;
}

.mock-title {
  flex: 1;
  text-align: center;
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
}

.mock-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .95rem;
  line-height: 1;
}

.mock-row {
  padding: 10px 12px;
  min-height: 44px;
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: .85rem;
  color: var(--muted);
}

.mock-row-active {
  border-color: var(--accent);
  color: var(--text);
  font-weight: 700;
}

.mock-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 4px 0;
}

.mock-plane {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  /* 图标是「尖头朝右的三角形」（像播放键），不是纸飞机 */
  font-size: .95rem;
  line-height: 1;
  padding-left: 3px; /* 视觉重心补偿：三角形偏左才显得居中 */
  font-variant-emoji: text;
}

/* 页面里所有符号都用文字形态渲染，避免安卓把 ▶ ☰ 之类当成彩色 emoji */
.sym,
.mock-icon {
  font-variant-emoji: text;
}

figcaption {
  margin-top: 8px;
  font-size: .85rem;
  color: var(--muted);
}

/* ---------- 常见问题 ---------- */

details {
  border-top: 1px solid var(--border);
  padding: 2px 0;
}

details:first-of-type { border-top: 0; }

summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 2px;
  font-weight: 600;
  font-size: .98rem;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 28px;
}

summary::-webkit-details-marker { display: none; }

summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 700;
}

details[open] summary::after { content: "–"; }

details > p {
  margin: .2rem 0 .8rem;
  padding: 0 2px;
  font-size: .95rem;
  color: var(--muted);
}

/* ---------- 链接与页脚 ---------- */

a { color: var(--link); text-underline-offset: 2px; }

a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.site-footer {
  margin-top: 28px;
  padding: 16px 4px 0;
  border-top: 1px solid var(--border);
  font-size: .85rem;
  color: var(--muted);
  text-align: center;
}

.site-footer p { margin: 0 0 .3rem; }

/* ---------- 无障碍工具类 ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media (min-width: 560px) {
  body { padding: 28px 24px 48px; }
  h1 { font-size: 1.75rem; }
  .card, .step { padding: 22px 22px; }
  .quick li { font-size: .95rem; }
}
