/* ===== 纸飞机导航 - 前台全局样式 ===== */

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

:root {
  --bg: #0a0a0f;
  --surface: rgba(255,255,255,0.03);
  --border: rgba(255,255,255,0.06);
  --text: #e0e0e0;
  --text-secondary: #888;
  --text-muted: #666;
  --accent-start: #7c3aed;
  --accent-end: #3b82f6;
  --accent-rgb: 124, 58, 237;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

/* ============================
   TOP BAR
   ============================ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10,10,15,0.93);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar .logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700;
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  text-decoration: none;
}
.topbar .logo .icon {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; -webkit-text-fill-color: #fff;
}
.topbar .nav { display: flex; gap: 2px; align-items: center; }
.topbar .nav a {
  color: #888; text-decoration: none; font-size: 13px;
  padding: 6px 12px; border-radius: 8px; transition: all 0.2s;
}
.topbar .nav a:hover, .topbar .nav a.active { color: #fff; background: rgba(255,255,255,0.08); }

/* 商业按钮 */
.topbar .commercial-links { display: flex; gap: 6px; }
.topbar .commercial-links a {
  padding: 6px 14px; border-radius: 8px; font-size: 13px;
  text-decoration: none; font-weight: 500;
  transition: all 0.2s;
}
.topbar .commercial-links .buy-account {
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #fff;
}
.topbar .commercial-links .buy-account:hover { opacity: 0.9; }
.topbar .commercial-links .rocket {
  background: rgba(59,130,246,0.15);
  color: #60a5fa; border: 1px solid rgba(59,130,246,0.3);
}
.topbar .commercial-links .rocket:hover { background: rgba(59,130,246,0.25); }

/* ============================
   DEVICE BAR
   ============================ */
.device-bar {
  margin-top: 56px;
  padding: 10px 24px;
  background: linear-gradient(90deg, rgba(124,58,237,0.08), rgba(59,130,246,0.08));
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; flex-wrap: wrap;
}
.device-bar .device-label { color: #888; }
.device-bar .device-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 6px;
  background: rgba(124,58,237,0.2);
  color: #a78bfa; font-weight: 500; font-size: 13px;
}
.device-bar .device-switch { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.device-bar .device-switch .ds-btn {
  padding: 3px 10px; border-radius: 6px; font-size: 12px;
  border: 1px solid var(--border); background: transparent;
  color: #666; cursor: pointer; transition: all 0.15s;
}
.device-bar .device-switch .ds-btn.active {
  background: rgba(124,58,237,0.15); color: #a78bfa; border-color: rgba(124,58,237,0.3);
}
.device-bar .device-switch .ds-btn:hover { color: #aaa; }

/* ============================
   COMMERCIAL BANNERS
   ============================ */
.commercial-banners {
  max-width: 1200px; margin: 0 auto; padding: 20px 24px 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.commercial-banners .cb-item {
  padding: 20px 24px; border-radius: 14px;
  text-decoration: none; display: flex; align-items: center;
  justify-content: space-between; transition: transform 0.2s;
}
.commercial-banners .cb-item:hover { transform: translateY(-2px); }
.commercial-banners .cb-accounts {
  background: linear-gradient(135deg, #7c2d12, #9a3412);
  border: 1px solid rgba(249,115,22,0.3);
}
.commercial-banners .cb-rocket {
  background: linear-gradient(135deg, #1e3a5f, #0c4a6e);
  border: 1px solid rgba(56,189,248,0.3);
}
.commercial-banners .cb-item .cb-text h3 { color: #fff; font-size: 16px; }
.commercial-banners .cb-item .cb-text p { color: rgba(255,255,255,0.6); font-size: 12px; margin-top: 2px; }
.commercial-banners .cb-item .cb-arrow { font-size: 20px; color: rgba(255,255,255,0.5); transition: transform 0.2s; }
.commercial-banners .cb-item:hover .cb-arrow { transform: translateX(4px); color: #fff; }

/* ============================
   MAIN LAYOUT
   ============================ */
.main-content { max-width: 1200px; margin: 0 auto; padding: 16px 24px 40px; }

/* ============================
   BANNER SLIDER
   ============================ */
.hero { padding: 0 24px 16px; max-width: 1248px; margin: 0 auto; }
.banner-slider {
  position: relative;
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
  border-radius: 16px;
  padding: 36px 40px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.banner-slider .bg-glow {
  position: absolute; top: -50%; right: -20%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(124,58,237,0.15), transparent 70%);
}
.banner-slider h2 { font-size: 26px; color: #fff; margin-bottom: 8px; position: relative; }
.banner-slider p { color: #aaa; font-size: 14px; margin-bottom: 16px; position: relative; }
.banner-slider .btn-download {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  color: #fff; text-decoration: none;
  padding: 10px 28px; border-radius: 10px; font-weight: 600; font-size: 14px;
  transition: transform 0.2s; position: relative;
}
.banner-slider .btn-download:hover { transform: translateY(-2px); }
.banner-dots {
  display: flex; gap: 8px; margin-top: 16px;
}
.banner-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.2); cursor: pointer; transition: all 0.2s;
}
.banner-dots span.active { background: var(--accent-start); width: 24px; border-radius: 4px; }

/* ============================
   SECTIONS
   ============================ */
.section { margin-bottom: 32px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-header h3 {
  font-size: 16px; font-weight: 600; color: #fff;
  display: flex; align-items: center; gap: 8px;
}
.section-header h3 .s-icon {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.section-header .more { color: var(--text-secondary); font-size: 12px; text-decoration: none; }
.section-header .more:hover { color: var(--accent-start); }

/* ============================
   LINK GRID
   ============================ */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.link-card {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 16px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: #ccc;
  transition: all 0.25s;
  position: relative;
}
.link-card:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(124,58,237,0.3);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.link-card .link-icon {
  width: 40px; height: 40px;
  background: rgba(124,58,237,0.12);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 8px;
}
.link-card .link-title { font-size: 13px; font-weight: 500; color: #e0e0e0; }
.link-card .link-desc { font-size: 11px; color: #666; margin-top: 2px; }
.link-card .hot-badge {
  position: absolute; top: 6px; right: 6px;
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 4px;
  font-weight: 600;
}

/* ============================
   DOWNLOAD SECTION
   ============================ */
.download-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
}
.download-section .ds-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.download-section .ds-header h3 { font-size: 18px; color: #fff; }
.download-section .ds-header .device-hint {
  font-size: 12px; color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
  padding: 4px 10px; border-radius: 6px;
}
.download-section .subtitle { color: var(--text-secondary); font-size: 12px; margin-bottom: 16px; }

.platform-tabs {
  display: flex; gap: 4px; margin-bottom: 16px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px; padding: 4px; width: fit-content;
  flex-wrap: wrap;
}
.platform-tabs .tab {
  padding: 7px 16px; border-radius: 8px; font-size: 13px;
  color: var(--text-secondary); cursor: pointer; transition: all 0.2s;
  border: none; background: transparent;
}
.platform-tabs .tab.active { background: rgba(124,58,237,0.2); color: #a78bfa; font-weight: 500; }
.platform-tabs .tab:hover:not(.active) { color: #ccc; }

.download-list { display: flex; flex-direction: column; gap: 10px; }
.download-item {
  display: flex; align-items: center;
  padding: 14px 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.2s;
}
.download-item:hover { border-color: rgba(124,58,237,0.2); background: rgba(255,255,255,0.05); }
.download-item .d-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(59,130,246,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-right: 14px; flex-shrink: 0;
}
.download-item .d-info { flex: 1; }
.download-item .d-info .d-name { font-size: 14px; font-weight: 500; color: #e0e0e0; }
.download-item .d-info .d-meta { font-size: 11px; color: #666; margin-top: 1px; }
.download-item .d-info .d-meta .tag {
  display: inline-block; padding: 1px 6px; border-radius: 3px;
  font-size: 10px; margin-left: 6px;
}
.tag-local { background: rgba(34,197,94,0.12); color: #4ade80; }
.tag-appstore { background: rgba(59,130,246,0.12); color: #60a5fa; }
.tag-redirect { background: rgba(234,179,8,0.12); color: #facc15; }
.download-item .d-info .d-note { font-size: 11px; color: #f97316; margin-top: 2px; }
.download-item .d-btn {
  padding: 7px 18px;
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  border: none; border-radius: 8px; color: #fff; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; text-decoration: none; flex-shrink: 0;
}
.download-item .d-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.download-item .d-btn-appstore {
  background: rgba(59,130,246,0.2); color: #60a5fa;
  border: 1px solid rgba(59,130,246,0.3);
}
.download-item .d-btn-redirect {
  background: rgba(234,179,8,0.15); color: #facc15;
  border: 1px solid rgba(234,179,8,0.2);
}
.download-item .d-btn-disabled {
  background: rgba(255,255,255,0.05); color: #555;
  cursor: not-allowed; border: 1px solid var(--border);
}

/* ============================
   GUIDE CARD & MODAL
   ============================ */
.guide-card {
  margin-bottom: 16px;
  padding: 14px 18px;
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.15);
  border-radius: 12px;
}
.guide-card h4 { font-size: 14px; color: #fbbf24; margin-bottom: 4px; }
.guide-card p { font-size: 12px; color: #aaa; }
.guide-card .guide-btn {
  display: inline-block; margin-top: 8px;
  padding: 5px 14px; border-radius: 6px;
  background: rgba(245,158,11,0.15); color: #fbbf24;
  border: 1px solid rgba(245,158,11,0.2); text-decoration: none;
  font-size: 12px; transition: all 0.15s; cursor: pointer;
}
.guide-card .guide-btn:hover { background: rgba(245,158,11,0.25); }

/* 弹窗遮罩 */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6); z-index: 9999;
  align-items: center; justify-content: center;
}
.modal-overlay .modal-box {
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  max-width: 90vw;
}

/* ============================
   FOOTER
   ============================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center; color: #555; font-size: 12px;
}
.footer a { color: #666; text-decoration: none; }
.footer a:hover { color: var(--accent-start); }

/* ============================
   LOADING & ERROR STATES
   ============================ */
.loading { text-align: center; padding: 60px 20px; color: #666; }
.loading .spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--accent-start); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.load-error { text-align: center; padding: 40px 20px; color: #f87171; font-size: 14px; }

.empty-state { text-align: center; padding: 40px; color: #555; font-size: 13px; }

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 768px) {
  .topbar .nav { display: none; }
  .topbar .commercial-links a { font-size: 12px; padding: 5px 10px; }
  .commercial-banners { grid-template-columns: 1fr; }
  .link-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .device-bar .device-switch { margin-left: 0; width: 100%; }
  .banner-slider h2 { font-size: 18px; }
  .banner-slider { padding: 24px 20px; }
  .download-item { flex-wrap: wrap; }
  .download-item .d-btn { margin-top: 8px; width: 100%; text-align: center; }
  .hero { padding: 0 12px 12px; }
  .main-content { padding: 12px; }
}
