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

:root {
  --bg: #000C2A; --card-bg: #000C2A; --border: #FF770F;
  --text: #f5f5f5; --text-secondary: #b8bfd6;
  --accent: #FF770F; --accent-hover: #FF9A4D;
  --danger: #f85149; --success: #00C853; --warning: #facc15;
  --primary: #FF770F; --radius: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6;
}

/* 弹窗 */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { position: relative; }
.modal-close { position: absolute; top: 12px; right: 16px; font-size: 24px; color: var(--text-secondary); cursor: pointer; line-height: 1; z-index: 5; }
.modal-close:hover { color: var(--danger); }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* Banner */
.banner-area { grid-column: 1 / -1; width: 100%; background: var(--bg); border-bottom: 1px solid var(--border); overflow: hidden; height: 140px; max-height: 140px; display: flex; align-items: center; justify-content: center; }
#banner-img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; }
#banner-text { font-size: 32px; color: #fff; letter-spacing: 2px; padding: 32px 16px; }

/* 用户栏 */
.user-bar { display: flex; justify-content: center; align-items: center; gap: 16px; padding: 10px 20px; font-size: 13px; background: var(--card-bg); border-bottom: 1px solid var(--border); grid-column: 1 / -1; min-height: 44px; flex-wrap: wrap; position: relative; }
.bar-left { display: flex; align-items: center; gap: 16px; }
.bar-tip { color: #fff; font-size: 18px; font-weight: 600; white-space: nowrap; }
.bar-count { color: var(--text-secondary); font-size: 16px; font-weight: 500; white-space: nowrap; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); }
.bar-count span { color: var(--accent); font-weight: 700; }
.ban-red { color: #ef4444; font-size: 18px; font-weight: 900; white-space: nowrap; }
.ban-guide { color: #facc15; font-size: 18px; font-weight: 700; white-space: nowrap; }

.donate-btn {
  background: linear-gradient(135deg, var(--accent), #FFA040);
  color: #fff !important;
  font-size: 16px;
  font-weight: 700;
  padding: 8px 20px;
  border-radius: 20px;
  box-shadow: 0 2px 12px rgba(255,119,15,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}
.donate-btn:hover { transform: scale(1.05); box-shadow: 0 4px 20px rgba(255,119,15,0.6); }



/* 捐赠弹窗 */
.donate-modal { background: var(--card-bg); border: 1px solid var(--border); border-radius: 24px; padding: 54px 60px 48px; text-align: center; animation: modalIn 0.2s ease; min-width: 480px; }
.donate-modal h2 { color: var(--warning); font-size: 33px; margin-bottom: 36px; }
.donate-qrs { display: flex; gap: 30px; justify-content: center; }
.donate-qr { text-align: center; }
.donate-qr img { width: 330px; height: auto; border-radius: 12px; display: block; }

/* 布局 */
.layout { display: grid; grid-template-columns: auto 1fr; gap: 16px; padding: 16px 24px 0 0; }
.content { flex: 1; min-width: 0; }

/* 侧边栏 */
.sidebar { width: 280px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 0 var(--radius) var(--radius) 0; border-left: 3px solid var(--accent); padding: 18px 16px; height: fit-content; position: sticky; top: 16px; align-self: start; }
.filter-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 28px; margin-bottom: 14px; }
.filter-section { margin-bottom: 0; position: relative; }
.filter-section:first-child::after { content: ""; position: absolute; top: 0; right: -14px; bottom: 0; width: 1px; background: linear-gradient(to bottom, transparent, var(--accent) 20%, var(--accent) 80%, transparent); opacity: 0.4; }
.filter-title { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.filter-options { display: flex; flex-direction: column; gap: 4px; }
.filter-chip { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text); transition: background 0.15s; }
.filter-chip:hover { background: rgba(255,119,15,0.1); }
.filter-chip .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2); flex-shrink: 0; }
.filter-chip.active { background: rgba(255,119,15,0.15); color: #fff; }
.filter-chip.active .dot { box-shadow: 0 0 0 2px var(--accent), 0 0 0 3px var(--bg); }
.filter-clear { width: 100%; margin-top: 8px; padding: 8px; background: transparent; color: var(--text-secondary); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; font-size: 13px; transition: all 0.2s; }
.filter-clear:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

/* 法律声明 */
.legal-notice {
  margin-top: 20px; padding: 18px 16px;
  background: var(--bg); border: 2px solid rgba(255,119,15,0.3);
  border-radius: 8px;
}
.legal-notice h4 { color: var(--accent); font-size: 15px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,119,15,0.2); }
.legal-notice p { color: var(--text); font-size: 13px; line-height: 1.8; margin-bottom: 10px; }
.legal-notice p:last-child { margin-bottom: 0; }
.legal-notice strong { color: var(--accent); font-weight: 700; }
.legal-email { color: var(--accent)!important; cursor: pointer; }

/* 搜索 */
.search-area { position: sticky; top: 0; z-index: 50; padding: 16px 16px; background: var(--bg); border-bottom: 1px solid var(--border); width: 100%; box-sizing: border-box; }
.search-row { display: flex; align-items: center; gap: 12px; }
.search-box { display: flex; align-items: center; background: var(--bg); border: 2px solid var(--accent); border-radius: 12px; padding: 6px 8px; box-shadow: 0 0 0 4px rgba(255,119,15,0.2), 0 0 40px rgba(255,119,15,0.08), 0 8px 24px rgba(0,0,0,0.4); }
.search-box:focus-within { border-color: var(--accent-hover); box-shadow: 0 0 0 6px rgba(255,119,15,0.35), 0 0 60px rgba(255,119,15,0.15), 0 8px 32px rgba(0,0,0,0.5); }
.search-icon { padding: 0 8px 0 12px; font-size: 18px; color: var(--accent); }
#search-input { flex: 1; padding: 16px 10px; background: transparent; border: none; color: var(--text); font-size: 18px; outline: none; }
#search-input::placeholder { color: var(--text-secondary); }
#search-btn { padding: 14px 36px; background: var(--accent); color: #fff; border: none; border-radius: 10px; cursor: pointer; font-size: 17px; font-weight: 600; white-space: nowrap; }
#search-btn:hover { background: var(--accent-hover); }
.search-history { margin-top: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.history-label { color: var(--text-secondary); font-size: 13px; flex-shrink: 0; }
.history-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.history-tag { padding: 6px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; color: var(--text); font-size: 13px; cursor: pointer; transition: all 0.2s; }
.history-tag:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.history-clear { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); padding: 6px 12px; border-radius: 16px; font-size: 12px; cursor: pointer; }
.history-clear:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.search-tip { color: #fff; font-size: 18px; font-weight: 600; white-space: nowrap; margin-left: 12px; flex-shrink: 0; }
.stats-bar { padding: 12px 0; color: var(--text-secondary); font-size: 13px; }

/* 卡片 */
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px 18px; padding-bottom: 24px; }
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; position: relative; }
.card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-hover)); opacity: 0; transition: opacity 0.2s; z-index: 2; }
.card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 0 30px rgba(255,119,15,0.25), 0 8px 24px rgba(0,0,0,0.5); }
.card:hover::before { opacity: 1; }
.card-img-wrap { position: relative; overflow: hidden; }
.card-thumb { width: 100%; aspect-ratio: 4/3; object-fit: contain; background: #0d1117; display: block; }

/* 倍速切换按钮 */
.speed-toggle { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; opacity: 0; transition: opacity 0.2s; }
.card:hover .speed-toggle { opacity: 1; }
.speed-btn { width: 56px; height: 40px; border-radius: 20px; background: rgba(255,255,255,0.92); border: none; color: #1f2937; font-size: 15px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.15s; line-height: 1; padding: 0; }
.speed-btn:hover { background: #fff; }
.speed-btn.active { background: var(--accent); color: #fff; }
.card-body { padding: 16px 18px; }
.card-body h3 { font-size: 16px; color: #fff; margin-bottom: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.card-meta { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.card-dim { color: var(--text-secondary); }
.card-size { padding: 3px 8px; background: var(--bg); border-radius: 4px; font-size: 11px; }
.card-frames { padding: 4px 10px; background: var(--bg); border-radius: 4px; font-size: 22px; color: var(--accent); font-weight: 700; }
.no-result { text-align: center; padding: 80px 20px; color: var(--text-secondary); font-size: 18px; }

/* 分页 */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 20px 0 40px; }
.pg-btn { min-width: 36px; height: 36px; padding: 0 10px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 14px; cursor: pointer; transition: all 0.15s; }
.pg-btn:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 12px rgba(255,119,15,0.3); }
.pg-btn.active { background: linear-gradient(135deg, var(--accent), var(--accent-hover)); border-color: var(--accent); color: #fff; box-shadow: 0 0 16px rgba(255,119,15,0.35); }
.pg-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pg-info { color: var(--text-secondary); font-size: 13px; padding: 0 12px; }

/* 详情弹窗 */
#modal-overlay .modal { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; max-width: 800px; width: 90vw; max-height: 90vh; overflow-y: auto; }
.modal-content { display: flex; flex-direction: column; }
.modal-preview { width: 100%; background: #000; display: flex; align-items: center; justify-content: center; min-height: 300px; }
.modal-preview img { max-width: 100%; max-height: 500px; object-fit: contain; }
.modal-info { padding: 24px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.modal-info h2 { color: #fff; font-size: 22px; margin-bottom: 8px; }
.modal-warn { display: block; color: var(--danger); background: rgba(248,81,73,0.1); border: 1px solid rgba(248,81,73,0.4); padding: 8px 14px; border-radius: 6px; font-size: 13px; margin: 12px auto 0; max-width: 80%; text-align: center; }
.download-btn { display: inline-block; padding: 12px 32px; background: var(--accent); color: #fff; text-decoration: none; border-radius: var(--radius); font-size: 16px; font-weight: 500; }
.download-btn:hover { background: var(--accent-hover); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 16px; }
  .sidebar { width: 100%; position: static; border-radius: var(--radius); border-left: 1px solid var(--border); }
  .ban-red { font-size: 14px; }
  .ban-guide { font-size: 14px; }
}
/* 底部备案栏 */
.site-footer {
  background: #161b22;
  border-top: 3px solid var(--accent);
  padding: 24px 20px;
  text-align: center;
  margin-top: 40px;
}
.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #8b949e;
}
.footer-copy {
  color: #8b949e;
}
.beian-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8b949e;
  text-decoration: none;
  transition: color 0.2s;
}
.beian-link:hover {
  color: #c9d1d9;
}
.beian-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}
.beian-divider {
  color: #424a55;
  margin: 0 2px;
  user-select: none;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; padding: 16px; }
  .sidebar { width: 100%; position: static; border-radius: var(--radius); border-left: 1px solid var(--border); }
  .ban-red { font-size: 14px; }
  .ban-guide { font-size: 14px; }
}
@media (max-width: 640px) {
  #banner-text { font-size: 22px; padding: 20px 12px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .ban-red { font-size: 12px; }
  .ban-guide { font-size: 12px; }
}
