/* 基本样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 顶部导航栏 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.admin-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.admin-name {
    color: #4caf50;
    font-weight: 600;
    font-size: 0.9rem;
}

.logout-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #d32f2f;
    transform: translateY(-1px);
}

.login-btn {
    background: #2196f3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.login-btn:hover {
    background: #1976d2;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.5);
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header h1 i {
    color: #667eea;
}

.add-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

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

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

/* 搜索容器 */
.search-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 1.1rem;
}

.search-box input {
    width: 100%;
    padding: 15px 45px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    background: white;
}

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

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #4a5568;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

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

/* 项目网格 */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.project-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 5px;
}

.project-category {
    display: inline-block;
    background: #f7fafc;
    color: #667eea;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.edit-btn {
    background: #e6fffa;
    color: #319795;
}

.edit-btn:hover {
    background: #319795;
    color: white;
}

.delete-btn {
    background: #fed7d7;
    color: #e53e3e;
}

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

.project-description {
    color: #4a5568;
    font-size: 0.95rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag {
    background: #edf2f7;
    color: #4a5568;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 20px;
    background: #f7fafc;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.project-link:hover {
    background: #667eea;
    color: white;
    transform: translateX(5px);
}

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

.empty-state i {
    font-size: 4rem;
    color: #cbd5e0;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #2d3748;
}

.empty-state p {
    font-size: 1rem;
    color: #718096;
}

.empty-state.hidden {
    display: none;
}

/* 模态框 */
.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(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #a0aec0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f7fafc;
    color: #4a5568;
}

.modal-body {
    padding: 30px;
}

form {
    padding: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

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

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    padding: 20px 30px;
    border-top: 1px solid #e2e8f0;
    background: #f7fafc;
}

.btn-cancel {
    background: #edf2f7;
    color: #4a5568;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: #e2e8f0;
}

.btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

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

.btn-delete {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(229, 62, 62, 0.4);
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 62, 62, 0.6);
}

/* 登录相关样式 */
.setup-password-hint {
    padding: 20px 30px;
    border-top: 1px solid #e2e8f0;
    background: #f7fafc;
    text-align: center;
}

.setup-password-hint p {
    margin: 0;
    color: #4a5568;
    font-size: 0.9rem;
}

.setup-password-hint a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.setup-password-hint a:hover {
    text-decoration: underline;
}

/* 访客模式提示 */
.visitor-notice {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.visitor-notice i {
    color: #ff9800;
    font-size: 1.2rem;
}

.visitor-notice-text {
    color: #e65100;
    font-size: 0.9rem;
    font-weight: 500;
}

/* 隐藏的管理员操作按钮 */
.project-actions.visitor-mode {
    display: none;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .admin-info {
        justify-content: center;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .project-card {
        padding: 20px;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .modal-header,
    .modal-body,
    form {
        padding: 20px;
    }
    
    .form-actions {
        padding: 15px 20px;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.25rem;
    }
    
    .add-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .project-title {
        font-size: 1.1rem;
    }
    
    .project-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .action-btn {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
}

/* 分类管理样式 */
.category-management {
    margin-top: 15px;
    text-align: center;
}

.manage-categories-btn {
    background: #4a5568;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.manage-categories-btn:hover {
    background: #2d3748;
    transform: translateY(-1px);
}

.category-form {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 25px;
    margin-bottom: 25px;
}

.category-form h3 {
    margin: 0 0 15px 0;
    color: #2d3748;
    font-size: 1.1rem;
}

.category-list h3 {
    margin: 0 0 15px 0;
    color: #2d3748;
    font-size: 1.1rem;
}

.category-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.category-item:hover {
    background: #edf2f7;
}

.category-item-name {
    font-weight: 500;
    color: #2d3748;
    flex-grow: 1;
}

.category-item-actions {
    display: flex;
    gap: 8px;
}

.category-action-btn {
    background: none;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.category-edit-btn {
    color: #2b6cb0;
    background: rgba(43, 108, 176, 0.1);
}

.category-edit-btn:hover {
    background: rgba(43, 108, 176, 0.2);
}

.category-delete-btn {
    color: #c53030;
    background: rgba(197, 48, 48, 0.1);
}

.category-delete-btn:hover {
    background: rgba(197, 48, 48, 0.2);
}

.category-edit-form {
    display: none;
    margin-top: 10px;
}

.category-edit-form.active {
    display: block;
}

.category-edit-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.category-edit-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.category-save-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.category-save-btn:hover {
    background: #38a169;
}

.category-cancel-btn {
    background: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.category-cancel-btn:hover {
    background: #cbd5e0;
}

.no-categories {
    text-align: center;
    padding: 30px;
    color: #718096;
    font-style: italic;
}

/* 加载状态样式 */
.loading-state {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 30px 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 16px;
    color: #4a5568;
    backdrop-filter: blur(5px);
}

.loading-state i {
    font-size: 20px;
    color: #667eea;
}

/* 网络状态指示器 */
.network-status {
    position: fixed;
    bottom: 20px;
    left: 20px;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    z-index: 1500;
    display: none;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.network-status.online {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.network-status.offline {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.network-status.slow {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* 消息提示增强样式 */
.message {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.message div {
    margin: 2px 0;
}

.message i {
    flex-shrink: 0;
    margin-top: 2px;
}

/* 重试按钮样式 */
.retry-button {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.retry-button:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

/* 缓存状态提示 */
.cache-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: #e65100;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
}

/* 空状态增强 */
.empty-state.network-error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
}

.empty-state.network-error i {
    color: #e53e3e;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .loading-state {
        width: 90%;
        padding: 20px;
        font-size: 14px;
    }
    
    .network-status {
        bottom: 10px;
        left: 10px;
        font-size: 11px;
        padding: 8px 12px;
    }
    
    .message {
        max-width: 90%;
        right: 5%;
        font-size: 13px;
    }
} 