@font-face {
  font-family: 'FT Cinzel';
  src: url('/fonts/cinzel-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #0d0c0a;
  --surface: #14120e;
  --border: #2a261e;
  --text: #f3ead6;
  --muted: #a39878;
  --gold: #e6c27a;
  --gold-strong: #f2c14e;
  --gold-deep: #a8792b;
  --on-gold: #1a1408;
  --font-sans: -apple-system, 'Segoe UI', 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans TC', sans-serif;
  --font-latin: 'FT Cinzel', Georgia, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(230, 194, 122, 0.16), transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 110%, rgba(168, 121, 43, 0.12), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

/* 標題 */
.head { text-align: center; margin-bottom: 28px; }
.logo {
  display: block; width: 200px; max-width: 60%; height: auto; margin: 0 auto 12px;
  /* 淡化 logo 圖本身的深色底邊 */
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 60%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 60%, transparent 100%);
}
.rule {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 0 auto 12px; color: var(--gold);
}
.rule::before, .rule::after {
  content: ''; width: 64px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.rule::after { transform: scaleX(-1); }
.rule span { width: 7px; height: 7px; background: currentColor; transform: rotate(45deg); }
h1 {
  margin: 0; font-size: clamp(24px, 5vw, 34px); font-weight: 800; letter-spacing: 0.08em;
  background: linear-gradient(180deg, #fff3d1, var(--gold) 55%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sub { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

/* 首頁分類卡：電腦一排五張直卡；手機第一張（電子）橫的整排，其餘兩兩一排 */
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.cat {
  position: relative; display: block; overflow: hidden; border-radius: 14px;
  border: 1px solid var(--border); text-decoration: none; aspect-ratio: 3 / 4;
  background: var(--surface);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.cat img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
/* 圖上的標題字：橫圖在左邊、直圖在上面，裁切時對準它 */
.cat-wide img { object-position: left center; }
.cat-tall img { object-position: center top; }
.cat-label {
  position: absolute; inset: auto 0 0 0; padding: 36px 12px 12px;
  background: linear-gradient(180deg, transparent, rgba(13, 12, 10, 0.94) 55%);
  display: flex; flex-direction: column; gap: 2px;
}
.cat-name { font-size: 17px; font-weight: 800; color: var(--gold); letter-spacing: 0.06em; }
.cat-hint { font-size: 12px; color: var(--muted); white-space: nowrap; }
.cat:hover, .cat:focus-visible {
  border-color: var(--gold); transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(230, 194, 122, 0.18);
}
.cat:hover img, .cat:focus-visible img { transform: scale(1.04); }

@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .cat:first-child { grid-column: 1 / -1; aspect-ratio: 4 / 3; }
  .cat:first-child img { object-position: center; }
  .cat:first-child .cat-label { flex-direction: row; align-items: baseline; justify-content: space-between; padding: 40px 16px 14px; }
  .cat:first-child .cat-name { font-size: 20px; }
}

/* 分類頁 */
.back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 999px; color: var(--muted);
  text-decoration: none; font-size: 14px; margin-bottom: 8px;
}
.back:hover, .back:focus-visible { color: var(--gold); border-color: var(--gold); }
.card {
  max-width: 480px; margin: 0 auto; overflow: hidden; border-radius: 16px;
  border: 1px solid var(--border); background: var(--surface);
}
.card-hero { position: relative; aspect-ratio: 4 / 3; }
.card-hero img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-hero-tall img { object-position: center top; }
.card-hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, var(--surface));
}
.card-body { display: grid; gap: 12px; padding: 4px 20px 24px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px;
  padding: 0 18px; border-radius: 12px; font-size: 16px; font-weight: 700;
  letter-spacing: 0.06em; text-decoration: none; transition: filter 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn svg { flex: none; }
.btn[hidden] { display: none; }
.btn-main {
  background: linear-gradient(180deg, var(--gold-strong), var(--gold-deep));
  color: var(--on-gold); box-shadow: 0 6px 20px rgba(242, 193, 78, 0.25);
}
.btn-main:hover, .btn-main:focus-visible { filter: brightness(1.08); }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  background: rgba(26, 20, 8, 0.18); font-size: 12px; letter-spacing: 0.02em;
}
.btn-backup { border: 1px solid var(--border); color: var(--text); background: rgba(255, 255, 255, 0.02); }
.btn-backup:hover, .btn-backup:focus-visible { border-color: var(--gold); color: var(--gold); }
.note { margin: 4px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.empty { text-align: center; color: var(--muted); }

/* 說明 */
.about { margin-top: 48px; }
h2 { margin: 0 0 16px; text-align: center; font-size: 22px; color: var(--gold); letter-spacing: 0.08em; }
.about p { margin: 0 0 12px; color: var(--muted); }
.faq { display: grid; gap: 10px; margin-top: 20px; }
.faq details { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.faq summary {
  cursor: pointer; padding: 14px 16px; font-weight: 700; list-style: none;
  display: flex; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--gold); font-weight: 400; }
.faq details[open] summary::after { content: '−'; }
.faq details p { margin: 0; padding: 0 16px 14px; color: var(--muted); }

.foot {
  margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border);
  text-align: center; color: var(--muted); font-size: 13px; font-family: var(--font-latin);
  letter-spacing: 0.08em;
}

a:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

@media (max-width: 480px) {
  .wrap { padding-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
