* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    min-height: 100dvh;
    color: #333;
    padding-bottom: 70px;
    -webkit-font-smoothing: antialiased;
    padding-top: env(safe-area-inset-top);
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
}

.navbar {
    display: none;
}

.mobile-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.mobile-topbar .mb-logo {
    font-size: 18px;
    font-weight: bold;
}

.mobile-topbar .mb-right {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.mobile-topbar .mb-points {
    background: rgba(255,255,255,0.25);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
}

.mobile-topbar .mb-logout {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 15px;
    font-size: 12px;
}

.mobile-bottomnav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.1);
    z-index: 99;
}

.mobile-bottomnav a {
    text-decoration: none;
    color: #888;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    gap: 2px;
    padding: 4px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.mobile-bottomnav a:active {
    transform: scale(0.95);
}

.mobile-bottomnav a.mb-active {
    color: #667eea;
}

.mobile-bottomnav a.mb-admin {
    color: #e74c3c;
}

.mobile-bottomnav .mb-icon {
    font-size: 22px;
    line-height: 1;
}

.main-content {
    max-width: 600px;
    margin: 15px auto;
    padding: 0 12px;
    overflow-x: hidden;
}

.auth-container {
    max-width: 100%;
    margin: 20px 12px;
    background: white;
    padding: 28px 22px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-size: 22px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s;
    margin-top: 10px;
}

.btn:active {
    transform: scale(0.97);
}

.btn-admin {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.btn-success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 14px;
    width: auto;
    margin-top: 0;
    display: inline-block;
}

.btn-danger {
    background: #e74c3c;
}

.auth-link {
    text-align: center;
    margin-top: 18px;
    color: #666;
    font-size: 14px;
}

.auth-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background: #fdecea;
    color: #e74c3c;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.lottery-wrapper {
    background: white;
    border-radius: 20px;
    padding: 20px 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    text-align: center;
    margin-bottom: 15px;
}

.lottery-title {
    font-size: 22px;
    color: #333;
    margin-bottom: 6px;
}

.lottery-subtitle {
    color: #888;
    margin-bottom: 20px;
    font-size: 13px;
    line-height: 1.6;
}

.wheel-container {
    position: relative;
    width: min(85vw, 320px);
    height: min(85vw, 320px);
    margin: 0 auto 20px;
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 8px solid #667eea;
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
    background: conic-gradient(
        #ff6b6b 0deg 60deg,
        #ffd93d 60deg 120deg,
        #6bcb77 120deg 180deg,
        #4d96ff 180deg 240deg,
        #ff6b6b 240deg 300deg,
        #ffd93d 300deg 360deg
    );
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
}

.wheel-pointer {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-top: 32px solid #e74c3c;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.wheel-center-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 25%;
    height: 25%;
    min-width: 70px;
    min-height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: 4px solid white;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
    z-index: 5;
}

.wheel-center-btn:active {
    transform: translate(-50%, -50%) scale(0.92);
}

.wheel-center-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.prizes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.prize-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px 10px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.prize-card:active {
    transform: scale(0.97);
}

.prize-icon {
    font-size: 32px;
    margin-bottom: 6px;
}

.prize-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
    font-size: 13px;
}

.prize-stock {
    font-size: 11px;
    color: #888;
}

.page-title {
    color: white;
    font-size: 20px;
    margin-bottom: 15px;
    text-align: center;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 18px 14px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.card h3 {
    margin-bottom: 14px;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
    font-size: 17px;
}

.packages {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.package-card {
    border: 2px solid #eee;
    border-radius: 12px;
    padding: 18px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.package-card:active, .package-card.selected {
    border-color: #667eea;
    background: #f8f9ff;
    transform: scale(0.97);
}

.package-points {
    font-size: 28px;
    font-weight: bold;
    color: #667eea;
}

.package-price {
    font-size: 15px;
    color: #e74c3c;
    margin: 6px 0;
    font-weight: bold;
}

table {
    width: 100%;
    border-collapse: collapse;
    display: block;
}

table thead {
    display: none;
}

table tbody {
    display: block;
}

table tr {
    display: block;
    padding: 12px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border: none;
    font-size: 14px;
    text-align: right;
}

table td::before {
    content: attr(data-label);
    font-weight: bold;
    color: #666;
    margin-right: 10px;
    text-align: left;
    font-size: 13px;
}

.admin-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.admin-tab {
    padding: 12px 6px;
    background: white;
    border: 1px solid #eee;
    border-radius: 12px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.admin-tab-icon {
    font-size: 22px;
    line-height: 1;
}

.admin-tab-text {
    font-size: 12px;
    color: #555;
}

.admin-tab.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
    box-shadow: 0 3px 10px rgba(102,126,234,0.3);
}

.admin-tab.active .admin-tab-text {
    color: white;
}

.admin-tab:active {
    transform: scale(0.96);
}

@media (max-width: 480px) {
    .admin-tabs {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .admin-tab {
        padding: 10px 4px;
    }
    .admin-tab-icon {
        font-size: 20px;
    }
    .admin-tab-text {
        font-size: 11px;
    }
    .mapping-num {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
    .mapping-item {
        padding: 6px;
        gap: 3px;
    }
    .mapping-group-label {
        gap: 3px;
    }
}

.result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.result-modal.show {
    display: flex;
}

.result-content {
    background: white;
    padding: 35px 25px;
    border-radius: 20px;
    text-align: center;
    animation: popIn 0.3s ease;
    width: 100%;
    max-width: 320px;
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.result-icon {
    font-size: 70px;
    margin-bottom: 12px;
}

.result-text {
    font-size: 20px;
    color: #333;
    font-weight: bold;
    line-height: 1.5;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 14px;
    padding: 20px 12px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 26px;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    color: #888;
    margin-top: 4px;
    font-size: 12px;
}

.admin-login body {
    background: linear-gradient(135deg, #c0392b 0%, #8e44ad 100%);
}

.admin-login .auth-container {
    border-top: 5px solid #e74c3c;
}

.admin-login .btn {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
}

.admin-login .btn:active {
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

@media (min-width: 768px) {
    body {
        padding-bottom: 30px;
    }
    
    .mobile-topbar {
        display: none;
    }
    
    .mobile-bottomnav {
        display: none;
    }
    
    .navbar {
        display: block;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        padding: 12px 0;
        position: sticky;
        top: 0;
        z-index: 100;
    }
    
    .nav-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .nav-logo {
        font-size: 22px;
        font-weight: bold;
        color: #667eea;
        text-decoration: none;
    }
    
    .nav-menu {
        display: flex;
        align-items: center;
        gap: 15px;
    }
    
    .nav-link {
        color: #555;
        text-decoration: none;
        padding: 6px 14px;
        border-radius: 6px;
        transition: all 0.3s;
        font-size: 14px;
    }
    
    .nav-link:hover {
        background: #667eea;
        color: white;
    }
    
    .nav-admin {
        background: #e74c3c;
        color: white;
    }
    
    .nav-admin:hover {
        background: #c0392b;
    }
    
    .nav-user, .nav-points {
        font-size: 14px;
        color: #666;
    }
    
    .nav-points {
        font-weight: bold;
        color: #f39c12;
    }
    
    .nav-logout {
        color: #e74c3c;
        text-decoration: none;
        padding: 6px 14px;
        border: 1px solid #e74c3c;
        border-radius: 6px;
        transition: all 0.3s;
        font-size: 14px;
    }
    
    .nav-logout:hover {
        background: #e74c3c;
        color: white;
    }
    
    .main-content {
        max-width: 1000px;
        margin: 30px auto;
        padding: 0 20px;
    }
    
    .auth-container {
        max-width: 420px;
        margin: 60px auto;
        padding: 40px;
    }
    
    .auth-container h2 {
        font-size: 26px;
    }
    
    .lottery-wrapper {
        padding: 40px;
    }
    
    .lottery-title {
        font-size: 28px;
    }
    
    .wheel-container {
        width: 400px;
        height: 400px;
    }
    
    .prizes-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 20px;
    }
    
    .prize-icon {
        font-size: 40px;
    }
    
    .packages {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 20px;
    }
    
    .card {
        padding: 30px;
    }
    
    .stat-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
    
    table {
        display: table;
    }
    
    table thead {
        display: table-header-group;
    }
    
    table tbody {
        display: table-row-group;
    }
    
    table tr {
        display: table-row;
        padding: 0;
        margin: 0;
        background: transparent;
        border-left: none;
    }
    
    table th, table td {
        display: table-cell;
        padding: 12px 15px;
        border-bottom: 1px solid #eee;
        text-align: left;
    }
    
    table th {
        background: #f8f9fa;
        color: #555;
        font-weight: 600;
    }
    
    table td::before {
        content: none;
    }
    
    .result-content {
        max-width: 400px;
        padding: 40px;
    }
    
    .result-icon {
        font-size: 80px;
    }
    
    .result-text {
        font-size: 24px;
    }
    
    .page-title {
        font-size: 28px;
    }
}

.tongji-wrapper {
    background: white;
    border-radius: 16px;
    padding: 14px 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    text-align: center;
    margin-bottom: 12px;
}

.tongji-title {
    font-size: 18px;
    color: #333;
    margin-bottom: 4px;
}

.tongji-subtitle {
    color: #888;
    margin-bottom: 14px;
    font-size: 12px;
    overflow-wrap: break-word;
    word-break: break-all;
}

.tongji-subtitle strong {
    font-size: 16px;
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.grand-total-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 14px 10px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.35);
}

.grand-total-label {
    font-size: 11px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.grand-total-value {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 0.5px;
    overflow-wrap: anywhere;
    word-break: break-all;
}

.number-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 14px;
}

.number-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 6px 2px 5px;
    background: #f8f9fa;
    border: 2px solid transparent;
    min-width: 0;
    transition: transform 0.15s;
}

.number-card:active {
    transform: scale(0.94);
}

.number-ball {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: white;
    font-weight: bold;
    font-size: 13px;
    line-height: 1;
    margin-bottom: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.num-red .number-ball {
    background: linear-gradient(135deg, #ff6b6b, #c0392b);
}

.num-blue .number-ball {
    background: linear-gradient(135deg, #4d96ff, #2c5aa0);
}

.num-green .number-ball {
    background: linear-gradient(135deg, #6bcb77, #27ae60);
}

.num-red { border-color: #ff6b6b; }
.num-blue { border-color: #4d96ff; }
.num-green { border-color: #6bcb77; }

.number-points {
    font-size: 10px;
    color: #555;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    max-width: 100%;
}

.legend-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    font-size: 11px;
    color: #666;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot.num-red { background: #c0392b; }
.dot.num-blue { background: #2c5aa0; }
.dot.num-green { background: #27ae60; }

@media (min-width: 768px) {
    .tongji-wrapper {
        padding: 35px;
        border-radius: 20px;
    }

    .tongji-title {
        font-size: 26px;
    }

    .tongji-subtitle {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .grand-total-card {
        padding: 22px;
        margin-bottom: 22px;
    }

    .grand-total-label {
        font-size: 13px;
    }

    .grand-total-value {
        font-size: 40px;
        letter-spacing: 1px;
    }

    .number-grid {
        gap: 10px;
        margin-bottom: 20px;
    }

    .number-card {
        padding: 12px 6px 10px;
        border-radius: 12px;
    }

    .number-ball {
        width: 44px;
        height: 44px;
        font-size: 17px;
        margin-bottom: 5px;
    }

    .number-points {
        font-size: 12px;
    }

    .legend-row {
        font-size: 13px;
        gap: 20px;
    }

    .dot {
        width: 12px;
        height: 12px;
    }
}

.tj-tabs {
    display: flex;
    background: #f0f2ff;
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 16px;
}

.tj-tab {
    flex: 1;
    padding: 9px 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.25s;
}

.tj-tab.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
}

.tj-tab:active {
    transform: scale(0.97);
}

.tj-panel {
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.grand-total-zodiac {
    background: linear-gradient(135deg, #f39c12 0%, #e74c3c 100%);
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.35);
}

.zodiac-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.zodiac-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px 4px 8px;
    text-align: center;
    border: 2px solid transparent;
    transition: transform 0.15s;
}

.zodiac-card:active {
    transform: scale(0.95);
}

.zodiac-icon {
    font-size: 26px;
    line-height: 1;
    margin-bottom: 3px;
}

.zodiac-name {
    font-size: 13px;
    font-weight: bold;
    color: #333;
    margin-bottom: 3px;
    line-height: 1;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.zodiac-points {
    font-size: 11px;
    color: #555;
    font-weight: 600;
}

@media (min-width: 768px) {
    .tj-tab {
        font-size: 16px;
        padding: 11px 0;
    }

    .zodiac-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 12px;
        margin-bottom: 20px;
    }

    .zodiac-card {
        padding: 16px 6px 12px;
        border-radius: 14px;
    }

    .zodiac-icon {
        font-size: 38px;
        margin-bottom: 5px;
    }

    .zodiac-name {
        font-size: 16px;
    }

    .zodiac-points {
        font-size: 13px;
    }
}

.zodiac-admin-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.zodiac-admin-item {
    border-radius: 10px;
    padding: 10px 6px;
    text-align: center;
    border: 2px solid transparent;
    background: #f8f9fa;
}

.zodiac-admin-item.num-red { border-color: #ff6b6b; }
.zodiac-admin-item.num-blue { border-color: #4d96ff; }
.zodiac-admin-item.num-green { border-color: #6bcb77; }

.za-name {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.za-points {
    font-size: 16px;
    font-weight: bold;
    color: #667eea;
}

.mapping-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.mapping-item {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px;
    overflow: hidden;
    min-width: 0;
}

.mapping-group-label {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.mapping-group-list {
    font-size: 10px;
    color: #888;
    font-weight: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

.base-tag {
    font-size: 10px;
    background: #e74c3c;
    color: white;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: bold;
    margin-left: auto;
}

.mapping-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: bold;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mapping-select {
    flex: 1;
    min-width: 0;
    padding: 6px 4px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: white;
}

@media (min-width: 481px) {
    .mapping-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

@media (min-width: 768px) {
    .mapping-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .mapping-num {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .mapping-group-list {
        font-size: 12px;
    }
}
.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #27ae60;
    margin-left: 6px;
    animation: livePulse 2s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(39,174,96,0.6); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(39,174,96,0); }
}

.purchase-wrapper {
    margin-top: 20px;
}

.purchase-wrapper .card {
    background: white;
    border-radius: 10px;
    padding: 12px 10px;
    margin-bottom: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.card-header-row.clickable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
    margin: -12px -10px 14px -10px;
    padding: 12px 10px 8px 10px;
}

.card-header-row.clickable:hover {
    background: rgba(102, 126, 234, 0.06);
}

.card-toggle-icon {
    display: inline-block;
    font-size: 12px;
    color: #667eea;
    transition: transform 0.3s ease;
}

.card-toggle-icon.collapsed {
    transform: rotate(-90deg);
}

.card-header-row h3 {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.btn-quick-fill {
    padding: 6px 12px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(243,156,18,0.4);
    transition: transform 0.15s;
}

.btn-quick-fill:active {
    transform: scale(0.94);
}

.quick-fill-panel {
    background: #f8f9ff;
    border: 1px solid #d6dbff;
    border-radius: 10px;
    padding: 12px 10px;
    margin-bottom: 14px;
    animation: qfSlide 0.25s ease-out;
}

@keyframes qfSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.qf-tabs {
    display: flex;
    background: #eef0ff;
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 10px;
}

.qf-tab {
    flex: 1;
    padding: 8px 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.qf-tab.active {
    background: white;
    color: #667eea;
    box-shadow: 0 1px 4px rgba(102,126,234,0.2);
}

.qf-quick-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.qf-quick-label {
    font-size: 12px;
    color: #888;
    font-weight: bold;
    margin-right: 2px;
}

.qf-qbtn {
    padding: 4px 8px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    color: #555;
    cursor: pointer;
    transition: all 0.15s;
}

.qf-qbtn:active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.qf-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
    -webkit-overflow-scrolling: touch;
}

.qf-grid::-webkit-scrollbar {
    width: 4px;
}

.qf-grid::-webkit-scrollbar-thumb {
    background: #c5caff;
    border-radius: 2px;
}

.qf-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 2px solid transparent;
    background: white;
    transition: transform 0.15s;
}

.qf-item.num-red { background: #fff5f5; border-color: #ffc9c9; }
.qf-item.num-blue { background: #f0f7ff; border-color: #bcd4ff; }
.qf-item.num-green { background: #f0fff4; border-color: #b8e6c4; }

.qf-num {
    font-weight: bold;
    font-size: 17px;
    line-height: 1;
    min-width: 36px;
    text-align: center;
    flex-shrink: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.num-red .qf-num { color: #e74c3c; }
.num-blue .qf-num { color: #3498db; }
.num-green .qf-num { color: #27ae60; }

.qf-input {
    flex: 1;
    min-width: 0;
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    font-weight: bold;
    text-align: right;
    box-sizing: border-box;
    background: white;
    -moz-appearance: textfield;
}

.qf-input::-webkit-outer-spin-button,
.qf-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qf-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102,126,234,0.2);
}

.qf-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px dashed #ccc;
    gap: 10px;
}

.qf-total {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

.qf-total strong {
    font-size: 14px;
}

.qf-apply-btn {
    padding: 8px 14px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: transform 0.15s;
}

.qf-apply-btn:active {
    transform: scale(0.96);
}

@media (min-width: 768px) {
    .card-header-row {
        margin-bottom: 18px;
    }

    .btn-quick-fill {
        padding: 8px 16px;
        font-size: 14px;
    }

    .qf-grid {
        max-height: none;
    }

    .qf-item {
        padding: 12px 14px;
        gap: 14px;
    }

    .qf-num {
        font-size: 20px;
        min-width: 48px;
    }

    .qf-input {
        font-size: 16px;
        padding: 9px 14px;
    }
}

.purchase-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    background: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
}

.purchase-tab {
    flex: 1;
    padding: 10px 6px;
    background: transparent;
    border: none;
    font-size: 13px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.purchase-tab.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.purchase-panel-title {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.purchase-number-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.pnum-item,
.pzod-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    position: relative;
    transition: all 0.15s;
    min-width: 0;
    padding: 8px 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.pnum-num,
.pzod-name {
    font-weight: bold;
    font-size: 22px;
    line-height: 1.2;
}

.pnum-mine,
.pzod-mine {
    font-size: 12px;
    color: #e67e22;
    text-align: center;
    line-height: 1.3;
    margin-top: 4px;
    padding: 2px 8px;
    background: #fff4e6;
    border-radius: 10px;
    max-width: 100%;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.pnum-item.num-red, .pzod-item.num-red { background: #fff5f5; border-color: #ffc9c9; color: #e74c3c; }
.pnum-item.num-blue, .pzod-item.num-blue { background: #f0f7ff; border-color: #bcd4ff; color: #3498db; }
.pnum-item.num-green, .pzod-item.num-green { background: #f0fff4; border-color: #b8e6c4; color: #27ae60; }

.pnum-item:active,
.pzod-item:active {
    transform: scale(0.93);
}

.pnum-item.in-cart,
.pzod-item.in-cart {
    border-width: 2px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: white !important;
    border-color: #667eea !important;
}

.pnum-item.in-cart .pnum-mine,
.pzod-item.in-cart .pzod-mine {
    color: rgba(255,255,255,0.95);
    background: rgba(255,255,255,0.2);
}

.purchase-zodiac-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.cart-summary {
    background: #fafbfc;
    border-radius: 10px;
    border: 1px dashed #ddd;
    padding: 12px 10px;
    margin-top: 10px;
}

.cart-empty {
    text-align: center;
    color: #aaa;
    font-size: 12px;
    padding: 10px 0;
}

.cart-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 12px;
    border: 1px solid transparent;
}

.cart-item.item-red { background: #fff5f5; border-color: #ffc9c9; }
.cart-item.item-blue { background: #f0f7ff; border-color: #bcd4ff; }
.cart-item.item-green { background: #f0fff4; border-color: #b8e6c4; }

.cart-item-label {
    flex-shrink: 0;
    font-weight: bold;
    min-width: 56px;
}

.cart-item-input {
    flex: 1;
    min-width: 0;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
    font-weight: bold;
    box-sizing: border-box;
}

.cart-item-del {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: none;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}

.cart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid #eee;
    margin-bottom: 10px;
    font-size: 13px;
}

.cart-footer strong {
    color: #e74c3c;
    font-size: 15px;
}

.btn-cart-clear {
    padding: 4px 10px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
}

.btn-cart-clear:active {
    background: #e0e0e0;
}

.btn-submit-purchase {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    box-sizing: border-box;
}

.purchase-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.purchase-modal-inner {
    background: white;
    border-radius: 18px;
    padding: 22px 18px 18px;
    max-width: 380px;
    width: 100%;
    max-height: min(90dvh, 700px);
    overflow-y: auto;
    position: relative;
    animation: modalPop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

@keyframes modalPop {
    from { transform: scale(0.88) translateY(10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.modal-close:active {
    background: #e0e0e0;
    transform: scale(0.92);
}

@media (max-width: 380px) {
    .purchase-modal-inner {
        padding: 18px 14px 14px;
        border-radius: 14px;
    }
}

.modal-target-wrap {
    display: flex;
    justify-content: center;
    margin: 8px 0 14px;
}

.modal-ball {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: white;
    font-weight: bold;
    font-size: 34px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.modal-ball.small {
    width: 36px;
    height: 36px;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.modal-ball.num-ball-red { background: #e74c3c; }
.modal-ball.num-ball-blue { background: #3498db; }
.modal-ball.num-ball-green { background: #27ae60; }

.modal-zod-block {
    width: 90px;
    height: 90px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: white;
    font-weight: bold;
    font-size: 32px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.modal-zod-block.zod-block-red { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.modal-zod-block.zod-block-blue { background: linear-gradient(135deg, #3498db, #2980b9); }
.modal-zod-block.zod-block-green { background: linear-gradient(135deg, #27ae60, #1e8449); }

.modal-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

.modal-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 3px 0;
    color: #666;
}

.modal-info-row strong {
    font-size: 15px;
    color: #333;
}

.modal-points-title {
    font-size: 13px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.modal-points-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 18px;
    text-align: center;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.modal-quick {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.modal-qbtn {
    flex: 1;
    padding: 7px 0;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    color: #555;
    cursor: pointer;
}

.modal-qbtn:active {
    background: #667eea;
    color: white;
}

.modal-qbtn.qbtn-plus {
    color: #27ae60;
    border-color: #27ae60;
}
.modal-qbtn.qbtn-plus:active {
    background: #27ae60;
    color: white;
}
.modal-qbtn.qbtn-minus {
    color: #e74c3c;
    border-color: #e74c3c;
}
.modal-qbtn.qbtn-minus:active {
    background: #e74c3c;
    color: white;
}

.modal-confirm {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 8px;
}

.modal-remove {
    width: 100%;
    padding: 10px;
    background: #f8f9fa;
    color: #888;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
}

.modal-related-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #eee;
}

.modal-related-title {
    font-size: 13px;
    font-weight: bold;
    color: #555;
    margin-bottom: 10px;
}

.modal-related-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.modal-related-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 4px 0;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}

.modal-related-item:active {
    background: #f0f0f0;
}

.modal-related-label {
    font-size: 9px;
    color: #888;
    white-space: nowrap;
}

.modal-related-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-related-input-row .modal-points-input {
    margin-bottom: 0;
    padding: 8px 10px;
    font-size: 15px;
}

@media (min-width: 768px) {
    .purchase-number-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 10px;
    }
    .pnum-item, .pzod-item {
        border-radius: 10px;
        border-width: 2px;
        min-height: 80px;
        padding: 10px 6px;
    }
    .pnum-num, .pzod-name {
        font-size: 24px;
    }
    .purchase-zodiac-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 10px;
    }
    .purchase-wrapper .card {
        padding: 24px;
        border-radius: 12px;
    }
    .pnum-mine, .pzod-mine {
        font-size: 12px;
    }
    .modal-ball, .modal-zod-block {
        width: 110px;
        height: 110px;
        font-size: 40px;
    }
}
.purchase-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 480px) {
    .purchase-table,
    .purchase-table thead,
    .purchase-table tbody,
    .purchase-table th,
    .purchase-table td,
    .purchase-table tr {
        display: block;
    }

    .purchase-table thead {
        display: none;
    }

    .purchase-table tr {
        border-bottom: 1px solid #eee;
        padding: 8px 0;
    }

    .purchase-table td {
        text-align: right;
        padding: 4px 8px;
        border: none;
    }

    .purchase-table td::before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        color: #666;
        font-size: 12px;
    }
}

.number-card {
    cursor: pointer;
}

.zodiac-card {
    cursor: pointer;
}

.detail-modal-inner {
    max-width: 420px;
}

.detail-loading {
    text-align: center;
    padding: 30px 0;
    color: #888;
    font-size: 14px;
}

.detail-empty {
    text-align: center;
    padding: 30px 0;
    color: #aaa;
    font-size: 13px;
}

.detail-header {
    text-align: center;
    padding: 10px 0 16px;
}

.detail-big-ball {
    width: 100px;
    height: 100px;
    font-size: 40px;
    margin: 0 auto;
}

.detail-big-zod {
    width: 100px;
    height: 100px;
    font-size: 36px;
    margin: 0 auto;
}

.detail-zodiac-badge {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 14px;
    background: #f0f2ff;
    color: #667eea;
    border-radius: 14px;
    font-size: 12px;
    font-weight: bold;
}

.detail-stats-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.detail-stat-card {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
}

.detail-stat-value {
    font-size: 22px;
    font-weight: bold;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.detail-stat-label {
    font-size: 11px;
    opacity: 0.9;
    margin-top: 2px;
}

.detail-tabs {
    display: flex;
    background: #f0f2ff;
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 12px;
}

.detail-tab {
    flex: 1;
    padding: 8px 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.detail-tab.active {
    background: white;
    color: #667eea;
    box-shadow: 0 1px 4px rgba(102, 126, 234, 0.2);
}

.detail-tab:active {
    transform: scale(0.97);
}

.detail-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-buyer-item,
.detail-recent-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    gap: 10px;
}

.detail-buyer-rank {
    width: 30px;
    text-align: center;
    font-size: 16px;
    flex-shrink: 0;
    font-weight: bold;
    color: #888;
}

.detail-buyer-info,
.detail-recent-left {
    flex: 1;
    min-width: 0;
}

.detail-buyer-name {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-buyer-sub {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

.detail-buyer-pts {
    font-size: 15px;
    font-weight: bold;
    color: #e74c3c;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .detail-modal-inner {
        max-width: 480px;
        padding: 25px 22px 20px;
    }

    .detail-big-ball,
    .detail-big-zod {
        width: 120px;
        height: 120px;
        font-size: 46px;
    }

    .detail-stat-value {
        font-size: 26px;
    }

    .detail-buyer-name {
        font-size: 15px;
    }

    .detail-buyer-pts {
        font-size: 17px;
    }
}

.admin-multiplier-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.admin-multiplier-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 6px;
    border-radius: 10px;
    background: #f8f9fa;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.admin-multiplier-item.multiplier-red {
    border-color: #e74c3c;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
}

.admin-multiplier-item.multiplier-blue {
    border-color: #3498db;
    background: linear-gradient(135deg, #f0f8ff 0%, #e0f0ff 100%);
}

.admin-multiplier-item.multiplier-green {
    border-color: #27ae60;
    background: linear-gradient(135deg, #f0fff5 0%, #e0f5e8 100%);
}

.admin-multiplier-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    color: white;
}

.admin-multiplier-item.multiplier-red .admin-multiplier-num {
    background: #e74c3c;
}

.admin-multiplier-item.multiplier-blue .admin-multiplier-num {
    background: #3498db;
}

.admin-multiplier-item.multiplier-green .admin-multiplier-num {
    background: #27ae60;
}

.admin-multiplier-input {
    width: 100%;
    max-width: 80px;
    text-align: center;
    padding: 6px 4px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    background: white;
}

.admin-multiplier-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.admin-multiplier-unit {
    font-size: 11px;
    color: #888;
}

.admin-zodiac-multiplier-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.admin-zodiac-multiplier-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 10px;
    border-radius: 12px;
    background: #f8f9fa;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.admin-zodiac-multiplier-item.multiplier-red {
    border-color: #e74c3c;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
}

.admin-zodiac-multiplier-item.multiplier-blue {
    border-color: #3498db;
    background: linear-gradient(135deg, #f0f8ff 0%, #e0f0ff 100%);
}

.admin-zodiac-multiplier-item.multiplier-green {
    border-color: #27ae60;
    background: linear-gradient(135deg, #f0fff5 0%, #e0f5e8 100%);
}

.admin-zodiac-multiplier-name {
    font-size: 20px;
    font-weight: bold;
}

.admin-zodiac-multiplier-input {
    width: 100%;
    max-width: 90px;
    text-align: center;
    padding: 8px 6px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    font-weight: bold;
    color: #333;
    background: white;
}

.admin-zodiac-multiplier-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.admin-zodiac-multiplier-unit {
    font-size: 12px;
    color: #888;
}

@media (max-width: 768px) {
    .admin-multiplier-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }

    .admin-multiplier-item {
        padding: 10px 4px;
    }

    .admin-multiplier-num {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .admin-multiplier-input {
        max-width: 65px;
        font-size: 13px;
        padding: 5px 2px;
    }

    .admin-zodiac-multiplier-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .admin-zodiac-multiplier-item {
        padding: 14px 8px;
    }

    .admin-zodiac-multiplier-name {
        font-size: 18px;
    }

    .admin-zodiac-multiplier-input {
        max-width: 75px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .admin-multiplier-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .admin-zodiac-multiplier-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

.draw-form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.draw-form-group {
    flex: 1;
    min-width: 0;
}

.draw-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    color: #555;
    font-size: 13px;
}

.draw-form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.draw-form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.draw-form-section {
    margin-bottom: 16px;
}

.draw-section-title {
    font-size: 14px;
    font-weight: bold;
    color: #555;
    margin-bottom: 10px;
    padding-left: 4px;
}

.draw-special-title {
    color: #e74c3c;
}

.draw-numbers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.draw-number-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
    border: 2px solid #eee;
    transition: all 0.2s;
}

.draw-number-item:focus-within {
    border-color: #667eea;
    background: #f0f2ff;
}

.draw-number-special {
    background: linear-gradient(135deg, #fff5f5, #ffe8e8);
    border-color: #ffc9c9;
    grid-column: span 1;
    max-width: 160px;
    margin: 0 auto;
}

.draw-number-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
    font-weight: 600;
}

.draw-number-input {
    width: 100%;
    padding: 10px 6px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    color: #667eea;
    background: white;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.draw-number-input:focus {
    outline: none;
    border-color: #667eea;
}

.draw-number-special .draw-number-input {
    color: #e74c3c;
    border-color: #ffb3b3;
}

.draw-number-special .draw-number-label {
    color: #e74c3c;
}

.draw-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.draw-record-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 14px 14px;
    border-left: 4px solid #667eea;
}

.draw-record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 6px;
}

.draw-record-issue {
    font-weight: bold;
    font-size: 15px;
    color: #333;
}

.draw-record-date {
    font-size: 13px;
    color: #888;
}

.draw-record-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 12px;
}

.draw-ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    font-weight: bold;
    font-size: 14px;
    padding: 0 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.draw-ball.ball-red {
    background: linear-gradient(135deg, #ff6b6b, #c0392b);
}

.draw-ball.ball-blue {
    background: linear-gradient(135deg, #4d96ff, #2c5aa0);
}

.draw-ball.ball-green {
    background: linear-gradient(135deg, #6bcb77, #27ae60);
}

.draw-ball.ball-special {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    min-width: 56px;
    border-radius: 18px;
    font-size: 13px;
    animation: specialPulse 2s ease-in-out infinite;
}

@keyframes specialPulse {
    0%, 100% { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); }
    50% { box-shadow: 0 2px 12px rgba(243, 156, 18, 0.5); }
}

.draw-special-sep {
    font-size: 16px;
    font-weight: bold;
    color: #bbb;
    margin: 0 2px;
}

.draw-record-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

@media (min-width: 768px) {
    .draw-numbers-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 12px;
    }

    .draw-number-special {
        grid-column: span 1;
    }

    .draw-ball {
        min-width: 42px;
        height: 42px;
        font-size: 16px;
    }

    .draw-ball.ball-special {
        min-width: 64px;
        height: 42px;
        border-radius: 21px;
    }

    .draw-form-group input {
        padding: 12px 14px;
    }

    .draw-number-input {
        font-size: 24px;
        padding: 12px 6px;
    }
}

@media (max-width: 480px) {
    .draw-form-row {
        flex-direction: column;
        gap: 10px;
    }

    .draw-numbers-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .draw-ball {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
        padding: 0 6px;
    }

    .draw-ball.ball-special {
        min-width: 48px;
        height: 32px;
        font-size: 11px;
    }
}

.btn-fill-gap {
    padding: 6px 12px;
    background: linear-gradient(135deg, #27ae60, #1e8449);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(39,174,96,0.4);
    transition: transform 0.15s;
}

.btn-fill-gap:active {
    transform: scale(0.94);
}

.fill-gap-panel {
    background: linear-gradient(135deg, #f0fff4, #e8f8ec);
    border: 1px solid #b8e6c4;
    border-radius: 10px;
    padding: 12px 10px;
    margin-bottom: 14px;
    animation: qfSlide 0.25s ease-out;
}

.fg-header {
    margin-bottom: 10px;
}

.fg-title {
    font-size: 15px;
    font-weight: bold;
    color: #1e8449;
    margin-bottom: 2px;
}

.fg-sub {
    font-size: 11px;
    color: #888;
}

.fg-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.fg-stat-card {
    background: white;
    border-radius: 8px;
    padding: 8px 4px;
    text-align: center;
    border: 1px solid #e8e8e8;
}

.fg-stat-highlight {
    background: linear-gradient(135deg, #27ae60, #1e8449);
    color: white;
    border: none;
    box-shadow: 0 2px 6px rgba(39,174,96,0.35);
}

.fg-stat-value {
    font-size: 16px;
    font-weight: bold;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.fg-stat-label {
    font-size: 10px;
    opacity: 0.8;
    margin-top: 2px;
}

.fg-bar-chart {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 110px;
    padding: 10px 4px 0;
    background: white;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    margin-bottom: 12px;
    overflow: hidden;
}

.fg-bar-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    position: relative;
}

.fg-bar-col.fg-bar-low .fg-bar-fill {
    box-shadow: 0 0 0 2px #ffc107;
    animation: fgLowPulse 1.5s ease-in-out infinite;
}

@keyframes fgLowPulse {
    0%, 100% { box-shadow: 0 0 0 2px #ffc107; }
    50% { box-shadow: 0 0 0 3px rgba(255,193,7,0.5); }
}

.fg-bar-value {
    font-size: 8px;
    color: #666;
    margin-bottom: 2px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
}

.fg-bar-track {
    flex: 1;
    width: 70%;
    background: #f5f5f5;
    border-radius: 2px 2px 0 0;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    position: relative;
}

.fg-bar-fill {
    width: 100%;
    border-radius: 2px 2px 0 0;
    min-height: 2px;
    transition: height 0.4s ease;
}

.fg-bar-num {
    font-size: 8px;
    color: #666;
    margin-top: 2px;
    font-weight: bold;
}

.fg-bar-avg-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: repeating-linear-gradient(90deg, #e74c3c 0, #e74c3c 4px, transparent 4px, transparent 8px);
    pointer-events: none;
}

.fg-plan-section {
    background: white;
    border-radius: 10px;
    padding: 10px;
    border: 1px solid #e0f2e6;
}

.fg-plan-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
}

.fg-plan-info {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.6;
    background: #f8f9fa;
    padding: 8px 10px;
    border-radius: 6px;
}

.fg-plan-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 4px;
}

.fg-plan-list::-webkit-scrollbar {
    width: 4px;
}

.fg-plan-list::-webkit-scrollbar-thumb {
    background: #c5e6d0;
    border-radius: 2px;
}

.fg-plan-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 2px solid transparent;
}

.fg-plan-item.num-red { background: #fff5f5; border-color: #ffc9c9; }
.fg-plan-item.num-blue { background: #f0f7ff; border-color: #bcd4ff; }
.fg-plan-item.num-green { background: #f0fff4; border-color: #b8e6c4; }

.fg-plan-ball {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: bold;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.fg-plan-ball.num-red { background: linear-gradient(135deg, #ff6b6b, #c0392b); }
.fg-plan-ball.num-blue { background: linear-gradient(135deg, #4d96ff, #2c5aa0); }
.fg-plan-ball.num-green { background: linear-gradient(135deg, #6bcb77, #27ae60); }

.fg-plan-detail {
    flex: 1;
    min-width: 0;
}

.fg-plan-line {
    font-size: 13px;
    color: #333;
    font-weight: 600;
}

.fg-plan-arrow {
    color: #aaa;
    margin: 0 4px;
}

.fg-plan-sub {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

.fg-plan-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px dashed #ddd;
    gap: 8px;
}

.fg-plan-total {
    font-size: 12px;
    color: #666;
}

.fg-plan-total strong {
    font-size: 15px;
    color: #e74c3c;
}

.fg-plan-btn {
    padding: 8px 14px;
    background: linear-gradient(135deg, #27ae60, #1e8449);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.15s;
    box-shadow: 0 2px 6px rgba(39,174,96,0.35);
}

.fg-plan-btn:active {
    transform: scale(0.96);
}

.fg-plan-btn-sm {
    background: #f0f0f0;
    color: #666;
    box-shadow: none;
}

.fg-plan-btn-sm:active {
    background: #e0e0e0;
}

.fg-empty-tip {
    text-align: center;
    padding: 16px 10px;
    color: #27ae60;
    font-size: 13px;
    font-weight: bold;
    background: white;
    border-radius: 8px;
    border: 1px solid #b8e6c4;
}

@media (min-width: 768px) {
    .btn-fill-gap {
        padding: 8px 16px;
        font-size: 14px;
    }

    .fill-gap-panel {
        padding: 16px;
    }

    .fg-bar-chart {
        height: 150px;
        gap: 4px;
    }

    .fg-bar-value {
        font-size: 10px;
    }

    .fg-bar-num {
        font-size: 10px;
    }

    .fg-plan-list {
        max-height: 280px;
    }
}

.mobile-card-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.55);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: mcmFadeIn 0.2s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

@keyframes mcmFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mobile-card-modal-inner {
    background: white;
    width: 100%;
    max-width: 420px;
    border-radius: 20px 20px 0 0;
    padding: 24px 20px 20px;
    animation: mcmSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    max-height: 85dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

@keyframes mcmSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.mobile-card-modal.center .mobile-card-modal-inner {
    border-radius: 20px;
    margin: auto;
    animation: mcmPopIn 0.25s ease;
    padding-bottom: 24px;
}

@keyframes mcmPopIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.mcm-icon {
    text-align: center;
    font-size: 52px;
    margin-bottom: 12px;
    line-height: 1;
}

.mcm-title {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.mcm-message {
    text-align: center;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    white-space: pre-wrap;
    word-break: break-word;
}

.mcm-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mcm-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.12s;
}

.mcm-btn:active {
    transform: scale(0.97);
}

.mcm-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.mcm-btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.mcm-btn-success {
    background: linear-gradient(135deg, #27ae60, #1e8449);
    color: white;
}

.mcm-btn-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.mcm-btn-default {
    background: #f0f0f0;
    color: #555;
}

.mcm-btns-row {
    display: flex;
    gap: 10px;
}

.mcm-btns-row .mcm-btn {
    flex: 1;
}

.mobile-card-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.mobile-card-close:active {
    background: #e0e0e0;
    transform: scale(0.92);
}

@media (min-width: 768px) {
    .mobile-card-modal {
        align-items: center;
    }
    .mobile-card-modal-inner {
        border-radius: 20px;
        padding-bottom: 24px;
        animation: mcmPopIn 0.25s ease;
    }
}

.fg-bar-chart {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 110px;
    padding: 10px 4px 0;
    background: white;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    margin-bottom: 12px;
    overflow: hidden;
}
.purchase-action-cell {
    white-space: nowrap;
}

.pa-btn {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    margin-right: 4px;
}

.pa-btn:last-child {
    margin-right: 0;
}

.pa-btn-edit {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.pa-btn-edit:active {
    transform: scale(0.95);
    opacity: 0.9;
}

.pa-btn-del {
    background: #fee2e2;
    color: #ef4444;
}

.pa-btn-del:active {
    background: #fecaca;
}

.modal-target-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.modal-ball {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 26px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.modal-zod-block {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 28px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.modal-info {
    background: #f8f9ff;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.modal-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 14px;
    color: #555;
}

.modal-info-row span {
    color: #888;
}

.modal-info-row strong {
    color: #333;
    font-size: 15px;
}

.modal-points-title {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
}

.modal-points-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 24px;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
    background: #fafafa;
    font-weight: bold;
}

.modal-points-input:focus {
    border-color: #667eea;
    background: white;
}

.modal-quick {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-top: 10px;
}

.modal-qbtn {
    padding: 8px 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    font-size: 13px;
    cursor: pointer;
    color: #667eea;
    font-weight: 600;
    transition: all 0.15s;
}

.modal-qbtn:active {
    background: #667eea;
    color: white;
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .modal-ball {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }
    .modal-zod-block {
        width: 70px;
        height: 70px;
        font-size: 24px;
    }
    .modal-quick {
        grid-template-columns: repeat(4, 1fr);
    }
    .pa-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.btn-quick-modify {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
    transition: all 0.2s;
}

.btn-quick-modify:active {
    transform: scale(0.95);
    box-shadow: 0 2px 6px rgba(230, 126, 34, 0.3);
}

.btn-batch-edit {
    display: inline-block;
    padding: 10px 22px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
    transition: all 0.2s;
}

.btn-batch-edit:active {
    transform: scale(0.95);
    box-shadow: 0 2px 6px rgba(230, 126, 34, 0.3);
}

.qf-header-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fff8e1, #fff3e0);
    border-radius: 10px;
    margin-bottom: 12px;
    border-left: 4px solid #f39c12;
}

.qf-header-icon {
    font-size: 18px;
}

.qf-header-text {
    font-size: 14px;
    font-weight: 700;
    color: #e67e22;
}

.qf-header-hint {
    font-size: 12px;
    color: #999;
    margin-left: auto;
}

.qf-item-has {
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.5) inset;
    background: linear-gradient(135deg, #fff9e6, #fff3cc) !important;
}

.qf-item-has .qf-num {
    font-weight: 800;
}

.qf-apply-cancel {
    background: #f0f0f0;
    color: #666;
}

.qf-apply-cancel:active {
    background: #e0e0e0;
}

@media (max-width: 768px) {
    .btn-batch-edit {
        padding: 12px 28px;
        font-size: 15px;
    }
    .qf-header-bar {
        flex-wrap: wrap;
    }
    .qf-header-hint {
        width: 100%;
        margin-left: 0;
    }
}

.reports-wrapper {
    max-width: 480px;
    margin: 0 auto;
    padding: 12px;
}

.issue-selector {
    background: #fff;
    padding: 14px 16px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.issue-selector label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    flex-shrink: 0;
}

.issue-selector select {
    flex: 1;
    min-width: 160px;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f8f9fa;
    color: #333;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.issue-selector select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

.btn-back-current {
    display: inline-block;
    padding: 6px 14px;
    font-size: 13px;
    color: #667eea;
    text-decoration: none;
    border: 1px solid #667eea;
    border-radius: 6px;
    background: #fff;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-back-current:hover {
    background: #667eea;
    color: #fff;
}

.receipt {
    position: relative;
    background: #fff;
    padding: 20px 16px;
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    font-family: 'Courier New', 'Consolas', monospace;
    color: #222;
    line-height: 1.8;
    font-size: 14px;
    text-align: center;
    margin-bottom: 16px;
}

.receipt-global {
    border: 2px solid #ddd;
    background: #fcfcfc;
}

.receipt-profit {
    border: 2px solid #e9ecef;
    background: linear-gradient(180deg, #fff 0%, #f8f9fa 100%);
}

.receipt-profit .receipt-title {
    color: #2c3e50;
}

.receipt-profit .receipt-header {
    border-bottom: 1px dashed #ccc;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.settled-seal {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 82px;
    height: 82px;
    border: 3px solid #c0392b;
    border-radius: 50%;
    color: #c0392b;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    transform: rotate(-18deg);
    opacity: 0.82;
    box-shadow: inset 0 0 0 2px rgba(192, 57, 43, 0.35);
    pointer-events: none;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.5);
    z-index: 5;
}

@media (max-width: 480px) {
    .settled-seal {
        width: 64px;
        height: 64px;
        font-size: 10px;
        letter-spacing: 1px;
        border-width: 2px;
    }
}

.receipt-header {
    margin-bottom: 8px;
}

.receipt-title {
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 4px;
    margin-bottom: 6px;
}

.receipt-user,
.receipt-date {
    font-size: 12px;
    color: #555;
}

.receipt-sep {
    border-top: 1px dashed #999;
    margin: 12px 0;
}

.receipt-sep-bold {
    border-top: 2px solid #333;
}

.receipt-summary {
    text-align: left;
}

.rs-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #333;
}

.rs-row span:last-child {
    font-weight: bold;
}

.rs-row-grand {
    font-size: 15px;
    padding: 4px 0;
}

.profit-value {
    color: #1e7e34;
    font-weight: bold;
}

.loss-value {
    color: #c0392b;
    font-weight: bold;
}

.receipt-section {
    text-align: left;
}

.receipt-section-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #222;
    border-bottom: 1px solid #ddd;
    padding-bottom: 4px;
}

.receipt-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0 18px;
}

.receipt-item {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 13px;
    line-height: 1.9;
}

.ri-num {
    color: #333;
}

.ri-pts {
    color: #c0392b;
    font-weight: bold;
}

.receipt-item-special .ri-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 6px;
    background: #e8f8ec;
    color: #1e7e34;
    border: 2px solid #28a745;
    border-radius: 50%;
    font-weight: bold;
    line-height: 1;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.15);
}

.receipt-item-special .ri-pts {
    color: #1e7e34;
}

.receipt-section-total {
    margin-top: 10px;
    font-size: 13px;
    color: #222;
    text-align: right;
    padding-top: 4px;
    border-top: 1px dotted #ccc;
}

.receipt-empty {
    font-size: 12px;
    color: #aaa;
    text-align: center;
    padding: 6px 0;
}

.receipt-grand-total {
    font-size: 16px;
    font-weight: bold;
    padding: 6px 0;
}

.receipt-tip {
    font-size: 12px;
    color: #c0392b;
    margin-top: 10px;
    letter-spacing: 1px;
    text-align: center;
}

.receipt-footer {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
    letter-spacing: 2px;
}

@media print {
    .receipt {
        box-shadow: none;
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .receipt-items {
        gap: 0 14px;
    }
    .receipt-item {
        font-size: 12px;
    }
}
.mobile-dialog {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    animation: mdFade 0.18s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

@keyframes mdFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mobile-dialog-box {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 340px;
    padding: 26px 22px 20px;
    text-align: center;
    animation: mdPop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

@keyframes mdPop {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.mobile-dialog-icon {
    font-size: 44px;
    margin-bottom: 10px;
    line-height: 1;
}

.mobile-dialog-icon.md-icon-warning { color: #f39c12; }
.mobile-dialog-icon.md-icon-error { color: #e74c3c; }
.mobile-dialog-icon.md-icon-success { color: #27ae60; }
.mobile-dialog-icon.md-icon-info { color: #667eea; }

.mobile-dialog-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
}

.mobile-dialog-message {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.mobile-dialog-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-dialog-actions.md-actions-2 {
    flex-direction: row;
    gap: 10px;
}

.mobile-dialog-btn {
    width: 100%;
    padding: 13px 16px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.12s, opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
    min-height: 48px;
}

.mobile-dialog-btn:active {
    transform: scale(0.96);
}

.md-btn-confirm {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.md-btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.md-btn-ok {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.mobile-dialog-actions.md-actions-2 .mobile-dialog-btn {
    flex: 1;
}

.mobile-dialog-box.md-type-alert .mobile-dialog-actions.md-actions-2 {
    display: none;
}

.mobile-dialog-box.md-type-confirm .mobile-dialog-actions.md-actions-1 {
    display: none;
}

@media (max-width: 360px) {
    .mobile-dialog-box {
        padding: 22px 18px 16px;
        border-radius: 16px;
    }
    .mobile-dialog-btn {
        padding: 11px 14px;
        font-size: 14px;
    }
}