:root {
  --bg: #ffffff;
  --text: #1f1f1f;
  --muted: #5a5a5a;
  --line: #eceef1;
  --brand: #c8a661;
  --brand-dark: #ae9358;
  --soft: #f5f6f7;
  --shadow: 0 8px 24px rgba(0,0,0,0.08);
  --rel-thumb-w: 128px;
  --rel-thumb-h: 112px;
  --danger: #e74c3c;
  --success: #27ae60;
  --price-color: #e74c3c;
}
* { box-sizing: border-box; }
html {
  font-size: 16px;
  scroll-behavior: smooth;
}
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: 64px;
  display: flex;
  flex-direction: column;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
main { flex: 1; }
.section { padding: 20px 0 40px; }
.section .section { padding-bottom: 0; }
.section-title { font-size: 22px; font-weight: 700; margin: 0 0 16px; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Header & Nav */
.site-header { position: fixed; left: 0; right: 0; top: 0; z-index: 50; background: rgba(255,255,255,0.9); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
@media (min-width: 769px) {
  .site-header .container { padding-left: 14px; padding-right: 14px; }
}
.logo { display: inline-flex; align-items: center; color: var(--text); transition: color .2s ease; }
.logo img { display: block; height: 36px; width: auto; flex-shrink: 0; transition: filter .2s ease, transform .2s ease; }
.logo:hover,
.logo:focus-visible { color: var(--brand); }
.logo:hover img,
.logo:focus-visible img { filter: brightness(1.05) saturate(1.1); transform: translateY(-1px); }
.logo-text { font-size: 20px; font-weight: 800; color: var(--brand); letter-spacing: -0.5px; }
.nav-toggle { display: none; }
.nav-btn { display: none; cursor: pointer; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.04); }
.nav-btn span { display: block; width: 22px; height: 3px; background: var(--text); position: relative; border-radius: 2px; transition: background .2s ease; }
.nav-btn span::before, .nav-btn span::after { content: ""; position: absolute; left: 0; width: 22px; height: 3px; background: var(--text); border-radius: 2px; transition: transform .25s ease, top .25s ease; }
.nav-btn span::before { top: -6px; }
.nav-btn span::after { top: 6px; }
.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav a { padding: 8px 12px; border-radius: 8px; font-size: 15px; }
.site-nav a:hover, .site-nav a[aria-current="page"], .site-nav a.active { background: var(--soft); color: var(--brand); }

/* Banner Search */
.banner { position: relative; background: radial-gradient(1200px 300px at 50% -50%, #fafafa 10%, transparent 60%), var(--bg); border-bottom: 1px solid var(--line); }
.banner-inner { padding: 56px 0 28px; display: grid; gap: 18px; justify-items: center; }
.banner-title { font-size: 28px; margin: 0 0 8px; text-align: center; }
.search-form { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 18px; width: 520px; max-width: 92vw; box-shadow: 0 6px 18px rgba(0,0,0,0.04); }
.search-form input[type="search"] { flex: 1; border: 0; outline: 0; padding: 10px 12px 10px 8px; font-size: 16px; background: transparent; }
.search-form .btn { padding: 10px 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; border-radius: 10px; background: var(--brand); color: #fff; border: 1px solid var(--brand); font-weight: 600; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; cursor: pointer; font-size: 14px; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--brand-dark); color: #fff; box-shadow: var(--shadow); transform: translateY(-1px); }
}
.btn:focus, .btn:active, .btn:focus-visible { background: var(--brand-dark); color: #fff; outline: none; }
.btn:active { transform: translateY(0); }
.btn.ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { color: var(--text); }
.btn.ghost:focus, .btn.ghost:active, .btn.ghost:focus-visible { background: #f5f5f5; color: var(--text); border-color: var(--brand); outline: none; }
.btn.disabled { opacity: 0.5; cursor: not-allowed; }
.btn.disabled:hover { background: var(--brand); color: #fff; box-shadow: none; transform: none; }
.btn.ghost.disabled { background: #f5f5f5; color: var(--muted); border-color: #e0e0e0; opacity: 0.6; }
.btn.ghost.disabled:hover { background: #f5f5f5; color: var(--muted); box-shadow: none; transform: none; }
.btn.price-btn { background: var(--price-color); border-color: var(--price-color); }
.btn.price-btn:hover { background: #c0392b; border-color: #c0392b; }
.btn.free-btn { background: var(--success); border-color: var(--success); }
.btn.free-btn:hover { background: #219a52; border-color: #219a52; }
.banner-slot { border: none; border-radius: 0; overflow: hidden; }
.banner-slot a { display: block; }
.banner-slot img { width: 100%; height: auto; }
.banner-inner .container.banner-slot { max-width: 1200px; padding: 0 16px; margin: 16px auto 0; }
@media (min-width: 769px) {
  .banner-inner .container.banner-slot { padding-left: 14px; padding-right: 14px; }
}

/* Card Grid */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.03); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,0.08); border-color: var(--brand); }
.card:focus-within { box-shadow: 0 10px 30px rgba(0,0,0,0.1); border-color: var(--brand); }
.card-cover { position: relative; background: #fafafa; aspect-ratio: 280 / 200; overflow: hidden; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; transition: transform .25s ease; }
.card:hover .card-cover img { transform: scale(1.03); }
.card-cover::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); opacity: 0; transition: opacity .3s ease; pointer-events: none; z-index: 1; }
.card-cover:hover::before { opacity: 1; }
.card-cover::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; background: rgba(255,255,255,0.95); border-radius: 50%; opacity: 0; transition: opacity .3s ease, transform .3s ease; pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,0.15); background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23c8a661" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>'); background-repeat: no-repeat; background-position: center; background-size: 28px 28px; z-index: 2; }
.card-cover:hover::after { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 16px; font-weight: 700; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.5; color: var(--text); overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; min-height: 3em; max-height: 3em; overflow-wrap: anywhere; word-break: normal; }
.card-title a { transition: color .2s ease; }
.card:hover .card-title a, .card:focus-within .card-title a { color: var(--brand); }
.card-desc { color: var(--muted); font-size: 14px; margin: 0; display: none; line-height: 1.6; max-height: 3.2em; overflow: hidden; flex: 1 1 0; min-height: 3.2em; }
.result-list .card-desc { display: block; }
.card-meta { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: auto; flex-shrink: 0; }
.card-price { color: var(--price-color); font-weight: 700; font-size: 14px; }
.card-price.free { color: var(--success); }
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--soft); color: var(--text); font-weight: 600; text-decoration: none; }
.badge a { color: inherit; text-decoration: none; }

/* Load more */
.load-more { margin: 40px 0 0; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; max-width: 100%; }
.load-more-btn { min-width: 180px; max-width: 240px; width: 100%; padding: 8px 32px; font-size: 14px; border-radius: 999px; cursor: pointer; background: transparent !important; color: var(--brand); border: 1px solid var(--brand); font-weight: 600; transition: all .25s ease; box-shadow: none !important; -webkit-tap-highlight-color: transparent; transform: none !important; }
@media (hover: hover) and (pointer: fine) {
  .load-more-btn:hover:not([disabled]):not([aria-disabled="true"]) { background: var(--brand) !important; color: #fff; box-shadow: 0 4px 16px rgba(200,166,97,0.3) !important; transform: translateY(-2px) !important; }
}
@media (hover: none), (pointer: coarse) {
  .load-more-btn:hover { background: transparent !important; color: var(--brand); box-shadow: none !important; transform: none !important; }
  .load-more-btn:active:not([disabled]):not([aria-disabled="true"]) { background: var(--brand) !important; color: #fff; transform: scale(0.98) !important; }
}
.load-more-btn[disabled], .load-more-btn[aria-disabled="true"] { background: transparent !important; color: var(--muted); border-color: var(--line); box-shadow: none !important; transform: none !important; cursor: not-allowed; opacity: 0.6; }
.load-more-status { font-size: 13px; color: var(--muted); letter-spacing: .08em; }

/* Result list (Search) */
.result-list { display: flex; flex-direction: column; gap: 20px; }
.card.card-horizontal { flex-direction: row; min-height: 190px; }
.card.card-horizontal .card-cover { flex: 0 0 280px; aspect-ratio: auto; height: 190px; border-right: 1px solid var(--line); }
.card.card-horizontal .card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card.card-horizontal .card-body { padding: 18px 20px; gap: 10px; }
.card.card-horizontal .card-title { font-size: 18px; white-space: normal; display: block; line-height: 1.5; min-height: auto; max-height: none; -webkit-line-clamp: unset; line-clamp: unset; -webkit-box-orient: unset; overflow: visible; }
.card.card-horizontal .card-desc { font-size: 15px; line-height: 1.7; max-height: none; min-height: auto; color: var(--text); display: -webkit-box; -webkit-line-clamp: 5; line-clamp: 5; -webkit-box-orient: vertical; }
.card.card-horizontal .card-meta { font-size: 13px; justify-content: flex-start; gap: 16px; flex-wrap: wrap; }
.search-highlight { color: #d93025; font-weight: 700; background: transparent; }

/* Filters */
.filters { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 10px; margin-bottom: 20px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.filter-row strong { min-width: 72px; color: #000; }
.filter-row a { padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; color: #000; cursor: pointer; }
.filter-row a:hover, .filter-row a.active { background: var(--soft); color: var(--brand); border-color: var(--brand); }

/* Pagination */
.pagination { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 40px 0 0; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 14px; }
.pagination a:hover, .pagination span[aria-current="page"] { background: var(--soft); color: var(--brand); }
.pagination a.current { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }
.pagination a.current:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.pagination-total { color: var(--muted); font-size: 14px; margin-right: 8px; white-space: nowrap; }

/* Detail Layout */
.detail { display: grid; grid-template-columns: 2.1fr 0.7fr; gap: 24px; align-items: start; }
.detail-main { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; min-width: 0; }
.detail-top { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: stretch; }
.detail-title { margin: 0 0 8px; font-size: 22px; }
.detail-cover { width: 100%; margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fafafa; box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 0 0 1px rgba(200,166,97,0.08); height: 228px; }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-cover.slider { position: relative; height: 228px; }
.detail-cover .slides { position: relative; width: 100%; height: 228px; }
.detail-cover.slider { touch-action: pan-y; }
.detail-cover .slides img { position: absolute; inset: 0; width: 100%; height: 228px; object-fit: cover; object-position: 50% 50%; opacity: 0; transition: opacity .35s ease; pointer-events: none; }
.detail-cover .slides img.active { opacity: 1; pointer-events: auto; }
.slide-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid rgba(200,166,97,0.85); color: var(--brand); background: rgba(255,255,255,0.95); backdrop-filter: blur(2px); cursor: pointer; font-size: 22px; font-weight: 800; box-shadow: 0 6px 16px rgba(0,0,0,0.2); -webkit-tap-highlight-color: transparent; }
.slide-nav:hover { background: #fff; transform: translateY(-50%) scale(1.05); }
.slide-nav.prev { left: 8px; }
.slide-nav.next { right: 8px; }
@media (hover: hover) {
  .detail-cover.slider .slide-nav { opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease; }
  .detail-cover.slider:hover .slide-nav { opacity: 1; visibility: visible; }
}
.slide-indicators { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; padding: 4px 8px; border-radius: 999px; background: rgba(0,0,0,0.18); backdrop-filter: blur(2px); }
.slide-indicators button { width: 8px; height: 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.7); background: rgba(255,255,255,0.5); padding: 0; display: inline-block; cursor: pointer; }
.slide-indicators button.active { background: var(--brand); border-color: var(--brand); width: 18px; }

/* Detail KV / Sidebar info */
.kv { display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.kv .row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.kv .row strong { min-width: 72px; color: #000; font-weight: 600; }
.kv .row span, .kv .row time { color: var(--muted); }
.kv .btns { display: flex; gap: 10px; margin-top: 14px; }
.kv .btns .btn { flex: 1; justify-content: center; text-align: center; padding: 12px 16px; font-size: 15px; }
.kv .price-display { font-size: 24px; font-weight: 800; color: var(--price-color); margin-top: 4px; }
.kv .price-display.free { color: var(--success); }

/* Detail content */
.detail-content { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); line-height: 1.8; }
.detail-content h2 { font-size: 18px; margin: 20px 0 10px; font-weight: 700; }
.detail-content p { margin: 8px 0; }
.detail-content img { border-radius: 8px; margin: 10px 0; border: 1px solid var(--line); }

/* Aside / Sidebar */
.aside .widget { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 20px; }
.aside .widget h3 { font-size: 16px; font-weight: 700; margin: 0 0 14px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--muted); transition: all .2s ease; }
.tag-cloud a:hover { background: var(--soft); color: var(--brand); border-color: var(--brand); }

/* Breadcrumb */
.breadcrumb { padding: 12px 0; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span { color: var(--text); font-weight: 500; }

/* Footer */
.site-footer { background: var(--soft); border-top: 1px solid var(--line); padding: 20px 0; margin-top: auto; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); }
.footer-inner a { color: var(--muted); }
.footer-inner a:hover { color: var(--brand); }

/* Reveal Animation */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.show { opacity: 1; transform: translateY(0); }

/* Admin page */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; padding-top: 0; }
.admin-sidebar { background: #1a1a2e; color: #fff; padding: 20px 0; }
.admin-sidebar .logo-area { padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 10px; }
.admin-sidebar .logo-area h2 { margin: 0; font-size: 18px; color: var(--brand); }
.admin-sidebar .logo-area p { margin: 4px 0 0; font-size: 12px; color: rgba(255,255,255,0.5); }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 12px 20px; color: rgba(255,255,255,0.7); font-size: 14px; transition: all .2s ease; border-left: 3px solid transparent; }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,0.05); color: #fff; border-left-color: var(--brand); }
.admin-main { background: #f5f6f7; padding: 24px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.admin-header h1 { margin: 0; font-size: 22px; }
.admin-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.admin-card h3 { margin: 0 0 16px; font-size: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; transition: border-color .2s; outline: none; font-family: inherit; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--brand); }
.form-group textarea { min-height: 100px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--line); }
.admin-table th { background: var(--soft); font-weight: 600; font-size: 13px; }
.admin-table tr:hover { background: #fafafa; }
.admin-table .thumb { width: 60px; height: 42px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.status-badge.free { background: #e8f5e9; color: var(--success); }
.status-badge.paid { background: #fce4ec; color: var(--price-color); }

/* Toast */
.toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.95); background: rgba(0, 0, 0, 0.85); color: #fff; padding: 16px 32px; border-radius: 8px; font-size: 16px; font-weight: 500; z-index: 10000; opacity: 0; transition: all 0.3s ease; pointer-events: none; backdrop-filter: blur(4px); }
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9999; display: none; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal { background: #fff; border-radius: 14px; padding: 28px; max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto; }
.modal h3 { margin: 0 0 16px; font-size: 18px; }

/* Responsive */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .nav-btn { display: flex; align-items: center; justify-content: center; }
  .site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 8px 16px; border-bottom: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,0.08); gap: 0; }
  .nav-toggle:checked ~ .site-nav { display: flex; }
  .site-nav a { padding: 12px 16px; width: 100%; border-radius: 8px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .detail { grid-template-columns: 1fr; }
  .detail-top { grid-template-columns: 1fr; }
  .detail-cover { height: 200px; }
  .detail-cover .slides img { height: 200px; }
  .banner-title { font-size: 22px; }
  .card.card-horizontal { flex-direction: column; min-height: auto; }
  .card.card-horizontal .card-cover { flex: none; height: 180px; border-right: none; }
  .footer-inner { flex-direction: column; text-align: center; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .search-form { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
}