:root {
    --bg: #f4f0ea;
    --card: #ffffff;
    --gold: #c9a962;
    --gold-light: #e8d5a3;
    --gold-dark: #9a7b3c;
    --text: #2c2c2c;
    --text-muted: #888;
    --danger: #d64545;
    --success: #07c160;
    --border: rgba(201, 169, 98, 0.25);
    --shadow: 0 8px 32px rgba(18, 18, 26, 0.12);
    --radius: 16px;
    --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, sans-serif;
    --page-width: 720px;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul, ol { list-style-position: outside; }

/* ── Header & Nav ── */
.site-header {
    background: linear-gradient(160deg, #12121a 0%, #1e1e2e 50%, #2a2218 100%);
    color: var(--gold-light);
    text-align: center;
    padding: 28px 20px 32px;
    position: relative;
    overflow: hidden;
}
.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(201,169,98,0.15) 0%, transparent 70%);
    pointer-events: none;
}
.site-header .brand { position: relative; z-index: 1; }
.site-header h1 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 4px;
    margin-bottom: 6px;
}
.site-header h1 a { color: inherit; }
.site-header .tagline {
    font-size: 12px;
    color: rgba(232, 213, 163, 0.75);
    letter-spacing: 1px;
}

.site-nav {
    display: flex;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 10px 12px;
    background: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.site-nav a {
    flex-shrink: 0;
    font-size: 13px;
    color: #666;
    padding: 6px 14px;
    border-radius: 20px;
    white-space: nowrap;
}
.site-nav a.active {
    color: #fff;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    font-weight: 500;
}

/* ── Layout ── */
.page-container {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 16px 16px 40px;
}

.content-head { margin-bottom: 20px; }
.content-head h2 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.content-sub { font-size: 13px; color: var(--text-muted); }

/* ── Buttons ── */
.btn-primary,
button.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: #fff;
    border: none;
    padding: 9px 22px;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(201, 169, 98, 0.35);
}
.btn-primary:active { opacity: 0.85; }
.btn-wechat,
button.btn-wechat {
    background: linear-gradient(135deg, #07c160 0%, #06ad56 100%) !important;
    box-shadow: 0 4px 16px rgba(7, 193, 96, 0.3) !important;
}
.btn-outline {
    background: #fff;
    color: var(--text-muted);
    border: 1px solid #ddd;
    padding: 9px 22px;
    border-radius: 22px;
    font-size: 14px;
    display: inline-block;
}
.btn-block { display: block; width: 100%; text-align: center; padding: 12px; font-size: 16px; }

/* ── Homepage ── */
.hero-banner {
    background: linear-gradient(135deg, #fffdf8 0%, #fff 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.hero-banner h2 { font-size: 20px; margin-bottom: 10px; letter-spacing: 2px; }
.hero-banner p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.8;
    max-width: 520px;
    margin: 0 auto 16px;
}
.hero-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.hero-tags span {
    font-size: 12px;
    color: var(--gold-dark);
    background: rgba(201,169,98,0.12);
    padding: 4px 12px;
    border-radius: 20px;
}

.promise-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 0;
}
.promise-grid.compact { margin-bottom: 0; }
.promise-card {
    background: var(--card);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.promise-card .promise-icon { font-size: 24px; margin-bottom: 6px; }
.promise-card h3 { font-size: 14px; margin-bottom: 4px; }
.promise-card p { font-size: 11px; color: var(--text-muted); line-height: 1.5; }
.promise-card a { color: var(--gold-dark); text-decoration: underline; }

.section-block { margin-bottom: 24px; }
.section-title { margin-bottom: 14px; }
.section-title h2 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.section-desc { font-size: 12px; color: var(--text-muted); }

.info-banner {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--border);
}
.info-banner h3 { font-size: 15px; margin-bottom: 10px; color: var(--gold-dark); }
.info-banner ul { padding-left: 18px; }
.info-banner li { font-size: 13px; color: #666; line-height: 1.9; }
.info-banner a { color: var(--gold-dark); text-decoration: underline; }

/* ── Product list ── */
.product-grid { display: flex; flex-direction: column; gap: 14px; }

.product-item {
    background: var(--card);
    border-radius: var(--radius);
    display: flex;
    gap: 14px;
    padding: 14px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.product-item .thumb {
    width: 108px;
    height: 108px;
    border-radius: 12px;
    object-fit: cover;
    background: #f0ece4;
    flex-shrink: 0;
}
.product-item .info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.product-item .name-link { color: inherit; }
.product-item .name { font-size: 15px; font-weight: 600; line-height: 1.45; }
.product-item .desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.product-item .bottom {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    gap: 10px;
}
.product-item .price { font-size: 22px; font-weight: 700; color: #b83232; white-space: nowrap; }
.product-item .price small { font-size: 14px; font-weight: 500; }

/* ── Product detail ── */
.product-detail {
    display: flex;
    gap: 20px;
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.detail-img { flex-shrink: 0; width: 240px; }
.detail-img img { width: 100%; border-radius: 12px; object-fit: cover; background: #f0ece4; aspect-ratio: 1; }
.detail-info { flex: 1; min-width: 0; }
.detail-info h3 { font-size: 18px; margin-bottom: 12px; line-height: 1.4; }
.detail-price { font-size: 14px; color: #666; margin-bottom: 16px; }
.detail-price strong { font-size: 28px; color: #b83232; }
.detail-meta { margin-bottom: 16px; }
.meta-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    padding: 8px 0;
    border-bottom: 1px solid #f5f0e8;
    color: #666;
}
.meta-row span:first-child { color: #aaa; flex-shrink: 0; }
.meta-row span:last-child { text-align: right; }
.detail-links { display: flex; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.detail-links a { font-size: 12px; color: var(--gold-dark); text-decoration: underline; }

/* ── Content cards ── */
.content-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.content-card h3 {
    font-size: 15px;
    color: var(--gold-dark);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0ebe3;
}
.content-card p { font-size: 14px; color: #555; line-height: 1.8; }
.content-list { padding-left: 18px; }
.content-list li { font-size: 14px; color: #555; line-height: 1.9; margin-bottom: 4px; }

.info-table { width: 100%; border-collapse: collapse; }
.info-table td {
    padding: 10px 12px;
    font-size: 14px;
    border-bottom: 1px solid #f5f0e8;
    vertical-align: top;
}
.info-table td:first-child { color: var(--text-muted); width: 90px; white-space: nowrap; }
.info-table a { color: var(--gold-dark); text-decoration: underline; }

.flow-steps { display: flex; flex-wrap: wrap; gap: 8px; }
.flow-step {
    flex: 1;
    min-width: 72px;
    text-align: center;
    background: #faf8f4;
    border-radius: 10px;
    padding: 12px 6px;
    font-size: 12px;
    color: #666;
}
.flow-step span {
    display: block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    border-radius: 50%;
    background: var(--gold);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    margin: 0 auto 6px;
}

.link-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.link-card {
    display: block;
    padding: 14px;
    background: #faf8f4;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #f0ebe3;
}
.link-card strong { display: block; font-size: 14px; margin-bottom: 4px; }
.link-card span { font-size: 11px; color: var(--text-muted); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }

/* ── Footer ── */
.site-footer {
    text-align: center;
    padding: 24px 16px 32px;
    font-size: 11px;
    color: #aaa;
    line-height: 1.8;
    border-top: 1px solid #e8e0d0;
    background: #fff;
}
.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin-bottom: 12px;
}
.footer-links a { color: #888; font-size: 12px; }

/* ── Pay page ── */
.pay-page {
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(18,18,26,0.92) 0%, rgba(42,34,24,0.88) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pay-dialog {
    background: var(--card);
    border-radius: 20px;
    width: 100%;
    max-width: 860px;
    display: flex;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.4);
    position: relative;
    border: 1px solid var(--border);
}

.pay-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.06);
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 2;
}

.pay-left {
    flex: 1;
    min-width: 0;
    padding: 36px 32px;
    border-right: 1px solid #f0ebe3;
}

.pay-right {
    width: 320px;
    flex-shrink: 0;
    padding: 36px 28px;
    background: linear-gradient(180deg, #faf8f4 0%, #f5f0e8 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.section-tag {
    display: inline-block;
    font-size: 11px;
    color: var(--gold-dark);
    background: rgba(201,169,98,0.12);
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.pay-product-card {
    border: 1.5px solid var(--gold);
    border-radius: 14px;
    padding: 20px;
    background: linear-gradient(135deg, #fffdf8 0%, #fff 100%);
    margin-bottom: 18px;
}
.pay-product-card .img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 14px;
    background: #f0ece4;
}
.pay-product-card .name { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.pay-product-card .price { font-size: 32px; font-weight: 700; color: #b83232; }
.pay-product-card .price small { font-size: 16px; }

.pay-detail-box {
    background: #faf8f4;
    border-radius: 12px;
    padding: 16px;
    font-size: 13px;
    color: #666;
    line-height: 1.8;
}
.pay-detail-box h4 { font-size: 12px; color: #aaa; font-weight: normal; margin-bottom: 8px; }
.pay-order-no { font-size: 11px; color: #ccc; margin-top: 16px; font-family: monospace; word-break: break-all; }

.mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #e8e0d0;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 12px;
    color: #666;
    margin-bottom: 20px;
}
.mode-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }

.qr-wrap {
    width: 210px;
    height: 210px;
    background: #fff;
    border-radius: 14px;
    border: 2px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}
.qr-wrap canvas, .qr-wrap img { max-width: 100%; max-height: 100%; }

.scan-label { margin-top: 16px; font-size: 15px; font-weight: 600; }
.wx-brand { margin-top: 10px; display: flex; align-items: center; gap: 6px; color: var(--success); font-size: 13px; font-weight: 500; }
.wx-brand-icon {
    width: 20px; height: 20px; background: var(--success); border-radius: 4px;
    color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center;
}

.pay-action-box { text-align: center; width: 100%; }
.pay-action-tip { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.7; }
.pay-status-text { margin-top: 14px; font-size: 12px; color: #aaa; }
.pay-status-text.ok { color: var(--success); font-weight: 500; }

/* ── Error panel ── */
.error-panel { text-align: center; width: 100%; }
.error-icon {
    width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg, #fff0f0, #ffe8e8);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px; font-size: 28px;
}
.error-panel.permission .error-icon { background: linear-gradient(135deg, #fff8e8, #fff3d0); }
.error-title { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.error-hint { font-size: 13px; color: #666; line-height: 1.7; margin-bottom: 16px; text-align: left; }
.error-msg {
    font-size: 12px; color: #bbb; background: #f8f8f8; border-radius: 8px;
    padding: 10px 12px; margin: 12px 0; word-break: break-all; text-align: left;
}
.error-steps {
    text-align: left; background: #fff; border: 1px solid #eee;
    border-radius: 12px; padding: 14px 16px; margin-bottom: 20px;
}
.error-steps li { font-size: 12px; color: #666; line-height: 1.8; margin-left: 16px; }
.error-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ── Result page ── */
.result-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.result-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 48px 36px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.result-icon {
    width: 72px; height: 72px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px; font-size: 32px;
}
.result-icon.success { background: linear-gradient(135deg, #e8faf0, #d0f5e0); }
.result-icon.pending { background: linear-gradient(135deg, #fff8e8, #fff3d0); }
.result-card h2 { font-size: 20px; margin-bottom: 10px; }
.result-card p { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; line-height: 1.7; }

/* ── Responsive ── */
@media (max-width: 680px) {
    .site-header h1 { font-size: 18px; letter-spacing: 2px; }
    .promise-grid { grid-template-columns: 1fr 1fr; }
    .product-detail { flex-direction: column; }
    .detail-img { width: 100%; }
    .link-cards { grid-template-columns: 1fr; }
    .pay-dialog { flex-direction: column; }
    .pay-left { border-right: none; border-bottom: 1px solid #f0ebe3; padding: 28px 20px; }
    .pay-right { width: 100%; padding: 28px 20px; }
    .product-item .bottom { flex-wrap: wrap; }
}

@media (max-width: 400px) {
    .promise-grid { grid-template-columns: 1fr; }
}
