/* 会议事项管理系统 —— 不引用任何外部字体/CDN（国内团队访问需要） */
:root {
  --bg: #f4f6f9; --panel: #fff; --text: #1e293b; --muted: #64748b; --line: #e2e8f0;
  --brand: #1d4ed8; --brand-soft: #e0e7ff;
  --red: #dc2626; --red-soft: #fee2e2; --amber: #b45309; --amber-soft: #fef3c7;
  --green: #15803d; --green-soft: #dcfce7; --gray-soft: #f1f5f9;
  --radius: 8px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.6 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 14px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* 顶栏 */
.topbar { background: #0f172a; color: #e2e8f0; position: sticky; top: 0; z-index: 10; }
.topbar .inner { max-width: 1200px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 4px; height: 50px; }
.topbar .logo { font-weight: 700; color: #fff; margin-right: 16px; white-space: nowrap; }
.topbar nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.topbar nav a { color: #cbd5e1; padding: 6px 12px; border-radius: 6px; white-space: nowrap; }
.topbar nav a:hover, .topbar nav a.active { background: #1e293b; color: #fff; text-decoration: none; }
.topbar .who { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 13px; }
.topbar .who a { color: #cbd5e1; }
.topbar .who button { background: none; border: 0; color: #94a3b8; cursor: pointer; font: inherit; padding: 0; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 20px 16px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 860px) { .grid-2, .grid-main { grid-template-columns: 1fr; } }

/* 提示 */
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 12px; }
.flash.ok { background: var(--green-soft); color: var(--green); }
.flash.error { background: var(--red-soft); color: var(--red); }

/* 按钮与表单 */
.btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; border-radius: 6px; border: 1px solid var(--line);
  background: #fff; color: var(--text); cursor: pointer; font: inherit; white-space: nowrap; }
.btn:hover { background: var(--gray-soft); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #1e40af; }
.btn.danger { color: var(--red); border-color: #fecaca; }
.btn.sm { padding: 2px 8px; font-size: 12px; }
.btn.big { padding: 10px 20px; font-size: 15px; }
input[type=text], input[type=password], input[type=date], input[type=datetime-local], input[type=number], select, textarea {
  font: inherit; padding: 6px 10px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: var(--text); width: 100%; max-width: 100%;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.req::after { content: " *"; color: var(--red); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }

/* 标签 */
.tag { display: inline-block; padding: 0 7px; border-radius: 10px; font-size: 12px; line-height: 20px; background: var(--gray-soft); color: var(--muted); white-space: nowrap; }
.cat { color: #fff; }
.st-todo { background: var(--gray-soft); color: #334155; }
.st-doing { background: var(--brand-soft); color: var(--brand); }
.st-blocked { background: var(--red-soft); color: var(--red); }
.st-done { background: var(--green-soft); color: var(--green); }
.st-cancelled { background: var(--gray-soft); color: #94a3b8; text-decoration: line-through; }
.pr-high { background: var(--red); color: #fff; }
.kind-decision { background: #ede9fe; color: #6d28d9; }
.kind-issue { background: var(--amber-soft); color: var(--amber); }
.kind-info { background: #e0f2fe; color: #0369a1; }
.due-over { color: var(--red); font-weight: 600; }
.due-today { color: var(--amber); font-weight: 600; }
.due-soon { color: var(--amber); }

/* 红灯卡片 */
.lights { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 860px) { .lights { grid-template-columns: repeat(2, 1fr); } }
.light { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: block; color: var(--text); }
.light:hover { text-decoration: none; border-color: #94a3b8; }
.light .n { font-size: 28px; font-weight: 700; line-height: 1.2; }
.light .l { font-size: 12px; color: var(--muted); }
.light.hot { border-color: #fca5a5; background: #fff5f5; }
.light.hot .n { color: var(--red); }
.light.warm .n { color: var(--amber); }

/* 事项列表 */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 10px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.item-line { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.item-line .title { font-weight: 600; color: var(--text); }
.item-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 2px; }
.empty { color: var(--muted); padding: 16px 0; text-align: center; }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 500; background: #f8fafc; white-space: nowrap; }
.tbl tr:hover td { background: #fafbfc; }
.tbl-scroll { overflow-x: auto; }

/* 会议工作台 */
.carry-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.carry-item.pending { border-left: 4px solid var(--amber); }
.carry-item.reviewed { border-left: 4px solid var(--green); background: #fbfefc; }
.carry-item .review-note { font-size: 12px; color: var(--green); margin-top: 4px; }
.carry-item .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.carry-item .actions input[type=text] { flex: 1 1 200px; width: auto; padding: 2px 8px; font-size: 13px; }
.carry-item .actions input[type=date] { width: 140px; padding: 2px 6px; font-size: 12px; }
.progress { height: 6px; background: var(--gray-soft); border-radius: 3px; overflow: hidden; flex: 1; max-width: 160px; }
.progress > i { display: block; height: 100%; background: var(--green); }
.agenda li { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; }
.agenda li.done span { color: var(--muted); text-decoration: line-through; }
.agenda input { margin-top: 4px; }
.quick-add { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: var(--radius); padding: 12px; }
.quick-add .row > * { flex: 1 1 120px; }
.quick-add .row > .grow { flex: 3 1 260px; }
.sticky-side { position: sticky; top: 90px; }
.save-state { font-size: 12px; color: var(--muted); }
.banner { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner.warn { background: var(--amber-soft); color: var(--amber); }
.banner.ended { background: var(--gray-soft); color: var(--muted); }

pre.minutes { white-space: pre-wrap; word-break: break-word; background: #f8fafc; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; font: 14px/1.7 "Microsoft YaHei", "PingFang SC", monospace; margin: 0; }

/* 时间线 */
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px 12px; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; border: 2px solid #fff; }
.timeline li.meeting::before { background: var(--brand); }
.timeline .when { font-size: 12px; color: var(--muted); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { width: auto; }
.cat-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-bar a { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border: 1px solid var(--line); border-radius: 16px; color: var(--text); background: #fff; font-size: 13px; }
.cat-bar .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.auth { max-width: 380px; margin: 10vh auto; }
details.type-edit { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 8px; }
details.type-edit summary { cursor: pointer; font-weight: 600; }

/* 事项编号（研发写进 Git 提交信息用） */
.ref-id { font: 12px/20px Consolas, monospace; color: var(--muted); background: var(--gray-soft); padding: 0 5px; border-radius: 4px; white-space: nowrap; }
h1 .ref-id { font-size: 14px; vertical-align: middle; }
code { font: 12px Consolas, monospace; background: var(--gray-soft); padding: 1px 4px; border-radius: 3px; }

/* 事项楼层式进展 */
.thread .post { border-top: 1px solid var(--line); padding: 12px 0; }
.thread .post:first-child { border-top: 0; padding-top: 0; }
.thread .post.origin { background: #f8fafc; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 4px; }
.thread .post-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; margin-bottom: 4px; }
.thread .floor { font-size: 12px; color: #fff; background: #94a3b8; border-radius: 4px; padding: 0 6px; }
.thread .origin .floor { background: var(--brand); }
.thread .post-body { margin-bottom: 4px; }
.thread .pre { white-space: pre-wrap; word-break: break-word; }
.thread .src { font-size: 12px; color: var(--muted); }
.thread .src-git { color: #7c3aed; }
.thread .src-ai { color: #0369a1; }
.thread .src-row-ai .post-body { background: #f0f9ff; border-radius: 6px; padding: 8px 10px; }
.thread .src-row-system { opacity: .75; }
.thread .reply { border-top: 2px dashed var(--line); margin-top: 4px; }
.thread .reply .floor { background: var(--green); }

/* 快速记录条（开会时一直停在顶部） */
.quickbar { position: sticky; top: 74px; z-index: 5; background: #fff; border: 2px solid var(--brand); border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 12px; box-shadow: 0 4px 12px rgba(15, 23, 42, .08); }
.quickbar .grow { flex: 1 1 300px; font-size: 15px; padding: 8px 12px; }
.quick-msg { min-height: 18px; margin-top: 4px; color: var(--muted); }
.quick-msg.ok { color: var(--green); }
.quick-msg.err { color: var(--red); }
.view-switch { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.view-switch a { padding: 4px 12px; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--text); font-size: 13px; }
.view-switch a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.view-switch a:hover { text-decoration: none; }

/* 按人视图 */
.person h2 { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.person .new-list:not(:empty) { margin: 4px 0 8px; padding-left: 10px; border-left: 3px solid var(--brand-soft); }
.person .new-list > li { padding: 6px 0; }
.person-input { border-style: dashed !important; background: #f8fafc !important; }
.person-input:focus { background: #fff !important; border-style: solid !important; }
@keyframes flashNew { from { background: #dcfce7; } to { background: transparent; } }
.flash-new { animation: flashNew 2s ease-out; }

/* 草稿确认 */
.drafts td { vertical-align: top; }
.drafts tr.need-owner td { background: #fffbeb; }
.drafts select, .drafts input[type=date] { min-width: 110px; }

/* 各地实时时钟条 */
.clockbar { background: #1e293b; color: #cbd5e1; font-size: 12px; position: sticky; top: 50px; z-index: 9; }
.clockbar .inner { max-width: 1200px; margin: 0 auto; padding: 3px 16px; display: flex; gap: 16px; overflow-x: auto; white-space: nowrap; }
.clockbar .clk b { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.clockbar .clk.off, .clockbar .clk.off b { color: #64748b; }
.clockbar small { color: #fbbf24; margin-left: 2px; }

/* 时间换算面板 */
.clockbar .inner { align-items: center; }
.clockbar .clocks { display: flex; gap: 16px; flex: 1; overflow-x: auto; }
.tz-toggle { background: #334155; color: #fff; border: 0; border-radius: 4px; padding: 1px 10px; font: inherit; cursor: pointer; white-space: nowrap; }
.tz-toggle:hover { background: var(--brand); }
.tz-panel { position: absolute; right: max(16px, calc((100vw - 1200px) / 2 + 16px)); top: 100%; width: min(440px, calc(100vw - 32px));
  background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .2); font-size: 14px; }
.tz-panel #tz-text { font-size: 15px; padding: 8px 10px; }
.tz-panel .row > * { flex: 1 1 100px; }
.tz-row { display: grid; grid-template-columns: 64px 70px 1fr; gap: 8px; padding: 5px 8px; border-radius: 6px; align-items: baseline; }
.tz-row b { font-size: 18px; font-variant-numeric: tabular-nums; }
.tz-row em { font-style: normal; color: var(--muted); font-size: 12px; }
.tz-row.src { background: var(--brand-soft); }
.tz-row.off b { color: #94a3b8; }

/* 会上直接改事项 */
.li-actions { margin-left: auto; display: inline-flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.editable:hover .li-actions, .editable:focus-within .li-actions { opacity: 1; }
@media (hover: none) { .li-actions { opacity: 1; } }
.li-act { border: 1px solid var(--line); background: #fff; border-radius: 4px; padding: 0 6px; font-size: 12px; line-height: 20px; cursor: pointer; }
.li-act:hover { background: var(--brand-soft); border-color: var(--brand); }
.editing > .item-line, .editing > .item-meta, .editing > .small.muted { opacity: .35; }
.inline-editor { margin: 6px 0 2px; padding: 8px; background: #f8fafc; border: 1px solid var(--brand); border-radius: 6px; display: grid; gap: 6px; }
.inline-editor .row > * { flex: 1 1 120px; }
