/* ═══════════════════════════════════════════
   PanSou Web - 响应式三页面设计
   品牌色: #FF7D00
   ═══════════════════════════════════════════ */

:root {
  --brand: #FF7D00;
  --brand-hover: #e67000;
  --brand-light: #FFF3E6;
  --brand-bg: #FFF8F2;
  --bg: #f7f7f8;
  --card: #fff;
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow: 0 2px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.08);
  --radius: 12px;
  --radius-sm: 8px;
  --header-h: 60px;
  --max-w: 1140px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }

/* ── Header ── */
.header {
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
}
.header-inner {
  max-width: var(--max-w);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.logo:hover { opacity: .8; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all .15s;
  font-weight: 500;
}
.nav-links a:hover { background: var(--brand-light); color: var(--brand); }
.nav-links a.active { background: var(--brand); color: #fff; }

/* ── Main ── */
.main {
  flex: 1;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 0 24px 60px;
}

/* ═══ 首页 ═══ */
.search-hero {
  text-align: center;
  padding: 80px 0 48px;
}
.search-hero h1 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -.5px;
}
.hero-sub {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 36px;
}
.search-box {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .2s;
  box-shadow: var(--shadow-sm);
}
.search-box:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-light);
}
.search-box input {
  flex: 1;
  border: none;
  outline: none;
  padding: 15px 20px;
  font-size: 16px;
  color: var(--text);
  background: transparent;
  min-width: 0;
}
.search-box input::placeholder { color: #c4c4c4; }
.search-box button {
  flex-shrink: 0;
  border: none;
  background: var(--brand);
  color: #fff;
  padding: 15px 32px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.search-box button:hover { background: var(--brand-hover); }
.search-box button:disabled { background: #d1d5db; cursor: not-allowed; }

.hotwords-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 24px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.hotwords-wrap .tag {
  display: inline-block;
  padding: 6px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
}
.hotwords-wrap .tag:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-light);
}

/* ── SEO 文案 ── */
.seo-desc {
  max-width: 600px;
  margin: 40px auto 0;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-muted);
  text-align: left;
}
.seo-desc span {
  font-weight: 600;
  color: var(--text-secondary);
}

/* ═══ 列表页 ═══ */
.list-header {
  padding-top: 24px;
}
.list-header .search-box { max-width: 100%; margin: 0 0 16px 0; }
.list-header .search-box input { font-size: 15px; padding: 12px 18px; }
.list-header .search-box button { padding: 12px 28px; font-size: 15px; }

.filters-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filters-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.filter-group { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  background: var(--card);
  color: var(--text-secondary);
  transition: all .15s;
  user-select: none;
  font-weight: 500;
}
.filter-chip:hover { border-color: var(--brand); color: var(--brand); }
.filter-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.results-count { font-weight: 600; color: var(--text); }

/* ── 结果卡片 ── */
.result-list { display: flex; flex-direction: column; gap: 12px; }

.result-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all .2s;
  border: 1px solid transparent;
}
.result-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--brand);
  transform: translateY(-1px);
}
.result-card .card-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.result-card .card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  word-break: break-all;
  flex: 1;
}
.result-card .card-arrow {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 18px;
  margin-top: 2px;
}
.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 10px;
  align-items: center;
}
.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 12px;
}
.meta-tag.size { background: #f3f4f6; color: #374151; }
.meta-tag.cloud { font-weight: 600; }

.cloud-baidu { background: #EFF6FF; color: #2563EB; }
.cloud-ali { background: #FFF7ED; color: #EA580C; }
.cloud-quark { background: #FAF5FF; color: #9333EA; }
.cloud-115 { background: #FEF2F2; color: #DC2626; }
.cloud-tianyi { background: #ECFDF5; color: #059669; }
.cloud-xunlei { background: #F0F9FF; color: #0284C7; }
.cloud-other { background: #f3f4f6; color: #6b7280; }

/* ═══ 列表页 2:1 布局 ═══ */
.list-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}
.list-main { min-width: 0; }
.list-sidebar { position: sticky; top: calc(var(--header-h) + 24px); }

/* ── 广告卡片 ── */
.ad-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.ad-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.ad-card a {
  display: block;
  padding: 8px 0;
  color: var(--text);
  font-size: 14px;
  transition: color .15s;
  border-bottom: 1px solid #f3f4f6;
}
.ad-card a:last-child { border-bottom: none; }
.ad-card a:hover { color: var(--brand); }
.ad-card img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 8px;
}
.ad-card .ad-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
}

/* ── 详情页回退按钮 ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  padding: 10px 20px;
  margin-bottom: 20px;
  font-weight: 600;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all .15s;
  box-shadow: var(--shadow-sm);
}
.back-link:hover {
  color: var(--brand);
  border-color: var(--brand);
  box-shadow: var(--shadow);
  transform: translateX(-2px);
}

/* ═══ APP下载页 ═══ */
.app-download { text-align: center; padding: 60px 0; }
.app-hero { max-width: 400px; margin: 0 auto; }
.app-icon {
  width: 120px; height: 120px;
  margin: 0 auto 20px;
  background: var(--brand);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: #fff;
}
.app-icon img {
  width: 120px; height: 120px;
  border-radius: 24px;
}
.app-hero h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.app-hero p { color: var(--text-secondary); font-size: 14px; margin-bottom: 28px; }
.app-version { font-size: 12px; color: var(--text-muted); margin-top: 12px; }
.app-features {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 48px;
  flex-wrap: wrap;
}
.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.feature-item i { font-size: 28px; color: var(--brand); }
.page-header {
  padding: 32px 0 8px;
}

.detail-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding-top: 8px;
}
.detail-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.detail-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.5;
  word-break: break-all;
  margin-bottom: 20px;
  color: var(--text);
}
.detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.detail-meta-item {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.detail-meta-item .label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
}
.detail-meta-item .value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-outline {
  background: var(--card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-lg { padding: 14px 36px; font-size: 16px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb .sep { color: #d1d5db; }

/* ═══ 热门搜索页 ═══ */
.hots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.hot-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all .15s;
  font-size: 14px;
  word-break: break-all;
}
.hot-card:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.hot-card .rank { font-size: 22px; font-weight: 800; color: var(--brand); margin-bottom: 6px; }
.hot-card .keyword { color: var(--text); font-weight: 500; }

.page-header {
  padding: 32px 0 8px;
}

/* ═══ 加载/空态/错误 ═══ */
.state-msg {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}
.state-msg .icon { font-size: 56px; margin-bottom: 16px; }
.state-msg h3 { font-size: 18px; margin-bottom: 8px; color: var(--text); }
.state-msg p { font-size: 14px; }
.state-msg .sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ 分页 ═══ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.pagination button {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.pagination button:hover { border-color: var(--brand); color: var(--brand); }
.pagination button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination button:disabled { opacity: .35; cursor: not-allowed; }

/* ═══ Footer ═══ */
.footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ═══ 响应式 ═══ */
@media (max-width: 768px) {
  .search-hero { padding: 48px 0 32px; }
  .search-hero h1 { font-size: 26px; }
  .search-box input { padding: 12px 14px; font-size: 15px; }
  .search-box button { padding: 12px 20px; font-size: 15px; }
  .result-card { padding: 16px 18px; }
  .detail-card { padding: 24px 20px; }
  .detail-meta { grid-template-columns: 1fr 1fr; }
  .detail-title { font-size: 18px; }
  .btn { padding: 10px 20px; font-size: 14px; }
  .hots-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .list-layout { grid-template-columns: 1fr; }
  .list-sidebar { position: static; }
}

@media (max-width: 480px) {
  .detail-meta { grid-template-columns: 1fr; }
  .header-inner { padding: 0 16px; }
  .main { padding: 0 16px 40px; }
}
