* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f4f6f9; color: #2c3e50; }
a { color: #2d6cdf; text-decoration: none; }

.navbar { background: #1f2a44; color: #fff; }
.nav-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; padding: 0 16px; height: 54px; gap: 24px; }
.brand { font-size: 17px; font-weight: 700; color: #fff; }
.nav-links { display: flex; gap: 16px; flex: 1; }
.nav-links a { color: #cfd8ea; font-size: 14px; padding: 6px 4px; }
.nav-links a:hover { color: #fff; }
.nav-sep { color: #46546e; }
.nav-user { color: #cfd8ea; font-size: 14px; display: flex; gap: 12px; align-items: center; }
.nav-user a { color: #9db8ff; }

.container { max-width: 1200px; margin: 20px auto; padding: 0 16px; }
.flash { background: #e8f4fd; border: 1px solid #b8ddf7; color: #1f5f8b; padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 14px; }

.card { background: #fff; border-radius: 10px; padding: 18px; box-shadow: 0 1px 4px rgba(0,0,0,.06); margin-bottom: 16px; }
.card h2 { font-size: 18px; margin-bottom: 12px; }
.page-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.page-title h1 { font-size: 22px; }

.btn { display: inline-block; background: #2d6cdf; color: #fff; border: none; border-radius: 6px; padding: 7px 14px; font-size: 14px; cursor: pointer; }
.btn:hover { background: #245bbd; }
.btn.secondary { background: #fff; color: #2c3e50; border: 1px solid #cfd6e0; }
.btn.danger { background: #d9534f; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }

table.grid { width: 100%; border-collapse: collapse; background: #fff; }
table.grid th, table.grid td { border: 1px solid #e6e9ef; padding: 8px 10px; font-size: 14px; text-align: left; }
table.grid th { background: #f7f9fc; font-weight: 600; }
table.grid tr:hover td { background: #fafbfe; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.tag.todo { background: var(--ui-todo-bg,#e8eaf0); color: var(--ui-todo-tx,#555f72); }
.tag.doing { background: var(--ui-doing-bg,#fff3d6); color: var(--ui-doing-tx,#a07000); }
.tag.done { background: var(--ui-done-bg,#d9f2e0); color: var(--ui-done-tx,#1c7c3c); }
.tag.overdue { background: var(--ui-overdue-bg,#fde2e2); color: var(--ui-overdue-tx,#c03535); }

.chip { display: inline-block; background: #edf1fa; color: #2c3e50; border-radius: 6px; padding: 2px 8px; font-size: 13px; }

/* ---- 日历视图 ---- */
.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-nav .cal-title { font-size: 20px; font-weight: 700; min-width: 180px; }
.view-btns .btn { margin-left: 6px; }
.view-btns .btn.active { background: #1f2a44; }

.cal-grid { display: grid; gap: 1px; background: #e6e9ef; border: 1px solid #e6e9ef; border-radius: 8px; overflow: hidden; }
.cal-month { grid-template-columns: repeat(7, 1fr); }
.cal-day-head, .cal-cell { background: #fff; }
.cal-day-head { text-align: center; font-size: 13px; color: #6b7688; padding: 8px 0; font-weight: 600; }
.cal-cell { min-height: 96px; padding: 5px; font-size: 13px; }
.cal-cell .d { color: #6b7688; font-size: 12px; margin-bottom: 4px; }
.cal-cell.other-month { background: #fafbfc; }
.cal-cell.other-month .d { color: #c3c9d4; }
.cal-cell.today { background: #f0f6ff; }
.cal-cell.today .d { color: #2d6cdf; font-weight: 700; }
.cal-cell .task-item { display: block; border-radius: 4px; padding: 2px 6px; margin-bottom: 3px; font-size: 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-item.todo { background: var(--ui-todo-bg,#e8eaf0); color: var(--ui-todo-tx,#555f72); }
.task-item.doing { background: var(--ui-doing-bg,#fff3d6); color: var(--ui-doing-tx,#8a6200); }
.task-item.done { background: var(--ui-done-bg,#d9f2e0); color: var(--ui-done-tx,#1c7c3c); text-decoration: line-through; }
.task-item.overdue { border-left: 3px solid var(--ui-overdue,#c03535); }

.cal-week { grid-template-columns: repeat(7, 1fr); }
.cal-week .cal-cell { min-height: 380px; }
.cal-day { grid-template-columns: 1fr; }
.cal-day .cal-cell { min-height: 560px; }
.cal-year { grid-template-columns: repeat(4, 1fr); gap: 14px; background: transparent; border: none; }
.year-month { background: #fff; border-radius: 8px; padding: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.year-month .ym-title { text-align: center; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.year-month .cal-cell { min-height: 34px; padding: 2px; font-size: 11px; }
.year-month .cal-cell .d { font-size: 11px; }
.year-month .task-item { font-size: 10px; padding: 1px 4px; }

.cal-multi { grid-template-columns: repeat(7, 1fr); }
.member-task { border-radius: 4px; padding: 2px 6px; margin-bottom: 3px; font-size: 12px; cursor: pointer; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- 甘特图 ---- */
.gantt-wrap { overflow-x: auto; }
.gantt { min-width: 900px; }
.gantt-row { display: flex; border-bottom: 1px solid #eceff4; min-height: 46px; align-items: center; }
.gantt-row.head { background: #f7f9fc; font-weight: 600; min-height: 34px; }
.gantt-label { width: 160px; flex-shrink: 0; padding: 6px 10px; font-size: 14px; }
.gantt-track { position: relative; flex: 1; height: 46px; }
.gantt-track.head { height: 34px; }
.gantt-gridline { position: absolute; top: 0; bottom: 0; border-left: 1px solid #f0f2f6; font-size: 10px; color: #b6bec9; padding-top: 2px; padding-left: 3px; }
.gantt-bar { position: absolute; top: 8px; height: 30px; border-radius: 6px; font-size: 12px; padding: 0 8px; line-height: 30px; cursor: pointer; overflow: hidden; white-space: nowrap; color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.gantt-bar.todo { background: var(--ui-todo,#8f9bb3); }
.gantt-bar.doing { background: var(--ui-doing,#e6a23c); }
.gantt-bar.done { background: var(--ui-done,#67c23a); }
.gantt-bar.overdue { outline: 2px solid var(--ui-overdue,#c03535); }
.gantt-row .row-title { width: 160px; flex-shrink: 0; padding: 0 10px; font-size: 14px; font-weight: 600; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border-radius: 10px; padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.stat .num { font-size: 28px; font-weight: 700; }
.stat .lbl { color: #6b7688; font-size: 13px; margin-top: 2px; }

/* ---- 表单/弹窗 ---- */
.modal-mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 50; align-items: center; justify-content: center; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 460px; max-width: 92vw; max-height: 88vh; overflow: auto; padding: 20px; }
.modal h3 { margin-bottom: 14px; font-size: 17px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 13px; color: #555f72; margin-bottom: 4px; }
.form-row input[type=text], .form-row input[type=date], .form-row input[type=password], .form-row select, .form-row textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #cfd6e0; border-radius: 6px; font-size: 14px; font-family: inherit; }
.form-row textarea { min-height: 70px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

.comment-box { margin-top: 14px; border-top: 1px solid #eceff4; padding-top: 12px; }
.comment-item { font-size: 13px; padding: 6px 0; border-bottom: 1px dashed #f0f2f6; }
.comment-item .c-author { font-weight: 600; margin-right: 8px; }
.comment-item .c-time { color: #9aa3b2; font-size: 12px; }
.comment-item .c-content { margin-top: 2px; color: #3a4556; }
.comment-input { display: flex; gap: 8px; margin-top: 10px; }
.comment-input input { flex: 1; padding: 8px 10px; border: 1px solid #cfd6e0; border-radius: 6px; font-size: 14px; }

.auth-wrap { max-width: 420px; margin: 60px auto; }
.auth-card { background: #fff; border-radius: 12px; padding: 28px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.auth-card h1 { font-size: 20px; margin-bottom: 4px; }
.auth-sub { color: #6b7688; font-size: 13px; margin-bottom: 18px; }
.auth-demo { margin-top: 16px; background: #f7f9fc; border-radius: 8px; padding: 12px; font-size: 13px; color: #555f72; }
.login-footer { text-align: center; font-size: 13px; margin-top: 16px; }

.flex-between { display: flex; justify-content: space-between; align-items: center; }
.muted { color: #6b7688; font-size: 13px; }
.alert-err { background: #fde2e2; color: #c03535; padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; font-size: 14px; }

/* 任务编辑列表小行 */
.task-mini { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid #f0f2f6; font-size: 14px; cursor: pointer; }
.task-mini:hover { background: #fafbfe; }

/* ---- Outlook 贯穿色带（月/周视图） ---- */
.cal-week-row { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: #e6e9ef; }
.cal-week-row .cal-cell { min-height: 0; padding: 6px; }
.cal-month .cal-week-row { grid-column: 1 / -1; }
.cal-week .cal-week-row { grid-column: 1 / -1; min-height: 420px; }
.cal-lane-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.cal-lane { position: absolute; height: 22px; border-radius: 6px; padding: 0 6px; font-size: 12px; line-height: 22px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; pointer-events: auto; box-shadow: 0 1px 2px rgba(0,0,0,.10); }
.cal-lane.todo { background: var(--ui-todo,#8f9bb3); }
.cal-lane.doing { background: var(--ui-doing,#e6a23c); }
.cal-lane.done { background: var(--ui-done,#67c23a); text-decoration: line-through; }
.cal-lane.overdue { background: var(--ui-overdue,#d9534f); box-shadow: 0 1px 2px rgba(0,0,0,.12), inset 0 0 0 2px #b03a35; }
.cal-lane.clip-left { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-lane.clip-right { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-more { position: absolute; right: 8px; bottom: 5px; font-size: 11px; color: #6b7688; background: rgba(255,255,255,.88); border-radius: 4px; padding: 1px 7px; pointer-events: none; z-index: 3; }

/* ---- 日历内嵌甘特视图 ---- */
.cal-grid.cal-gantt { display: block; background: #fff; border: 1px solid #e6e9ef; overflow: auto; }
.cal-gantt .gantt-wrap { overflow-x: auto; }
.cal-gantt .gantt { min-width: 860px; border-bottom: 1px solid #eceff4; }
.cal-gantt .gantt-row:last-child { border-bottom: none; }

/* ---- 团队全年甘特（team_calendar：左侧人员，一人一行） ---- */
.tcal-scroll { overflow-x: auto; border: 1px solid #e6e9ef; border-radius: 10px; background: #fff; }
.tcal-grid { display: inline-block; min-width: 100%; }
.tcal-row { display: flex; border-bottom: 1px solid #eceff4; align-items: stretch; }
.tcal-row:last-child { border-bottom: none; }
.tcal-head { position: sticky; top: 0; z-index: 5; background: #f7f9fc; font-weight: 600; }
.tcal-person { flex: 0 0 200px; padding: 8px 12px; background: #fbfcfe; border-right: 1px solid #e6e9ef; position: sticky; left: 0; z-index: 4; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.tcal-head .tcal-person { font-size: 13px; color: #6b7688; justify-content: center; }
.tcal-dept { font-size: 11px; color: #9aa3b2; }
.tcal-name { font-size: 14px; font-weight: 600; color: #2c3e50; display: flex; align-items: center; gap: 6px; }
.tcal-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.tcal-me { font-style: normal; background: #2d6cdf; color: #fff; border-radius: 8px; font-size: 10px; padding: 0 6px; line-height: 16px; }
.tcal-count { font-size: 11px; color: #9aa3b2; font-weight: 400; }
.tcal-track-head { position: relative; flex: 0 0 auto; display: flex; }
.tcal-month-cell { position: relative; flex: 0 0 auto; height: 38px; border-right: 1px solid #e6e9ef; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #6b7688; background: #f7f9fc; overflow: hidden; }
.tcal-track { position: relative; flex: 0 0 auto; min-height: 40px; }
.tcal-mline { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid #eef1f6; pointer-events: none; }
.tcal-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid #e8635a; pointer-events: none; z-index: 2; }
.tcal-empty { position: absolute; top: 14px; left: 12px; font-size: 12px; color: #c3c9d4; }
.tcal-row .cal-lane { height: 20px; line-height: 20px; font-size: 12px; }

/* ===== 团队日志矩阵视图 ===== */
.tl-toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:12px}
.tl-mode-btns{display:flex;gap:4px;background:#eef2f7;border-radius:8px;padding:3px}
.tl-mode-btns .btn{border:none;background:transparent;border-radius:6px;color:#4a5568}
.tl-mode-btns .btn.active{background:#fff;box-shadow:0 1px 4px rgba(15,23,42,.12);color:#1a5cff;font-weight:600}
.tl-viewport{overflow:auto;border:1px solid #e6eaf2;border-radius:12px;background:#fff;max-height:70vh}
.tl-grid{display:grid;min-width:max-content;position:relative}
.tl-head{position:sticky;top:0;z-index:3;background:#f4f6fb;border-bottom:1px solid #e3e8f2;font-size:11px;color:#5b6472;font-weight:600;display:flex;align-items:center;justify-content:center;padding:4px 2px;border-right:1px solid #eef1f7}
.tl-head.today{background:#e8f0ff;color:#1a5cff}
.tl-corner{position:sticky;left:0;top:0;z-index:6;background:#eef2f8;font-weight:700;padding:8px 12px;border-right:1px solid #dfe5ef;border-bottom:1px solid #dfe5ef;white-space:nowrap}
.tl-row-head{position:sticky;left:0;z-index:2;background:#fff;display:flex;align-items:center;gap:6px;padding:6px 12px;border-bottom:1px solid #eef1f7;border-right:1px solid #e3e8f2;min-width:170px}
.tl-row-head .tl-dept{font-size:10px;color:#8a93a6;background:#f1f4fa;border-radius:4px;padding:1px 5px;white-space:nowrap}
.tl-row-head .tl-user{font-weight:600;white-space:nowrap}
.tl-cell{cursor:pointer;border-bottom:1px solid #f1f4f9;border-right:1px solid #f1f4f9;min-height:56px;padding:3px 4px;font-size:11px;background:#fff;transition:background .12s;display:block;overflow:hidden}
.tl-cell:hover{background:#f2f7ff}
.tl-cell.today{background:#f5f9ff;box-shadow:inset 0 0 0 1px #9fc0ff}
.tl-cell.no-log{background:#fbfcfe}
.tl-cell .tl-badge{display:inline-block;border-radius:5px;padding:1px 6px;font-size:10px;font-weight:600;margin-bottom:3px}
.tl-badge.ok{background:var(--ui-logok-bg,#e5f6e8);color:var(--ui-logok-tx,#1c7c3c)}
.tl-badge.draft{background:var(--ui-logdraft-bg,#e8f0ff);color:var(--ui-logdraft-tx,#1a5cff)}
.tl-cell .tl-text{color:#4a5568;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-all;white-space:pre-wrap}
.tl-legend{display:flex;gap:14px;font-size:11px;color:#5b6472;margin-top:8px;flex-wrap:wrap}
.tl-legend i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:4px;vertical-align:-1px}
/* 日志详情弹窗 */
.td-body{padding:4px 2px}
.td-log-box{background:#f7f9fc;border-radius:10px;padding:10px 14px;margin:8px 0;white-space:pre-wrap;color:#2f3a4d;font-size:13px;line-height:1.7}
.td-task-row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:7px 2px;border-bottom:1px dashed #edf0f6;font-size:13px}
.td-task-row:last-child{border-bottom:none}
.td-comment{display:none}

/* ===== 法定节假日标注（红底=节假日，「班」=调休补班） ===== */
.cal-cell.holiday{background:#fdeceb !important}
.cal-cell.holiday .d{color:#c0392b}
.cal-cell.holiday.today{box-shadow:inset 0 0 0 2px #e8635a}
.cal-cell.other-month.holiday{background:#fbf3f2 !important}
.cal-cell.makeup-work .d{color:#c07b00}
.h-badge{display:inline-block;margin-left:4px;font-style:normal;font-size:10px;background:#c0392b;color:#fff;border-radius:4px;padding:0 4px;line-height:14px;vertical-align:1px}
.mk-badge{display:inline-block;margin-left:3px;font-style:normal;font-size:9px;background:#e6a23c;color:#fff;border-radius:3px;padding:0 3px;line-height:12px;vertical-align:1px}
.cal-year .h-badge,.cal-year .mk-badge{display:none}

/* ===== 颜色规则管理弹窗（状态区 / 关键词区分区） ===== */
.cr-section-title{font-size:13px;font-weight:600;color:#2c3e50;margin:14px 0 6px}
.cr-section-title .muted{font-weight:400}
.cr-table{width:100%;border-collapse:collapse;font-size:13px}
.cr-table th{text-align:left;padding:6px 8px;border-bottom:1px solid #e3e8f0;color:#6b7688;font-weight:600}
.cr-table td{padding:6px 8px;border-bottom:1px solid #eef2f8}
.cr-st-cell{background:#fafcff}

/* ===== 团队日历：忙闲徽标与空闲行 ===== */
.tcal-badge{border-radius:8px;font-size:10px;line-height:15px;padding:0 7px;font-weight:600;white-space:nowrap;margin-left:6px}
.tcal-badge.busy{background:var(--ui-busy-bg,#e5f6e8);color:var(--ui-busy-tx,#1c7c3c)}
.tcal-badge.done{background:var(--ui-logok-bg,#eef1f6);color:var(--ui-logok-tx,#8a93a6)}
.tcal-badge.idle{background:var(--ui-idle-bg,#fff4e2);color:var(--ui-idle-tx,#b06a00)}
.tcal-row.idle .tcal-person{background:#fbfaf6}
.tcal-row.idle .tcal-name{color:#9aa3b2}

/* ============ 品牌顶栏（企业视觉） ============ */
:root{
  --brand-red:#b12a2a;
  --brand-ink:#1a2332;
  --navy:#1f2a44;
  --bg:#f5f7fa;
  --card-shadow:0 2px 10px rgba(26,35,50,.06);
}
html,body{background:var(--bg);}
.topbar{background:#ffffff;border-bottom:1px solid #e6eaf1;}
.topbar-inner{max-width:1240px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:9px 20px;}
.brand{display:flex;align-items:center;gap:14px;color:var(--brand-ink) !important;text-decoration:none;}
.brand-logo{height:36px;width:auto;object-fit:contain;display:block;}
.brand-name{font-size:15px;font-weight:700;color:var(--brand-ink);letter-spacing:.4px;white-space:nowrap;}
.topbar-user{display:flex;align-items:center;gap:10px;}
.chip.role-chip{background:#eef2f7;color:#5b6575;border-radius:20px;font-size:12px;}
.chip.role-chip.leader{background:#fdf0ee;color:var(--brand-red);}
.user-name{font-size:14px;color:#2b3648;font-weight:600;}
.topbar-user .logout{color:#7c8698;font-size:13px;padding:4px 10px;border:1px solid #e2e7ee;border-radius:18px;transition:.15s;}
.topbar-user .logout:hover{color:var(--brand-red);border-color:#eec9c7;background:#fdf7f6;}

.navbar{background:var(--navy);}
.nav-inner{max-width:1240px;margin:0 auto;display:flex;align-items:center;height:46px;padding:0 20px;gap:6px;}
.nav-inner a{color:#c8d2e4;font-size:14px;line-height:46px;padding:0 16px;text-decoration:none;border-bottom:2px solid transparent;transition:.15s;}
.nav-inner a:hover{color:#fff;background:rgba(255,255,255,.06);}
.nav-inner a.active{color:#fff;font-weight:600;border-bottom-color:#f0b3b0;background:rgba(255,255,255,.05);}
.nav-inner .spacer{flex:1;}

.card{border-radius:12px;box-shadow:var(--card-shadow);border:1px solid #eef1f6;}
.container{max-width:1240px;}
@media (max-width:900px){ .brand-name{display:none;} .brand-logo{height:30px;} }

/* ============ 团队视图（tv-） ============ */
.tv-head{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;margin:2px 0 14px;}
.tv-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.tv-controls{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap;padding:10px 14px;margin:0 0 14px;background:#fff;}
.tv-tabs{display:flex;gap:4px;background:#eef1f6;border-radius:10px;padding:4px;}
.tv-tab{border:none;background:transparent;border-radius:8px;padding:7px 16px;font-size:13px;cursor:pointer;color:#5b6575;transition:.15s;}
.tv-tab.active{background:#fff;color:var(--brand-red);font-weight:600;box-shadow:0 1px 4px rgba(26,35,50,.10);}
.tv-tab:hover{color:#1a2332;}
.tv-toolbar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;}
.tv-sel{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:#6b7688;}
.tv-sel select{padding:5px 8px;border:1px solid #dfe4ec;border-radius:7px;background:#fff;font-size:13px;color:#2b3648;}
.tv-panel{display:none;}
.tv-panel.active{display:block;}
.tv-subbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:6px 0 12px;}
.tv-cal-title{font-size:17px;min-width:130px;text-align:center;color:#1a2332;}
.tv-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:14px;}
.tv-stat{background:#fff;border:1px solid #eef1f6;border-radius:12px;padding:14px 16px;display:flex;flex-direction:column;gap:4px;box-shadow:var(--card-shadow);}
.tv-stat b{font-size:26px;color:#1a2332;}
.tv-stat span{font-size:12px;color:#8a93a6;}
.tv-member{margin-bottom:10px;background:#fff;border-radius:12px;overflow:hidden;}
.tv-member-row{display:flex;align-items:center;gap:14px;padding:12px 16px;cursor:pointer;flex-wrap:wrap;transition:background .15s;}
.tv-member-row:hover{background:#fafbfe;}
.tv-ava{width:40px;height:40px;border-radius:11px;color:#fff;font-weight:700;display:flex;align-items:center;justify-content:center;font-size:16px;flex-shrink:0;}
.tv-m-name{width:168px;display:flex;flex-direction:column;gap:2px;flex-shrink:0;}
.tv-m-name b{font-size:14px;color:#1a2332;}
.tv-m-today{width:132px;display:flex;gap:6px;align-items:center;flex-wrap:wrap;flex-shrink:0;}
.tv-badge{padding:3px 10px;border-radius:20px;color:#fff;font-size:12px;font-weight:600;white-space:nowrap;}
.tv-badge.warn{background:#fff3e0;color:#b06a00;}
.tv-m-prog{width:170px;display:flex;flex-direction:column;gap:5px;flex-shrink:0;}
.tv-bar{height:7px;background:#edf0f5;border-radius:6px;overflow:hidden;}
.tv-bar i{display:block;height:100%;background:linear-gradient(90deg,#b12a2a,#d9534f);border-radius:6px;}
.tv-m-week{display:flex;align-items:center;gap:3px;flex-wrap:wrap;min-width:150px;}
.tv-m-week .sm{width:100%;}
.tv-chev{margin-left:auto;color:#9aa3b2;font-size:13px;flex-shrink:0;}
.tv-detail{padding:12px 18px 14px;background:#fbfcfe;border-top:1px dashed #e6eaf1;}
.tv-detail-title{font-weight:700;color:#576277;font-size:13px;margin:2px 0 6px;}
.tv-tasks-mini{display:flex;flex-direction:column;gap:6px;margin-top:6px;}
.tv-task-pill{display:flex;align-items:center;gap:10px;background:#fff;border:1px solid #edf0f5;border-radius:9px;padding:7px 12px;font-size:13px;}
.tv-task-pill i{width:11px;height:11px;border-radius:3px;flex-shrink:0;}
.tv-task-pill span{flex:1;color:#2b3648;}
.tv-task-pill em{font-style:normal;color:#8a93a6;font-size:12px;white-space:nowrap;}
.tv-log-mini{margin-top:10px;font-size:13px;color:#2b3648;}
.tv-log-mini b{color:#576277;}
.dot{display:inline-block;width:8px;height:8px;border-radius:50%;flex-shrink:0;}
.dot.lg{width:15px;height:15px;line-height:15px;text-align:center;font-size:10px;color:#fff;}
.dot.busy{background:var(--ui-busy,#d96c3c);}.dot.done{background:var(--ui-logok,#2f9e5f);}.dot.idle{background:var(--ui-idle,#cdd4de);}.dot.overdue{background:var(--ui-overdue,#b12a2a);}.dot.draft{background:var(--ui-logdraft,#d9a52e);}
.sm{font-size:11px;}
/* 日历忙闲（8列网格：首列周号未用，实为7列） */
.tv-cal-wrap{overflow-x:auto;background:#fff;border:1px solid #eef1f6;border-radius:12px;padding:10px;}
#tvCalGrid{display:grid;grid-template-columns:repeat(7,minmax(90px,1fr));gap:6px;min-width:680px;}
.tcal-h{padding:4px 2px;text-align:center;font-size:12px;color:#6b7688;font-weight:600;}
.tcal-cell{background:#fff;border:1px solid #eef0f5;border-radius:9px;min-height:78px;padding:6px;cursor:pointer;transition:box-shadow .12s,border-color .12s;position:relative;}
.tcal-cell:hover{border-color:#d8c6c6;box-shadow:0 2px 8px rgba(26,35,50,.08);}
.tcal-cell.out{background:#fafbfd;border-color:#f2f3f6;}
.tcal-cell.today{border-color:var(--brand-red);box-shadow:0 0 0 1px var(--brand-red) inset;}
.tcal-date{display:block;font-size:12px;color:#1a2332;margin-bottom:8px;}
.tcal-cell.out .tcal-date{color:#c3c9d4;}
.tcal-cell.today .tcal-date{color:var(--brand-red);font-weight:700;}
.tcal-dots{display:flex;flex-wrap:wrap;gap:4px;}
.tcal-dots .dot{width:9px;height:9px;}
.tv-day-detail{background:#fff;padding:12px 16px;margin-top:12px;border-left:4px solid #e9c1bf;}
.tv-day-head{display:flex;align-items:center;gap:12px;margin-bottom:8px;font-size:14px;}
.tv-day-head b{font-size:15px;}
.tv-day-head button{margin-left:auto;}
.tv-day-person{padding:8px 0;border-bottom:1px solid #f0f2f6;}
.tv-day-person:last-child{border-bottom:none;}
.tv-day-p{display:flex;align-items:center;gap:8px;margin-bottom:6px;}
.tv-day-tasks{margin:2px 0 4px;padding-left:0;}
.tv-day-log{margin:2px 0 0;font-size:13px;color:#576277;padding-left:18px;}
/* 甘特（gx-） */
.tv-gantt{background:#fff;overflow:hidden;}
.gx-grid{display:flex;align-items:stretch;overflow-x:auto;}
.gx-labels{flex:0 0 190px;border-right:1px solid #e6eaf1;background:#fbfcfe;}
.gx-caption{padding:9px 12px;font-weight:700;font-size:13px;color:#576277;border-bottom:1px solid #eceff4;}
.gx-main{flex:1;min-width:600px;overflow-x:auto;}
.gx-header{height:34px;position:relative;background:#f7f9fc;border-bottom:1px solid #eceff4;}
.gx-mlabel{position:absolute;top:0;line-height:34px;text-align:center;font-size:11px;color:#6b7688;border-left:1px solid #f0f2f6;box-sizing:border-box;white-space:nowrap;overflow:hidden;}
.gx-row{display:flex;border-bottom:1px solid #f0f2f6;cursor:pointer;}
.gx-row:last-child{border-bottom:none;}
.gx-row:hover{background:#fbfcfe;}
.gx-head{flex:0 0 190px;display:flex;flex-direction:column;justify-content:center;gap:2px;padding:4px 12px;background:#fbfcfe;border-right:1px solid #e6eaf1;position:sticky;left:0;z-index:2;}
.gx-head b{font-size:13px;color:#1a2332;}
.gx-track{position:relative;background:#fff;min-height:30px;}
.gx-bar{position:absolute;border-radius:5px;font-size:11px;height:20px;line-height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 7px;box-shadow:0 1px 2px rgba(0,0,0,.15);cursor:default;}
.gx-bar-txt{display:block;overflow:hidden;text-overflow:ellipsis;}
.gx-today{position:absolute;top:0;bottom:0;width:0;border-left:2px solid #e8635a;z-index:3;pointer-events:none;}
.gx-collapse{display:none;}
.gx-row.collapsed .gx-track{height:30px!important;overflow:hidden;}
.gx-row.collapsed .gx-bar{display:none;}
.gx-row.collapsed .gx-head{border-left:3px solid #b12a2a;}
/* 日志矩阵 */
.tv-matrix{background:#fff;overflow:auto;padding:6px;}
.lhead{display:flex;align-items:stretch;border-bottom:1px solid #eceff4;background:#f7f9fc;}
.lcell-head{font-size:12px;color:#6b7688;padding:8px 6px;text-align:center;display:flex;flex-direction:column;justify-content:center;gap:2px;flex-shrink:0;}
.lcell-head i{font-style:normal;color:#9aa3b2;font-size:11px;}
.lcell-head.today,.lcell.today{outline:2px solid rgba(177,42,42,.55);outline-offset:-2px;}
table.lmatrix{width:100%;border-collapse:collapse;}
tr.tv-logrow{border-bottom:1px solid #f0f2f6;}
tr.tv-logrow:hover{background:#fbfcfe;}
.tv-log-name{display:flex;align-items:center;gap:8px;padding:8px 12px;font-size:13px;cursor:pointer;white-space:nowrap;flex-shrink:0;}
.tv-log-name .muted{font-size:11px;margin-left:2px;}
tr.tv-log-expand td{background:#f8fafd;border-bottom:1px solid #eef1f6;padding:10px 18px;}
.tv-log-flow{display:flex;flex-direction:column;gap:10px;}
.flow-day{border-left:3px solid #e0e4ec;padding-left:12px;font-size:13px;color:#2b3648;}
.flow-day b{color:#1a2332;}
.lcell{display:flex;align-items:center;justify-content:center;height:34px;margin:2px;border-radius:7px;color:#fff;font-size:13px;font-weight:700;cursor:pointer;flex-shrink:0;transition:transform .1s,opacity .15s;}
.lcell:hover{transform:scale(1.14);opacity:.9;}
.lcell.idle{background:var(--ui-idle-bg,#eef1f6) !important;color:var(--ui-idle-tx,#b6bec9);font-weight:400;}
.lcell.done{background:var(--ui-logok,#2f9e5f) !important;}
.lcell.busy{background:var(--ui-busy,#d96c3c) !important;}
.lcell.plan{background:#7d9fd1 !important;}
.lcell.overdue{background:var(--ui-overdue,#b12a2a) !important;}
.lcell.draft{background:var(--ui-logdraft,#d9a52e) !important;}
.auth-brand{display:flex;justify-content:center;margin:0 0 12px;}
.auth-brand img{max-width:86%;max-height:64px;object-fit:contain;}
.auth-card h1{text-align:center;font-size:18px;}
.auth-card .auth-sub{text-align:center;}


/* ===== 团队视图 v2（按部门分组 · 新交互）===== */
.dropdown{position:relative;display:inline-block;}
.dropdown-menu{position:absolute;right:0;top:calc(100% + 6px);min-width:190px;background:#fff;border:1px solid #eef1f6;border-radius:10px;box-shadow:0 10px 28px rgba(26,35,50,.14);padding:6px;z-index:40;animation:tvFade .16s ease;}
.dropdown-menu a{display:block;padding:8px 12px;border-radius:7px;font-size:13px;color:#2b3648;cursor:pointer;white-space:nowrap;}
.dropdown-menu a:hover{background:#fdf0ee;color:var(--brand-red);}

.tv-blocks{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px;}
.tv-dept-card{padding:14px 16px;overflow:hidden;animation:tvFade .25s ease;}
.tv-dept-head{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;padding-bottom:10px;border-bottom:1px dashed #e6eaf1;margin-bottom:12px;}
.tv-dept-name{font-size:16px;color:#1a2332;position:relative;padding-left:12px;}
.tv-dept-name::before{content:"";position:absolute;left:0;top:3px;bottom:3px;width:4px;border-radius:3px;background:linear-gradient(180deg,var(--brand-red),#e8635a);}
.tv-block{background:#fff;border:1px solid #eef1f6;border-radius:12px;padding:12px;cursor:pointer;transition:transform .18s,box-shadow .18s,border-color .18s;border-top:3px solid var(--st,#cdd4de);}
.tv-block:hover,.tv-block:focus-visible{transform:translateY(-2px);box-shadow:0 8px 20px rgba(26,35,50,.10);border-color:#e2cdcb;outline:none;}
.tv-block-top{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-bottom:8px;}
.tv-block-status{font-size:12px;color:#576277;display:inline-flex;align-items:center;gap:5px;white-space:nowrap;}
.tv-block-name{font-size:14px;font-weight:600;color:#1a2332;margin:0 0 4px;display:flex;align-items:center;gap:6px;}
.tv-block-name .me,.ll-name .me{font-style:normal;font-size:10px;background:#fde9e7;color:var(--brand-red);border-radius:4px;padding:1px 5px;}
.tv-block .muted,.tv-dept-head .muted,.ll-name .muted{font-size:12px;}
.tv-ava.sm{width:30px;height:30px;border-radius:9px;font-size:13px;}
.tv-ava{display:inline-flex;align-items:center;justify-content:center;}
.tv-ava.img{overflow:hidden;padding:0;background:transparent}
.tv-ava.img img{width:100%;height:100%;object-fit:cover;display:block}

@keyframes tvFade{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}

/* 日历：数字类名与首列网格 */
.tcal-n{display:block;font-size:12px;color:#1a2332;margin-bottom:8px;}
.tcal-cell.out .tcal-n{color:#c3c9d4;}
.tcal-cell.today .tcal-n{color:var(--brand-red);font-weight:700;}
.tv-cal-grid{display:grid;grid-template-columns:repeat(7,minmax(92px,1fr));gap:6px;min-width:700px;}

/* 甘特 v2 结构 */
.gx-inner{overflow-x:auto;background:#fff;}
.gx-row{display:flex;align-items:stretch;min-width:max-content;border-bottom:1px solid #f0f2f6;cursor:default;}
.gx-row:last-child{border-bottom:none;}
.gx-caprow{background:#f7f9fc;border-bottom:1px solid #eceff4;position:sticky;top:0;z-index:5;}
.gx-lcol{flex:0 0 190px;position:sticky;left:0;z-index:4;background:#fbfcfe;border-right:1px solid #e6eaf1;display:flex;align-items:center;gap:8px;padding:6px 12px;}
.gx-caprow .gx-lcol{background:#f7f9fc;font-weight:700;color:#576277;min-height:34px;box-sizing:border-box;}
.gx-harea{position:relative;flex:0 0 auto;}
.gx-mlabel{position:absolute;top:0;height:34px;line-height:17px;text-align:center;font-size:10px;color:#6b7688;border-left:1px solid #f0f2f6;box-sizing:border-box;white-space:nowrap;overflow:hidden;padding-top:2px;}
.gx-mlabel b{display:block;font-size:11px;color:#45506a;font-weight:600;}
.gx-mlabel i{font-style:normal;color:#9aa3b2;font-size:10px;}
.gx-mlabel.today b{color:var(--brand-red);}
.gx-deptrow{background:#faf5f4;cursor:default;}
.gx-deptrow .gx-lcol{background:#faf5f4;cursor:pointer;font-weight:700;color:#1a2332;}
.gx-deptrow .gx-lcol:hover{background:#f6ecea;}
.gx-deptline{height:30px;border-bottom:1px solid #f2e5e2;}
.gx-arrow{color:var(--brand-red);font-style:normal;font-size:12px;flex:0 0 auto;}
.gx-name .gx-fold{cursor:pointer;font-style:normal;color:#8a93a6;flex:0 0 auto;font-size:12px;}
.gx-name .gx-fold:hover{color:var(--brand-red);}
.gx-uname{cursor:pointer;color:#1a2332;font-size:13px;font-weight:600;}
.gx-uname:hover{color:var(--brand-red);text-decoration:underline;}
.gx-lcol em{font-style:normal;font-size:11px;color:#9aa3b2;margin-left:auto;}
.gx-track{position:relative;background:#fff;}
.gx-foldnote{padding:6px 10px;font-size:12px;color:#a5adba;background:#fbfcfe;border-radius:6px;width:max-content;margin:6px 0 0 8px;}
.gx-bar{position:absolute;border-radius:6px;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0 8px;box-shadow:0 1px 2px rgba(0,0,0,.14);cursor:pointer;box-sizing:border-box;transition:filter .15s,transform .15s;}
.gx-bar:hover{filter:brightness(1.08);transform:scaleY(1.12);z-index:3;}
.gx-bar.done{opacity:.62;}
.gx-bar.done span{text-decoration:line-through;}
.gx-bar.overdue{outline:2px solid #fff;outline-offset:-2px;box-shadow:0 0 0 2px #c0392b inset;}
.gx-today{border-left:2px solid var(--brand-red);}
.gx-row:hover .gx-track{background:#fffefc;}

/* 日志矩阵 v2（部门分组行 + 日期网格） */
.tv-matrix{overflow:auto;padding:6px;}
.ll-head,.ll-row{display:grid;min-width:max-content;}
.ll-head{background:#f7f9fc;border-bottom:1px solid #eceff4;border-radius:8px 8px 0 0;position:sticky;top:0;z-index:3;}
.ll-head .ll-name{background:#f7f9fc;font-weight:700;color:#576277;min-height:44px;border-radius:8px 0 0 0;}
.ll-headgrid{display:grid;}
.ll-d{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;font-size:11px;color:#6b7688;border-left:1px solid #eef1f6;min-height:44px;}
.ll-d b{font-size:12px;color:#45506a;}
.ll-d i{font-style:normal;color:#9aa3b2;font-size:10px;}
.ll-d.today{background:#fdeeed;color:var(--brand-red);}
.ll-d.today b{color:var(--brand-red);}
.ll-dept{display:flex;align-items:center;gap:10px;margin:12px 0 6px;padding:8px 12px;background:#faf5f4;border-radius:8px;cursor:pointer;font-size:13px;color:#1a2332;user-select:none;transition:background .15s;}
.ll-dept b{padding-left:10px;position:relative;}
.ll-dept b::before{content:"";position:absolute;left:0;top:2px;bottom:2px;width:4px;border-radius:3px;background:linear-gradient(180deg,var(--brand-red),#e8635a);}
.ll-dept:hover{background:#f6ecea;}
.ll-dept .muted{font-size:12px;}
.ll-row{border-bottom:1px solid #f4f6f9;}
.ll-row:hover{background:#fdfaf9;}
.ll-row .ll-name{min-height:40px;}
.ll-row .ll-name .dot{margin-right:4px;}
.ll-grid{display:grid;}

/* 悬浮窗 */
.tv-tip{position:fixed;z-index:120;max-width:320px;min-width:190px;background:#1f2a44;color:#fff;border-radius:10px;padding:10px 12px;font-size:12px;line-height:1.55;box-shadow:0 10px 30px rgba(0,0,0,.28);pointer-events:none;animation:tvTipIn .14s ease;}
@keyframes tvTipIn{from{opacity:0;transform:translateY(3px)}to{opacity:1}}
.tv-tip b{color:#fff;display:block;margin-bottom:2px;font-size:12px;}
.tv-tip .muted{color:#c8d0e0;}
.tv-tip hr{border:none;border-top:1px solid rgba(255,255,255,.14);margin:5px 0;}
.tv-tip .t-t{display:flex;gap:6px;align-items:baseline;}
.tv-tip .t-t i{width:7px;height:7px;border-radius:50%;flex:0 0 auto;}
.tv-tip .t-t em{font-style:normal;color:#e8edf7;}

/* 成员抽屉 */
.overlay{position:fixed;inset:0;background:rgba(15,22,38,.42);z-index:90;opacity:0;animation:tvFade .18s forwards;}
.member-drawer{position:fixed;top:0;right:0;bottom:0;width:min(430px,94vw);background:#fff;z-index:95;box-shadow:-10px 0 40px rgba(0,0,0,.18);transform:translateX(105%);transition:transform .24s cubic-bezier(.2,.8,.25,1);display:flex;flex-direction:column;}
.member-drawer.open{transform:none;}
.drawer-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:16px 18px;border-bottom:1px solid #eef1f6;}
.drawer-head b{font-size:16px;color:#1a2332;}
.drawer-body{overflow:auto;padding:14px 18px 24px;font-size:13px;}
.member-head{display:flex;align-items:center;gap:12px;margin-bottom:14px;}
.member-head .tv-ava{width:48px;height:48px;border-radius:13px;font-size:18px;}
.member-head b{font-size:16px;color:#1a2332;display:block;}
.member-head .muted{font-size:12px;}
.member-sec{font-weight:700;color:#576277;font-size:12px;margin:14px 0 6px;letter-spacing:.5px;}
.member-sec:first-child{margin-top:0;}

/* 底部抽屉 sheet（日历按日 / 手机用） */
.tv-bottom-sheet{position:fixed;left:50%;bottom:14px;transform:translateX(-50%) translateY(calc(100% + 30px));width:min(720px,calc(100vw - 20px));max-height:64vh;overflow:auto;background:#fff;border-radius:14px;box-shadow:0 14px 50px rgba(0,0,0,.22);z-index:96;transition:transform .26s cubic-bezier(.2,.8,.25,1);opacity:0;pointer-events:none;}
.tv-bottom-sheet.show{transform:translateX(-50%) translateY(0);opacity:1;pointer-events:auto;}
.sheet-head{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:14px 16px;border-bottom:1px solid #eef1f6;position:sticky;top:0;background:#fff;z-index:2;}
.sheet-head b{font-size:15px;color:#1a2332;}
.sheet-head .btn{margin-left:auto;}
.sheet-body{padding:10px 14px 16px;}
.sheet-body .ll-dept{margin:8px 0 2px;}
.cal-person{display:flex;align-items:center;gap:9px;padding:8px 10px;border-radius:9px;cursor:pointer;transition:background .14s;}
.cal-person:hover{background:#fbf6f5;}
.cal-person b{font-size:13px;color:#1a2332;min-width:74px;}
.badge{display:inline-block;padding:2px 9px;border-radius:14px;color:#fff;font-size:11px;white-space:nowrap;}
.cal-person em{margin-left:auto;font-style:normal;font-size:12px;color:#8a93a6;}

/* 动画：卡片/加载 */
.tv-panel{display:none;}
.tv-panel.active{display:block;animation:tvPanel .22s ease;}
@keyframes tvPanel{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.tv-controls,.tv-dept-card,.tv-gantt,.tv-matrix,.tv-cal-wrap{transition:box-shadow .2s;}
.tv-tab{transition:color .15s,background .15s,box-shadow .15s;}
.tv-stat{transition:transform .16s;}
.tv-stat:hover{transform:translateY(-2px);}
.lcell{transition:transform .12s,box-shadow .12s,opacity .15s;box-shadow:0 1px 2px rgba(0,0,0,.08);}
.lcell:hover{transform:scale(1.12);box-shadow:0 3px 8px rgba(0,0,0,.15);}

/* 响应式：手机 */
@media (max-width:760px){
  .tv-head{flex-direction:column;align-items:flex-start;}
  .tv-tabs{width:100%;overflow-x:auto;flex-wrap:nowrap;}
  .tv-tab{white-space:nowrap;flex:1;}
  .tv-actions{width:100%;justify-content:space-between;}
  .tv-controls{padding:10px;}
  .tv-blocks{grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:8px;}
  .tv-block{padding:10px;}
  .gx-lcol{flex-basis:150px;padding:6px 8px;}
  .ll-row,.ll-head{grid-template-columns:150px repeat(auto-fit,minmax(72px,1fr))!important;}
  .member-drawer{width:100vw;}
  .tcal-cell{min-height:64px;}
  .tv-subbar{gap:8px;padding-bottom:8px;}
  .tv-gantt-hint{width:100%;}
  .ttip-hint{display:none;}
  .sheet-head .muted{display:none;}
}
@media (max-width:480px){
  .tv-toolbar{width:100%;justify-content:space-between;}
  .cal-person b{min-width:58px;}
}


/* ---- 与实际 DOM 对齐的悬浮窗/抽屉/明细类 ---- */
.tv-tip-title{display:flex;align-items:center;gap:7px;color:#fff;font-weight:600;font-size:12px;margin-bottom:6px;}
.tv-tip-title b{color:#ffd9d6;font-weight:600;}
.tv-tip-sec{font-size:11px;color:#9fb0d4;margin:7px 0 3px;text-transform:none;}
.tv-tip-task{display:flex;align-items:baseline;gap:6px;padding:2px 0;font-size:12px;color:#eef2fa;}
.tv-tip-task i{width:7px;height:7px;border-radius:2px;flex:0 0 auto;align-self:center;}
.tv-tip-task span{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.tv-tip-task em{font-style:normal;font-size:11px;color:#aeb9cf;white-space:nowrap;}
.tv-tip-log{font-size:12px;color:#e6ecf7;background:rgba(255,255,255,.07);border-radius:6px;padding:6px 8px;margin-top:2px;white-space:pre-wrap;max-height:110px;overflow:auto;}
.tv-tip-sec + .muted{color:#8ea0c2;font-size:11px;}
.drawer-member{display:flex;align-items:center;gap:12px;margin-bottom:8px;}
.drawer-member .badge{margin-left:auto;}
.drawer-member .muted{font-size:12px;}
.drawer-sec{font-weight:700;color:#576277;font-size:12px;margin:14px 0 6px;letter-spacing:.3px;}
.drawer-sec:first-of-type{margin-top:6px;}
.drawer-task{display:flex;align-items:baseline;gap:8px;padding:6px 0;border-bottom:1px dashed #f0f2f6;font-size:13px;}
.drawer-task i{width:9px;height:9px;border-radius:3px;flex:0 0 auto;align-self:center;}
.drawer-task span{flex:1;color:#2b3648;}
.drawer-task em{font-style:normal;font-size:12px;color:#9aa3b2;}
.drawer-log{background:#f4f9f5;border:1px solid #dceee3;color:#24543a;border-radius:8px;padding:8px 10px;white-space:pre-wrap;font-size:13px;}
.drawer-log.draft{background:var(--ui-logdraft-bg,#fbf7ec);border-color:var(--ui-logdraft-bg,#efe3c4);color:var(--ui-logdraft-tx,#7a5d14);}
.drawer-weekdots{display:flex;gap:8px;align-items:center;padding:4px 0;}
.dot.lg{width:15px;height:15px;border-radius:50%;}


/* ===== 配色弹窗页签 ===== */
.cr-tabs{display:flex;gap:6px;margin:4px 0 10px;border-bottom:1px solid #e3e8f0}
.cr-tab{background:#fff;border:1px solid #dfe5ef;border-bottom:none;padding:7px 18px;font-size:13px;border-radius:8px 8px 0 0;cursor:pointer;color:#576277}
.cr-tab.active{background:#1f2a44;color:#fff;font-weight:600}
.modal-actions{margin-top:10px;display:flex;justify-content:flex-end;gap:8px}

/* ===== 头像 ===== */
.avatar{display:inline-block;width:28px;height:28px;border-radius:50%;background:#dbe3f0;color:#2c3e50;font-size:12px;font-weight:600;line-height:28px;text-align:center;vertical-align:-8px;overflow:hidden;object-fit:cover;flex-shrink:0}
.avatar.sm{width:22px;height:22px;font-size:10px;line-height:22px;vertical-align:-6px}
.avatar.lg{width:44px;height:44px;font-size:17px;line-height:44px;vertical-align:middle}
.avatar-img{object-fit:cover;width:100%;height:100%;border-radius:50%;display:block}
.nav-user .avatar{vertical-align:middle;margin-right:6px}
.tcal-name .avatar,.tv-log-name .avatar,.tl-row-head .avatar,.tcal-person .avatar,.member-cell .avatar{margin-right:6px}
/* 请假/特殊标记徽标（leave key 配色） */
.badge-leave{background:var(--ui-leave,#8a5a9e);color:#fff;border-radius:10px;font-size:11px;padding:1px 8px;display:inline-block;line-height:16px}

/* 关键词分组视图 */
.kg-wrap{padding:2px}
.kg-card .chip{font-size:12px}
.kg-sec{margin:10px 0;font-size:13px}
.kg-sec>div{display:flex;flex-direction:column;gap:5px}
.kg-item{display:flex;align-items:center;gap:7px;flex-wrap:wrap;background:#fbfcfe;border:1px solid #eef1f6;border-radius:8px;padding:6px 10px;font-size:13px}
.kg-item .dot{flex-shrink:0}
.kg-kw{font-style:normal;font-size:11px;color:#8C1F28;background:#f7ecea;border-radius:4px;padding:1px 6px}
.kg-date{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12px;color:#576277;background:#eef2f7;border-radius:4px;padding:1px 6px}
.kg-log{display:flex;align-items:center;gap:8px}
.kg-excerpt{flex-basis:100%;padding-left:2px}
.kg-member{display:inline-flex;align-items:center;gap:6px;background:#f4f7fb;border:1px solid #e2e8f0;border-radius:20px;padding:3px 10px 3px 4px;font-size:13px}
.kg-member .avatar{background:#e8ecf4}
.kg-member em{margin-left:4px;font-style:normal;font-size:11px}

/* ===== 关键词分组：命中概览条 / 按人紧凑行 / 按年分区 / 时间倒序 ===== */
.kg-ov{display:flex;flex-wrap:wrap;align-items:center;gap:6px;background:#f4f7fb;border:1px solid #e6ecf5;border-radius:10px;padding:8px 10px;font-size:12px;color:#576277;}
.kg-ov .chip{background:#eef2f7;color:#5b6575;padding:2px 9px;border-radius:999px;font-size:12px;}
.kg-ov .chip b{color:#1a2332;margin-right:2px;}
.kg-ov .kg-span{background:#fbe9e7;color:#8C1F28;font-family:ui-monospace,Menlo,Consolas,monospace;}
.kg-ov .kg-sort-hint{margin-left:auto;font-style:normal;font-size:12px;color:#8a93a6;}
.kg-person{display:flex;align-items:flex-start;gap:10px;margin:6px 0 0;padding:9px 12px;background:#fff;border:1px solid #eef1f6;border-radius:10px;cursor:pointer;transition:background .14s,border-color .14s;}
.kg-person.open{border-radius:10px 10px 0 0;background:#fbfcfe;border-color:#d9e1ec;}
.kg-person:hover{background:#fbfcfe;}
.kg-ava{display:inline-flex;align-items:center;justify-content:center;color:#fff;font-weight:600;width:34px;height:34px;border-radius:10px;font-size:15px;flex-shrink:0;}
.kg-p-main{flex:1;min-width:0;}
.kg-p-line1{display:flex;align-items:center;gap:6px;flex-wrap:wrap;}
.kg-p-line1 b{font-size:14px;color:#1a2332;}
.kg-p-dept{font-style:normal;font-size:12px;color:#8a93a6;}
.kg-p-badges{display:inline-flex;align-items:center;gap:5px;flex-wrap:wrap;}
.kg-cnt{font-style:normal;font-size:12px;color:#46536a;background:#eef2f7;border-radius:4px;padding:1px 7px;}
.kg-yrs{display:inline-flex;gap:4px;flex-wrap:wrap;}
.kg-yr{font-style:normal;font-size:12px;color:#8C1F28;background:#fdeeea;border-radius:4px;padding:1px 7px;}
.kg-caret{margin-left:auto;font-style:normal;font-size:12px;color:#9aa3b2;white-space:nowrap;}
.kg-p-sum{font-size:13px;line-height:1.5;color:#46536a;margin-top:4px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word;}
.kg-p-detail{margin:0 0 6px;padding:8px 12px 10px;background:#fbfcfe;border:1px solid #d9e1ec;border-top:none;border-radius:0 0 10px 10px;}
.kg-sec-h{font-size:13px;font-weight:700;color:#576277;margin:10px 0 5px;display:flex;align-items:center;gap:8px;}
.kg-sec-h em{font-style:normal;font-size:12px;color:#9aa3b2;font-weight:400;}
.kg-items{display:flex;flex-direction:column;gap:5px;}
.kg-it-t{flex:1;min-width:0;font-weight:500;color:#2b3648;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.kg-it-d{font-style:normal;flex-shrink:0;}
.kg-none{padding:4px 0 8px;}
.kg-year{margin:10px 0 0;padding:10px;background:#f5f8fc;border:1px solid #e6ecf5;border-radius:12px;}
.kg-year-h{display:flex;align-items:baseline;gap:8px;margin:0 0 4px;flex-wrap:wrap;}
.kg-year-h b{font-size:14px;color:#1a2332;padding-left:8px;border-left:4px solid var(--brand-red,#b12a2a);}
.kg-year-h .muted{font-size:12px;}
.kg-trow{display:flex;align-items:center;gap:8px;margin:4px 0 0;padding:6px 10px;background:#fff;border:1px solid #eef1f6;border-radius:8px;}
.kg-tdate{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:12px;color:#46536a;background:#eef2f7;border-radius:4px;padding:2px 7px;flex-shrink:0;}
.kg-tmid{display:flex;align-items:center;gap:7px;flex:1;min-width:0;}
.kg-tx{flex:1;min-width:0;font-size:13px;color:#2b3648;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.kg-trow .kg-ava{width:24px;height:24px;font-size:12px;border-radius:7px;}
.kg-trow .kg-kw{margin-left:auto;flex-shrink:0;}

/* ===== 手机端：仅保留悬浮窗（复用 #tvTip 为可关闭底部浮层） ===== */
.tv-tip-x{display:none;}
.tv-tip-body{max-height:calc(70vh - 36px);overflow:auto;}
@media (max-width:760px){
  #tvLogSheet,.member-drawer,#tvOverlay{display:none!important;}
  .tv-tip.mobile{left:10px;right:10px;bottom:10px;top:auto;width:auto;max-width:none;min-width:0;pointer-events:auto;max-height:72vh;z-index:150;padding:0;overflow:hidden;display:block;}
  .tv-tip.mobile .tv-tip-x{display:block;position:sticky;top:0;left:0;width:100%;background:rgba(0,0,0,.25);border:none;color:#fff;font-size:20px;line-height:1;padding:8px 14px;text-align:right;cursor:pointer;border-radius:10px 10px 0 0;}
  .tv-tip.mobile .tv-tip-body{max-height:calc(72vh - 38px);overflow:auto;padding:2px 12px 14px;font-size:13px;}
  .tv-tip.mobile .tv-tip-title{font-size:13px;margin-top:8px;}
  .tv-tip.mobile .tv-tip-task{font-size:13px;}
  .tv-tip.mobile .tv-tip-task em,.tv-tip.mobile .tv-tip-sec,.tv-tip.mobile .tv-tip-sec + .muted{font-size:12px;}
  .tv-tip.mobile .tv-tip-log{max-height:calc(72vh - 120px);}
  .tv-tip.mobile .sheet-head{background:transparent;border:none;position:static;padding:0;}
  .tv-tip.mobile .sheet-head b{color:#fff;font-size:13px;}
  .tv-tip.mobile .sheet-head .muted{display:inline;color:#c8d0e0;font-size:12px;}
  .tv-tip.mobile .sheet-head .btn{display:none;}
  .tv-tip.mobile .sheet-body{padding:0;}
  .tv-tip.mobile .ll-dept b{color:#dbe3f0;}
  .tv-tip.mobile .cal-person b{color:#fff;}
  .tv-tip.mobile .cal-person em{color:#c8d0e0;}
  .tv-tip.mobile .cal-person{border-radius:8px;margin:2px 0;}
}
/* 手机字体与可点区域：按钮/标签/表头不小于 12-14px，行高留足 */
@media (max-width:760px){
  .tv-tab{font-size:14px;padding:7px 4px;}
  .tv-sel{font-size:13px;}
  .tv-sel select{font-size:14px;padding:6px 8px;}
  .tv-block-name{font-size:14px;}
  .tv-block-status,.tv-block .muted,.tv-dept-head .muted,.ll-name .muted,.tv-log-name .muted{font-size:12px;}
  .tv-stat b{font-size:19px;}
  .tv-stat span{font-size:12px;}
  .ll-row .ll-name{min-height:44px;}
  .lcell-head,.lcell{font-size:13px;}
  .kg-card .chip,.kg-kw,.kg-cnt,.kg-yr{font-size:12px;}
  .kg-p-sum{font-size:13px;}
  .tv-subbar .muted{font-size:12px!important;}
  .btn{font-size:13px;padding:7px 12px;}
  .btn.sm{padding:5px 10px;}
  .badge{font-size:12px;}
}
@media (max-width:480px){
  body{font-size:15px;}
  .tv-toolbar{width:100%;justify-content:space-between;gap:6px;}
  .tv-toolbar .tv-sel{margin-left:0;}
  .tv-toolbar select{max-width:130px;}
  .tv-block{min-height:96px;}
  .tv-tip-task,.tv-tip-log{font-size:13px;}
}
/* 时间线/日历小字号表头在手机上也提到 12px 以上 */
@media (max-width:760px){
  .tl-head,.tl-cell,.tl-legend{font-size:12px;}
  .tl-cell{min-height:64px;}
}

/* ---- 登录页钉钉扫码入口 ---- */
.oauth-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; color: #9aa3b2; font-size: 12px; }
.oauth-divider::before, .oauth-divider::after { content: ""; flex: 1; height: 1px; background: #e6e9ef; }
.oauth-btn { width: 100%; box-sizing: border-box; text-align: center; background: #fff; color: #2c3e50; border: 1px solid #cfd6e0; text-decoration: none; }
.oauth-btn:hover { background: #f5f8ff; border-color: #2d6cdf; color: #2d6cdf; }
