/* CSS by zq at 2015/5/7 10:09 - MODERNIZED 2026-09-05 */
/* ================================================
   MODERN RESPONSIVE BASE STYLES
   Width: 640px mobile-first (fixed layout)
   ================================================ */

:root {
  --brand-primary: #1693dd;
  --brand-orange: #ff6b35;
  --brand-red: #cc0033;
  --brand-green: #009944;
  --text-dark: #333;
  --text-gray: #666;
  --text-light: #999;
  --bg-light: #f7f7f7;
  --bg-white: #fff;
  --border-color: #eee;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 2px 12px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
}

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

html, body { font-size: 16px; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  background: var(--bg-white);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; outline: 0; }
a:hover { color: var(--brand-primary); }

img { border: 0; display: block; max-width: 100%; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea, select { font: inherit; outline: none; }

/* ================================================
   LAYOUT
   ================================================ */
.wrapper {
  width: 640px;
  max-width: 100%;
  margin: 0 auto;
  overflow-x: hidden;
  background: var(--bg-white);
}

.container {
  width: 100%;
  padding: 0 12px;
}

/* ================================================
   HEADER
   ================================================ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 12px;
  background: var(--brand-primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(22,147,221,0.3);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-logo img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
}
.header-logo-text {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
}
.header-logo-text small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  opacity: 0.85;
  letter-spacing: 0;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.header-nav a {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  border-radius: 20px;
  transition: background 0.2s, color 0.2s;
}
.header-nav a:hover,
.header-nav a.active {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* ================================================
   BREADCRUMB
   ================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-gray);
  background: var(--bg-light);
  border-bottom: 1px solid var(--border-color);
}
.breadcrumb a { color: var(--brand-primary); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: #ccc; }
.breadcrumb-current { color: var(--text-dark); font-weight: 600; }

/* ================================================
   ALERT BANNER
   ================================================ */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(135deg, #ff6b35, #ff3d5a);
}
.alert-banner strong { font-weight: 700; }
.alert-banner.info {
  background: linear-gradient(135deg, #0066cc, #1693dd);
}

/* ================================================
   NAVIGATION TABS (Category Tabs)
   ================================================ */
.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
}
.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  font-size: 13px;
  color: var(--brand-primary);
  background: #e8f4fc;
  border-radius: 20px;
  border: 1px solid #c5e3f7;
  transition: all 0.2s;
}
.nav-tab:hover, .nav-tab.active {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}
.nav-tab.active { font-weight: 700; }

/* ================================================
   SECTION TITLE
   ================================================ */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  background: var(--bg-light);
  border-bottom: 2px solid var(--brand-primary);
}
.section-title-emoji { font-size: 18px; margin-right: 6px; }
.section-title-link {
  font-size: 12px;
  font-weight: 400;
  color: var(--brand-primary);
}
.section-title-link:hover { text-decoration: underline; }

/* ================================================
   IMAGE GRID
   ================================================ */
.img-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 12px;
}
.img-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}
.img-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.img-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: #f0f0f0;
}
.img-card-name {
  width: 100%;
  padding: 5px 4px;
  font-size: 11px;
  color: var(--text-dark);
  text-align: center;
  background: var(--bg-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid var(--border-color);
}
.img-card-tag {
  position: absolute;
  top: 4px;
  left: 4px;
  padding: 1px 5px;
  font-size: 10px;
  color: #fff;
  background: var(--brand-red);
  border-radius: 3px;
}
.img-card-wrap {
  position: relative;
  width: 100%;
}

/* Image row (2-per-row for featured) */
.img-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 10px 12px;
}
.img-row .img-card img { aspect-ratio: 3/4; }

/* ================================================
   LIST (Old-style text list for category pages)
   ================================================ */
.img-list {
  padding: 10px 12px;
}
.img-list-item {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  gap: 10px;
}
.img-list-item:last-child { border-bottom: none; }
.img-list-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  font-size: 14px;
  color: var(--text-dark);
  transition: color 0.2s;
}
.img-list-item a:hover { color: var(--brand-primary); }
.img-list-thumb {
  width: 50px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  background: #f0f0f0;
}
.img-list-info { flex: 1; min-width: 0; }
.img-list-name {
  font-size: 14px;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.img-list-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  color: #fff;
  background: var(--brand-red);
  border-radius: 10px;
  margin-left: 6px;
}
.img-list-badge.rec {
  background: var(--brand-orange);
}
.img-list-badge.new {
  background: var(--brand-green);
}

/* ================================================
   AD BANNER
   ================================================ */
.ad-banner {
  margin: 8px 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.ad-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  margin-bottom: 6px;
  padding: 0 10px;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(135deg, #e63946, #d62828);
  border-radius: var(--radius-sm);
  transition: opacity 0.2s;
  text-align: center;
  line-height: 1.4;
}
.ad-item:hover { opacity: 0.9; }
.ad-item.orange { background: linear-gradient(135deg, #ff6b35, #f77f00); }
.ad-item.blue { background: linear-gradient(135deg, #219ebc, #126782); }
.ad-item.green { background: linear-gradient(135deg, #2d6a4f, #40916c); }
.ad-item.purple { background: linear-gradient(135deg, #7b2cbf, #5a189a); }
.ad-item .ad-star { margin-right: 4px; }

/* ================================================
   TABS (Category section)
   ================================================ */
.typelist {
  padding: 10px 12px;
}
.typelist-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.type-block {
  flex: 1;
  background: var(--bg-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.type-block-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--brand-primary);
}
.type-block-list {
  padding: 6px 0;
}
.type-block-item {
  padding: 5px 10px;
  font-size: 13px;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 6px;
}
.type-block-item:last-child { border-bottom: none; }
.type-block-item:hover { background: #e8f4fc; color: var(--brand-primary); }
.type-block-item-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 11px;
  color: #fff;
  background: var(--brand-primary);
  border-radius: 50%;
  flex-shrink: 0;
}
.type-block-more {
  display: block;
  text-align: center;
  padding: 8px;
  font-size: 13px;
  color: var(--brand-primary);
  font-weight: 600;
  border-top: 1px solid var(--border-color);
  background: var(--bg-white);
}
.type-block-more:hover { background: #e8f4fc; }

/* ================================================
   LETTER NAVIGATION (A-Z)
   ================================================ */
.letter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
  background: var(--bg-white);
}
.letter-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 32px;
  padding: 0 8px;
  font-size: 13px;
  color: var(--brand-primary);
  background: #e8f4fc;
  border: 1px solid #c5e3f7;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.letter-nav a:hover,
.letter-nav a.active {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}
.letter-nav a.active { font-weight: 700; }

/* ================================================
   FOOTER
   ================================================ */
.footer {
  margin-top: 20px;
  background: var(--text-dark);
  color: rgba(255,255,255,0.85);
}
.footer-main {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.1);
  padding: 16px 0;
}
.footer-col {
  padding: 0 12px;
}
.footer-col-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--brand-primary);
}
.footer-col a {
  display: block;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  padding: 4px 0;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--brand-orange); }
.footer-bottom {
  text-align: center;
  padding: 14px 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  border-top: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.3);
}
.footer-bottom a { color: rgba(255,255,255,0.7); }
.footer-bottom a:hover { color: var(--brand-orange); }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
}

/* ================================================
   WARNING NOTICE
   ================================================ */
.notice-warn {
  margin: 10px 12px;
  padding: 10px 12px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #856404;
}
.notice-warn-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.notice-warn a { color: #0056b3; }

/* ================================================
   DIVIDER
   ================================================ */
.divider {
  height: 1px;
  background: var(--border-color);
  margin: 12px 0;
}
.divider-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 12px 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-primary);
}

/* ================================================
   BANNER LIST (pure CSS grid rows, no JS)
   ================================================ */
.bannerlist { margin: 0; background: var(--bg-white); }

/* ================================================
   UTILITIES
   ================================================ */
.text-center { text-align: center; }
.text-red { color: var(--brand-red); }
.text-blue { color: var(--brand-primary); }
.text-orange { color: var(--brand-orange); }
.text-green { color: var(--brand-green); }
.fw-bold { font-weight: 700; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.p-12 { padding: 12px; }
.bg-light { background: var(--bg-light); }
.hidden { display: none; }

/* ================================================
   RESPONSIVE (for screens < 640px auto-scale)
   ================================================ */
@media (max-width: 640px) {
  .wrapper { width: 100%; }
}
