/* ============================================================
   写频软件网 - Main Stylesheet
   商务简洁风格 | Mobile-First | CSS Grid & Flexbox
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #dbeafe;
  --color-primary-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --color-secondary: #f59e0b;
  --color-success: #10b981;
  --color-success-light: #d1fae5;
  --color-danger: #ef4444;
  --color-danger-light: #fee2e2;
  --color-warning: #f59e0b;
  --color-warning-light: #fef3c7;
  --color-white: #ffffff;
  --color-bg: #f8fafc;
  --color-bg-alt: #f1f5f9;
  --color-text: #1e293b;
  --color-text-secondary: #64748b;
  --color-text-muted: #94a3b8;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --shadow-xl: 0 15px 35px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.35s ease;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --max-width: 1200px;
  --header-height: 64px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-y: scroll;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--color-primary-dark); }

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

ul, ol { list-style: none; }

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

.main-content {
  flex: 1;
  padding-bottom: 40px;
}

/* ---------- Typography ---------- */
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-primary);
  display: inline-block;
}

.text-muted { color: var(--color-text-secondary); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  white-space: nowrap;
  line-height: 1.4;
}

.btn-primary {
  background: var(--color-primary-gradient);
  color: var(--color-white);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  color: var(--color-white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-success {
  background: var(--color-success);
  color: var(--color-white);
}
.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: var(--color-white);
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}
.btn-outline:hover {
  background: var(--color-primary-light);
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--color-warning);
  color: var(--color-white);
}
.btn-warning:hover { background: #d97706; transform: translateY(-1px); }

.btn-lg {
  padding: 14px 32px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-xs {
  padding: 4px 12px;
  font-size: 0.75rem;
}

.btn-block {
  width: 100%;
}

.btn:active {
  transform: translateY(0);
}

/* ---------- Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
}

.badge-free {
  background: var(--color-success-light);
  color: var(--color-success);
}

.badge-hot {
  background: #fffbeb;
  color: #d97706;
}

.badge-new {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 16px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-text);
  text-decoration: none;
}
.site-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--color-primary-gradient);
  color: var(--color-white);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 900;
}
.site-logo:hover { color: var(--color-primary); }

/* ---------- Brand Dropdown Nav ---------- */
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-nav .nav-link {
  display: block;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}
.header-nav .nav-link:hover {
  color: var(--color-primary);
  background: var(--color-bg-hover);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown > button {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.nav-dropdown > button:hover {
  color: var(--color-primary);
  background: var(--color-primary-light);
}
.nav-dropdown > button .arrow {
  font-size: 0.6rem;
  transition: transform var(--transition-fast);
}

.nav-dropdown:hover > button .arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  z-index: 1001;
}

.nav-dropdown:hover .dropdown-menu {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-menu .brand-group {
  padding: 6px 20px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dropdown-menu a {
  display: block;
  padding: 8px 20px;
  font-size: 0.85rem;
  color: var(--color-text);
  transition: all var(--transition-fast);
}
.dropdown-menu a:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* ---------- Search Bar (Header) ---------- */
.header-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.header-search form {
  display: flex;
}

.header-search input {
  width: 100%;
  padding: 9px 16px;
  padding-right: 40px;
  border: 2px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--transition-fast);
  background: var(--color-bg);
}
.header-search input:focus {
  border-color: var(--color-primary);
  background: var(--color-white);
}

.header-search button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: var(--color-primary-gradient);
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

/* ---------- Mobile Hamburger ---------- */
.hamburger {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 1.4rem;
  color: var(--color-text);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-white);
  z-index: 999;
  padding: 16px;
  overflow-y: auto;
  flex-direction: column;
  gap: 12px;
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu .mobile-search {
  margin-bottom: 8px;
}

.mobile-menu .mobile-search input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
}

.mobile-menu .mobile-nav-link {
  display: block;
  padding: 14px 16px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}
.mobile-menu .mobile-nav-link:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.mobile-menu .mobile-brand-group {
  display: block;
  padding: 12px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-primary);
  background: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  text-decoration: none;
  margin: 4px 8px;
  transition: background var(--transition-fast);
}
.mobile-menu .mobile-brand-group:hover {
  background: var(--color-primary-light);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--color-text);
  color: var(--color-text-muted);
  padding: 40px 0 24px;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

.footer-features {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 16px;
}

.footer-feature {
  color: var(--color-white);
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  padding: 8px 0;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 32px auto 0;
  padding: 20px 16px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.footer-bottom a {
  color: var(--color-text-muted);
}
.footer-bottom a:hover { color: var(--color-white); }

/* ---------- Detail Stats Bar (product page) ---------- */
.detail-stats-bar {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 28px 0;
  margin: 0;
  width: 100%;
}
.detail-stats-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.detail-stats-left {
  flex: 1;
}
.detail-stats-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}
.detail-stats-tags {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 500;
}
.detail-stats-right {
  display: flex;
  gap: 40px;
  flex-shrink: 0;
}
.detail-stats-right .stat-item {
  text-align: center;
}
.detail-stats-right .stat-number {
  font-size: 1.6rem;
}
.detail-stats-right .stat-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

@media (max-width: 767px) {
  .detail-stats-inner {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
  .detail-stats-right {
    gap: 24px;
  }
  .detail-stats-title {
    font-size: 1.1rem;
  }
  .detail-stats-right .stat-number {
    font-size: 1.3rem;
  }
}

/* ---------- Coupon section ---------- */
.coupon-section {
  padding: 10px 0;
}
.coupon-section form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#couponMsg {
  margin-top: 6px;
  font-size: 0.8rem;
  padding: 4px 0;
}
/* Recovery bar for returning after payment */
.recovery-bar {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.9rem;
  color: #92400e;
  margin-bottom: 16px;
  line-height: 1.6;
}
.recovery-bar a {
  color: #f59e0b;
  font-weight: 600;
  text-decoration: none;
}
.recovery-bar a:hover {
  text-decoration: underline;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  padding: 12px 0;
  flex-wrap: wrap;
}

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

.breadcrumb .sep {
  color: var(--color-text-muted);
}

.breadcrumb .current {
  color: var(--color-text);
  font-weight: 500;
}

/* ============================================================
   HERO SECTION (Homepage)
   ============================================================ */
.hero {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 50%, #bfdbfe 100%);
  padding: 60px 16px 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.05);
  top: -100px;
  right: -100px;
}

.hero::after {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.05);
  bottom: -50px;
  left: -50px;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 12px;
  line-height: 1.3;
}

.hero p {
  font-size: 1rem;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
}

.hero-search {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}

.hero-search input {
  width: 100%;
  padding: 16px 56px 16px 24px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-size: 1rem;
  outline: none;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-normal);
}
.hero-search input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.15);
}

.hero-search button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: var(--color-primary-gradient);
  color: var(--color-white);
  border-radius: 50%;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
}
.hero-search button:hover {
  transform: translateY(-50%) scale(1.05);
}

/* ---------- Stats Bar ---------- */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 32px 16px;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 6px;
}

/* ============================================================
   BRAND GRID (Homepage)
   ============================================================ */
.brand-grid-section {
  padding: 40px 0;
}

.brand-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.brand-card {
  position: relative;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px 12px;
  text-align: center;
  transition: all var(--transition-normal);
  cursor: pointer;
  text-decoration: none;
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.brand-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.brand-card .brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--color-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--color-primary);
}

/* 下载排行榜：桌面端只显示前5个 */
@media (min-width: 1024px) {
  .rank-section .product-grid .product-card:nth-child(n+6) {
    display: none;
  }
}

.brand-card .brand-icon.has-logo {
  width: auto;
  height: auto;
  background: none;
  border-radius: 0;
}
.brand-card .brand-icon.has-logo img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  display: block;
}

.brand-card .brand-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.brand-card .brand-count {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

/* ============================================================
   PRODUCT CARD
   ============================================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.product-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  position: relative;
}

.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--color-primary-light);
}

.product-card .card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.product-card .card-img .no-img {
  width: 64px;
  height: 64px;
  background: var(--color-bg-alt);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 1.5rem;
}

.product-card .card-body {
  padding: 10px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-card .card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.product-card .card-title a {
  color: var(--color-text);
}
.product-card .card-title a:hover {
  color: var(--color-primary);
}

.product-card .card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.product-card .card-meta .btn {
  width: auto;
  flex-shrink: 0;
}

.product-card .card-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
}

.product-card .card-price.free {
  color: var(--color-success);
}

.product-card .card-brand {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.product-card .card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--color-border-light);
}

.product-card .card-footer .btn {
  width: 100%;
  font-size: 0.8rem;
  padding: 8px 16px;
}

/* Top badges on card */
.product-card .card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}

/* ============================================================
   SECTION SPACING
   ============================================================ */
.section {
  padding: 28px 0;
}

/* ---------- Sort Bar ---------- */
.sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--color-border-light);
  flex-wrap: wrap;
  gap: 12px;
}

.sort-options {
  display: flex;
  gap: 4px;
}

.sort-options a,
.sort-options span {
  padding: 6px 14px;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  border-radius: 999px;
  transition: all var(--transition-fast);
  font-weight: 500;
}

.sort-options a:hover {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.sort-options a.active {
  background: var(--color-primary);
  color: var(--color-white);
}

.result-count {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 32px 0 16px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.pagination a:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.pagination .active {
  background: var(--color-primary);
  color: var(--color-white);
  font-weight: 700;
}

.pagination .disabled {
  color: var(--color-text-muted);
  cursor: not-allowed;
}

/* ============================================================
   BRAND LIST PAGE
   ============================================================ */
.brand-header {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand-header .brand-header-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: var(--color-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--color-primary);
  flex-shrink: 0;
  overflow: hidden;
}

.brand-header .brand-header-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-header .brand-header-info h1 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.brand-header .brand-header-info .count {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.brand-header .brand-header-info .desc {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-top: 8px;
  line-height: 1.5;
}

.brand-header .brand-header-ratings {
  margin-left: auto;
  margin-right: 16px;
  display: flex;
  flex-direction: row;
  gap: 32px;
  flex-shrink: 0;
}

.brand-header .rating-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.brand-header .rating-icon {
  width: 40px;
  height: 40px;
  display: block;
}

.brand-header .rating-text {
  font-size: 0.85rem;
  color: #94a3b8;
}

.brand-header .rating-count {
  font-weight: 700;
  font-size: 0.95rem;
}
.rating-count.rc-up { color: #16a34a; }
.rating-count.rc-down { color: #ef4444; }

.brand-header .rating-btn:hover .rating-icon {
  transform: scale(1.1);
  transition: transform 0.2s;
}

.brand-header .rating-count {
  font-weight: 700;
  font-size: 0.9rem;
}

.sub-brand-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border-light);
}

.sub-brand-filter a,
.sub-brand-filter span {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 999px;
  transition: all var(--transition-fast);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.sub-brand-filter a:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.sub-brand-filter a.active,
.sub-brand-filter span.active {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

/* ============================================================
   PRODUCT DETAIL PAGE
   ============================================================ */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 32px 0;
}

.product-detail .detail-image {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.product-detail .detail-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-detail .detail-image .no-img {
  font-size: 3rem;
  color: var(--color-text-muted);
}

.product-detail .detail-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.product-detail .detail-info h1 {
  font-size: 1.6rem;
  line-height: 1.4;
}

.product-detail .detail-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}

.product-detail .detail-meta .meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.product-detail .detail-meta .meta-label {
  color: var(--color-text-muted);
  font-weight: 500;
  min-width: 44px;
  flex-shrink: 0;
}

.product-detail .detail-meta .brand-tag {
  padding: 2px 12px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.product-detail .detail-meta .model-tag {
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.9rem;
}

.product-detail .detail-meta .safe-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #16a34a;
  font-weight: 600;
  font-size: 0.85rem;
}

.product-detail .detail-price-box {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: 24px;
  border: 2px solid var(--color-border);
}


.product-detail .detail-price-box .price-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-primary);
}

.product-detail .detail-price-box .price-value.free {
  color: var(--color-success);
}

.product-detail .detail-price-box .price-hint {
  font-size: 0.8rem;
  color: var(--color-primary);
  margin-top: 10px;
  line-height: 1.5;
}

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.payment-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.payment-buttons .btn-wechat {
  background: #07c160;
  color: var(--color-white);
}
.payment-buttons .btn-wechat:hover { background: #06ad56; }

.payment-buttons .btn-alipay {
  background: #1677ff;
  color: var(--color-white);
}
.payment-buttons .btn-alipay:hover { background: #0958d9; }

/* 纠正/报错 */
.correction-trigger { margin-top: 16px; }
.btn-correction {
  display: inline-block; padding: 6px 16px; font-size: 0.8rem;
  color: var(--color-text-muted); background: var(--color-bg);
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--transition-fast);
  text-decoration: none;
}
.btn-correction:hover { color: var(--color-primary); border-color: var(--color-primary); }

/* 下载说明按钮 */
.btn-download-info {
  display: inline-block; padding: 2px 12px; font-size: 1.1rem;
  font-weight: 400; color: #475569; background: transparent;
  border: 1px solid #e2e8f0; border-radius: 4px;
  cursor: pointer; transition: all .2s; text-decoration: none;
  line-height: 1.6;
}
.btn-download-info:hover { color: var(--color-primary); border-color: var(--color-primary); }

/* 弹窗 */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.45); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-box {
  background: #fff; border-radius: 12px; width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.15);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--color-border);
}
.modal-header h3 { font-size: 1.05rem; font-weight: 600; margin: 0; }
.modal-close {
  width: 32px; height: 32px; border: none; background: none;
  font-size: 1.4rem; cursor: pointer; color: #94a3b8; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--color-bg); color: var(--color-text); }
.modal-section { padding: 16px 24px; border-bottom: 1px solid #f1f5f9; }
.modal-section h4 { font-size: 0.9rem; font-weight: 600; margin: 0 0 12px 0; }
.modal-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.modal-row label { min-width: 72px; font-size: 0.85rem; color: var(--color-text-muted); flex-shrink: 0; }
.modal-row input[type="text"],
.modal-row select {
  flex: 1; padding: 7px 10px; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); font-size: 0.85rem; outline: none;
}
.modal-row input:focus,
.modal-row select:focus { border-color: var(--color-primary); }
.modal-radio,
.modal-check { display: block; padding: 4px 0; font-size: 0.88rem; cursor: pointer; }
.modal-radio input,
.modal-check input { margin-right: 6px; }
.modal-footer { padding: 16px 24px; display: flex; gap: 10px; justify-content: flex-end; }
/* Description area */
.product-description {
  margin-top: 40px;
}

.product-description .desc-section {
  margin-bottom: 32px;
}

.product-description .desc-section h3 {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-primary);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  display: inline-block;
}

.product-description .desc-section p,
.product-description .desc-section div,
.product-description .desc-section span,
.product-description .desc-section li,
.product-description .desc-section td,
.product-description .desc-section th {
  font-size: 1rem !important;
  line-height: 1.8 !important;
  color: #1e293b !important;
  font-family: inherit !important;
  background: transparent !important;
}

/* Related products */
.related-section {
  margin-top: 40px;
}

/* Share buttons */
.share-buttons {
  display: flex;
  gap: 12px;
  padding: 16px 0;
}

.share-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--color-white);
  transition: all var(--transition-fast);
}

.share-btn:hover {
  transform: translateY(-2px);
}

.share-wechat { background: #07c160; }
.share-weibo { background: #e6162d; }

/* ============================================================
   SEARCH RESULTS
   ============================================================ */
.search-header {
  padding: 24px 0 16px;
}

.search-header .query-text {
  color: var(--color-primary);
  font-weight: 700;
}

.no-results {
  text-align: center;
  padding: 60px 20px;
}

.no-results .no-results-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.no-results h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.no-results p {
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.suggested-products {
  margin-top: 40px;
}

/* ============================================================
   PAY SUCCESS PAGE
   ============================================================ */
.pay-success {
  max-width: 600px;
  margin: 40px auto;
  text-align: center;
}

.pay-success .success-icon-wrapper {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--color-success-light);
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* CSS checkmark */
.checkmark {
  width: 40px;
  height: 20px;
  border-left: 4px solid var(--color-success);
  border-bottom: 4px solid var(--color-success);
  transform: rotate(-45deg);
  margin-top: -4px;
}

.pay-success h1 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.pay-success .order-info {
  margin-bottom: 24px;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.download-section {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: left;
}

.download-section h3 {
  text-align: center;
  margin-bottom: 16px;
}

.download-link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.download-link-item .link-text {
  flex: 1;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  word-break: break-all;
  line-height: 1.4;
}

.download-link-item .link-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
}

.copy-btn {
  padding: 6px 14px;
  font-size: 0.8rem;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.copy-btn:hover {
  background: var(--color-primary);
  color: var(--color-white);
}
.copy-btn.copied {
  background: var(--color-success);
  color: var(--color-white);
}

.btn-baidu {
  display: block;
  text-align: center;
  padding: 14px 24px;
  background: var(--color-primary-gradient);
  color: var(--color-white);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  margin: 20px 0 0;
  transition: all var(--transition-fast);
}
.btn-baidu:hover {
  background: var(--color-primary-dark);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.warning-box {
  background: var(--color-warning-light);
  border: 1px solid var(--color-warning);
  border-left: 4px solid var(--color-warning);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 20px;
  text-align: center;
}

.warning-box .warning-text {
  font-size: 0.85rem;
  color: #92400e;
  line-height: 1.6;
}

/* ============================================================
   MOBILE RESPONSIVE (< 768px)
   ============================================================ */
@media (max-width: 767px) {
  :root {
    --header-height: 56px;
  }

  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }

  /* Header */
  .header-nav { display: none; }
  .header-search { display: none; }

  .hamburger { display: flex; }

  .site-logo { font-size: 1.1rem; }
  .site-logo .logo-icon { width: 30px; height: 30px; font-size: 1rem; }

  /* Hero */
  .hero { padding: 40px 16px 36px; }
  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: 0.85rem; margin-bottom: 24px; }
  .hero-search input { padding: 14px 50px 14px 18px; font-size: 0.9rem; }

  /* Stats */
  .stats-bar { gap: 20px; padding: 24px 12px; }
  .stat-number { font-size: 1.4rem; }
  .stat-label { font-size: 0.7rem; }

  /* Brand Grid */
  .brand-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .brand-card { padding: 14px 8px; }
  .brand-card .brand-icon { width: 40px; height: 40px; font-size: 1.2rem; }
  .brand-card .brand-icon.has-logo { width: auto; height: auto; }
  .brand-header { flex-direction: column; align-items: flex-start; }
  .brand-header .brand-header-ratings { gap: 24px; margin-right: 0; }
  .brand-header .rating-icon { width: 32px; height: 32px; }
  .brand-card .brand-icon.has-logo img { width: 68px; height: 68px; }
  .brand-card .brand-name { font-size: 0.75rem; }

  /* Product Grid */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  /* Product Detail */
  .product-detail {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .product-detail .detail-info h1 { font-size: 1.3rem; }
  .payment-buttons { grid-template-columns: 1fr; }

  /* Footer */
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }

  /* Pagination */
  .pagination a, .pagination span { min-width: 34px; height: 34px; font-size: 0.8rem; }

  /* Brand header */
  .brand-header { flex-direction: column; text-align: center; padding: 20px; }
  .brand-header .brand-header-icon { width: 56px; height: 56px; font-size: 1.5rem; }

  /* Sort bar */
  .sort-bar { justify-content: center; }
  .sort-options { flex-wrap: wrap; justify-content: center; }

  /* Pay success */
  .pay-success { padding: 0 16px; margin: 24px auto; }
  .download-link-item { flex-direction: column; align-items: stretch; }
  .download-link-item .copy-btn { align-self: flex-end; }
}

/* ============================================================
   TABLET RESPONSIVE (768px - 1023px)
   ============================================================ */
@media (min-width: 768px) and (max-width: 1023px) {
  /* Header search smaller */
  .header-search { max-width: 240px; }

  /* Product Grid */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Brand Grid */
  .brand-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Product Detail */
  .product-detail {
    gap: 24px;
  }

  /* Footer */
  .footer-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }

  .hero h1 { font-size: 1.8rem; }
}

/* ============================================================
   DESKTOP (> 1024px)
   ============================================================ */
@media (min-width: 1024px) {
  /* Full brand grid 6 cols and product grid 4 cols are defaults above */
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.hidden { display: none !important; }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-alt) 25%, var(--color-border-light) 50%, var(--color-bg-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
