/* ============================================
   鲲鸿祥瑞产品展示 - 全局样式
   更新日期：20260616
   ============================================ */

:root {
  --primary: #4eb3f0;
  --primary-dark: #3a9fd9;
  --header-height: 52px;
  --primary-light: #e8f6fd;
  --bg: #ffffff;
  --bg-secondary: #f5f7fa;
  --text: #333333;
  --text-light: #666666;
  --text-muted: #999999;
  --border: #e0e0e0;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.12);
  --radius: 8px;
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --transition: all 0.25s ease;
}

/* ---------- Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-stack);
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  cursor: pointer;
  font-family: var(--font-stack);
  border: none;
  outline: none;
  transition: var(--transition);
}

input, textarea, select {
  font-family: var(--font-stack);
  outline: none;
  transition: var(--transition);
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 20px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.logo-link {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.logo-link:hover {
  opacity: 0.85;
}

.logo-img {
  height: 50px;
  width: auto;
  display: block;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.site-title:hover {
  color: var(--primary-dark);
}

.main-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-link.active {
  color: #fff;
  background: var(--primary);
}

.nav-link.active:hover {
  background: var(--primary-dark);
  color: #fff;
}

/* ---------- Login ---------- */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 200px);
  padding: 40px 20px;
}

.login-card {
  background: var(--bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
}

.login-card h2 {
  text-align: center;
  margin-bottom: 28px;
  color: var(--primary);
  font-size: 1.4rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(78, 179, 240, 0.15);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.error-msg {
  color: #e74c3c;
  font-size: 0.85rem;
  margin-top: 4px;
  display: none;
}

.error-msg.show {
  display: block;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
}

.btn-danger {
  background: #e74c3c;
  color: #fff;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-warning {
  background: #f39c12;
  color: #fff;
}

.btn-warning:hover {
  background: #e67e22;
}

.btn-success {
  background: #27ae60;
  color: #fff;
}

.btn-success:hover {
  background: #219a52;
}

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 500;
}

.status-badge.online {
  background-color: #d4edda;
  color: #155724;
}

.status-badge.offline {
  background-color: #f8d7da;
  color: #721c24;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

/* ---------- Navigation ---------- */
.nav-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-search-input {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  width: 200px;
  transition: var(--transition);
}

.nav-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(78, 179, 240, 0.15);
}

.nav-search-btn {
  padding: 6px 14px;
  font-size: 0.85rem;
}

/* 返回首页按钮 */
.btn-back-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition);
  min-height: 44px;
  min-width: 44px;
}
.btn-back-home:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: scale(1.05);
}
@media (max-width: 768px) {
  .btn-back-home {
    padding: 10px 20px;
    font-size: 0.95rem;
    min-height: 44px;
  }
}

.nav-cat-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-cat-btns::-webkit-scrollbar {
  display: none;
}

.nav-btn {
  padding: 8px 20px;
  border-radius: 20px;
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.nav-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---------- Side Nav (index) ---------- */
.side-nav {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: #ffffff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px 6px;
  z-index: 200;
  min-width: 60px;
  max-width: 100px;
  display: block;
}

.side-nav-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-search-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.side-search-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.side-search-icon:hover {
  background: var(--primary-dark);
}

.side-search-popup {
  display: none;
  position: absolute;
  right: 50px;
  top: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  padding: 8px;
  z-index: 201;
  white-space: nowrap;
}

.side-search-popup.active {
  display: block;
}

.side-search-input {
  width: 180px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
}

.side-search-input:focus {
  border-color: var(--primary);
  outline: none;
}

.side-search-btn {
  padding: 5px 10px;
  font-size: 0.8rem;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  white-space: nowrap;
}

.side-nav-btns {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.side-nav-btns .nav-btn,
.side-nav .nav-btn {
  display: block;
  text-align: center;
  font-size: 0.75rem;
  padding: 5px 6px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 88px;
}



/* ---------- Masonry ---------- */
.masonry-container {
  flex: 1;
  min-width: 0;
  padding: 20px;
  margin-right: 0;
}

.masonry {
  position: relative;
}

.masonry-item {
  position: absolute;
  opacity: 0;
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: opacity .2s ease;
}

.masonry-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.masonry-item .poster-link {
  display: block;
  position: relative;
}

.masonry-item .poster-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  max-height: none;
}

.masonry-item .poster-info {
  padding: 10px 12px;
  cursor: pointer;
  background: #ffffff;
  transition: background-color 0.2s ease;
}

.masonry-item .poster-info:hover {
  background-color: #f5f5f5;
}

.masonry-item .poster-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #222222;
  line-height: 1.4;
}

.masonry-item .poster-time {
  font-size: 0.78rem;
  color: #999999;
  margin-top: 4px;
}

/* Detail table thumbnail */
/* Poster thumbnail (9:16) */
.detail-poster-thumb {
  width: auto;
  height: 200px;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: top center;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.detail-poster-thumb:hover {
  transform: scale(1.02);
}

/* Cover thumbnail (9:16) */
.detail-cover-thumb {
  width: auto;
  height: 200px;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: top center;
  border-radius: 3px;
  border: 1px solid #ddd;
}
.card-cover-wrap {
  text-align: center;
  padding: 8px 0 4px;
}

/* Admin table thumbnail */
.admin-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 3px;
}

/* ---------- Product Table (detail) ---------- */
.product-table-container {
  padding: 20px;
  overflow-x: auto;
}

.product-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.product-table th {
  background: var(--primary-light);
  color: var(--text);
  padding: 12px 10px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.product-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.product-table tbody tr {
  transition: var(--transition);
}

.product-table tbody tr:hover {
  background: var(--bg-secondary);
}

.product-table .thumb-img {
  width: 80px;
  border-radius: 4px;
  cursor: pointer;
}

.policy-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
}

.policy-cell.expanded {
  white-space: normal;
  max-width: 400px;
}

.file-icon-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-size: 0.85rem;
  cursor: pointer;
}

.file-icon-link:hover {
  color: var(--primary-dark);
}

/* ---------- Admin ---------- */
.admin-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 20px;
}

.admin-header {
  text-align: center;
  margin-bottom: 28px;
}

.admin-header h1 {
  font-size: 1.4rem;
  color: var(--primary);
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-light);
}

.admin-form {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.admin-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.admin-form .form-row.full {
  grid-template-columns: 1fr;
}

.admin-form .image-preview {
  margin-top: 8px;
  max-width: 200px;
  border-radius: 6px;
}

.admin-product-list {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-table th {
  background: var(--bg-secondary);
  padding: 10px 8px;
  text-align: left;
  font-weight: 600;
}

.admin-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.admin-table tbody tr:hover {
  background: var(--primary-light);
}

.action-btns {
  display: flex;
  gap: 6px;
}

.export-section {
  margin-top: 16px;
  text-align: right;
}

.export-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ---------- Tab Navigation ---------- */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--primary-light);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 10px 24px;
  background: transparent;
  color: var(--text-light);
  font-size: 0.95rem;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.tab-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ---------- Config Card ---------- */
.config-card {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.config-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: 6px;
}

/* ---------- Logo Preview ---------- */
.logo-preview-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

.logo-preview-box p {
  font-size: 0.9rem;
  color: var(--text-light);
  white-space: nowrap;
}

.logo-preview-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  padding: 4px;
}

/* ---------- Category List ---------- */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.category-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.category-row:hover {
  border-color: var(--primary);
}

.category-index {
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 24px;
}

.category-name {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

/* Star button */
.star-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  color: #ccc;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  line-height: 1;
}

.star-btn:hover {
  color: #f0c040;
  background: rgba(240, 192, 64, 0.1);
}

.star-btn.starred {
  color: #f0c040;
  text-shadow: 0 0 4px rgba(240, 192, 64, 0.5);
}

.add-category-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.add-category-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
}

.add-category-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(78, 179, 240, 0.15);
}

/* ---------- User Table ---------- */
.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.user-table th {
  background: var(--bg-secondary);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}

.user-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.user-table tbody tr:hover {
  background: var(--primary-light);
}

.password-cell {
  font-family: monospace;
  letter-spacing: 2px;
}

.add-user-row {
  margin-top: 16px;
  text-align: right;
}

/* ---------- Export Actions ---------- */
.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-bottom: 20px;
}

.export-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.export-btn {
  min-width: 200px;
}

.export-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* 备案号同行显示，禁止换行 */
.site-footer small {
  display: inline-block;
  white-space: nowrap;
  max-width: none;
}

/* 公安备案图标强制可见（不受全局 img{opacity:0} 懒加载规则影响） */
.site-footer .beian-icon {
  display: inline;
  opacity: 1;
}

.site-footer .divider {
  color: #ccc;
}

/* ---------- Modal ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  justify-content: center;
  align-items: center;
}

.modal-overlay.show,
.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--bg);
  border-radius: 12px;
  padding: 28px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-box h3 {
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 0.9rem;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

.toast.success {
  background: #27ae60;
}

.toast.error {
  background: #e74c3c;
}

/* ---------- No data ---------- */
.no-data {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 20px;
  font-size: 1rem;
}

/* ============================================
   Responsive
   ============================================ */

/* Desktop wide: 5 cols (JS handled) */
@media (min-width: 1400px) {
}

/* Desktop: 4 cols (JS handled) */
@media (min-width: 1025px) and (max-width: 1399px) {
}

/* Tablet: 3 cols (JS handled) */
@media (min-width: 769px) and (max-width: 1024px) {
  .side-nav {
    right: 10px;
    min-width: 50px;
    max-width: 80px;
    padding: 8px 4px;
  }
  .masonry-container {
    margin-right: 100px;
  }
  .admin-form .form-row {
    grid-template-columns: 1fr;
  }
  .tab-btn {
    padding: 10px 16px;
    font-size: 0.88rem;
  }
  .nav-search-input {
    width: 160px;
  }
}

/* Tablet / small: 2 cols (JS handled) */
@media (max-width: 768px) {
  .masonry-container { padding: 10px; margin-right: 0; }
  /* side-nav hidden on mobile — filter-bar-wrapper handles nav */
  .side-nav { display: none !important; }
  /* detail page nav */
  .nav-cat-btns {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
  }
  .nav-cat-btns .nav-btn {
    padding: 6px 12px;
    font-size: 0.82rem;
    white-space: nowrap;
  }
  .nav-search-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }
  .nav-search-row .nav-search-wrap {
    flex: 1;
    min-width: 0;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .masonry-container {
    margin-right: 0;
    padding: 10px;
  }
  /* side-nav hidden — filter-bar-wrapper handles nav */
  .side-nav {
    display: none !important;
  }
  .nav-search-input {
    width: 140px;
    font-size: 0.8rem;
  }
  .product-table th:nth-child(4),
  .product-table td:nth-child(4) {
    display: none;
  }
  .tab-nav {
    gap: 4px;
  }
  .tab-btn {
    padding: 8px 12px;
    font-size: 0.82rem;
  }
  .export-actions {
    flex-direction: column;
    align-items: center;
  }
  .category-row {
    flex-wrap: wrap;
    gap: 8px;
  }
  .logo-preview-box {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Phone: 2 cols (JS handled) */
@media (max-width: 480px) {
  .masonry-container {
    margin-right: 0;
    padding: 8px;
  }
  .masonry-item .poster-name {
    font-size: 0.8rem;
  }
  .masonry-item .poster-time {
    font-size: 0.72rem;
  }
  .site-header {
    padding: calc(var(--header-height) + 2px) 10px 10px;
  }
  .site-title {
    font-size: 1.1rem;
  }
  .logo-img {
    height: 36px;
  }
  .nav-search-input {
    flex: 1;
    min-width: 0;
    font-size: 0.8rem;
    padding: 5px 8px;
  }
  .product-table thead {
    display: none;
  }
  .product-table tbody tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
  }
  .product-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dotted var(--border);
  }
  .product-table tbody td:last-child {
    border-bottom: none;
  }
  .product-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-right: 10px;
  }
  .admin-form .form-row {
    grid-template-columns: 1fr;
  }
  .admin-table {
    font-size: 0.78rem;
  }
  .tab-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .tab-btn {
    padding: 8px 12px;
    font-size: 0.78rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .export-actions {
    flex-direction: column;
    align-items: center;
  }
  .export-btn {
    width: 100%;
    min-width: auto;
  }
  .category-row {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
  }
  .add-category-row {
    flex-direction: column;
  }
  .add-category-row input {
    width: 100%;
  }
  .logo-preview-box {
    flex-direction: column;
    align-items: flex-start;
  }
  .user-table {
    font-size: 0.78rem;
  }
  .user-table th,
  .user-table td {
    padding: 6px 8px;
  }
}

/* ========== Image Modal ========== */
.img-modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.9);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
.img-modal.active {
  display: flex;
}
.img-modal img {
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: default;
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
  transition: transform 0.2s ease;
  -webkit-user-select: none;
  user-select: none;
}

.img-modal-toolbar {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  z-index: 10000;
  pointer-events: none;
}
.img-modal-toolbar .modal-download {
  pointer-events: auto;
  display: inline-block;
  padding: 6px 14px;
  background: #4eb3f0;
  color: #ffffff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.25);
  transition: background 0.2s ease;
}
.img-modal-toolbar .modal-download:hover {
  background: #3a9fd9;
}
.img-modal-toolbar .modal-download:active {
  background: #2d85b8;
}
.img-modal-close {
  pointer-events: auto;
  color: rgba(255,255,255,0.85);
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 12px;
  user-select: none;
  -webkit-user-select: none;
  background: transparent;
  border: none;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.img-modal-close:hover {
  color: #ffffff;
}

.modal-disclaimer {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 10000;
}

/* Close hint (legacy, replaced by toolbar) */
.img-modal::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  pointer-events: none;
  z-index: 10;
}


/* ========== Admin-specific (migrated from admin.html) ========== */
.product-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}
.search-box input {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  width: 200px;
}
.search-box input:focus {
  outline: none;
  border-color: var(--primary, #4eb3f0);
}
.sort-bar {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sort-bar label {
  font-size: 14px;
  color: #666;
}
.sort-bar select {
  padding: 5px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}
.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.category-filter .cat-tag {
  padding: 4px 14px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  background: #f5f5f5;
  transition: all 0.2s;
  user-select: none;
}
.category-filter .cat-tag:hover {
  border-color: var(--primary, #4eb3f0);
  color: var(--primary, #4eb3f0);
}
.category-filter .cat-tag.active {
  background: var(--primary, #4eb3f0);
  color: #fff;
  border-color: var(--primary, #4eb3f0);
}

/* ============================================
   移动端独立规则（最高优先级，所有 @media 之后）
   ============================================ */

/* ---------- 手机端 (≤480px) ---------- */
@media (max-width: 480px) {
  .site-header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: #fff;
    padding: 6px 10px;
  }
  .site-title { font-size: 0.95rem; }
  .logo-img { height: 32px !important; width: auto !important; }
  .main-nav { gap: 2px; }
  .nav-link { padding: 6px 10px; font-size: 0.8rem; }

  /* side-nav hidden on mobile — filter-bar-wrapper handles nav */
  .side-nav {
    display: none !important;
  }

  .masonry-item .poster-time {
    display: block;
    color: #aaaaaa;
    font-size: 0.72rem;
    word-break: break-all;
    white-space: normal;
    margin-top: 4px;
  }
  .poster-img, .masonry-item img {
    max-width: 100%;
    height: auto;
  }
}

/* ---------- 平板端 (481-768px) ---------- */
@media (min-width: 481px) and (max-width: 768px) {
  .site-header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: #fff;
    padding: 8px 12px;
  }
  .site-title { font-size: 1.05rem; }
  .logo-img { height: 36px !important; width: auto !important; }
  .main-nav { gap: 4px; }
  .nav-link { padding: 7px 12px; font-size: 0.85rem; }

  /* side-nav hidden on tablet — filter-bar-wrapper handles nav */
  .side-nav {
    display: none !important;
  }
}

/* ============================================
   优先级输入框
   ============================================ */
.priority-input {
  width: 50px;
  text-align: center;
  padding: 4px 2px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
  -moz-appearance: textfield;
}
.priority-input::-webkit-inner-spin-button,
.priority-input::-webkit-outer-spin-button {
  opacity: 1;
  height: 24px;
}
@media (max-width: 768px) {
  .priority-input {
    width: 44px;
    font-size: 0.78rem;
    min-height: 36px;
  }
}
.sort-radio-group {
  display: inline-flex;
  gap: 4px;
}
.sort-radio-group input[type="radio"] {
  display: none;
}
.sort-radio-group label {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid var(--border, #d1d5db);
  background: var(--bg-secondary, #f9fafb);
  color: var(--text, #333);
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}
.sort-radio-group label:first-of-type {
  border-radius: 6px 0 0 6px;
}
.sort-radio-group label:last-of-type {
  border-radius: 0 6px 6px 0;
}
.sort-radio-group input[type="radio"]:checked + label {
  background: var(--primary, #4eb3f0);
  color: #fff;
  border-color: var(--primary, #4eb3f0);
}

/* ============================================
   导航栏辅助样式（PC 端默认隐藏移动端按钮）
   ============================================ */
.nav-all-mobile,
.side-all-mobile {
  display: none;
}

/* ============================================
   Mobile 产品卡片样式
   ============================================ */
@media (max-width: 768px) {
  /* 隐藏 PC 端表格 */
  .product-table-wrap {
    display: none !important;
  }
  /* 移动端卡片容器 */
  #mobileProductCards {
    display: block;
    padding: 10px;
  }
  .product-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  }
  .product-card .card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 0.9rem;
    line-height: 1.5;
  }
  .product-card .card-row:not(:last-child) {
    border-bottom: 1px solid #f3f4f6;
  }
  .product-card .card-label {
    color: #6b7280;
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-right: 8px;
  }
  .product-card .card-value {
    color: #333;
    text-align: right;
    word-break: break-word;
  }
  .product-card .card-row-cat .card-value {
    font-weight: 600;
    color: var(--primary, #4eb3f0);
  }
  .product-card .card-thumb {
    max-width: 100px;
    max-height: 60px;
    border-radius: 4px;
    cursor: pointer;
  }
  .product-card .card-dl {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary, #4eb3f0);
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    min-height: 36px;
    line-height: 28px;
  }
  .product-card .card-time {
    color: #9ca3af;
    font-size: 0.8rem;
  }
}

/* ============================================
   图片加载优化：缩略图 + 懒加载 + 防布局抖动
   ============================================ */

/* 所有 img 淡入效果 */
/* no-js 降级：JS 未加载时图片直接可见 */
.no-js img { opacity: 1; }

img {
  opacity: 0;
  transition: opacity 0.4s ease;
}
img.loaded,
.logo-img,
.img-modal img {
  opacity: 1;
}

/* 图片容器防布局抖动 */
.img-wrapper {
  position: relative;
  overflow: hidden;
  background: #f0f0f0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.img-wrapper img {
  position: relative;
  z-index: 1;
}
.img-wrapper img.loaded {
  opacity: 1;
}

/* 骨架屏 shimmer 动画 */
.skeleton {
  animation: shimmer 1.5s infinite;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === 来自 admin.html 的内联样式（合并于 2026-07-10） === */
    /* ========== 移动端增强适配 (v2) ========== */

    /* --- Hamburger 按钮 for Tab Nav（默认隐藏） --- */
    .tab-hamburger-btn {
      display: none;
      background: var(--bg-secondary);
      border: 1px solid var(--border);
      font-size: 1rem;
      cursor: pointer;
      color: var(--text);
      padding: 10px 16px;
      border-radius: 6px;
      line-height: 1;
      min-height: 44px;
      min-width: 44px;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      width: 100%;
      text-align: left;
    }
    .tab-hamburger-btn::after {
      content: '\25BC';
      font-size: 0.7rem;
      margin-left: auto;
    }
    .tab-hamburger-btn.expanded::after {
      content: '\25B2';
    }

    @media (max-width: 768px) {
      /* --- 触控区域最小 44px --- */
      .btn, .tab-btn, button, .btn-sm, .btn-primary, .btn-danger,
      .btn-warning, .btn-success, .btn-outline, .star-btn, .cat-tag,
      .status-badge, .nav-btn {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
      }
      .btn-sm {
        padding: 8px 16px;
      }

      /* --- Tab 导航：横向滚动 + 折叠按钮 --- */
      .tab-hamburger-btn {
        display: flex;
        margin-bottom: 12px;
      }
      .tab-nav {
        display: none;
        flex-direction: column;
        gap: 4px;
        border-bottom: none;
        margin-bottom: 16px;
        overflow-x: visible;
      }
      .tab-nav.expanded {
        display: flex;
      }
      .tab-btn {
        text-align: left;
        justify-content: flex-start;
        border-bottom: 1px solid var(--border);
        border-radius: 6px;
        padding: 12px 16px;
        margin-bottom: 0;
        width: 100%;
        font-size: 0.95rem;
      }
      .tab-btn.active {
        background: var(--primary-light);
        color: var(--primary);
        border-bottom: 1px solid var(--primary);
      }

      /* --- 管理容器 --- */
      .admin-container {
        padding: 16px 10px;
        max-width: 100%;
      }
      .admin-header h1 {
        font-size: 1.2rem;
      }

      /* --- 表单行单列 --- */
      .admin-form .form-row {
        grid-template-columns: 1fr !important;
        gap: 12px;
      }
      .admin-form {
        padding: 16px;
      }

      /* --- 表单输入框占满宽度 + 触控 --- */
      .form-group input,
      .form-group textarea,
      .form-group select,
      .search-box input,
      .sort-bar select,
      .add-category-row input {
        min-height: 44px;
        font-size: 1rem;
        width: 100%;
      }

      /* --- 表格：横向滚动容器 --- */
      .admin-product-list {
        padding: 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }
      .admin-table {
        min-width: 600px;
        font-size: 0.82rem;
      }
      .admin-table th,
      .admin-table td {
        padding: 8px 6px;
        white-space: nowrap;
      }

      /* --- 用户表格 --- */
      .config-card {
        padding: 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }
      .user-table {
        min-width: 500px;
        font-size: 0.82rem;
      }
      .user-table th,
      .user-table td {
        padding: 8px 6px;
      }

      /* --- 产品列表头部 --- */
      .product-list-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
      }
      .search-box input {
        width: 100%;
      }

      /* --- 排序栏 --- */
      .sort-bar {
        flex-wrap: wrap;
      }
      .sort-bar select {
        flex: 1;
        min-width: 0;
      }

      /* --- 分类筛选 --- */
      .category-filter {
        gap: 6px;
      }
      .category-filter .cat-tag {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        font-size: 0.82rem;
        padding: 6px 14px;
      }

      /* --- 模态框全屏 --- */
      .modal-overlay.show,
      .modal-overlay.active {
        align-items: flex-end;
      }
      .modal-box {
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        padding: 24px 16px;
        max-height: 90vh;
        overflow-y: auto;
        margin: 0;
      }
      .modal-actions {
        flex-direction: column;
        gap: 8px;
      }
      .modal-actions button {
        width: 100%;
      }

      /* --- Toast --- */
      .toast {
        width: 90%;
        max-width: 400px;
        text-align: center;
        font-size: 0.85rem;
        padding: 12px 20px;
      }

      /* --- Header --- */
      .site-header {
        padding: 14px 12px 10px;
        flex-wrap: wrap;
        gap: 6px;
      }
      .site-title {
        font-size: 1.1rem;
      }
      .logo-img {
        height: 38px;
      }

      /* --- 登录卡片 --- */
      .login-card {
        padding: 24px 18px;
        margin: 10px;
        max-width: 100%;
      }
      .login-card h2 {
        font-size: 1.2rem;
        margin-bottom: 20px;
      }

      /* --- 配置卡片 --- */
      .config-card {
        padding: 16px;
      }
      .add-category-row {
        flex-direction: column;
        gap: 8px;
      }
      .add-category-row input {
        width: 100%;
      }
      .add-category-row .btn {
        width: 100%;
      }

      /* --- Logo 预览 --- */
      .logo-preview-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
      }

      /* --- 分类行 --- */
      .category-row {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
      }

      /* --- 导出操作 --- */
      .export-actions {
        flex-direction: column;
        align-items: center;
      }
      .export-btn {
        width: 100%;
        min-width: auto;
      }

      /* --- Footer --- */
      .site-footer {
        padding: 20px 10px;
        font-size: 0.8rem;
      }

      /* --- 图片自适应 --- */
      .image-preview, .logo-preview-img, .logo-img {
        max-width: 100%;
        height: auto;
      }

      /* --- 新增用户行 --- */
      .add-user-row .btn {
        width: 100%;
      }

      /* --- 表单提交行 --- */
      .admin-form .form-row.full[style*="display:flex"] {
        flex-direction: column !important;
      }
      .admin-form .form-row.full[style*="display:flex"] .btn {
        width: 100%;
      }
    }

    @media (max-width: 480px) {
      .site-header {
        padding: 10px 8px 8px;
      }
      .site-title {
        font-size: 1rem;
      }
      .logo-img {
        height: 32px;
      }
      .admin-container {
        padding: 10px 6px;
      }
      .admin-header h1 {
        font-size: 1.1rem;
      }
      .section-title {
        font-size: 1rem;
      }
      .tab-btn {
        font-size: 0.85rem;
        padding: 10px 14px;
      }
      .admin-table {
        min-width: 520px;
        font-size: 0.78rem;
      }
      .user-table {
        min-width: 420px;
        font-size: 0.78rem;
      }
      .login-card {
        padding: 20px 14px;
      }
      .modal-box {
        padding: 20px 12px;
      }
    }
    /* --- 分类拖拽排序 --- */
    .nav-sortable {
      cursor: default;
    }
    .nav-sortable.dragging {
      opacity: 0.4;
    }
    .drag-handle {
      cursor: grab;
      font-size: 1rem;
      color: #999;
      padding: 0 4px;
      user-select: none;
      line-height: 1;
    }
    .drag-handle:active {
      cursor: grabbing;
    }

    /* --- 添加/编辑产品表单卡片 --- */
    .admin-form-card {
      border: 2px solid var(--primary-light);
      border-radius: 12px;
      padding: 24px;
      margin-bottom: 24px;
      background: #fff;
    }
    .admin-form-card .section-title {
      margin-top: 0;
      margin-bottom: 20px;
    }
    .admin-form-card .admin-form {
      box-shadow: none;
      padding: 0;
      margin-bottom: 0;
    }

    /* --- 三列布局 --- */
    .form-row-three {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 16px;
    }
    .admin-form .form-row-three {
      grid-template-columns: 1fr 1fr 1fr;
    }

    /* --- 文件拖拽上传区 --- */
    .file-drop-zone {
      position: relative;
      border: 2px dashed var(--border);
      border-radius: 8px;
      padding: 16px;
      text-align: center;
      transition: all 0.25s ease;
      background: var(--bg-secondary);
      min-height: 80px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      cursor: pointer;
    }
    .file-drop-zone.drag-over {
      border-color: var(--primary);
      background: var(--primary-light);
      box-shadow: 0 0 0 3px rgba(78, 179, 240, 0.2);
    }
    .file-drop-zone input[type="file"] {
      position: absolute;
      inset: 0;
      opacity: 0;
      cursor: pointer;
      width: 100%;
      height: 100%;
    }
    .drop-hint {
      color: var(--text-muted);
      font-size: 0.85rem;
      pointer-events: none;
    }
    .file-drop-zone .image-preview {
      margin-top: 8px;
      max-width: 120px;
      max-height: 80px;
      border-radius: 4px;
      pointer-events: none;
    }
    .file-drop-zone small {
      pointer-events: none;
    }

    @media (max-width: 768px) {
      .form-row-three {
        grid-template-columns: 1fr;
        gap: 12px;
      }
      .admin-form .form-row-three {
        grid-template-columns: 1fr;
      }
      .file-drop-zone {
        min-height: 60px;
        padding: 12px;
      }
      .admin-form-card {
        padding: 16px 12px;
      }
      .admin-form-card .admin-form .form-row.full[style*="display:flex"] {
        flex-direction: column !important;
      }
      .admin-form-card .admin-form .form-row.full[style*="display:flex"] .btn {
        width: 100%;
      }
    }


/* === 来自 detail.html 的内联样式（合并于 2026-07-10） === */
    /* ========== 移动端增强适配 (v3) ========== */

    /* --- 移动端专用"全部"按钮（默认隐藏） --- */
    .nav-all-mobile {
      display: none;
    }

    @media (max-width: 768px) {
      /* --- 导航栏 sticky 在 header 下方 --- */
      .nav-bar {
        position: sticky;
        top: var(--header-height);
        z-index: 140;
        background: #fff;
        display: flex;
        flex-direction: column;
        gap: 6px;
        padding: 6px 10px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.06);
      }
      .nav-bar .nav-cat-btns {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        overflow-x: auto;
        scrollbar-width: none;
      }
      .nav-bar .nav-cat-btns::-webkit-scrollbar {
        display: none;
      }
      .nav-bar .nav-cat-btns .nav-btn[data-cat="all"] {
        display: none;
      }
      .nav-search-row {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 6px;
      }
      .nav-search-wrap {
        flex: 1;
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0;
      }
      .nav-search-input {
        flex: 1;
        min-width: 0;
        min-height: 44px;
        font-size: 0.9rem;
      }
      .nav-search-btn {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: auto;
        flex-shrink: 0;
      }
      .nav-all-mobile {
        display: inline-flex;
        min-height: 44px;
        min-width: 44px;
        align-items: center;
        justify-content: center;
        padding: 8px 12px;
        flex-shrink: 0;
        white-space: nowrap;
        font-size: 0.85rem;
      }

      /* --- 导航按钮触控 --- */
      .nav-btn {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px 18px;
      }

      /* --- 触控区域最小 44px --- */
      .btn, button, .btn-sm, .btn-primary, .btn-danger,
      .img-modal-close, .modal-download {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
      }

      /* --- PC表格隐藏，改用卡片 --- */
      .product-table-container {
        display: none;
      }
      .mobile-product-cards {
        display: block;
        padding: 10px;
      }
      .product-card {
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 12px;
        margin-bottom: 10px;
        background: #fff;
      }
      .product-card .card-row {
        display: flex;
        align-items: flex-start;
        padding: 6px 0;
        gap: 8px;
      }
      .product-card .card-row + .product-card .card-row {
        border-top: 1px dotted var(--border);
      }
      .card-label {
        font-weight: 600;
        color: var(--text-light);
        font-size: 0.82rem;
        flex-shrink: 0;
        min-width: 64px;
      }
      .copy-policy-btn {
        display: block;
        margin-top: 4px;
        font-size: 0.72rem;
        padding: 3px 10px;
        min-height: 32px;
        min-width: 32px;
        border: 1px solid var(--primary);
        border-radius: 4px;
        background: #fff;
        color: var(--primary);
        cursor: pointer;
        white-space: nowrap;
        line-height: 1;
      }
      .copy-policy-btn:active {
        background: var(--primary);
        color: #fff;
      }
      .card-value {
        color: var(--text);
        font-size: 0.85rem;
        word-break: break-word;
        flex: 1;
      }
      .card-value-full {
        flex: 1;
        min-width: 0;
      }
      .detail-cover-thumb { display: none; }
      .card-cover-wrap { display: none; }
      .detail-poster-thumb {
        max-height: 180px;
        height: auto;
        width: auto;
        aspect-ratio: 9/16;
      }
      .card-download-btn {
        display: inline-block;
        padding: 6px 14px;
        background: var(--primary);
        color: #fff;
        border-radius: 6px;
        text-decoration: none;
        font-size: 0.85rem;
        min-height: 36px;
        line-height: 24px;
      }
      .card-row-poster {
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
      }
      .card-value .detail-thumb,
      .card-value .detail-poster-thumb {
        max-height: 60px;
        max-width: 100px;
        border-radius: 4px;
        cursor: pointer;
      }

      /* --- 模态框全屏 --- */
      .img-modal {
        padding: 10px;
      }
      .img-modal img {
        max-width: 100vw;
        max-height: 100vh;
      }
      .img-modal-toolbar {
        padding: 0 10px;
        top: 5px;
      }
      .img-modal-toolbar .modal-download {
        padding: 8px 16px;
        font-size: 0.9rem;
        min-height: 44px;
      }
      .img-modal-close {
        font-size: 42px;
        padding: 8px 16px;
        min-height: 44px;
      }

      /* --- 图片自适应 --- */
      .detail-thumb, .detail-poster-thumb, .logo-img {
        max-width: 100%;
        height: auto;
      }

      /* --- Header 适配 --- */
      .site-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 150;
        background: #fff;
        padding: 6px 10px;
        flex-wrap: nowrap;
        gap: 6px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06);
      }
      .site-title {
        font-size: 1.1rem;
      }
      .logo-img {
        height: 38px;
      }

      /* --- 登录卡片 --- */
      .login-card {
        padding: 24px 20px;
        margin: 10px;
        max-width: 100%;
      }
      .login-card h2 {
        font-size: 1.2rem;
        margin-bottom: 20px;
      }

      /* --- 表单输入框 --- */
      .form-group input,
      .form-group textarea,
      .form-group select {
        min-height: 44px;
        font-size: 1rem;
        width: 100%;
      }

      /* --- Footer --- */
      .site-footer {
        padding: 20px 10px;
        font-size: 0.8rem;
      }

      /* --- 退出按钮 --- */
      .logout-mobile-wrap {
        margin-bottom: 12px;
      }
      .logout-mobile-btn {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px 24px;
      }
    }

    /* --- PC 端：mobile cards 隐藏 --- */
    .mobile-product-cards {
      display: none;
    }

/* ============================================
   Phase 2: 封面预览 & 月份复选框 & 海报9:16
   ============================================ */
.image-preview-cover,
.image-preview-poster {
  max-width: 200px;
  max-height: none !important;
  width: auto;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  object-position: top center;
  border-radius: 6px;
  margin-top: 8px;
  pointer-events: none;
}

.month-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--bg-secondary);
}

.month-row label {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text);
  user-select: none;
  padding: 2px 4px;
  white-space: nowrap;
}

.month-row label:hover {
  color: var(--primary);
}

.month-row input[type="checkbox"] {
  margin: 0;
  accent-color: var(--primary);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.month-toggle-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.month-toggle-row button {
  padding: 4px 16px;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-secondary);
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}

.month-toggle-row button:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* 月份上传区域：封面图在左侧空出一个块的半行 */
@media (max-width: 768px) {
  .image-preview-cover,
  .image-preview-poster {
    max-width: 140px;
  }
  .month-row {
    flex-wrap: wrap;
    gap: 4px;
  }
  .month-row label {
    font-size: 0.82rem;
  }
}

    @media (max-width: 480px) {
      .site-header {
        padding: 6px 8px;
      }
      .site-title {
        font-size: 1rem;
      }
      .logo-img {
        height: 32px;
      }
      .nav-bar {
        padding: 6px 8px;
      }
      .nav-btn {
        font-size: 0.8rem;
        padding: 7px 12px;
      }
      .card-label {
        font-size: 0.76rem;
        min-width: 56px;
      }
      .card-value {
        font-size: 0.8rem;
      }
      .login-card {
        padding: 20px 14px;
      }
    }

/* ========== 分类管理美化 (2026-07-10) ========== */
.cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 6px;
  background: #f8f9fc;
  border: 1px solid #e0e4ee;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: default;
}
.cat-item:hover {
  background: #eef2fb;
  border-color: #c8d4f0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.cat-item .drag-handle {
  cursor: grab;
  font-size: 1.1rem;
  color: #aab;
  padding: 0 2px;
  user-select: none;
  line-height: 1;
  transition: color 0.15s;
}
.cat-item .drag-handle:active {
  cursor: grabbing;
  color: #667;
}
.cat-item span:nth-child(2) {
  flex: 1;
  font-size: 0.92rem;
  color: #333;
  font-weight: 500;
}
.cat-item .cat-delete-btn {
  min-height: 32px;
  min-width: 32px;
  padding: 4px 12px;
  font-size: 0.78rem;
  border-radius: 5px;
  background: #ffeaea;
  color: #d44;
  border: 1px solid #fcc;
  transition: all 0.15s;
}
.cat-item .cat-delete-btn:hover {
  background: #fdd;
  border-color: #f99;
  color: #b22;
}
.cat-item.dragging {
  opacity: 0.4;
  box-shadow: none;
}
.cat-item.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(78, 179, 240, 0.2);
}
.add-category-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.add-category-row input {
  flex: 1;
  min-width: 140px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
}
.add-category-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(78, 179, 240, 0.15);
  outline: none;
}

/* ============================================
   Phase 3: 月份筛选面板 + 封面角标
   ============================================ */

/* 月份筛选面板 */
.side-month-filter {
  margin-top: 12px;
  padding: 8px 0;
}

.month-filter-title {
  font-size: 13px;
  color: #999;
  margin-bottom: 6px;
}

.month-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.month-checkboxes label {
  font-size: 12px;
  padding: 2px 6px;
  border: 1px solid #ddd;
  border-radius: 3px;
  cursor: pointer;
  user-select: none;
}

.month-checkboxes label.active {
  background: #d4a574;
  color: #fff;
  border-color: #d4a574;
}

.month-checkboxes input[type=checkbox] {
  display: none;
}

/* 封面角标 */
.cover-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 48px;
  height: 85px;
  border-radius: 3px;
  object-fit: cover;
  border: 1.5px solid rgba(255,255,255,.8);
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  z-index: 2;
}


/* ============================================
   Top Category Bar + Month Sidebar (2026-07-14)
   ============================================ */

/* ---------- Main content flex wrapper ---------- */
.main-content-wrap {
  display: flex;
  gap: 0;
  align-items: flex-start;
}

/* ---------- Right side month column ---------- */
.side-month-col {
  width: 110px;
  flex-shrink: 0;
  background: var(--bg);
  border-left: 1px solid var(--border);
  padding: 14px 10px;
  position: sticky;
  top: calc(var(--header-height) + 52px);
  align-self: flex-start;
  max-height: calc(100vh - var(--header-height) - 52px);
  overflow-y: auto;
}

.side-month-col .month-filter-title {
  font-size: 13px;
  color: #999;
  margin-bottom: 10px;
  text-align: center;
  font-weight: 500;
}

.month-checkboxes-vertical {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.month-checkboxes-vertical label.month-btn {
  display: block;
  text-align: center;
  padding: 8px 0;
  border-radius: 20px;
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 0.82rem;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}

.month-checkboxes-vertical label.month-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.month-checkboxes-vertical label.month-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.month-checkboxes-vertical input[type=checkbox] {
  display: none;
}

/* Desktop "全年" button (inside month sidebar) */
.month-checkboxes-vertical .month-btn-all {
  display: block;
  width: 100%;
  text-align: center;
  padding: 8px 0;
  border-radius: 20px;
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 0.82rem;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
  font-family: var(--font-stack);
  margin-bottom: 4px;
}
.month-checkboxes-vertical .month-btn-all:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.month-checkboxes-vertical .month-btn-all.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---------- Top category bar ---------- */
.top-category-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 150;
}

.category-scroll-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  position: relative;
  max-width: calc(100% - 56px);
}

.category-scroll-inner {
  flex: 1;
  overflow-x: auto;
  scroll-behavior: smooth;
  position: relative;
  scrollbar-width: none;
}
.category-scroll-inner::-webkit-scrollbar { display: none; }

/* Gradient edge masks for scroll overflow hint */
.category-scroll-inner::before,
.category-scroll-inner::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 32px;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.2s;
}
.category-scroll-inner::before {
  left: 0;
  background: linear-gradient(to right, #fff, transparent);
  opacity: 0;
}
.category-scroll-inner.scroll-shadow-left::before {
  opacity: 1;
}
.category-scroll-inner::after {
  right: 0;
  background: linear-gradient(to left, #fff, transparent);
  opacity: 0;
}
.category-scroll-inner.scroll-shadow-right::after {
  opacity: 1;
}

.category-btns {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
  padding-right: 4px;
}

.category-btns .nav-btn {
  flex-shrink: 0;
}

/* Sticky "全部" button — fixed left, not masked */
.category-btns .nav-btn[data-cat="all"] {
  position: sticky;
  left: 0;
  z-index: 3;
}

/* ---------- Scroll arrows ---------- */
.scroll-arrow {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 34px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-light);
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
  z-index: 2;
  transition: var(--transition);
  padding: 0;
  line-height: 1;
}

.scroll-arrow:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.scroll-left {
  margin-right: 4px;
}

.scroll-right {
  margin-left: 4px;
}

/* ---------- Top search ---------- */
.top-search-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  position: relative;
  margin-left: 12px;
}

.top-search-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.top-search-icon:hover {
  background: var(--primary-dark);
}

.top-search-popup {
  display: none;
  position: absolute;
  right: 0;
  top: 44px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  padding: 8px;
  z-index: 201;
  white-space: nowrap;
}

.top-search-popup.active {
  display: block;
}

.top-search-input {
  width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
}

.top-search-input:focus {
  border-color: var(--primary);
  outline: none;
}

/* ---------- Filter bar wrapper ---------- */
.filter-bar-wrapper {
  /* desktop: transparent wrapper, sticky handled by child .top-category-bar */
}

/* ---------- Mobile month row (desktop: hidden) ---------- */
.mobile-month-row {
  display: none;
}

/* ============================================
   Responsive: Top Bar + Month Sidebar
   ============================================ */

/* Tablet (769-1024): narrower month column */
@media (min-width: 769px) and (max-width: 1024px) {
  .side-month-col {
    width: 90px;
    padding: 12px 8px;
  }
  .month-checkboxes-vertical label.month-btn {
    font-size: 0.78rem;
    padding: 7px 0;
  }
  .top-category-bar {
    padding: 8px 10px;
  }
  .category-btns {
    gap: 6px;
  }
  .category-btns .nav-btn {
    padding: 6px 14px;
    font-size: 0.82rem;
  }
}

/* Mobile (≤768px): two-row sticky filter bar + bottom sheet */
@media (max-width: 768px) {
  .main-content-wrap {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
  }

  /* Hide desktop side month column */
  .side-month-col {
    display: none !important;
  }

  /* Hide old side-nav on mobile — filter-bar-wrapper replaces it */
  .side-nav {
    display: none !important;
  }

  /* Sticky filter bar wrapper below fixed header */
  .filter-bar-wrapper {
    position: sticky;
    top: var(--header-height);
    z-index: 149;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-top: var(--header-height);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  /* Row 1: Category bar — horizontal scroll */
  .top-category-bar {
    position: static;
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    background: #fff;
  }

  .category-scroll-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    max-width: calc(100% - 48px);
  }

  .category-scroll-inner {
    flex: 1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-behavior: smooth;
    position: relative;
  }
  .category-scroll-inner::-webkit-scrollbar { display: none; }

  /* Gradient masks on mobile same as desktop */
  .category-scroll-inner::before,
  .category-scroll-inner::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 28px;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.2s;
  }
  .category-scroll-inner::before {
    left: 0;
    background: linear-gradient(to right, #fff, transparent);
    opacity: 0;
  }
  .category-scroll-inner.scroll-shadow-left::before {
    opacity: 1;
  }
  .category-scroll-inner::after {
    right: 0;
    background: linear-gradient(to left, #fff, transparent);
    opacity: 0;
  }
  .category-scroll-inner.scroll-shadow-right::after {
    opacity: 1;
  }

  .category-btns {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .category-btns .nav-btn {
    padding: 6px 14px;
    font-size: 0.82rem;
    min-height: 36px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Sticky "全部" on mobile */
  .category-btns .nav-btn[data-cat="all"] {
    position: sticky;
    left: 0;
    z-index: 3;
  }

  /* Hide scroll arrows on mobile */
  .scroll-arrow {
    display: none !important;
  }

  .top-search-wrap {
    flex-shrink: 0;
    margin-left: 6px;
  }

  .top-search-input {
    width: 160px;
  }

  /* Row 2: Month chips + expand button */
  .mobile-month-row {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 6px 8px;
    background: #fff;
    border-bottom: 1px solid var(--border);
  }

  .month-chips-scroll {
    flex: 1;
    min-width: 0;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: relative;
  }
  .month-chips-scroll::-webkit-scrollbar { display: none; }

  /* Gradient masks for month chips scroll */
  .month-chips-scroll::before,
  .month-chips-scroll::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 28px;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.2s;
  }
  .month-chips-scroll::before {
    left: 0;
    background: linear-gradient(to right, #fff, transparent);
    opacity: 0;
  }
  .month-chips-scroll.scroll-shadow-left::before {
    opacity: 1;
  }
  .month-chips-scroll::after {
    right: 0;
    background: linear-gradient(to left, #fff, transparent);
    opacity: 0;
  }
  .month-chips-scroll.scroll-shadow-right::after {
    opacity: 1;
  }

  .month-chip {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 0.82rem;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    transition: var(--transition);
  }
  .month-chip:hover {
    background: var(--primary-light);
    color: var(--primary);
  }
  .month-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
  }

  /* Sticky "全年" chip */
  .month-chip-all {
    position: sticky;
    left: 0;
    z-index: 3;
  }

  /* Masonry container: no extra top padding (filter-bar is sticky, not fixed) */
  .masonry-container {
    padding: 10px !important;
    margin-right: 0 !important;
    padding-top: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden;
  }
}

/* Phone (≤480px): tighter spacing */
@media (max-width: 480px) {
  .top-category-bar {
    padding: 5px 6px;
  }

  .category-btns {
    gap: 4px;
  }

  .category-btns .nav-btn {
    padding: 5px 10px;
    font-size: 0.75rem;
    min-height: 32px;
  }

  .top-search-icon {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  .top-search-input {
    width: 140px;
    font-size: 0.8rem;
  }

  .mobile-month-row {
    padding: 5px 6px;
  }

  .month-chips-scroll {
    gap: 4px;
  }

  .month-chip {
    padding: 4px 10px;
    font-size: 0.72rem;
    min-height: 30px;
  }

  .month-expand-btn {
    padding: 4px 8px;
    font-size: 0.72rem;
    min-height: 30px;
  }

  .month-bottom-sheet-body {
    padding: 12px 16px 20px;
    gap: 6px;
  }

  .month-bottom-sheet-body label.month-sheet-btn {
    padding: 7px 12px;
    font-size: 0.82rem;
    min-width: 52px;
  }

  .masonry-container {
    padding: 8px !important;
    margin-right: 0 !important;
    padding-top: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .masonry-item .poster-name {
    font-size: 0.8rem;
  }

  .masonry-item .poster-time {
    font-size: 0.72rem;
  }
}
