/* -------------------------------------------------------------
   悟空搞钱 · 移动端优先苹果美学 (Mobile-First Apple Design System)
   ------------------------------------------------------------- */

:root {
  /* Apple Dark Titanium & Royal Gold Palette */
  --bg-dark: #000000;
  --bg-elevated: #161617;
  --bg-card: rgba(22, 22, 24, 0.75);
  --bg-card-active: rgba(32, 32, 36, 0.9);
  
  /* Apple Original Font Stack & Colors */
  --font-apple: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", sans-serif;
  --text-primary: #F5F5F7;
  --text-secondary: #86868B;
  --text-tertiary: #6E6E73;
  
  /* Black Gold Theme Accents */
  --gold-primary: #E6C687;
  --gold-secondary: #D4AF37;
  --gold-gradient: linear-gradient(135deg, #F5E5C9 0%, #E6C687 50%, #C59B3F 100%);
  --gold-gradient-press: linear-gradient(135deg, #E6C687 0%, #C59B3F 100%);
  
  /* Borders & Shadows */
  --border-glass: rgba(230, 198, 135, 0.16);
  --border-active: rgba(230, 198, 135, 0.4);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.25);
  
  /* Mobile Interaction Timing */
  --apple-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-apple);
  line-height: 1.47059;
  letter-spacing: -0.022em;
  overflow-x: hidden;
}

/* Ambient Background Light (Apple Style) */
body::before {
  content: '';
  position: fixed;
  top: -10vw;
  left: 50%;
  transform: translateX(-50%);
  width: 120vw;
  height: 80vw;
  max-height: 450px;
  background: radial-gradient(ellipse at center, rgba(212, 175, 55, 0.12) 0%, rgba(163, 127, 44, 0.02) 60%, transparent 80%);
  pointer-events: none;
  z-index: -1;
  filter: blur(50px);
}

/* -------------------------------------------------------------
   Header / Navigation (iOS App Header Style)
   ------------------------------------------------------------- */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.2rem;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
}

.logo {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: -0.015em;
}

.logo svg {
  color: var(--gold-primary);
}

.nav-links {
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 400;
  text-decoration: none;
  transition: color 0.2s var(--apple-ease);
}

.nav-links a:active, .nav-links a:hover {
  color: var(--gold-primary);
}

/* -------------------------------------------------------------
   Hero Header (iOS Large Title Style)
   ------------------------------------------------------------- */
.hero {
  padding: 2.2rem 1.2rem 1.2rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* -------------------------------------------------------------
   Segmented Control (Mobile Horizontal Scrollable Bar)
   ------------------------------------------------------------- */
.tabs-wrapper {
  padding: 0.5rem 1.2rem 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs-wrapper::-webkit-scrollbar {
  display: none;
}

.tabs {
  display: inline-flex;
  gap: 0.5rem;
  background: rgba(22, 22, 24, 0.9);
  padding: 0.3rem;
  border-radius: 980px;
  border: 0.5px solid var(--border-glass);
}

.tab {
  padding: 0.5rem 1.1rem;
  border-radius: 980px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.25s var(--apple-ease);
}

.tab.active {
  background: var(--gold-gradient);
  color: #000000;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}

.tab:active:not(.active) {
  opacity: 0.7;
}

/* -------------------------------------------------------------
   Mobile Cards List (iOS Grouped Card Style)
   ------------------------------------------------------------- */
.grid {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: 0 1.2rem 5rem;
  max-width: 600px;
  margin: 0 auto;
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid var(--border-glass);
  border-radius: 20px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  transition: all 0.25s var(--apple-ease);
  box-shadow: var(--shadow-card);
  position: relative;
}

.card:active {
  transform: scale(0.98);
  background: var(--bg-card-active);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.badge {
  background: rgba(230, 198, 135, 0.12);
  color: var(--gold-primary);
  padding: 0.25rem 0.75rem;
  border-radius: 980px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 0.5px solid rgba(230, 198, 135, 0.25);
}

.card-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.card-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.45;
  margin-bottom: 1.2rem;
  font-weight: 400;
}

.card-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-tertiary);
  font-size: 0.82rem;
  margin-bottom: 1.2rem;
  padding-top: 0.8rem;
  border-top: 0.5px solid rgba(255, 255, 255, 0.08);
}

.card-stats span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.card-actions {
  display: flex;
  gap: 0.6rem;
}

.card-actions .btn {
  flex: 1;
}

/* -------------------------------------------------------------
   iOS Apple Buttons (Touch Optimized, Min 44px height)
   ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1.2rem;
  border-radius: 980px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s var(--apple-ease);
  border: none;
  text-decoration: none;
  touch-action: manipulation;
}

.btn-primary {
  background: var(--gold-gradient);
  color: #000000;
  box-shadow: var(--shadow-gold);
}

.btn-primary:active {
  transform: scale(0.96);
  background: var(--gold-gradient-press);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold-primary);
  border: 0.5px solid var(--border-glass);
}

.btn-secondary:active {
  transform: scale(0.96);
  background: rgba(230, 198, 135, 0.15);
}

/* -------------------------------------------------------------
   Detail & Handbook Mobile Optimized
   ------------------------------------------------------------- */
.detail-container {
  max-width: 600px;
  margin: 1rem auto 6rem;
  padding: 0 1.2rem;
}

.detail-section {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 0.5px solid var(--border-glass);
  border-radius: 20px;
  padding: 1.4rem;
  margin-bottom: 1.2rem;
}

.timeline {
  position: relative;
  padding-left: 1.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.3rem; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--gold-primary) 0%, rgba(212, 175, 55, 0.1) 100%);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.45rem;
  top: 0.25rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-primary);
}

/* Sticky Bottom Action Bar (iOS Style) */
.mobile-bottom-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 0.8rem 1.2rem calc(0.8rem + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 0.5px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 999;
}

.mobile-bottom-bar .price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold-primary);
}

/* Handbook Mobile Layout */
.handbook-layout {
  display: flex;
  flex-direction: column;
}

.sidebar {
  width: 100%;
  background: rgba(16, 16, 18, 0.9);
  padding: 1rem 1.2rem;
  border-bottom: 0.5px solid var(--border-glass);
}

.sidebar-menu {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  list-style: none;
  -webkit-overflow-scrolling: touch;
}

.sidebar-menu li { white-space: nowrap; }

.sidebar-menu a {
  display: block;
  padding: 0.4rem 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 980px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-decoration: none;
}

.sidebar-menu a.active {
  background: var(--gold-primary);
  color: #000000;
  font-weight: 600;
}

.handbook-content {
  padding: 1.5rem 1.2rem 5rem;
}

/* Modal for Mobile */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(15px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s var(--apple-ease);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: #1C1C1E;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 2rem 1.5rem calc(2rem + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 600px;
  transform: translateY(100%);
  transition: transform 0.3s var(--apple-ease);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.form-group input {
  width: 100%;
  min-height: 48px;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 0.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
}

.form-group input:focus {
  outline: none;
  border-color: var(--gold-primary);
}

/* Footer */
footer {
  text-align: center;
  padding: 3rem 1.2rem;
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

/* Desktop Enhancement */
@media (min-width: 768px) {
  .hero h1 { font-size: 3.2rem; }
  .grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    max-width: 1100px;
  }
  .handbook-layout { flex-direction: row; }
  .sidebar { width: 280px; height: calc(100vh - 60px); position: sticky; top: 60px; }
  .sidebar-menu { flex-direction: column; }
  .modal-overlay { align-items: center; }
  .modal { border-radius: 24px; transform: scale(0.95); }
}
