:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2329;
  --muted: #8f959e;
  --line: #e5e6eb;
  --primary: #3370ff;
  --primary-text: #ffffff;
  --success: #34a853;
  --warn: #f5a623;
  --warn-bg: #fff7e8;
  --danger: #f54a45;
  --danger-bg: #fdeceb;
  --info-bg: #eef3ff;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181a;
    --card: #232427;
    --text: #e8e9eb;
    --muted: #8f959e;
    --line: #34363a;
    --warn-bg: #3a2f1a;
    --danger-bg: #3d2223;
    --info-bg: #1f2a44;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: var(--primary); text-decoration: none; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 16px; margin: 16px 0 8px; }
h3 { font-size: 14px; margin: 12px 0 4px; color: var(--muted); }
ul { padding-left: 20px; margin: 4px 0; }

.topbar {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; color: var(--text); }
.nav { display: flex; align-items: center; gap: 12px; }
.who { color: var(--muted); font-size: 13px; }
.container { max-width: 960px; margin: 0 auto; padding: 16px; }

.card { background: var(--card); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card > h2:first-child, .row-head h2 { margin-top: 0; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.back { display: inline-block; margin-bottom: 8px; font-size: 14px; }

.btn {
  display: inline-block; padding: 6px 14px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--card); color: var(--text); font-size: 14px; cursor: pointer; white-space: nowrap;
}
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }

.tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; font-size: 12px; background: var(--info-bg); color: var(--primary); }
.badge { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 12px; }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }

.status { flex: none; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: var(--info-bg); color: var(--primary); }
.status-done { background: #e8f7ed; color: var(--success); }
.status-partial { background: var(--warn-bg); color: var(--warn); }
.status-failed { background: var(--danger-bg); color: var(--danger); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters input, .filters select { flex: 1 1 140px; min-width: 0; }
input, select, textarea {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--card); color: var(--text); font: inherit; max-width: 100%;
}

.meetings { list-style: none; padding: 0; margin: 0; }
.meeting a { display: block; background: var(--card); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; color: var(--text); }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.meeting-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { color: var(--muted); font-size: 13px; }
.progress { height: 6px; background: var(--line); border-radius: 3px; margin: 8px 0 4px; overflow: hidden; }
.progress .bar { height: 100%; background: var(--success); }
.stats { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.pager { display: flex; justify-content: center; gap: 16px; padding: 8px; font-size: 14px; }

.info { display: grid; grid-template-columns: 5em 1fr; gap: 4px 12px; margin: 0; }
.info dt { color: var(--muted); }
.info dd { margin: 0; }
.topic { font-weight: 600; }

.todos { list-style: none; padding: 0; }
.todo { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.todo:first-child { border-top: 0; }
.todo .check { flex: none; width: 18px; color: var(--muted); }
.todo.done .check { color: var(--success); }
.todo.done .todo-title { color: var(--muted); text-decoration: line-through; }
.todo-desc { font-size: 13px; margin-top: 2px; }

.notice { background: var(--warn-bg); }
.notice h2 { color: var(--warn); margin-top: 0; }

.board-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.board-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.board-card p { margin: 6px 0 0; font-size: 14px; }

details summary { cursor: pointer; font-weight: 600; }
.transcript { white-space: pre-wrap; word-break: break-word; font-size: 13px; max-height: 480px; overflow: auto; }

.table-wrap { overflow-x: auto; }
.logs { width: 100%; border-collapse: collapse; font-size: 13px; }
.logs th, .logs td { text-align: left; padding: 6px 8px; border-top: 1px solid var(--line); }
.log-failed td { color: var(--danger); }

.login { max-width: 360px; margin: 64px auto; text-align: center; }
.mode { border: 0; padding: 0; margin: 0 0 12px; display: flex; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 14px; color: var(--muted); }
textarea { width: 100%; resize: vertical; }

/* 会议全流程：页签、月历、参与人选择器、确认页 */
.status-scheduled { background: var(--info-bg); color: var(--primary); }
.status-review { background: var(--warn-bg); color: var(--warn); }
.status-cancelled { background: var(--line); color: var(--muted); }
.btn-sm { padding: 2px 10px; font-size: 13px; }
.notice-info { background: var(--info-bg); }
.notice-info h2 { margin-top: 0; }

.tabs { display: flex; gap: 20px; margin-bottom: 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 6px 0; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--text); font-weight: 600; border-bottom-color: var(--primary); }

.cal-head { margin-bottom: 12px; }
.month { width: 100%; border-collapse: collapse; table-layout: fixed; }
.month th { font-size: 13px; font-weight: normal; color: var(--muted); padding: 4px; }
.month td { vertical-align: top; height: 80px; padding: 4px; border: 1px solid var(--line); }
.month td.other { opacity: .45; }
.month td.today { outline: 2px solid var(--primary); outline-offset: -2px; }
.month .day { display: block; font-size: 12px; color: var(--muted); }
.cal-item {
  display: block; margin: 2px 0; padding: 1px 6px; border-left: 3px solid var(--primary); border-radius: 3px;
  background: var(--bg); color: var(--text); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-item.status-done { border-left-color: var(--success); }
.cal-item.status-partial, .cal-item.status-review { border-left-color: var(--warn); }
.cal-item.status-failed { border-left-color: var(--danger); }
.cal-list { display: none; list-style: none; padding: 0; }
.cal-list .cal-item { font-size: 14px; padding: 6px 8px; white-space: normal; }

.field-row { display: flex; flex-wrap: wrap; gap: 0 12px; }
.field-row .field { flex: 1 1 200px; }
.field .check-label { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.picker { margin-bottom: 12px; }
.picker > label { font-size: 14px; color: var(--muted); }
.picker-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0; }
.picker-tools input { flex: 1 1 160px; min-width: 0; }
.picker-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
.picker-list label { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.picker-list small { color: var(--muted); margin-left: auto; }
.events { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.event { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.event span { display: flex; flex-direction: column; }
.content-form { margin-top: 8px; }

.review fieldset#review-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.line { display: flex; gap: 8px; margin-bottom: 6px; }
.line input { flex: 1; min-width: 0; }
.item {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 0 0 8px; min-width: 0;
}
.item > input[data-k="task_title"], .item > input[data-k="item_name"], .item > textarea { grid-column: 1 / -1; }
.item .tag { margin-left: 0; justify-self: start; }
.item [data-del] { justify-self: start; }
.notify { margin: 16px 0 0; font-size: 14px; }
.actions {
  position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 0 4px; background: var(--card);
}

@media (max-width: 640px) {
  .month { display: none; }
  .cal-list { display: block; }
  .item { grid-template-columns: 1fr; }
}
