/* 内联编辑样式 */
.editable-field {
    position: relative;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.editable-field:hover {
    background: rgba(102, 126, 234, 0.1);
}

.edit-icon {
    font-size: 12px;
    color: #666;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.editable-field:hover .edit-icon {
    opacity: 1;
}

/* 内联表单控件样式 */
.inline-select,
.inline-task-name,
.inline-date,
.inline-text {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.inline-select:focus,
.inline-task-name:focus,
.inline-date:focus,
.inline-text:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.inline-task-name {
    font-weight: 500;
    min-width: 150px;
}

.inline-date {
    font-size: 11px;
}

.inline-text {
    font-size: 12px;
}

/* 迭代版本样式 */
.iteration-version {
    display: inline-block;
    padding: 4px 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #495057;
}

/* 延期状态样式 */
.overdue-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.overdue-yes {
    background-color: #f8d7da;
    color: #721c24;
}

.overdue-no {
    background-color: #d4edda;
    color: #155724;
}

/* 延期原因输入框样式 */
.overdue-reason:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
    cursor: not-allowed;
}

.overdue-reason:not(:disabled) {
    background-color: #fff;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 表格单元格样式调整 */
.tasks-table td {
    padding: 8px 6px;
    vertical-align: middle;
}

.tasks-table td:first-child {
    min-width: 150px;
}

.tasks-table td:nth-child(2),
.tasks-table td:nth-child(3),
.tasks-table td:nth-child(4),
.tasks-table td:nth-child(5) {
    min-width: 100px;
}

.tasks-table td:nth-child(6),
.tasks-table td:nth-child(7) {
    min-width: 110px;
}

.tasks-table td:nth-child(8),
.tasks-table td:nth-child(9) {
    min-width: 80px;
}

.tasks-table td:nth-child(10) {
    min-width: 120px;
}

.inline-edit-container {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: fadeInScale 0.2s ease-out;
    margin-top: 4px;
    min-width: 150px;
    max-width: 250px;
    width: auto;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.inline-edit-content {
    display: flex;
    align-items: center;
    padding: 8px;
    gap: 8px;
}

.inline-select {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    outline: none;
    transition: border-color 0.2s ease;
}

.inline-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.inline-edit-actions {
    display: flex;
    gap: 4px;
}

.inline-edit-actions .btn {
    padding: 6px 8px;
    font-size: 12px;
    min-width: auto;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    z-index: 2000;
    animation: slideInRight 0.3s ease-out;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

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

.notification-success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.notification-error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.notification-info {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

/* 完成按钮特殊样式 */
.btn-success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.4s ease-out;
}

.modal-content h3 {
    margin: 0 0 30px 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

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

/* 登录相关样式 */
.login-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.tab-btn.active {
    border-bottom: 2px solid #667eea;
    color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.login-hint {
    font-size: 12px;
    color: #666;
    margin-top: 10px;
    text-align: center;
}

.login-switch-hint {
    font-size: 13px;
    color: #666;
    margin-top: 15px;
    text-align: center;
}

.login-switch-hint a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.login-switch-hint a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* 主应用样式 */
.main-app {
    background: white;
    min-height: 100vh;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-logo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.site-logo:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.header-left h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.user-info {
    font-size: 14px;
    opacity: 0.9;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 番茄钟入口样式 */
.pomodoro-entrance {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    position: relative;
    overflow: hidden;
}

.pomodoro-entrance::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.pomodoro-entrance:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    text-decoration: none;
    color: white;
}

.pomodoro-entrance:hover::before {
    left: 100%;
}

.pomodoro-entrance i {
    font-size: 16px;
    animation: pulse 2s infinite;
}

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

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

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

.btn-secondary {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 101, 101, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 101, 101, 0.4);
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled::before {
    display: none;
}

/* 看板统计样式 */
.dashboard {
    padding: 30px;
    background: #f8f9fa;
}

.dashboard h2 {
    margin-bottom: 20px;
    color: #333;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

.stat-card canvas {
    max-width: 180px !important;
    max-height: 180px !important;
    width: 180px !important;
    height: 180px !important;
}

/* 快速操作栏样式 */
.quick-actions {
    padding: 20px 30px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.view-switcher {
    display: flex;
    gap: 5px;
}

.view-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 6px;
}

.view-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.view-btn:hover:not(.active) {
    background: #f8f9fa;
}

/* 任务区域样式 */
.tasks-section {
    padding: 30px;
    background: #f8f9fa;
}

.tasks-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* 表单样式 */
.form-group {
    flex: 1;
    margin-bottom: 20px;
}

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

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    margin-bottom: 0;
    box-sizing: border-box;
    background: #fafbfc;
}

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

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    box-sizing: border-box;
    background: #fafbfc;
    cursor: pointer;
}

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

.custom-select {
    position: relative;
    margin-bottom: 20px;
    flex: 1;
}

.custom-select .form-input {
    margin-bottom: 0;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.form-row .custom-select {
    flex: 1;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

/* 表格样式 */
.tasks-table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tasks-table th {
    background: #667eea;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.tasks-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.tasks-table tr:hover {
    background: #f8f9fa;
}

/* 状态标签样式 */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.status-未开始 {
    background: #e2e8f0;
    color: #64748b;
}

.status-进行中 {
    background: #dbeafe;
    color: #1e40af;
}

.status-已完成 {
    background: #d1fae5;
    color: #065f46;
}

.status-延期 {
    background: #fee2e2;
    color: #991b1b;
}

.status-已拒绝 {
    background: #f3f4f6;
    color: #6b7280;
}

/* 优先级样式 */
.priority-高 {
    color: #ef4444;
    font-weight: bold;
}

.priority-中 {
    color: #f59e0b;
    font-weight: 500;
}

.priority-低 {
    color: #10b981;
}

/* 看板视图样式 */
.view-container {
    display: none;
}

.view-container.active {
    display: block;
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.kanban-column {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.kanban-column h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
}

.kanban-cards {
    min-height: 200px;
}

.kanban-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: move;
    transition: all 0.3s;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.kanban-card.dragging {
    opacity: 0.5;
}

.kanban-card h4 {
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
}

.kanban-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #666;
}

/* 按类型查看样式 */
.category-group {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.category-group h3 {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.category-tasks {
    display: grid;
    gap: 10px;
}

/* 日历视图样式 */
.calendar-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e9ecef;
    border: 1px solid #e9ecef;
}

.calendar-day {
    background: white;
    padding: 10px;
    min-height: 80px;
    position: relative;
}

.calendar-day-header {
    background: #f8f9fa;
    padding: 10px;
    font-weight: bold;
    text-align: center;
}

.calendar-task {
    background: #667eea;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    margin-bottom: 2px;
    cursor: pointer;
}

/* 所有问题查看样式 */
.all-tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.task-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.task-card:hover {
    transform: translateY(-5px);
}

.task-card h3 {
    margin-bottom: 10px;
    color: #333;
}

.task-card-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-right {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .quick-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .view-switcher {
        flex-wrap: wrap;
    }
    
    .tasks-controls {
        flex-direction: column;
    }
    
    .kanban-board {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

/* 拖拽效果 */
.drag-over {
    background: #e3f2fd;
    border: 2px dashed #2196f3;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}