/*
  主站样式 · 零外部依赖
  设计原则：
    - 极简、可读、有信赖感
    - 移动端友好（响应式 Grid）
    - 暗色主题（与 Anthropic / 开发者审美对齐）
*/

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

/* ===== Tokens ===== */
:root {
  --bg: #0e0e10;
  --bg-elev: #18181b;
  --bg-elev-2: #1f1f24;
  --border: #2a2a30;
  --text: #ededee;
  --text-dim: #a0a0a8;
  --text-faint: #6e6e76;
  --accent: #c96442;       /* Anthropic 暖色调 */
  --accent-hover: #d97757;
  --warning: #d99748;
  --success: #6ed99c;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.2);
}

/* ===== Base ===== */
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); }

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  background: var(--bg-elev-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--text);
}

/* ===== Top bar ===== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
.logo { font-weight: 600; color: var(--text); letter-spacing: 0.3px; }
.topbar-meta { font-size: 13px; color: var(--text-faint); }

/* ===== Main layout ===== */
main {
  flex: 1;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 24px 24px;
}
@media (max-width: 480px) {
  main { padding: 32px 16px 16px; }
}

/* ===== Hero ===== */
.hero { text-align: center; margin-bottom: 64px; }
.hero h1 {
  font-size: clamp(22px, 4.6vw, 42px);
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 12px;
  line-height: 1.3;
  word-break: break-word;
  padding: 0 4px;
}
@media (max-width: 480px) {
  .hero h1 .title-sep { display: none; }
  .hero h1 .title-sub { display: block; color: var(--text-dim); font-size: 0.7em; margin-top: 4px; }
}
.hero .subtitle {
  color: var(--text-dim);
  font-size: clamp(12px, 3.5vw, 15px);
  margin-bottom: 36px;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
  word-break: break-word;
  padding: 0 8px;
}

/* ===== Card 通用 ===== */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
@media (max-width: 480px) {
  .card { padding: 20px; }
}

/* ===== Hero card (download box) ===== */
.hero-card {
  max-width: 560px;
  margin: 0 auto 24px;
  text-align: left;
  box-shadow: var(--shadow);
}

.detected-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--text-dim);
}
.detected-info .check { color: var(--success); }

.download-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 12px;
  background: var(--accent);
  color: white;
  font-size: clamp(13px, 3.6vw, 16px);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
  text-decoration: none;
  text-align: center;
  word-break: break-word;
  line-height: 1.3;
}
.download-button > span:last-child { min-width: 0; }
.download-button:hover { background: var(--accent-hover); color: white; }
.download-button:active { transform: scale(0.99); }

.download-meta {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-faint);
  text-align: center;
}
.download-meta code { font-size: 11px; }

.alt-platforms {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}
.alt-platforms a {
  margin: 0 6px;
  color: var(--text-dim);
  border-bottom: 1px dashed var(--text-faint);
}
.alt-platforms a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Detecting state */
.detecting { text-align: center; padding: 24px 0; color: var(--text-dim); }
.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Mobile / unsupported state */
.unsupported {
  text-align: center;
  padding: 24px 0;
  color: var(--text-dim);
}
.unsupported strong { color: var(--text); display: block; margin-bottom: 8px; font-size: 16px; }

.scroll-hint {
  margin-top: 32px;
  font-size: 13px;
  color: var(--text-faint);
  animation: bob 2s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

/* ===== 三块卡片 grid ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 56px;
}
@media (max-width: 820px) {
  .cards-grid { grid-template-columns: 1fr; }
}

.info-card {
  display: flex;
  flex-direction: column;
}
.info-card .card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-elev-2);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 16px;
}
.info-card h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text);
}
.info-card p {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.info-card p strong { color: var(--text); font-weight: 600; }
.info-card ol, .info-card ul { padding-left: 20px; color: var(--text-dim); font-size: 14px; }
.info-card ol li, .info-card ul li { margin-bottom: 8px; }

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  background: var(--bg-elev-2);
  padding: 4px;
  border-radius: var(--radius-sm);
}
.tab {
  flex: 1;
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
  font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab-active { background: var(--bg-elev); color: var(--text); }

.tab-content { display: none; }
.tab-content-active { display: block; }

/* ===== Link list ===== */
.link-list { list-style: none; padding: 0; margin: 0 0 12px; }
.link-list li { margin-bottom: 10px; }
.link-list li a {
  display: block;
  padding: 12px 14px;
  background: var(--bg-elev-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.link-list li a:hover {
  border-color: var(--accent);
  background: rgba(201, 100, 66, 0.05);
}
.link-list .link-title {
  display: block;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 2px;
  font-size: 14px;
}
.link-list .link-desc {
  display: block;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.5;
}

/* ===== Primary link button (in card 3) ===== */
.primary-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  background: var(--bg-elev-2);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 16px;
  transition: all 0.15s;
}
.primary-link-button:hover {
  background: var(--accent);
  color: white;
}

/* ===== Card footnote ===== */
.card-footnote {
  font-size: 12px !important;
  color: var(--text-faint) !important;
  margin-top: auto !important;
  padding-top: 12px;
  line-height: 1.6;
}
.card-footnote.warning { color: var(--warning) !important; }

/* ===== Community hint ===== */
.community-hint {
  text-align: center;
  padding: 24px;
  margin-bottom: 48px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-dim);
}
.community-hint a {
  color: var(--accent);
  font-weight: 500;
  border-bottom: 1px solid currentColor;
}

/* ===== Footer ===== */
footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.7;
}
.footer-main { margin-bottom: 12px; }
.footer-meta a { color: var(--text-faint); border-bottom: 1px dotted var(--text-faint); }
.footer-meta a:hover { color: var(--accent); border-bottom-color: var(--accent); }
