/* ============================================================
   CLASH DOWNLOAD PAGE — STYLESHEET
   Extends main.css design tokens; do not duplicate global rules here.
   ============================================================ */

/* ---------- Download Hero ---------- */
.dl-hero {
  position: relative;
  padding: 110px 0 70px;
  overflow: hidden;
}

.dl-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.dl-hero .container { position: relative; z-index: 1; }

.dl-hero-inner {
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.dl-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,45,91,0.1);
  border: 1px solid rgba(255,45,91,0.28);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 16px;
  border-radius: 100px;
  margin-bottom: 22px;
}

.dl-kicker-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: kpulse 2s ease-in-out infinite;
}

@keyframes kpulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.7); }
}

.dl-hero-h1 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin-bottom: 18px;
}

.dl-hero-h1 span { color: var(--accent); }

.dl-hero-sub {
  font-size: clamp(15px, 2vw, 17px);
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Hero platform quick-pick row */
.dl-hero-platforms {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.dl-hpf-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background: var(--bg-card);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.dl-hpf-btn:hover,
.dl-hpf-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255,45,91,0.06);
  box-shadow: 0 0 20px rgba(255,45,91,0.15);
}

/* Hero trust stats */
.dl-hero-trust {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 24px;
  font-size: 13px;
  color: var(--text-3);
}

.dl-trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dl-trust-item i { color: var(--green); font-size: 12px; }
.dl-trust-sep { width: 4px; height: 4px; border-radius: 50%; background: var(--border-h); }

/* ---------- Sticky Platform Tabs ---------- */
.platform-tabs {
  position: sticky;
  top: 68px;
  z-index: 200;
  background: rgba(245,247,252,0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}

.pt-inner {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 10px 0;
}
.pt-inner::-webkit-scrollbar { display: none; }

.pt-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.pt-tab:hover {
  background: rgba(0,0,0,0.05);
  color: var(--text);
}

.pt-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255,45,91,0.35);
}

.pt-tab i { font-size: 16px; }

/* ---------- Platform Section ---------- */
.platform-section {
  padding: 64px 0 80px;
}

.platform-section[hidden] { display: none; }

.ps-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 36px;
}

.ps-title-group { display: flex; flex-direction: column; gap: 8px; }

.ps-platform-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.ps-platform-label i { font-size: 0.9em; color: var(--accent); }

.ps-sysreq {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sysreq-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
}

/* ---------- Client Cards Layout ---------- */
.client-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.client-grid-primary {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* ---------- Client Card ---------- */
.client-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.client-card:hover {
  border-color: var(--border-h);
  box-shadow: 0 8px 40px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.client-card.card-primary {
  border-color: rgba(255,45,91,0.35);
  background: linear-gradient(135deg, rgba(255,45,91,0.04) 0%, rgba(255,255,255,0.95) 50%);
}

.client-card.card-primary::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.client-card.card-archived {
  opacity: 0.8;
  border-style: dashed;
  background: rgba(0,0,0,0.02);
}

/* Card top row: icon + name + badges */
.cc-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.cc-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,45,91,0.15), rgba(123,63,228,0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--accent);
  flex-shrink: 0;
}

.cc-icon.icon-purple { color: var(--purple); background: linear-gradient(135deg, rgba(123,63,228,0.15), rgba(0,153,204,0.1)); }
.cc-icon.icon-cyan { color: var(--cyan); background: linear-gradient(135deg, rgba(0,153,204,0.15), rgba(0,168,107,0.1)); }
.cc-icon.icon-green { color: var(--green); background: linear-gradient(135deg, rgba(0,168,107,0.15), rgba(0,153,204,0.1)); }
.cc-icon.icon-gray { color: var(--text-3); background: var(--bg-1); }

.cc-name-group { flex: 1; min-width: 0; }

.cc-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 5px;
}

.cc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-star {
  background: rgba(255,45,91,0.12);
  border: 1px solid rgba(255,45,91,0.3);
  color: var(--accent);
}

.badge-newbie {
  background: rgba(0,153,204,0.12);
  border: 1px solid rgba(0,153,204,0.3);
  color: var(--cyan);
}

.badge-archived {
  background: rgba(212,152,0,0.12);
  border: 1px solid rgba(212,152,0,0.3);
  color: var(--yellow);
}

/* Card description */
.cc-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
}

/* Feature chips */
.cc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cc-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
}

/* Download buttons */
.cc-dl-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.cc-dl-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.cc-dl-primary:hover {
  background: var(--accent-h);
  box-shadow: 0 0 28px rgba(255,45,91,0.45);
  transform: translateY(-1px);
}

/* Pulse animation on primary button */
.cc-dl-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(255,45,91,0.6);
  animation: btnPulse 2.4s ease-out infinite;
}

@keyframes btnPulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,45,91,0.5); }
  70%  { box-shadow: 0 0 0 10px rgba(255,45,91,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,45,91,0); }
}

.card-archived .cc-dl-primary { background: var(--yellow); }
.card-archived .cc-dl-primary::after { animation: none; }
.card-archived .cc-dl-primary:hover { background: #b98000; box-shadow: 0 0 20px rgba(212,152,0,0.35); }

.cc-dl-alts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cc-dl-alt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg-1);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  flex: 1;
  min-width: 0;
  justify-content: center;
}

.cc-dl-alt:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255,45,91,0.05);
}

/* GitHub link */
.cc-github {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.2s;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.cc-github:hover { color: var(--text); }
.cc-github i { font-size: 13px; }
.cc-github.github-deleted { cursor: default; color: var(--text-3) !important; }
.cc-github.github-closed { cursor: default; color: var(--text-3) !important; }

/* iOS App Store button */
.cc-dl-appstore {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: #0071e3;
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: var(--transition);
}

.cc-dl-appstore:hover {
  background: #0060c0;
  box-shadow: 0 0 22px rgba(0,113,227,0.4);
  transform: translateY(-1px);
}

.cc-price-note {
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  margin-top: 4px;
}

/* ---------- Platform Note / Info Box ---------- */
.platform-note {
  background: rgba(0,153,204,0.06);
  border: 1px solid rgba(0,153,204,0.2);
  border-radius: var(--r);
  padding: 16px 20px;
  margin-top: 24px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.platform-note i { color: var(--cyan); font-size: 16px; margin-top: 2px; flex-shrink: 0; }
.platform-note p { font-size: 13px; color: var(--text-2); line-height: 1.6; }
.platform-note strong { color: var(--text); }

/* ---------- Architecture Guide (Android) ---------- */
.arch-guide {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  margin-top: 28px;
}

.arch-guide-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.arch-guide-title i { color: var(--accent); }

.arch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.arch-table th {
  text-align: left;
  padding: 8px 12px;
  background: var(--bg-1);
  font-weight: 600;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}

.arch-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  line-height: 1.5;
}

.arch-table tr:last-child td { border-bottom: none; }
.arch-table .tag-rec { color: var(--green); font-weight: 600; }

/* ---------- iOS Guide ---------- */
.ios-guide-section {
  background: linear-gradient(135deg, rgba(0,113,227,0.05), rgba(123,63,228,0.05));
  border: 1.5px solid rgba(0,113,227,0.2);
  border-radius: var(--r-xl);
  padding: 40px;
  margin-top: 36px;
}

.ios-guide-head {
  text-align: center;
  margin-bottom: 32px;
}

.ios-guide-head h3 {
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 800;
  margin-bottom: 10px;
}

.ios-guide-head p { font-size: 14px; color: var(--text-2); line-height: 1.6; }

.ios-guide-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.ios-step {
  background: var(--bg-card);
  border-radius: var(--r);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--border);
}

.ios-step-num {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: #0071e3;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ios-step h4 { font-size: 14px; font-weight: 700; }
.ios-step p { font-size: 13px; color: var(--text-2); line-height: 1.5; }

/* ---------- Linux CLI ---------- */
.linux-cli-block {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: var(--r);
  padding: 20px;
  margin-top: 20px;
  overflow-x: auto;
}

.cli-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #30363d;
}

.cli-dots { display: flex; gap: 5px; }
.cli-dot { width: 10px; height: 10px; border-radius: 50%; }
.cli-dot.r { background: #ff5f57; }
.cli-dot.y { background: #febc2e; }
.cli-dot.g { background: #28c840; }
.cli-label { color: #8b949e; font-size: 12px; margin-left: auto; }

.cli-code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 13px;
  line-height: 1.8;
  color: #e6edf3;
  white-space: pre;
}

.cli-comment { color: #8b949e; }
.cli-prompt { color: #79c0ff; }
.cli-cmd { color: #a5d6ff; }
.cli-path { color: #f2cc60; }
.cli-ok { color: #3fb950; }

/* ---------- Quick Start ---------- */
.qs-section {
  padding: 80px 0;
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.qs-steps-dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
  position: relative;
}

.qs-step-dl {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  position: relative;
  z-index: 1;
  text-align: center;
}

.qs-step-num-dl {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 0 20px rgba(255,45,91,0.35);
}

.qs-step-dl h3 { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.qs-step-dl p { font-size: 14px; color: var(--text-2); line-height: 1.6; }

/* ---------- FAQ ---------- */
.faq-dl-section { padding: 80px 0; }

.faq-dl-grid {
  max-width: 820px;
  margin: 0 auto;
}

.faq-dl-item {
  border-bottom: 1px solid var(--border);
}

.faq-dl-item:first-child { border-top: 1px solid var(--border); }

.faq-dl-item details { width: 100%; }

.faq-dl-item details summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 4px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  gap: 12px;
  -webkit-user-select: none;
  user-select: none;
}

.faq-dl-item details summary::-webkit-details-marker { display: none; }

.faq-dl-item details summary::after {
  content: '+';
  font-size: 20px;
  color: var(--text-3);
  font-weight: 300;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.faq-dl-item details[open] summary::after {
  content: '−';
}

.faq-dl-answer {
  padding: 0 4px 20px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.75;
}

.faq-dl-answer p + p { margin-top: 10px; }
.faq-dl-answer strong { color: var(--text); }
.faq-dl-answer a { color: var(--accent); text-decoration: underline; }

/* ---------- Mihomo Core Section ---------- */
.core-section {
  padding: 64px 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.core-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 32px;
}

.core-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: var(--transition);
  color: var(--text);
}

.core-card:hover {
  border-color: var(--border-h);
  background: var(--bg-card);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.core-card i { color: var(--text-3); font-size: 18px; flex-shrink: 0; }
.core-card-info { flex: 1; min-width: 0; }
.core-card-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.core-card-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ---------- GitHub Trust Band ---------- */
.dl-github-band {
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.dl-gb-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.dl-gb-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dl-gb-icon {
  width: 52px; height: 52px;
  flex-shrink: 0;
  aspect-ratio: 1;
  border-radius: 14px;
  background: var(--text);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.dl-gb-left h3 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.dl-gb-left p { font-size: 14px; color: var(--text-2); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .client-grid-primary { grid-template-columns: 1fr; }
  .client-grid { grid-template-columns: 1fr 1fr; }
  .qs-steps-dl { grid-template-columns: 1fr; }
  .qs-steps-dl::before { display: none; }
  .ios-guide-section { padding: 28px 20px; }
  .ios-guide-steps { grid-template-columns: 1fr 1fr; }
  .dl-hero { padding: 90px 0 50px; }
  .platform-tabs { top: 60px; }
}

@media (max-width: 600px) {
  .client-grid { grid-template-columns: 1fr; }
  .ios-guide-steps { grid-template-columns: 1fr; }
  .dl-gb-inner { flex-direction: column; align-items: flex-start; }
  .cc-dl-alts { flex-direction: column; }
  .cc-dl-alt { width: 100%; }
  .arch-guide { padding: 18px; overflow-x: auto; }
}
