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

body {
    font-family: 'ZCOOL KuaiLe', cursive;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5em;
    color: #ff6b6b;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

header p {
    font-size: 1.2em;
    color: #666;
}

.upload-section, .add-task-section, .task-list-section, .task-summary-section, .control-section, .timer-section, .result-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px solid #e9ecef;
}

h3 {
    font-size: 1.5em;
    color: #4ecdc4;
    margin-bottom: 20px;
    text-align: center;
}

/* 图片上传区域 */
.upload-btn {
    display: inline-block;
    padding: 15px 30px;
    background: #4ecdc4;
    color: white;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.3);
}

.upload-btn:hover {
    background: #45b7aa;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(78, 205, 196, 0.4);
}

#imageUpload {
    display: none;
}

/* 图片预览区域 */
.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 2px dashed #ddd;
    min-height: 100px;
}

.preview-image {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 25px;
    height: 25px;
    background: rgba(255, 107, 107, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.remove-image:hover {
    background: rgba(255, 107, 107, 1);
    transform: scale(1.1);
}

/* 识别按钮 */
.recognize-btn {
    display: block;
    margin: 20px auto 0;
    padding: 15px 40px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.recognize-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

.recognize-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 添加任务区域 */
.add-task-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.add-task-form input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1em;
    font-family: inherit;
    flex: 1;
    min-width: 150px;
}

.add-btn {
    padding: 12px 25px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.add-btn:hover {
    background: #ee5a52;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

/* 任务列表 */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
}

.task-item:hover {
    border-color: #4ecdc4;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.task-order {
    font-size: 1.2em;
    font-weight: bold;
    color: #4ecdc4;
    min-width: 30px;
    text-align: center;
}

.task-info {
    flex: 1;
}

.task-name {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 5px;
}

.task-time {
    font-size: 0.9em;
    color: #666;
}

.task-controls {
    display: flex;
    gap: 10px;
}

.edit-btn, .delete-btn, .move-up-btn, .move-down-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.edit-btn {
    background: #ffd93d;
    color: #333;
}

.delete-btn {
    background: #ff6b6b;
    color: white;
}

.move-up-btn, .move-down-btn {
    background: #6c757d;
    color: white;
    padding: 8px;
}

.edit-btn:hover, .delete-btn:hover, .move-up-btn:hover, .move-down-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* 任务总体完成情况预览 */
.task-summary-section .summary-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #ddd;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f0f8ff;
    border-radius: 8px;
    font-size: 1.1em;
}

.summary-label {
    font-weight: bold;
    color: #4ecdc4;
}

.summary-item span:last-child {
    color: #ff6b6b;
    font-weight: bold;
}

/* 控制区域 */
.control-section {
    text-align: center;
}

.start-btn {
    padding: 20px 50px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.5em;
    font-weight: bold;
    font-family: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(255, 107, 107, 0.4);
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(255, 107, 107, 0.5);
}

.start-btn:active {
    transform: translateY(0);
}

/* 计时器区域 */
.timer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.skip-btn {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
}

.skip-btn:hover {
    background: #5a6268;
}

.timer-display {
    text-align: center;
    margin-bottom: 30px;
}

.timer {
    font-size: 4em;
    font-weight: bold;
    color: #ff6b6b;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.task-status {
    font-size: 1.2em;
    color: #666;
}

.timer-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.control-btn {
    padding: 12px 25px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.complete-btn {
    padding: 12px 30px;
    background: #4ecdc4;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.3);
}

.complete-btn:hover {
    background: #45b7aa;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(78, 205, 196, 0.4);
}

/* 结果区域 */
.result-section h2 {
    text-align: center;
    color: #ff6b6b;
    margin-bottom: 20px;
    font-size: 2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.result-details {
    background: white;
    padding: 20px;
    border-radius: 15px;
    border: 2px solid #ddd;
}

.result-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    font-size: 1.1em;
}

.result-item:last-child {
    border-bottom: none;
    font-weight: bold;
    color: #ff6b6b;
}

/* 超时提示模态框 */
.modal {
    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;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    animation: modalAppear 0.3s ease;
}

.modal-content h2 {
    color: #ff6b6b;
    margin-bottom: 20px;
    font-size: 2em;
}

.modal-content p {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 30px;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.modal-btn {
    padding: 15px 30px;
    background: #4ecdc4;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 150px;
}

.modal-btn:hover {
    background: #45b7aa;
    transform: translateY(-2px);
}

.modal-btn.complete-btn {
    background: #ff6b6b;
    font-weight: bold;
}

.modal-btn.complete-btn:hover {
    background: #ee5a52;
}

#timeoutTime {
    color: #ff6b6b;
    font-weight: bold;
    font-size: 1.2em;
}

/* 编辑表单样式 */
.edit-form {
    margin: 30px 0;
}

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

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

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

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 动画 */
@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 辅助类 */
.hidden {
    display: none;
}

.completed {
    background: #d4edda !important;
    border-color: #c3e6cb !important;
    opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        margin: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .timer {
        font-size: 3em;
    }
    
    .add-task-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .timer-controls {
        flex-wrap: wrap;
    }
}

/* 学习氛围装饰 */
.container::before {
    content: "🎓";
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 2em;
    opacity: 0.1;
}

.container::after {
    content: "📖";
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 2em;
    opacity: 0.1;
}