/* ==================== 基础重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-dark: #0d3a5c;
    --primary: #1a5f8a;
    --primary-light: #3b9eff;
    --bg: #f0f2f5;
    --card-bg: #ffffff;
    --text: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --border: #e0e0e0;
    --success: #52c41a;
    --warning: #faad14;
    --danger: #ff4d4f;
    --sidebar-w: 240px;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

/* ==================== 登录页面 ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d3a5c 0%, #1a5f8a 50%, #0d3a5c 100%);
    position: relative;
    overflow: hidden;
}

.login-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(59, 158, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(59, 158, 255, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 40% 80%, rgba(59, 158, 255, 0.06) 0%, transparent 40%);
}

.login-container {
    background: rgba(255, 255, 255, 0.98);
    padding: 48px 40px 32px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 420px;
    max-width: 90%;
    position: relative;
    z-index: 1;
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 18px;
    color: var(--primary-dark);
    font-weight: 600;
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
}

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

.login-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.login-form input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 158, 255, 0.12);
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: var(--primary-dark);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.btn-login:hover {
    background: var(--primary);
}

.login-error {
    color: var(--danger);
    font-size: 13px;
    margin-bottom: 12px;
    text-align: center;
}

.login-hint {
    text-align: center;
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-light);
}

.login-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.login-footer p {
    font-size: 12px;
    color: var(--text-light);
}

/* ==================== 主界面布局 ==================== */
.main-app {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-w);
    background: var(--primary-dark);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 20px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-title {
    font-size: 15px;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: var(--radius);
    margin-bottom: 4px;
    transition: all 0.2s;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
    color: #fff;
    background: rgba(59, 158, 255, 0.2);
    border-left: 3px solid var(--primary-light);
}

.nav-item span {
    font-size: 14px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
}

.user-role {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.btn-logout {
    width: 100%;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(255, 77, 79, 0.2);
    color: #fff;
    border-color: rgba(255, 77, 79, 0.3);
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-bar {
    height: 56px;
    background: #fff;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar h2 {
    font-size: 17px;
    color: var(--primary-dark);
    font-weight: 600;
}

.current-time {
    font-size: 13px;
    color: var(--text-light);
}

.page-content {
    padding: 24px;
    flex: 1;
}

/* ==================== 工作台统计卡片 ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-blue .stat-icon { background: #e6f4ff; color: #1677ff; }
.stat-orange .stat-icon { background: #fff7e6; color: #fa8c16; }
.stat-green .stat-icon { background: #f6ffed; color: #52c41a; }
.stat-purple .stat-icon { background: #f9f0ff; color: #722ed1; }
.stat-cyan .stat-icon { background: #e6fffb; color: #13c2c2; }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}

.stat-label {
    font-size: 13px;
    color: var(--text-light);
}

/* ==================== 仪表盘面板 ==================== */
.dashboard-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.dashboard-panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 16px;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-header h3 {
    font-size: 15px;
    color: var(--primary-dark);
    font-weight: 600;
}

.panel-body {
    padding: 12px 20px;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-title {
    font-size: 14px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 12px;
}

.list-item-meta {
    font-size: 12px;
    color: var(--text-light);
    flex-shrink: 0;
}

.empty-state {
    text-align: center;
    padding: 32px;
    color: var(--text-light);
    font-size: 14px;
}

/* ==================== 工具栏 ==================== */
.page-toolbar {
    margin-bottom: 16px;
    display: flex;
    justify-content: flex-end;
}

.btn-primary {
    background: var(--primary-dark);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary);
}

.btn-secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

.btn-danger {
    background: #fff;
    color: var(--danger);
    border: 1px solid #ffccc7;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

/* ==================== 数据表格 ==================== */
.data-table-container {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    background: #fafafa;
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: #f0f7ff;
}

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

/* 标签 */
.tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.tag-normal { background: #f0f0f0; color: #666; }
.tag-high { background: #fff1f0; color: #ff4d4f; }
.tag-medium { background: #fff7e6; color: #fa8c16; }
.tag-low { background: #f6ffed; color: #52c41a; }
.tag-info { background: #e6f4ff; color: #1677ff; }
.tag-success { background: #f6ffed; color: #52c41a; }
.tag-warning { background: #fff7e6; color: #fa8c16; }

/* ==================== 任务卡片 ==================== */
.task-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.task-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--border);
    transition: box-shadow 0.2s;
}

.task-card:hover {
    box-shadow: var(--shadow-lg);
}

.task-card.priority-high { border-left-color: var(--danger); }
.task-card.priority-medium { border-left-color: var(--warning); }
.task-card.priority-low { border-left-color: var(--success); }

.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.task-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.task-card-body {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

.task-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-light);
}

.task-status {
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending { background: #f0f0f0; color: #999; }
.status-in_progress { background: #e6f4ff; color: #1677ff; }
.status-completed { background: #f6ffed; color: #52c41a; }

/* ==================== 文档网格 ==================== */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.doc-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.doc-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.doc-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    background: #e6f4ff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1677ff;
}

.doc-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-meta {
    font-size: 12px;
    color: var(--text-light);
}

/* ==================== 日程时间线 ==================== */
.schedule-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.schedule-item {
    background: #fff;
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    border-left: 4px solid var(--primary-light);
}

.schedule-date {
    text-align: center;
    min-width: 64px;
}

.schedule-date .day {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
}

.schedule-date .month {
    font-size: 12px;
    color: var(--text-light);
}

.schedule-info {
    flex: 1;
}

.schedule-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.schedule-time {
    font-size: 13px;
    color: var(--text-secondary);
}

.schedule-location {
    font-size: 12px;
    color: var(--text-light);
}

/* ==================== 通讯录 ==================== */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.contact-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow 0.2s;
}

.contact-card:hover {
    box-shadow: var(--shadow-lg);
}

.contact-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    flex-shrink: 0;
}

.contact-info {
    flex: 1;
    overflow: hidden;
}

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

.contact-detail {
    font-size: 13px;
    color: var(--text-secondary);
}

.contact-detail span {
    margin-right: 12px;
}

/* ==================== 模态框 ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s;
}

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

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 480px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

.modal-large {
    width: 640px;
}

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

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 17px;
    color: var(--primary-dark);
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 表单 */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 158, 255, 0.12);
}

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

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .sidebar {
        width: 64px;
    }
    .sidebar-title,
    .nav-item span,
    .user-details {
        display: none;
    }
    .main-content {
        margin-left: 64px;
    }
    .dashboard-row {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}
