/* ============================================================
   一元商城 前台样式
   设计原则：一个响应式模板同时适配电脑和手机，减少维护成本
   ============================================================ */

:root {
    --primary: #e4393c;
    --primary-dark: #c1272d;
    --primary-light: #fff1f0;
    --gold: #f0a020;
    --text: #222;
    --text-light: #666;
    --text-muted: #999;
    --border: #eee;
    --bg: #f6f6f8;
    --white: #fff;
    --success: #18a058;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(0, 0, 0, .06);
    --shadow-hover: 0 8px 24px rgba(228, 57, 60, .16);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: var(--bg);
    font-size: 14px;
    line-height: 1.6;
}

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

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

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

h1,
h2,
h3,
h4,
h5 {
    margin: 0;
    font-weight: 600;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: 14px;
}

button {
    cursor: pointer;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.clearfix::after {
    content: "";
    display: block;
    clear: both;
}

.text-primary {
    color: var(--primary);
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success);
}

.mt10 {
    margin-top: 10px;
}

.mt20 {
    margin-top: 20px;
}

.mb20 {
    margin-bottom: 20px;
}

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}

/* -------------------- 顶部 -------------------- */
.topbar {
    background: #2b2b2b;
    color: #bbb;
    font-size: 12px;
    line-height: 32px;
}

.topbar .container {
    display: flex;
    justify-content: space-between;
}

.topbar a:hover {
    color: #fff;
}

.header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-main {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    flex-shrink: 0;
}

.logo img {
    width: 42px;
    height: 42px;
}

.nav {
    display: flex;
    gap: 22px;
    font-size: 15px;
}

.nav a {
    color: #333;
    padding: 6px 2px;
    position: relative;
}

.nav a:hover,
.nav a.active {
    color: var(--primary);
}

.nav a.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -15px;
    height: 2px;
    background: var(--primary);
}

.header-search {
    flex: 1;
    display: flex;
    max-width: 380px;
    margin-left: auto;
}

.header-search input {
    flex: 1;
    height: 38px;
    border: 2px solid var(--primary);
    border-right: 0;
    border-radius: 20px 0 0 20px;
    padding: 0 16px;
    outline: none;
}

.header-search button {
    width: 72px;
    border: 0;
    background: var(--primary);
    color: #fff;
    border-radius: 0 20px 20px 0;
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    white-space: nowrap;
}

.header-actions .cart-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--primary);
}

.cart-badge {
    position: absolute;
    top: -10px;
    right: -12px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    line-height: 17px;
    text-align: center;
}

.mobile-menu-btn {
    display: none;
    border: 0;
    background: transparent;
    font-size: 22px;
    color: #333;
}

/* -------------------- 轮播 -------------------- */
.hero {
    margin-top: 18px;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    background: #ddd;
}

.hero-slide {
    display: none;
    position: relative;
}

.hero-slide.active {
    display: block;
}

.hero-slide img {
    width: 100%;
    height: 340px;
    object-fit: cover;
}

.hero-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 14px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.hero-dots span {
    width: 22px;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .55);
    cursor: pointer;
}

.hero-dots span.active {
    background: #fff;
}

/* -------------------- 公告 / 分类 -------------------- */
.notice-bar {
    margin-top: 16px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
    font-size: 13px;
}

.notice-bar .label {
    flex-shrink: 0;
    color: var(--primary);
    font-weight: 600;
}

.notice-bar .content {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-light);
}

.category-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
}

.category-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 18px 8px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
}

.category-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.category-item img {
    width: 48px;
    height: 48px;
    margin: 0 auto 8px;
}

.category-item span {
    font-size: 14px;
    color: #333;
}

/* -------------------- 区块标题 -------------------- */
.section {
    margin-top: 30px;
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    position: relative;
    padding-left: 14px;
}

.section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 4px;
    border-radius: 2px;
    background: var(--primary);
}

.section-title small {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 8px;
}

.section-more {
    color: var(--text-muted);
    font-size: 13px;
}

.section-more:hover {
    color: var(--primary);
}

/* -------------------- 商品卡片 -------------------- */
.goods-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.goods-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}

.goods-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.goods-thumb {
    position: relative;
    padding: 14px;
    background: #fafafa;
}

.goods-thumb img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    margin: 0 auto;
}

.goods-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
}

.goods-badge.gold {
    background: var(--gold);
}

.goods-body {
    padding: 12px 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.goods-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    height: 44px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 4px;
}

.goods-sub {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 8px;
}

.progress {
    height: 7px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: auto;
}

.progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #ff7a76);
    border-radius: 4px;
}

.goods-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.goods-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 18px;
}

.goods-price small {
    font-size: 12px;
    font-weight: 400;
}

.goods-price .origin {
    color: #bbb;
    font-size: 12px;
    text-decoration: line-through;
    margin-left: 6px;
    font-weight: 400;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 20px;
    border-radius: 20px;
    border: 1px solid transparent;
    font-size: 14px;
    background: var(--primary);
    color: #fff;
    transition: background .2s, color .2s, border-color .2s;
}

.btn:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: #fff;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
}

.btn-gray {
    background: #f1f1f1;
    color: #666;
}

.btn-gray:hover {
    background: #e6e6e6;
}

.btn-small {
    height: 32px;
    padding: 0 14px;
    font-size: 13px;
    border-radius: 16px;
}

.btn-block {
    width: 100%;
}

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

/* -------------------- 中奖 / 动态 -------------------- */
.winner-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.winner-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    gap: 12px;
    box-shadow: var(--shadow);
}

.winner-card img.avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    background: #f3f3f3;
}

.winner-card .info {
    flex: 1;
    min-width: 0;
}

.winner-card .name {
    font-weight: 600;
    font-size: 14px;
}

.winner-card .code {
    color: var(--primary);
    font-size: 13px;
    margin-top: 2px;
}

.winner-card .goods {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.winner-card .time {
    font-size: 12px;
    color: #bbb;
    margin-top: 4px;
}

.activity-list {
    background: var(--white);
    border-radius: var(--radius);
    padding: 6px 16px;
    box-shadow: var(--shadow);
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 13px;
}

.activity-item:last-child {
    border-bottom: 0;
}

.activity-item img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #f3f3f3;
}

.activity-item .name {
    color: var(--primary);
}

.activity-item .time {
    margin-left: auto;
    color: #bbb;
    font-size: 12px;
}

/* -------------------- 晒单 -------------------- */
.shaidan-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.shaidan-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.shaidan-card img.cover {
    width: 100%;
    height: 220px;
    object-fit: contain;
    background: #fafafa;
}

.shaidan-card .body {
    padding: 12px 14px;
}

.shaidan-card .title {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shaidan-card .desc {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
    height: 38px;
    overflow: hidden;
}

/* -------------------- 流程 / 页脚 -------------------- */
.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.step {
    text-align: center;
}

.step .num {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 18px;
}

.step p {
    margin: 0;
    font-size: 13px;
    color: var(--text-light);
}

.footer {
    margin-top: 40px;
    background: #222;
    color: #999;
    padding: 30px 0 20px;
    font-size: 13px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 24px;
}

.footer h4 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 14px;
}

.footer a {
    display: block;
    line-height: 2;
    color: #999;
}

.footer a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid #333;
    margin-top: 20px;
    padding-top: 16px;
    text-align: center;
    color: #777;
    font-size: 12px;
}

/* -------------------- 商品列表 -------------------- */
.page-banner {
    background: linear-gradient(120deg, #e4393c, #ff7a76);
    color: #fff;
    padding: 32px 0;
    margin-bottom: 20px;
}

.page-banner h1 {
    font-size: 26px;
}

.page-banner p {
    margin: 4px 0 0;
    opacity: .85;
    font-size: 13px;
}

.filter-bar {
    background: var(--white);
    border-radius: var(--radius);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}

.filter-bar .label {
    color: var(--text-muted);
    font-size: 13px;
}

.filter-bar a {
    padding: 5px 14px;
    border-radius: 16px;
    font-size: 13px;
    color: #555;
    background: #f5f5f5;
}

.filter-bar a.active,
.filter-bar a:hover {
    background: var(--primary);
    color: #fff;
}

/* -------------------- 商品详情 -------------------- */
.detail-wrap {
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 30px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.detail-gallery .main-img {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fafafa;
}

.detail-gallery .main-img img {
    width: 100%;
    height: 420px;
    object-fit: contain;
}

.detail-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.detail-thumbs img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border: 2px solid transparent;
    border-radius: 6px;
    background: #fafafa;
    cursor: pointer;
}

.detail-thumbs img.active {
    border-color: var(--primary);
}

.detail-info h1 {
    font-size: 24px;
    line-height: 1.4;
}

.detail-info .subtitle {
    color: var(--text-muted);
    margin-top: 6px;
    font-size: 13px;
}

.price-box {
    background: linear-gradient(120deg, #fff5f5, #fff);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 16px;
}

.price-box .price {
    color: var(--primary);
    font-size: 34px;
    font-weight: 700;
}

.price-box .price small {
    font-size: 14px;
    font-weight: 400;
}

.price-box .unit {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 2px;
}

.progress-box {
    margin-top: 16px;
}

.progress-box .progress {
    height: 10px;
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.progress-stats b {
    color: var(--primary);
}

.buy-box {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.qty-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.qty {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.qty button {
    width: 36px;
    height: 36px;
    border: 0;
    background: #f7f7f7;
    font-size: 18px;
    color: #555;
}

.qty input {
    width: 64px;
    height: 36px;
    border: 0;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    text-align: center;
    outline: none;
}

.qty-tip {
    font-size: 12px;
    color: var(--text-muted);
}

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

.buy-actions .btn {
    height: 48px;
    border-radius: 24px;
    flex: 1;
    font-size: 16px;
}

.detail-meta {
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 18px;
}

.winner-box {
    margin-top: 18px;
    background: #fffaf0;
    border: 1px solid #ffe8b3;
    border-radius: var(--radius);
    padding: 14px;
}

.winner-box .title {
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 6px;
}

.winner-box .row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.winner-box img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
}

.countdown-box {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    color: var(--primary);
    font-weight: 600;
}

.countdown-box span {
    background: var(--primary);
    color: #fff;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
}

.tabs {
    margin-top: 24px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.tab-head {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.tab-head button {
    flex: 1;
    border: 0;
    background: #fff;
    padding: 14px;
    font-size: 15px;
    color: #666;
    border-bottom: 2px solid transparent;
}

.tab-head button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-panel {
    display: none;
    padding: 20px;
}

.tab-panel.active {
    display: block;
}

.detail-content img {
    max-width: 100%;
}

.record-table,
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.record-table th,
.record-table td,
.data-table th,
.data-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 13px;
}

.record-table th,
.data-table th {
    color: var(--text-muted);
    font-weight: 500;
    background: #fafafa;
}

.record-table tr:last-child td,
.data-table tr:last-child td {
    border-bottom: 0;
}

.period-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.period-list a {
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 12px;
}

.period-list a.active,
.period-list a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* -------------------- 列表 / 分页 -------------------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    color: #555;
}

.pagination a:hover,
.pagination .active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

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

.empty img {
    width: 120px;
    margin: 0 auto 12px;
    opacity: .6;
}

/* -------------------- 表单 / 登录 -------------------- */
.auth-wrap {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--white);
    border-radius: 14px;
    padding: 32px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .08);
}

.auth-card h1 {
    font-size: 24px;
    margin-bottom: 6px;
}

.auth-card .sub {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 22px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
}

.form-group label .required {
    color: var(--primary);
}

.form-control {
    width: 100%;
    height: 42px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0 12px;
    outline: none;
    transition: border-color .2s;
    background: #fff;
}

.form-control:focus {
    border-color: var(--primary);
}

textarea.form-control {
    height: auto;
    min-height: 100px;
    padding: 10px 12px;
    resize: vertical;
}

select.form-control {
    appearance: auto;
}

.input-group {
    display: flex;
    gap: 8px;
}

.input-group .form-control {
    flex: 1;
}

.input-group .btn {
    height: 42px;
    border-radius: 8px;
    white-space: nowrap;
}

.captcha-img {
    height: 42px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #ddd;
}

.form-help {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
}

.auth-footer {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
}

/* -------------------- 会员中心 -------------------- */
.user-layout {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 20px;
    margin-top: 20px;
}

.user-sidebar {
    background: var(--white);
    border-radius: var(--radius);
    padding: 18px 0;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 86px;
}

.user-sidebar .user-brief {
    text-align: center;
    padding: 0 16px 16px;
    border-bottom: 1px solid var(--border);
}

.user-sidebar .user-brief img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 8px;
    background: #f3f3f3;
}

.user-sidebar .user-brief .name {
    font-weight: 600;
}

.user-sidebar .user-brief .balance {
    color: var(--primary);
    font-size: 13px;
    margin-top: 2px;
}

.user-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 20px;
    color: #555;
    font-size: 14px;
    border-left: 3px solid transparent;
}

.user-menu a:hover,
.user-menu a.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
}

.user-main {
    min-width: 0;
}

.panel {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.panel-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    font-weight: 600;
}

.panel-body {
    padding: 20px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card .num {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .label {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 2px;
}

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

.info-list .item {
    display: flex;
    font-size: 14px;
}

.info-list .item .label {
    width: 90px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.address-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 12px;
    position: relative;
}

.address-card.default {
    border-color: var(--primary);
    background: #fffafa;
}

.address-card .tag {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 0 var(--radius) 0 8px;
}

.address-card .name {
    font-weight: 600;
    margin-bottom: 4px;
}

.address-card .detail {
    color: var(--text-light);
    font-size: 13px;
}

.address-card .ops {
    margin-top: 10px;
    display: flex;
    gap: 12px;
    font-size: 12px;
}

.address-card .ops a {
    color: var(--primary);
}

.order-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 14px;
    overflow: hidden;
}

.order-card .head {
    background: #fafafa;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.order-card .body {
    display: flex;
    gap: 14px;
    padding: 14px;
    align-items: center;
}

.order-card .body img {
    width: 74px;
    height: 74px;
    object-fit: contain;
    background: #fafafa;
    border-radius: 6px;
}

.order-card .body .info {
    flex: 1;
    min-width: 0;
}

.order-card .body .title {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-card .body .meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.order-card .body .ops {
    display: flex;
    gap: 8px;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    background: #f2f2f2;
    color: #666;
}

.badge.red {
    background: var(--primary-light);
    color: var(--primary);
}

.badge.green {
    background: #e8f8ef;
    color: var(--success);
}

.badge.gold {
    background: #fff7e6;
    color: var(--gold);
}

.tabs-line {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.tabs-line a {
    padding: 6px 16px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--border);
    font-size: 13px;
    color: #555;
}

.tabs-line a.active,
.tabs-line a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.message-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.message-item:last-child {
    border-bottom: 0;
}

.message-item .title {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
}

.message-item .time {
    font-size: 12px;
    color: #bbb;
    font-weight: 400;
}

.message-item .content {
    color: var(--text-light);
    font-size: 13px;
    margin-top: 4px;
}

/* -------------------- 支付 -------------------- */
.pay-wrap {
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
}

.pay-card {
    width: 100%;
    max-width: 520px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .08);
    overflow: hidden;
}

.pay-card .head {
    background: linear-gradient(120deg, var(--primary), #ff7a76);
    color: #fff;
    padding: 26px;
    text-align: center;
}

.pay-card .head .amount {
    font-size: 34px;
    font-weight: 700;
}

.pay-card .head .amount small {
    font-size: 14px;
    font-weight: 400;
}

.pay-card .body {
    padding: 24px;
}

.pay-info {
    background: #fafafa;
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 18px;
    font-size: 13px;
}

.pay-info .row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    color: var(--text-light);
}

.pay-info .row b {
    color: var(--text);
}

.pay-actions {
    display: flex;
    gap: 10px;
}

.pay-actions .btn {
    flex: 1;
    height: 46px;
    border-radius: 23px;
}

.pay-tip {
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    margin-top: 12px;
}

/* -------------------- 提示页 -------------------- */
.message-page {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.message-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 100%;
}

.message-card .icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #fff;
}

.message-card .icon.success {
    background: var(--success);
}

.message-card .icon.error {
    background: var(--primary);
}

.message-card h2 {
    font-size: 20px;
    margin-bottom: 8px;
}

.message-card .msg {
    color: var(--text-light);
    margin-bottom: 20px;
}

/* -------------------- 移动端底部导航 -------------------- */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    background: #fff;
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-bottom-nav a {
    flex: 1;
    text-align: center;
    font-size: 11px;
    color: #777;
    padding: 7px 0 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    position: relative;
}

.mobile-bottom-nav a.active,
.mobile-bottom-nav a:hover {
    color: var(--primary);
}

.mobile-bottom-nav .icon {
    font-size: 19px;
    line-height: 1;
}

/* -------------------- 响应式 -------------------- */
@media (max-width: 1000px) {
    .goods-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .detail-wrap {
        grid-template-columns: 1fr;
    }

    .detail-gallery .main-img img {
        height: 360px;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .winner-grid,
    .shaidan-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .user-layout {
        grid-template-columns: 200px 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: 58px;
        font-size: 13px;
    }

    .container {
        padding: 0 12px;
    }

    .topbar {
        display: none;
    }

    .header-main {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 0;
    }

    .logo {
        font-size: 18px;
    }

    .logo img {
        width: 34px;
        height: 34px;
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav {
        display: none;
        width: 100%;
        flex-wrap: wrap;
        gap: 0;
        border-top: 1px solid var(--border);
        padding-top: 8px;
    }

    .nav.open {
        display: flex;
    }

    .nav a {
        width: 33.33%;
        text-align: center;
        padding: 8px 0;
        font-size: 13px;
    }

    .nav a.active::after {
        display: none;
    }

    .header-search {
        order: 3;
        width: 100%;
        max-width: none;
        margin: 0;
    }

    .header-search input {
        height: 36px;
        font-size: 13px;
    }

    .header-actions .hide-mobile {
        display: none;
    }

    .header-actions {
        margin-left: auto;
    }

    .hero {
        margin-top: 10px;
        border-radius: 8px;
    }

    .hero-slide img {
        height: 170px;
    }

    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-top: 12px;
    }

    .category-item {
        padding: 12px 4px;
        border-radius: 8px;
    }

    .category-item img {
        width: 36px;
        height: 36px;
        margin-bottom: 4px;
    }

    .category-item span {
        font-size: 12px;
    }

    .section {
        margin-top: 20px;
    }

    .section-title {
        font-size: 18px;
    }

    .section-title small {
        font-size: 11px;
    }

    .goods-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .goods-thumb {
        padding: 8px;
    }

    .goods-thumb img {
        height: 140px;
    }

    .goods-body {
        padding: 8px 10px 12px;
    }

    .goods-title {
        font-size: 13px;
        height: 40px;
    }

    .goods-price {
        font-size: 16px;
    }

    .goods-meta {
        font-size: 11px;
    }

    .winner-grid,
    .shaidan-grid {
        grid-template-columns: 1fr;
    }

    .steps {
        grid-template-columns: repeat(2, 1fr);
        padding: 16px;
        gap: 14px;
    }

    .detail-wrap {
        padding: 12px;
        gap: 16px;
    }

    .detail-gallery .main-img img {
        height: 280px;
    }

    .detail-info h1 {
        font-size: 19px;
    }

    .price-box {
        padding: 12px;
    }

    .price-box .price {
        font-size: 28px;
    }

    .buy-actions .btn {
        height: 44px;
        font-size: 15px;
    }

    .tab-head {
        overflow-x: auto;
    }

    .tab-head button {
        white-space: nowrap;
        padding: 12px 16px;
        flex: none;
    }

    .tab-panel {
        padding: 14px;
    }

    .record-table,
    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .footer {
        padding-bottom: 20px;
    }

    .user-layout {
        display: block;
        margin-top: 10px;
    }

    .user-sidebar {
        position: static;
        margin-bottom: 12px;
        padding: 12px 0;
    }

    .user-sidebar .user-brief {
        display: flex;
        align-items: center;
        gap: 12px;
        text-align: left;
        padding: 0 14px 12px;
    }

    .user-sidebar .user-brief img {
        width: 54px;
        height: 54px;
        margin: 0;
    }

    .user-menu {
        display: flex;
        overflow-x: auto;
        padding: 8px 6px 0;
    }

    .user-menu a {
        flex: none;
        padding: 6px 12px;
        border-left: 0;
        border-bottom: 2px solid transparent;
        font-size: 13px;
        white-space: nowrap;
    }

    .user-menu a.active {
        border-left: 0;
        border-bottom-color: var(--primary);
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-card .num {
        font-size: 20px;
    }

    .info-list {
        grid-template-columns: 1fr;
    }

    .order-card .body {
        padding: 10px;
    }

    .order-card .body img {
        width: 60px;
        height: 60px;
    }

    .order-card .body .ops {
        flex-direction: column;
    }

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

    .mobile-bottom-nav {
        display: flex;
    }

    .panel-head {
        padding: 12px 14px;
        font-size: 15px;
    }

    .panel-body {
        padding: 14px;
    }

    .address-card {
        padding: 12px;
    }

    .pay-card .head {
        padding: 20px;
    }

    .pay-card .body {
        padding: 18px;
    }

    .pay-actions {
        flex-direction: column;
    }

    .filter-bar {
        padding: 10px 12px;
        gap: 8px;
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .filter-bar a {
        white-space: nowrap;
    }
}
