/* Apple Design System - Project Management */

:root {
    --apple-black: #000000;
    --apple-white: #ffffff;
    --apple-gray-light: #f5f5f7;
    --apple-gray-dark: #1d1d1f;
    --apple-blue: #0071e3;
    --apple-blue-hover: #0077ed;
    --text-primary: #1d1d1f;
    --text-secondary: rgba(0, 0, 0, 0.8);
    --text-tertiary: rgba(0, 0, 0, 0.48);
    --shadow-card: rgba(0, 0, 0, 0.22) 3px 5px 30px 0px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--apple-gray-light);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.47;
    letter-spacing: -0.374px;
    -webkit-font-smoothing: antialiased;
}

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

/* Empty Projects State */
.empty-projects-state {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 64px 24px;
}

.empty-projects-content {
    text-align: center;
    max-width: 400px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 24px;
}

.empty-projects-content h3 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.empty-projects-content p {
    font-size: 17px;
    color: var(--text-tertiary);
    margin-bottom: 32px;
}

.empty-projects-content .btn {
    padding: 14px 28px;
    font-size: 17px;
    border-radius: 980px;
}

/* Header */
header { text-align: center; margin-bottom: 64px; padding: 32px 0; }
header h1 {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
    font-size: 48px; font-weight: 600; line-height: 1.07;
    letter-spacing: -0.28px; color: var(--apple-black); margin-bottom: 12px;
}
header p { font-size: 21px; font-weight: 400; line-height: 1.19; color: var(--text-secondary); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 48px; }
@media (max-width: 1024px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr; } }

.stat-card {
    background: var(--apple-white); border-radius: 8px; padding: 24px;
    box-shadow: var(--shadow-card); transition: transform 0.3s ease;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-label { font-size: 14px; color: var(--text-tertiary); margin-bottom: 8px; }
.stat-value { font-size: 40px; font-weight: 600; line-height: 1.1; color: var(--apple-black); }
.stat-value.accent { color: var(--apple-blue); }
.stat-value.success { color: #10b981; }
.stat-value.warning { color: #ff9500; }

/* Toolbar */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; flex-wrap: wrap; gap: 16px; }

/* Filter Buttons - Pill Style */
.filter-group { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn {
    padding: 8px 16px; border: none; background: var(--apple-white);
    border-radius: 980px; font-size: 14px; color: var(--text-secondary);
    cursor: pointer; transition: all 0.2s ease; font-family: inherit;
}
.filter-btn:hover { background: var(--apple-gray-light); color: var(--apple-black); }
.filter-btn.active { background: var(--apple-black); color: var(--apple-white); }

/* Buttons */
.btn { padding: 8px 16px; border-radius: 980px; font-size: 14px; cursor: pointer; transition: all 0.2s ease; border: none; font-family: inherit; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary { background: var(--apple-blue); color: var(--apple-white); }
.btn-primary:hover { background: var(--apple-blue-hover); }

/* View Toggle */
.view-toggle { display: flex; gap: 4px; background: var(--apple-white); padding: 4px; border-radius: 980px; box-shadow: var(--shadow-card); }
.view-btn { padding: 6px 16px; border: none; background: transparent; border-radius: 980px; cursor: pointer; color: var(--text-secondary); font-size: 14px; transition: all 0.2s ease; }
.view-btn.active { background: var(--apple-black); color: var(--apple-white); }

/* Card */
.card { background: var(--apple-white); border-radius: 8px; box-shadow: var(--shadow-card); overflow: hidden; }

/* Kanban */
.kanban-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; padding: 24px; }
@media (max-width: 1024px) { .kanban-board { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .kanban-board { grid-template-columns: 1fr; } }

.column { background: var(--apple-gray-light); border-radius: 8px; padding: 16px; min-height: 400px; }
.column-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid rgba(0,0,0,0.1); }
.column-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.column-count { background: var(--apple-white); padding: 2px 8px; border-radius: 980px; font-size: 12px; color: var(--text-secondary); }

/* Task List & Cards */
.task-list { display: flex; flex-direction: column; gap: 12px; }
.task-card {
    background: var(--apple-white); border-radius: 8px; padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); cursor: pointer;
    transition: all 0.2s ease;
}
.task-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-card); }
.task-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.task-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-tertiary); }

/* Tags */
.task-tag { display: inline-block; padding: 3px 10px; border-radius: 980px; font-size: 11px; font-weight: 500; }
.tag-planning { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.tag-design { background: rgba(0, 113, 227, 0.1); color: var(--apple-blue); }
.tag-development { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.tag-completed { background: rgba(0,0,0,0.05); color: var(--text-tertiary); }

/* Priority */
.priority-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.priority-high { background: #ff3b30; }
.priority-medium { background: #ff9500; }
.priority-low { background: #34c759; }

/* Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center;
    z-index: 1000; opacity: 0; visibility: hidden; transition: all 0.3s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal { background: var(--apple-white); border-radius: 8px; width: 90%; max-width: 500px; padding: 32px; transform: translateY(20px); transition: all 0.3s ease; }
.modal-overlay.active .modal { transform: translateY(0); }
.modal h2 { font-size: 24px; font-weight: 600; margin-bottom: 24px; }

/* Form */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px 16px; border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px; font-size: 14px; font-family: inherit;
    transition: border-color 0.2s ease; background: var(--apple-white);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--apple-blue);
    box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.2);
}
.form-group textarea { resize: vertical; min-height: 100px; }

/* Modal Actions */
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }
.btn-secondary { background: var(--apple-gray-light); color: var(--text-secondary); }
.btn-secondary:hover { background: rgba(0,0,0,0.1); }
.btn-danger { background: rgba(255, 59, 48, 0.1); color: #ff3b30; }
.btn-danger:hover { background: #ff3b30; color: white; }

/* Empty State */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-tertiary); }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: 0.5; }

/* View States */
.list-view { display: none; }
.list-view.active { display: block; }
.kanban-view { display: grid; }
.kanban-view.hidden, #kanbanView.hidden { display: none; }

.list-view .task-card { margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.list-view .task-info { flex: 1; }

/* Column Indicators */
.column[data-status="planning"] .column-title::before { content: ''; width: 8px; height: 8px; background: #8b5cf6; border-radius: 50%; }
.column[data-status="design"] .column-title::before { content: ''; width: 8px; height: 8px; background: var(--apple-blue); border-radius: 50%; }
.column[data-status="development"] .column-title::before { content: ''; width: 8px; height: 8px; background: #10b981; border-radius: 50%; }
.column[data-status="completed"] .column-title::before { content: ''; width: 8px; height: 8px; background: var(--text-tertiary); border-radius: 50%; }

/* Project Selector */
.header-left { position: relative; }
.header-center { 
    flex: 1; 
    text-align: center; 
}
header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    text-align: left; 
    margin-bottom: 48px; 
    padding: 24px 0;
}
header h1 { display: none; }

.project-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--apple-white);
    border-radius: 980px;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: all 0.2s ease;
}
.project-selector:hover { transform: translateY(-1px); }
.project-selector .project-icon { font-size: 16px; }
.project-selector .project-name { 
    font-size: 16px; 
    font-weight: 600; 
    color: var(--text-primary);
}
.project-selector svg { color: var(--text-tertiary); }

/* Project Dropdown */
.project-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 280px;
    background: var(--apple-white);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    padding: 8px;
}
.project-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.project-list { max-height: 320px; overflow-y: auto; }
.project-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.project-item:hover { background: var(--apple-gray-light); }
.project-item.active { background: rgba(0, 113, 227, 0.1); }
.project-item .project-icon { 
    width: 32px; 
    height: 32px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background: var(--apple-gray-light);
    border-radius: 8px;
    font-size: 14px;
}
.project-item.add-project .project-icon { 
    background: var(--apple-blue); 
    color: white;
    font-weight: 600;
}
.project-info { flex: 1; }
.project-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.project-task-count { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.project-edit-btn {
    opacity: 0;
    padding: 4px 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    border-radius: 4px;
    transition: opacity 0.2s ease;
}
.project-item:hover .project-edit-btn {
    opacity: 1;
}
.project-edit-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}
.check-icon { 
    width: 20px; 
    height: 20px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    background: var(--apple-blue);
    color: white;
    border-radius: 50%;
    font-size: 12px;
}

.header-right p { font-size: 14px; color: var(--text-tertiary); }

/* ========================================
   Apple Design System - Auth Page
   ======================================== */

.auth-page {
    background: var(--apple-black);
    min-height: 100vh;
    overflow: hidden;
}

.auth-page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    position: relative;
}

/* Background Pattern */
.auth-bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 113, 227, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(0, 113, 227, 0.08), transparent);
    pointer-events: none;
    z-index: 0;
}

/* Header */
.auth-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.auth-brand {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.28px;
    color: var(--apple-white);
    margin: 0 0 12px 0;
}

.auth-tagline {
    font-size: 42px;
    font-weight: 300;
    line-height: 1.2;
    letter-spacing: -0.5px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

/* Page Subtitle (内页副标题) */
.page-subtitle {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 42px;
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -0.28px;
    color: var(--apple-black);
    margin: 0;
    text-align: center;
}



/* Page Title Wrapper */
.page-title-wrapper {
    text-align: center;
}

/* Main Card */
.auth-main {
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 40px;
}

/* Navigation */
.auth-nav {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 28px;
}

.auth-nav-item {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.25s ease;
}

.auth-nav-item:hover {
    color: rgba(255, 255, 255, 0.7);
}

.auth-nav-item.active {
    background: rgba(255, 255, 255, 0.95);
    color: var(--apple-black);
}

/* Message */
.auth-message {
    margin-bottom: 20px;
}

.auth-message-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

.auth-message-content.error {
    background: rgba(255, 69, 58, 0.15);
    border: 1px solid rgba(255, 69, 58, 0.3);
    color: #ff453a;
}

.auth-message-content.success {
    background: rgba(48, 209, 88, 0.15);
    border: 1px solid rgba(48, 209, 88, 0.3);
    color: #30d158;
}

.auth-message-content svg {
    flex-shrink: 0;
}

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

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-field label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: -0.08px;
}

.form-field input {
    width: 100%;
    padding: 15px 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    font-size: 16px;
    color: var(--apple-white);
    transition: all 0.2s ease;
}

.form-field input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-field input:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.form-field input:focus {
    outline: none;
    border-color: var(--apple-blue);
    background: rgba(0, 113, 227, 0.1);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

/* Primary Button */
.btn-auth-primary {
    width: 100%;
    padding: 15px 24px;
    background: var(--apple-blue);
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 500;
    color: var(--apple-white);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.btn-auth-primary:hover {
    background: #0077ed;
    transform: translateY(-1px);
}

.btn-auth-primary:active {
    transform: translateY(0);
    background: #006edb;
}

/* Focus State */
.btn-auth-primary:focus-visible,
.auth-nav-item:focus-visible,
.form-field input:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.4);
}

/* Footer Links */
.auth-footer-links {
    margin-top: 28px;
    text-align: center;
}

.auth-link {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: var(--apple-blue);
}

/* ICP 备案号 */
.auth-icp {
    margin-top: 20px;
    text-align: center;
}

.auth-icp a {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-icp a:hover {
    color: rgba(255, 255, 255, 0.6);
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--apple-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--apple-white);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    min-width: 200px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    padding: 8px;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 8px;
}

.user-email {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
}

.user-role {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s ease;
}

.user-dropdown-item:hover {
    background: var(--apple-gray-light);
}

.user-dropdown-item.danger {
    color: #dc2626;
}

.user-dropdown-item.danger:hover {
    background: #fef2f2;
}

/* App Container */
.app-container {
    display: none;
}

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

.auth-container.hidden {
    display: none;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 480px) {
    .auth-brand {
        font-size: 32px;
    }
    
    .auth-tagline {
        font-size: 15px;
    }
    
    .auth-card {
        padding: 28px 20px;
        border-radius: 14px;
    }
    
    .form-field input {
        padding: 14px 16px;
        font-size: 16px;
    }
    
    .btn-auth-primary {
        padding: 14px 20px;
        font-size: 16px;
    }
}

/* ========================================
   Admin Settings Page
   ======================================== */

/* Admin page uses the same .container as main page (max-width: 1200px) */

.admin-card {
    background: var(--apple-white);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.admin-card-header {
    padding: 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.admin-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.admin-card-title svg {
    color: var(--apple-blue);
}

.admin-card-desc {
    font-size: 14px;
    color: var(--text-tertiary);
    margin: 0;
}

.user-list {
    padding: 16px;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.user-item:hover {
    background: var(--apple-gray-light);
}

.user-item + .user-item {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--apple-blue);
    color: white;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
}

.user-id-display {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.wecom-id-value {
    font-family: monospace;
    color: var(--text-secondary);
}

.user-action {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wecom-id-input {
    width: 200px;
    padding: 10px 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wecom-id-input:focus {
    outline: none;
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.2);
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
    white-space: nowrap;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--text-tertiary);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--apple-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--apple-black);
    color: var(--apple-white);
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: #10b981;
}

.toast.error {
    background: #ef4444;
}

/* Responsive */
@media (max-width: 640px) {
    .user-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .user-action {
        width: 100%;
    }
    
    .wecom-id-input {
        flex: 1;
    }
}

/* ========================================
   Tools Menu (外部工具入口)
   ======================================== */
.tools-menu {
    position: relative;
}

.tools-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--apple-white);
    border-radius: 980px;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.tools-trigger:hover {
    transform: translateY(-1px);
}

.tools-trigger .tools-dropdown-arrow {
    color: var(--text-tertiary);
    transition: transform 0.2s ease;
}

.tools-menu.active .tools-trigger .tools-dropdown-arrow {
    transform: rotate(180deg);
}

.tools-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 200px;
    background: var(--apple-white);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100;
    padding: 8px;
}

.tools-menu.active .tools-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tools-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease;
}

.tools-dropdown-item:hover {
    background: var(--apple-gray-light);
}

.tools-dropdown-item .external-icon {
    margin-left: auto;
    color: var(--text-tertiary);
}

/* ========================================
   仪表台样式
   ======================================== */

/* Tab 切换 */
.admin-tabs {
    display: flex;
    gap: 4px;
    background: var(--apple-white);
    padding: 4px;
    border-radius: 980px;
    box-shadow: var(--shadow-card);
    margin-bottom: 48px;
    width: fit-content;
}

.admin-tab {
    padding: 10px 24px;
    border: none;
    background: transparent;
    border-radius: 980px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-tab:hover {
    background: var(--apple-gray-light);
    color: var(--apple-black);
}

.admin-tab.active {
    background: var(--apple-black);
    color: var(--apple-white);
}

/* Tab 内容区 */
.admin-tab-content {
    display: none;
}

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

/* 仪表台容器 */
.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* 区块标题 */
.dashboard-section {
    background: var(--apple-white);
    border-radius: 12px;
    box-shadow: var(--shadow-card);
    padding: 24px;
}

.dashboard-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.dashboard-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* 筛选器 */
.dashboard-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dashboard-filter-select {
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-secondary);
    background: var(--apple-white);
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.dashboard-filter-select:focus {
    outline: none;
    border-color: var(--apple-blue);
}

.dashboard-filter-input {
    padding: 8px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-secondary);
    width: 180px;
    transition: border-color 0.2s ease;
}

.dashboard-filter-input:focus {
    outline: none;
    border-color: var(--apple-blue);
}

/* 表格 */
.dashboard-table-wrapper {
    overflow-x: auto;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.dashboard-table th {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--text-tertiary);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
}

.dashboard-table tbody tr:hover {
    background: var(--apple-gray-light);
}

.dashboard-table tbody tr:last-child td {
    border-bottom: none;
}

/* 描述列截断样式 */
.desc-cell {
    max-width: 300px;
    position: relative;
    cursor: default;
}

.desc-truncated {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.desc-cell:hover .desc-truncated {
    white-space: normal;
    overflow: visible;
}

.desc-cell:hover {
    position: relative;
    z-index: 10;
    background: var(--apple-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 8px 12px;
}

.table-loading {
    text-align: center;
    color: var(--text-tertiary);
    padding: 32px 16px !important;
}

/* 按钮小型 */
.btn-small {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
    white-space: nowrap;
}

.btn-secondary {
    background: var(--apple-gray-light);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* 辅助样式 */
.text-tertiary { color: var(--text-tertiary); }
.text-overdue { color: #ff3b30; font-weight: 600; }

.task-count-badge {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(0, 113, 227, 0.1);
    color: var(--apple-blue);
    border-radius: 980px;
    font-size: 13px;
    font-weight: 600;
}

/* 每周任务视图 */
.weekly-view-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.weekly-loading {
    text-align: center;
    color: var(--text-tertiary);
    padding: 32px;
    width: 100%;
}

.week-column {
    min-width: 200px;
    background: var(--apple-gray-light);
    border-radius: 12px;
    padding: 16px;
    flex-shrink: 0;
}

.week-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    text-align: center;
}

.week-task-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.week-task-item {
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    font-weight: 500;
    line-height: 1.3;
}

.week-task-item:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.week-task-item.planning {
    background: #8b5cf6;
}

.week-task-item.design {
    background: var(--apple-blue);
}

.week-task-item.development {
    background: #10b981;
}

.week-task-item.completed {
    background: var(--text-tertiary);
}

.week-task-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* 负责人视图 */
.assignee-view-container {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.assignee-loading {
    text-align: center;
    color: var(--text-tertiary);
    padding: 32px;
    width: 100%;
}

.assignee-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--apple-gray-light);
    border-radius: 12px;
    padding: 16px 20px;
    min-width: 260px;
    flex: 1;
    transition: transform 0.2s ease;
}

.assignee-card:hover {
    transform: translateY(-2px);
}

.assignee-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--apple-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
}

.assignee-info {
    flex: 1;
}

.assignee-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.assignee-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.assignee-stat {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 980px;
    font-weight: 500;
}

.assignee-stat.total {
    background: rgba(0, 113, 227, 0.1);
    color: var(--apple-blue);
}

.assignee-stat.planning {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.assignee-stat.design {
    background: rgba(0, 113, 227, 0.1);
    color: var(--apple-blue);
}

.assignee-stat.development {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.assignee-stat.completed {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-tertiary);
}

.assignee-stat.overdue {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
}

/* 任务详情模态框（仪表台专用） */
.dashboard-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.dashboard-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.dashboard-modal {
    background: var(--apple-white);
    border-radius: 12px;
    width: 90%;
    max-width: 520px;
    padding: 32px;
    transform: translateY(20px);
    transition: all 0.3s ease;
    position: relative;
}

.dashboard-modal-overlay.active .dashboard-modal {
    transform: translateY(0);
}

.dashboard-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--apple-gray-light);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    font-size: 16px;
}

.dashboard-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.dashboard-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-right: 40px;
}

.dashboard-modal-field {
    margin-bottom: 16px;
}

.dashboard-modal-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.dashboard-modal-value {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

.dashboard-modal-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    background: var(--apple-gray-light);
    padding: 12px;
    border-radius: 8px;
    margin-top: 4px;
}

/* 响应式 */
@media (max-width: 768px) {
    .admin-tabs {
        width: 100%;
        justify-content: center;
    }

    .dashboard-filters {
        width: 100%;
    }

    .dashboard-filter-input {
        width: 100%;
    }

    .assignee-card {
        min-width: 100%;
    }

    .week-column {
        min-width: 160px;
    }
}