/* Trainko — shared style */
:root {
  --bg: #0a0a0a;
  --surface: #161618;
  --surface-hover: #1c1c1e;
  --border: #2c2c2e;
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #6e6e73;
  --accent: #FF6B35;
  --accent-light: #FF9F1C;
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', 'PingFang SC', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 56px;
}
.header .icon {
  font-size: 56px;
  margin-bottom: 12px;
  display: block;
}
.header h1 {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header .tagline {
  font-size: 17px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* Language switch */
.lang-switch {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 6px;
  z-index: 100;
  background: rgba(22,22,24,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.lang-switch a,
.lang-switch button {
  display: block;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-tertiary);
  background: none;
  border: none;
  text-decoration: none;
  border-radius: 7px;
  transition: all 0.2s;
  cursor: pointer;
}
.lang-switch a.active,
.lang-switch button.active {
  color: var(--text);
  background: var(--surface-hover);
}
.lang-switch a:hover,
.lang-switch button:hover { color: var(--text-secondary); }

/* Headings */
h2 {
  font-size: 22px;
  font-weight: 700;
  margin-top: 48px;
  margin-bottom: 16px;
  color: var(--text);
}
h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

/* Text */
p { font-size: 15px; color: var(--text-secondary); margin-bottom: 14px; }
p strong { color: var(--text); font-weight: 600; }

/* Links */
a { color: var(--accent); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 14px;
  transition: border-color 0.2s;
}
.card:hover { border-color: #3a3a3c; }
.card h3 { margin-bottom: 6px; }
.card p { margin-bottom: 0; font-size: 14px; }

/* Contact card */
.contact-email {
  display: inline-block;
  margin-top: 10px;
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}

/* Lists */
ul { list-style: none; padding: 0; margin-bottom: 14px; }
ul li {
  position: relative;
  font-size: 15px;
  color: var(--text-secondary);
  padding-left: 18px;
  margin-bottom: 8px;
}
ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* Legal page heading */
.legal-header {
  margin-bottom: 40px;
}
.legal-header h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 6px;
}
.legal-header .meta {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 0;
}

/* Legal sections */
.section { margin-top: 36px; }
.section h2 { margin-top: 0; }

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: 48px 0 12px;
}

/* Footer */
.footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer p {
  font-size: 13px;
  color: var(--text-tertiary);
}
.footer a { color: var(--text-tertiary); }
.footer a:hover { color: var(--text-secondary); }

/* ICP 备案号（仅首页页脚）：与上一行版权文字靠紧，间距 14px - 8px = 6px */
.footer .icp { margin-top: -8px; }

/* Links row in legal section */
.legal-links { display: flex; gap: 8px; }
.legal-links a {
  display: inline-block;
  padding: 4px 14px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
}
.legal-links a:hover { border-color: var(--accent); color: var(--accent); }

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 32px;
}
.back-link:hover { color: var(--accent); }

/* Grid & Feature cards */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 600px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform 0.2s, border-color 0.2s;
}
.feature-card:hover {
  border-color: #3a3a3c;
  transform: translateY(-2px);
}
.feature-icon {
  font-size: 28px;
  margin-bottom: 10px;
  display: block;
}
.feature-card h3 {
  font-size: 16px;
  margin-bottom: 6px;
  color: var(--text);
}
.feature-card p {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0;
}

/* Hero Badge */
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 20px;
}
.badge.accent {
  color: var(--accent);
  border-color: rgba(255, 107, 53, 0.3);
  background: rgba(255, 107, 53, 0.1);
}

/* App Store download badge */
.app-store-badge {
  display: inline-block;
  margin-top: 22px;
}
.app-store-badge img {
  height: 48px;
  width: auto;
  display: block;
}

/* Step cards */
.step-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.step-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.step-content h3 {
  font-size: 15px;
  margin-bottom: 4px;
}
.step-content p {
  font-size: 13.5px;
  margin-bottom: 0;
}

/* Membership banner */
.premium-card {
  background: linear-gradient(145deg, rgba(255, 159, 28, 0.12), rgba(22, 22, 24, 0.9));
  border: 1px solid rgba(255, 159, 28, 0.3);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.premium-card h3 {
  font-size: 18px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.premium-card ul {
  margin-bottom: 0;
}

/* Responsive */
@media (max-width: 480px) {
  .container { padding: 40px 18px 60px; }
  .header h1 { font-size: 32px; }
  .header .icon { font-size: 44px; }
  h2 { font-size: 20px; }
}

/* ===== App 内嵌模式（?embed=1）=====
   隐私政策 / 用户协议在 App 内以在线页面展示：去掉官网外壳（语言切换、返回、页脚），
   版式与配色沿用 App 原内置文档并跟随系统明暗；官网正常访问时不受影响。 */
html.embed {
  color-scheme: light dark;
  --bg: #ffffff;
  --text: #1c1c1e;
  --text-secondary: #6e6e73;
  --text-tertiary: #6e6e73;
  --border: #e5e5ea;
  --heading: #000000;
}
@media (prefers-color-scheme: dark) {
  html.embed {
    --bg: #000000;
    --text: #f2f2f7;
    --text-secondary: #98989f;
    --text-tertiary: #98989f;
    --border: #38383a;
    --heading: #ffffff;
  }
}
html.embed .lang-switch,
html.embed .back-link,
html.embed .footer { display: none; }
html.embed body { font-size: 15px; }
html.embed .container { max-width: 720px; padding: 24px 20px 48px; }
html.embed .legal-header { margin-bottom: 24px; }
html.embed .legal-header h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  margin: 8px 0 4px;
  color: var(--heading);
}
html.embed .legal-header .meta { font-size: 13px; color: var(--text-secondary); margin: 4px 0 0; }
html.embed .section { margin-top: 0; }
html.embed h2 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--heading);
  margin: 32px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
html.embed h3 { font-size: 16px; font-weight: 600; color: var(--heading); margin: 20px 0 8px; }
html.embed p,
html.embed ul li { font-size: 15px; color: var(--text); }
html.embed p { margin: 8px 0; }
html.embed p strong,
html.embed li strong { color: var(--heading); font-weight: 600; }
html.embed ul { list-style: disc; padding-left: 22px; margin: 8px 0; }
html.embed ul li { padding-left: 0; margin: 6px 0; }
html.embed ul li::before { content: none; }
/* 页内跨文档链接（如协议 → 隐私政策）在内嵌模式下渲染为普通文字，与 App 原内置文档一致 */
html.embed a[href^="privacy.html"],
html.embed a[href^="agreement.html"] { color: inherit; pointer-events: none; }
