/* ============================================================
   团队工作报告管理系统 - 样式
   设计理念：专业、清爽、结果导向
   ============================================================ */

/* ---- CSS 变量 ---- */
:root {
    --primary: #1a56db;
    --primary-light: #e8f0fe;
    --success: #059669;
    --success-light: #d1fae5;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --sidebar-width: 240px;
    --topbar-height: 60px;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,.1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    display: flex;
    min-height: 100vh;
}

/* ---- 侧边栏 ---- */
#sidebar {
    width: var(--sidebar-width);
    background: var(--gray-900);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow-y: auto;
}
.sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.logo { font-size: 20px; font-weight: 700; }
.subtitle { font-size: 11px; color: var(--gray-500); margin-top: 6px; }

#nav-menu { flex: 1; padding: 12px 0; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px; color: var(--gray-300);
    text-decoration: none; font-size: 14px;
    transition: all .15s; border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.active {
    background: rgba(255,255,255,.1); color: #fff;
    border-left-color: var(--primary);
}
.nav-icon { font-size: 18px; width: 24px; text-align: center; }

.sidebar-footer {
    padding: 12px 20px; border-top: 1px solid rgba(255,255,255,.1);
    font-size: 12px; color: var(--gray-500); display: flex; align-items: center; gap: 6px;
}
.status-dot { font-size: 10px; }
.status-dot.online { color: var(--success); }
.status-dot.offline { color: var(--danger); }

/* ---- 主内容 ---- */
#main-content {
    margin-left: var(--sidebar-width);
    flex: 1; display: flex; flex-direction: column;
    min-height: 100vh;
}
#topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    position: sticky; top: 0; z-index: 50;
}
#page-title { font-size: 18px; font-weight: 600; }
#page-container { flex: 1; padding: 24px; overflow-y: auto; }

/* ---- 卡片 ---- */
.card {
    background: #fff; border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px;
}
.card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-100);
}
.card-header h3 { font-size: 16px; font-weight: 600; }

/* ---- 统计卡片 ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff; border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 20px;
    display: flex; align-items: center; gap: 14px;
}
.stat-icon { font-size: 32px; }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-label { font-size: 13px; color: var(--gray-500); }

/* ---- 表单 ---- */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block; font-size: 14px; font-weight: 500;
    margin-bottom: 6px; color: var(--gray-700);
}
.form-group label .hint {
    font-weight: 400; font-size: 12px; color: var(--gray-500);
}
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 10px 14px;
    border: 1px solid var(--gray-300); border-radius: var(--radius);
    font-size: 14px; font-family: inherit;
    transition: border-color .15s;
    background: #fff;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-textarea { min-height: 80px; resize: vertical; }

/* ---- 按钮 ---- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius);
    font-size: 14px; font-weight: 500; cursor: pointer;
    border: 1px solid transparent;
    transition: all .15s; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #1e40af; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #047857; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #b45309; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-outline { background: #fff; color: var(--gray-700); border-color: var(--gray-300); }
.btn-outline:hover { background: var(--gray-50); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- 表格 ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
    text-align: left; padding: 10px 14px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 13px;
}
th { font-weight: 600; color: var(--gray-500); font-size: 12px; text-transform: uppercase; }
tr:hover { background: var(--gray-50); }

/* ---- 徽章 ---- */
.badge {
    display: inline-block; padding: 2px 8px; border-radius: 12px;
    font-size: 11px; font-weight: 600;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-gray { background: var(--gray-100); color: var(--gray-500); }

/* ---- 看板 ---- */
.kanban { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col {
    flex: 1; min-width: 240px; max-width: 320px;
    background: var(--gray-100); border-radius: var(--radius); padding: 12px;
}
.kanban-col-header {
    font-weight: 600; font-size: 13px; padding: 4px 8px 12px;
    display: flex; justify-content: space-between;
}
.kanban-card {
    background: #fff; border-radius: var(--radius);
    padding: 12px; margin-bottom: 8px;
    box-shadow: var(--shadow); cursor: pointer;
    transition: box-shadow .15s;
}
.kanban-card:hover { box-shadow: var(--shadow-lg); }
.kanban-card h4 { font-size: 14px; margin-bottom: 4px; }
.kanban-card .meta { font-size: 12px; color: var(--gray-500); }

/* ---- Toast ---- */
#toast-container {
    position: fixed; top: 16px; right: 16px; z-index: 9999;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    padding: 12px 20px; border-radius: var(--radius);
    color: #fff; font-size: 14px;
    box-shadow: var(--shadow-lg);
    animation: slideIn .3s ease;
    max-width: 360px;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--primary); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---- Modal ---- */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.4); z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}
.modal-box {
    background: #fff; border-radius: var(--radius);
    box-shadow: var(--shadow-lg); width: 90%; max-width: 600px;
    max-height: 80vh; overflow-y: auto;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-bottom: 1px solid var(--gray-200);
}
.modal-header h3 { font-size: 16px; }
.modal-close {
    background: none; border: none; font-size: 20px;
    cursor: pointer; color: var(--gray-500);
}
.modal-close:hover { color: var(--gray-900); }
#modal-body { padding: 20px; }

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    #sidebar {
        width: 100%; height: auto; position: fixed; top: 0; left: 0; z-index: 500;
        flex-direction: column; overflow-y: auto; max-height: 100vh;
        display: none;
    }
    #sidebar.show { display: flex; }
    .sidebar-header { display: none; }
    #nav-menu { display: flex; flex-wrap: wrap; }
    .nav-item { padding: 8px 12px; font-size: 12px; border-left: none; border-bottom: 2px solid transparent; }
    .nav-item.active { border-left: none; border-bottom-color: var(--primary); }
    .sidebar-footer { display: none; }
    #main-content { margin-left: 0; }
    #topbar { padding: 0 12px; }
    #page-container { padding: 12px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .kanban { flex-direction: column; }
    .kanban-col { max-width: 100%; }
    .menu-toggle { display: inline-flex !important; }
}
.menu-toggle { display: none; align-items: center; gap: 4px; padding: 4px 10px;
    background: var(--primary); color: #fff; border: none; border-radius: 6px;
    font-size: 13px; cursor: pointer; }

/* ---- 加载动画 ---- */
.loading-spinner {
    display: inline-block; width: 24px; height: 24px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- 空状态 ---- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--gray-500); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* ---- 贡献导向日报的高亮样式 ---- */
.contribution-highlight {
    background: linear-gradient(to right, #fef3c7, #fffbeb);
    border-left: 3px solid var(--warning);
    padding: 10px 14px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 8px 0;
}
.result-tag {
    display: inline-block;
    background: var(--success-light);
    color: var(--success);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}
