*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f0f14;
  --bg-alt: #16161f;
  --surface: #1e1e2a;
  --surface-hover: #262636;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8e8f0;
  --text-muted: #9494a8;
  --primary: #ff8c42;
  --primary-dark: #e6732a;
  --accent: #ffb347;
  --gradient: linear-gradient(135deg, #ff8c42 0%, #ffb347 50%, #ffd166 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(15, 15, 20, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
}

.logo-icon {
  font-size: 1.3rem;
}

/* App icon */
.app-icon {
  --icon-size: 32px;
  display: inline-block;
  width: var(--icon-size);
  height: var(--icon-size);
  background-image: url('images/Group 2390.png');
  background-repeat: no-repeat;
  background-size: cover;
  border-radius: calc(var(--icon-size) * 0.22);
  flex-shrink: 0;
}

.app-icon--sm { --icon-size: 32px; }
.app-icon--md { --icon-size: 56px; }
.app-icon--xl { --icon-size: min(220px, 42vw); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-cta {
  background: var(--gradient);
  color: #1a1a1a !important;
  padding: 8px 20px;
  border-radius: 999px;
  font-weight: 600;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(255, 140, 66, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 90% 80%, rgba(255, 179, 71, 0.1) 0%, transparent 50%),
    var(--bg);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 48px;
  position: relative;
  z-index: 1;
}

.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-icon-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(255, 140, 66, 0.25) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-content {
  position: relative;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(255, 140, 66, 0.15);
  border: 1px solid rgba(255, 140, 66, 0.3);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 56px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  border: none;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--gradient);
  color: #1a1a1a;
  box-shadow: 0 4px 24px rgba(255, 140, 66, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 8px 32px rgba(255, 140, 66, 0.45);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-hover);
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.05rem;
}

.hero-stats {
  display: flex;
  gap: 48px;
}

.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Sections */
.section {
  padding: 100px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 12px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: rgba(255, 140, 66, 0.3);
  transform: translateY(-4px);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 16px;
}

.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.feature-tags li {
  padding: 4px 12px;
  background: rgba(255, 140, 66, 0.1);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--accent);
}

/* Tasks */
.task-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 32px;
}

.task-category h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.category-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.category-dot.hot { background: #ff6b6b; }
.category-dot.brain { background: #74b9ff; }
.category-dot.body { background: #55efc4; }

.task-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}

.task-item:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.task-emoji {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.task-item strong {
  display: block;
  margin-bottom: 2px;
}

.task-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Sleep */
.sleep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.sleep-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.sleep-card.highlight {
  border-color: rgba(255, 140, 66, 0.3);
  background: linear-gradient(135deg, rgba(255, 140, 66, 0.08) 0%, var(--surface) 100%);
}

.sleep-card h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.sleep-card ul {
  list-style: none;
}

.sleep-card li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 10px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.sleep-card li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}

/* Permissions */
.perm-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.perm-item {
  padding: 10px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Download */
.download-section {
  padding: 100px 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(255, 140, 66, 0.12) 0%, transparent 60%),
    var(--bg-alt);
}

.download-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  flex-wrap: wrap;
}

.download-text h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin-bottom: 12px;
}

.download-app {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.download-app h2 {
  margin-bottom: 4px;
}

.download-app p {
  margin-bottom: 0;
}

.download-text p {
  color: var(--text-muted);
}

.download-note {
  margin-top: 16px !important;
  margin-bottom: 0 !important;
  font-size: 0.82rem !important;
}

.download-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.download-qr img {
  display: block;
  border-radius: 8px;
}

.download-qr span {
  font-size: 0.85rem;
  color: #555;
  font-weight: 600;
}

/* Footer */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.footer-content {
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  margin-bottom: 8px;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.footer-links a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-sep {
  color: var(--text-muted);
  opacity: 0.5;
}

/* Legal pages */
.legal-page {
  padding: 120px 0 64px;
  min-height: calc(100vh - 160px);
}

.legal-inner {
  max-width: 760px;
}

.legal-back {
  margin-bottom: 24px;
}

.legal-back a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.legal-back a:hover {
  color: var(--primary);
}

.legal-page h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.legal-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.legal-content {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-muted);
}

.legal-content > p {
  margin-bottom: 1.1em;
}

.legal-content h2 {
  font-size: 1.15rem;
  font-weight: 650;
  color: var(--text);
  margin: 2em 0 0.75em;
}

.legal-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.5em 0 0.5em;
}

.legal-content ul {
  margin: 0.5em 0 1.1em;
  padding-left: 1.35em;
}

.legal-content li {
  margin-bottom: 0.45em;
}

.legal-content strong {
  color: var(--text);
  font-weight: 600;
}

.legal-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-content a:hover {
  color: var(--accent);
}

.legal-nav {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.legal-nav a {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.legal-nav a:hover {
  color: var(--accent);
}

/* App WebView：隐藏站点导航，适配安全区 */
html.in-app {
  background: var(--bg);
}

html.in-app body {
  background: var(--bg);
  overscroll-behavior-y: contain;
  -webkit-tap-highlight-color: transparent;
}

html.in-app .header,
html.in-app .footer,
html.in-app .legal-back {
  display: none !important;
}

html.in-app .legal-page {
  padding: max(20px, env(safe-area-inset-top, 0px)) 0 max(40px, env(safe-area-inset-bottom, 0px));
  min-height: 100vh;
  min-height: 100dvh;
}

html.in-app .legal-inner {
  max-width: 100%;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

html.in-app .legal-page h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

html.in-app .legal-meta {
  margin-bottom: 28px;
  padding-bottom: 16px;
  font-size: 0.8rem;
}

html.in-app .legal-content {
  font-size: 0.9rem;
  line-height: 1.75;
}

html.in-app .legal-content h2 {
  font-size: 1.05rem;
  margin: 1.6em 0 0.6em;
}

html.in-app .legal-nav {
  margin-top: 36px;
  padding-top: 20px;
}

/* Mobile Nav */
@media (max-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-visual {
    order: -1;
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .download-app {
    flex-direction: column;
    text-align: center;
  }

  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(15, 15, 20, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s, opacity 0.3s;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links li {
    width: 100%;
    text-align: center;
  }

  .nav-links a {
    display: block;
    padding: 14px 24px;
  }

  .menu-toggle {
    display: flex;
  }

  .menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .hero-stats {
    gap: 32px;
  }

  .download-content {
    flex-direction: column;
    text-align: center;
  }

  .download-text p {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
    width: 100%;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: 24px;
  }
}
