:root {
  --vg-ink: #252127;
  --vg-muted: #6d6266;
  --vg-red: #8b2f3c;
  --vg-gold: #d6ad57;
  --vg-cream: #fbf6ed;
  --vg-line: #eadde0;
  --vg-focus: #1769aa;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--vg-ink); background: #fffdf9; font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif; }
body, button, input, select { font: inherit; }
a { color: var(--vg-red); }
img { display: block; max-width: 100%; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 9999; padding: 10px 14px; color: #fff; background: #111; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
:focus-visible { outline: 3px solid var(--vg-focus); outline-offset: 3px; }

.vg-header { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 11px clamp(16px, 4vw, 36px); border-bottom: 4px solid var(--vg-gold); background: rgba(255,255,255,.97); box-shadow: 0 2px 10px rgba(36,27,29,.08); }
.vg-brand { display: flex; align-items: center; gap: 11px; min-width: 0; color: var(--vg-red); text-decoration: none; font-weight: 800; }
.vg-brand img { width: 46px; height: 46px; object-fit: contain; border-radius: 50%; }
.vg-brand span { display: grid; line-height: 1.15; }
.vg-brand small { margin-top: 3px; color: var(--vg-muted); font-size: 11px; font-weight: 600; }
.vg-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.vg-nav a { padding: 9px 12px; border: 1px solid var(--vg-line); border-radius: 999px; background: #fff; color: var(--vg-red); text-decoration: none; font-size: 14px; font-weight: 700; }
.vg-nav a[aria-current="page"] { color: #fff; background: var(--vg-red); border-color: var(--vg-red); }

.vg-shell { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 24px 0 64px; }
.vg-breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; color: var(--vg-muted); font-size: 14px; }
.vg-breadcrumb a { text-decoration: none; }
.vg-hero { overflow: hidden; position: relative; padding: clamp(30px, 6vw, 72px); border-radius: 24px; color: #fff; background: linear-gradient(130deg, #6f1f2c 0%, #973c49 55%, #c1873a 130%); }
.vg-hero::after { content: ""; position: absolute; width: 270px; height: 270px; right: -80px; top: -110px; border: 44px solid rgba(255,255,255,.09); border-radius: 50%; }
.vg-eyebrow { margin: 0 0 10px; color: var(--vg-gold); font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.vg-hero h1 { position: relative; margin: 0; max-width: 760px; font-size: clamp(36px, 7vw, 72px); line-height: 1.08; }
.vg-hero p { position: relative; max-width: 720px; margin: 18px 0 0; font-size: clamp(17px, 2.5vw, 21px); line-height: 1.75; }
.vg-section { margin-top: clamp(34px, 6vw, 68px); }
.vg-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.vg-section h2 { margin: 0; color: var(--vg-red); font-size: clamp(26px, 4vw, 38px); }
.vg-section-heading p { margin: 0; color: var(--vg-muted); }

.vg-search-panel { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--vg-line); border-radius: 18px; background: #fff; box-shadow: 0 8px 30px rgba(74,42,46,.06); }
.vg-search-panel label { font-weight: 800; }
.vg-search-controls { display: grid; grid-template-columns: 1fr; gap: 10px; }
.vg-search-controls input, .vg-search-controls select { min-height: 48px; width: 100%; padding: 10px 13px; border: 1px solid #cbbdc0; border-radius: 10px; color: var(--vg-ink); background: #fff; }
.vg-result-summary { min-height: 1.5em; margin: 0; color: var(--vg-muted); }

.vg-card-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.vg-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--vg-line); border-radius: 18px; background: #fff; box-shadow: 0 5px 22px rgba(57,37,41,.06); }
.vg-card[hidden] { display: none; }
.vg-card-media { position: relative; overflow: hidden; aspect-ratio: 4 / 5; background: #eee7e0; }
.vg-card-media img { width: 100%; height: 100%; object-fit: contain; transition: transform .25s ease; }
.vg-card:hover .vg-card-media img { transform: scale(1.015); }
.vg-card-body { display: flex; flex: 1; flex-direction: column; padding: 18px; }
.vg-chip { align-self: flex-start; display: inline-flex; padding: 5px 9px; border-radius: 999px; color: #6f1f2c; background: #f6e7e9; font-size: 12px; font-weight: 800; }
.vg-card h3 { margin: 10px 0 9px; font-size: 21px; line-height: 1.35; }
.vg-card h3 a { color: var(--vg-ink); text-decoration: none; }
.vg-card p { margin: 0 0 16px; color: var(--vg-muted); line-height: 1.65; }
.vg-card-link { margin-top: auto; font-weight: 800; text-decoration: none; }

.vg-category-grid, .vg-situation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.vg-filter-tile { padding: 18px 14px; border: 1px solid var(--vg-line); border-radius: 14px; color: var(--vg-ink); background: var(--vg-cream); text-align: left; cursor: pointer; }
.vg-filter-tile strong { display: block; color: var(--vg-red); font-size: 17px; }
.vg-filter-tile span { display: block; margin-top: 5px; color: var(--vg-muted); font-size: 13px; }

.vg-detail-hero { display: grid; gap: 14px; max-width: 860px; }
.vg-detail-hero h1 { margin: 0; color: var(--vg-red); font-size: clamp(34px, 6vw, 58px); line-height: 1.16; }
.vg-detail-hero .vg-intro { margin: 0; color: #493f42; font-size: clamp(17px, 2.4vw, 21px); line-height: 1.75; }
.vg-reading-time { margin: 0; color: var(--vg-muted); font-size: 14px; }
.vg-detail-layout { display: grid; gap: clamp(26px, 5vw, 56px); margin-top: 26px; }
.vg-carousel { min-width: 0; }
.vg-carousel-frame { position: relative; overflow: hidden; }
.vg-carousel-track { display: flex; gap: 12px; overflow-x: auto; padding: 5px calc(14% - 12px) 12px 0; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; touch-action: pan-y; cursor: grab; }
.vg-carousel-track.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.vg-carousel-track::-webkit-scrollbar { display: none; }
.vg-slide { flex: 0 0 86%; overflow: hidden; aspect-ratio: 4 / 5; border-radius: 18px; background: #eee7e0; scroll-snap-align: start; box-shadow: 0 6px 22px rgba(31,21,24,.13); }
.vg-slide img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; user-select: none; }
.vg-carousel-toolbar { display: grid; grid-template-columns: 46px 1fr auto 46px; align-items: center; gap: 10px; margin-top: 12px; }
.vg-arrow { width: 44px; height: 44px; border: 1px solid var(--vg-line); border-radius: 50%; color: var(--vg-red); background: #fff; cursor: pointer; font-size: 22px; }
.vg-arrow:disabled { opacity: .35; cursor: default; }
.vg-dots { display: flex; justify-content: center; gap: 1px; }
.vg-dot { position: relative; flex: 0 0 24px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.vg-dot::after { position: absolute; inset: 50% auto auto 50%; width: 9px; height: 9px; border-radius: 50%; background: #c9b9bc; content: ""; transform: translate(-50%, -50%); }
.vg-dot[aria-current="true"]::after { background: var(--vg-red); transform: translate(-50%, -50%) scale(1.25); }
.vg-dot:focus-visible { outline: 3px solid #1d5f85; outline-offset: 1px; }
.vg-counter { min-width: 45px; color: var(--vg-muted); font-variant-numeric: tabular-nums; text-align: center; }
.vg-copy { min-width: 0; }
.vg-copy section { margin-bottom: 28px; }
.vg-copy h2 { margin: 0 0 12px; color: var(--vg-red); font-size: 26px; }
.vg-copy p, .vg-copy li { color: #443b3e; line-height: 1.78; }
.vg-copy ul { padding-left: 1.25rem; }
.vg-source-summary { white-space: pre-line; }
.vg-notice { padding: 14px 16px; border-left: 4px solid var(--vg-gold); background: var(--vg-cream); color: #514548; line-height: 1.65; }
.vg-related-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.vg-related-card { display: block; padding: 15px; border: 1px solid var(--vg-line); border-radius: 12px; color: var(--vg-ink); background: #fff; text-decoration: none; }
.vg-related-card strong { display: block; color: var(--vg-red); }
.vg-cta { padding: clamp(24px, 5vw, 42px); border-radius: 20px; color: #fff; background: #6f1f2c; }
.vg-cta h2 { color: #fff; }
.vg-cta a { display: inline-flex; margin-top: 10px; padding: 12px 18px; border-radius: 999px; color: #4e2914; background: var(--vg-gold); font-weight: 900; text-decoration: none; }
.vg-footer { padding: 32px 18px; color: #d8ced0; background: #2d292a; text-align: center; font-size: 13px; }

@media (min-width: 640px) {
  .vg-search-controls { grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr) minmax(180px, 1fr); }
  .vg-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vg-category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vg-situation-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vg-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 920px) {
  .vg-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vg-category-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .vg-detail-layout { grid-template-columns: minmax(0, 610px) minmax(280px, 1fr); align-items: start; }
  .vg-carousel { position: sticky; top: 96px; }
  .vg-carousel-track { padding-right: 0; }
  .vg-slide { flex-basis: 100%; }
}
@media (max-width: 680px) {
  .vg-header { align-items: flex-start; }
  .vg-brand small { display: none; }
  .vg-brand span > span { max-width: 135px; font-size: 14px; }
  .vg-nav a { padding: 7px 9px; font-size: 12px; }
}
@media (max-width: 400px) {
  .vg-carousel-toolbar { grid-template-columns: 44px minmax(0, 1fr) 34px 44px; gap: 2px; }
  .vg-counter { min-width: 34px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
