* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: #f5f7fc;
    min-height: 100vh;
    padding: 12px 0 70px;
    color: #1e293b;
}

.app {
    max-width: 400px;
    margin: 0 auto;
}

.app {
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
    background: #ffffff;
    border-radius: 32px 32px 0 0;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.04);
    padding: 0 12px 16px;
    min-height: 780px;
    display: flex;
    flex-direction: column;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 8px;
}

.logo {
    font-weight: 700;
    font-size: 26px;
    background: linear-gradient(135deg, #0b1e33, #1a3a5c);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.balance-badge {
    background: #eef2ff;
    border-radius: 40px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 600;
    color: #1e4bd2;
    display: flex;
    align-items: center;
    gap: 4px;
}

.lang-select-wrapper {
    position: relative;
    display: inline-block;
}

/* ===== 彻底修复语言下拉框：紧贴文字，无多余空白 ===== */
.lang-select {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 40px;
    /* 关键：内边距只保留左侧文字间距和右侧箭头空间 */
    padding: 6px 24px 6px 10px !important;
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='16' height='16' fill='%23475569'%3E%3Cpath d='M12 16L6 10H18L12 16Z'/%3E%3Csvg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 14px;
    /* 强制覆盖，确保宽度由内容撑开 */
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    /* 防止换行 */
    white-space: nowrap !important;
    /* 移除浏览器默认边距 */
    margin: 0 !important;
}

.round-card {
    background: linear-gradient(145deg, #0b1e33, #132b44);
    border-radius: 24px;
    padding: 16px 14px;
    margin: 10px 0 14px;
    color: white;
}

.round-number {
    font-size: 26px;
    font-weight: 700;
}

.timer-area {
    text-align: right;
}

.timer-value {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    font-feature-settings: "tnum";
}

.last-result {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    padding: 6px 10px;
    border-radius: 40px;
}

.last-result-num {
    font-size: 26px;
    font-weight: 700;
}

.tag {
    background: rgba(255, 255, 255, 0.15);
    padding: 3px 8px;
    border-radius: 30px;
    font-size: 12px;
}

.play-section {
    margin-bottom: 6px;
}

.play-row {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.play-btn {
    flex: 1;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 10px 0;
    font-weight: 600;
    font-size: 15px;
    text-align: center;
    cursor: pointer;
    transition: 0.1s;
    user-select: none;
}

.play-btn:active {
    transform: scale(0.97);
    background: #eef2ff;
}

.play-btn.active {
    background: #1e4bd2;
    border-color: #1e4bd2;
    color: white;
}

.number-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

.num-btn {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 9px 0;
    font-weight: 600;
    font-size: 15px;
    text-align: center;
    cursor: pointer;
    transition: 0.1s;
}

.num-btn:active {
    transform: scale(0.95);
    background: #f1f5f9;
}

.num-btn.active {
    background: #1e4bd2;
    border-color: #1e4bd2;
    color: white;
}

.bet-input-row {
    background: #f8fafc;
    border-radius: 24px;
    padding: 4px 4px 4px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 8px 0 6px;
}

.bet-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bet-control button {
    background: white;
    border: 1px solid #cbd5e1;
    width: 32px;
    height: 32px;
    border-radius: 30px;
    font-size: 18px;
    cursor: pointer;
}

.bet-control input {
    width: 55px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    border: none;
    background: transparent;
    outline: none;
}

.action-row {
    display: flex;
    gap: 8px;
    margin: 8px 0 6px;
}

.action-btn {
    flex: 2;
    background: #1e4bd2;
    border: none;
    border-radius: 60px;
    padding: 13px;
    font-weight: 700;
    font-size: 17px;
    color: white;
    cursor: pointer;
    transition: 0.15s;
}

.action-btn:active {
    background: #163bb0;
    transform: scale(0.98);
}

.action-btn.disabled {
    background: #cbd5e1;
    color: #64748b;
    pointer-events: none;
}

.record-btn {
    flex: 1;
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    border-radius: 60px;
    padding: 13px 0;
    font-weight: 600;
    font-size: 15px;
    color: #1e293b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: 0.1s;
}

.record-btn:active {
    background: #e2e8f0;
}

.hint-text {
    color: #94a3b8;
    font-size: 10px;
    text-align: center;
    margin-bottom: 8px;
}

.history-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0 8px;
}

.history-title h3 {
    font-weight: 600;
    font-size: 17px;
}

.rule-capsule {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 40px;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #1e4bd2;
    cursor: pointer;
    transition: 0.1s;
}

.rule-capsule:active {
    background: #e2e8f0;
}

.table-wrapper {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: white;
    overflow-y: auto;
    max-height: 400px;
    flex-shrink: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9px;
    table-layout: fixed;
}

colgroup col.round-col {
    width: 11%;
}

colgroup col.digit-col {
    width: 6.5%;
}

colgroup col.result-col {
    width: 8%;
}

th,
td {
    padding: 5px 1px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
}

th {
    background: #f8fafc;
    font-weight: 600;
    color: #334155;
}

.group-header th {
    background: #eef2ff;
}

.highlight-num {
    color: #dc2626;
    font-weight: 700;
}

.stat-row {
    background: #faf9ff;
    font-weight: 600;
}

/* 个人中心 */
.profile-container {
    padding: 4px 0;
}

.profile-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0 12px;
}

.avatar-lg {
    width: 70px;
    height: 70px;
    background: linear-gradient(145deg, #eef2ff, #e0e7ff);
    border-radius: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #1e4bd2;
    box-shadow: 0 6px 12px rgba(30, 75, 210, 0.08);
    flex-shrink: 0;
}

.user-detail {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.nickname-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.crown-icon {
    color: #fbbf24;
    font-size: 18px;
}

.nickname-lg {
    font-weight: 700;
    font-size: 20px;
}

.user-id-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.user-id {
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    letter-spacing: 0.5px;
}

.edit-nickname-icon {
    color: #64748b;
    font-size: 16px;
    cursor: pointer;
    transition: 0.1s;
    background: #f1f5f9;
    width: 28px;
    height: 28px;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.edit-nickname-icon:active {
    background: #e2e8f0;
}

.settings-icon {
    color: #64748b;
    font-size: 26px;
    cursor: pointer;
    transition: 0.1s;
    background: #f1f5f9;
    width: 40px;
    height: 40px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    text-decoration: none;
}

.settings-icon:active {
    background: #e2e8f0;
}

.dual-panel {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 12px;
    margin: 16px 0 12px;
}

.panel-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.02), 0 2px 6px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
}

.panel-label {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 500;
}

.invite-value-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.invite-code-large {
    font-weight: 700;
    font-size: 26px;
    color: #0b1e33;
}

.copy-btn {
    color: #64748b;
    cursor: pointer;
    font-size: 18px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 30px;
}

.integral-value-large {
    font-size: 28px;
    font-weight: 700;
    color: #1e4bd2;
}

.customer-service-btn {
    background: #1e4bd2;
    color: white;
    border: none;
    border-radius: 60px;
    padding: 14px;
    width: 100%;
    font-weight: 600;
    font-size: 16px;
    margin: 8px 0 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 16px rgba(30, 75, 210, 0.15);
}

.menu-list-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-item-vertical {
    display: flex;
    align-items: center;
    padding: 16px 14px;
    background: #ffffff;
    border-radius: 20px;
    cursor: pointer;
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    text-decoration: none;
    color: inherit;
}

.menu-item-vertical i:first-child {
    font-size: 26px;
    width: 34px;
    color: #1e4bd2;
}

.menu-item-vertical span {
    flex: 1;
    font-weight: 500;
    font-size: 15px;
}

.menu-item-vertical i:last-child {
    color: #94a3b8;
}

/* 团队页面 */
.team-container {
    padding: 8px 0;
}

.invite-header {
    background: linear-gradient(145deg, #eef2ff, #ffffff);
    border-radius: 24px;
    padding: 20px 16px;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
}

.invite-code-row-lg {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border-radius: 60px;
    padding: 8px 8px 8px 20px;
    border: 1px solid #e2e8f0;
    margin: 12px 0;
}

.invite-code-lg {
    font-weight: 700;
    font-size: 26px;
}

.copy-btn-lg {
    background: #1e4bd2;
    color: white;
    border: none;
    border-radius: 40px;
    padding: 10px 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.stats-row {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}

.stat-item {
    flex: 1;
    text-align: center;
}

.stat-num {
    font-weight: 700;
    font-size: 24px;
    color: #1e4bd2;
}

.tabs {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}

.tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    background: #f1f5f9;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
}

.tab.active {
    background: #1e4bd2;
    color: white;
}

.search-box {
    background: #f8fafc;
    border-radius: 30px;
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
}

.member-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

/* 子页面 */
.subpage-container {
    padding: 8px 0;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    color: #64748b;
    cursor: pointer;
    text-decoration: none;
}

.subpage-card {
    background: #fff;
    border-radius: 20px;
    padding: 16px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    margin-bottom: 12px;
}

.filter-row {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}

.filter-select {
    background: #f1f5f9;
    border: none;
    border-radius: 30px;
    padding: 8px 14px;
    font-size: 13px;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
}

.list-item-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.list-item-title {
    font-weight: 600;
}

.list-item-desc {
    font-size: 12px;
    color: #64748b;
}

.list-item-right {
    font-weight: 600;
}

.income {
    color: #10b981;
}

.expense {
    color: #ef4444;
}

.frozen {
    color: #3b82f6;
}

.checkin-stats {
    display: flex;
    justify-content: space-around;
    margin: 16px 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin: 16px 0;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 30px;
}

.calendar-day.checked {
    background: #1e4bd2;
    color: white;
}

.settings-item {
    display: flex;
    align-items: center;
    padding: 16px 14px;
    background: #ffffff;
    border-radius: 20px;
    margin-bottom: 8px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.settings-item i:first-child {
    font-size: 26px;
    width: 34px;
    color: #1e4bd2;
}

.settings-item span {
    flex: 1;
    font-weight: 500;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    font-size: 15px;
    outline: none;
}

.address-scroll {
    background: #f8fafc;
    border-radius: 16px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.address-text-scroll {
    font-family: monospace;
    font-size: 13px;
    flex: 1;
    white-space: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}

.address-text-scroll::-webkit-scrollbar {
    display: none;
}

.copy-icon-btn {
    background: #eef2ff;
    border: none;
    border-radius: 30px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e4bd2;
    cursor: pointer;
    flex-shrink: 0;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    padding: 12px 0 6px;
    border-top: 1px solid #eef2f6;
    background: #fff;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #94a3b8;
    font-size: 11px;
    cursor: pointer;
    text-decoration: none;
}

.nav-item i {
    font-size: 26px;
    margin-bottom: 2px;
}

.nav-item.active {
    color: #1e4bd2;
    font-weight: 500;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 32px;
    padding: 24px;
    max-width: 340px;
    width: 90%;
    max-height: 70vh;
    overflow-y: auto;
}

#rulesContent p {
    margin: 8px 0;
    line-height: 1.6;
}

#scrollNoticeBar {
    overflow: hidden;
    white-space: nowrap;
}

#scrollNoticeText {
    display: inline-block;
    animation: marquee 30s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
}

.bet-record-item {
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
    word-break: break-word;
}

.qrcode-mock {
    width: 160px;
    height: 160px;
    background: #f1f5f9;
    margin: 16px auto;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.qrcode-mock img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
}

/* 全局链接样式重置 */
a {
    text-decoration: none;
    color: inherit;
}

a:hover {
    text-decoration: none;
}

/* Toast 提示样式 */
.toast-container {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    max-width: 280px;
    text-align: center;
    animation: toastFadeIn 0.3s ease;
    pointer-events: auto;
}

.toast.success {
    background: #10b981;
}

.toast.error {
    background: #ef4444;
}

.toast.warning {
    background: #f59e0b;
}

@keyframes toastFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}