:root {
  --bg-outer: #030304;
  --bg-obsidian: #08080a;
  --bg-surface: #111115;
  --bg-card: #16161c;
  --bg-card-hover: #1e1e26;
  --gold-primary: #d4af37;
  --gold-light: #f1d77a;
  --gold-dim: rgba(212, 175, 55, 0.24);
  --gold-border: rgba(212, 175, 55, 0.34);
  --text-ivory: #f5f1e6;
  --text-muted: #a69f92;
  --font-display: "Cinzel", "Cormorant Garamond", "Noto Serif TC", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

:root[lang="ja"] {
  --font-body: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
}

:root[lang="ko"] {
  --font-body: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  background-color: var(--bg-outer);
  color: var(--text-ivory);
  font-family: var(--font-body);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* 全站鎖定手機直式版型（最大寬度 430px，適合 QR Code 手機掃碼瀏覽） */
.app-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background-color: var(--bg-obsidian);
  background-image:
    radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.11), transparent 55%),
    radial-gradient(circle at 85% 90%, rgba(212, 175, 55, 0.05), transparent 45%);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.9);
}

@media (min-width: 431px) {
  .app-shell {
    border-left: 1px solid var(--gold-dim);
    border-right: 1px solid var(--gold-dim);
  }
}

/* Loading & Error */
.loading-screen,
.error-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 28px 20px;
  text-align: center;
}

.gold-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--gold-dim);
  border-top-color: var(--gold-primary);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-family: var(--font-display);
  letter-spacing: 0.22em;
  font-size: 0.8rem;
  color: var(--gold-primary);
}

/* 預覽模式提示條 */
.preview-banner {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.22), rgba(212, 175, 55, 0.12));
  border-bottom: 1px solid var(--gold-border);
  color: var(--gold-light);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 6px 12px;
}

/* Top Header (Shared) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(8, 8, 10, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gold-dim);
}

.header-inner {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

/* 主題 LOGO：唯一不強制 16:9 的圖片，保持原始比例 */
.brand-logo-img {
  max-height: 36px;
  max-width: 180px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.brand-title-fallback {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lang-select {
  background: var(--bg-card);
  color: var(--gold-light);
  border: 1px solid var(--gold-border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
  outline: none;
  max-width: 130px;
}

/* 16:9 Media Frame (除主題 LOGO 外，所有圖片皆為 16:9) */
.ratio-16-9 {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #14141a, #0b0b0e);
  border: 1px solid var(--gold-dim);
}

.ratio-16-9 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ratio-16-9-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  letter-spacing: 0.18em;
  color: rgba(212, 175, 55, 0.4);
  font-size: 0.82rem;
}

/* Tier 1: 手機首頁 / 語言選擇 */
.home-container {
  flex: 1;
  width: 100%;
  padding: 36px 20px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
}

.home-logo-wrap {
  text-align: center;
}

.home-logo-img {
  max-height: 68px;
  max-width: 240px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.home-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  background: linear-gradient(135deg, #fff3c4 0%, var(--gold-primary) 55%, #a88222 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-hero-frame {
  border-radius: var(--radius-md);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.75), 0 0 0 1px var(--gold-border);
}

.language-grid {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lang-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(28, 28, 36, 0.96), rgba(16, 16, 20, 0.98));
  border: 1px solid var(--gold-border);
  transition: var(--transition);
}

.lang-btn:active {
  transform: scale(0.98);
  border-color: var(--gold-light);
}

.lang-btn-native {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold-light);
  letter-spacing: 0.04em;
}

.lang-btn-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-footer-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-align: center;
}

/* Container for Tier 2 & Tier 3 */
.page-container {
  flex: 1;
  width: 100%;
  padding: 18px 16px 56px;
}

/* Section / Country Tabs (橫向滑動) */
.section-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.section-tabs::-webkit-scrollbar {
  display: none;
}

.section-tab {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--gold-dim);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  transition: var(--transition);
}

.section-tab.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.24), rgba(212, 175, 55, 0.08));
  border-color: var(--gold-light);
  color: var(--gold-light);
}

/* Tier 2: Section Hero + History */
.section-hero-card {
  background: var(--bg-surface);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
}

.section-hero-card .ratio-16-9 {
  border: none;
  border-bottom: 1px solid var(--gold-dim);
}

.section-hero-body {
  padding: 18px 18px 22px;
}

.section-kicker {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--gold-primary);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 12px;
  line-height: 1.35;
}

.rich-paragraphs {
  color: var(--text-ivory);
  font-size: 0.96rem;
  line-height: 1.8;
  white-space: pre-line;
}

/* Tier 2 Bottom: 手機單欄小項目列表 */
.items-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--gold-dim);
  padding-bottom: 8px;
}

.items-heading {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.14em;
  color: var(--gold-primary);
}

.items-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.items-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.item-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.item-card:active {
  transform: scale(0.99);
  border-color: var(--gold-light);
}

.item-card .ratio-16-9 {
  border: none;
  border-bottom: 1px solid var(--gold-dim);
}

.item-card-content {
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.item-index {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--gold-primary);
}

.item-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-ivory);
  line-height: 1.4;
}

.item-card-excerpt {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tier 3: Item Detail */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--gold-border);
  background: var(--bg-surface);
  color: var(--gold-light);
  font-size: 0.84rem;
  margin-bottom: 16px;
}

.detail-article {
  background: var(--bg-surface);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
}

.detail-article .ratio-16-9 {
  border: none;
  border-bottom: 1px solid var(--gold-dim);
}

.detail-body {
  padding: 20px 18px 28px;
}

.detail-section-tag {
  font-family: var(--font-display);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  color: var(--gold-primary);
  margin-bottom: 6px;
}

.detail-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 16px;
  line-height: 1.35;
}

.detail-nav {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-pill {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  color: var(--text-ivory);
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}

.nav-pill.next {
  text-align: right;
}

.nav-pill-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--gold-primary);
  text-transform: uppercase;
}

.nav-pill-title {
  font-size: 0.92rem;
  font-weight: 500;
}

.empty-state {
  padding: 36px 20px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--gold-dim);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}
