:root {
  --primary: #ff5a1f;
  --primary-dark: #e64a12;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-2: #666;
  --text-3: #999;
  --border: #ebedf0;
  --radius: 12px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
}

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

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== Header ===== */
.header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  height: 60px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), #ff8c42);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.logo-sub {
  color: var(--primary);
}

.nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 14px;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--primary);
  background: #fff5f0;
}

.nav-link.active {
  color: var(--primary);
  background: #fff5f0;
  font-weight: 600;
}

.search {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 6px 6px 14px;
  width: 260px;
  flex-shrink: 0;
}

.search-input {
  border: none;
  outline: none;
  background: transparent;
  flex: 1;
  font-size: 13px;
  color: var(--text);
  min-width: 0;
}

.search-btn {
  border: none;
  background: var(--primary);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn:hover {
  background: var(--primary-dark);
}

/* ===== Main ===== */
.main {
  min-height: calc(100vh - 60px - 160px);
}

/* ===== Sections ===== */
.section {
  margin-top: 24px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--primary);
}

.section-more {
  font-size: 13px;
  color: var(--text-3);
}

.section-more:hover {
  color: var(--primary);
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #fff7f2, #ffe9dd);
  padding: 40px 0;
  text-align: center;
}

.hero h1 {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 10px;
}

.hero p {
  color: var(--text-2);
  font-size: 15px;
  max-width: 640px;
  margin: 0 auto;
}

/* ===== Cards ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.app-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  transition: all 0.2s;
}

.app-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border-color: #ffd9c4;
}

.app-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  flex-shrink: 0;
  position: relative;
}

.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-icon-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #999;
  background: var(--bg);
}

.app-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-desc {
  font-size: 12px;
  color: var(--text-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.app-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

.app-tag {
  font-size: 11px;
  color: var(--primary);
  background: #fff2ec;
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}

/* ===== Featured / big cards ===== */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.featured-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: all 0.2s;
}

.featured-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border-color: #ffd9c4;
}

.featured-card .app-icon {
  width: 48px;
  height: 48px;
  border-radius: 11px;
}

.featured-card .featured-body {
  flex: 1;
  min-width: 0;
}

.featured-card .app-name {
  font-size: 15px;
  margin-bottom: 3px;
}

.featured-card .app-desc {
  font-size: 12px;
  line-height: 1.5;
}

/* ===== App detail page ===== */
.detail-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-top: 24px;
}

.breadcrumb {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 24px;
  margin-bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.detail-head {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.detail-icon {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.detail-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info {
  flex: 1;
}

.detail-info h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.detail-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.detail-desc {
  color: var(--text-2);
  font-size: 14px;
}

.detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.detail-btn.primary {
  background: var(--primary);
  color: #fff;
}

.detail-btn.primary:hover {
  background: var(--primary-dark);
}

.detail-btn.ghost {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-2);
}

.detail-btn.ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.detail-links-section {
  margin-top: 28px;
}

.detail-links-section h2 {
  font-size: 17px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.link-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}

.link-item:hover {
  border-color: var(--primary);
}

.link-badge {
  font-size: 11px;
  color: var(--primary);
  background: #fff2ec;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.link-name {
  flex: 1;
  color: var(--text-2);
  font-size: 14px;
}

.link-arrow {
  color: var(--text-3);
}

/* ===== Article ===== */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.article-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.2s;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.article-cover {
  height: 160px;
  overflow: hidden;
  background: var(--bg);
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-body {
  padding: 16px;
}

.article-body h3 {
  font-size: 16px;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-body p {
  color: var(--text-2);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-date {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 10px;
}

.article-detail {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  margin-top: 24px;
}

.article-detail h1 {
  font-size: 26px;
  margin-bottom: 12px;
}

.article-content {
  margin-top: 20px;
  font-size: 15px;
  color: var(--text);
  line-height: 1.9;
}

.article-content h2,
.article-content h3 {
  margin: 20px 0 10px;
}

.article-content p {
  margin-bottom: 14px;
}

.article-content img {
  border-radius: 8px;
  margin: 10px 0;
}

.article-content ul,
.article-content ol {
  padding-left: 20px;
  margin-bottom: 14px;
}

.article-content a {
  color: var(--primary);
}

/* ===== App card (new) ===== */
.app-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}

.app-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border-color: #ffd9c4;
}

.app-card .app-icon {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  flex-shrink: 0;
}

.app-card .app-body {
  flex: 1;
  min-width: 0;
}

.app-card .app-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-card .app-plus {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Detail page extras ===== */
.detail-slogan {
  color: var(--text-2);
  font-size: 14px;
  margin-bottom: 8px;
}

.platform-switch {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ps-label {
  font-size: 13px;
  color: var(--text-3);
}

.ps-link {
  font-size: 13px;
  color: var(--primary);
  background: #fff2ec;
  padding: 3px 10px;
  border-radius: 6px;
}

.ps-link:hover {
  background: var(--primary);
  color: #fff;
}

/* ===== FAQ ===== */
.faq-list {
  list-style: none;
}

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

.faq-q {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  cursor: pointer;
}

.faq-a {
  font-size: 13px;
  color: var(--text-2);
}

/* ===== Category page ===== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.cat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: all 0.2s;
}

.cat-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.cat-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffe8dc, #ffd1b8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.cat-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.cat-count {
  font-size: 12px;
  color: var(--text-3);
}

/* ===== Cate group (app index) ===== */
.cate-group {
  margin-bottom: 20px;
}

.cate-group-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
  padding-left: 10px;
  border-left: 4px solid var(--primary);
}

.cate-group-title a:hover {
  color: var(--primary);
}

.cate-children {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 10px;
}

.cate-chip {
  font-size: 13px;
  color: var(--text-2);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 4px 14px;
  transition: all 0.2s;
}

.cate-chip:hover {
  color: var(--primary);
  border-color: var(--primary);
}

/* ===== Empty state ===== */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}

.empty h1 {
  font-size: 60px;
  color: var(--primary);
  margin-bottom: 16px;
}

.empty p {
  font-size: 16px;
  margin-bottom: 24px;
}

.empty a.btn-back {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 10px 28px;
  border-radius: 8px;
}

/* ===== QR ===== */
.qr-panel {
  margin-top: 16px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.qr-box img {
  margin: 0 auto;
}

.qr-box p {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-2);
}

.qr-box .qr-url {
  font-size: 12px;
  color: var(--text-3);
  word-break: break-all;
}

/* ===== Notice ===== */
.notice {
  background: #fff8e6;
  border: 1px solid #ffe1a6;
  color: #8a6d1f;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 16px;
}

/* ===== Footer ===== */
.footer {
  background: #fff;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer-inner {
  padding: 24px 16px;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--text-2);
  font-size: 13px;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-copy p {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 4px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .header-inner {
    gap: 12px;
  }
  .nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar {
    display: none;
  }
  .search {
    display: none;
  }
  .hero h1 {
    font-size: 24px;
  }
  .featured-grid,
  .article-grid {
    grid-template-columns: 1fr 1fr;
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
  .detail-head {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .detail-links {
    justify-content: center;
  }
  .detail-meta {
    justify-content: center;
  }
}
