/* ============ 基础 ============ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  cursor: default;
}

:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --light: #9aa5b5;
  --border: #e6ebf2;
  --accent: #2f6fed;
  --accent-soft: #e9f0fc;
  --btn-bg: #eef2f8;
  --btn-hover: #e1ecfb;
  --radius: 12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}
.container.narrow { max-width: 720px; }

/* ============ 顶部导航 ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(246, 248, 251, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, #5b8def, #2f6fed);
}

.nav-links {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--muted);
}
.nav-links a:hover { color: var(--accent); }

/* ============ Hero ============ */
.hero {
  padding: 40px 0 16px;
  text-align: center;
}

.hero h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
}

.subtitle {
  margin-top: 8px;
  font-size: 15px;
  color: var(--muted);
}

.search-box {
  max-width: 460px;
  margin: 16px auto 0;
}

.search-box input {
  width: 100%;
  height: 46px;
  padding: 0 20px;
  font-size: 14px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  outline: none;
  cursor: text;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-box input::placeholder { color: var(--light); }
.search-box input:focus {
  border-color: #bcd2f6;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ============ 分类标签 ============ */
.section { padding: 24px 0 64px; }
#apps.section { padding: 12px 0 24px; }
#apps .tabs { margin-bottom: 18px; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

.tab {
  padding: 7px 18px;
  font-size: 14px;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 18px;
  transition: background 0.15s, color 0.15s;
}
.tab:hover { color: var(--accent); background: var(--btn-hover); }
.tab.active { background: var(--btn-bg); color: var(--text); font-weight: 600; }

/* ============ 软件卡片 ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.card:hover {
  border-color: #c9dcfb;
  box-shadow: 0 8px 24px rgba(47, 111, 237, 0.08);
  transform: translateY(-2px);
}

/* 编辑推荐：边框与阴影强调，仍与普通卡片保持一致高度 */
.card-rec {
  border-color: #c9dcfb;
  box-shadow: 0 6px 18px rgba(47, 111, 237, 0.07);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-icon {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.app-title { font-size: 16px; font-weight: 600; }
.app-meta { margin-top: 2px; font-size: 12px; color: var(--light); }

.app-desc {
  margin: 14px 0 18px;
  font-size: 13.5px;
  color: var(--muted);
  flex: 1;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.badge {
  font-size: 11.5px;
  color: var(--muted);
  background: var(--btn-bg);
  padding: 3px 9px;
  border-radius: 10px;
}

/* 推荐标签：用主色块突出，与普通标签区分 */
.badge[data-tag="推荐"] {
  color: #fff;
  background: var(--accent);
  font-weight: 600;
}

.btn {
  padding: 8px 20px;
  font-size: 13.5px;
  color: var(--text);
  background: var(--btn-bg);
  border: none;
  border-radius: 8px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.btn:hover { background: var(--btn-hover); color: var(--accent); }

/* ============ 空状态 / 关于 / 页脚 ============ */
.empty {
  padding: 60px 0;
  text-align: center;
  font-size: 14px;
  color: var(--light);
}

.about h2 { font-size: 20px; margin-bottom: 14px; }
.about p { font-size: 14.5px; color: var(--muted); margin-bottom: 10px; }
.about .contact { margin-top: 16px; }
.about a { color: var(--accent); }
.about a:hover { text-decoration: underline; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  text-align: center;
  font-size: 13px;
  color: var(--light);
}

.footer-beian { margin-top: 6px; }
.footer-beian a { color: var(--light); }
.footer-beian a:hover { color: var(--accent); }

/* ============ 详情页 ============ */
.back-link {
  display: inline-block;
  margin-bottom: 20px;
  font-size: 13.5px;
  color: var(--muted);
}
.back-link:hover { color: var(--accent); }

.detail-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.detail-icon {
  width: 64px;
  height: 64px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 26px;
  font-weight: 700;
}

.detail-info { flex: 1; min-width: 0; }
.detail-info h1 { font-size: 22px; font-weight: 700; }
.detail-desc { margin: 10px 0 12px; font-size: 14px; color: var(--muted); }

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.detail-actions .btn { text-align: center; min-width: 120px; }

.tabs-left {
  justify-content: flex-start;
  margin-bottom: 20px;
}

.panel { animation: fade-in 0.15s ease; }
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.loading { color: var(--light); font-size: 14px; }

/* ---- README 排版 ---- */
.md {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 36px;
  font-size: 14.5px;
  color: #374151;
}
.md h1 { font-size: 24px; margin-bottom: 16px; }
.md h2 {
  font-size: 18px;
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.md h3 { font-size: 15.5px; margin: 20px 0 8px; }
.md p { margin: 10px 0; line-height: 1.8; }
.md ul, .md ol { margin: 10px 0; padding-left: 24px; }
.md li { margin: 6px 0; line-height: 1.7; }
.md a { color: var(--accent); }
.md a:hover { text-decoration: underline; }
.md hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.md blockquote {
  margin: 12px 0;
  padding: 8px 14px;
  border-left: 3px solid #c9dcfb;
  background: var(--bg);
  color: var(--muted);
  border-radius: 0 6px 6px 0;
}
.md code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  background: var(--btn-bg);
  padding: 2px 6px;
  border-radius: 5px;
}
.md pre {
  margin: 14px 0;
  padding: 16px 18px;
  background: #f4f6fa;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
}
.md pre code { background: none; padding: 0; font-size: 13px; line-height: 1.7; }

/* ---- 源码浏览 ---- */
.source-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.file-list {
  width: 200px;
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
}

.file-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: Consolas, "Courier New", monospace;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 7px;
  transition: background 0.15s, color 0.15s;
}
.file-item:hover { background: var(--btn-hover); color: var(--accent); }
.file-item.active { background: var(--btn-bg); color: var(--text); font-weight: 600; }

.code-wrap {
  flex: 1;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-family: Consolas, "Courier New", monospace;
  color: var(--muted);
}
.code-bar a { font-size: 12.5px; color: var(--accent); }
.code-bar a:hover { text-decoration: underline; }

.code-view {
  margin: 0;
  padding: 16px 18px;
  max-height: 560px;
  overflow: auto;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.7;
  color: #374151;
  white-space: pre;
}

.panel-empty {
  padding: 60px 0;
  text-align: center;
  font-size: 14px;
  color: var(--light);
}

/* ---- 成品下载 ---- */
.release-card {
  max-width: 560px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 28px 24px;
}

.release-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.release-row:last-of-type { border-bottom: none; }
.release-label { color: var(--light); flex-shrink: 0; }

.mono { font-family: Consolas, "Courier New", monospace; font-size: 13px; }

.btn-block {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 18px;
  padding: 11px 0;
  font-size: 14.5px;
}

.release-tip {
  margin-top: 12px;
  text-align: center;
  font-size: 12.5px;
  color: var(--light);
}

.not-found {
  padding: 80px 0;
  text-align: center;
}
.not-found p { margin-bottom: 18px; color: var(--muted); }

/* ============ 内页标题 + 下载页 ============ */
.page-h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 24px;
}

.download-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.download-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.download-row:hover {
  border-color: #c9dcfb;
  box-shadow: 0 6px 18px rgba(47, 111, 237, 0.06);
}

.download-info { flex: 1; min-width: 0; }
.download-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 16px;
  font-weight: 600;
}
.download-title a:hover { color: var(--accent); }
.download-desc {
  margin: 6px 0 10px;
  font-size: 13.5px;
  color: var(--muted);
}
.download-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}
.download-actions .btn { white-space: nowrap; }

/* ============ 手机端 ============ */
@media (max-width: 640px) {
  .hero { padding: 24px 0 10px; }
  .hero h1 { font-size: 22px; letter-spacing: 1px; }
  .grid { grid-template-columns: 1fr; }
  .detail-hero { flex-direction: column; align-items: flex-start; }
  .detail-actions { flex-direction: row; width: 100%; }
  .detail-actions .btn { flex: 1; }
  .md { padding: 22px 18px; }
  .source-layout { flex-direction: column; }
  .download-row { flex-direction: column; align-items: flex-start; }
  .download-actions { flex-direction: row; width: 100%; }
  .download-actions .btn { flex: 1; text-align: center; }
  .file-list {
    width: 100%;
    display: flex;
    overflow-x: auto;
    padding: 6px;
  }
  .file-item { width: auto; white-space: nowrap; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .detail-body { grid-template-columns: 1fr; }
  .detail-side { position: static; }
}

/* ============ 详情页增强：面包屑 / 功能亮点 / 侧栏 ============ */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--light);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--border); }
.breadcrumb .current { color: var(--text); }

.detail-section { padding-top: 28px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: #2560d8; color: #fff; }

.btn-block {
  display: block;
  width: 100%;
  text-align: center;
}

.mono {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.app-meta .fact-cat {
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 8px;
  border-radius: 9px;
}

.hero-note {
  max-width: 620px;
  margin: 14px auto 0;
  font-size: 13px;
  line-height: 1.8;
  color: var(--light);
}

.page-lead {
  margin: -10px 0 24px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.feature-card {
  padding: 18px 18px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.feature-card h3 {
  margin-bottom: 6px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}
.feature-card p {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

.detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.detail-main { min-width: 0; }

.block-title {
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.intro-card {
  padding: 30px 34px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.md-inline {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.source-section { margin-top: 24px; }

.detail-side {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.side-card {
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.side-title {
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 700;
}

.side-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.side-row:last-of-type { border-bottom: none; }
.side-row span { color: var(--light); flex-shrink: 0; }
.side-row b { font-weight: 500; color: var(--text); text-align: right; word-break: break-all; }

.side-card .btn-block { margin-top: 12px; }

.side-tip {
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  color: var(--light);
}

.related-list { display: flex; flex-direction: column; gap: 10px; }

.related-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 9px;
  transition: background 0.15s;
}
.related-item:hover { background: var(--btn-bg); }

.related-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.related-text { min-width: 0; display: flex; flex-direction: column; }
.related-text b { font-size: 13.5px; font-weight: 600; }
.related-text em {
  font-style: normal;
  font-size: 12px;
  color: var(--light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-box {
  margin: 4px 0 12px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  justify-content: center;
}
.qr-box img {
  display: block;
  width: 160px;
  height: 160px;
  border-radius: 4px;
}

@media (max-width: 900px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .detail-body { grid-template-columns: 1fr; }
  .detail-side { position: static; }
}

