* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1rem;
    opacity: 0.9;
}

main {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

section {
    margin-bottom: 30px;
}

section:last-child {
    margin-bottom: 0;
}

h2 {
    color: #4CAF50;
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

input, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.btn-primary, .btn-secondary, .btn-danger {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.btn-primary {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #45a049, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 2px solid #ddd;
}

.btn-secondary:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

.btn-danger {
    background: linear-gradient(45deg, #f44336, #d32f2f);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(45deg, #d32f2f, #f44336);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.4);
}

.history-controls, .allocation-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.history-controls button, .allocation-controls button {
    flex: 1;
    margin-bottom: 0;
}

.result-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #4CAF50;
}

.result-item.available {
    border-left-color: #4CAF50;
    background: #e8f5e8;
}

.result-item.unavailable {
    border-left-color: #f44336;
    background: #ffebee;
}

.result-item.expired {
    border-left-color: #ff9800;
    background: #fff3e0;
}

.result-item.allocated {
    border-left-color: #2196F3;
    background: #e3f2fd;
}

.result-time {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.result-status {
    font-size: 0.9rem;
    opacity: 0.8;
}

.feeding-schedule {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.schedule-item {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.schedule-item .time {
    display: block;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.schedule-item .meal {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
}

.history-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.history-date {
    font-weight: 600;
    color: #4CAF50;
}

.history-delete {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
}

.history-details {
    font-size: 0.9rem;
    color: #666;
}

.history-note {
    margin-top: 10px;
    padding: 10px;
    background: #e3f2fd;
    border-radius: 5px;
    font-style: italic;
}

/* 分配对话框样式 */
.allocation-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.dialog-content {
    background: white;
    border-radius: 20px;
    padding: 25px;
    max-width: 90%;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.dialog-content h3 {
    color: #4CAF50;
    margin-bottom: 15px;
    text-align: center;
}

.slot-selection {
    margin: 20px 0;
}

.slot-option {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.slot-option:hover {
    background: #e8f5e8;
}

.slot-option input[type="checkbox"] {
    width: auto;
    margin-right: 12px;
    transform: scale(1.2);
}

.slot-details {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.slot-time {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.slot-pump-time {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

.dialog-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.dialog-buttons button {
    flex: 1;
    margin-bottom: 0;
}

/* 分配状态显示样式 */
.allocation-status {
    padding: 20px 0;
}

.allocated-slots, .allocation-history {
    margin: 15px 0;
}

.allocated-slot, .allocation-record {
    background: #e3f2fd;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #2196F3;
    position: relative;
}

.cancel-allocation {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.cancel-allocation:hover {
    background: #d32f2f;
}

.slot-time, .record-time {
    font-weight: 600;
    color: #2196F3;
    margin-bottom: 8px;
}

.slot-info, .record-info {
    font-size: 0.9rem;
    color: #666;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.slot-info span, .record-info span {
    display: block;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    main {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .schedule-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .history-controls, .allocation-controls {
        flex-direction: column;
    }
    
    .dialog-content {
        margin: 20px;
        padding: 20px;
    }
    
    .dialog-buttons {
        flex-direction: column;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-section, .save-section, .allocation-section {
    animation: fadeIn 0.5s ease-out;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 