:root {
    --lottery-primary: #e74c3c;
    --lottery-bg: #f5f6f8;
    --lottery-text: #222;
    --lottery-muted: #888;
    --lottery-card: #fff;
    --lottery-radius: 10px;
    --lottery-tab-h: 54px;
    --lottery-max: 480px;
}

* { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    background: #111;
    color: var(--lottery-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
a { color: inherit; text-decoration: none; }
a:hover, a:focus { text-decoration: none; color: inherit; }

.lottery-app {
    max-width: var(--lottery-max);
    margin: 0 auto;
    min-height: 100vh;
    background: var(--lottery-bg);
    position: relative;
    padding-bottom: calc(var(--lottery-tab-h) + 12px);
}

/* 顶部 */
.lottery-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.lottery-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f0f0f0;
}
.lottery-logo-text {
    font-size: 15px;
    font-weight: 700;
    color: var(--lottery-primary);
    white-space: nowrap;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lottery-search {
    flex: 1;
    display: flex;
    align-items: center;
    background: #f2f3f5;
    border-radius: 20px;
    padding: 0 12px;
    height: 34px;
}
.lottery-search input {
    border: 0;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 13px;
    height: 34px;
}
.lottery-search .fa { color: #999; margin-right: 6px; }

/* 轮播 */
.lottery-banner {
    margin: 10px 12px 0;
    border-radius: var(--lottery-radius);
    overflow: hidden;
    background: #ddd;
}
.lottery-banner .carousel-inner > .item > img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.lottery-banner .carousel-indicators { bottom: 4px; }
.lottery-banner .carousel-indicators li {
    width: 6px;
    height: 6px;
    margin: 0 3px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
}
.lottery-banner .carousel-indicators .active {
    width: 6px;
    height: 6px;
    margin: 0 3px;
    background: #fff;
}

/* Tab */
.lottery-tabs {
    display: flex;
    margin: 14px 12px 8px;
    background: #fff;
    border-radius: var(--lottery-radius);
    overflow: hidden;
}
.lottery-tabs a {
    flex: 1;
    text-align: center;
    padding: 11px 0;
    font-size: 14px;
    color: var(--lottery-muted);
    position: relative;
}
.lottery-tabs a.active {
    color: var(--lottery-primary);
    font-weight: 600;
}
.lottery-tabs a.active:after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 4px;
    width: 18px;
    height: 3px;
    margin-left: -9px;
    border-radius: 2px;
    background: var(--lottery-primary);
}

/* 商品网格 */
.lottery-goods {
    display: flex;
    flex-wrap: wrap;
    padding: 0 8px 8px;
}
.goods-card {
    width: 50%;
    padding: 4px;
}
.goods-card-inner {
    background: var(--lottery-card);
    border-radius: var(--lottery-radius);
    overflow: hidden;
    height: 100%;
}
.goods-card-inner .thumb {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: #f0f0f0;
    display: block;
}
.goods-card-inner .info {
    padding: 8px 10px 12px;
}
.goods-card-inner .name {
    font-size: 13px;
    line-height: 1.35;
    height: 36px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 0 0 6px;
}
.goods-card-inner .price {
    color: var(--lottery-primary);
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 6px;
}
.goods-card-inner .price small {
    font-size: 11px;
    font-weight: 400;
    color: var(--lottery-muted);
    margin-left: 4px;
}
.goods-progress {
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}
.goods-progress > i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #ff8a65, var(--lottery-primary));
}
.goods-meta {
    font-size: 11px;
    color: var(--lottery-muted);
}

.lottery-empty {
    width: 100%;
    text-align: center;
    padding: 48px 16px;
    color: var(--lottery-muted);
    font-size: 14px;
}

/* 底部菜单 */
.lottery-tabbar {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--lottery-max);
    height: var(--lottery-tab-h);
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom);
}
.lottery-tabbar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #999;
}
.lottery-tabbar a i {
    font-size: 18px;
    margin-bottom: 2px;
}
.lottery-tabbar a.active {
    color: var(--lottery-primary);
}

/* 内页通用 */
.lottery-page-title {
    background: #fff;
    text-align: center;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #f0f0f0;
}
.lottery-panel {
    margin: 12px;
    background: #fff;
    border-radius: var(--lottery-radius);
    padding: 16px;
}
.lottery-panel .row-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
}
.lottery-panel .row-item:last-child { border-bottom: 0; }
.lottery-panel .row-item .muted { color: var(--lottery-muted); }
.win-record-item {
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 10px;
    margin-bottom: 4px;
}
.win-record-item:last-child { border-bottom: 0; margin-bottom: 0; }
.win-buyback-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 0 4px;
}
.btn-buyback {
    border: 0;
    background: var(--lottery-primary);
    color: #fff;
    border-radius: 16px;
    padding: 6px 14px;
    font-size: 12px;
    white-space: nowrap;
}
.btn-buyback:disabled { opacity: 0.6; }
.btn-lottery {
    display: block;
    width: 100%;
    background: var(--lottery-primary);
    color: #fff !important;
    border: 0;
    border-radius: 22px;
    padding: 11px;
    text-align: center;
    font-size: 15px;
    margin-top: 12px;
}
.wallet-balance {
    text-align: center;
    padding: 28px 16px;
}
.wallet-balance .num {
    font-size: 36px;
    font-weight: 700;
    color: var(--lottery-primary);
}
.wallet-balance .label {
    color: var(--lottery-muted);
    font-size: 13px;
    margin-top: 4px;
}

/* 中奖弹窗 */
.win-mask {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.win-dialog {
    width: 100%;
    max-width: 320px;
    background: #fff;
    border-radius: 14px;
    padding: 22px 18px 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,.2);
    animation: winPop .25s ease;
}
@keyframes winPop {
    from { transform: scale(.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.win-dialog-title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--lottery-primary);
    margin-bottom: 12px;
}
.win-dialog-body {
    font-size: 14px;
    line-height: 1.7;
    color: #444;
    text-align: center;
    white-space: pre-wrap;
    margin-bottom: 18px;
}
.win-dialog-actions { margin-top: 4px; }

/* 详情：已参与 / 总需 / 剩余 */
.share-stats {
    display: flex;
    margin-top: 14px;
    padding: 12px 0;
    border-top: 1px solid #f5f5f5;
    border-bottom: 1px solid #f5f5f5;
}
.share-stat {
    flex: 1;
    text-align: center;
}
.share-stat .num {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}
.share-stat .num.remain {
    color: var(--lottery-primary);
}
.share-stat .label {
    font-size: 11px;
    color: var(--lottery-muted);
    margin-top: 4px;
}
.join-record-link {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: #666;
}
.period-join-item {
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}
.period-join-item:last-child { border-bottom: 0; }
.period-join-head {
    display: flex;
    align-items: center;
    gap: 10px;
}
.period-join-head img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: #eee;
    flex-shrink: 0;
}
.period-join-info {
    flex: 1;
    min-width: 0;
}
.period-join-info .name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.period-join-codes {
    margin-top: 10px;
    padding: 10px;
    background: #fafafa;
    border-radius: 8px;
}

/* 详情：快捷份数 + 描边按钮 */
.share-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.share-quick button {
    min-width: 44px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 17px;
    background: #fff;
    color: #666;
    font-size: 13px;
}
.share-quick button.active,
.share-quick button:active {
    border-color: var(--lottery-primary);
    color: var(--lottery-primary);
    background: rgba(231, 76, 60, .06);
}
.share-quick button.all {
    min-width: auto;
    padding: 0 14px;
    font-weight: 600;
}
.join-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}
.join-actions .btn-lottery,
.join-actions .btn-lottery-outline {
    flex: 1;
    margin-top: 0;
}
.btn-lottery-outline {
    display: block;
    width: 100%;
    background: #fff;
    color: var(--lottery-primary) !important;
    border: 1px solid var(--lottery-primary);
    border-radius: 22px;
    padding: 10px;
    text-align: center;
    font-size: 15px;
    margin-top: 12px;
}

/* 首页公告滚动 */
.home-notice {
    display: flex;
    align-items: center;
    margin: 10px 12px 0;
    padding: 8px 12px;
    background: #fff7e6;
    border-radius: 8px;
    overflow: hidden;
}
.home-notice .notice-tag {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #f0a020;
    border-radius: 4px;
    padding: 2px 6px;
    margin-right: 10px;
}
.home-notice .notice-marquee {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}
.home-notice .notice-track {
    display: inline-block;
    padding-left: 100%;
    animation: noticeScroll 22s linear infinite;
}
.home-notice .notice-item {
    font-size: 13px;
    color: #8a5a00;
    margin-right: 48px;
}
@keyframes noticeScroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* 最新获得者 */
.home-winners {
    margin: 12px 0 4px;
    padding: 0 0 4px;
}
.home-winners-title {
    font-size: 15px;
    font-weight: 600;
    padding: 0 12px 8px;
}
.winner-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0 12px 6px;
    -webkit-overflow-scrolling: touch;
}
.winner-scroll::-webkit-scrollbar { display: none; }
.winner-card {
    flex: 0 0 200px;
    display: flex;
    gap: 10px;
    align-items: center;
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.winner-card img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: #eee;
    flex-shrink: 0;
}
.winner-info { min-width: 0; }
.winner-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.winner-goods {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.winner-meta {
    font-size: 11px;
    color: var(--lottery-muted);
    margin-top: 2px;
}

/* 夺宝码 */
.code-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.code-chip {
    font-size: 12px;
    font-family: Consolas, Monaco, monospace;
    letter-spacing: .5px;
    background: #f5f5f5;
    color: #333;
    border-radius: 6px;
    padding: 6px 8px;
}
.code-chip.win {
    background: #ffe8e6;
    color: #e74c3c;
    font-weight: 700;
    border: 1px solid #f5b7b1;
}
.join-code-preview {
    font-size: 12px;
    color: var(--lottery-muted);
    margin-top: 4px;
}

/* 邀请 */
.invite-panel .invite-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.invite-panel .invite-more {
    font-size: 12px;
    color: var(--lottery-muted);
}
.invite-stats {
    display: flex;
    background: #fafafa;
    border-radius: 10px;
    padding: 12px 4px;
    margin-bottom: 12px;
}
.invite-stat {
    flex: 1;
    text-align: center;
}
.invite-stat .num {
    font-size: 18px;
    font-weight: 700;
    color: var(--lottery-primary);
    line-height: 1.2;
}
.invite-stat .label {
    font-size: 11px;
    color: var(--lottery-muted);
    margin-top: 4px;
}
.invite-qr-box {
    text-align: center;
    padding: 8px 0 4px;
}
.invite-qr {
    width: 168px;
    height: 168px;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 6px;
    object-fit: contain;
}
.invite-code {
    font-weight: 700;
    letter-spacing: 1px;
    font-family: Consolas, Monaco, monospace;
}
.invite-link-box {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f5f5f5;
}
.invite-link {
    word-break: break-all;
    font-size: 12px;
    background: #f7f7f7;
    padding: 10px;
    border-radius: 8px;
    color: #444;
    line-height: 1.5;
    user-select: all;
}
.invite-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}
.invite-actions .btn-lottery,
.invite-actions .btn-lottery-outline {
    flex: 1;
}
.invite-user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}
.invite-user-row:last-child { border-bottom: 0; }
.invite-user-row img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #eee;
    flex-shrink: 0;
}
.invite-user-info {
    flex: 1;
    min-width: 0;
}
.invite-user-info .name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.invite-user-reward {
    text-align: right;
    flex-shrink: 0;
}
.invite-user-reward .plus {
    color: #27ae60;
    font-weight: 700;
    font-size: 14px;
}
.invite-toast {
    position: fixed;
    left: 50%;
    bottom: 90px;
    transform: translateX(-50%) translateY(8px);
    background: rgba(0,0,0,.78);
    color: #fff;
    font-size: 13px;
    padding: 10px 18px;
    border-radius: 20px;
    z-index: 10000;
    opacity: 0;
    transition: opacity .2s, transform .2s;
    pointer-events: none;
}
.invite-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 充值方式 */
.pay-method-list { display: flex; flex-direction: column; gap: 8px; }
.pay-method-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 10px;
    background: #fff;
}
.pay-method-item.active {
    border-color: var(--lottery-primary);
    background: rgba(231, 76, 60, .04);
}
.pay-method-item.disabled {
    opacity: .55;
}
.pay-method-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f5f6f8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lottery-primary);
    font-size: 18px;
    flex-shrink: 0;
}
.pay-method-info { flex: 1; min-width: 0; }
.pay-method-info .name { font-weight: 600; font-size: 14px; }
.pay-method-info .desc { font-size: 12px; color: #999; margin-top: 2px; }
.pay-method-arrow { color: #bbb; font-size: 16px; }
.pay-method-arrow .coming {
    font-size: 11px;
    color: #999;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 2px 6px;
}
.usdt-address-box {
    background: #fafafa;
    border-radius: 8px;
    padding: 12px;
}
.usdt-address {
    font-size: 13px;
    word-break: break-all;
    line-height: 1.5;
    font-weight: 600;
    color: #333;
}
.voucher-upload { margin-top: 8px; }
.voucher-add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    border: 1px dashed #ccc;
    border-radius: 8px;
    color: #999;
    font-size: 12px;
    gap: 6px;
    background: #fafafa;
}
.voucher-add .fa { font-size: 22px; }
.voucher-preview {
    position: relative;
    width: 96px;
    height: 96px;
}
.voucher-preview img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 8px;
    background: #f0f0f0;
}
.voucher-remove {
    position: absolute;
    right: 4px;
    bottom: 4px;
    background: rgba(0,0,0,.65);
    color: #fff !important;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
}
.pay-mask {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.pay-dialog {
    width: 100%;
    max-width: 340px;
    background: #fff;
    border-radius: 12px;
    padding: 20px 18px 16px;
}
.pay-dialog-title {
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
}
.pay-dialog-body {
    font-size: 14px;
    color: #444;
}

/* 关于我们 */
.about-content .about-body {
    font-size: 14px;
    line-height: 1.75;
    color: #444;
    word-break: break-word;
}
.about-content .about-body img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}
.about-content .about-body p { margin: 0 0 10px; }
.about-content .about-body h1,
.about-content .about-body h2,
.about-content .about-body h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 12px 0 8px;
    color: #222;
}
