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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 98%;
    margin: 0 auto;
}

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

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

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

/* 添加小组区域 - 放在底部，低调样式 */
.add-group-section {
    display: flex;
    gap: 10px;
    max-width: 500px;
    margin: 40px auto 20px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.add-group-section:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.12);
}

#groupNameInput {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
}

#groupNameInput:focus {
    outline: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    background: white;
}

/* 按钮样式 */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

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

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #da190b;
}

.btn-secondary {
    background: #9e9e9e;
    color: white;
}

.btn-secondary:hover {
    background: #757575;
}

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

/* 底部添加小组按钮样式 */
#addGroupBtn {
    padding: 12px 20px;
    font-size: 0.95rem;
    white-space: nowrap;
}

/* 看板容器 */
.board-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 0 20px;
}

/* 小组卡片 */
.group-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    animation: slideIn 0.4s ease;
}

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

.group-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* 小组头部 */
.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.group-name-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.group-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.group-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 拖拽手柄 */
.drag-handle {
    cursor: move;
    color: #999;
    font-size: 0.9rem;
    user-select: none;
    padding: 3px;
    transition: color 0.3s ease;
}

.drag-handle:hover {
    color: #667eea;
}

.drag-handle-small {
    cursor: move;
    color: #999;
    font-size: 0.75rem;
    user-select: none;
    padding: 2px;
    margin-right: 5px;
    transition: color 0.3s ease;
}

.drag-handle-small:hover {
    color: #667eea;
}

/* 编辑按钮 */
.edit-group-btn,
.edit-project-btn {
    background: transparent;
    border: none;
    color: #2196F3;
    font-size: 0.9rem;
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.edit-group-btn:hover,
.edit-project-btn:hover {
    background: #e3f2fd;
    opacity: 1;
    transform: scale(1.1);
}

.delete-group-btn {
    background: transparent;
    border: none;
    color: #f44336;
    font-size: 1.1rem;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.delete-group-btn:hover {
    background: #ffebee;
    transform: rotate(90deg);
    opacity: 1;
}

/* 添加项目区域 */
.add-project-section {
    margin-bottom: 15px;
}

.add-project-form {
    display: flex;
    gap: 10px;
}

.project-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: border-color 0.3s ease;
}

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

/* 项目列表 */
.projects-list {
    list-style: none;
    min-height: 50px;
}

.project-item {
    background: #f8f9fa;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
    cursor: move;
    gap: 8px;
}

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

.project-item.dragging {
    opacity: 0.5;
    background: #e3f2fd;
}

.project-name {
    font-size: 0.9rem;
    color: #333;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: text;
}

.project-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.delete-project-btn {
    background: transparent;
    border: none;
    color: #f44336;
    font-size: 0.9rem;
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.delete-project-btn:hover {
    background: #ffebee;
    opacity: 1;
    transform: scale(1.1);
}

/* 拖拽样式 */
.group-card {
    cursor: default;
}

.drag-placeholder {
    pointer-events: none;
}

/* 编辑输入框 */
.edit-input {
    border: 2px solid #667eea !important;
    outline: none !important;
}

.group-name-text,
.project-name-text {
    cursor: text;
    user-select: text;
}

.group-name-text:hover,
.project-name-text:hover {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 3px;
    padding: 2px 4px;
}

/* 空状态 */
.empty-state {
    display: none;
    text-align: center;
    color: white;
    padding: 60px 20px;
    animation: fadeIn 0.5s ease;
}

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

.empty-state.show {
    display: block;
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.empty-state p {
    font-size: 1.3rem;
    opacity: 0.9;
}

.empty-projects {
    text-align: center;
    padding: 20px;
    color: #999;
    font-style: italic;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.5rem;
}

.modal-content p {
    margin-bottom: 25px;
    color: #666;
    font-size: 1.1rem;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .board-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .board-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .add-group-section {
        flex-direction: column;
    }

    .board-container {
        grid-template-columns: 1fr;
    }

    .group-name {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .group-card {
        padding: 20px;
    }

    .modal-content {
        padding: 20px;
    }

    .modal-buttons {
        flex-direction: column;
    }

    .modal-buttons .btn {
        width: 100%;
    }
}

/* 项目数量徽章 */
.project-count {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* 通知提示 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    animation: slideInRight 0.3s ease;
}

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

.notification.fade-out {
    animation: fadeOut 0.3s ease;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

.notification-success {
    background: #4CAF50;
}

.notification-error {
    background: #f44336;
}

.notification-warning {
    background: #ff9800;
}

.notification-info {
    background: #2196F3;
}

