/* ============================================================
   ComicMaster Material Library — Professional Asset Store Style
   Inspired by CSP Assets, Unity Asset Store, ArtStation
   ============================================================ */

/* ---- reset & base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --c-bg:        #f8f9fb;
  --c-surface:   #ffffff;
  --c-border:    #e8ecf1;
  --c-text:      #1a1d26;
  --c-text-dim:  #6b7280;
  --c-text-muted:#9ca3af;
  --c-accent:    #2563eb;
  --c-accent-hv: #1d4ed8;
  --c-accent-lt: #eff6ff;
  --c-price:     #dc2626;
  --c-free:      #059669;
  --c-free-bg:   #ecfdf5;
  --c-star:      #f59e0b;
  --shadow-sm:   0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg:   0 12px 32px rgba(0,0,0,0.1);
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --font:        "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --max-w:       1200px;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  color: var(--c-text);
  background: var(--c-bg);
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

/* ---- header ---- */

header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--c-border);
}

.header-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 24px;
}

.header-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 700;
  letter-spacing: -0.01em; color: var(--c-text);
  transition: opacity 0.2s;
}
.header-logo:hover { opacity: 0.7; }

.header-logo-icon {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--c-accent), #7c3aed);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px;
}

nav { display: flex; gap: 4px; }
nav a {
  padding: 6px 14px; font-size: 14px; font-weight: 500;
  color: var(--c-text-dim); border-radius: 8px;
  transition: all 0.18s;
}
nav a:hover { color: var(--c-accent); background: var(--c-accent-lt); }
nav a.current { color: var(--c-accent); background: var(--c-accent-lt); }

/* ---- main ---- */

main { max-width: var(--max-w); margin: 0 auto; padding: 48px 24px 80px; width: 100%; }

/* ---- hero ---- */

.hero {
  text-align: center; padding: 64px 0 48px;
}

.hero h1 {
  font-size: 40px; font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.15; margin-bottom: 12px;
  background: linear-gradient(135deg, #1a1d26 0%, #3b3f50 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 17px; color: var(--c-text-dim);
  line-height: 1.7; max-width: 520px; margin: 0 auto 32px;
}

/* ---- buttons ---- */

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 28px; font-size: 14px; font-weight: 600;
  color: #fff; background: var(--c-accent);
  border-radius: 999px; border: none;
  transition: all 0.2s; white-space: nowrap;
}
.btn:hover { background: var(--c-accent-hv); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(37,99,235,0.25); }

.btn-outline {
  background: #fff; color: var(--c-accent);
  border: 1.5px solid #d1d5db;
}
.btn-outline:hover { background: var(--c-accent-lt); border-color: var(--c-accent); box-shadow: 0 4px 12px rgba(37,99,235,0.12); }

.btn-sm  { padding: 6px 16px; font-size: 13px; }
.btn-lg  { padding: 15px 40px; font-size: 16px; }

.btn-free { background: linear-gradient(135deg, #059669, #047857); }
.btn-free:hover { box-shadow: 0 8px 24px rgba(5,150,105,0.25); }

.btn-disabled { background: #d1d5db; color: #9ca3af; pointer-events: none; }

/* ---- features (3-col) ---- */

.features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin-top: 20px;
}

.feature {
  padding: 32px 24px; border-radius: var(--radius-md);
  border: 1px solid var(--c-border); background: var(--c-surface);
  text-align: center; transition: box-shadow 0.2s;
}
.feature:hover { box-shadow: var(--shadow-md); }

.feature-icon {
  font-size: 28px; margin-bottom: 12px;
  width: 52px; height: 52px; line-height: 52px;
  border-radius: 50%; margin-left: auto; margin-right: auto;
}
.feature-icon.tags   { background: #eff6ff; }
.feature-icon.format { background: #fef3c7; }
.feature-icon.update { background: #ecfdf5; }

.feature strong { display: block; font-size: 15px; margin-bottom: 6px; }
.feature p { margin: 0; color: var(--c-text-dim); font-size: 13px; line-height: 1.6; }

/* ---- section titles ---- */

.section-title {
  font-size: 24px; font-weight: 700; letter-spacing: -0.02em;
  margin: 64px 0 24px;
  display: flex; align-items: baseline; gap: 12px;
}
.section-title .count {
  font-size: 14px; font-weight: 400; color: var(--c-text-muted);
}

/* ---- search ---- */

.search-bar {
  position: relative; max-width: 400px; margin-bottom: 24px;
}

.search-bar input {
  width: 100%; padding: 10px 16px 10px 40px;
  font-size: 14px; border: 1.5px solid var(--c-border);
  border-radius: 999px; background: var(--c-surface);
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar input:focus { border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.search-bar input::placeholder { color: var(--c-text-muted); }

.search-bar .search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--c-text-muted); font-size: 16px; pointer-events: none;
}

/* ---- pack cards grid ---- */

.pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.pack-card {
  border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--c-border); background: var(--c-surface);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column;
}
.pack-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.pack-card-image-wrap {
  position: relative; overflow: hidden;
  aspect-ratio: 3/2; background: #eef1f6;
}

.pack-card-image-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.35s;
}
.pack-card:hover .pack-card-image-wrap img { transform: scale(1.05); }

.pack-card-badge {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 10px; font-size: 11px; font-weight: 700;
  border-radius: 999px; letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-free {
  background: var(--c-free-bg); color: var(--c-free);
  border: 1px solid #a7f3d0;
}

.badge-hot {
  background: #fef3c7; color: #92400e;
  border: 1px solid #fcd34d;
}

.pack-card-body {
  padding: 16px 18px 18px; flex: 1;
  display: flex; flex-direction: column; gap: 8px;
}

.pack-card-body h3 {
  font-size: 15px; font-weight: 700; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pack-card-body h3 a:hover { color: var(--c-accent); }

.pack-card-desc {
  font-size: 13px; color: var(--c-text-dim);
  line-height: 1.6; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.pack-card-meta {
  display: flex; gap: 14px; font-size: 12px; color: var(--c-text-muted);
}

.pack-card-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 8px; border-top: 1px solid var(--c-border);
}

.pack-card-price {
  font-size: 19px; font-weight: 800; color: var(--c-price);
}
.pack-card-price.free { color: var(--c-free); }
.pack-card-price.donation { color: #7c3aed; font-size: 14px; font-weight: 600; }

/* ---- category badge ---- */

.cat-badge {
  display: inline-block; padding: 3px 10px;
  font-size: 11px; font-weight: 600; border-radius: 999px;
  letter-spacing: 0.03em;
}

.cat-framing   { background: #eff6ff; color: #2563eb; }
.cat-character { background: #fdf2f8; color: #be185d; }
.cat-scene     { background: #ecfdf5; color: #059669; }
.cat-effect    { background: #fff7ed; color: #c2410c; }
.cat-prop      { background: #f5f3ff; color: #6d28d9; }

/* ---- filters ---- */

.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-bottom: 28px;
}

.filter-label {
  font-size: 13px; font-weight: 600; color: var(--c-text-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}

.filter-pills {
  display: flex; flex-wrap: wrap; gap: 6px;
}

.pill {
  padding: 6px 16px; font-size: 13px; font-weight: 500;
  border-radius: 999px; border: 1.5px solid var(--c-border);
  background: var(--c-surface); color: var(--c-text-dim);
  transition: all 0.18s;
}
.pill:hover { border-color: var(--c-accent); color: var(--c-accent); }
.pill.active {
  background: var(--c-accent); color: #fff;
  border-color: var(--c-accent);
}

.filter-spacer { flex: 1; }

/* ---- pack detail ---- */

.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start;
}

.detail-cover {
  width: 100%; border-radius: var(--radius-md);
  border: 1px solid var(--c-border); box-shadow: var(--shadow-md);
}

.detail-info h1 {
  font-size: 28px; font-weight: 800; letter-spacing: -0.02em;
  line-height: 1.2; margin-bottom: 4px;
}

.detail-category {
  display: inline-block; margin-bottom: 8px;
}

.detail-price-lg {
  font-size: 32px; font-weight: 800; color: #7c3aed; margin-bottom: 16px;
}
.detail-price-lg.free { color: var(--c-free); }

.detail-meta-row {
  display: flex; flex-wrap: wrap; gap: 20px;
  margin-bottom: 20px; font-size: 14px; color: var(--c-text-dim);
}
.detail-meta-row span {
  display: flex; align-items: center; gap: 6px;
}

.detail-desc {
  color: #374151; line-height: 1.8; font-size: 14px; margin-bottom: 20px;
}
.detail-desc h3 { font-size: 15px; font-weight: 700; margin: 16px 0 6px; }
.detail-desc li  { margin-left: 18px; margin-bottom: 2px; }

.detail-tags {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 28px;
}

.tag {
  padding: 4px 12px; font-size: 12px; font-weight: 500;
  border-radius: 999px; background: #f3f4f6; color: var(--c-text-dim);
}

.tag-toggle {
  padding: 4px 12px; font-size: 12px; font-weight: 500;
  border-radius: 999px; background: none; border: 1.5px dashed #d1d5db;
  color: var(--c-text-muted); cursor: pointer;
}
.tag-toggle:hover { border-color: var(--c-accent); color: var(--c-accent); }

.detail-actions {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}

.detail-payment-hint {
  font-size: 12px; color: var(--c-text-muted); margin-top: 10px;
  line-height: 1.6;
}

/* ---- donation section ---- */

.donation-section {
  margin-top: 24px; padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border); background: #fafbfc;
}

.donation-title {
  font-size: 17px; font-weight: 700;
  margin-bottom: 4px;
}

.donation-suggest {
  color: #7c3aed; font-size: 20px; font-weight: 800;
}

.donation-hint {
  font-size: 13px; color: var(--c-text-dim); margin-bottom: 20px;
}

.payment-qrcodes {
  display: flex; gap: 16px;
}

.payment-qr {
  flex: 1; text-align: center;
  padding: 16px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--c-border); background: #fff;
}

.payment-qr img {
  width: 100%; max-width: 180px; margin: 0 auto 8px;
  border-radius: var(--radius-sm); border: 1px solid var(--c-border);
}

.payment-qr span {
  font-size: 12px; font-weight: 600; color: var(--c-text-dim);
}

/* ---- pan card ---- */

.pan-card {
  margin-top: 16px; padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid #a7f3d0; background: #f0fdf4;
}

.pan-label {
  font-size: 14px; font-weight: 700; color: #065f46;
  margin-bottom: 12px;
}

.pan-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}

.pan-link-label {
  font-size: 13px; font-weight: 600; color: var(--c-text-dim);
  min-width: 48px;
}

.pan-code {
  flex: 1; font-size: 12px; font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
  padding: 6px 10px; background: #fff; border-radius: 4px;
  color: var(--c-text); word-break: break-all;
  border: 1px solid var(--c-border);
}

.pan-code-lg {
  font-size: 18px; letter-spacing: 0.12em; text-align: center;
}

.pan-note {
  font-size: 12px; color: #065f46; margin-top: 12px;
  line-height: 1.6;
}

.btn-copied {
  background: #059669 !important; color: #fff !important;
  border-color: #059669 !important;
}

/* ---- preview gallery ---- */

.preview-section { margin-top: 56px; }

.preview-section h2 {
  font-size: 20px; font-weight: 700; margin-bottom: 20px;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.preview-grid img {
  width: 100%; border-radius: var(--radius-sm);
  border: 1px solid var(--c-border); cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.preview-grid img:hover { transform: scale(1.04); box-shadow: var(--shadow-lg); }

/* ---- lightbox ---- */

.lightbox {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.9); align-items: center; justify-content: center;
  cursor: pointer;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }

/* ---- download page ---- */

.download-card {
  max-width: 460px; margin: 60px auto; text-align: center;
  padding: 48px 32px; border-radius: var(--radius-lg);
  border: 1px solid var(--c-border); background: var(--c-surface);
  box-shadow: var(--shadow-md);
}

.download-card h2 { font-size: 22px; font-weight: 700; margin-bottom: 18px; }

.download-input {
  width: 100%; padding: 14px 16px; font-size: 16px;
  border: 2px solid var(--c-border); border-radius: var(--radius-md);
  text-align: center; font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
  letter-spacing: 0.06em; outline: none; transition: border-color 0.2s;
}
.download-input:focus { border-color: var(--c-accent); }

.download-error {
  color: #dc2626; font-size: 13px; margin-top: 8px; display: none;
}
.download-error.show { display: block; }

.download-success { display: none; margin-top: 20px; }
.download-success.show { display: block; }

/* ---- about ---- */

.about-content { max-width: 700px; }

.about-content h2 { font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.about-content h3 { font-size: 17px; font-weight: 700; margin: 32px 0 8px; }
.about-content p, .about-content li {
  color: var(--c-text-dim); line-height: 1.8; font-size: 14px;
}
.about-content ul, .about-content ol { padding-left: 18px; }
.about-content code {
  background: #f3f4f6; padding: 2px 8px; border-radius: 4px;
  font-size: 13px; font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
}

/* ---- usage steps ---- */

.usage-steps {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-top: 32px;
}

.usage-step {
  text-align: center; padding: 28px 16px;
  border-radius: var(--radius-md); border: 1px solid var(--c-border);
  background: var(--c-surface); transition: box-shadow 0.2s;
}
.usage-step:hover { box-shadow: var(--shadow-md); }

.usage-step .step-num {
  width: 40px; height: 40px; line-height: 40px; border-radius: 50%;
  background: var(--c-accent-lt); color: var(--c-accent);
  font-weight: 800; font-size: 17px; margin: 0 auto 12px;
}

.usage-step strong { display: block; font-size: 14px; margin-bottom: 4px; }
.usage-step p { color: var(--c-text-dim); font-size: 13px; line-height: 1.5; }

/* ---- empty state ---- */

.empty-state {
  text-align: center; padding: 64px 20px;
  color: var(--c-text-muted);
}
.empty-state p { font-size: 15px; }
.empty-state .btn { margin-top: 16px; }

/* ---- footer ---- */

footer {
  text-align: center; padding: 24px;
  color: var(--c-text-muted); font-size: 12px;
  border-top: 1px solid var(--c-border);
}

/* ---- responsive ---- */

@media (max-width: 768px) {
  .detail-grid { grid-template-columns: 1fr; gap: 24px; }
  .features { grid-template-columns: 1fr; }
  .usage-steps { grid-template-columns: 1fr 1fr; }
  .pack-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
  .header-inner { padding: 0 12px; }
  nav a { font-size: 13px; padding: 5px 8px; }
  .filter-bar { flex-direction: column; align-items: flex-start; }
}
