/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

/* 头部样式 */
header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    padding: 20px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 主要内容区域 */
main {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* 添加记录表单 */
.add-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.add-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-danger {
    background: #ff4757;
    color: white;
    font-size: 0.9rem;
    padding: 8px 16px;
}

.btn-danger:hover {
    background: #ff3838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.4);
}

/* 统计卡片 */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-card.today {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.stat-card.total {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.stat-card h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.stat-value {
    margin-bottom: 10px;
}

.stat-value .number {
    font-size: 2.5rem;
    font-weight: bold;
    display: block;
}

.stat-value .unit {
    font-size: 1rem;
    opacity: 0.9;
}

.stat-detail {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 记录列表 */
.records-section {
    margin-top: 30px;
}

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

.records-header h2 {
    color: #667eea;
    font-size: 1.5rem;
}

.records-list {
    max-height: 500px;
    overflow-y: auto;
}

.empty-message {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 1.1rem;
}

/* 日期分组 */
.date-group {
    margin-bottom: 25px;
}

.date-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.date-header .date {
    font-weight: bold;
    font-size: 1.1rem;
}

.date-header .daily-total {
    font-size: 1rem;
}

/* 记录项 */
.record-item {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.record-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.record-info {
    flex: 1;
}

.record-time {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.record-coins {
    font-size: 1.3rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.record-note {
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

.record-actions {
    display: flex;
    gap: 10px;
}

.delete-btn {
    background: #ff4757;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.delete-btn:hover {
    background: #ff3838;
    transform: scale(1.1);
}

/* 底部 */
footer {
    text-align: center;
    color: white;
    margin-top: 20px;
    padding: 20px;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* 滚动条样式 */
.records-list::-webkit-scrollbar {
    width: 8px;
}

.records-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.records-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.records-list::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* 响应式设计 */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    main {
        padding: 20px;
    }

    .stats-section {
        grid-template-columns: 1fr;
    }

    .records-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .date-header {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }

    .record-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .record-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .modal-dialog {
        width: 90%;
        margin: 20px;
    }
}

/* 自定义弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
}

.modal-overlay.show .modal-dialog {
    transform: scale(1);
    opacity: 1;
}

.modal-dialog {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.modal-header {
    padding: 30px 30px 20px 30px;
    text-align: center;
    border-bottom: 2px solid #f0f0f0;
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.modal-title {
    font-size: 1.5rem;
    color: #333;
    margin: 0;
}

.modal-body {
    padding: 30px;
}

.modal-message {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.6;
    text-align: center;
    margin: 0;
}

.modal-footer {
    padding: 20px 30px 30px 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 100px;
}

.modal-btn-cancel {
    background: #e0e0e0;
    color: #666;
}

.modal-btn-cancel:hover {
    background: #d0d0d0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.modal-btn-confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* 不同类型的弹窗颜色 */
.modal-dialog.warning .modal-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
}

.modal-dialog.warning .modal-title {
    color: white;
}

.modal-dialog.danger .modal-header {
    background: linear-gradient(135deg, #ff4757 0%, #ff3838 100%);
    color: white;
    border: none;
}

.modal-dialog.danger .modal-title {
    color: white;
}

.modal-dialog.danger .modal-btn-confirm {
    background: linear-gradient(135deg, #ff4757 0%, #ff3838 100%);
}

.modal-dialog.danger .modal-btn-confirm:hover {
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.4);
}

.modal-dialog.info .modal-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
}

.modal-dialog.info .modal-title {
    color: white;
}

.modal-dialog.success .modal-header {
    background: linear-gradient(135deg, #00b09b 0%, #96c93d 100%);
    color: white;
    border: none;
}

.modal-dialog.success .modal-title {
    color: white;
}
