/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    color: #212121;
    background: #F5F5F5;
    overflow-x: hidden;
}

a {
    color: #2D5F3F;
    text-decoration: none;
}

input, button {
    border: none;
    outline: none;
    font-family: inherit;
    font-size: inherit;
}

button {
    cursor: pointer;
}

/* ========== 应用容器（移动端居中） ========== */
#app {
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    min-height: 100vh;
    background: #F5F5F5;
    overflow-x: hidden;
}

/* ========== 页面切换 ========== */
.page {
    display: none;
    min-height: 100vh;
    padding-bottom: 60px;
    background: #F5F5F5;
}

.page.active {
    display: block;
}

/* ========== Toast ========== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    max-width: 260px;
    text-align: center;
}

.toast.show {
    opacity: 1;
}

/* ========== 首页 ========== */
.home-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.search-bar {
    flex: 1;
    display: flex;
    align-items: center;
    background: #F5F5F5;
    border-radius: 20px;
    padding: 7px 12px;
    gap: 6px;
}

.search-icon {
    flex-shrink: 0;
}

.search-bar input {
    flex: 1;
    background: none;
    font-size: 13px;
    color: #212121;
}

.search-bar input::placeholder {
    color: #999;
}

/* ========== Banner轮播 ========== */
.banner-wrapper {
    position: relative;
    overflow: hidden;
    background: #ddd;
}

.banner-track {
    display: flex;
    transition: transform 0.4s ease;
}

.banner-slide {
    min-width: 100%;
    flex-shrink: 0;
}

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

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
}

.dot.active {
    background: #fff;
}

/* ========== 公告栏 ========== */
.notice-bar {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    margin-top: 1px;
    gap: 8px;
}

.notice-tag {
    flex-shrink: 0;
    background: linear-gradient(135deg, #8B6914, #D4A943);
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
}

.notice-scroll {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    font-size: 13px;
    color: #757575;
}

/* ========== 商品推荐标题 ========== */
.section-title {
    display: flex;
    align-items: center;
    padding: 15px 12px 10px;
    gap: 8px;
}

.title-bar {
    width: 4px;
    height: 16px;
    background: linear-gradient(180deg, #8B6914, #D4A943);
    border-radius: 2px;
}

.title-text {
    font-size: 16px;
    font-weight: bold;
    color: #212121;
}

/* ========== 商品网格 ========== */
.goods-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 8px 15px;
}

.goods-empty-tip {
    grid-column: 1 / -1;
    text-align: center;
    color: #999;
    font-size: 14px;
    padding: 40px 0;
}

.goods-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.goods-card:active {
    opacity: 0.9;
}

.goods-img {
    width: 100%;
    height: 0;
    padding-bottom: 75%;
    background: #f0ebe0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.goods-img span {
    color: #999;
    font-size: 13px;
}

.goods-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.goods-name {
    padding: 8px 10px 2px;
    font-size: 13px;
    color: #212121;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.goods-price {
    padding: 4px 10px 10px;
    font-size: 16px;
    color: #E53935;
    font-weight: bold;
}

.goods-price .yen {
    font-size: 12px;
    margin-right: 1px;
}

/* ========== 抢购页 ========== */
.rush-carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f5f5f5;
}

.rush-carousel-track {
    display: flex;
    transition: transform 0.35s ease;
}

.rush-carousel-slide {
    min-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    padding-bottom: 12px;
}

.rush-carousel-slide .rc-img {
    width: 100%;
    height: 260px;
    background: #f0ebe0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.rush-carousel-slide .rc-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rush-carousel-slide .rc-name {
    margin-top: 10px;
    font-size: 15px;
    color: #333;
    padding: 0 15px;
    text-align: center;
}

.rush-carousel-slide .rc-price {
    margin-top: 6px;
    font-size: 18px;
    color: #E53935;
    font-weight: bold;
}

.rush-carousel-slide .rc-btn {
    margin-top: 10px;
    padding: 8px 32px;
    background: linear-gradient(135deg, #E53935, #FF5722);
    color: #fff;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

.rush-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 8px 0;
    background: #fff;
}

.rush-carousel-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    transition: all 0.3s;
}

.rush-carousel-dots .dot.active {
    width: 14px;
    background: #E53935;
}

.rush-notice {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
    margin-top: 1px;
    gap: 8px;
    font-size: 14px;
    color: #333;
}

.rush-session-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #333;
    color: #fff;
    margin: 12px 16px;
    padding: 20px 22px;
    border-radius: 14px;
    cursor: default;
    transition: transform 0.2s, box-shadow 0.2s;
}

.rush-session-card.clickable {
    cursor: pointer;
    background: linear-gradient(135deg, #333, #444);
}

.rush-session-card.clickable:active {
    transform: scale(0.98);
}

.session-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.session-label {
    font-size: 18px;
    font-weight: bold;
}

.session-time {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.session-status {
    font-size: 14px;
    background: #E53935;
    padding: 6px 14px;
    border-radius: 14px;
    font-weight: bold;
    white-space: nowrap;
}

/* ========== 购物车页 ========== */
.page-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 16px;
    background: #fff;
}

.page-top-title {
    font-size: 17px;
    font-weight: bold;
    color: #212121;
}

.edit-btn {
    font-size: 14px;
    color: #757575;
    cursor: pointer;
}

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 80px;
}

.empty-text {
    margin-top: 15px;
    font-size: 15px;
    color: #757575;
}

.empty-btns {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.empty-btn {
    padding: 8px 22px;
    border-radius: 20px;
    font-size: 13px;
    background: #fff;
    color: #2D5F3F;
    border: 1px solid #2D5F3F;
}

.empty-btn:active {
    background: #f5f5f5;
}

/* 购物车列表 */
.cart-list {
    padding: 0 0 100px;
}

.cart-item {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 12px;
    margin-bottom: 1px;
    gap: 10px;
}

.cart-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: #2D5F3F;
}

.cart-item-img {
    width: 70px;
    height: 70px;
    border-radius: 6px;
    background: #f0ebe0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 13px;
    color: #212121;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.cart-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.cart-item-price {
    font-size: 15px;
    color: #E53935;
    font-weight: bold;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-item-qty button {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #F5F5F5;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-qty span {
    font-size: 14px;
    min-width: 20px;
    text-align: center;
}

/* 购物车底部栏 */
.cart-bottom-bar {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 480px;
    width: 100%;
    display: flex;
    align-items: center;
    background: #fff;
    padding: 10px 12px;
    border-top: 1px solid #E0E0E0;
    z-index: 200;
}

.select-all {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
}

.select-all input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2D5F3F;
}

.cart-total {
    flex: 1;
    text-align: right;
    font-size: 14px;
    color: #333;
    margin-right: 10px;
}

.price-color {
    color: #E53935;
    font-weight: bold;
}

.checkout-btn {
    background: #2D5F3F;
    color: #fff;
    padding: 10px 22px;
    border-radius: 22px;
    font-size: 14px;
    font-weight: bold;
}

.checkout-btn:active {
    background: #1B5E20;
}

/* ========== 我的页面 ========== */
.me-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #fff;
}

.me-search {
    display: flex;
    align-items: center;
    flex: 1;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 8px 14px;
    margin-right: 12px;
}

.me-search-icon {
    margin-right: 6px;
}

.me-search-text {
    font-size: 14px;
    color: #999;
}

.me-top-actions {
    display: flex;
    align-items: center;
}

.me-white-bg {
    background: #fff;
    padding: 0 16px 20px;
}

.me-header-new {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 28px;
    cursor: pointer;
}

.avatar-new {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    font-weight: bold;
}

.user-info-new {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.username-new {
    font-size: 17px;
    font-weight: bold;
    color: #333;
}

.phone-new {
    font-size: 13px;
    color: #999;
}

.me-header-right {
    display: flex;
    align-items: center;
}

.asset-card-new {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.asset-item-new {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.asset-label-new {
    font-size: 13px;
    color: #999;
}

.asset-value-new {
    font-size: 22px;
    font-weight: bold;
    color: #E53935;
}

.asset-divider-new {
    width: 1px;
    height: 30px;
    background: #eee;
}

.me-bottom-text {
    text-align: center;
    padding: 30px 0 20px;
    font-size: 13px;
    color: #ccc;
}

/* ========== 邀请二维码页面 ========== */
.invite-qr-page {
    padding: 15px;
    display: flex;
    justify-content: center;
}

.invite-qr-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px 20px;
    width: 100%;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.invite-qr-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.invite-qr-subtitle {
    font-size: 13px;
    color: #999;
    margin-bottom: 20px;
}

.invite-qr-img-box {
    display: flex;
    justify-content: center;
    margin: 0 auto 20px;
    width: 200px;
    height: 200px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}

.invite-qr-img-box canvas {
    width: 200px !important;
    height: 200px !important;
}

.invite-code-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
}

.invite-code-label {
    font-size: 14px;
    color: #666;
}

.invite-code-value {
    font-size: 20px;
    font-weight: bold;
    color: #2D5F3F;
    letter-spacing: 3px;
}

.invite-link-row {
    margin-bottom: 15px;
}

.invite-link-row input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    color: #666;
    background: #f9f9f9;
    text-align: center;
}

.invite-btn-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.invite-btn {
    flex: 0 0 auto;
    padding: 9px 20px;
    border: 1px solid #2D5F3F;
    border-radius: 20px;
    background: #fff;
    color: #2D5F3F;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
}

.invite-btn-primary {
    background: linear-gradient(135deg, #2D5F3F, #4CAF50);
    color: #fff;
    border: none;
}

.invite-desc {
    text-align: left;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.invite-desc p {
    font-size: 12px;
    color: #888;
    line-height: 1.8;
}

/* ========== 仓库标签切换 ========== */
.warehouse-tabs {
    display: flex;
    background: #fff;
    margin: 10px 12px 0;
    border-radius: 8px;
    overflow: hidden;
}

.wh-tab {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.wh-tab.active {
    color: #2D5F3F;
    font-weight: bold;
    border-bottom: 2px solid #2D5F3F;
}

/* ========== 通用表单样式 ========== */
.form-card {
    background: #fff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
}

.form-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.form-item:last-child {
    border-bottom: none;
}

.form-item label {
    width: 80px;
    font-size: 14px;
    color: #333;
    flex-shrink: 0;
}

.form-item input,
.form-item select {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: #333;
    text-align: right;
    background: transparent;
}

.form-item input::placeholder {
    color: #bbb;
}

/* 三级页面主按钮：统一为居中胶囊按钮，不再整行拉满 */
.btn-primary,
.form-submit-btn {
    display: inline-block;
    padding: 10px 26px;
    background: linear-gradient(135deg, #2D5F3F, #4CAF50);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
}

.btn-primary:active,
.form-submit-btn:active {
    opacity: 0.85;
}

.form-submit-btn.btn-cancel {
    background: #999;
}

/* 添加类按钮容器（居中、不拉满） */
.form-btn-wrap {
    display: flex;
    justify-content: center;
    padding: 15px;
}

/* 表单按钮行：取消/保存居中排列 */
.form-btn-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
}

/* ========== 地址列表 ========== */
.addr-card {
    background: #fff;
    margin: 10px 12px;
    border-radius: 10px;
    padding: 15px;
    position: relative;
}

.addr-card .addr-name {
    font-size: 15px;
    font-weight: bold;
    color: #333;
}

.addr-card .addr-phone {
    font-size: 13px;
    color: #999;
    margin-left: 12px;
}

.addr-card .addr-text {
    margin-top: 6px;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.addr-card .addr-default {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 11px;
    color: #E53935;
    border: 1px solid #E53935;
    padding: 1px 6px;
    border-radius: 3px;
}

.addr-card .addr-actions {
    margin-top: 10px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.addr-card .addr-actions span {
    font-size: 12px;
    color: #2D5F3F;
    cursor: pointer;
}

/* ========== 收款卡片 ========== */
.pay-card {
    background: #fff;
    margin: 10px 12px;
    border-radius: 10px;
    padding: 15px;
}

.pay-card .pay-type-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.pay-card .pay-type-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.pay-card .pay-type-name {
    font-size: 15px;
    font-weight: bold;
    color: #333;
}

.pay-card .pay-account {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.pay-card .pay-name {
    font-size: 13px;
    color: #999;
}

.pay-card .pay-actions {
    margin-top: 10px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.pay-card .pay-actions span {
    font-size: 12px;
    color: #2D5F3F;
    cursor: pointer;
}

/* 旧样式兼容隐藏 */
.me-bg, .me-header, .avatar, .user-info, .username, .phone, .asset-card, .asset-item, .asset-label, .asset-value, .asset-divider {
    display: none;
}

/* 订单卡片 */
.order-card-new {
    background: linear-gradient(135deg, #2E7D32, #1B5E20);
    margin: 10px 12px;
    border-radius: 10px;
    padding: 15px;
}

.order-icons-new {
    display: flex;
    justify-content: space-around;
    padding-top: 5px;
}

.order-icon-item-new {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.order-icon-item-new span {
    color: #fff;
    font-size: 11px;
}

/* 功能区 */
.func-group {
    background: #fff;
    margin: 10px 12px;
    border-radius: 10px;
    padding: 12px;
}

.func-group-title {
    font-size: 14px;
    font-weight: bold;
    color: #212121;
    margin-bottom: 12px;
    padding-left: 4px;
}

.func-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 8px;
}

.func-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 0;
    cursor: pointer;
}

.func-item svg {
    width: 40px;
    height: 40px;
    padding: 8px;
    border-radius: 50%;
    background: #E8F5E9;
}

.func-item.seller-item svg {
    background: #E3F2FD;
}

.func-item span {
    font-size: 12px;
    color: #333;
}

/* 功能列表 */
.func-list {
    background: #fff;
    margin: 10px 12px;
    border-radius: 10px;
    overflow: hidden;
    padding-bottom: 15px;
}

.func-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #F5F5F5;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.func-list-item:last-child {
    border-bottom: none;
}

.func-list-item:active {
    background: #fafafa;
}

/* ========== 登录页 ========== */
#pageLogin {
    background: #fff;
}

.login-container {
    padding: 50px 24px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-logo {
    margin-bottom: 10px;
}

.login-brand {
    font-size: 20px;
    font-weight: bold;
    color: #2D5F3F;
    margin-bottom: 30px;
}

.login-form {
    width: 100%;
}

.input-group {
    display: flex;
    align-items: center;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    padding: 0 14px;
    margin-bottom: 14px;
    height: 48px;
    position: relative;
}

.input-label {
    flex-shrink: 0;
    font-size: 14px;
    color: #333;
    margin-right: 10px;
    width: 50px;
}

.input-group input {
    flex: 1;
    font-size: 14px;
    color: #212121;
    background: none;
}

.input-group input::placeholder {
    color: #bbb;
}

.eye-icon {
    flex-shrink: 0;
    cursor: pointer;
    margin-left: 6px;
}

.login-btn {
    width: 100%;
    height: 48px;
    background: #2D5F3F;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    border-radius: 24px;
    margin-top: 6px;
}

.login-btn:active {
    background: #1B5E20;
}

.login-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    font-size: 13px;
    color: #2D5F3F;
    cursor: pointer;
}

.login-agreement {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 20px;
    font-size: 12px;
    color: #757575;
}

.login-agreement input[type="checkbox"] {
    margin-top: 2px;
    accent-color: #2D5F3F;
}

.login-agreement a {
    color: #2D5F3F;
}

/* ========== 注册页 ========== */
.register-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    gap: 12px;
}

.register-header svg {
    cursor: pointer;
}

.register-title {
    font-size: 17px;
    font-weight: bold;
    color: #212121;
}

.register-container {
    padding: 20px 24px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
}

.register-form {
    width: 100%;
}

.prefix-group {
    padding-left: 0;
}

.phone-prefix {
    flex-shrink: 0;
    font-size: 14px;
    color: #333;
    padding: 0 12px;
    border-right: 1px solid #E0E0E0;
    margin-right: 10px;
    height: 30px;
    display: flex;
    align-items: center;
}

.code-group {
    padding-right: 0;
}

.code-group input {
    flex: 1;
}

.code-btn {
    flex-shrink: 0;
    background: #2D5F3F;
    color: #fff;
    font-size: 12px;
    padding: 0 12px;
    height: 36px;
    border-radius: 0 8px 8px 0;
    white-space: nowrap;
}

.code-btn:active {
    background: #1B5E20;
}

.code-btn.disabled {
    background: #999;
}

/* ========== 商品详情页 ========== */
.detail-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.detail-header svg {
    cursor: pointer;
}

.detail-title {
    font-size: 17px;
    font-weight: bold;
    color: #212121;
}

.detail-img-wrapper {
    background: #f0ebe0;
}

.detail-main-img {
    width: 100%;
}

.detail-info {
    background: #fff;
    padding: 15px;
    margin-top: 1px;
}

.detail-model {
    font-size: 15px;
    color: #2D5F3F;
    font-weight: bold;
    margin-bottom: 8px;
}

.detail-price {
    font-size: 24px;
    color: #E53935;
    font-weight: bold;
}

.price-symbol {
    font-size: 14px;
    margin-right: 2px;
}

.detail-sold {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}

.detail-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 14px 15px;
    margin-top: 1px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.detail-entry:active {
    background: #fafafa;
}

/* 详情底部 */
.detail-bottom {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 480px;
    width: 100%;
    display: flex;
    align-items: center;
    background: #fff;
    padding: 10px 12px;
    border-top: 1px solid #E0E0E0;
    z-index: 200;
}

.detail-qty {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #333;
}

.qty-control {
    display: flex;
    align-items: center;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #F5F5F5;
    font-size: 16px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-input {
    width: 36px;
    height: 28px;
    text-align: center;
    font-size: 14px;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    margin: 0 4px;
    background: #fff;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.buy-btn {
    margin-left: auto;
    background: #2D5F3F;
    color: #fff;
    padding: 10px 28px;
    border-radius: 22px;
    font-size: 15px;
    font-weight: bold;
}

.buy-btn:active {
    background: #1B5E20;
}

/* ========== 三级页面公共导航栏（参考推荐关系页） ========== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #fff;
}

.page-header svg {
    display: block;
    cursor: pointer;
}

.page-header-title {
    font-size: 17px;
    font-weight: bold;
    color: #212121;
}

/* ========== 空状态 ========== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 80px;
    color: #999;
    font-size: 15px;
}

/* ========== 设置页面 ========== */
.settings-list {
    background: #fff;
    margin: 10px 12px;
    border-radius: 10px;
    overflow: hidden;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #F5F5F5;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item:active {
    background: #fafafa;
}

/* ========== 底部TabBar ========== */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 480px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: #fff;
    height: 50px;
    border-top: 1px solid #E0E0E0;
    z-index: 500;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
    padding: 4px 0;
}

.tab-item.active {
    color: #8B6914;
}

.tab-icon {
    display: block;
}

.tab-item span {
    font-size: 10px;
}

/* ========== 工具类 ========== */
.no-tabbar {
    display: none !important;
}

/* 当子页面显示时隐藏tabbar */
#pageLogin.active ~ .tabbar,
#pageRegister.active ~ .tabbar,
#pageDetail.active ~ .tabbar,
#pageOrders.active ~ .tabbar,
#pageWarehouse.active ~ .tabbar,
#pagePayConfirm.active ~ .tabbar,
#pageReceive.active ~ .tabbar,
#pageCompleted.active ~ .tabbar,
#pageMyGoods.active ~ .tabbar,
#pageMySales.active ~ .tabbar,
#pageEarnings.active ~ .tabbar,
#pageWithdraw.active ~ .tabbar,
#pageAddress.active ~ .tabbar,
#pageCoupon.active ~ .tabbar,
#pageReferral.active ~ .tabbar,
#pageReferralTree.active ~ .tabbar,
#pagePayment.active ~ .tabbar,
#pageInviteQR.active ~ .tabbar,
#pageFav.active ~ .tabbar,
#pageReview.active ~ .tabbar,
#pageSettings.active ~ .tabbar {
    display: none !important;
}

/* ========== 滚动条美化 ========== */
::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* ========== 推荐关系（树状图） ========== */
#pageReferralTree {
    height: 100vh;
    padding-bottom: 0;
    overflow: hidden;
    background: #F5F5F5;
}

#pageReferralTree.active {
    display: flex;
    flex-direction: column;
}

.rt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #fff;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.rt-header-title {
    font-size: 17px;
    font-weight: bold;
    color: #212121;
}

.rt-header svg {
    display: block;
    cursor: pointer;
}

.rt-header-icon {
    display: flex;
    align-items: center;
}

.rt-stats {
    display: flex;
    gap: 8px;
    padding: 0 16px 14px;
    background: #fff;
    flex-shrink: 0;
}

.rt-stat {
    flex: 1;
    text-align: center;
    background: #F4F7F4;
    border-radius: 10px;
    padding: 9px 4px;
}

.rt-stat-num {
    font-size: 19px;
    font-weight: bold;
    color: #2D5F3F;
    line-height: 1.2;
}

.rt-stat-label {
    font-size: 11px;
    color: #999;
    margin-top: 3px;
}

.rt-hint {
    flex-shrink: 0;
    padding: 9px 16px;
    font-size: 11px;
    color: #999;
    background: #fff;
    border-top: 1px solid #F5F5F5;
    text-align: center;
}

/* 滚动容器：上下左右均可滑动 */
.rt-scroll {
    flex: 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.rt-scroll::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.rt-scroll::-webkit-scrollbar-thumb {
    background: rgba(45, 95, 63, 0.3);
    border-radius: 3px;
}

.rt-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.rt-canvas {
    display: inline-block;
    min-width: 100%;
    box-sizing: border-box;
    vertical-align: top;
    padding: 16px 14px 40px;
}

.rt-empty {
    padding: 60px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* ---------- 树结构 ---------- */
.rt-tree,
.rt-tree ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.rt-tree {
    display: flex;
    justify-content: center;
    min-width: 100%;
    box-sizing: border-box;
}

.rt-tree ul {
    display: flex;
    justify-content: center;
    padding-top: 20px;
    position: relative;
}

.rt-tree li {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 20px 7px 0;
}

.rt-tree > li {
    padding-top: 0;
}

/* 独生子女节点：紧贴上级连线，避免出现断裂 */
.rt-tree li:only-child {
    padding-top: 0;
}

/* 连接线 */
.rt-tree li::before,
.rt-tree li::after {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    width: 50%;
    height: 20px;
    border-top: 2px solid #D6DDD7;
}

.rt-tree li::after {
    right: auto;
    left: 50%;
    border-left: 2px solid #D6DDD7;
}

.rt-tree > li::before,
.rt-tree > li::after,
.rt-tree li:only-child::before,
.rt-tree li:only-child::after {
    display: none;
}

.rt-tree li:first-child::before,
.rt-tree li:last-child::after {
    border: 0 none;
}

.rt-tree li:last-child::before {
    border-right: 2px solid #D6DDD7;
    border-radius: 0 6px 0 0;
}

.rt-tree li:first-child::after {
    border-radius: 6px 0 0 0;
}

.rt-tree ul ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 20px;
    border-left: 2px solid #D6DDD7;
}

/* ---------- 节点卡片 ---------- */
.rt-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 74px;
    padding: 8px 4px 6px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid transparent;
    line-height: 1.3;
}

.rt-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: bold;
    color: #fff;
    background: #8FC6A5;
}

.rt-name {
    margin-top: 5px;
    font-size: 12px;
    color: #333;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rt-tag {
    margin-top: 4px;
    font-size: 10px;
    color: #6E8C79;
    background: #EEF4EF;
    border-radius: 8px;
    padding: 1px 7px;
}

.rt-date {
    margin-top: 3px;
    font-size: 9px;
    color: #bbb;
}

/* 各层级配色 */
.rt-node.rt-root {
    border-color: #2D5F3F;
    background: #2D5F3F;
}

.rt-node.rt-root .rt-avatar {
    background: rgba(255, 255, 255, 0.25);
}

.rt-node.rt-root .rt-name,
.rt-node.rt-root .rt-tag,
.rt-node.rt-root .rt-date {
    color: #fff;
}

.rt-node.rt-root .rt-tag {
    background: rgba(255, 255, 255, 0.22);
}

.rt-node.rt-lv1 {
    border-color: #BFDCC8;
}

.rt-node.rt-lv1 .rt-avatar {
    background: #399359;
}

.rt-node.rt-lv2 {
    border-color: #D9E9DE;
}

.rt-node.rt-lv2 .rt-avatar {
    background: #5FB07C;
}

.rt-node.rt-lv3 {
    border-color: #E6EFE9;
}

.rt-node.rt-lv3 .rt-avatar {
    background: #8FC6A5;
}

.rt-more {
    margin-top: 4px;
    font-size: 10px;
    color: #aaa;
    white-space: nowrap;
}
