:root {
  --primary: #0066ff;
  --primary-dark: #004ec2;
  --download: #16a34a;
  --download-dark: #15803d;
  --bg: #f3f6fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --soft: #f9fafb;
  --yellow: #f59e0b;
  --danger: #dc2626;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1180px, 94%);
  margin: 0 auto;
}

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  font-size: 23px;
  font-weight: 900;
  flex: 0 0 auto;
}

.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #00a3ff);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.nav {
  display: flex;
  gap: 20px;
  color: var(--muted);
  font-size: 15px;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--primary);
}

.header-search {
  margin-left: auto;
  max-width: 390px;
  flex: 1;
}

.header-search input,
.searchbox input,
.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--soft);
  outline: none;
  font-size: 14px;
}

.header-search input:focus,
.searchbox input:focus,
.form-control:focus {
  border-color: var(--primary);
  background: #fff;
}

/* Common */
.section {
  margin: 28px 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
}

.page-title {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.2;
}

.view-more {
  color: var(--primary);
  font-weight: 800;
  font-size: 14px;
}

.view-more:hover {
  color: var(--primary-dark);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 900;
  font-size: 14px;
  border: 0;
  cursor: pointer;
}

.btn-download {
  background: var(--download);
  color: #fff;
}

.btn-download:hover {
  background: var(--download-dark);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--soft);
}

.muted {
  color: var(--muted);
}

.stars {
  color: var(--yellow);
  letter-spacing: -1px;
  white-space: nowrap;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, rgba(0,102,255,0.96), rgba(0,61,153,0.96));
  color: #fff;
  padding: 58px 0;
}

.hero-inner {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.12;
}

.hero p {
  margin: 0 auto 26px;
  max-width: 720px;
  color: rgba(255,255,255,.88);
  font-size: 18px;
}

.searchbox {
  display: flex;
  gap: 8px;
  background: #fff;
  border-radius: 16px;
  padding: 8px;
  max-width: 760px;
  margin: 0 auto;
  box-shadow: 0 22px 55px rgba(0,0,0,.18);
}

.searchbox input {
  border: 0;
  background: #fff;
  border-radius: 12px;
  font-size: 16px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  color: rgba(255,255,255,.86);
  font-size: 14px;
}

.chips a {
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.22);
}

/* Layout */
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.main-content,
.sidebar {
  display: grid;
  gap: 22px;
}

.main-content {
  min-width: 0;
}

.sidebar {
  width: 100%;
  position: sticky;
  top: 88px;
}

/* Categories */
.category-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

.category {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 12px;
  text-align: center;
  transition: .18s;
}

.category:hover,
.app-card:hover,
.article:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(31,41,55,.07);
  border-color: #bfdbfe;
}

.cat-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  border-radius: 14px;
  background: #eff6ff;
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 22px;
}

.category strong {
  display: block;
  font-size: 14px;
}

.category span {
  color: var(--muted);
  font-size: 12px;
}

/* App Cards */
.app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.app-card {
  display: flex;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: #fff;
  transition: all .18s ease;
  min-width: 0;
  height: 100%;
}

.app-icon,
.rank-icon,
.detail-icon,
.big-icon {
  overflow: hidden;
}

.app-icon img,
.rank-icon img,
.detail-icon img,
.big-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-icon {
  width: 62px;
  height: 62px;
  min-width: 62px;
  border-radius: 15px;
  background: linear-gradient(135deg, #dbeafe, #ecfdf5);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 900;
  flex: 0 0 auto;
}

.app-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.app-body h3 {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 1.3;
  color: var(--text);
}

.app-meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-desc {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  line-height: 1.45;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-action {
  display: inline-block;
  margin-top: auto;
  padding-top: 8px;
  color: var(--download);
  font-weight: 900;
  font-size: 13px;
}

/* Feature */
.feature-box {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 20px;
  align-items: center;
  background: linear-gradient(135deg, #fff, #eff6ff);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
}

.feature-visual {
  min-height: 220px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: radial-gradient(circle at 30% 30%, rgba(22,163,74,.25), transparent 28%),
              radial-gradient(circle at 70% 60%, rgba(0,102,255,.22), transparent 30%),
              #fff;
  display: grid;
  place-items: center;
}

.big-icon {
  width: 120px;
  height: 120px;
  border-radius: 28px;
  background: linear-gradient(135deg, #22c55e, #facc15);
  color: #064e3b;
  display: grid;
  place-items: center;
  font-size: 42px;
  font-weight: 900;
}

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* Detail */
.breadcrumb {
  padding: 18px 0;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.detail-hero {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.detail-icon {
  width: 104px;
  height: 104px;
  min-width: 104px;
  border-radius: 24px;
  background: linear-gradient(135deg, #22c55e, #facc15);
  color: #064e3b;
  display: grid;
  place-items: center;
  font-size: 36px;
  font-weight: 900;
  flex: 0 0 auto;
}

.detail-title {
  margin: 0 0 6px;
  font-size: 32px;
  line-height: 1.25;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
}

.spec-table tr {
  border-bottom: 1px solid var(--border);
}

.spec-table tr:last-child {
  border-bottom: 0;
}

.spec-table td {
  padding: 12px 4px;
  font-size: 14px;
}

.spec-table td:first-child {
  color: var(--muted);
  width: 40%;
}

.spec-table td:last-child {
  font-weight: 700;
}

.proscons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.proscons ul {
  margin: 0;
  padding-left: 18px;
}

.pros h3 {
  color: var(--download);
}

.cons h3 {
  color: var(--danger);
}

.screenshots {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.shot {
  min-width: 170px;
  aspect-ratio: 9/16;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, #dbeafe, #dcfce7);
  padding: 16px;
  overflow: hidden;
}

.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mock-line {
  height: 12px;
  background: rgba(31,41,55,.16);
  border-radius: 99px;
  margin-bottom: 12px;
}

.mock-box {
  height: 70px;
  border-radius: 12px;
  background: rgba(0,102,255,.14);
  margin: 14px 0;
}

/* Lists */
.rank-list,
.link-list {
  display: grid;
  gap: 13px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 11px;
}

.rank-num {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  flex: 0 0 auto;
}

.rank-item:nth-child(1) .rank-num {
  background: #fef3c7;
  color: #92400e;
}

.rank-item:nth-child(2) .rank-num {
  background: #dbeafe;
  color: #1d4ed8;
}

.rank-item:nth-child(3) .rank-num {
  background: #dcfce7;
  color: #166534;
}

.rank-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  background: #eff6ff;
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 900;
  flex: 0 0 auto;
}

.rank-text strong {
  display: block;
  font-size: 14px;
}

.rank-text span {
  color: var(--muted);
  font-size: 12px;
}

.link-list a {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.link-list a:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.link-list a:hover {
  color: var(--primary);
}

/* Articles */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.article {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 15px;
  overflow: hidden;
  transition: .18s;
}

.article-thumb {
  height: 126px;
  background: linear-gradient(135deg, #dbeafe, #ecfdf5);
  display: grid;
  place-items: center;
  font-size: 36px;
}

.article-body {
  padding: 15px;
}

.article-body h3 {
  margin: 0 0 7px;
  font-size: 15px;
  line-height: 1.35;
}

.article-body p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

/* Content */
.content h2 {
  margin-top: 26px;
}

.content p,
.content li {
  color: #374151;
}

.notice {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 15px;
  padding: 15px;
  font-size: 14px;
}

details {
  border-bottom: 1px solid var(--border);
  padding: 13px 0;
}

details:last-child {
  border-bottom: 0;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

/* Form */
.form {
  display: grid;
  gap: 14px;
}

.form-control {
  border-radius: 10px;
}

textarea.form-control {
  min-height: 140px;
  resize: vertical;
}

/* Footer */
.site-footer {
  margin-top: 38px;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 34px 0;
  color: var(--muted);
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 26px;
  margin-bottom: 22px;
}

.footer-logo {
  color: var(--primary);
  font-weight: 900;
  font-size: 21px;
  margin-bottom: 10px;
}

.footer-col h4 {
  color: var(--text);
  margin: 0 0 10px;
}

.footer-col a {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}

.footer-col a:hover {
  color: var(--primary);
}

.copyright {
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

/* Responsive */
@media (max-width: 1020px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .feature-box {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    height: auto;
    min-height: 64px;
    padding: 12px 0;
  }

  .nav,
  .header-search {
    display: none;
  }

  .searchbox {
    flex-direction: column;
  }

  .searchbox button {
    padding: 14px;
  }

  .app-grid,
  .article-grid,
  .proscons {
    grid-template-columns: 1fr;
  }

  .detail-hero {
    flex-direction: column;
  }

  .detail-title {
    font-size: 26px;
  }

  .page-title {
    font-size: 28px;
  }

  .section-title {
    font-size: 22px;
  }

  .card {
    padding: 18px;
  }

  .app-card {
    padding: 14px;
  }

  .app-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 13px;
  }
}

@media (max-width: 520px) {
  .container {
    width: min(100% - 24px, 1180px);
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .big-icon {
    width: 96px;
    height: 96px;
    font-size: 34px;
  }

  .app-card {
    gap: 12px;
  }

  .app-body h3 {
    font-size: 15px;
  }

  .app-meta,
  .app-desc,
  .app-action {
    font-size: 12px;
  }
}
/* =========================
   Global Layout Center Fix
========================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  margin: 0;
  padding: 0;
}

body {
  overflow-x: hidden;
}

/* 关键：让所有 container 居中 */
.container {
  width: 100%;
  max-width: 1180px;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 20px;
  padding-right: 20px;
}

/* Header 居中修复 */
.site-header {
  width: 100%;
}

.topbar {
  width: 100%;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* PC 导航修复 */
.logo {
  flex: 0 0 auto;
}

.nav {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-width: 0;
}

.nav a {
  white-space: nowrap;
}

.header-search {
  flex: 0 0 280px;
}

.header-search input {
  width: 100%;
}

/* =========================
   Category Page PC Fix
========================= */

main.container.section {
  padding-top: 34px;
  padding-bottom: 50px;
}

/* 你的分类页主体布局 */
main.container.section > .content-grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 26px;
  align-items: flex-start;
}

/* 左侧内容不要被撑破 */
.main-content {
  min-width: 0;
  width: 100%;
}

/* 右侧栏 */
.sidebar {
  min-width: 0;
  width: 100%;
}

/* App 列表 PC 端 */
.app-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

/* 卡片内部修复 */
.app-card {
  width: 100%;
  min-width: 0;
}

.app-body {
  min-width: 0;
}

.app-body h3,
.app-desc,
.app-meta {
  overflow-wrap: anywhere;
}

/* 让右侧分类栏固定更自然 */
@media (min-width: 1024px) {
  .sidebar {
    position: sticky;
    top: 90px;
  }
}

/* 大屏幕 3 列 */
@media (min-width: 1280px) {
  .container {
    max-width: 1240px;
  }

  main.container.section > .content-grid {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 30px;
  }

  .app-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* 平板 */
@media (max-width: 1023px) {
  .topbar {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav {
    order: 3;
    flex-basis: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .header-search {
    flex: 1 1 260px;
  }

  main.container.section > .content-grid {
    display: block;
  }

  .sidebar {
    margin-top: 22px;
    position: static;
  }

  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 手机 */
@media (max-width: 640px) {
  .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .topbar {
    align-items: stretch;
  }

  .logo {
    justify-content: center;
  }

  .nav {
    gap: 12px;
  }

  .header-search {
    flex-basis: 100%;
  }

  .app-grid {
    grid-template-columns: 1fr;
  }
}
