/* ============================================
   极致引擎 — Apple-style Design System
   ============================================ */

:root {
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --blue-light: #e8f4fd;
  --text: #1d1d1f;
  --text-secondary: #86868b;
  --text-tertiary: #6e6e73;
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --bg-dark: #000000;
  --border: #d2d2d7;
  --border-light: #e8e8ed;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.12);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --radius-xl: 28px;
  --nav-height: 48px;
  --max-width: 1200px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 17px;
}

/* ============================================
   NAVIGATION — Apple-style sticky nav
   ============================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  height: var(--nav-height);
  display: flex;
  align-items: center;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.nav-logo:hover { opacity: 0.7; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.08px;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--blue); }

.nav-links a.active { color: var(--text); }

/* ============================================
   HERO — Large hero section
   ============================================ */

.hero {
  text-align: center;
  padding: 80px 24px 60px;
  background: var(--bg);
}

.hero-dark {
  background: var(--bg-dark);
  color: #f5f5f7;
}

.hero-tag {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.hero-dark .hero-tag { color: #a1a1a6; }

.hero h1 {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1.05;
  margin-bottom: 16px;
}

.hero-dark h1 { color: #f5f5f7; }

.hero h2 {
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 600;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--text);
}

.hero-dark h2 { color: #f5f5f7; }

.hero-sub {
  font-size: clamp(17px, 2.2vw, 21px);
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto 28px;
  line-height: 1.5;
}

.hero-dark .hero-sub { color: #a1a1a6; }

.hero-actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 28px;
  border-radius: 980px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.2px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

.btn-primary:hover { background: var(--blue-hover); }

.btn-outline {
  background: transparent;
  color: var(--blue);
  border: 1.5px solid var(--blue);
}

.btn-outline:hover { background: var(--blue); color: #fff; }

.btn-outline-light {
  background: transparent;
  color: #2997ff;
  border: 1.5px solid #2997ff;
}

.btn-outline-light:hover { background: #2997ff; color: #fff; }

.btn-link {
  background: transparent;
  color: var(--blue);
  padding: 0;
  font-size: 17px;
}

.btn-link::after {
  content: ' ›';
  font-size: 20px;
}

.btn-link:hover { text-decoration: underline; }

/* ============================================
   SECTIONS — Apple-style content sections
   ============================================ */

.section {
  padding: 80px 24px;
}

.section-alt {
  background: var(--bg-alt);
}

.section-dark {
  background: var(--bg-dark);
  color: #f5f5f7;
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 60px;
}

.section-header h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.8px;
  margin-bottom: 12px;
}

.section-header p {
  font-size: 19px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.section-dark .section-header h2 { color: #f5f5f7; }
.section-dark .section-header p { color: #a1a1a6; }

/* ============================================
   CARDS GRID
   ============================================ */

.cards-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-icon {
  font-size: 40px;
  margin-bottom: 20px;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border-radius: var(--radius);
}

.card h3 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}

.card p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================
   FEATURE ROW — alternating image + text
   ============================================ */

.feature-row {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 80px;
}

.feature-row + .feature-row {
  margin-top: 80px;
}

.feature-row.reverse {
  flex-direction: row-reverse;
}

.feature-text {
  flex: 1;
  min-width: 300px;
}

.feature-text h3 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
  line-height: 1.2;
}

.feature-text p {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.feature-visual {
  flex: 1;
  min-width: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-visual-box {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  box-shadow: var(--shadow-sm);
}

.section-dark .feature-visual-box {
  background: #1d1d1f;
}

/* ============================================
   APP HERO
   ============================================ */

.app-hero {
  text-align: center;
  padding: 100px 24px 80px;
  background: linear-gradient(180deg, #f5f5f7 0%, #ffffff 100%);
}

.app-icon {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  margin: 0 auto 28px;
  box-shadow: 0 8px 32px rgba(99,102,241,0.3);
  color: #fff;
}

.app-hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.app-hero h2 {
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.app-meta {
  display: flex;
  justify-content: center;
  gap: 32px;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.app-meta span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.app-meta strong {
  font-size: 17px;
  color: var(--text);
  font-weight: 600;
}

/* ============================================
   PRIVACY POLICY PAGE
   ============================================ */

.privacy-hero {
  background: var(--bg-dark);
  color: #f5f5f7;
  text-align: center;
  padding: 80px 24px 60px;
}

.privacy-hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.privacy-hero p {
  font-size: 19px;
  color: #a1a1a6;
}

.privacy-content {
  max-width: 780px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

.privacy-content h2 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 52px 0 16px;
  color: var(--text);
}

.privacy-content h2:first-child {
  margin-top: 0;
}

.privacy-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 12px;
  color: var(--text);
}

.privacy-content p {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.privacy-content ul {
  margin: 0 0 20px 20px;
}

.privacy-content li {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.6;
}

.privacy-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 15px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.privacy-table thead {
  background: var(--bg-alt);
}

.privacy-table th {
  padding: 14px 18px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.3px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.privacy-table td {
  padding: 14px 18px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  line-height: 1.5;
}

.privacy-table tr:last-child td { border-bottom: none; }

.privacy-highlight {
  background: var(--blue-light);
  border-left: 3px solid var(--blue);
  padding: 18px 22px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 20px 0;
  font-size: 15px;
  color: var(--text);
  line-height: 1.6;
}

.privacy-highlight strong {
  color: var(--blue);
}

.sign-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 32px 20px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  margin: 24px 0;
  flex-wrap: wrap;
}

.sign-flow-box {
  background: var(--bg);
  padding: 18px 22px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  text-align: center;
  min-width: 200px;
}

.sign-flow-box .label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.sign-flow-box code {
  font-size: 13px;
  background: var(--bg-alt);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--text);
  font-family: "SF Mono", "Fira Code", monospace;
  word-break: break-all;
}

.sign-flow-arrow {
  font-size: 24px;
  color: var(--text-tertiary);
  font-weight: 300;
}

.rights-grid-apple {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.right-card-apple {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 24px;
  transition: background 0.2s;
}

.right-card-apple:hover {
  background: #e8e8ed;
}

.right-card-apple .icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.right-card-apple h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.right-card-apple p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.contact-card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 28px;
  margin: 20px 0;
}

.contact-card p {
  margin-bottom: 8px;
  font-size: 15px;
}

.contact-card strong {
  color: var(--text);
  display: inline-block;
  min-width: 80px;
}

/* ============================================
   FOOTER — Apple-style footer
   ============================================ */

.footer {
  background: var(--bg-alt);
  padding: 40px 24px 28px;
  border-top: 1px solid var(--border-light);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: 0.2px;
}

.footer-col a {
  display: block;
  font-size: 13px;
  color: var(--text-tertiary);
  text-decoration: none;
  margin-bottom: 8px;
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--text); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.footer-bottom a {
  color: var(--blue);
  text-decoration: none;
}

.footer-bottom a:hover { text-decoration: underline; }

.footer-bottom-links {
  display: flex;
  gap: 16px;
}

/* ============================================
   ADMIN PAGES (keep functional)
   ============================================ */

.admin-body {
  background: var(--bg-alt);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.login-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
}

.login-header {
  text-align: center;
  margin-bottom: 36px;
}

.login-header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.login-header p {
  font-size: 15px;
  color: var(--text-secondary);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  transition: border-color 0.2s;
  outline: none;
  font-family: inherit;
}

.form-group input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,113,227,0.12);
}

.form-error {
  display: none;
  background: #fef2f2;
  color: #dc2626;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 980px;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
  font-family: inherit;
}

.btn-primary:hover { background: var(--blue-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.login-footer {
  text-align: center;
  margin-top: 20px;
}

.login-footer a {
  color: var(--blue);
  text-decoration: none;
  font-size: 14px;
}

.login-footer a:hover { text-decoration: underline; }

/* Dashboard */
.dashboard-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.dashboard-nav .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 52px;
}

.nav-brand h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-user {
  font-size: 14px;
  color: var(--text-secondary);
}

.btn-logout {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 6px 16px;
  border-radius: 980px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.dashboard-body { background: #f5f5f7; }

.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 24px;
}

.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card.highlight {
  border-left: 3px solid var(--blue);
}

.stat-icon {
  font-size: 32px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.stat-info { display: flex; flex-direction: column; }

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
  line-height: 1.2;
}

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.chart-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: -0.2px;
}

.chart-wrapper { position: relative; height: 260px; }
.chart-wrapper-pie { position: relative; height: 300px; }

.table-section {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 24px;
}

.table-section h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: -0.2px;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.table-header h3 { margin-bottom: 0; }

.table-filters select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  cursor: pointer;
  outline: none;
}

.table-filters select:focus { border-color: var(--blue); }

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.table-wrapper .data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 0;
}

.table-wrapper .data-table thead {
  background: var(--bg-alt);
}

.table-wrapper .data-table th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.table-wrapper .data-table td {
  padding: 12px 14px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-ios { background: #e0e7ff; color: #4338ca; }
.badge-android { background: #d1fae5; color: #065f46; }
.badge-unknown { background: #f1f5f9; color: #64748b; }

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

.pagination button {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 980px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
  background: var(--bg-alt);
}

.pagination button:disabled { opacity: 0.3; cursor: not-allowed; }

.pagination span {
  font-size: 13px;
  color: var(--text-secondary);
}

code {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.9em;
  color: var(--text);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 834px) {
  .feature-row {
    flex-direction: column !important;
    gap: 40px;
  }

  .charts-row {
    grid-template-columns: 1fr;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 60px 20px 40px;
  }

  .section {
    padding: 60px 20px;
  }

  .nav-links {
    gap: 16px;
  }

  .nav-links a {
    font-size: 12px;
  }

  .sign-flow {
    flex-direction: column;
  }

  .sign-flow-arrow {
    transform: rotate(90deg);
  }

  .rights-grid-apple {
    grid-template-columns: 1fr 1fr;
  }

  .privacy-content {
    padding: 40px 20px 60px;
  }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 36px; }
  .hero h2 { font-size: 21px; }
  .hero-sub { font-size: 16px; }

  .nav-links { gap: 12px; }
  .nav-links a { font-size: 11px; }

  .login-card { padding: 32px 24px; }

  .rights-grid-apple {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
