/* ============================================================
   aropla.com — 站点布局样式（共享）
   结构参考 sukisu.org：导航栏 + Hero + 特性卡片 + 步骤 + 页脚
   ============================================================ */

/* ---------- 粘性页脚：footer 始终贴底，内容不足一屏也不上浮 ---------- */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.site-header { flex-shrink: 0; }

/* ---------- 页面过渡：平面推出推入 + 模糊叠加 ---------- */
.page-body {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: transform .22s cubic-bezier(.22,1,.36,1),
              filter .22s ease, opacity .22s ease;
  will-change: transform, filter;
}
/* 离开（导航跳转）：向左滑出 + 模糊 */
.page-body.is-leaving {
  transform: translateX(-2.5%);
  filter: blur(6px);
  opacity: .35;
}
/* 入场（新页面）：从右滑入 + 模糊，就绪后 JS 移除 is-entering → 滑入清晰 */
html.is-entering .page-body {
  transform: translateX(2.5%);
  filter: blur(6px);
  opacity: .35;
}

/* 顶栏底部加载进度条 */
.header-progress {
  position: absolute;
  left: 0; bottom: 0;
  height: 2px;
  width: 0;
  background: #5aa8ff;
  box-shadow: 0 0 8px rgba(90,168,255,0.55);
  opacity: 0;
  transition: width .25s ease, opacity .25s ease;
  z-index: 60;
  pointer-events: none;
}
.header-progress.active { opacity: 1; }
.header-progress.done { opacity: 0; }

/* ---------- 容器 ---------- */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: 72px 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 48px; }
.section-head h2 {
  font-size: 1.9rem;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.section-head p { color: var(--text-muted); margin: 0; font-size: 1.05rem; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--glass-brd);
  /* 玻璃效果放在 ::before 上，避免 .site-header 本身带 backdrop-filter
     阻断子元素（移动端菜单）的 backdrop-filter 生效（iOS Safari 已知问题） */
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.site-header .inner {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 9px 24px;            /* 调矮顶栏 */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}
.brand .logo {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  color: #fff; font-size: 14px; font-weight: 800;
  box-shadow: var(--shadow-sm);
}
.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  color: var(--text-muted);
  padding: 7px 13px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.header-right { display: flex; align-items: center; gap: 10px; }

/* 汉堡菜单按钮（默认桌面隐藏，窄屏显示） */
.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 11px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex: none;
  padding: 0;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  position: relative;
  transition: transform 0.25s, opacity 0.2s;
}
.nav-toggle span::before { position: absolute; top: -6px; left: 0; }
.nav-toggle span::after  { position: absolute; top: 6px;  left: 0; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after  { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  text-align: center;
  padding: 96px 24px 72px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 420px;
  background: radial-gradient(60% 100% at 50% 0%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.hero .inner { position: relative; max-width: 760px; margin: 0 auto; }
.hero .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  margin-bottom: 26px;
}
.hero .badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,0.18);
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  line-height: 1.1;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--text), var(--accent) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* 404 大数字 */
.notfound-code {
  font-size: clamp(5rem, 18vw, 9rem);
  font-weight: 800;
  line-height: 1;
  margin: 0 0 8px;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* 404 自动跳转提示与倒计时 */
.redirect-tip {
  margin: 24px 0 16px;
  color: var(--text-muted);
  font-size: 1rem;
}
.redirect-tip .countdown {
  font-weight: 700;
  color: var(--accent);
  font-size: 1.25em;
  font-variant-numeric: tabular-nums;
}
.hero p.sub {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin: 0 auto 36px;
  max-width: 600px;
}
.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-2); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.grid { display: grid; gap: 22px; }

/* 液态玻璃面板（卡片/文档正文/状态框/徽标）：半透明 + 高光；
   桌面端再叠加 backdrop-filter；触屏/小屏仅半透明以控性能 */
.feature, .step, .status-box, .doc-content, .hero .badge {
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  box-shadow: var(--shadow-sm), var(--glass-hi);
}
@media (hover: hover) and (pointer: fine) {
  .feature, .step, .status-box, .doc-content, .hero .badge {
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  }
}
.feature-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.feature:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}
.feature .icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 22px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 16px;
}
.feature h3 { margin: 0 0 8px; font-size: 1.15rem; }
.feature p { margin: 0; color: var(--text-muted); font-size: 0.97rem; }

/* ---------- 步骤 ---------- */
.steps { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: var(--shadow-sm);
}
.step .num {
  position: absolute;
  top: -16px; left: 22px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
}
.step h3 { margin: 14px 0 10px; font-size: 1.1rem; }
.step p { margin: 0 0 14px; color: var(--text-muted); font-size: 0.97rem; }
.step pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  overflow-x: auto;
  font-size: 0.85rem;
  margin: 0;
}
.step code, .doc-content code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

/* ---------- 当前状态 ---------- */
.status-box {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-sm);
}
.status-box p { color: var(--text-muted); margin: 0 0 20px; }

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: auto;   /* 粘性页脚：推到 page-body 底部 */
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.site-footer a { color: var(--text-muted); }
.site-footer .links { margin: 10px 0; }
.site-footer .links a { margin: 0 8px; }
.site-footer .police img { vertical-align: middle; height: 18px; margin-right: 5px; }
.site-stats {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.site-stats b { color: var(--text); font-weight: 600; }

/* ============================================================
   响应式 / 设备适配
   断点：桌面 >1024 / 平板 769–1024 / 手机 ≤768 / 小屏 ≤380
   导航：≤768 改为汉堡下拉菜单（不再直接隐藏）
   主题按钮：随屏宽用 --ts 等比缩小
   ============================================================ */

/* ---- 平板 ---- */
@media (max-width: 1024px) {
  .container, .site-header .inner { max-width: 100%; }
  .doc-content { padding: 34px 32px; }
}

/* ---- 手机：汉堡菜单 + 单列 ---- */
@media (max-width: 768px) {
  .site-header .inner { padding: 9px 16px; gap: 10px; }
  .header-right { gap: 10px; }

  /* 汉堡按钮显示 */
  .nav-toggle { display: inline-flex; }

  /* 导航变为下拉面板（Apple 风格平滑展开：max-height + opacity + 背景虚化） */
  .nav {
    position: absolute;
    top: calc(100% + 6px);
    right: 14px;
    left: 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    border: 1px solid var(--glass-brd);
    border-radius: 16px;
    box-shadow: var(--shadow), var(--glass-hi);
    padding: 8px;
    /* 关闭态：收起 + 透明 + 不可点 */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    pointer-events: none;
    transition: max-height .42s cubic-bezier(.22,1,.36,1),
                opacity .3s ease,
                padding .3s ease,
                border-width .3s ease;
  }
  .nav.nav-open {
    max-height: 340px;
    opacity: 1;
    padding-top: 8px;
    padding-bottom: 8px;
    border-width: 1px;
    pointer-events: auto;
  }
  .nav a {
    padding: 13px 14px;       /* 加大触控目标 */
    font-size: 1rem;
    border-radius: 11px;
    color: var(--text);       /* 全强度主色，保证在菜单上可读 */
  }
  .nav a:hover { background: var(--surface-2); }

  /* 主题按钮略小 */
  .theme-toggle { --ts: 0.6px; }   /* 约 108x42 */

  .hero { padding: 60px 18px 48px; }
  .hero p.sub { font-size: 1.05rem; }
  .section { padding: 52px 0; }
  .section-head { margin-bottom: 34px; }
  .section-head h2 { font-size: 1.6rem; }
  .feature, .step, .status-box { padding: 22px 20px; }
  .doc-content { padding: 26px 20px; }
  .doc-content h1 { font-size: 1.7rem; }
}

/* ---- 小屏手机 ---- */
@media (max-width: 380px) {
  .site-header .inner { padding: 8px 12px; gap: 8px; }
  .brand { font-size: 1rem; gap: 8px; }
  .brand .logo { width: 26px; height: 26px; font-size: 13px; }
  .theme-toggle { --ts: 0.5px; }   /* 约 90x35 */
  .hero h1 { font-size: 2rem; }
  .cta-row .btn { padding: 11px 18px; font-size: 0.95rem; }
  .doc-main { padding: 18px 12px 50px; }
  .doc-content { padding: 22px 16px; }
}

/* ---- 极窄 ---- */
@media (max-width: 320px) {
  .theme-toggle { --ts: 0.42px; }  /* 约 76x29 */
}

/* ---- 触控设备：取消 hover 位移，避免粘滞 ---- */
@media (hover: none) {
  .feature:hover, .btn:hover { transform: none; }
}

/* ---- UA 识别为移动端 + 手机横屏(769–900px)：也启用汉堡菜单 ---- */
@media (min-width: 769px) and (max-width: 900px) {
  html[data-device="mobile"] .nav-toggle { display: inline-flex; }
  html[data-device="mobile"] .nav {
    position: absolute;
    top: calc(100% + 6px);
    right: 14px;
    left: 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    border: 1px solid var(--glass-brd);
    border-radius: 16px;
    box-shadow: var(--shadow), var(--glass-hi);
    padding: 8px;
    max-height: 0; opacity: 0; overflow: hidden;
    padding-top: 0; padding-bottom: 0; border-width: 0;
    pointer-events: none;
    transition: max-height .42s cubic-bezier(.22,1,.36,1), opacity .3s ease,
                padding .3s ease, border-width .3s ease;
  }
  html[data-device="mobile"] .nav.nav-open {
    max-height: 340px; opacity: 1; padding-top: 8px; padding-bottom: 8px;
    border-width: 1px; pointer-events: auto;
  }
  html[data-device="mobile"] .nav a { padding: 13px 14px; font-size: 1rem; border-radius: 11px; color: var(--text); }
}

/* ============================================================
   文档页 /docs/
   ============================================================ */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}
.doc-sidebar {
  position: sticky;
  top: 64px;
  align-self: start;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 28px 18px 28px 24px;
  border-right: 1px solid var(--border);
}
.doc-sidebar h4 {
  margin: 0 0 12px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.doc-sidebar ul { list-style: none; margin: 0 0 18px; padding: 0; }
.doc-sidebar li { margin: 2px 0; }
.doc-sidebar a {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: background 0.18s, color 0.18s;
}
.doc-sidebar a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.doc-sidebar a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
/* 侧栏角标（如「社区文档 · 公开」） */
.doc-sidebar .doc-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  vertical-align: 1px;
  background: var(--accent-soft);
  color: var(--accent);
}

.doc-main { padding: 36px 40px 80px; min-width: 0; }
.doc-content {
  max-width: 820px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 44px;
  box-shadow: var(--shadow-sm);
  transition: filter .2s ease, opacity .2s ease, transform .2s ease;
}
/* 文档内切换：模糊+位移+淡出，替换内容后淡入 */
.doc-content.doc-switching {
  filter: blur(5px);
  opacity: 0;
  transform: translateY(8px);
}
.doc-content h1 { font-size: 2rem; margin: 0 0 18px; letter-spacing: -0.01em; }
.doc-content h2 { font-size: 1.5rem; margin: 34px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.doc-content h3 { font-size: 1.2rem; margin: 26px 0 10px; }
.doc-content p { margin: 0 0 14px; }
.doc-content ul, .doc-content ol { margin: 0 0 14px; padding-left: 24px; }
.doc-content li { margin: 4px 0; }
.doc-content a { text-decoration: underline; text-underline-offset: 2px; }
.doc-content blockquote {
  margin: 0 0 16px;
  padding: 10px 18px;
  border-left: 4px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 10px 10px 0;
  color: var(--text-muted);
}
.doc-content code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.88em;
}
.doc-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 18px;
}
.doc-content pre code { background: none; padding: 0; }
.doc-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 18px;
  font-size: 0.95rem;
}
.doc-content th, .doc-content td {
  border: 1px solid var(--border);
  padding: 9px 12px;
  text-align: left;
}
.doc-content th { background: var(--surface-2); }
.doc-content img { max-width: 100%; border-radius: 10px; }
.doc-empty { color: var(--text-muted); }

@media (max-width: 860px) {
  .docs-layout { grid-template-columns: 1fr; }
  .doc-sidebar {
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 20px 16px;
  }
  .doc-sidebar h4 { margin-bottom: 8px; }
  /* 移动端侧边栏变顶部列表，加大触控目标 */
  .doc-sidebar ul { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
  .doc-sidebar li { margin: 0; }
  .doc-sidebar a { padding: 12px 16px; }
  .doc-main { padding: 24px 18px 60px; }
  .doc-content { padding: 26px 22px; }
}

/* ============================================================
   外部链接安全提示弹窗
   ============================================================ */
.aropla-external-guard-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.aropla-external-guard-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.aropla-external-guard {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 30px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18), var(--shadow);
  color: var(--text);
  transform: translateY(10px);
  transition: transform 0.22s cubic-bezier(.22,1,.36,1);
}
.aropla-external-guard-overlay.active .aropla-external-guard {
  transform: translateY(0);
}
.aropla-external-guard h2 {
  margin: 0 0 14px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.aropla-guard-tip {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.55;
}
.aropla-guard-url {
  margin: 0 0 22px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  word-break: break-all;
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  line-height: 1.5;
}
.aropla-guard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 4px;
}
.aropla-guard-actions button {
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s, box-shadow 0.18s, background 0.18s;
}
.aropla-guard-actions button:hover { transform: translateY(-1px); }
.aropla-guard-cancel {
  background: var(--surface-2);
  color: var(--text-muted);
  border-color: var(--border);
}
.aropla-guard-cancel:hover {
  background: var(--surface);
  color: var(--text);
}
.aropla-guard-continue {
  background: linear-gradient(135deg, #1d8cf8, #145fbe);
  color: #fff;
  box-shadow: 0 4px 14px rgba(29,140,248,0.28);
}
.aropla-guard-continue:hover {
  box-shadow: 0 6px 18px rgba(29,140,248,0.36);
}

/* 深色主题适配 */
html[data-theme="dark"] .aropla-external-guard-overlay {
  background: rgba(0, 0, 0, 0.62);
}
html[data-theme="dark"] .aropla-guard-url {
  background: var(--bg-soft);
}

/* 移动端适配 */
@media (max-width: 480px) {
  .aropla-external-guard {
    padding: 22px 20px 20px;
    border-radius: 14px;
  }
  .aropla-external-guard h2 { font-size: 1.2rem; }
  .aropla-guard-actions { flex-direction: column-reverse; }
  .aropla-guard-actions button { width: 100%; padding: 12px; }
}
