:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #f1f5f9;
  --sidebar: #0f172a;
  --sidebar-text: #cbd5e1;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0284c7;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }

a { color: var(--primary); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* ===== 登录页（分屏 · 科技风） ===== */
.login-split { position: fixed; inset: 0; z-index: 900; display: flex; background: #fff; overflow: auto; }

.login-left {
  width: 50%; min-width: 460px; padding: 42px 52px 30px;
  background:
    radial-gradient(circle at 78% 18%, rgba(14, 165, 233, .22) 0%, transparent 42%),
    radial-gradient(circle at 12% 82%, rgba(6, 182, 212, .16) 0%, transparent 46%),
    linear-gradient(160deg, #061a33 0%, #04122b 45%, #020a18 100%);
  color: #dbeafe; display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.login-left::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(56, 189, 248, .10) 1px, transparent 1px), linear-gradient(90deg, rgba(56, 189, 248, .10) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 30% 20%, #000 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 30% 20%, #000 0%, transparent 80%);
}
.login-left::after {
  content: ''; position: absolute; width: 480px; height: 480px; right: -150px; top: -130px; border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, .22) 0%, transparent 68%); pointer-events: none;
}
.login-left > * { position: relative; z-index: 1; }

.brand-row { display: flex; align-items: center; gap: 13px; }
.brand-logo {
  width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0284c7, #22d3ee);
  box-shadow: 0 0 0 1px rgba(103, 232, 249, .35), 0 8px 24px rgba(6, 182, 212, .45);
}
.brand-name { font-size: 18px; font-weight: 800; color: #f0f9ff; letter-spacing: .3px; }
.brand-sub { font-size: 10px; letter-spacing: 2.4px; color: #7dd3fc; margin-top: 3px; }

.login-badge {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 58px; padding: 7px 15px;
  border-radius: 999px; background: rgba(34, 211, 238, .10); border: 1px solid rgba(34, 211, 238, .40);
  font-size: 11px; letter-spacing: 1.6px; color: #67e8f9; width: fit-content;
}
.login-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #22d3ee; box-shadow: 0 0 10px #22d3ee; }

.login-hero { margin-top: 24px; font-size: 42px; line-height: 1.28; font-weight: 800; color: #f0f9ff; letter-spacing: .5px; }
.login-hero .hl { color: #22d3ee; text-shadow: 0 0 22px rgba(34, 211, 238, .45); }
.login-desc { margin-top: 20px; color: #93b8d6; font-size: 13.5px; line-height: 1.95; max-width: 540px; }

.login-features { margin-top: 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 15px; max-width: 620px; }
.login-feature {
  background: rgba(34, 211, 238, .05); border: 1px solid rgba(56, 189, 248, .16); border-radius: 14px; padding: 18px 18px 16px;
}
.login-feature .fi {
  width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: rgba(34, 211, 238, .14); color: #67e8f9; margin-bottom: 13px;
  box-shadow: 0 0 14px rgba(34, 211, 238, .25);
}
.login-feature .ft { font-weight: 700; color: #e0f2fe; font-size: 14px; margin-bottom: 6px; }
.login-feature .fd { color: #7ea8c6; font-size: 12px; line-height: 1.75; }

.login-foot { margin-top: auto; padding-top: 28px; display: flex; align-items: center; gap: 12px; color: #5f85a8; font-size: 12px; }
.avatar-stack { display: flex; }
.avatar-stack .av {
  width: 27px; height: 27px; border-radius: 50%; border: 2px solid #04122b; margin-left: -9px;
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700;
}
.avatar-stack .av:first-child { margin-left: 0; }

.login-right { flex: 1; display: flex; flex-direction: column; background: linear-gradient(180deg, #f7fcff 0%, #eef7fd 100%); padding: 34px 48px 24px; min-width: 380px; }
.login-top { text-align: right; color: #94a3b8; font-size: 12px; }
.login-form-wrap { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 396px; margin: 0 auto; width: 100%; }
.login-welcome { color: #0891b2; font-size: 11px; letter-spacing: 3px; font-weight: 700; margin-bottom: 11px; }
.login-title { font-size: 27px; font-weight: 800; color: #07243a; margin-bottom: 9px; letter-spacing: .3px; }
.login-sub { color: #64748b; font-size: 13px; margin-bottom: 30px; }
.login-input { position: relative; margin-bottom: 18px; }
.login-input > label { display: block; font-size: 12.5px; color: #4b5f73; margin-bottom: 8px; }
.login-input .ic { position: absolute; left: 14px; bottom: 13px; color: #7ba7c9; pointer-events: none; }
.login-input input {
  width: 100%; padding: 12px 42px 12px 41px; border: 1px solid #d3e6f2; border-radius: 10px;
  background: #fff; font-size: 14px; color: #0f2740;
}
.login-input input::placeholder { color: #a9c0d3; }
.login-input input:focus { outline: none; border-color: #06b6d4; box-shadow: 0 0 0 3px rgba(6, 182, 212, .15); }
.login-eye { position: absolute; right: 11px; bottom: 9px; background: none; border: none; color: #7ba7c9; cursor: pointer; padding: 4px; line-height: 0; }
.login-eye:hover { color: #06b6d4; }
.login-error { color: #dc2626; font-size: 12px; min-height: 18px; margin-bottom: 8px; }
.login-btn {
  width: 100%; padding: 13px; border: none; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, #0284c7, #06b6d4); color: #fff; font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  box-shadow: 0 9px 24px rgba(6, 182, 212, .38); transition: filter .15s;
}
.login-btn:hover { filter: brightness(1.08); }
.login-hint { margin-top: 16px; text-align: center; color: #94a3b8; font-size: 12px; }
.login-demo {
  margin-top: 24px; background: #eaf7fd; border: 1px dashed #bfe4f2; border-radius: 10px;
  padding: 12px 14px; font-size: 11px; color: #3d7089; line-height: 1.85;
}
.login-bottom { text-align: center; color: #9bb4c9; font-size: 11px; padding-top: 26px; }

@media (max-width: 980px) {
  .login-left { display: none; }
  .login-right { padding: 28px 22px; }
  .login-split { position: fixed; }
}

/* 布局 */
.app { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 230px; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar .brand { padding: 18px 16px; font-size: 15px; font-weight: 700; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); line-height: 1.4; }
.sidebar .brand small { display: block; font-weight: 400; color: var(--sidebar-text); font-size: 11px; margin-top: 3px; }
.nav { flex: 1; overflow-y: auto; padding: 10px 8px; scrollbar-width: thin; scrollbar-color: rgba(148,163,184,.45) transparent; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #64748b, #475569); border-radius: 999px; }
.nav::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.nav-group { margin-bottom: 6px; }
.nav-group .group-title { font-size: 11px; color: #64748b; text-transform: uppercase; padding: 10px 10px 4px; letter-spacing: .5px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px; color: var(--sidebar-text); cursor: pointer; font-size: 13px; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item .ico { width: 18px; text-align: center; }
.sidebar .user { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; }
.sidebar .user .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.sidebar .user .meta { flex: 1; min-width: 0; }
.sidebar .user .meta .name { color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .user .meta .role { font-size: 11px; color: var(--sidebar-text); }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 52px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 20px; gap: 14px; flex-shrink: 0; }
.topbar .title { font-size: 16px; font-weight: 600; flex: 1; }
.topbar .actions { display: flex; align-items: center; gap: 10px; }
.content { flex: 1; overflow-y: auto; padding: 20px; }

/* 标签页栏 */
.tabbar {
  height: 44px; flex-shrink: 0; display: flex; align-items: center;
  padding: 0 8px; background: #fff; border-bottom: 1px solid var(--border);
}
.tabs-scroll {
  flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; gap: 5px;
  padding: 0 2px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin;
}
.tabs-scroll::-webkit-scrollbar { height: 4px; }
.tabs-scroll::-webkit-scrollbar-track { background: transparent; }
.tabs-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.tabs-scroll::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.tab-actions {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0; height: 100%;
  padding-left: 10px; margin-left: 6px; border-left: 1px solid var(--border);
}
.tab-action {
  font-size: 12px; color: #64748b; background: transparent; border: 1px solid transparent;
  border-radius: 6px; padding: 5px 10px; cursor: pointer; white-space: nowrap;
}
.tab-action:hover { background: #f1f5f9; color: #1d4ed8; }
.tab-action .caret { font-size: 10px; margin-left: 2px; }
.tab-more { position: relative; display: flex; align-items: center; height: 100%; }
.tab-menu {
  position: absolute; right: 0; top: calc(100% + 2px); min-width: 150px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .16); padding: 6px;
  display: none; z-index: 60;
}
.tab-menu.open { display: block; }
.tab-menu-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; font-size: 13px;
  color: var(--text); border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.tab-menu-item:hover { background: #f1f5f9; }
.tab-menu-item .mi { width: 16px; text-align: center; color: #94a3b8; font-size: 13px; }
.tab-menu-item[data-danger] { color: #dc2626; }
.tab-menu-item[data-danger] .mi { color: #dc2626; }
.tab {
  display: flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 8px;
  font-size: 13px; color: #64748b; cursor: pointer; white-space: nowrap; user-select: none;
  border: 1px solid transparent; transition: background .12s, color .12s;
}
.tab:hover { background: #f1f5f9; color: var(--text); }
.tab.active { background: #eff6ff; color: #1d4ed8; font-weight: 600; border-color: #bfdbfe; }
.tab .dot { width: 6px; height: 6px; border-radius: 50%; background: #2563eb; flex-shrink: 0; }
.tab .x {
  width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1; color: #94a3b8; flex-shrink: 0;
}
.tab .x:hover { background: #bfdbfe; color: #1d4ed8; }

/* 组件 */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .card-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.card .card-head h3 { font-size: 15px; font-weight: 600; }
.card .card-head .spacer { flex: 1; }
.card .card-body { padding: 16px 18px; }

.grid { display: grid; gap: 16px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-card .label { color: var(--muted); font-size: 12px; }
.stat-card .value { font-size: 26px; font-weight: 700; margin-top: 4px; }
.stat-card .foot { font-size: 12px; color: var(--muted); margin-top: 6px; }
.stat-card.blue .value { color: var(--primary); }
.stat-card.green .value { color: var(--success); }
.stat-card.orange .value { color: var(--warning); }
.stat-card.red .value { color: var(--danger); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.filter-label { color: #64748b; font-size: 12px; white-space: nowrap; }
.filter-sep { color: #94a3b8; font-size: 12px; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: #fff; color: var(--text); padding: 7px 13px; border-radius: 8px; font-size: 13px; }
.btn:hover { background: #f8fafc; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn.ghost:hover { background: #eff6ff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

input, select, textarea { font-family: inherit; font-size: 13px; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--text); width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
textarea { resize: vertical; min-height: 80px; }
label.fld { display: block; margin-bottom: 12px; }
label.fld > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
label.fld > span .req { color: var(--danger); }

table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th, table.tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
table.tbl th { background: #f8fafc; color: var(--muted); font-weight: 600; white-space: nowrap; }
table.tbl tr:hover td { background: #f8fafc; }
table.tbl td .ops { display: flex; gap: 4px; flex-wrap: wrap; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; line-height: 1.6; }
.badge.gray { background: #f1f5f9; color: #475569; }
.badge.blue { background: #dbeafe; color: #1d4ed8; }
.badge.green { background: #dcfce7; color: #15803d; }
.badge.orange { background: #fef3c7; color: #b45309; }
.badge.red { background: #fee2e2; color: #b91c1c; }
.badge.purple { background: #ede9fe; color: #6d28d9; }

.empty { text-align: center; color: var(--muted); padding: 40px; }

/* 看板 */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { min-width: 230px; background: #f8fafc; border-radius: var(--radius); border: 1px solid var(--border); }
.kanban-col .col-head { padding: 10px 12px; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.kanban-col .col-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.kanban-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; box-shadow: var(--shadow); cursor: pointer; }
.kanban-card .t { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.kanban-card .m { font-size: 12px; color: var(--muted); }

/* 模态框 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 640px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.lg { max-width: 900px; }
.modal .modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal .modal-head h3 { font-size: 16px; font-weight: 600; flex: 1; }
.modal .modal-head .close { cursor: pointer; font-size: 20px; color: var(--muted); border: none; background: none; }
.modal .modal-body { padding: 20px; overflow-y: auto; }
.modal .modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }

/* 通知 */
.toast-wrap { position: fixed; top: 16px; right: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #fff; border-left: 4px solid var(--success); border-radius: 8px; padding: 12px 16px; box-shadow: 0 4px 20px rgba(0,0,0,.15); min-width: 240px; animation: slidein .2s; }
.toast.err { border-left-color: var(--danger); }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 图表 */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-row .bar-label { width: 110px; font-size: 12px; color: var(--muted); text-align: right; }
.bar-row .bar-track { flex: 1; background: #eef2f7; border-radius: 6px; height: 18px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; background: var(--primary); border-radius: 6px; }
.bar-row .bar-val { width: 40px; font-size: 12px; }
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.legend { display: flex; flex-direction: column; gap: 6px; }
.legend .li { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.legend .dot { width: 10px; height: 10px; border-radius: 3px; }

/* AI 输出框 */
.ai-box { background: #f8fafc; border: 1px dashed var(--primary); border-radius: 8px; padding: 14px; margin-top: 12px; white-space: pre-wrap; line-height: 1.7; font-size: 13px; }
.ai-box .ai-tag { display: inline-block; background: var(--primary); color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 4px; margin-bottom: 8px; }

/* 大屏 */
.dash-full { min-height: calc(100vh - 92px); }

/* 今日日报统计 */
.daily-mini { max-height: 300px; overflow-y: auto; scrollbar-width: thin; }
.daily-mini::-webkit-scrollbar { width: 5px; }
.daily-mini::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }
.daily-mini-row {
  display: flex; align-items: center; gap: 9px; padding: 7px 4px;
  border-bottom: 1px solid #f1f5f9; cursor: pointer; border-radius: 6px; transition: background .12s;
}
.daily-mini-row:last-child { border-bottom: none; }
.daily-mini-row:hover { background: #f8fafc; }
.dm-avatar {
  width: 26px; height: 26px; border-radius: 50%; color: #fff; display: flex;
  align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.dm-name { flex: 1; font-size: 13px; }
.dm-hour { font-size: 12px; color: #94a3b8; width: 36px; text-align: right; }

/* 工作日程 */
.schedule-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; scrollbar-width: thin; }
.schedule-list::-webkit-scrollbar { width: 5px; }
.schedule-list::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }
.schedule-item { display: flex; align-items: center; gap: 9px; padding: 9px 11px; background: #f8fafc; border-radius: 8px; font-size: 13px; }
.sch-time { color: #2563eb; font-weight: 600; width: 46px; flex-shrink: 0; }
.sch-title { flex: 1; }
.sch-del { color: #cbd5e1; cursor: pointer; font-size: 15px; padding: 0 4px; line-height: 1; }
.sch-del:hover { color: #dc2626; }

/* 消息通知卡片 */
.msg-mini { max-height: 300px; overflow-y: auto; scrollbar-width: thin; }
.msg-mini::-webkit-scrollbar { width: 5px; }
.msg-mini::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }
.msg-mini-row { display: flex; align-items: center; gap: 8px; padding: 8px 4px; border-bottom: 1px solid #f1f5f9; cursor: pointer; border-radius: 6px; }
.msg-mini-row:last-child { border-bottom: none; }
.msg-mini-row:hover { background: #f8fafc; }
.msg-dot { width: 7px; height: 7px; border-radius: 50%; background: #2563eb; flex-shrink: 0; }
.msg-dot.read { background: #cbd5e1; }
.msg-type { font-size: 11px; color: #64748b; background: #f1f5f9; padding: 1px 6px; border-radius: 4px; flex-shrink: 0; }
.msg-title { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-time { font-size: 11px; color: #94a3b8; flex-shrink: 0; }

/* 响应式 */
@media (max-width: 900px) {
  .sidebar { width: 64px; }
  .sidebar .brand span, .sidebar .nav-item span, .sidebar .group-title, .sidebar .user .meta { display: none; }
  .form-grid { grid-template-columns: 1fr; }
}
