:root {
    color-scheme: light;
    --bg: #f8fbf6;
    --surface: #ffffff;
    --surface-2: #edf5ef;
    --surface-3: #e7f2eb;
    --ink: #17201a;
    --muted: #657064;
    --line: #d9e3da;
    --primary: #146c5f;
    --primary-ink: #ffffff;
    --secondary: #41665b;
    --tertiary: #315d54;
    --accent: #1f7b68;
    --info: #45655d;
    --shadow: 0 20px 60px rgba(23, 32, 26, 0.12);
    --radius: 8px;
    --radius-small: 6px;
    --rail: 88px;
    --topbar: 82px;
    font-family: Inter, "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@font-face {
    font-family: "Material Symbols Rounded";
    src: url("/assets/fonts/material-symbols-rounded.ttf") format("truetype");
    font-weight: 100 700;
    font-style: normal;
    font-display: swap;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--bg);
}

body {
    margin: 0;
    color: var(--ink);
    background:
        repeating-linear-gradient(135deg, rgba(20, 108, 95, 0.045) 0 1px, transparent 1px 22px),
        linear-gradient(180deg, rgba(20, 108, 95, 0.10), rgba(248, 251, 246, 0) 320px),
        var(--bg);
}

[hidden] {
    display: none !important;
}

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

button,
input {
    font: inherit;
}

img {
    display: block;
    max-width: 100%;
}

.material-symbols-rounded {
    font-family: "Material Symbols Rounded";
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    display: inline-block;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-feature-settings: "liga";
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "liga";
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 1fr);
}

.rail {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 16px;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(18px);
    z-index: 20;
}

.brand-mark,
.mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.brand-glyph {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    color: var(--primary-ink);
    background: var(--primary);
    box-shadow: 0 14px 34px rgba(20, 108, 95, 0.24);
}

.rail-nav {
    margin-top: 34px;
    display: grid;
    gap: 12px;
}

.rail-link,
.icon-button,
.filled-icon-button {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: var(--radius);
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.rail-link:hover,
.icon-button:hover {
    color: var(--primary);
    background: var(--surface-2);
}

.rail-link.is-active,
.bottom-link.is-active {
    color: var(--primary);
    background: #d6efe7;
}

.page-frame {
    min-width: 0;
    padding-bottom: 96px;
}

.topbar {
    min-height: var(--topbar);
    padding: 16px clamp(18px, 4vw, 48px);
    display: grid;
    grid-template-columns: auto minmax(240px, 1fr) auto;
    gap: 18px;
    align-items: center;
    position: sticky;
    top: 0;
    background: rgba(248, 251, 246, 0.78);
    backdrop-filter: blur(18px);
    z-index: 10;
}

.mobile-brand {
    display: none;
}

.searchbar,
.field {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
    box-shadow: 0 10px 28px rgba(23, 32, 26, 0.06);
}

.searchbar:focus-within,
.field:focus-within {
    border-color: rgba(20, 108, 95, 0.42);
    box-shadow: 0 0 0 4px rgba(20, 108, 95, 0.10);
}

.searchbar input,
.field input,
.field select,
.ticket-panel select {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
}

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

.profile-chip,
.state-pill,
.chip,
.text-link {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: var(--radius);
    padding: 0 14px;
    color: var(--primary);
    background: #dff2ea;
    white-space: nowrap;
}

.badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: var(--accent);
    font-size: 12px;
    font-weight: 800;
}

.content {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 10px clamp(18px, 4vw, 48px) 44px;
}

.hero-band {
    min-height: calc(100vh - var(--topbar) - 72px);
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(340px, 1.05fr);
    gap: clamp(22px, 4vw, 54px);
    align-items: center;
}

.hero-copy {
    display: grid;
    gap: 22px;
    align-content: center;
}

.lively-title h1,
.hero-copy h1 {
    color: var(--primary);
}

.eyebrow,
.state-pill {
    color: var(--secondary);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1 {
    font-size: clamp(44px, 8vw, 104px);
    line-height: 0.95;
    font-weight: 900;
    max-width: 9ch;
}

h2 {
    font-size: clamp(24px, 3vw, 38px);
    line-height: 1.05;
}

h3 {
    font-size: 18px;
    line-height: 1.25;
}

.hero-copy p {
    max-width: 620px;
    color: var(--muted);
    font-size: 20px;
    line-height: 1.6;
}

.hero-actions,
.load-more-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filled-button,
.tonal-button {
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: var(--radius);
    padding: 0 20px;
    font-weight: 800;
    cursor: pointer;
}

.filled-button,
.filled-icon-button {
    color: var(--primary-ink);
    background: var(--primary);
}

.tonal-button {
    color: var(--primary);
    background: #dff2ea;
}

.filled-button:hover,
.tonal-button:hover,
.filled-icon-button:hover {
    transform: translateY(-1px);
}

.stretch {
    width: 100%;
}

.hero-media {
    min-height: 560px;
    position: relative;
}

.visual-stack {
    height: 100%;
    min-height: 560px;
    display: grid;
    grid-template-columns: 1fr 0.72fr;
    grid-template-rows: 1fr 0.64fr;
    gap: 14px;
}

.visual-tile {
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0)),
        linear-gradient(135deg, #dcefe7, #f8fbf6);
    box-shadow: var(--shadow);
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.tile-large {
    grid-row: span 2;
}

.tile-small {
    background-image:
        linear-gradient(135deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0)),
        linear-gradient(135deg, #bfded2, #eef7f2);
}

.tile-wide {
    background-image:
        linear-gradient(135deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0)),
        linear-gradient(135deg, #c8e5da, #ffffff);
}

.section-band,
.page-title,
.filter-bar,
.account-layout {
    margin-top: clamp(24px, 5vw, 58px);
}

.section-heading,
.page-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}

.section-heading.compact {
    margin-bottom: 18px;
}

.category-strip {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.category-card,
.product-card,
.news-card,
.login-panel,
.member-panel,
.checkout-panel,
.cart-item,
.empty-state {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 14px 38px rgba(23, 32, 26, 0.07);
}

.category-card {
    min-height: 96px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.category-icon,
.avatar {
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    color: var(--primary);
    background: #dff2ea;
    overflow: hidden;
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
    gap: clamp(20px, 4vw, 42px);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.product-grid.dense {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.product-card {
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.product-card:hover,
.lively-card:hover {
    transform: translateY(-4px);
    border-color: rgba(20, 108, 95, 0.36);
    box-shadow: 0 24px 70px rgba(23, 32, 26, 0.14);
}

.product-image {
    aspect-ratio: 1 / 1;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.35), transparent),
        linear-gradient(135deg, #dff2ea, #edf5ef);
    background-size: cover;
    background-position: center;
}

.ticket-card .product-image {
    position: relative;
}

.ticket-card .product-image::after {
    content: "入场票";
    position: absolute;
    left: 12px;
    bottom: 12px;
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border-radius: var(--radius-small);
    color: #fff;
    background: rgba(23, 32, 26, 0.72);
    font-size: 13px;
    font-weight: 800;
}

.product-body,
.news-card,
.cart-item {
    padding: 14px;
}

.product-meta,
.news-meta,
.muted {
    color: var(--muted);
    line-height: 1.55;
}

.price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
}

.price {
    color: var(--primary);
    font-size: 22px;
    font-weight: 900;
}

.small-icon {
    width: 40px;
    height: 40px;
}

.news-list,
.cart-list,
.order-preview {
    display: grid;
    gap: 12px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(130px, 220px) 52px;
    gap: 12px;
}

.field.short {
    min-width: 0;
}

.field.stacked {
    min-height: 0;
    display: grid;
    align-items: stretch;
    padding: 12px 14px;
}

.field.stacked span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.segmented-control,
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.segmented-control {
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.segmented-control button,
.chip {
    border: 0;
    min-height: 38px;
    border-radius: var(--radius-small);
    padding: 0 14px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
}

.segmented-control button.is-active,
.chip.is-active {
    color: #fff;
    background: var(--primary);
}

.account-layout {
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.auth-panel {
    display: grid;
    gap: 14px;
}

.stretch-tabs {
    width: 100%;
}

.stretch-tabs button {
    flex: 1 1 0;
}

.auth-form {
    display: none;
}

.auth-form.is-active {
    display: grid;
}

.code-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 136px;
    gap: 10px;
    align-items: stretch;
}

.login-panel,
.member-panel,
.checkout-panel {
    padding: 20px;
}

.login-panel {
    display: grid;
    gap: 14px;
}

.login-panel.auth-form {
    display: none;
}

.login-panel.auth-form.is-active {
    display: grid;
}

.member-panel {
    display: grid;
    gap: 18px;
}

.member-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.metric {
    min-height: 96px;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--surface-2);
}

.metric span {
    display: block;
    color: var(--muted);
    margin-bottom: 8px;
}

.metric strong {
    font-size: 28px;
}

.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 20px;
    align-items: start;
}

.cart-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
}

.cart-thumb {
    width: 72px;
    height: 72px;
    border-radius: var(--radius);
    background: var(--surface-2);
    background-size: cover;
    background-position: center;
}

.empty-state {
    min-height: 420px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 16px;
    text-align: center;
}

.empty-state > .material-symbols-rounded {
    font-size: 54px;
    color: var(--primary);
}

.compact-empty {
    min-height: 220px;
}

.detail-shell {
    min-height: calc(100vh - var(--topbar) - 120px);
    display: grid;
    grid-template-columns: minmax(300px, 0.95fr) minmax(320px, 0.75fr);
    gap: clamp(20px, 4vw, 54px);
    align-items: center;
    margin-top: 18px;
}

.detail-gallery {
    border-radius: var(--radius);
    min-height: 560px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.detail-image {
    width: 100%;
    height: 100%;
    min-height: 560px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.25), transparent),
        linear-gradient(135deg, #dff2ea, #edf5ef);
    background-size: cover;
    background-position: center;
}

.detail-info {
    display: grid;
    gap: 18px;
}

.detail-info h1 {
    max-width: 11ch;
}

.detail-price-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stock-chip {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border-radius: var(--radius-small);
    color: var(--info);
    background: #e5eefc;
    font-weight: 800;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ticket-note {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--surface-3);
    color: var(--tertiary);
}

.rich-content {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.78);
    line-height: 1.8;
    overflow: hidden;
}

.ticket-grid {
    margin-top: clamp(24px, 5vw, 58px);
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 18px;
}

.ticket-panel {
    padding: 22px;
    display: grid;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 18px 48px rgba(23, 32, 26, 0.09);
}

.purchase-panel {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.86);
}

.order-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.order-detail-card {
    background: rgba(255, 255, 255, 0.9);
}

.verify-qr {
    width: min(260px, 100%);
    aspect-ratio: 1 / 1;
    object-fit: contain;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.qr-fallback {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 220px;
    border: 1px dashed rgba(20, 108, 95, 0.35);
    border-radius: var(--radius);
    background: var(--surface-2);
    text-align: center;
    color: var(--primary);
}

.qr-fallback .material-symbols-rounded {
    font-size: 64px;
}

.order-items {
    display: grid;
    gap: 6px;
}

.captcha-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(18, 31, 26, 0.38);
    backdrop-filter: blur(10px);
}

.captcha-card {
    width: min(420px, 100%);
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.captcha-stage {
    position: relative;
    width: 100%;
    max-width: 310px;
    margin-inline: auto;
    aspect-ratio: 310 / 155;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface-2);
}

.captcha-stage img {
    display: block;
    height: 100%;
    max-width: none;
}

#captchaBg {
    width: 100%;
    object-fit: cover;
}

#captchaPiece {
    position: absolute;
    left: 0;
    top: 0;
    width: auto;
    pointer-events: none;
}

.captcha-range {
    width: 100%;
    accent-color: var(--primary);
}

.captcha-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.verify-panel {
    background: var(--surface-2);
}

.skeleton-line {
    display: block;
    width: 72%;
    height: 16px;
    border-radius: var(--radius-small);
    background: rgba(20, 108, 95, 0.12);
}

.skeleton-line.short {
    width: 42%;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    color: var(--muted);
}

pre {
    white-space: pre-wrap;
    word-break: break-word;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 20px);
    max-width: min(520px, calc(100vw - 32px));
    padding: 13px 18px;
    border-radius: var(--radius);
    color: #fff;
    background: rgba(23, 32, 26, 0.92);
    opacity: 0;
    pointer-events: none;
    transition: transform 180ms ease, opacity 180ms ease;
    z-index: 50;
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.bottom-nav {
    display: none;
}

.skeleton {
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.64), transparent);
    animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

@media (max-width: 980px) {
    :root {
        --rail: 0px;
        --topbar: 76px;
    }

    .app-shell {
        display: block;
    }

    .rail {
        display: none;
    }

    .topbar {
        grid-template-columns: 1fr auto;
        padding: 12px 16px;
    }

    .mobile-brand {
        display: inline-flex;
    }

    .topbar .searchbar {
        grid-column: 1 / -1;
        order: 3;
    }

    .profile-chip {
        display: none;
    }

    .content {
        padding: 8px 16px 96px;
    }

    .hero-band,
    .split-layout,
    .account-layout,
    .cart-layout,
    .detail-shell,
    .ticket-grid {
        grid-template-columns: 1fr;
    }

    .hero-band {
        min-height: auto;
        padding-top: 18px;
    }

    .hero-media,
    .visual-stack {
        min-height: 360px;
    }

    .detail-gallery,
    .detail-image {
        min-height: 360px;
    }

    h1 {
        font-size: 46px;
    }

    .page-title,
    .section-heading {
        align-items: start;
        flex-direction: column;
    }

    .filter-bar {
        grid-template-columns: 1fr 1fr 52px;
    }

    .bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        min-height: 72px;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
        padding: 8px 10px max(8px, env(safe-area-inset-bottom));
        border-top: 1px solid var(--line);
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(18px);
        z-index: 30;
    }

    .bottom-link {
        min-width: 0;
        display: grid;
        place-items: center;
        gap: 2px;
        border-radius: var(--radius);
        padding: 6px 4px;
        color: var(--muted);
        font-size: 12px;
    }

    .bottom-link span:last-child {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 620px) {
    .top-actions {
        gap: 4px;
    }

    .icon-button {
        width: 46px;
        height: 46px;
    }

    .hero-actions,
    .segmented-control,
    .chip-row {
        width: 100%;
    }

    .filled-button,
    .tonal-button {
        min-width: 0;
        flex: 1 1 160px;
    }

    .filter-bar {
        grid-template-columns: 1fr 52px;
    }

    .field.short {
        grid-column: 1 / -1;
        order: 3;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .code-row {
        grid-template-columns: 1fr;
    }

    .cart-item {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .cart-item .price {
        grid-column: 2;
    }
}
