:root {
    --v2-ink: #221d35;
    --v2-muted: #6e6377;
    --v2-paper: #f4e3c5;
    --v2-panel: #fff8ea;
    --v2-gold: #bd8d25;
    --v2-blue: #252659;
    --v2-plum: #2a1738;
    --v2-line: rgba(189, 141, 37, 0.52);
    --v2-shadow: rgba(35, 22, 50, 0.22);
}

* {
    box-sizing: border-box;
}

body.v2-page {
    min-height: 100vh;
    margin: 0;
    color: var(--v2-ink);
    background:
        linear-gradient(90deg, rgba(37, 38, 89, 0.1) 0 1px, transparent 1px 100%),
        linear-gradient(180deg, rgba(189, 141, 37, 0.12) 0 1px, transparent 1px 100%),
        linear-gradient(135deg, #f8e8c9 0%, #f1d8ad 52%, #ead0a4 100%);
    background-size: auto, 28px 28px, auto;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    letter-spacing: 0;
}

.v2-container {
    width: min(100% - 2rem, 1120px);
    margin-inline: auto;
}

.v2-nav {
    position: relative;
    z-index: 3;
    border-bottom: 1px solid rgba(189, 141, 37, 0.42);
    background: rgba(255, 242, 215, 0.86);
    backdrop-filter: blur(12px);
}

.v2-nav-inner {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.v2-brand,
.v2-nav-links,
.v2-actions,
.v2-feedback-actions,
.v2-result-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.v2-brand {
    min-width: 0;
    color: var(--v2-ink);
    font-weight: 900;
    text-decoration: none;
}

.v2-brand img {
    width: auto;
    max-width: 12rem;
    max-height: 3rem;
}

.v2-brand span {
    white-space: nowrap;
}

.v2-nav-links {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.v2-nav-links a {
    color: var(--v2-muted);
    font-weight: 800;
    text-decoration: none;
}

.v2-nav-links a:hover {
    color: var(--v2-gold);
}

.v2-hero {
    position: relative;
    min-height: min(82vh, 760px);
    overflow: hidden;
    color: #fff7e6;
    background:
        linear-gradient(90deg, rgba(21, 17, 40, 0.94), rgba(38, 33, 84, 0.8) 54%, rgba(114, 80, 30, 0.64)),
        url("assets/images/tablecloth.png") center / cover;
}

.v2-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 9rem;
    background: linear-gradient(180deg, transparent, rgba(244, 228, 197, 0.98));
    pointer-events: none;
}

.v2-hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    align-items: center;
    min-height: min(82vh, 760px);
    padding-block: 3rem 7rem;
}

.v2-hero-copy {
    max-width: 720px;
}

.v2-eyebrow {
    margin: 0 0 0.75rem;
    color: var(--v2-gold);
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.v2-hero .v2-eyebrow {
    color: #e4bd65;
}

.v2-hero h1,
.v2-intro h1,
.v2-result-heading h1,
.v2-notice h1 {
    margin: 0 0 1rem;
    font-size: clamp(2.25rem, 8vw, 5.5rem);
    font-weight: 900;
    line-height: 1.04;
}

.v2-hero h1 {
    color: #fff7e6;
    font-size: clamp(2rem, 6vw, 4.2rem);
    text-shadow: 0 3px 18px rgba(0, 0, 0, 0.36);
}

.v2-hero p {
    max-width: 640px;
    color: rgba(255, 247, 230, 0.9);
    font-size: 1.12rem;
    line-height: 1.8;
}

.v2-actions {
    flex-wrap: wrap;
    margin-top: 1.65rem;
}

.v2-hero .v2-actions .v2-btn-primary {
    min-width: min(100%, 18rem);
    min-height: 54px;
    padding-inline: 2rem;
    font-size: 1.08rem;
}

.v2-btn {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.1rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 900;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.v2-btn.is-disabled,
.v2-btn[aria-disabled="true"] {
    opacity: 0.45;
    pointer-events: none;
}

.v2-wide-action {
    width: min(100%, 34rem);
    min-height: 60px;
    padding-inline: 1.5rem;
    font-size: 1.16rem;
}

.v2-btn-primary {
    color: #fff7e6;
    border-color: rgba(228, 189, 101, 0.82);
    background: linear-gradient(135deg, #252659, #3d2a65 56%, #7d5521);
    box-shadow: 0 10px 22px rgba(42, 23, 56, 0.22);
}

body.v2-page .v2-btn-primary,
body.v2-page .v2-btn-primary:visited,
body.v2-page .v2-btn-primary:hover,
body.v2-page .v2-btn-primary:focus {
    color: #fff7e6;
}

body.v2-page .footer-social a,
body.v2-page .footer-social a:visited,
body.v2-page .footer-social a:hover,
body.v2-page .footer-social a:focus {
    color: #fff6dd;
}

.v2-btn-ghost {
    color: var(--v2-ink);
    border-color: rgba(189, 141, 37, 0.68);
    background: rgba(255, 242, 215, 0.56);
}

.v2-hero .v2-btn-ghost {
    color: #fff7e6;
    background: rgba(255, 247, 230, 0.08);
    border-color: rgba(228, 189, 101, 0.72);
}

.v2-card-fan {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(82px, 1fr));
    align-items: end;
    width: min(100%, 520px);
    min-height: 18rem;
    margin: 0 auto;
}

.v2-fan-card {
    width: 100%;
    max-height: 22rem;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 22px 44px rgba(0, 0, 0, 0.32);
}

.v2-fan-left {
    position: relative;
    z-index: 1;
    transform: rotate(-9deg) translateX(1.2rem);
}

.v2-fan-center {
    position: relative;
    z-index: 3;
    transform: translateY(-1.8rem);
}

.v2-fan-right {
    position: relative;
    z-index: 1;
    transform: rotate(9deg) translateX(-1.2rem);
}

.v2-spread-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
    margin-top: -4.4rem;
    padding-bottom: 3rem;
}

.v2-spread-grid article,
.v2-panel,
.v2-notice,
.v2-feedback,
.v2-question-summary {
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: rgba(255, 249, 236, 0.92);
    box-shadow: 0 16px 34px rgba(42, 23, 56, 0.16);
}

.v2-spread-grid article {
    padding: 1.2rem;
}

.v2-spread-grid span {
    color: var(--v2-gold);
    font-weight: 900;
}

.v2-spread-grid h2,
.v2-panel h2,
.v2-feedback h2 {
    margin: 0.35rem 0 0.55rem;
    color: var(--v2-ink);
    font-size: 1.45rem;
    font-weight: 900;
}

.v2-spread-grid p,
.v2-intro p,
.v2-card-reading p,
.v2-question-summary p,
.v2-notice p {
    margin: 0;
    color: #433852;
    line-height: 1.75;
}

.v2-intro .v2-scroll-hint {
    margin-top: 0.55rem;
    color: var(--v2-ink);
    font-weight: 900;
}

.v2-page-shell {
    padding-block: 2.2rem 3rem;
}

.v2-intro {
    max-width: 840px;
    margin-bottom: 1.35rem;
}

.v2-intro h1,
.v2-result-heading h1,
.v2-notice h1 {
    color: var(--v2-ink);
    font-size: clamp(2rem, 8vw, 4.2rem);
}

.v2-draw-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: stretch;
}

.v2-preview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
    align-items: end;
    padding: 1rem;
    border: 1px solid var(--v2-line);
    border-radius: 8px;
    background: rgba(37, 38, 89, 0.92);
    box-shadow: 0 18px 42px rgba(42, 23, 56, 0.18);
}

.v2-preview div {
    display: grid;
    gap: 0.7rem;
    justify-items: center;
    color: #fff7e6;
    font-weight: 900;
    text-align: center;
}

.v2-preview img {
    width: 100%;
    max-height: 18rem;
    object-fit: contain;
    border-radius: 7px;
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.28);
}

.v2-panel {
    padding: 1.25rem;
}

.v2-panel form {
    display: grid;
    gap: 0.8rem;
}

.v2-panel label {
    font-weight: 900;
}

.v2-panel select,
.v2-panel textarea {
    display: block;
    width: 100%;
    padding: 0.85rem 0.95rem;
    color: var(--v2-ink);
    border: 1px solid rgba(189, 141, 37, 0.42);
    border-radius: 8px;
    background: rgba(255, 249, 236, 0.9);
    font: inherit;
}

.v2-panel textarea {
    resize: vertical;
}

.v2-submit {
    width: 100%;
    margin-top: 0.5rem;
}

.v2-alert {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid #d7b46a;
    border-radius: 8px;
    background: rgba(255, 244, 215, 0.96);
}

.v2-question-panel {
    max-width: 760px;
}

.v2-pick-shell {
    display: grid;
    gap: 1rem;
}

.v2-card-scroll {
    display: grid;
    grid-auto-columns: minmax(9.5rem, 36vw);
    grid-auto-flow: column;
    gap: 0.85rem;
    overflow-x: auto;
    padding: 0.5rem 0.25rem 1.2rem;
    scroll-padding-inline: 0.25rem;
    scroll-snap-type: x mandatory;
}

.v2-card-scroll::-webkit-scrollbar {
    height: 0.7rem;
}

.v2-card-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(37, 38, 89, 0.38);
}

.v2-back-card {
    position: relative;
    display: grid;
    gap: 0.65rem;
    justify-items: center;
    padding: 0;
    color: #fff7e6;
    border: 0;
    background: transparent;
    font: inherit;
    font-weight: 900;
    scroll-snap-align: center;
    transition: transform 180ms ease, filter 180ms ease;
}

.v2-back-card img {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3.35;
    object-fit: cover;
    border: 2px solid rgba(189, 141, 37, 0.48);
    border-radius: 8px;
    box-shadow: 0 15px 28px rgba(42, 23, 56, 0.22);
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.v2-back-card span {
    position: absolute;
    right: 0.65rem;
    bottom: 2.1rem;
    min-width: 2.2rem;
    padding: 0.25rem 0.45rem;
    border: 1px solid rgba(228, 189, 101, 0.7);
    border-radius: 999px;
    background: rgba(37, 38, 89, 0.82);
    font-size: 0.78rem;
}

.v2-back-card:not(:disabled):hover,
.v2-back-card.is-selected {
    transform: translateY(-0.45rem);
}

.v2-back-card.is-selected img {
    border-color: #f2cf75;
    box-shadow: 0 0 0 4px rgba(242, 207, 117, 0.36), 0 20px 34px rgba(42, 23, 56, 0.3);
}

.v2-back-card:disabled:not(.is-selected) {
    opacity: 0.62;
}

.v2-pick-message {
    min-height: 1.6rem;
    margin: 0;
    color: var(--v2-ink);
    font-weight: 900;
}

.v2-result-heading {
    margin-bottom: 1.5rem;
}

.v2-question-summary {
    display: grid;
    gap: 0.65rem;
    max-width: 820px;
    padding: 1rem;
}

.v2-question-summary span {
    width: fit-content;
    padding: 0.35rem 0.7rem;
    color: #fff7e6;
    border-radius: 999px;
    background: var(--v2-blue);
    font-weight: 900;
}

.v2-result-list {
    display: grid;
    gap: 1rem;
}

.v2-flip-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.v2-flip-card {
    display: block;
    width: 100%;
    min-height: 28rem;
    padding: 0;
    border: 0;
    background: transparent;
    perspective: 1200px;
    cursor: pointer;
}

.v2-flip-inner {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    min-height: 28rem;
    transform-style: preserve-3d;
    transition: transform 650ms ease;
}

.v2-flip-card.is-flipped .v2-flip-inner {
    transform: rotateY(180deg);
}

.v2-flip-face {
    position: absolute;
    inset: 0;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    overflow: hidden;
    border: 1px solid rgba(189, 141, 37, 0.62);
    border-radius: 8px;
    backface-visibility: hidden;
    box-shadow: 0 18px 42px rgba(42, 23, 56, 0.18);
}

.v2-flip-back {
    color: #fff7e6;
    background: rgba(37, 38, 89, 0.94);
}

.v2-flip-front {
    color: var(--v2-ink);
    background: linear-gradient(135deg, rgba(255, 248, 234, 0.98), rgba(246, 225, 190, 0.94));
    transform: rotateY(180deg);
}

.v2-flip-face img {
    display: block;
    width: min(100%, 17rem);
    max-height: 22rem;
    object-fit: contain;
    border-radius: 7px;
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.24);
}

.v2-flip-front img.is-reversed {
    transform: rotate(180deg);
}

.v2-flip-face strong {
    color: inherit;
    font-size: 1.2rem;
    font-weight: 900;
}

.v2-flip-face em {
    padding: 0.28rem 0.7rem;
    color: #fff7e6;
    border-radius: 999px;
    background: var(--v2-plum);
    font-style: normal;
    font-weight: 900;
}

.v2-result-card {
    display: grid;
    grid-template-columns: 1fr;
    overflow: hidden;
    border: 1px solid rgba(189, 141, 37, 0.62);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255, 248, 234, 0.98), rgba(246, 225, 190, 0.94));
    box-shadow: 0 18px 42px rgba(42, 23, 56, 0.18);
}

.v2-card-image {
    padding: 0.5rem;
    background:
        radial-gradient(circle at 0% 0%, rgba(67, 38, 82, 0.22), transparent 42%),
        #241834;
}

.v2-card-image img {
    display: block;
    width: 100%;
    max-height: 68vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 12px 28px rgba(28, 18, 42, 0.28);
}

.v2-card-image img.is-reversed {
    transform: rotate(180deg);
}

.v2-card-reading {
    padding: 1rem;
}

.v2-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    color: var(--v2-muted);
    font-size: 0.92rem;
}

.v2-card-meta strong {
    min-width: 3.4rem;
    padding: 0.25rem 0.55rem;
    color: #fff7e6;
    border-radius: 999px;
    background: var(--v2-plum);
    text-align: center;
}

.v2-card-reading h2 {
    margin: 0 0 1rem;
    color: var(--v2-ink);
    font-size: 1.85rem;
    font-weight: 900;
}

.v2-card-reading h3 {
    margin: 1rem 0 0.4rem;
    color: var(--v2-gold);
    font-size: 1rem;
    font-weight: 900;
}

.v2-feedback {
    margin-top: 1.5rem;
    padding: 1.35rem;
}

.v2-feedback-actions,
.v2-result-actions {
    flex-wrap: wrap;
}

.v2-feedback-message {
    min-height: 1.6rem;
    margin: 0.85rem 0 0;
    color: var(--v2-ink);
    font-weight: 900;
}

.v2-result-actions {
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.v2-pick-shell .v2-wide-action,
.v2-result-actions .v2-wide-action {
    justify-self: center;
    margin-inline: auto;
}

.v2-notice {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.25rem;
}

.v2-footer {
    padding: 1.4rem 0 2rem;
}

.v2-footer-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    color: var(--v2-muted);
    font-weight: 800;
}

.v2-footer a {
    color: var(--v2-ink);
    text-decoration: none;
}

@media (min-width: 768px) {
    .v2-hero-inner {
        grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    }

    .v2-spread-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v2-draw-layout {
        grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.18fr);
    }

    .v2-preview {
        grid-template-columns: 1fr;
    }

    .v2-preview img {
        width: min(70%, 220px);
    }

    .v2-result-card {
        grid-template-columns: minmax(220px, 30%) 1fr;
    }

    .v2-card-scroll {
        grid-auto-columns: 12rem;
    }

    .v2-flip-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .v2-card-image img {
        height: 100%;
        max-height: none;
    }

    .v2-card-reading {
        padding: 1.5rem;
    }
}

@media (max-width: 767px) {
    .v2-nav-inner {
        align-items: flex-start;
        flex-direction: column;
        padding-block: 0.75rem;
    }

    .v2-brand {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }

    .v2-brand img {
        max-width: 13rem;
    }

    .v2-nav-links {
        width: 100%;
        justify-content: space-between;
    }

    .v2-card-meta {
        align-items: flex-start;
        flex-direction: column;
    }
}
