:root {
    --bg-page: #f7f7f5;
    --card-bg: rgba(255, 255, 255, 0.93);
    --card-border: rgba(255, 255, 255, 0.82);
    --surface-soft: #ffffff;
    --surface-muted: #f7f9f7;
    --text-main: #193129;
    --text-subtle: #65756e;
    --line-soft: rgba(25, 49, 41, 0.1);
    --brand: #1a8a5f;
    --brand-deep: #116545;
    --brand-soft: rgba(26, 138, 95, 0.12);
    --danger: #b04c30;
    --danger-soft: rgba(176, 76, 48, 0.12);
    --shadow-page: 0 30px 60px rgba(24, 50, 41, 0.15);
    --shadow-panel: 0 14px 28px rgba(24, 50, 41, 0.1);
    --radius-page: 30px;
    --radius-card: 22px;
    --radius-pill: 999px;
    --font-title: "Noto Serif SC", "Songti SC", "STSong", serif;
    --font-body: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
}

body {
    margin: 0;
    min-height: 100dvh;
    font-family: var(--font-body);
    color: var(--text-main);
    background: var(--bg-page);
}

button {
    font: inherit;
    -webkit-tap-highlight-color: transparent;
}

.mobile-shell {
    min-height: 100dvh;
    padding:
        max(18px, env(safe-area-inset-top))
        16px
        max(20px, env(safe-area-inset-bottom))
        16px;
    display: grid;
    place-items: center;
}

.screen-card {
    position: relative;
    width: min(100%, 430px);
    padding: 22px;
    border-radius: var(--radius-page);
    border: 1px solid rgba(25, 49, 41, 0.06);
    background: #ffffff;
    box-shadow: 0 18px 36px rgba(24, 50, 41, 0.08);
}

.screen-card.is-error {
    border-color: rgba(176, 76, 48, 0.18);
}

.hero-topbar,
.hero-block,
.qr-section,
.scan-tip,
.contact-box,
.micro-strip,
.error-panel {
    position: relative;
    z-index: 1;
}

.hero-topbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-badge {
    min-height: 40px;
    padding: 0 14px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.hero-badge.success {
    background: var(--brand-soft);
    color: var(--brand-deep);
}

.hero-badge.ghost {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-main);
    border: 1px solid var(--line-soft);
}

.hero-badge.danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.hero-block {
    margin-top: 18px;
    margin-bottom: 24px;
}

.hero-kicker {
    margin: 0;
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-title {
    margin: 12px 0 0;
    font-family: var(--font-title);
    font-size: clamp(34px, 8vw, 44px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.hero-copy {
    margin: 12px 0 0;
    color: var(--text-subtle);
    font-size: 15px;
    line-height: 1.8;
}

.qr-section {
    margin-top: 0;
}

.qr-panel {
    background: #ffffff;
    border-radius: 24px;
    padding: 22px 18px 18px;
    border: 1px solid rgba(25, 49, 41, 0.08);
    box-shadow: 0 10px 24px rgba(24, 50, 41, 0.06);
}

.qr-headline {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.qr-label {
    margin: 0;
    color: var(--text-subtle);
    font-size: 13px;
}

.qr-headline h2 {
    margin: 4px 0 0;
    font-size: 20px;
    line-height: 1.28;
}

.outline-button {
    min-height: 42px;
    padding: 0 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line-soft);
    background: #ffffff;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.qr-frame {
    width: min(68vw, 280px);
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    display: grid;
    place-items: center;
    padding: 12px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid rgba(25, 49, 41, 0.08);
}

.qr-image {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 18px;
    background: #fff;
    cursor: zoom-in;
}

.scan-tip {
    margin: 18px 0 0;
    text-align: center;
    color: var(--text-subtle);
    font-size: 14px;
    line-height: 1.7;
}

.contact-box {
    margin-top: 20px;
    padding: 18px;
    border-radius: var(--radius-card);
    background: #f8f8f6;
    border: 1px solid var(--line-soft);
}

.contact-label {
    margin: 0;
    font-size: 13px;
    color: var(--text-subtle);
}

.contact-value {
    margin: 10px 0 0;
    font-family: var(--font-title);
    font-size: clamp(30px, 8vw, 36px);
    line-height: 1.1;
    letter-spacing: -0.04em;
    word-break: break-all;
}

.contact-note {
    margin: 10px 0 0;
    color: var(--text-subtle);
    font-size: 14px;
    line-height: 1.7;
}

.action-grid {
    margin-top: 16px;
    display: grid;
    gap: 12px;
}

.action-button {
    min-height: 50px;
    width: 100%;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 180ms ease, background-color 180ms ease, opacity 180ms ease;
}

.action-button:active,
.outline-button:active,
.preview-close:active {
    transform: scale(0.98);
}

.action-button.primary {
    border: 0;
    background: var(--brand);
    color: #fff;
}

.action-button.secondary {
    border: 1px solid var(--line-soft);
    background: #fff;
    color: var(--text-main);
}

.action-button.is-success {
    background: #14875b;
}

.micro-strip {
    margin-top: 18px;
}

.micro-strip.single {
    display: block;
}

.micro-card {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid var(--line-soft);
}

.micro-label {
    display: block;
    color: var(--text-subtle);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.micro-card strong {
    display: block;
    margin-top: 6px;
    font-size: 16px;
    line-height: 1.45;
}

.error-panel {
    margin-top: 18px;
    display: grid;
    gap: 12px;
}

.preview-modal[hidden],
.toast[hidden] {
    display: none;
}

.preview-modal {
    position: fixed;
    inset: 0;
    z-index: 24;
}

.preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 22, 18, 0.72);
    backdrop-filter: blur(8px);
}

.preview-dialog {
    position: relative;
    z-index: 1;
    width: min(92vw, 520px);
    margin: max(16px, env(safe-area-inset-top)) auto;
    padding: 18px;
    border-radius: 28px;
    background: #fff;
    box-shadow: var(--shadow-page);
}

.preview-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: rgba(25, 49, 41, 0.08);
    color: var(--text-main);
    font-size: 26px;
    cursor: pointer;
}

.preview-image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 18px;
    background: #fff;
}

.preview-tip {
    margin: 14px 0 0;
    text-align: center;
    color: var(--text-subtle);
    font-size: 14px;
    line-height: 1.7;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom) + 18px);
    transform: translateX(-50%);
    z-index: 30;
    min-width: 164px;
    max-width: calc(100vw - 32px);
    padding: 12px 16px;
    border-radius: var(--radius-pill);
    background: rgba(20, 35, 29, 0.94);
    color: #fff;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    box-shadow: var(--shadow-panel);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
