* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "Segoe UI", sans-serif; background: #f0f2f5; color: #1f2329; }
.hidden { display: none !important; }
.muted { color: #8a919f; font-size: 13px; }

/* 顶栏 */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; background: #1f2329; color: #fff; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo { height: 36px; width: auto; }
.topbar h1 { font-size: 18px; font-weight: 600; }
.stats span { margin-left: 18px; font-size: 13px; background: rgba(255,255,255,.12); padding: 4px 12px; border-radius: 12px; }
.stats .warn { color: #ffb02e; }

/* 布局 */
.layout { display: flex; min-height: calc(100vh - 52px); }
.sidebar { width: 300px; background: #fff; border-right: 1px solid #e5e6eb; padding: 16px; overflow-y: auto; }
.content { flex: 1; padding: 24px; overflow-y: auto; }

.sidebar-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.sidebar-head h2 { font-size: 15px; }

/* 按钮 */
.btn { border: 1px solid #d0d3da; background: #fff; color: #1f2329; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn:hover { border-color: #3370ff; color: #3370ff; }
.btn.primary { background: #3370ff; border-color: #3370ff; color: #fff; }
.btn.primary:hover { background: #2f66e0; color: #fff; }
.btn.danger { color: #d54941; border-color: #f0c7c4; }
.btn.danger:hover { border-color: #d54941; }
.btn.small { padding: 4px 10px; font-size: 12px; }

/* 项目列表 */
.project-item { padding: 12px; border: 1px solid #e5e6eb; border-radius: 8px; margin-bottom: 10px; cursor: pointer; transition: all .15s; }
.project-item:hover { border-color: #3370ff; }
.project-item.active { border-color: #3370ff; background: #f0f6ff; }
.project-item .p-name { font-weight: 600; font-size: 14px; }
.project-item .p-meta { font-size: 12px; color: #8a919f; margin-top: 6px; display: flex; justify-content: space-between; }
.project-item .p-status { font-size: 11px; padding: 1px 8px; border-radius: 8px; background: #e8f3e5; color: #4e8d3e; }
.project-item .p-status.archived { background: #f0f0f0; color: #8a919f; }

/* 详情 */
.detail-head { background: #fff; border-radius: 10px; padding: 20px; margin-bottom: 16px; display: flex; justify-content: space-between; }
.detail-head h2 { font-size: 20px; }
.detail-head p { margin: 8px 0; }
.detail-actions .btn { margin-left: 8px; }
.progress-bar { width: 260px; height: 8px; background: #e5e6eb; border-radius: 4px; overflow: hidden; }
.progress-bar > div { height: 100%; background: #3370ff; transition: width .3s; }

.section { background: #fff; border-radius: 10px; padding: 18px; margin-bottom: 16px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.section-head h3 { font-size: 15px; }

/* 成员 */
.member-list { display: flex; flex-wrap: wrap; gap: 8px; }
.member-tag { display: inline-flex; align-items: center; gap: 6px; background: #f2f3f5; border-radius: 14px; padding: 4px 12px; font-size: 13px; }
.member-tag .role { color: #8a919f; font-size: 12px; }
.member-tag .leader-badge { color: #b45a1b; background: #fdeedb; border-radius: 8px; padding: 0 6px; font-size: 12px; }
.member-tag .del { cursor: pointer; color: #d54941; margin-left: 4px; }

/* 看板 */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kanban-col { background: #f7f8fa; border-radius: 10px; padding: 10px; min-height: 220px; }
.col-head { font-weight: 600; font-size: 14px; padding: 6px 8px; }
.col-body { min-height: 180px; }
.task-card { background: #fff; border: 1px solid #e5e6eb; border-radius: 8px; padding: 12px; margin-bottom: 10px; cursor: pointer; }
.task-card:hover { box-shadow: 0 2px 8px rgba(31,35,41,.08); }
.task-card .t-title { font-size: 14px; font-weight: 500; }
.task-card .t-meta { font-size: 12px; color: #8a919f; margin-top: 8px; display: flex; justify-content: space-between; align-items: center; }
.task-card .t-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 10px; padding-top: 8px; border-top: 1px solid #f2f3f5; }
.task-card .t-actions .btn { padding: 3px 10px; font-size: 12px; }
.task-card .t-project { display: inline-block; font-size: 11px; color: #1f6feb; background: #e8f1ff; border-radius: 4px; padding: 2px 8px; margin-bottom: 8px; }
#taskbox-view { display: flex; flex-direction: column; gap: 16px; }
.priority { font-size: 11px; padding: 1px 8px; border-radius: 8px; }
.priority.high { background: #ffece8; color: #d54941; }
.priority.medium { background: #fff7e6; color: #d48806; }
.priority.low { background: #e8f3e5; color: #4e8d3e; }
.due.overdue { color: #d54941; font-weight: 600; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 10px; width: 480px; max-width: 92vw; max-height: 90vh; overflow-y: auto; padding: 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-close { border: none; background: none; font-size: 22px; cursor: pointer; color: #8a919f; }
.form-item { margin-bottom: 12px; }
.form-item label { display: block; font-size: 13px; color: #4e5969; margin-bottom: 5px; }
.form-item input, .form-item select, .form-item textarea { width: 100%; padding: 8px 10px; border: 1px solid #d0d3da; border-radius: 6px; font-size: 13px; font-family: inherit; }
.form-item textarea { resize: vertical; min-height: 60px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.empty-tip { text-align: center; color: #8a919f; margin-top: 120px; font-size: 15px; }

/* 登录界面 */
.login-mask { position: fixed; inset: 0; background: #f0f2f5; display: flex; align-items: center; justify-content: center; z-index: 200; }
.login-box { background: #fff; border-radius: 12px; width: 360px; padding: 36px 32px; box-shadow: 0 8px 30px rgba(31,35,41,.12); }
.login-box .login-logo { display: block; margin: 0 auto 14px; max-width: 220px; max-height: 56px; width: auto; height: auto; }
.login-box h2 { text-align: center; font-size: 20px; margin-bottom: 4px; }
.login-box .muted { text-align: center; margin-bottom: 24px; }
.remember-row { margin-bottom: 4px !important; }
.remember-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #4e5969; cursor: pointer; margin-bottom: 0 !important; }
.remember-label input[type="checkbox"] { width: auto; margin: 0; }
.btn-block { width: 100%; padding: 10px; font-size: 15px; }
.login-error { color: #d54941; font-size: 13px; margin-bottom: 10px; text-align: center; }

/* 用户区 */
.user-area { display: flex; align-items: center; gap: 8px; }
.current-user { font-size: 13px; background: rgba(255,255,255,.12); padding: 4px 12px; border-radius: 12px; }
.btn.ghost { background: transparent; border-color: rgba(255,255,255,.35); color: #fff; }
.btn.ghost:hover { border-color: #fff; color: #fff; }

/* 角色徽标 */
.role-badge { font-size: 12px; padding: 3px 10px; border-radius: 10px; }
.role-badge:empty { display: none; }
.role-badge.super { background: #fff0e6; color: #b25e00; border: 1px solid #ffd4a8; }

/* 用户管理表格 */
.user-table-wrap { max-height: 360px; overflow-y: auto; margin: 10px 0; }
.user-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.user-table th, .user-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #eee; }
.user-table th { background: #f7f8fa; color: #666; font-weight: 500; white-space: nowrap; }
.user-table td.ops { white-space: nowrap; }
.user-table select { padding: 4px 8px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; }
.user-table .btn.small { padding: 3px 8px; font-size: 12px; }
.user-table .btn.ghost { background: #fff; border-color: #d0d3da; color: #1f2329; }
.user-table .btn.ghost:hover { border-color: #3370ff; color: #3370ff; }
.user-table .btn.danger { color: #e5484d; border-color: #f3b9bb; }
.user-table .btn.danger:hover { background: #fdebec; }

/* 项目周期（阶段） */
.phase-list { display: flex; flex-direction: column; gap: 8px; }
.phase-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border: 1px solid #e5e6eb; border-radius: 8px; padding: 12px 14px; }
.phase-main { flex: 1; min-width: 0; }
.phase-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.phase-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #c9cdd4; }
.phase-dot.active { background: #3370ff; box-shadow: 0 0 0 3px rgba(51,112,255,.15); }
.phase-desc { font-size: 12px; color: #4e5969; margin-top: 4px; }
.phase-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: #4e5969; margin-top: 6px; flex-wrap: wrap; }
.phase-review { font-size: 12px; color: #b25e00; background: #fff7e6; border-radius: 4px; padding: 2px 8px; margin-top: 6px; }
.mini-progress { width: 90px; height: 6px; background: #e5e6eb; border-radius: 3px; overflow: hidden; }
.mini-progress > div { height: 100%; background: #3370ff; }
.phase-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.btn.ghost.light { background: #fff; border-color: #d0d3da; color: #1f2329; }
.btn.ghost.light:hover { border-color: #3370ff; color: #3370ff; }
.phase-status { font-size: 11px; padding: 1px 8px; border-radius: 8px; font-weight: 400; }
.ph-st-notstarted { background: #f2f3f5; color: #8a919f; }
.ph-st-inprogress { background: #e8f0fe; color: #3370ff; }
.ph-st-pending { background: #fff7e6; color: #d48806; }
.ph-st-approved { background: #e8f3e5; color: #4e8d3e; }
.ph-st-rejected { background: #ffece8; color: #d54941; }

/* 阶段模板 */
.template-item { border: 1px solid #e5e6eb; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; transition: all .15s; }
.template-item:hover { border-color: #3370ff; background: #f0f6ff; }
.template-name { font-size: 14px; font-weight: 600; }

/* 交付物 / 文档 */
.deliverable-item { border: 1px solid #e5e6eb; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.deliverable-item .dl-name { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.doc-version { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: #f2f3f5; color: #4e5969; }
.doc-status { font-size: 11px; padding: 1px 8px; border-radius: 8px; }
.doc-st-draft { background: #f2f3f5; color: #8a919f; }
.doc-st-submitted { background: #fff7e6; color: #d48806; }
.doc-st-published { background: #e8f3e5; color: #4e8d3e; }
.doc-st-obsolete { background: #f2f3f5; color: #a9aeb8; text-decoration: line-through; }
.doc-st-adminreview { background: #e8f0fe; color: #3370ff; }
.doc-upload-box { background: #f7f8fa; border: 1px dashed #d0d3da; border-radius: 8px; padding: 10px; }

/* 审批中心入口角标 */
.badge { display: inline-block; min-width: 16px; height: 16px; line-height: 16px; margin-left: 4px; padding: 0 4px; border-radius: 8px; background: #d54941; color: #fff; font-size: 11px; text-align: center; vertical-align: middle; }

/* 文档三级审批流程条：①提交审批 → ②项目负责人审核 → ③管理员批准 */
.doc-approval-flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; background: #f7f8fa; border-radius: 6px; padding: 6px 8px; margin: 6px 0 2px; font-size: 12px; }
.apf-step { display: inline-flex; align-items: center; gap: 5px; color: #8a919f; }
.apf-step .apf-dot { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid #c9cdd4; background: #fff; color: #a9aeb8; font-size: 10px; flex: none; }
.apf-step .apf-tx { display: inline-flex; flex-direction: column; line-height: 1.25; }
.apf-step .apf-tx em { font-style: normal; font-size: 11px; color: #a9aeb8; }
.apf-step.apf-done { color: #1f2329; }
.apf-step.apf-done .apf-dot { background: #52c41a; border-color: #52c41a; color: #fff; }
.apf-step.apf-done .apf-tx em { color: #4e5969; }
.apf-step.apf-current { color: #3370ff; font-weight: 600; }
.apf-step.apf-current .apf-dot { background: #3370ff; border-color: #3370ff; color: #fff; }
.apf-step.apf-current .apf-tx em { color: #3370ff; font-weight: 400; }
.apf-arrow { color: #c9cdd4; }
.apf-obsolete { font-size: 11px; color: #a9aeb8; border: 1px solid #d0d3da; border-radius: 8px; padding: 1px 8px; }
.doc-reject-note { font-size: 12px; color: #d54941; background: #ffece8; border-radius: 4px; padding: 4px 8px; margin-top: 4px; }

