/**
 * style.css - 鬼谷子样式表
 * 保持原有 UI 风格
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #d9e2cf;
    font-family: 'Segoe UI', 'PingFang SC', Roboto, sans-serif;
    padding: 20px;
    color: #2c3a2b;
    position: relative;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #fef9ef;
    border-radius: 2rem;
    box-shadow: 0 20px 35px rgba(60, 45, 30, 0.15);
    overflow: hidden;
    border: 1px solid #cddfb8;
}

.header {
    background: #e3efd3;
    padding: 1rem 2rem;
    border-bottom: 1px solid #c2d6aa;
    text-align: center;
}

.header h1 {
    font-size: 1.8rem;
    color: #3f5c3a;
}

.sub {
    color: #6e7f5e;
    font-size: 0.8rem;
}

.top-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 1.5rem 2rem;
    background: #f5f9ef;
}

.history-area {
    flex: 2;
    background: #ffffffcc;
    border-radius: 1.5rem;
    padding: 1rem;
}

.history-balls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
    max-height: 120px;
    overflow-y: auto;
}

.history-ball {
    background: #e2e9d5;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.input-area {
    flex: 1.2;
    background: #ffffffcc;
    border-radius: 1.5rem;
    padding: 1rem;
}

.digit-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.digit-btn {
    background: #e6efdc;
    border: none;
    padding: 10px 0;
    border-radius: 40px;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
}

.digit-btn.selected-digit {
    background: #b3cf94;
    border: 2px solid #6a9c4b;
}

.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.action-buttons button {
    flex: 1;
    padding: 8px;
    border-radius: 60px;
    font-weight: bold;
    border: none;
    cursor: pointer;
}

.confirm-btn {
    background: #82aa66;
    color: white;
}

.undo-btn {
    background: #cfbc8c;
    color: #2c2b1f;
}

.stat-panel {
    background: #e9f0e0;
    margin: 1rem 2rem;
    border-radius: 1.5rem;
    padding: 1rem;
}

.stat-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.stat-card {
    background: white;
    border-radius: 1rem;
    padding: 6px 12px;
    min-width: 90px;
    text-align: center;
}

.gems-panel {
    background: #fff3df;
    margin: 1rem 2rem;
    border-radius: 1.5rem;
    padding: 1rem;
    border: 2px solid #f3c26b;
}

.gems-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.gems-input-row input {
    flex: 1;
    padding: 8px 12px;
    border-radius: 60px;
    border: 2px solid #e0c490;
    font-size: 1rem;
    text-align: center;
}

.gems-input-row button {
    padding: 8px 20px;
    border-radius: 60px;
    border: none;
    background: #f5bc70;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.strategy-box {
    background: #fff3df;
    margin: 0 2rem 1rem 2rem;
    border-radius: 2rem;
    padding: 1.2rem;
    border: 2px solid #f3c26b;
}

.rec-single {
    background: #f5d98f;
    border-radius: 60px;
    padding: 6px 18px;
    font-size: 1.4rem;
    font-weight: bold;
    display: inline-block;
    margin: 4px;
}

.strategy-detail {
    background: #fff0db;
    border-radius: 1rem;
    padding: 1rem;
    margin-top: 12px;
}

.adaptive-info {
    background: #e6ddc0;
    border-radius: 1rem;
    padding: 10px;
    margin-top: 12px;
    font-size: 0.8rem;
}

.probability-info {
    background: #e8f5e9;
    border-radius: 1rem;
    padding: 1rem;
    margin-top: 12px;
}

.trend-area {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0 2rem 1.5rem 2rem;
}

.trend-card {
    background: #f3f7ec;
    border-radius: 1.2rem;
    padding: 0.8rem;
    flex: 1;
}

.footer {
    font-size: 0.7rem;
    text-align: center;
    padding: 1rem;
    color: #819b6e;
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e2b;
    color: #f9efcf;
    padding: 8px 20px;
    border-radius: 60px;
    font-size: 0.8rem;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

button {
    cursor: pointer;
}

.reward-float {
    position: fixed;
    bottom: 30px;
    right: 20px;
    z-index: 1000;
    background: #f5bc70;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: 0.2s;
    font-size: 28px;
}

.reward-float:hover {
    transform: scale(1.05);
    background: #e0a34b;
}

.reward-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: 0.2s;
}

.reward-modal.active {
    visibility: visible;
    opacity: 1;
}

.reward-card {
    background: #fffef7;
    border-radius: 2rem;
    max-width: 340px;
    width: 85%;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.3);
    position: relative;
}

.reward-card h3 {
    margin-bottom: 1rem;
    color: #b97f2e;
}

.reward-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.reward-btn {
    background: #f3f0e0;
    border: 1px solid #d4b87a;
    padding: 10px;
    border-radius: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: bold;
    cursor: pointer;
}

.reward-btn:active {
    transform: scale(0.97);
}

.qr-img {
    width: 180px;
    height: 180px;
    margin: 10px auto;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
}

.qr-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.close-modal {
    background: #c0cfaa;
    border: none;
    padding: 6px 20px;
    border-radius: 40px;
    margin-top: 10px;
    cursor: pointer;
}

.group-note {
    font-size: 0.7rem;
    color: #6e7f5e;
    margin-top: 8px;
}

.copy-btn {
    background: #c0cfaa;
    border: none;
    border-radius: 20px;
    padding: 2px 12px;
    margin-left: 8px;
    cursor: pointer;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .top-row {
        flex-direction: column;
    }
    
    .history-area,
    .input-area {
        flex: 1;
    }
    
    .header h1 {
        font-size: 1.4rem;
    }
    
    .stat-grid {
        justify-content: center;
    }
    
    .trend-area {
        flex-direction: column;
    }
}
