:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --text: #1c1d22;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --border: #ececf1;
  --border-2: #e3e3ea;
  --accent: #5b5bd6;
  --accent-soft: #eef0ff;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(20,20,40,.06), 0 6px 20px rgba(20,20,40,.05);
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 60px;
}

* { margin:0; padding:0; box-sizing:border-box; }
html, body { height:100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
  line-height: 1.55; -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border:none; background:none; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

#app { display: flex; height: 100vh; overflow: hidden; }

/* ===== 侧边栏 ===== */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--surface-2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; transition: width .18s ease;
}
.sidebar.collapsed { width: var(--sidebar-w-collapsed); }
.sidebar-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; }
.logo { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, #6b6bf0, #4f46e5); color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center; }
.logo-text { font-weight: 700; font-size: 16px; letter-spacing: .3px; }
.collapse-btn { margin-left: auto; width: 24px; height: 24px; color: var(--text-3); border-radius: 6px; font-size: 13px; }
.collapse-btn:hover { background: var(--border); color: var(--text); }
.sidebar.collapsed .logo-text, .sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-group-title, .sidebar.collapsed .migrate-hint { display: none; }
.sidebar.collapsed .collapse-btn { transform: rotate(180deg); margin: 0 auto; }

.sidebar-scroll { flex: 1; overflow-y: auto; padding: 4px 0 8px; }
.sidebar-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
.nav-group { padding: 8px 10px; }
.nav-group-title { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase;
  letter-spacing: .6px; padding: 4px 12px 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 7px;
  color: var(--text-2); font-size: 14px; font-weight: 500; transition: background .15s, color .15s; }
.nav-item:hover { background: var(--border); color: var(--text); }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-ico { width: 18px; text-align: center; font-size: 14px; }
.proj-dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.proj-count { margin-left: auto; font-size: 11px; color: var(--text-3); }

.sidebar-foot { padding: 12px 16px; }
.migrate-hint { font-size: 11px; color: var(--text-3); background: var(--border); padding: 8px 10px; border-radius: 7px; text-align: center; }

/* ===== 主区 ===== */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 56px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 16px; font-weight: 700; }
.scope-chip { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft);
  padding: 4px 10px; border-radius: 20px; }
.scope-chip:hover { background: #e2e5ff; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.view { flex: 1; overflow-y: auto; padding: 24px 28px 40px; display: flex; flex-direction: column; }
#view-board { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* ===== 主页 ===== */
.home-greet { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 22px; }
.greet-text { font-size: 24px; font-weight: 700; }
.greet-clock { text-align: right; }
#clockTime { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.clock-date { display: block; font-size: 13px; color: var(--text-2); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 14px; margin-bottom: 28px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-num { font-size: 28px; font-weight: 800; }
.stat-label { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.stat-card.accent .stat-num { color: var(--accent); }
.stat-card.warn .stat-num { color: #e5484d; }
.stat-card.ok .stat-num { color: #16a34a; }

.block-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.today-list { display: flex; flex-direction: column; gap: 8px; }
.today-item { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 14px; }
.today-item .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.today-item .t-code { font-size: 11px; color: var(--text-3); font-weight: 600; min-width: 52px; }
.today-item .t-title { font-weight: 500; }
.today-item .t-meta { margin-left: auto; font-size: 12px; color: var(--text-3); }
.today-empty { color: var(--text-3); font-size: 13px; padding: 10px 2px; }

/* ===== 任务工具栏 ===== */
.task-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.seg { display: inline-flex; background: var(--border); border-radius: 8px; padding: 3px; }
.seg-btn { padding: 6px 14px; border-radius: 6px; font-size: 13px; color: var(--text-2); font-weight: 500; }
.seg-btn.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar-right { margin-left: auto; display: flex; gap: 8px; }
.sel, .inp { border: 1px solid var(--border-2); border-radius: 7px; padding: 7px 10px; font-size: 13px; background: var(--surface); color: var(--text); outline: none; }
.sel:focus, .inp:focus { border-color: var(--accent); }
.inp { min-width: 160px; }

.btn { border: 1px solid var(--border-2); background: var(--surface); border-radius: 7px; padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--text); transition: background .15s; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #4f4fc8; }
.btn.ghost { color: var(--text-2); }

/* ===== 头像 ===== */
.avatar { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 700; }
.avatar.empty { background: var(--border-2); color: var(--text-3); }

/* ===== 列表视图 ===== */
.list-view { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.task-row { display: grid; grid-template-columns: 30px 66px 1fr 104px 30px 96px 36px; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.task-row:last-child { border-bottom: none; }
.task-row.head { background: var(--surface-2); font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.task-row:not(.head):hover { background: var(--surface-2); cursor: pointer; }
.cb { width: 18px; height: 18px; border: 1.5px solid var(--border-2); border-radius: 5px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; }
.cb.done { background: #16a34a; border-color: #16a34a; }
.code-badge { font-size: 12px; font-weight: 700; color: var(--text-3); font-variant-numeric: tabular-nums; }
.t-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-title.done { text-decoration: line-through; color: var(--text-3); }
.prio { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; }
.pill { font-size: 11px; padding: 3px 9px; border-radius: 20px; font-weight: 600; white-space: nowrap; text-align: center; }
.due { font-size: 12px; color: var(--text-2); }
.due.over { color: #e5484d; font-weight: 600; }
.row-edit { color: var(--text-3); text-align: center; font-size: 14px; }
.row-edit:hover { color: var(--accent); }

/* ===== 看板视图 ===== */
.board-view { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 12px; }
.board-col { flex: 1; min-width: 240px; max-height: calc(100vh - 190px); display: flex; flex-direction: column;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px; transition: border-color .15s, background .15s; }
.board-col.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.board-col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 700; font-size: 13px; }
.board-col-head .count { color: var(--text-3); font-weight: 600; }
.board-col-body { flex: 1; overflow-y: auto; min-height: 14px; padding: 2px; margin: -2px; }
.board-col.drag-over .board-col-body { outline: 2px dashed var(--accent); outline-offset: -4px; border-radius: var(--radius); }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 12px; margin-bottom: 9px; box-shadow: 0 1px 2px rgba(0,0,0,.04); cursor: grab; }
.kcard:hover { border-color: var(--accent); }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .4; }
.kcard .k-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.kcard .k-code { font-size: 11px; font-weight: 700; color: var(--text-3); }
.kcard .k-title { font-weight: 500; font-size: 13px; margin-bottom: 9px; }
.kcard .k-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.k-due { font-size: 11px; color: var(--text-3); }
.k-due.over { color: #e5484d; font-weight: 600; }
.col-add { width: 100%; margin-top: 8px; padding: 7px; border: 1px dashed var(--border-2); border-radius: var(--radius); color: var(--text-2); font-size: 12px; font-weight: 600; background: transparent; transition: border-color .15s, color .15s; }
.col-add:hover { border-color: var(--accent); color: var(--accent); background: var(--surface); }
.board-tip { font-size: 12px; color: var(--text-3); margin-top: 14px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }

/* ===== 快捷工具 ===== */
.section-head { margin-bottom: 18px; }
.section-head h2 { font-size: 20px; font-weight: 700; }
.section-head p { color: var(--text-2); font-size: 13px; margin-top: 4px; }
/* ===== 周报设置(飞书 4 段模板的后 3 段) ===== */
.ws-grid { display: flex; flex-direction: column; gap: 16px; max-width: 800px; }
.ws-field { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 18px 16px; box-shadow: var(--shadow); }
.ws-label { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ws-title { font-weight: 700; font-size: 14px; color: var(--text); }
.ws-required { color: #ef4444; font-weight: 800; }
.ws-hint { font-size: 11px; color: var(--text-3); background: var(--surface-2); padding: 2px 8px; border-radius: 10px; }
.ws-textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-family: inherit; font-size: 13px; line-height: 1.6; resize: vertical; background: var(--bg); color: var(--text); }
.ws-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
/* ===== 周报 4 板块 Tab 布局 ===== */
.ws-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ws-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; }
.ws-tab:hover { border-color: var(--accent); color: var(--text); }
.ws-tab.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.ws-no { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 3px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; }
.ws-tab .ws-no { background: transparent; color: var(--accent); min-width: 18px; height: 18px; }
.ws-tab.is-active .ws-no { color: #fff; background: rgba(255,255,255,.22); }
.ws-panel { display: none; margin-top: 16px; }
.ws-panel.is-active { display: block; }
.ws-panel-hint { font-size: 12px; color: var(--text-3); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.ws-panel .ws-textarea { max-width: 860px; }
/* 周报后 3 段卡片 + 结构化列表 */
.ws-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow); max-width: 760px; }
.ws-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ws-ico { font-size: 16px; }
.ws-card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.ws-card-desc { font-size: 12px; color: var(--text-3); margin-bottom: 14px; }
.ws-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.ws-row { display: flex; align-items: center; gap: 8px; }
.ws-row-no { flex: 0 0 auto; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; }
.ws-input { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-family: inherit; font-size: 13px; background: var(--bg); color: var(--text); }
.ws-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ws-row.ai .ws-tool { flex: 0 0 40%; }
.ws-row.ai .ws-use { flex: 1; }
.ws-del { flex: 0 0 auto; width: 26px; height: 26px; border: none; border-radius: 6px; background: transparent; color: var(--text-3); font-size: 14px; cursor: pointer; }
.ws-del:hover { background: #fee2e2; color: #dc2626; }
.ws-add { margin-top: 2px; }
.ws-card .ws-textarea { max-width: 100%; }
.ws-add-row { display: flex; gap: 8px; }
.ws-batch { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.ws-batch-actions { display: flex; gap: 8px; margin-top: 8px; }
.ws-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.ws-count { font-size: 12px; color: var(--text-3); }

.section-head code { background: var(--accent-soft); color: var(--accent); padding: 1px 6px; border-radius: 5px; font-size: 12px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 14px; }
.tool-card { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.tool-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.tool-icon { width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px; }
.tool-name { font-weight: 600; }
.tool-desc { font-size: 12px; color: var(--text-2); }

/* ===== 关于 ===== */
.about-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 26px; max-width: 720px; box-shadow: var(--shadow); font-size: 14px; }
.about-list { list-style: none; margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.about-list li { line-height: 1.6; }
.about-list code { background: var(--accent-soft); color: var(--accent); padding: 1px 6px; border-radius: 5px; font-size: 12px; }

/* ===== 弹窗 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(20,20,40,.45); display: flex; align-items: center; justify-content: center; z-index: 200; }
.modal { width: 480px; max-width: 92vw; background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 20px 60px rgba(0,0,0,.3); overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-close { font-size: 16px; color: var(--text-3); }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.fld { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-2); font-weight: 600; }
.fld .inp, .fld .sel { font-weight: 400; font-size: 13px; }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fld textarea { resize: vertical; font-family: inherit; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
#modalDelete { color: #e5484d; border: 1px solid #f3c2c4; }
#modalDelete:hover { background: #fdecec; }

/* ===== 命令面板 ===== */
.cmd-mask { position: fixed; inset: 0; background: rgba(20,20,40,.4); display: flex; align-items: flex-start; justify-content: center; z-index: 300; padding-top: 14vh; }
.cmd { width: 560px; max-width: 92vw; background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 24px 70px rgba(0,0,0,.35); overflow: hidden; }
.cmd-input { width: 100%; padding: 16px 18px; font-size: 15px; border: none; border-bottom: 1px solid var(--border); outline: none; }
.cmd-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.cmd-item { padding: 10px 12px; border-radius: 7px; font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.cmd-item.active, .cmd-item:hover { background: var(--accent-soft); color: var(--accent); }
.cmd-empty { padding: 14px 12px; color: var(--text-3); font-size: 13px; }
.cmd-hint { padding: 8px 14px; font-size: 11px; color: var(--text-3); border-top: 1px solid var(--border); }

/* ===== 响应式 ===== */
@media (max-width: 760px) {
  .sidebar { position: absolute; z-index: 150; height: 100%; }
  .sidebar.collapsed { transform: translateX(-100%); width: var(--sidebar-w); }
  .task-row { grid-template-columns: 28px 58px 1fr 90px; }
  .task-row .col-due, .task-row .row-edit { display: none; }
  .toolbar-right { width: 100%; }
}

/* ===== 主页近期任务 ===== */
.home-tasks { margin-top: 28px; }
.home-tasks-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.home-tasks-head .btn.sm { padding: 5px 12px; font-size: 12px; }
.home-task-list { display: flex; flex-direction: column; gap: 8px; }
.home-task { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.home-task:hover { border-color: var(--accent); background: var(--surface-2); }
.ht-cb { width: 18px; height: 18px; border: 1.5px solid var(--border-2); border-radius: 5px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; flex-shrink: 0; }
.ht-cb.done { background: #16a34a; border-color: #16a34a; }
.ht-code { font-size: 11px; font-weight: 700; color: var(--text-3); min-width: 52px; }
.ht-title { font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ht-proj { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.ht-pill { font-size: 11px; padding: 2px 9px; border-radius: 20px; font-weight: 600; }

/* ===== 数据分析 ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi-num { font-size: 28px; font-weight: 800; }
.kpi-label { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.kpi-card.accent .kpi-num { color: var(--accent); }
.kpi-card.warn .kpi-num { color: #e5484d; }
.kpi-card.ok .kpi-num { color: #16a34a; }

.chart-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow); }
.chart-card.wide { grid-column: 1 / -1; }
.chart-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.chart-body { min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.svg-chart { width: 100%; max-width: 320px; height: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 10px; font-size: 12px; color: var(--text-2); justify-content: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.trend-empty { color: var(--text-3); font-size: 13px; padding: 30px 0; text-align: center; }

.prog-row { display: flex; align-items: center; gap: 10px; width: 100%; margin: 7px 0; }
.prog-name { font-size: 13px; font-weight: 600; min-width: 84px; }
.prog-track { flex: 1; height: 8px; background: var(--border); border-radius: 6px; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 6px; }
.prog-pct { font-size: 12px; color: var(--text-2); min-width: 38px; text-align: right; }

@media (max-width: 760px) { .chart-grid { grid-template-columns: 1fr; } }

/* ===== 周报模块 ===== */
.weekly-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.weekly-toolbar .toolbar-right { margin-left: auto; display: flex; gap: 8px; }
.weekly-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
.wstat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 96px; }
.wstat-num { font-size: 24px; font-weight: 800; }
.wstat-label { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.wstat-wide { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.wstat-cats { font-size: 13px; font-weight: 600; color: var(--text); }
.wstat-scope { margin-left: auto; font-size: 12px; color: var(--text-3); background: var(--accent-soft); color: var(--accent); padding: 6px 12px; border-radius: 20px; font-weight: 600; }

.weekly-list { display: flex; flex-direction: column; gap: 18px; }
.wgroup { }
.wdate { font-size: 12px; font-weight: 700; color: var(--text-3); margin-bottom: 8px; padding-left: 4px; letter-spacing: .4px; }
.witem { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 14px; margin-bottom: 8px; box-shadow: var(--shadow); }
.witem:hover { border-color: var(--accent); }
.wcontent-text { font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wresult { font-size: 12px; color: #16a34a; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.wedit { color: var(--text-3); font-size: 14px; cursor: pointer; padding: 2px 4px; flex-shrink: 0; }
.wedit:hover { color: var(--accent); }
.wdelete { color: var(--text-3); font-size: 14px; cursor: pointer; padding: 2px 4px; flex-shrink: 0; }
.wdelete:hover { color: #e5484d; }

/* 主题分组卡片 — v13 周报事项行 */
.wtopic {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color .15s;
}
.wtopic:hover { border-color: var(--accent); }
.wtopic-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.wtopic-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wtopic-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; cursor: default; user-select: none; }
.wtopic-title { font-weight: 700; font-size: 14.5px; color: var(--text); }
.wtopic-meta { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.wtopic-toggle { cursor: pointer; user-select: none; }
.wtopic-toggle::before { content: "▸ "; }
.wtopic-toggle.open::before { content: "▾ "; }
.wtopic-toggle:hover { color: var(--accent); }
.wtopic-detail { border-top: 1px dashed var(--border); background: var(--surface-2); padding: 8px 16px 10px; }
.wtopic-detail[hidden] { display: none; }
.wtopic-detail ul { list-style: none; margin: 0; padding: 0; }
.wtopic-detail li { display: flex; gap: 10px; padding: 4px 0; font-size: 12px; line-height: 1.55; color: var(--text-2); }
.wtopic-detail li + li { border-top: 1px dashed var(--border); }
.wd-date { flex: 0 0 46px; color: var(--text-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.wd-text { flex: 1; min-width: 0; word-break: break-word; }
.wtopic-desc {
  border: 1px dashed transparent;
  background: rgba(0,0,0,.025);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text);
  width: 100%;
  outline: none;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
.wtopic-desc:hover { border-color: var(--border-2); }
.wtopic-desc:focus { border: 1px solid var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
/* 已保存的描述不再视觉强调 — 与未保存外观一致,只 data-saved 用来给 generateReport 优先输出 */
.wtopic-actions { display: flex; flex-direction: row; gap: 6px; flex-shrink: 0; align-items: center; }
.wtopic-btn {
  background: transparent;
  border: 1px solid var(--border-2);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all .15s;
}
.wtopic-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.wtopic-btn-ghost { padding: 5px 8px; font-size: 11px; color: var(--text-3); }
.wtopic-btn-ghost:hover { border-color: var(--border-2); color: var(--text-2); background: var(--bg); }
.wtopic-btn-danger {
  color: #e5484d;
  border-color: #f3c2c4;
  font-weight: 600;
}
.wtopic-btn-danger:hover {
  background: #fdecec;
  border-color: #e5484d;
  color: #b91c1f;
}

.report-hint { font-size: 12px; color: var(--text-2); margin: 0 0 4px; line-height: 1.6; }
.report-hint.loading { color: var(--accent); }
.report-hint.done { color: #16a34a; }
.report-hint.fail { color: #dc2626; }
#reportText { width: 100%; resize: vertical; }

/* ===== 批量记录弹窗 ===== */
.batch-preview { margin-top: 10px; font-size: 12px; color: var(--accent); font-weight: 600; min-height: 16px; }
.bdel { width: 28px; height: 28px; align-self: center; color: var(--text-3); font-size: 14px; border-radius: 6px; background: transparent; border: 1px solid var(--border-2); cursor: pointer; flex-shrink: 0; }
.bdel:hover { color: #e5484d; border-color: #f3c2c4; background: #fdecec; }
.batch-add-row { width: 100%; margin-top: 12px; padding: 9px; border: 1px dashed var(--border-2); border-radius: var(--radius); color: var(--text-2); font-size: 13px; font-weight: 600; background: transparent; transition: border-color .15s, color .15s; }
.batch-add-row:hover { border-color: var(--accent); color: var(--accent); background: var(--surface); }

/* ===== 工作看板 ===== */
.board-root { padding-bottom: 20px; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.board-show-done { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 12px; color: var(--text-2); cursor: pointer; user-select: none; }
.board-show-done input { cursor: pointer; }
.board-wrap { display: flex; gap: 12px; align-items: stretch; overflow-x: auto; padding: 4px 0 12px; flex: 1; min-height: 0; }
.board-col {
  flex: 1 1 0; min-width: 168px; max-width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
  min-height: 0;
  overflow: hidden;
  position: relative;
  box-shadow: 0 1px 2px rgba(20,20,40,.04);
}
/* 每列顶部 3px 配色条 —— 视觉区分 */
.board-col::before {
  content: ""; display: block; height: 3px;
  background: var(--col-color, var(--accent));
  flex-shrink: 0;
}
/* 列配色由 board.js 渲染时 inline 设置 --col-color;此处不写硬编码规则 */

.board-col-head { display: flex; align-items: center; gap: 6px; padding: 10px 12px 6px; }
.board-col-name { font-weight: 700; font-size: 13px; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-col-count { font-size: 11px; color: var(--text-3); font-weight: 600; flex-shrink: 0; }
.board-col-count .num { color: var(--text); font-weight: 700; }
.board-col-count .doing-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 3px; vertical-align: middle; }
.board-col-del { width: 20px; height: 20px; border-radius: 50%; border: none; background: transparent; color: var(--text-3); font-size: 16px; line-height: 1; cursor: pointer; opacity: 0; transition: all .15s; padding: 0; font-family: inherit; flex-shrink: 0; margin-left: 2px; }
.board-col:hover .board-col-del { opacity: 1; }
.board-col-del:hover { background: #fdecec; color: #e5484d; }

.board-cards { flex: 1; overflow-y: auto; padding: 4px 8px 8px; display: flex; flex-direction: column; gap: 6px; min-height: 40px; }
.board-empty { padding: 14px 6px; text-align: center; color: var(--text-3); font-size: 11.5px; line-height: 1.6; }
.board-empty-ico, .board-empty-txt, .board-empty-sub { display: none; }

.board-add { margin: 4px 8px 10px; border: 1px dashed var(--border-2); background: transparent; border-radius: 6px; padding: 6px; font-size: 12px; color: var(--text-3); cursor: pointer; transition: all .15s; font-family: inherit; }
.board-add:hover { border-color: var(--col-color, var(--accent)); color: var(--col-color, var(--accent)); background: var(--surface-2); }

.board-card { background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 8px 10px; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: border-color .15s, transform .12s; }
.board-card:hover { border-color: var(--col-color, var(--accent)); }
.board-card.board-card-is-done { opacity: .55; }
.board-card-top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.board-status-wrap { position: relative; display: inline-flex; }
.board-status { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; cursor: pointer; user-select: none; line-height: 1.5; border: none; font-family: inherit; transition: filter .15s; }
.board-status.st-pending { color: #6b7280; background: #eef0f3; }
.board-status.st-in_progress { color: #5b5bd6; background: #eef0ff; }
.board-status.st-done { color: #1a9c5a; background: #e3f5ec; }
.board-status:hover { filter: brightness(.94); }
.board-status-menu { position: absolute; top: calc(100% + 4px); left: 0; min-width: 130px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; z-index: 60; display: none; }
.board-status-menu.open { display: block; }
.board-status-opt { padding: 6px 10px; font-size: 12px; border-radius: 5px; cursor: pointer; color: var(--text-2); white-space: nowrap; }
.board-status-opt:hover { background: var(--bg); color: var(--text); }
.board-status-opt.current { font-weight: 700; color: var(--text); }
.board-card-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; word-break: break-word; }
.board-card-note { font-size: 12px; color: var(--text-2); margin-top: 4px; line-height: 1.5; word-break: break-word; }
.board-card-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.board-card-date { font-size: 11px; color: var(--text-3); }
.board-card-due { font-size: 11px; font-weight: 600; }
.board-card-due.due-overdue { color: #e5484d; }
.board-card-due.due-soon { color: #d97706; }
.board-card-due.due-normal { color: var(--text-3); }
.due-inputs { display: flex; gap: 6px; }
.due-inputs input { flex: 1; min-width: 0; }
.board-card-act { border: none; background: transparent; font-size: 11px; cursor: pointer; padding: 2px 7px; border-radius: 5px; font-family: inherit; transition: all .15s; }
.board-report { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.board-report:hover { background: #dfe2ff; }
.board-del { color: var(--text-3); margin-left: auto; }
.board-del:hover { color: #e5484d; background: #fdecec; }
.board-card-done { font-size: 11px; color: #1a9c5a; font-weight: 600; }
.board-card.dragging { opacity: .5; }
.board-cards.drag-over { background: var(--accent-soft); border-radius: 8px; }

/* 看板 toast */
.board-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: rgba(28,29,34,.92); color: #fff; padding: 9px 18px; border-radius: 20px; font-size: 13px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 999; }
.board-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 标题区 h2 内嵌"＋ 店铺"小按钮 */
.btn-mini { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border: 1px solid var(--border); background: var(--surface); border-radius: 20px; font-size: 11.5px; font-weight: 600; color: var(--text-2); cursor: pointer; font-family: inherit; transition: all .15s; }
.btn-mini:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* 看板底部数据概览 + 平台分布 */
.board-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.bs-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: 0 1px 2px rgba(20,20,40,.04);
  display: flex; flex-direction: column; gap: 2px;
}
.bs-num { font-size: 26px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.bs-label { font-size: 12px; color: var(--text-2); }
.bs-card.pending .bs-num { color: #6b7280; }
.bs-card.doing  .bs-num { color: #5b5bd6; }
.bs-card.done   .bs-num { color: #16a34a; }

.board-distribution {
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 1px 2px rgba(20,20,40,.04);
}
.bd-title { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 10px; }
.bd-list { display: flex; flex-direction: column; gap: 6px; }
.bd-row { display: grid; grid-template-columns: 100px 1fr 32px; align-items: center; gap: 10px; font-size: 12.5px; }
.bd-name { font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.bd-fill { display: block; height: 100%; background: var(--col, var(--accent)); width: 0; border-radius: 4px; transition: width .3s; }
.bd-count { font-weight: 700; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }

@media (max-width: 760px) { .board-stats { grid-template-columns: 1fr 1fr; } }

/* ===== 退货率分析 ===== */
.rr-meta { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.rr-shops { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 12px; }
.rr-shop { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow); cursor: pointer; transition: transform .15s, border-color .15s; }
.rr-shop:hover { border-color: var(--accent); transform: translateY(-2px); }
.rr-shop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.rr-shop-name { font-size: 15px; font-weight: 700; color: var(--text); }
.rr-shop-platform { font-size: 11px; color: var(--text-3); background: var(--surface-2); padding: 2px 8px; border-radius: 10px; }
.rr-shop-rate { font-size: 32px; font-weight: 800; line-height: 1; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.rr-shop-meta { font-size: 12px; color: var(--text-3); }
.rr-empty { color: var(--text-3); font-size: 13px; padding: 20px 0; text-align: center; }
@media (max-width: 1000px) { .rr-shops { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .rr-shops { grid-template-columns: 1fr; } }
