/* ============================================================
   千阙云庭 - 任务管理系统 样式
   ============================================================ */

/* --- 基础重置 --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #3370ff;
    --primary-hover: #2860e1;
    --success: #00b578;
    --warning: #ff8f1f;
    --danger: #f54a45;
    --bg: #f5f6fa;
    --card-bg: #ffffff;
    --text: #1f2329;
    --text-secondary: #646a73;
    --text-tertiary: #8f959e;
    --border: #dee0e3;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: 0.2s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
        "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* --- 头部导航 --- */
.header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.logo { display: flex; align-items: center; gap: 8px; }
.logo-icon { font-size: 28px; }
.logo-text { font-size: 20px; font-weight: 700; color: var(--primary); }
.logo-sub {
    font-size: 13px;
    color: var(--text-tertiary);
    padding-left: 8px;
    border-left: 1px solid var(--border);
    line-height: 1;
}
.header-right { display: flex; align-items: center; gap: 12px; }

/* --- 主布局 --- */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 24px;
    padding: 24px;
    min-height: calc(100vh - 56px);
}

/* --- 侧边栏 --- */
.sidebar {
    width: 220px;
    flex-shrink: 0;
}
.side-nav {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: sticky;
    top: 80px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 15px;
    text-decoration: none;
    user-select: none;
}
.nav-item:hover { background: #f0f2ff; color: var(--primary); }
.nav-item.active { background: #eef1ff; color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
.nav-icon { font-size: 18px; }

/* --- 内容区 --- */
.content { flex: 1; min-width: 0; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.section-header h2 { font-size: 22px; font-weight: 700; }

/* --- 筛选栏 --- */
.filter-bar { display: flex; gap: 10px; }
.filter-select {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
}
.filter-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(51,112,255,0.15); }

/* --- 任务卡片网格 --- */
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

/* --- 任务卡片 --- */
.task-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.task-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.task-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    flex: 1;
}
.task-type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}
.badge-program   { background: #e8f0fe; color: #1a73e8; }
.badge-art       { background: #fce8e6; color: #ea4335; }
.badge-design    { background: #fef7e0; color: #e37400; }
.badge-operation { background: #e6f4ea; color: #009944; }
.badge-admin     { background: #f3e8fd; color: #9334e6; }

.task-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}
.task-card-meta span { display: flex; align-items: center; gap: 4px; }

.task-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
}
.status-open      { background: #e6f4ea; color: #009944; }
.status-full      { background: #fef7e0; color: #e37400; }
.status-closed    { background: #f0f0f0; color: #8f959e; }
.status-completed { background: #e8f0fe; color: #1a73e8; }

.creator-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-tertiary);
}
.creator-info .avatar { width: 22px; height: 22px; border-radius: 50%; }

/* --- 按钮 --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #009a64; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dd3c38; }
.btn-outline { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-outline:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { display: flex; width: 100%; justify-content: center; }
.btn-feishu {
    background: #3370ff;
    color: #fff;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
}

/* --- 用户区域 --- */
.user-info { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.user-name { font-size: 15px; font-weight: 500; }
.user-roles { font-size: 12px; color: var(--text-tertiary); }

/* --- 表单 --- */
.form-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 28px;
    max-width: 660px;
}
.form-group { margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 14px; font-weight: 500; color: var(--text); }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.required { color: var(--danger); }
.form-input {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text);
    background: var(--card-bg);
    transition: var(--transition);
    font-family: inherit;
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(51,112,255,0.15); }
.form-textarea { resize: vertical; min-height: 100px; }

/* --- 上传区域 --- */
.upload-area {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
}
.upload-area:hover { border-color: var(--primary); background: #f8f9ff; }
.upload-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-placeholder { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-tertiary); font-size: 14px; }
.image-preview { max-width: 100%; max-height: 200px; border-radius: var(--radius); object-fit: contain; }

/* --- 弹窗 --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
.modal {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 640px;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.25s ease;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 18px; font-weight: 600; }
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-tertiary);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}
.modal-close:hover { background: #f0f0f0; color: var(--text); }
.modal-body { padding: 24px; }
.modal-body .task-meta-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; font-size: 14px; }
.modal-body .task-meta-row .meta-item { display: flex; gap: 4px; }
.modal-body .task-meta-row .meta-label { color: var(--text-tertiary); }
.modal-body .task-meta-row .meta-value { color: var(--text); font-weight: 500; }
.modal-body .task-description {
    background: var(--bg);
    padding: 16px;
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    margin-bottom: 16px;
}
.modal-body .task-image { max-width: 100%; border-radius: var(--radius); margin-bottom: 16px; }
.modal-body .claim-list h4 { font-size: 15px; margin-bottom: 10px; }
.modal-body .claim-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.modal-body .claim-item:last-child { border: none; }
.modal-body .claim-item img { width: 28px; height: 28px; border-radius: 50%; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* --- 用户管理 --- */
.user-list { display: flex; flex-direction: column; gap: 10px; }
.user-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.user-card-left { display: flex; align-items: center; gap: 12px; }
.user-card-info { display: flex; flex-direction: column; gap: 2px; }
.user-card-name { font-size: 15px; font-weight: 500; }
.user-card-meta { font-size: 13px; color: var(--text-tertiary); display: flex; gap: 8px; flex-wrap: wrap; }
.user-card-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* --- 分页 --- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}
.pagination button {
    padding: 8px 14px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: var(--transition);
}
.pagination button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* --- Toast --- */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    z-index: 2000;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s ease;
}
.toast.success { background: var(--success); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }

/* --- 加载 --- */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-tertiary);
    font-size: 15px;
}

/* --- 复选框组 (任务类型多选) --- */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
    background: var(--card-bg);
}
.checkbox-label:hover { border-color: var(--primary); }
.checkbox-label input[type="checkbox"]:checked ~ *,
.checkbox-label:has(input:checked) { background: #eef2ff; border-color: var(--primary); color: var(--primary); }

/* --- 开关式复选框 --- */
.form-toggle { flex-direction: row; align-items: center; }
.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
}
.toggle-text { user-select: none; }

/* --- 高级搜索 --- */
.advanced-search {
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.search-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.search-input {
    flex: 1;
    min-width: 150px;
}

/* --- 未登录保密遮罩 --- */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.login-overlay-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 48px 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 420px;
    width: 90%;
}
.login-overlay-icon {
    font-size: 56px;
    margin-bottom: 16px;
}
.login-overlay-card h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}
.login-overlay-card p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.6;
}

/* --- 统计报表 --- */
.report-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.report-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.report-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.report-month { font-size: 15px; font-weight: 500; }
.report-meta { font-size: 12px; color: var(--text-tertiary); }

/* --- 响应式 --- */
@media (max-width: 768px) {
    .main-container { flex-direction: column; padding: 12px; }
    .sidebar { width: 100%; }
    .side-nav { display: flex; flex-wrap: wrap; position: static; }
    .nav-item { flex: 1; min-width: 80px; justify-content: center; font-size: 13px; padding: 12px 8px; border-left: none; border-bottom: 2px solid transparent; }
    .nav-item.active { border-left: none; border-bottom-color: var(--primary); }
    .task-grid { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; }
    .header-inner { padding: 0 12px; }
    .logo-sub { display: none; }
}

/* --- 动画 --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
