/* ==========================================================
   软件应用精选站 - 主样式文件
   双主题(亮/暗) + 响应式三断点(1200/768/480)
   ========================================================== */

/* ========== 1. CSS变量 - 亮色主题 ========== */
:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --secondary-color: #06b6d4;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --purple-color: #8b5cf6;
  --pink-color: #ec4899;

  --bg-color: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-hover: #e2e8f0;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --text-inverse: #ffffff;

  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --container-width: 1200px;
  --transition-fast: 150ms ease;
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== 2. CSS变量 - 暗色主题 ========== */
[data-theme="dark"] {
  --primary-color: #6366f1;
  --primary-hover: #818cf8;
  --primary-light: #312e81;
  --secondary-color: #22d3ee;
  --success-color: #34d399;
  --warning-color: #fbbf24;
  --danger-color: #f87171;
  --purple-color: #a78bfa;
  --pink-color: #f472b6;

  --bg-color: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-hover: #475569;

  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-inverse: #0f172a;

  --border-color: #334155;
  --border-light: #1e293b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

/* ========== 3. 基础重置 ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

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

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

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

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

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

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

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

/* ========== 4. 通用容器 ========== */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ========== 5. 按钮样式 ========== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
  color: var(--text-inverse);
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all var(--transition-base);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

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

/* ========== 6. 顶部导航栏 ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  transition: background-color var(--transition-base), border-color var(--transition-base);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.logo-emoji {
  font-size: 28px;
  filter: drop-shadow(0 2px 6px rgba(79, 70, 229, 0.3));
}

.logo h1 {
  font-size: 20px;
  background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  font-weight: 500;
  position: relative;
}

.header-btn:hover {
  background-color: var(--bg-hover);
  transform: translateY(-1px);
}

.fav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: linear-gradient(135deg, var(--danger-color), var(--pink-color));
  color: white;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.theme-toggle .theme-icon-light,
.theme-toggle .theme-icon-dark {
  font-size: 18px;
}

[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="light"] .theme-icon-dark { display: none; }
.theme-toggle .theme-icon-light { display: inline; }
.theme-toggle .theme-icon-dark { display: inline; }
[data-theme="dark"] .theme-toggle .theme-icon-light { display: none; }
[data-theme="light"] .theme-toggle .theme-icon-dark { display: none; }

/* ========== 7. 主体内容 ========== */
.site-main {
  padding: 28px 20px 60px;
  min-height: calc(100vh - 68px - 80px);
}

/* ========== 8. 搜索区 ========== */
.search-section {
  margin-bottom: 28px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background-color: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 4px 4px 4px 18px;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.search-box:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1), var(--shadow-md);
}

.search-icon {
  font-size: 18px;
  opacity: 0.6;
  margin-right: 10px;
  flex-shrink: 0;
}

#search-input {
  flex: 1;
  height: 48px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  padding-right: 12px;
  width: 100%;
}

.search-clear {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.search-clear:hover {
  background-color: var(--danger-color);
  color: white;
  transform: rotate(90deg);
}

/* ========== 9. 筛选区 ========== */
.filter-section {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: background-color var(--transition-base), border-color var(--transition-base);
}

.filter-group {
  margin-bottom: 18px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  font-size: 14px;
}

.filter-icon {
  font-size: 16px;
}

.tab-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-btn {
  padding: 8px 16px;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-base);
  border: 1px solid transparent;
}

.tab-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  border-color: transparent;
}

/* ========== 10. 统计信息 ========== */
.stats-section {
  margin-bottom: 20px;
}

.stats-info {
  color: var(--text-tertiary);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stats-info::before {
  content: "📊";
  font-size: 16px;
}

/* ========== 11. 平台彩色徽章 ========== */
.platform-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.platform-Windows { background: linear-gradient(135deg, #0078d4, #00bcf2); color: white; }
.platform-Mac { background: linear-gradient(135deg, #333, #666); color: white; }
.platform-Linux { background: linear-gradient(135deg, #f59e0b, #ef4444); color: white; }
.platform-Android { background: linear-gradient(135deg, #3ddc84, #0f9d58); color: white; }
.platform-iOS { background: linear-gradient(135deg, #007aff, #5ac8fa); color: white; }
.platform-Web { background: linear-gradient(135deg, #8b5cf6, #ec4899); color: white; }
.platform-小程序 { background: linear-gradient(135deg, #07c160, #10b981); color: white; }

/* ========== 12. 分类色标 ========== */
.category-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background-color: var(--primary-light);
  color: var(--primary-color);
}

[data-theme="dark"] .category-tag {
  background-color: rgba(99, 102, 241, 0.15);
  color: var(--primary-color);
}

/* ========== 13. 授权类型徽章 ========== */
.license-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  gap: 3px;
}

.license-free { background: #dcfce7; color: #166534; }
.license-freeOpenSource { background: linear-gradient(135deg, #10b981, #06b6d4); color: white; }
.license-paid { background: #fee2e2; color: #991b1b; }
.license-limitedFree { background: #fef3c7; color: #92400e; }
.license-subscription { background: #ede9fe; color: #5b21b6; }

[data-theme="dark"] .license-free { background: rgba(16, 185, 129, 0.15); color: #34d399; }
[data-theme="dark"] .license-paid { background: rgba(239, 68, 68, 0.15); color: #f87171; }
[data-theme="dark"] .license-limitedFree { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
[data-theme="dark"] .license-subscription { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }

/* ========== 14. 卡片网格 ========== */
.card-section {
  position: relative;
  min-height: 400px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ========== 15. 软件卡片 ========== */
.software-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}

.software-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-color);
}

.card-cover {
  position: relative;
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
  overflow: hidden;
}

.card-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,0.1));
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity var(--transition-base);
}

.software-card:hover .card-cover img {
  opacity: 1;
}

.card-fav {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 34px;
  height: 34px;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .card-fav {
  background-color: rgba(30, 41, 59, 0.95);
}

.card-fav:hover {
  transform: scale(1.15);
}

.card-fav.active {
  color: var(--danger-color);
}

.card-fav.active .fav-icon {
  animation: heartBeat 500ms ease;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(0.95); }
  75% { transform: scale(1.15); }
}

.card-open-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-top {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.card-logo {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--primary-light), rgba(139, 92, 246, 0.1));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px var(--border-color);
}

.card-title-wrap {
  flex: 1;
  min-width: 0;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.card-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px dashed var(--border-color);
  margin-top: auto;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-item .stat-icon {
  font-size: 13px;
}

.stat-rating { color: var(--warning-color); }
.stat-downloads { color: var(--danger-color); }
.stat-size { color: var(--text-tertiary); }

/* ========== 16. 三状态（空/加载/错误） ========== */
.state-loading,
.state-empty,
.state-error {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-color);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--bg-tertiary);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.state-loading p {
  color: var(--text-tertiary);
  font-size: 14px;
}

.empty-emoji,
.error-emoji {
  font-size: 64px;
  margin-bottom: 20px;
  animation: float 2000ms ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.state-empty h3,
.state-error h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

.state-empty p,
.state-error p {
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

/* ========== 17. Modal弹窗 ========== */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 200ms ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-container {
  position: relative;
  width: 100%;
  max-width: 920px;
  max-height: calc(100vh - 40px);
  background-color: var(--bg-secondary);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: slideUp 300ms cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 20;
  width: 38px;
  height: 38px;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
}

.modal-close:hover {
  background-color: var(--danger-color);
  color: white;
  transform: rotate(90deg);
}

.modal-content {
  overflow-y: auto;
  flex: 1;
}

/* 弹窗头部 Banner */
.modal-banner {
  position: relative;
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
  overflow: hidden;
}

.modal-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
}

.modal-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, var(--bg-secondary));
}

.modal-header-info {
  position: relative;
  padding: 0 28px;
  margin-top: -56px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-end;
  gap: 20px;
  z-index: 5;
}

.modal-logo {
  width: 96px;
  height: 96px;
  background: linear-gradient(135deg, var(--primary-light), var(--bg-secondary));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  box-shadow: var(--shadow-lg), 0 0 0 4px var(--bg-secondary);
  flex-shrink: 0;
}

.modal-title-group {
  flex: 1;
  min-width: 0;
  padding-bottom: 8px;
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-subtags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 弹窗Tab切换 */
.modal-tabs {
  display: flex;
  gap: 4px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.modal-tab {
  position: relative;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-tertiary);
  transition: all var(--transition-base);
  white-space: nowrap;
}

.modal-tab:hover {
  color: var(--text-primary);
}

.modal-tab.active {
  color: var(--primary-color);
}

.modal-tab.active::after {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -1px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--purple-color));
  border-radius: 3px 3px 0 0;
}

.modal-tab-content {
  padding: 0 28px 28px;
  animation: tabFadeIn 300ms ease;
}

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

/* Tab: 简介 */
.intro-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 24px;
  padding: 18px;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary-color);
}

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

.info-item {
  display: flex;
  padding: 14px;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  gap: 12px;
  transition: background-color var(--transition-fast);
}

.info-item:hover {
  background-color: var(--bg-hover);
}

.info-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.info-label {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.info-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-all;
}

.download-btn-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all var(--transition-base);
  text-decoration: none;
  font-size: 14px;
}

.download-btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
  color: white;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

.download-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
  color: white;
}

.download-btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.download-btn-secondary:hover {
  background-color: var(--bg-hover);
  transform: translateY(-2px);
}

/* Tab: 系统需求 */
.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 18px;
  background: linear-gradient(180deg, var(--primary-color), var(--purple-color));
  border-radius: 2px;
}

.req-platform-group {
  margin-bottom: 22px;
}

.req-platform-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 14px;
}

.req-cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.req-col {
  padding: 16px;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
}

.req-col:hover {
  background-color: var(--bg-hover);
}

.req-col-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.req-col-title.min { color: var(--text-tertiary); }
.req-col-title.recom { color: var(--success-color); }

.req-list {
  list-style: none;
}

.req-list li {
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px dashed var(--border-color);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.req-list li:last-child {
  border-bottom: none;
}

.req-list .req-key {
  color: var(--text-tertiary);
  font-size: 12px;
  flex-shrink: 0;
}

.req-list .req-val {
  font-weight: 500;
  text-align: right;
}

/* Tab: 功能亮点 */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.highlight-item:hover {
  background-color: var(--bg-hover);
  transform: translateX(4px);
}

.highlight-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

.highlight-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-top: 8px;
}

/* Tab: 更新日志 */
.changelog-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.changelog-item {
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: background-color var(--transition-fast);
}

.changelog-item:hover {
  background-color: var(--bg-hover);
}

.changelog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  cursor: pointer;
  user-select: none;
}

.changelog-version {
  display: flex;
  align-items: center;
  gap: 10px;
}

.changelog-ver-badge {
  padding: 5px 12px;
  background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 12px;
  font-family: 'SF Mono', Consolas, monospace;
}

.changelog-date {
  font-size: 12px;
  color: var(--text-tertiary);
}

.changelog-toggle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  color: var(--text-tertiary);
  font-size: 16px;
}

.changelog-item.expanded .changelog-toggle {
  transform: rotate(180deg);
  background-color: var(--primary-color);
  color: white;
}

.changelog-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

.changelog-item.expanded .changelog-body {
  max-height: 500px;
}

.changelog-content {
  padding: 0 18px 18px;
  list-style: none;
}

.changelog-content li {
  padding: 8px 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-secondary);
  position: relative;
  border-top: 1px dashed var(--border-color);
}

.changelog-content li:first-child {
  border-top: none;
}

.changelog-content li::before {
  content: '•';
  position: absolute;
  left: 4px;
  color: var(--primary-color);
  font-weight: bold;
}

/* Tab: 相似推荐 */
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.related-card {
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: 12px;
}

.related-card:hover {
  background-color: var(--bg-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.related-logo {
  width: 44px;
  height: 44px;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px var(--border-color);
}

.related-info {
  flex: 1;
  min-width: 0;
}

.related-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.related-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Tab: 用户评价 */
.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.review-item {
  padding: 18px;
  background-color: var(--bg-tertiary);
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast);
}

.review-item:hover {
  background-color: var(--bg-hover);
}

.review-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.review-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 16px;
  overflow: hidden;
  flex-shrink: 0;
}

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

.review-user-info {
  flex: 1;
}

.review-nickname {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  margin-bottom: 4px;
}

.review-rating {
  display: flex;
  gap: 2px;
}

.star {
  font-size: 14px;
  color: #cbd5e1;
}

.star.filled {
  color: var(--warning-color);
}

.review-content {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  padding-left: 56px;
}

/* ========== 18. 回到顶部按钮 ========== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
  z-index: 90;
  transition: all var(--transition-base);
}

.back-to-top:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 26px rgba(79, 70, 229, 0.5);
}

.back-to-top.show {
  display: flex !important;
  animation: fadeInUp 300ms ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== 19. 页脚 ========== */
.site-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 28px 0;
  transition: background-color var(--transition-base), border-color var(--transition-base);
}

.site-footer p {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
}

/* ========== 20. 响应式三断点 ========== */
/* 断点1: 1200px及以下 */
@media (max-width: 1200px) {
  .container {
    padding: 0 16px;
  }

  .site-main {
    padding: 24px 16px 50px;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
  }

  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 断点2: 768px及以下 (平板) */
@media (max-width: 768px) {
  .header-inner {
    height: 60px;
  }

  .logo h1 {
    font-size: 17px;
  }

  .logo-emoji {
    font-size: 24px;
  }

  .header-btn {
    padding: 7px 11px;
  }

  .site-main {
    padding: 20px 14px 40px;
  }

  .filter-section {
    padding: 16px;
  }

  .tab-btn {
    padding: 7px 13px;
    font-size: 12px;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
  }

  .card-cover {
    height: 120px;
  }

  .card-logo {
    width: 46px;
    height: 46px;
    font-size: 24px;
  }

  .modal-container {
    max-height: calc(100vh - 24px);
    border-radius: var(--radius-lg);
  }

  .modal-banner {
    height: 160px;
  }

  .modal-header-info {
    padding: 0 20px;
    margin-top: -44px;
    gap: 14px;
    align-items: center;
  }

  .modal-logo {
    width: 72px;
    height: 72px;
    font-size: 36px;
    box-shadow: var(--shadow-md), 0 0 0 3px var(--bg-secondary);
  }

  .modal-title {
    font-size: 19px;
  }

  .modal-tabs {
    padding: 0 20px;
  }

  .modal-tab {
    padding: 12px 14px;
    font-size: 13px;
  }

  .modal-tab-content {
    padding: 0 20px 20px;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .req-cols {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .highlights-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .review-content {
    padding-left: 0;
    padding-top: 4px;
  }

  .back-to-top {
    width: 44px;
    height: 44px;
    bottom: 20px;
    right: 20px;
  }
}

/* 断点3: 480px及以下 (手机) */
@media (max-width: 480px) {
  .header-inner {
    height: 56px;
  }

  .logo h1 {
    font-size: 15px;
  }

  .logo-emoji {
    font-size: 22px;
  }

  .fav-count {
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    padding: 0 5px;
  }

  .site-main {
    padding: 16px 12px 32px;
  }

  .search-box {
    padding: 2px 2px 2px 14px;
    border-radius: var(--radius-lg);
  }

  #search-input {
    height: 42px;
    font-size: 14px;
  }

  .filter-section {
    padding: 14px;
    border-radius: var(--radius-md);
  }

  .filter-group {
    margin-bottom: 14px;
  }

  .filter-label {
    margin-bottom: 10px;
  }

  .tab-group {
    gap: 6px;
  }

  .tab-btn {
    padding: 6px 11px;
    font-size: 12px;
    border-radius: var(--radius-sm);
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .software-card:hover {
    transform: none;
  }

  .card-cover {
    height: 130px;
  }

  .state-loading,
  .state-empty,
  .state-error {
    padding: 50px 16px;
  }

  .empty-emoji,
  .error-emoji {
    font-size: 52px;
  }

  .modal-mask {
    padding: 0;
  }

  .modal-container {
    max-height: 100vh;
    border-radius: 0;
  }

  .modal-close {
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    font-size: 20px;
  }

  .modal-banner {
    height: 130px;
  }

  .modal-header-info {
    padding: 0 16px;
    margin-top: -36px;
    gap: 12px;
    flex-direction: column;
    align-items: flex-start;
  }

  .modal-logo {
    width: 64px;
    height: 64px;
    font-size: 32px;
  }

  .modal-title-group {
    padding-bottom: 0;
  }

  .modal-title {
    font-size: 17px;
  }

  .modal-tabs {
    padding: 0 16px;
    margin-bottom: 18px;
  }

  .modal-tab {
    padding: 11px 10px;
    font-size: 12px;
  }

  .modal-tab-content {
    padding: 0 16px 16px;
  }

  .info-grid {
    gap: 10px;
    margin-bottom: 18px;
  }

  .info-item {
    padding: 12px;
    gap: 10px;
  }

  .download-btn-wrap {
    gap: 10px;
  }

  .download-btn {
    padding: 10px 18px;
    font-size: 13px;
    flex: 1;
    justify-content: center;
  }

  .req-platform-group {
    margin-bottom: 18px;
  }

  .req-cols {
    gap: 10px;
  }

  .req-col {
    padding: 14px;
  }

  .highlight-item {
    padding: 14px;
    gap: 12px;
  }

  .highlight-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .related-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .review-item {
    padding: 14px;
  }

  .review-header {
    gap: 10px;
  }

  .review-avatar {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .site-footer {
    padding: 22px 0;
  }

  .site-footer p {
    font-size: 12px;
    padding: 0 16px;
    line-height: 1.6;
  }

  .back-to-top {
    width: 40px;
    height: 40px;
    font-size: 18px;
    bottom: 16px;
    right: 16px;
  }
}

/* ========== 21. 滚动条美化 ========== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-color), var(--purple-color));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--primary-hover), var(--purple-color));
}

/* ========== 22. 文本选择 ========== */
::selection {
  background-color: var(--primary-color);
  color: white;
}

/* ========== 23. 无障碍 - 焦点可见 ========== */
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ========== 24. 减少动画 (尊重用户偏好) ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
