/* chips系统样式 */

/* chips余额显示 */
.chips-balance {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 15px;
    box-shadow: 0 2px 5px rgba(255, 215, 0, 0.3);
    display: inline-block;
}

.chips-balance:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(255, 215, 0, 0.5);
}

/* chips不足模态框 */
.chips-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.chips-modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.chips-modal-content.wide {
    max-width: 700px;
}

.chips-modal-content h2 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
}

.chips-modal-content p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.chips-hint {
    background: #f0f4ff;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.chips-hint p {
    color: #333;
    font-weight: 600;
    margin-bottom: 12px;
}

.chips-hint ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.chips-hint li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

.chips-hint li::before {
    margin-right: 8px;
}

/* V2样式 - 优化后的弹窗 */
.chips-modal-v2 {
    text-align: center;
}

.chips-balance-display {
    background: linear-gradient(135deg, #f5f7fa 0%, #f0f4ff 100%);
    border-radius: 12px;
    padding: 15px 20px;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.chips-balance-display .balance-label {
    color: #666;
    font-weight: 500;
}

.chips-balance-display .balance-value {
    color: #667eea;
    font-weight: 600;
    font-size: 18px;
}

.chips-balance-info {
    background: linear-gradient(135deg, #f5f7fa 0%, #f0f4ff 100%);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.chips-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 16px;
}

.chips-label {
    color: #666;
    font-weight: 500;
}

.chips-value {
    font-weight: 600;
    font-size: 18px;
}

.chips-value.need {
    color: #ff6b6b;
}

.chips-value.current {
    color: #667eea;
}

.chips-hint-simple {
    background: #fff9e6;
    border-left: 4px solid #ffc107;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.chips-hint-simple p {
    margin: 0;
    color: #856404;
    font-size: 15px;
    line-height: 1.6;
    text-align: left;
}

.chips-modal-buttons-v2 {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    margin-top: 25px;
}

.chips-download-btn-v2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 30px;
    background: linear-gradient(135deg, #34a853 0%, #0f9d58 100%);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 168, 83, 0.3);
    width: 100%;
    max-width: 280px;
}

.chips-download-btn-v2:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(52, 168, 83, 0.4);
}

.chips-download-btn-v2 img {
    height: 60px;
    width: auto;
}

.chips-download-btn-v2 .download-text {
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.chips-ok-btn-v2 {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 35px;
    border-radius: 25px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.chips-ok-btn-v2:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5);
}

/* 按钮容器 */
.chips-modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    margin-top: 20px;
}

.chips-download-btn {
    display: inline-block;
    transition: all 0.3s ease;
    text-decoration: none;
}

.chips-download-btn:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.chips-download-btn img {
    display: block;
}

.chips-ok-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.chips-ok-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5);
}

/* 兼容旧按钮样式 */
.chips-modal-content button:not(.chips-ok-btn) {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    display: block;
    margin: 20px auto 0;
    transition: all 0.3s ease;
}

.chips-modal-content button:not(.chips-ok-btn):hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5);
}

/* chips历史记录 */
.chips-history {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    background: #fafafa;
}

.transaction-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s ease;
}

.transaction-item:hover {
    background: white;
}

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

.transaction-reason {
    font-weight: 500;
    color: #333;
}

.transaction-amount {
    font-weight: bold;
    text-align: right;
}

.transaction-amount.credit {
    color: #4caf50;
}

.transaction-amount.debit {
    color: #f44336;
}

.transaction-balance {
    color: #666;
    text-align: right;
}

.transaction-date {
    font-size: 0.9em;
    color: #999;
    text-align: right;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* 生成故事区域的chips显示 */
.chips-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #f5f5f5, #fafafa);
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.chips-cost {
    color: #f44336;
    font-weight: bold;
    font-size: 14px;
}

.chips-balance-inline {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(255, 215, 0, 0.3);
}

.chips-balance-inline.insufficient {
    background: linear-gradient(135deg, #ff5252, #ff7575);
    color: white;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* 每日奖励toast提示 */
.daily-reward-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10001;
    background: linear-gradient(135deg, #34a853 0%, #0f9d58 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(52, 168, 83, 0.4);
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.daily-reward-toast .toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.daily-reward-toast .toast-icon {
    font-size: 24px;
}

.daily-reward-toast .toast-message {
    font-size: 16px;
    font-weight: 600;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chips-balance {
        font-size: 12px;
        padding: 5px 10px;
        margin-right: 5px;
        border-radius: 15px;
    }

    .chips-indicator {
        flex-direction: column;
        gap: 8px;
        padding: 10px;
        font-size: 12px;
        text-align: center;
    }

    .chips-cost {
        font-size: 12px;
    }

    .chips-balance-inline {
        font-size: 12px;
        padding: 4px 10px;
    }

    .chips-modal-content {
        padding: 20px;
        width: 95%;
        margin: 10px;
    }

    .chips-modal-content h2 {
        font-size: 18px;
    }

    .chips-hint {
        padding: 15px;
    }

    .chips-history {
        max-height: 300px;
        padding: 10px;
    }

    .transaction-item {
        grid-template-columns: 1fr;
        gap: 5px;
        padding: 10px;
        font-size: 13px;
    }

    .transaction-amount,
    .transaction-balance,
    .transaction-date {
        text-align: left;
    }

    .transaction-reason {
        font-size: 13px;
        margin-bottom: 5px;
    }

    .transaction-amount {
        font-size: 14px;
        display: inline-block;
        margin-right: 10px;
    }

    .transaction-balance {
        font-size: 12px;
        display: inline-block;
    }

    .transaction-date {
        font-size: 11px;
        margin-top: 5px;
    }
}

@media (max-width: 480px) {
    .chips-balance {
        font-size: 11px;
        padding: 4px 8px;
    }

    .chips-modal-content {
        padding: 15px;
    }

    .chips-modal-content button {
        padding: 10px 20px;
        font-size: 14px;
    }
}