:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --ink: #1c1917;
  --muted: #57534e;
  --border: #e7e5e4;
  --kids: #e07a5f;
  --kids-bg: #fdf2ef;
  --adults: #3d5a80;
  --adults-bg: #eff4f9;
  --holiday: #b45309;
  --holiday-bg: #fef3c7;
  --accent: #2f6f4e;
  --accent-hover: #25593e;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(28, 25, 23, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans TC", "Noto Sans JP", "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 20px;
}
.brand h1 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
.tagline {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lang-select {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.product-nav {
  border-top: 1px solid var(--border);
  background: #fbfaf7;
}
.product-nav-inner {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 20px;
}
.pnav-link {
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.pnav-link:hover, .pnav-link.active {
  background: var(--ink);
  color: #fff;
}

/* Seasonal Spotlight Banner */
.holiday-spotlight {
  margin: 18px 0 8px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.spotlight-kicker {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--holiday);
}
.spotlight-text {
  margin: 2px 0 0;
  font-size: 0.96rem;
  font-weight: 600;
  color: #78350f;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #332e2a; }
.btn-secondary { background: #f3f1ec; color: var(--ink); border-color: var(--border); }
.btn-secondary:hover { background: #e8e4dc; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { background: #f3f1ec; }

/* Ad Slots */
.ad-slot { margin: 18px 0; }
.ad-placeholder {
  border: 1px dashed #d6d3d1;
  background: #f5f3ee;
  color: #78716c;
  border-radius: 10px;
  padding: 13px 16px;
  text-align: center;
  font-size: 0.82rem;
}
.ad-slot-compact .ad-placeholder {
  padding: 10px;
  font-size: 0.78rem;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 16px 0 12px;
}
.audience-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tab {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}
.tab.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.search-wrap input {
  width: 340px;
  max-width: 100%;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.9rem;
}
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.filter-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 64px;
}
.theme-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pill {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
}
.pill.active {
  background: #e7e5e4;
  color: var(--ink);
  font-weight: 600;
}
.pill-holiday.active {
  background: var(--holiday-bg);
  border-color: #f59e0b;
  color: #92400e;
}

/* Section Headers */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 14px;
}
.section-head h2 { margin: 0; font-size: 1.25rem; }
.count-pill { font-size: 0.85rem; color: var(--muted); }

/* Sheets Grid */
.sheets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}
.sheet-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.sheet-thumb {
  background: #fff;
  aspect-ratio: 3 / 4;
  padding: 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  display: grid;
  place-items: center;
}
.sheet-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}
.sheet-thumb:hover img { transform: scale(1.03); }
.sheet-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.sheet-tags {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tag-group {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-kids { background: var(--kids-bg); color: var(--kids); }
.badge-elementary { background: #ecfdf5; color: #047857; }
.badge-seniors { background: #f3e8ff; color: #7e22ce; }
.badge-adults { background: var(--adults-bg); color: var(--adults); }
.badge-holiday { background: var(--holiday-bg); color: var(--holiday); }
.source-tag {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sheet-body h3 { margin: 0; font-size: 1rem; line-height: 1.35; }
.sheet-desc { margin: 0; font-size: 0.84rem; color: var(--muted); flex: 1; }
.sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}
.sheet-actions .btn { padding: 8px 10px; font-size: 0.82rem; }
.empty-state {
  grid-column: 1 / -1;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  color: var(--muted);
}

/* Bundles & Gear */
.bundles-grid, .gear-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 18px;
}
.bundle-card, .gear-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bundle-card h3, .gear-card h3 { margin: 0; font-size: 1.05rem; }
.bundle-card p, .gear-card p { margin: 0; font-size: 0.88rem; color: var(--muted); flex: 1; }
.disclosure { font-size: 0.8rem; color: var(--muted); margin-top: 12px; }

/* App Promo */
.app-promo {
  margin: 36px 0;
  background: linear-gradient(135deg, #1c1917 0%, #2c3e50 100%);
  color: #fff;
  border-radius: 18px;
  padding: 28px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  align-items: center;
}
.promo-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.14);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 10px;
}
.app-promo h2 { margin: 0 0 8px; font-size: 1.35rem; }
.app-promo p { margin: 0; color: #d6d3d1; font-size: 0.92rem; }
.waitlist-form { display: flex; flex-direction: column; gap: 10px; }
.waitlist-form input { padding: 12px 14px; border-radius: 10px; border: none; font-size: 0.92rem; }
.waitlist-form .btn-primary { background: #e07a5f; }
.waitlist-form .btn-primary:hover { background: #cc684e; }
.waitlist-msg { margin: 0; font-size: 0.84rem; color: #a7f3d0; min-height: 1.2em; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 22px 0;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--muted);
}
.footer-inner p { margin: 0; }

/* Modal */
.modal.hidden { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(28, 25, 23, 0.65); }
.modal-card {
  position: relative;
  background: var(--surface);
  border-radius: 18px;
  max-width: 860px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
  z-index: 1;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 1.3rem;
  cursor: pointer;
}
.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.modal-image-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.modal-image-wrap img { width: 100%; display: block; }
.modal-info h3 { margin: 10px 0 8px; font-size: 1.25rem; }
.modal-info p { margin: 0 0 12px; color: var(--muted); font-size: 0.92rem; }
.modal-meta { font-size: 0.82rem; color: var(--muted); margin-bottom: 16px; }
.modal-downloads { display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 760px) {
  .app-promo, .modal-body { grid-template-columns: 1fr; }
  .search-wrap, .search-wrap input { width: 100%; }
  .modal-image-wrap { max-height: 44vh; display: grid; place-items: center; }
  .modal-image-wrap img { max-height: 40vh; width: auto; max-width: 100%; object-fit: contain; }
}

/* Quick Scenario & Sheet-Type Picker */
.scenario-section {
  margin: 18px 0 14px;
}
.scenario-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.scenario-head h2 {
  font-size: 1.02rem;
  margin: 0;
  color: var(--ink);
}
.btn-link {
  background: none;
  border: none;
  color: var(--accent, #2563eb);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
}
.btn-link:hover {
  text-decoration: underline;
}
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 10px;
}
.scenario-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border, #e5e7eb);
  background: #fff;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.scenario-card:hover {
  transform: translateY(-1px);
  border-color: var(--accent, #2563eb);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}
.scenario-card.active {
  border-color: var(--accent, #2563eb);
  background: #eff6ff;
}
.scenario-icon {
  font-size: 1.35rem;
  line-height: 1;
}
.scenario-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink, #111827);
}
.scenario-sub {
  font-size: 0.78rem;
  color: var(--muted, #6b7280);
  line-height: 1.35;
}

/* Non-Intrusive Ad Protection: never block UI controls, modals, or printing */
.ad-slot {
  position: relative;
  z-index: 1;
  overflow: hidden;
  max-width: 100%;
}
.modal {
  z-index: 10000 !important;
}
@media print {
  .ad-slot,
  ins.adsbygoogle,
  [id*="infolinks"],
  [class*="infolinks"],
  iframe[src*="infolinks"],
  iframe[src*="googlesyndication"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
  }
}

/* RTL Mirror Support (Arabic) */
[dir="rtl"] body {
  direction: rtl;
  text-align: right;
}
[dir="rtl"] .scenario-card,
[dir="rtl"] .sheet-body,
[dir="rtl"] .bundle-card,
[dir="rtl"] .gear-card,
[dir="rtl"] .modal-info,
[dir="rtl"] .holiday-spotlight,
[dir="rtl"] .app-promo {
  text-align: right;
}
[dir="rtl"] .scenario-card {
  align-items: flex-start;
}
[dir="rtl"] .modal-close {
  right: auto;
  left: 16px;
}
[dir="rtl"] .search-wrap input,
[dir="rtl"] .waitlist-form input {
  text-align: right;
}
[dir="rtl"] .filter-label {
  text-align: right;
}
[dir="rtl"] .footer-inner {
  text-align: right;
}
