/* ==========================================================================
   大喵弹弹堂 - 软件下载中心
   主样式表：配色、布局、卡片、按钮、弹窗
   ========================================================================== */

:root {
  --primary: #4f6ef7;
  --primary-dark: #3b55d9;
  --accent: #ff7d4d;
  --success: #22b573;
  --text-main: #1f2430;
  --text-sub: #6b7280;
  --bg: #f4f6fb;
  --card-bg: #ffffff;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(31, 42, 90, 0.08);
  --shadow-hover: 0 12px 32px rgba(31, 42, 90, 0.16);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

/* ---------- 顶部横幅 ---------- */

.hero {
  position: relative;
  background: linear-gradient(135deg, #4f6ef7 0%, #7a5cf0 55%, #a44ee8 100%);
  color: #fff;
  padding: 56px 20px 72px;
  text-align: center;
  overflow: hidden;
}

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

.hero h1 {
  font-size: 2.4rem;
  letter-spacing: 2px;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
  margin-bottom: 8px;
}

.hero-sub {
  font-size: 1.05rem;
  opacity: 0.92;
  margin-bottom: 14px;
}

.hero-qq {
  display: inline-block;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 6px 18px;
  font-size: 0.95rem;
  backdrop-filter: blur(4px);
}

.qq-link { font-weight: 700; color: #ffe9a8; }

.hero-announcement {
  margin-top: 12px;
  font-size: 0.85rem;
  opacity: 0.8;
}

/* 横幅装饰圆 */
.hero-deco {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.hero-deco-1 { width: 240px; height: 240px; top: -80px; left: -60px; }
.hero-deco-2 { width: 320px; height: 320px; bottom: -140px; right: -80px; }

/* ---------- 主体与网格 ---------- */

.container {
  width: 100%;
  max-width: 1080px;
  margin: -36px auto 40px;
  padding: 0 20px;
  flex: 1;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 18px;
}

.section-title h2 { font-size: 1.35rem; }

.app-count {
  font-size: 0.85rem;
  color: var(--text-sub);
  background: #e8ecfa;
  border-radius: 999px;
  padding: 2px 12px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
}

/* ---------- 软件卡片 ---------- */

.app-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 22px 20px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(31, 42, 90, 0.05);
}

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

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.app-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eef1ff, #f7efff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  flex-shrink: 0;
}

.app-name { font-size: 1.15rem; font-weight: 700; }

.app-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.version-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: #eef1ff;
  border-radius: 6px;
  padding: 1px 8px;
}

.date-badge {
  font-size: 0.75rem;
  color: var(--text-sub);
}

.app-desc {
  color: var(--text-sub);
  font-size: 0.92rem;
  margin: 6px 0 14px;
  flex: 1;
}

.app-size { font-size: 0.8rem; color: var(--text-sub); margin-bottom: 14px; }

/* ---------- 按钮组 ---------- */

.btn-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 10px;
  padding: 10px 8px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #7a5cf0);
  color: #fff;
}

.btn-doc {
  background: #eef7f1;
  color: var(--success);
  border: 1px solid #cdeeda;
}

/* ---------- 页脚 ---------- */

.footer {
  text-align: center;
  padding: 22px 16px;
  color: var(--text-sub);
  font-size: 0.85rem;
  background: #eceff7;
}

/* ---------- 状态 ---------- */

.loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-sub);
  padding: 60px 0;
  font-size: 0.95rem;
}

.error-box {
  grid-column: 1 / -1;
  text-align: center;
  background: #fff2f2;
  color: #b44444;
  border-radius: var(--radius);
  padding: 24px;
}

/* ---------- 说明文档页 ---------- */

.doc-page {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 34px;
  max-width: 860px;
  margin: -36px auto 40px;
}

.doc-page h2 { margin-bottom: 6px; }
.doc-page .doc-meta { color: var(--text-sub); font-size: 0.9rem; margin-bottom: 24px; }
.doc-page h3 {
  font-size: 1.05rem;
  margin: 26px 0 10px;
  padding-left: 10px;
  border-left: 4px solid var(--primary);
}
.doc-page p, .doc-page li { color: #3c4356; font-size: 0.94rem; }
.doc-page ul, .doc-page ol { padding-left: 22px; margin: 8px 0; }
.doc-page .doc-back {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 600;
}

/* 说明文档内容元素：表格 / 图片 / 问答 / 提示框 */
.doc-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 16px;
  font-size: 0.88rem;
  display: block;
  overflow-x: auto;
}
.doc-page th, .doc-page td {
  border: 1px solid #e3e7f0;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.doc-page th { background: #f4f6fb; color: #2c3550; white-space: nowrap; }
.doc-page tr:nth-child(even) td { background: #fafbfd; }

.doc-page img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid #e3e7f0;
  margin: 8px 0 4px;
  box-shadow: var(--shadow);
}
.doc-page .img-caption {
  font-size: 0.8rem;
  color: var(--text-sub);
  text-align: center;
  margin-bottom: 14px;
}

.doc-page .qa { margin: 12px 0; }
.doc-page .qa .q { font-weight: 700; color: #2c3550; }
.doc-page .qa .a { color: #3c4356; margin-top: 2px; }

.doc-page .note {
  background: #fffaf5;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.88rem;
  color: #5a4a3f;
  margin: 10px 0;
}

/* ---------- 响应式 ---------- */

@media (max-width: 640px) {
  .hero { padding: 44px 16px 64px; }
  .hero h1 { font-size: 1.7rem; }
  .container { margin-top: -30px; }
  .app-grid { grid-template-columns: 1fr; }
  .doc-page { padding: 26px 20px; }
}
