/* =============================================
   vposy.top - 前台响应式样式
   基于旧版 styles.css 升级，新增响应式支持
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

:root {
  --primary: #1ea6e6;
  --primary-dark: #1295d2;
  --primary-light: #e2f3ff;
  --bg: #ffffff;
  --bg-alt: #f7f7f7;
  --text: #111111;
  --text-secondary: #4a4a4a;
  --text-muted: #a7a7a7;
  --border: #e7e7e7;
  --border-light: #f0f0f0;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 20px rgba(0,0,0,0.1);
  --sidebar-w: 200px;
  --header-h: 56px;
  --max-width: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: #fff; border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.header-inner {
  max-width: var(--max-width); margin: 0 auto;
  display: flex; align-items: center; height: var(--header-h);
  padding: 0 24px; gap: 16px;
}
.header-logo {
  font-size: 20px; font-weight: 700; color: var(--primary);
  white-space: nowrap; flex-shrink: 0;
  letter-spacing: -0.5px;
}
.header-logo:hover { color: var(--primary-dark); }
.header-search { flex: 1; display: flex; justify-content: flex-end; }
.search-form { display: flex; align-items: center; max-width: 360px; width: 100%; }
.search-input {
  flex: 1; padding: 8px 14px; border: 1px solid var(--border); border-right: none;
  border-radius: 20px 0 0 20px; font-size: 14px; font-family: inherit;
  background: var(--bg-alt); outline: none; transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--primary); background: #fff; }
.search-btn {
  padding: 8px 16px; border: 1px solid var(--primary); background: var(--primary);
  color: #fff; border-radius: 0 20px 20px 0; cursor: pointer;
  display: flex; align-items: center; transition: background 0.2s;
}
.search-btn:hover { background: var(--primary-dark); }

.menu-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.menu-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all 0.3s; }
.mobile-nav { display: none; }

/* ── Page Layout ── */
.page-layout {
  max-width: var(--max-width); margin: 0 auto;
  display: flex; gap: 0; padding-top: 0;
}

/* ── Sidebar ── */
.site-sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h));
  overflow-y: auto; padding: 24px 0;
  border-right: 1px solid var(--border-light);
}
.sidebar-nav { display: flex; flex-direction: column; }
.sidebar-link {
  display: block; padding: 10px 20px; font-size: 14px; font-weight: 500;
  color: var(--text-secondary); border-left: 3px solid transparent;
  transition: all 0.2s;
}
.sidebar-link:hover, .sidebar-link.active {
  color: var(--primary); background: var(--primary-light);
  border-left-color: var(--primary);
}

/* ── Main Content ── */
.site-main {
  flex: 1; min-width: 0; padding: 24px;
}

.category-section { margin-bottom: 36px; }
.category-section:last-child { margin-bottom: 0; }
.category-title {
  font-size: 20px; font-weight: 700; margin-bottom: 16px;
  padding-bottom: 8px; border-bottom: 2px solid var(--primary-light);
  color: var(--text);
}
.category-desc { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }

/* ── Software Grid ── */
.software-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.software-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: all 0.25s ease; position: relative;
  text-decoration: none; color: inherit;
}
.software-card:hover {
  border-color: var(--primary); box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.software-card--recommended { border-left: 3px solid #f59e0b; }
.software-card-icon {
  width: 48px; height: 48px; flex-shrink: 0;
  border-radius: 10px; overflow: hidden; background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
}
.software-card-icon img { width: 100%; height: 100%; object-fit: contain; }
.software-card-name { flex: 1; font-size: 16px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn-download {
  padding: 6px 20px; background: var(--primary); color: #fff;
  border: none; border-radius: 16px; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; white-space: nowrap;
  font-family: inherit;
}
.btn-download:hover { background: var(--primary-dark); transform: scale(1.05); }

.rec-badge {
  position: absolute; top: -4px; right: -4px;
  color: #f59e0b; font-size: 16px; line-height: 1;
}

/* ── Breadcrumb ── */
.breadcrumb { padding: 8px 0 16px; font-size: 13px; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text-secondary); }

/* ── Software Detail ── */
.software-detail { padding-top: 8px; }
.software-detail-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.software-detail-icon { width: 72px; height: 72px; border-radius: 16px; object-fit: contain; background: var(--bg-alt); }
.software-detail-header h2 { font-size: 24px; font-weight: 700; }
.software-detail-desc { color: var(--text-secondary); margin-bottom: 24px; line-height: 1.8; }
.badge-rec { display: inline-block; background: #fef3c7; color: #92400e; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; margin-right: 6px; }
.badge-cat { display: inline-block; background: var(--primary-light); color: var(--primary-dark); padding: 2px 10px; border-radius: 12px; font-size: 12px; }

/* ── Download Section ── */
.download-section { margin-top: 16px; }
.download-section h3 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.download-links { display: flex; flex-direction: column; gap: 8px; }
.download-link-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--text);
  transition: all 0.2s;
}
.download-link-item:hover { border-color: var(--primary); box-shadow: var(--shadow-hover); }
.dl-icon { width: 28px; height: 28px; border-radius: 6px; object-fit: contain; flex-shrink: 0; }
.dl-name { font-weight: 500; min-width: 80px; }
.dl-code { font-size: 13px; color: var(--text-muted); flex: 1; }
.dl-btn {
  padding: 6px 18px; background: var(--primary); color: #fff;
  border-radius: 16px; font-size: 13px; font-weight: 500;
  transition: background 0.2s;
}
.download-link-item:hover .dl-btn { background: var(--primary-dark); }

/* ── Download Modal (Overlay) ── */
.download-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 5000;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s;
}
.download-modal {
  background: #fff; border-radius: 16px; padding: 28px;
  max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: scaleIn 0.25s ease;
  position: relative;
}
.download-modal h3 { font-size: 20px; margin-bottom: 20px; text-align: center; }
.download-modal .modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border: none; background: none;
  font-size: 22px; cursor: pointer; border-radius: 6px;
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
}
.download-modal .modal-close:hover { background: var(--bg-alt); }
.download-modal .download-links { margin-top: 0; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── Floating QR ── */
.qr-float { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 900; display: flex; flex-direction: column; gap: 8px; }
.qr-float-item { position: relative; }
.qr-float-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-width: 44px;
  padding: 10px 12px; background: var(--primary); color: #fff;
  border: none; border-radius: 8px 0 0 8px; font-size: 13px; font-weight: 500;
  cursor: pointer; letter-spacing: 2px; font-family: inherit;
  transition: background 0.2s;
}
.qr-float-btn:hover { background: var(--primary-dark); }
.qr-float-card { position: absolute; right: 100%; top: 0; margin-right: 8px; background: #fff; border-radius: 12px; padding: 8px; box-shadow: var(--shadow-hover); opacity: 0; visibility: hidden; transition: all 0.3s; z-index: 10; pointer-events: auto; white-space: nowrap; width: 156px; height: 156px; box-sizing: border-box; overflow: hidden; }
.qr-float-item:hover .qr-float-card { opacity: 1; visibility: visible; }
.qr-float-card img { width: 140px; height: 140px; border-radius: 6px; object-fit: contain; }

/* QR button icons - hidden on desktop, shown on mobile */
.qr-btn-icon { display: none; width: 20px; height: 20px; flex-shrink: 0; }
.qr-btn-text { display: inline; }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; }
.footer-inner { max-width: var(--max-width); margin: 0 auto; padding: 24px; text-align: center; }
.footer-inner p { font-size: 13px; color: var(--text-muted); }
.footer-icp { margin-top: 4px; }
.footer-icp a { color: var(--text-muted); }
.footer-icp a:hover { color: var(--primary); }

/* ── Search Page ── */
.search-hero { text-align: center; padding: 40px 0 24px; }
.search-hero h2 { font-size: 28px; margin-bottom: 16px; }
.search-form-large { display: flex; gap: 8px; max-width: 500px; margin: 0 auto; }
.search-input-large { flex: 1; padding: 12px 18px; border: 2px solid var(--border); border-radius: 24px; font-size: 16px; font-family: inherit; outline: none; }
.search-input-large:focus { border-color: var(--primary); }
.search-form-large .btn { padding: 12px 28px; border-radius: 24px; font-size: 15px; }

/* ── Pagination ── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 32px; padding: 16px 0; flex-wrap: wrap; }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; color: var(--text-secondary);
  text-decoration: none; transition: all 0.2s;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-ellipsis { padding: 0 4px; color: var(--text-muted); }

/* ── Buttons (utility) ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all 0.2s; font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

/* ══════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ══════════════════════════════════════ */

/* Tablet: <= 768px */
@media (max-width: 768px) {
  .page-layout { flex-direction: column; }
  
  .site-sidebar { display: none; }
  
  .header-logo { font-size: 18px; }

  .menu-toggle { display: flex; }
  
  .mobile-nav {
    display: none; flex-direction: column;
    background: #fff; border-top: 1px solid var(--border);
    padding: 8px 0;
  }
  .mobile-nav.open { display: flex; }
  .mobile-nav a {
    display: block; padding: 12px 24px; font-size: 15px; font-weight: 500;
    color: var(--text-secondary); border-bottom: 1px solid var(--border-light);
  }
  .mobile-nav a:hover { color: var(--primary); background: var(--primary-light); }

  .site-main { padding: 16px; }

  .software-grid { grid-template-columns: repeat(2, 1fr); }

  .software-detail-header { flex-direction: column; text-align: center; }
  .software-detail-header h2 { font-size: 20px; }

  .qr-float { right: 4px; }
  .qr-float-btn { padding: 8px 10px; font-size: 12px; }

  .download-modal { padding: 20px; width: 95%; }
}

/* Mobile: <= 480px */
@media (max-width: 480px) {
  .header-inner { padding: 0 12px; }
  .header-logo { font-size: 16px; }
  
  .search-input { font-size: 13px; padding: 6px 10px; }
  .search-btn { padding: 6px 12px; }

  .site-main { padding: 12px; }

  .software-grid { grid-template-columns: 1fr; gap: 8px; }
  .software-card { padding: 12px 16px; }
  .software-card-icon { width: 40px; height: 40px; border-radius: 8px; }
  .software-card-name { font-size: 14px; font-weight: 600; }

  .category-title { font-size: 18px; }
  
  .download-link-item { flex-wrap: wrap; gap: 8px; padding: 12px; }
  .dl-code { width: 100%; }

  /* QR float: icon-only on mobile */
  .qr-float-btn { display: flex; flex-direction: row; align-items: center; justify-content: center; writing-mode: horizontal-tb; letter-spacing: 0; font-size: 0; padding: 8px 10px; }
  .qr-btn-icon { display: block; width: 18px; height: 18px; }
  .qr-btn-text { display: none; }
}
