/* ========== Reset & Base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --border: #dfe3ea;
  --text: #1a1e2e;
  --text-dim: #6b7280;
  --accent: #7c5cff;
  --accent-glow: rgba(124, 92, 255, .12);
  --green: #34d399;
  --orange: #fbbf24;
  --red: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ========== Layout ========== */
.container { max-width: 960px; margin: 0 auto; padding: 24px 16px; }

header {
  text-align: center;
  padding: 56px 0 32px;
  border-bottom: 1px solid var(--border);
}
header h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  background: linear-gradient(135deg, #a78bfa, #7c5cff, #06b6d4);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
header p { color: var(--text-dim); font-size: .95rem; }
.version-badge {
  display: inline-block;
  margin-top: 10px;
  font-size: .7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(124, 92, 255, .3);
  padding: 2px 10px;
  border-radius: 999px;
}

nav { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; padding: 20px 0; }
nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: .85rem;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  transition: all .2s;
}
nav a:hover { color: var(--accent); background: var(--surface-2); }

section { margin-bottom: 56px; scroll-margin-top: 80px; }
section h2 {
  font-size: 1.3rem;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
section h2 .icon { font-size: 1.4rem; }

.note { font-size: .82rem; color: var(--text-dim); line-height: 1.6; }

/* ========== Cards ========== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.card h3 { font-size: .95rem; color: var(--accent); margin-bottom: 8px; }

/* ========== Permission Matrix ========== */
.perm-toggle {
  display: flex; gap: 4px; background: var(--surface-2); border-radius: 999px; padding: 3px;
  width: fit-content; margin-bottom: 16px;
}
.perm-toggle button {
  background: transparent; color: var(--text-dim); border: none; padding: 8px 20px;
  border-radius: 999px; cursor: pointer; font-size: .85rem; transition: all .2s;
}
.perm-toggle button.active { background: var(--accent); color: #fff; }

.perm-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.perm-table th, .perm-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.perm-table th { color: var(--text-dim); font-weight: 600; }
.perm-table .check { color: var(--green); }
.perm-table .cross { color: var(--red); }

/* ========== Flow Diagram ========== */
.flow-container { position: relative; padding-left: 24px; }
.flow-step {
  display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px;
}
.flow-dot {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; flex-shrink: 0; margin-top: 2px;
}
.flow-dot::after {
  content: ''; position: absolute; left: 15px; top: 36px; width: 2px; height: calc(100% + 4px);
  background: var(--border); z-index: -1;
}
.flow-step:last-child .flow-dot::after { display: none; }

.flow-content h4 { font-size: .9rem; margin-bottom: 4px; }
.flow-content p { color: var(--text-dim); font-size: .82rem; line-height: 1.5; }

/* ========== Pricing Cards ========== */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.price-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 16px; text-align: center; transition: transform .2s, box-shadow .2s;
}
.price-card:hover { transform: translateY(-4px); box-shadow: 0 8px 32px rgba(124,92,255,.15); }
.price-card.featured { border-color: var(--accent); position: relative; }
.price-card.featured::before {
  content: '推荐'; position: absolute; top: -10px; right: 16px; background: var(--accent);
  color: #fff; font-size: .7rem; padding: 2px 8px; border-radius: 999px;
}
.price-card h3 { font-size: 1rem; margin-bottom: 4px; }
.price-card .price { font-size: 1.5rem; font-weight: 700; color: var(--accent); margin: 8px 0; }
.price-card ul { list-style: none; text-align: left; font-size: .82rem; color: var(--text-dim); padding: 0; }
.price-card li { padding: 4px 0; border-bottom: 1px solid var(--border); }

/* ========== Badge / Tag ========== */
.tag { display: inline-block; font-size: .7rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-dim); margin-right: 4px; }

/* ========== Simulator ========== */
.sim-row { margin-bottom: 18px; }
.sim-row label { display: flex; justify-content: space-between; font-size: .82rem; color: var(--text-dim); margin-bottom: 6px; }
.sim-row label span { color: var(--accent); font-weight: 700; }
.sim-row input[type=range] { width: 100%; accent-color: var(--accent); }
.sim-result { background: var(--surface-2); border-radius: var(--radius-sm); padding: 16px; margin-top: 8px; }
.sim-total { font-size: 1.15rem; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.sim-tier { font-size: .85rem; line-height: 1.6; }
.sim-tier strong { color: var(--accent); }
.sim-warn { color: var(--orange); }

/* ========== Footer ========== */
footer {
  text-align: center;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: .75rem;
}

/* ========== Animations ========== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.card, .flow-step, .price-card { animation: fadeUp .4s ease-out both; }

/* ========== Responsive ========== */
@media (max-width: 600px) {
  nav a { font-size: .75rem; padding: 5px 10px; }
  .pricing-grid { grid-template-columns: 1fr; }
}
