:root {
  --bg: #09090b;
  --bg-subtle: #111114;
  --surface: #141418;
  --surface-hover: #1c1c22;
  --glass: rgba(18, 18, 23, 0.76);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent: #f4f4f5;
  --accent-fg: #09090b;
  --shadow-card: 0 18px 40px -16px rgba(0, 0, 0, 0.65);
  --shadow-modal: 0 32px 80px -12px rgba(0, 0, 0, 0.82);
}

body.theme-light {
  --bg: #f7f6f2;
  --bg-subtle: #efede7;
  --surface: #ffffff;
  --surface-hover: #f3f2ee;
  --glass: rgba(247, 246, 242, 0.82);
  --border: rgba(24, 24, 27, 0.08);
  --border-strong: rgba(24, 24, 27, 0.2);
  --text: #18181b;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  --accent: #18181b;
  --accent-fg: #fafafa;
  --shadow-card: 0 16px 36px -14px rgba(24, 24, 27, 0.1);
  --shadow-modal: 0 32px 80px -12px rgba(24, 24, 27, 0.22);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "PingFang HK", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
svg { display: block; flex-shrink: 0; }

/* HEADER */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1360px;
  margin: 0 auto;
  height: 68px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--text);
  color: var(--bg);
  display: grid;
  place-items: center;
}

.brand-name {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.brand-divider {
  width: 1px;
  height: 14px;
  background: var(--border-strong);
}

.brand-tag {
  font-size: 12.5px;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}

@media (max-width: 640px) {
  .brand-divider, .brand-tag { display: none; }
  .header-inner { padding: 0 18px; }
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.icon-pill:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

/* EDITORIAL HERO */
.hero {
  position: relative;
  overflow: hidden;
  padding: 64px 28px 38px;
}

.hero::before {
  content: "";
  position: absolute;
  top: -140px;
  left: 50%;
  transform: translateX(-50%);
  width: 780px;
  height: 320px;
  background: radial-gradient(ellipse at center, rgba(148, 163, 184, 0.12) 0%, transparent 72%);
  pointer-events: none;
}

.hero-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.hero h1 {
  font-family: "Songti TC", "Noto Serif TC", "Georgia", -apple-system, serif;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  max-width: 780px;
  margin-bottom: 14px;
}

.hero-sub {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 580px;
  margin-bottom: 34px;
  font-weight: 400;
}

/* TOOLBAR: FILTERS + SEARCH */
.toolbar-wrap {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 28px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .hero { padding: 42px 18px 26px; }
  .toolbar-wrap { padding: 0 18px 22px; }
}

.filter-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-tab {
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-tab:hover {
  color: var(--text);
  background: var(--surface);
}

.filter-tab.active {
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
}

.search-field {
  position: relative;
  width: 270px;
  max-width: 100%;
}

@media (max-width: 760px) {
  .search-field { width: 100%; }
}

.search-field svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-field input::placeholder { color: var(--text-muted); }
.search-field input:focus { border-color: var(--border-strong); }

/* GALLERY GRID */
.gallery-section {
  max-width: 1360px;
  margin: 0 auto;
  padding: 4px 28px 88px;
}

@media (max-width: 640px) {
  .gallery-section { padding: 4px 18px 64px; }
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(292px, 1fr));
  gap: 30px 26px;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 72px 20px;
  color: var(--text-secondary);
  font-size: 14.5px;
}

.art-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.art-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  cursor: pointer;
}

.art-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.art-card:hover .art-frame img {
  transform: scale(1.04);
}

.fav-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(12, 12, 15, 0.46);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.88);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.24s ease;
}

.art-frame:hover .fav-btn,
.fav-btn.saved {
  opacity: 1;
  transform: translateY(0);
}

.fav-btn.saved {
  color: #fb7185;
  background: rgba(12, 12, 15, 0.68);
}

.art-hover-veil {
  position: absolute;
  inset: auto 0 0 0;
  padding: 36px 16px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.68) 0%, rgba(0, 0, 0, 0) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  opacity: 0;
  transition: opacity 0.26s ease;
}

.art-frame:hover .art-hover-veil {
  opacity: 1;
}

.veil-preview-label {
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.veil-quick-dl {
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #09090b;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: transform 0.18s ease, background 0.18s ease;
}

.veil-quick-dl:hover {
  background: #ffffff;
  transform: scale(1.03);
}

/* Always keep subtle touch affordance on touch screens */
@media (hover: none) {
  .art-hover-veil { opacity: 1; }
  .fav-btn { opacity: 1; transform: none; }
}

.art-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px;
}

.art-title-group {
  min-width: 0;
}

.art-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.art-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.swatches-mini {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.swatch-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(128, 128, 128, 0.28);
}

/* STUDIO MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 6, 9, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.22s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  width: 100%;
  max-width: 1100px;
  max-height: 90vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
}

@media (max-width: 920px) {
  .modal-backdrop { padding: 12px; }
  .modal-dialog {
    grid-template-columns: 1fr;
    overflow-y: auto;
    max-height: 93vh;
  }
}

/* LEFT STAGE */
.stage-col {
  background: #070709;
  color: #f4f4f5;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  position: relative;
  border-right: 1px solid var(--border);
}

.stage-top-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.seg-control {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
}

.seg-btn {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.62);
  transition: all 0.18s ease;
}

.seg-btn:hover { color: #fff; }
.seg-btn.active {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-weight: 600;
}

.mockup-viewport {
  width: 100%;
  min-height: 430px;
  display: grid;
  place-items: center;
  position: relative;
}

@media (max-width: 920px) {
  .mockup-viewport { min-height: 340px; }
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
  display: grid;
  place-items: center;
  transition: all 0.18s;
  z-index: 4;
}
.nav-arrow:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
.nav-arrow.prev { left: 4px; }
.nav-arrow.next { right: 4px; }

/* Device Bezels */
.bezel {
  position: relative;
  overflow: hidden;
  background: #000;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.78);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.bezel img { width: 100%; height: 100%; object-fit: cover; display: block; }

.bezel-iphone {
  width: 218px;
  aspect-ratio: 1320 / 2868;
  border-radius: 36px;
  border: 5px solid #27272a;
  outline: 1px solid rgba(255, 255, 255, 0.14);
}

.bezel-duo {
  width: 288px;
  aspect-ratio: 1878 / 2670;
  border-radius: 26px;
  border: 5px solid #27272a;
  outline: 1px solid rgba(255, 255, 255, 0.14);
}

.bezel-desktop {
  width: 92%;
  max-width: 450px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  border: 4px solid #27272a;
  outline: 1px solid rgba(255, 255, 255, 0.14);
}

.bezel-raw {
  max-width: 430px;
  max-height: 410px;
  border-radius: 14px;
}

/* Refined Apple-grade Overlays */
.screen-ui { position: absolute; inset: 0; pointer-events: none; color: #fff; }
.dynamic-island {
  width: 62px; height: 17px; background: #000; border-radius: 99px;
  margin: 9px auto 0;
}
.lock-header {
  text-align: center;
  margin-top: 20px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.38);
}
.lock-date {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  opacity: 0.9;
}
.lock-clock {
  font-size: 50px;
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  opacity: 0.94;
}
.lock-actions {
  position: absolute;
  bottom: 16px; left: 20px; right: 20px;
  display: flex; justify-content: space-between;
}
.lock-pill-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  display: grid; place-items: center;
}
.home-bar {
  position: absolute;
  bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 74px; height: 3.5px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.78);
}
.fold-seam {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 1.5px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.14), transparent);
}
.glass-dock {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 7px; padding: 5px 10px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.18); backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.glass-app {
  width: 15px; height: 15px; border-radius: 4px;
  background: rgba(255, 255, 255, 0.75);
}
.desktop-menubar {
  position: absolute; top: 0; left: 0; right: 0; height: 18px;
  padding: 0 10px;
  background: rgba(0, 0, 0, 0.36); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 9.5px; font-weight: 500; letter-spacing: 0.02em;
}

.stage-bottom-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.52);
}

.overlay-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
  color: rgba(255, 255, 255, 0.72);
}
.overlay-switch input { accent-color: #fafafa; }

/* RIGHT DETAILS & DOWNLOAD COLUMN */
.detail-col {
  padding: 28px 30px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

@media (max-width: 640px) {
  .detail-col { padding: 22px 20px; }
}

.detail-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.detail-cat {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.detail-title {
  font-family: "Songti TC", "Noto Serif TC", "Georgia", -apple-system, serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
}

.detail-actions-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.palette-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.color-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 11.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-secondary);
  transition: border-color 0.18s;
}
.color-chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip-circle { width: 13px; height: 13px; border-radius: 50%; border: 1px solid rgba(128,128,128,0.25); }

/* PRIMARY RECOMMENDED DOWNLOAD CTA */
.primary-dl-btn {
  width: 100%;
  padding: 13px 18px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.primary-dl-btn:hover { opacity: 0.92; transform: translateY(-1px); }
.primary-dl-sub { font-size: 12px; opacity: 0.72; font-weight: 400; }

/* GROUPED SIZES */
.size-group-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 4px 0 8px;
}

.sizes-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

@media (max-width: 520px) {
  .sizes-list { grid-template-columns: 1fr; }
}

.size-item {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.18s ease;
}

.size-item:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.size-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
}

.size-dim {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.size-dl-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  transition: all 0.18s;
}

.size-item:hover .size-dl-icon {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.bundle-link {
  margin-top: auto;
  padding-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: all 0.18s;
}
.bundle-link:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--bg-subtle);
}

/* FOOTER */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 28px;
}
.footer-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* SUBTLE TOAST */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%, 14px);
  z-index: 200;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: all 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
