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

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

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

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 30px;
    border-radius: 16px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.header h1 {
    font-size: 28px;
    color: #667eea;
}

.date-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-nav-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.date-nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#datePicker {
    padding: 10px 15px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    color: #667eea;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

#datePicker:focus {
    outline: none;
    border-color: #764ba2;
}

.date-display {
    font-size: 18px;
    color: #666;
    font-weight: 500;
    min-width: 200px;
    text-align: center;
}

/* 主内容区 */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 模块网格布局 */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* 模块卡片 */
.module-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.module-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.module-header h2 {
    color: white;
    font-size: 20px;
    font-weight: 600;
}

.add-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #667eea;
    transition: all 0.3s ease;
}

.add-btn:hover {
    background: white;
    transform: scale(1.05);
}

.module-content {
    padding: 20px;
    min-height: 250px;
    max-height: 400px;
    overflow-y: auto;
}

/* 工作日常列表 */
.routine-list {
    list-style: none;
}

.routine-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.routine-item.play {
    border-left-color: #52c41a;
}

.routine-time {
    font-weight: 600;
    color: #667eea;
    min-width: 60px;
    font-size: 14px;
}

.routine-type {
    margin-left: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.routine-item.work .routine-type {
    background: #e6f7ff;
    color: #1890ff;
}

.routine-item.play .routine-type {
    background: #f6ffed;
    color: #52c41a;
}

.routine-content {
    margin-left: 12px;
    flex: 1;
    font-size: 14px;
}

.routine-delete {
    color: #ff4d4f;
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.routine-delete:hover {
    opacity: 1;
}

/* 支出记录 */
.expense-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    border-radius: 10px;
    color: white;
    margin-bottom: 15px;
}

.total-amount {
    font-size: 24px;
    font-weight: 700;
}

.expense-list {
    list-style: none;
}

.expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 10px;
}

.expense-category {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    background: #fff7e6;
    color: #fa8c16;
}

.expense-amount {
    font-weight: 600;
    color: #ff4d4f;
    font-size: 16px;
}

.expense-note {
    flex: 1;
    margin: 0 12px;
    font-size: 14px;
    color: #666;
}

/* 工作计划 */
.plan-title {
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.plan-list {
    list-style: none;
}

.plan-item {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.plan-item.high {
    border-left-color: #ff4d4f;
}

.plan-item.medium {
    border-left-color: #fa8c16;
}

.plan-item.low {
    border-left-color: #52c41a;
}

.plan-priority {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 10px;
}

.plan-item.high .plan-priority {
    background: #fff1f0;
    color: #ff4d4f;
}

.plan-item.medium .plan-priority {
    background: #fff7e6;
    color: #fa8c16;
}

.plan-item.low .plan-priority {
    background: #f6ffed;
    color: #52c41a;
}

.plan-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
}

.plan-delete {
    color: #ff4d4f;
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.plan-delete:hover {
    opacity: 1;
}

/* 食谱模块 */
.recipe-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #667eea;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #667eea;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: #667eea;
    color: white;
}

.recipe-list {
    display: grid;
    gap: 15px;
}

.recipe-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

.recipe-type {
    font-size: 12px;
    color: #667eea;
    margin-bottom: 8px;
    font-weight: 600;
}

.recipe-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.recipe-ingredients {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

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

.modal-header h3 {
    color: white;
    font-size: 20px;
    font-weight: 600;
}

.close-btn {
    color: white;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.close-btn:hover {
    opacity: 1;
}

.modal-form {
    padding: 25px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

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

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* 食谱选择器 */
.recipe-selector {
    padding: 25px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.recipe-option {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.recipe-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* 滚动条样式 */
.module-content::-webkit-scrollbar {
    width: 6px;
}

.module-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.module-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.module-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.empty-state-text {
    font-size: 14px;
}

/* 响应式设计 - 平板 */
@media (max-width: 1024px) {
    .modules-grid {
        grid-template-columns: 1fr;
    }

    .header {
        flex-direction: column;
        gap: 15px;
    }

    .date-controls {
        width: 100%;
        justify-content: center;
    }
}

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

    .header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }

    .header h1 {
        font-size: 24px;
    }

    .date-display {
        font-size: 16px;
        min-width: auto;
    }

    .date-controls {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .date-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    #datePicker {
        padding: 8px 12px;
        font-size: 14px;
    }

    .modules-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .module-header {
        padding: 15px;
    }

    .module-header h2 {
        font-size: 18px;
    }

    .module-content {
        padding: 15px;
        min-height: 200px;
    }

    .modal-content {
        width: 95%;
        max-width: 380px;
    }

    .recipe-selector {
        grid-template-columns: 1fr;
    }

    .routine-item,
    .expense-item,
    .plan-item {
        padding: 10px;
    }

    .expense-summary {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* 小屏幕手机 */
@media (max-width: 480px) {
    .header h1 {
        font-size: 20px;
    }

    .date-display {
        font-size: 14px;
    }

    .date-nav-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    #datePicker {
        padding: 6px 10px;
        font-size: 13px;
    }

    .module-header h2 {
        font-size: 16px;
    }

    .add-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .recipe-filter {
        gap: 8px;
    }

    .filter-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* 页脚样式 */
.footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.beian-link {
    display: flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.3s;
}

.beian-link:hover {
    opacity: 0.8;
}

.beian-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

.footer-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
}
