:root {
    --bg-page: #10080b;
    --bg-card: rgba(255, 255, 255, 0.96);
    --bg-soft: rgba(116, 23, 40, 0.08);
    --bg-strong: #130508;
    --bg-strong-accent: #45111d;
    --border: rgba(113, 43, 58, 0.16);
    --border-strong: rgba(113, 43, 58, 0.28);
    --text-primary: #23131a;
    --text-secondary: #5c3c47;
    --text-tertiary: #856671;
    --brand: #8f1f35;
    --brand-strong: #5f0f1e;
    --brand-soft: rgba(143, 31, 53, 0.12);
    --success: #2d7b54;
    --warning: #bc7a22;
    --shadow-sm: 0 16px 36px rgba(18, 4, 7, 0.18);
    --shadow-md: 0 24px 72px rgba(18, 4, 7, 0.26);
    --radius-md: 12px;
    --radius-lg: 16px;
}

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

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(165, 57, 86, 0.22), transparent 24%),
        radial-gradient(circle at bottom right, rgba(109, 18, 36, 0.2), transparent 26%),
        linear-gradient(180deg, #25090f 0%, #0c0507 44%, #050203 100%);
    color: var(--text-primary);
    font: 400 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    padding: 20px 20px 110px;
}

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

button,
input,
textarea {
    font: inherit;
}

.page-content,
.detail-shell,
.checkout-shell {
    max-width: 980px;
    margin: 0 auto;
}

/* 详情页底部留白：让最后的「兑换提示」能滚动到固定底栏(返回/兑换 + 导航)之上看全 */
.detail-shell {
    padding-bottom: 170px;
}

.hero-section {
    max-width: 980px;
    margin: 0 auto 28px;
    display: grid;
    gap: 20px;
}

.hero-card,
.carousel-panel,
.card,
.section-block,
.member-overview,
.detail-layout,
.login-panel {
    background: rgba(255, 248, 249, 0.96);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(157, 78, 96, 0.16);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.hero-card {
    padding: 28px;
    background:
        radial-gradient(circle at top right, rgba(214, 140, 157, 0.18), transparent 28%),
        linear-gradient(135deg, var(--bg-strong) 0%, var(--bg-strong-accent) 56%, #070304 100%);
    color: #f8fbff;
}

.brand-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 0 14px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.login-panel .brand-logo {
    margin-left: auto;
    margin-right: auto;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-title,
.login-title {
    font-size: clamp(30px, 4vw, 40px);
    line-height: 1.14;
    margin-bottom: 12px;
}

.hero-subtitle,
.login-subtitle {
    color: rgba(255, 255, 255, 0.78);
    max-width: 620px;
}

.hero-actions,
.login-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.mobile-app-shell {
    max-width: 520px;
    margin: 0 auto;
}

/* 首页 hero：logo 与文字全部居中 */
.hero-card {
    text-align: center;
}
.hero-card .brand-logo {
    margin-left: auto;
    margin-right: auto;
}
.hero-card .hero-actions {
    justify-content: center;
}

.hero-meta {
    margin-top: 18px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
}

.carousel-panel {
    padding: 14px;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: calc(var(--radius-lg) - 8px);
    aspect-ratio: 1.35 / 1;
    background: #391017;
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
}

.carousel-slide {
    min-width: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding: 22px;
}

.carousel-slide-fallback {
    background: linear-gradient(135deg, #2a0910 0%, #6a1a2d 100%);
}

.carousel-copy {
    max-width: 70%;
    color: #fff;
}

.carousel-kicker {
    margin-bottom: 6px;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.carousel-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.24;
}

.carousel-subtitle {
    margin-top: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.84);
}

.carousel-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    border: 0;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
}

.carousel-dot.active {
    width: 26px;
    background: #fff;
}

.section-block {
    padding: 22px;
    margin-bottom: 18px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.section-subtitle {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 14px;
}

.result-note {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    padding: 14px 16px;
    font-size: 14px;
}

.category-pills {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 10px;
}

.category-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
    padding: 12px 6px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    text-align: center;
    transition: all 0.2s ease;
}

.category-pill svg {
    width: 24px;
    height: 24px;
    display: block;
}

.category-pill-name {
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.category-pill.active,
.category-pill:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

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

.product-card,
.order-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.product-card:hover,
.order-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
}

.product-image-wrapper,
.detail-media {
    border-radius: 18px;
    background: linear-gradient(180deg, #f4e7ea 0%, #ead6db 100%);
    overflow: hidden;
}

.product-image,
.detail-media img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.product-image.placeholder,
.checkout-product-image.placeholder,
.order-image.placeholder,
.detail-placeholder {
    display: grid;
    place-items: center;
    min-height: 180px;
    color: var(--text-tertiary);
    background: linear-gradient(180deg, #f4e7ea 0%, #ead6db 100%);
}

.product-name,
.checkout-product-name,
.order-title,
.product-detail-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
}

.product-info,
.order-content,
.checkout-product-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-meta,
.checkout-meta-row,
.order-topline,
.detail-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.product-caption,
.order-caption,
.order-meta,
.detail-note,
.timeline-time {
    color: var(--text-tertiary);
    font-size: 13px;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.product-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.4;
    background: #f1eaec;
    color: var(--text-tertiary);
    border: 1px solid rgba(157, 78, 96, 0.12);
}

.product-tag.on {
    background: rgba(157, 78, 96, 0.10);
    color: var(--brand);
    border-color: rgba(157, 78, 96, 0.28);
}

.product-detail-description {
    color: var(--text-secondary);
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    overflow-x: hidden;
}
/* 粘贴进来的图文混排做边界控制，防止在手机端右侧溢出 */
.product-detail-description img,
.product-detail-description video,
.product-detail-description iframe {
    max-width: 100% !important;
    height: auto !important;
}
.product-detail-description * {
    max-width: 100% !important;
    box-sizing: border-box;
}
.product-detail-description table {
    display: block;
    width: 100% !important;
    overflow-x: auto;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.status-pending {
    background: #fff2df;
    color: var(--warning);
}

.status-shipped,
.status-completed {
    background: #e4f5ea;
    color: var(--success);
}

.status-disabled {
    background: #f3f4f6;
    color: #7a8496;
}

.page-head {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
    color: #fff7f8;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}

.page-back {
    color: #ffd8df;
    font-size: 14px;
    font-weight: 600;
}

.page-head .section-title,
.page-head .section-subtitle {
    color: #fff7f8;
}

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

.detail-body,
.card-body,
.stack-form,
.member-overview {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-panel {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
}

.detail-panel-title,
.card-header {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.card-header {
    padding: 18px 20px 0;
}

.card-body {
    padding: 0 20px 20px;
}

.result-chip {
    margin-top: 6px;
}

.detail-list {
    padding-left: 18px;
    color: var(--text-secondary);
}

.detail-list li + li {
    margin-top: 8px;
}

.checkout-product {
    display: flex;
    gap: 14px;
    align-items: center;
}

.checkout-product-image,
.order-image {
    width: 88px;
    height: 88px;
    border-radius: 16px;
    object-fit: cover;
    flex-shrink: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(143, 31, 53, 0.12);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-full {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
    color: #fff;
}

.btn-secondary {
    background: #fff5f7;
    color: var(--brand);
    border: 1px solid var(--border);
}

.btn-soft {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.btn-sm {
    min-height: 42px;
}

.empty-state,
.loading-card {
    display: grid;
    place-items: center;
    padding: 26px 18px;
    border-radius: var(--radius-md);
    background: var(--bg-soft);
    border: 1px dashed var(--border);
    color: var(--text-tertiary);
    text-align: center;
}

.empty-state.compact,
.loading-card.compact {
    padding: 16px;
}

.member-banner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #1b070c 0%, #5f1425 100%);
    color: #fff;
}

.member-banner p {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.78);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #fff;
}

.info-item span {
    color: var(--text-tertiary);
    font-size: 13px;
}

.info-item strong {
    font-size: 15px;
    word-break: break-word;
}

.info-item.full {
    grid-column: 1 / -1;
}

.order-card {
    flex-direction: row;
}

.logistics-actions {
    margin-top: 8px;
}

.logistics-panel {
    margin-top: 12px;
}

.logistics-timeline {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.timeline-item {
    display: flex;
    gap: 12px;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    margin-top: 6px;
    border-radius: 999px;
    background: #c7d3e8;
    flex-shrink: 0;
}

.timeline-item.is-latest .timeline-dot {
    background: var(--brand);
    box-shadow: 0 0 0 4px rgba(143, 31, 53, 0.12);
}

.timeline-text {
    font-weight: 600;
    color: var(--text-primary);
}

.bottom-action-bar {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: 78px;
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 248, 249, 0.94);
    border: 1px solid rgba(157, 78, 96, 0.14);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(14px);
}

.bottom-action-bar .btn {
    flex: 1;
}

.bottom-nav {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 10px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(24, 5, 9, 0.96) 0%, rgba(67, 17, 29, 0.96) 100%);
    box-shadow: var(--shadow-md);
}

.nav-item {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 46px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.68);
    font-weight: 600;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.site-footer {
    margin: 26px 0 0;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 12px;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(17, 4, 7, 0.62);
    z-index: 30;
}

.modal-overlay.active {
    display: flex;
}

.announcement-modal {
    width: min(560px, 100%);
    background: #fff8f9;
    border-radius: 22px;
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.announcement-modal-header,
.announcement-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.announcement-modal-body {
    margin: 18px 0;
    color: var(--text-secondary);
    max-height: 50vh;
    overflow: auto;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 0;
    background: var(--bg-soft);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 148px;
    transform: translate(-50%, 10px);
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(24, 5, 9, 0.94);
    color: #fff;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 40;
}

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

.toast.success {
    background: rgba(29, 122, 70, 0.95);
}

.toast.error {
    background: rgba(193, 69, 69, 0.95);
}

.login-page {
    padding-bottom: 20px;
}

.login-shell {
    min-height: calc(100vh - 70px);
    display: grid;
    place-items: center;
}

.login-panel {
    width: min(520px, 100%);
    padding: 30px;
    background: linear-gradient(180deg, rgba(24, 5, 9, 0.96) 0%, rgba(71, 17, 29, 0.96) 100%);
    color: #fff;
}

.auth-form {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-panel .form-label {
    color: rgba(255, 255, 255, 0.84);
}

.login-panel .form-input {
    background: rgba(255, 255, 255, 0.96);
}

.form-hint {
    margin-top: 6px;
    color: var(--text-tertiary);
    font-size: 12px;
}

@media (min-width: 768px) {
    .hero-section {
        grid-template-columns: 1.2fr 0.9fr;
    }

    .detail-layout {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    }
}

@media (max-width: 767px) {
    body {
        padding: 12px 12px 104px;
    }

    .info-grid,
    .quick-entry-strip {
        grid-template-columns: 1fr;
    }

    /* 移动端首页商品改为一行两列，多展示商品 */
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .order-card,
    .checkout-product,
    .hero-actions,
    .member-banner,
    .login-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-section {
        gap: 14px;
        margin-bottom: 18px;
    }

    .hero-card,
    .section-block,
    .login-panel,
    .detail-layout,
    .carousel-panel {
        border-radius: 20px;
    }

    .hero-card {
        padding: 22px 18px;
    }

    .hero-title,
    .login-title {
        font-size: 28px;
    }

    .carousel-copy {
        max-width: 100%;
    }

    .category-pills {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .bottom-nav {
        left: 12px;
        right: 12px;
        bottom: 12px;
        padding: 8px;
    }

    .bottom-action-bar {
        left: 12px;
        right: 12px;
        bottom: 72px;
    }

    .site-footer {
        display: none;
    }
}
