:root {
  --ink: #252a25;
  --muted: #565c53;
  --faint: #676c62;
  --line: #e3e2da;
  --control-line: #c9cdc2;
  --rail: #f1f0ea;
  --wash: #f6f5f0;
  --paper: #fffefa;
  --accent: #365748;
  --accent-hover: #2b483b;
  --selected: #e3e9df;
  --alert: #962f2d;
  --amber: #815018;
  --sidebar: 204px;
  --radius: 5px;
  font: 14px/1.5 "Segoe UI", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  accent-color: var(--accent);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
svg { width: 18px; height: 18px; display: inline-block; vertical-align: middle; flex: none; }
[hidden] { display: none !important; }

.layout { min-height: 100vh; padding-left: var(--sidebar); }
.sidebar {
  width: var(--sidebar);
  position: fixed;
  z-index: 4;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  padding: 0 13px 13px;
  background: var(--rail);
  border-right: 1px solid var(--line);
}
.sidebar nav { min-height: 0; overflow: auto; padding: 4px; }
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  margin: 0 8px 17px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  border-radius: var(--radius);
  color: var(--paper);
  background: var(--accent);
  font-weight: 700;
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-name { font-weight: 700; font-size: 16px; white-space: nowrap; }
.nav-group { border-top: 1px solid var(--line); padding-top: 13px; margin-top: 15px; }
.nav-label { margin: 0 9px 6px; color: var(--faint); font-size: 12px; }
.nav {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  margin-bottom: 2px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  text-align: left;
}
.nav svg { width: 16px; height: 16px; color: var(--faint); }
.nav:hover { background: #e9e8e0; color: var(--ink); }
.nav.active { background: var(--selected); color: var(--accent); font-weight: 650; }
.nav.active svg { color: currentColor; }
.sidebar-foot { margin-top: auto; }
.identity {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  margin-top: 7px;
  padding: 12px 4px 4px;
  background: transparent;
  text-align: left;
}
.avatar {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  border-radius: var(--radius);
  background: var(--selected);
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
}
.id-copy { min-width: 0; }
.id-copy strong, .id-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.id-copy strong { font-size: 13px; font-weight: 650; }
.id-copy small { margin-top: 2px; color: var(--faint); font-size: 11px; }
.identity > svg { width: 14px; margin-left: auto; color: var(--faint); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 0 37px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.crumbs, .top-actions { display: flex; align-items: center; gap: 10px; }
.crumbs { min-width: 0; font-size: 13px; white-space: nowrap; }
.crumbs span { color: var(--faint); overflow: hidden; text-overflow: ellipsis; }
.crumbs svg { width: 13px; height: 13px; color: var(--faint); }
.crumbs strong { font-weight: 620; }
.icon-button, .search-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  gap: 7px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}
.icon-button { width: 33px; }
.icon-button:hover, .search-button:hover { background: var(--wash); color: var(--ink); }
.icon-button svg, .search-button svg { width: 15px; height: 15px; }
.search-button { min-width: 150px; justify-content: flex-start; padding: 0 8px; font-size: 12px; }
kbd {
  margin-left: auto;
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--faint);
  font: 10px/1.5 ui-monospace, monospace;
}
.demo-mark {
  border: 0;
  padding: 3px 2px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.demo-mark:hover { color: var(--ink); text-decoration: underline; }
.connection-state { display: flex; align-items: center; gap: 5px; color: var(--accent); font-size: 11px; white-space: nowrap; }
.connection-state.offline { color: var(--alert); }
.dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; }

main.content { max-width: 1600px; margin: 0 auto; padding: 30px 37px 48px; }
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 23px;
}
.page-head h1 { font-size: 29px; font-weight: 690; line-height: 1.3; overflow-wrap: anywhere; }
.page-head p { margin-top: 5px; color: var(--muted); font-size: 13px; }
.head-date { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.head-date svg { width: 15px; height: 15px; }

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(228px, 24%);
  align-items: start;
  gap: 31px;
}
.daily-list { min-width: 0; }
.tabs { display: flex; gap: 19px; padding: 0 1px; overflow-x: auto; }
.tab {
  padding: 9px 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: none;
  font-size: 13px;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { border-color: var(--accent); color: var(--accent); font-weight: 670; }
.tab-count { margin-left: 6px; color: var(--faint); font-variant-numeric: tabular-nums; font-size: 12px; }
.table-wrap { overflow: auto; min-width: 0; border-bottom: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th {
  padding: 9px 12px;
  border-block: 1px solid var(--line);
  color: var(--muted);
  background: var(--wash);
  font-size: 12px;
  font-weight: 620;
}
td { padding: 10px 12px; border-top: 1px solid var(--line); }
tbody tr:hover { background: #f9f8f4; }
.admin-list { white-space: nowrap; }
.admin-list td { padding-top: 11px; padding-bottom: 11px; }
.work-list { table-layout: fixed; }
.work-list th:first-child { width: 59%; }
.work-list th:nth-child(2) { width: 18%; }
.work-list td { vertical-align: middle; }
.work-list td:first-child { padding: 0; }
.work-list td:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.work-list td.late, .late { color: var(--alert); }
.deadline-note { display: block; font-size: 11px; }
.task-link {
  display: flex;
  align-items: center;
  text-align: left;
  width: 100%;
  min-height: 63px;
  gap: 10px;
  padding: 9px 12px;
  border: 0;
  background: transparent;
}
.task-link:focus-visible { outline-offset: -3px; }
.task-link span:last-child { min-width: 0; }
.task-link strong { display: block; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.task-link:hover strong { color: var(--accent); text-decoration: underline; }
.task-link small { display: block; margin-top: 2px; color: var(--faint); font-size: 12px; }
.task-icon {
  width: 25px;
  height: 28px;
  flex: 0 0 25px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.task-icon svg { width: 18px; height: 18px; }
.task-icon.pptx { color: #876142; }
.task-icon.docx { color: #48665d; }
.task-icon.pdf { color: #843c35; }
.task-icon.xlsx { color: #42634e; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
}
.badge.in_progress, .badge.approved { color: var(--accent); }
.badge.returned, .badge.urgent, .badge.overdue { color: var(--alert); }
.badge.submitted, .badge.paused, .badge.scheduled, .badge.high { color: var(--amber); }
.deadlines { padding: 7px 0 0 23px; border-left: 1px solid var(--line); }
.deadlines h2 { font-size: 15px; font-weight: 680; margin-bottom: 10px; }
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda > li + li { border-top: 1px solid var(--line); }
.agenda-item { width: 100%; padding: 10px 0; border: 0; background: none; text-align: left; }
.agenda-item:hover strong { color: var(--accent); text-decoration: underline; }
.agenda-item strong, .agenda-item span { display: block; overflow-wrap: anywhere; }
.agenda-item strong { font-weight: 620; }
.agenda-item span { margin-top: 3px; color: var(--faint); font-size: 12px; }
.agenda-item span.late { color: var(--alert); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 35px;
  padding: 6px 10px;
  border: 1px solid var(--control-line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 620;
  white-space: nowrap;
  text-align: center;
}
.button svg { width: 15px; height: 15px; }
.button:hover { background: var(--wash); text-decoration: none; }
.button.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-hover); }
.button.danger { color: var(--alert); border-color: #d8b5ab; }
.button.danger:hover { background: #fbf0ec; }
.text-button {
  padding: 2px;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 620;
}
.text-button:hover { text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.empty { padding: 22px 12px; color: var(--faint); text-align: center; overflow-wrap: anywhere; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.6; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }

.columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(285px, 34%);
  align-items: start;
  gap: 23px;
}
.columns > *, .stack { min-width: 0; }
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.pad { padding: 16px 18px; }
.stack { display: grid; gap: 13px; }
.group-title { margin-bottom: 4px; font-size: 14px; font-weight: 675; }
.section-title { font-size: 16px; font-weight: 675; }
.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}
.summary .hint { display: block; }
.summary strong { font-size: 13px; }
.timeline { display: grid; }
.timeline > div { padding: 9px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.timeline strong { font-size: 13px; font-weight: 640; }
.timeline small { display: block; margin-top: 2px; color: var(--faint); font-size: 11px; }
.timeline p { margin-top: 3px; }

.file-list { display: grid; gap: 5px; }
.file {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.file .task-icon svg { width: 16px; height: 16px; }
.file-meta { min-width: 0; flex: 1; }
.file strong, .file small { display: block; overflow-wrap: anywhere; font-size: 12px; }
.file small { color: var(--faint); font-size: 11px; }
.file .text-button, .file input { white-space: nowrap; flex-shrink: 0; }
.upload-zone { position: relative; width: fit-content; cursor: pointer; }
.upload-zone.drag, .upload-zone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  clip-path: inset(50%);
  overflow: hidden;
}
label.field { display: grid; gap: 5px; font-size: 13px; font-weight: 625; }
.field input:not([type="checkbox"]), .field select, .field textarea, .filter input, .filter select, .form-control {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--control-line);
  border-radius: var(--radius);
  padding: 6px 8px;
  background: var(--paper);
  font-size: 13px;
  font-weight: 400;
}
.field textarea, textarea.form-control { resize: vertical; }
.field input[type="file"]::file-selector-button {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--wash);
  color: var(--ink);
  font: inherit;
}
fieldset.field { min-width: 0; margin: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius); }
fieldset legend { font-size: 13px; font-weight: 620; padding: 0 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-grid .span { grid-column: 1 / -1; }
.check-list { display: flex; gap: 6px 13px; flex-wrap: wrap; }
.check-list label { display: inline-flex; gap: 4px; align-items: center; font-size: 13px; color: var(--muted); }
.error { color: var(--alert); font-size: 13px; line-height: 1.5; }
.notice { padding: 8px 10px; border-left: 2px solid var(--accent); background: var(--wash); font-size: 13px; line-height: 1.55; }
.notice.warn { border-color: var(--amber); color: var(--amber); }
.agent-model-status { font-size: 12px; color: var(--muted); }
.agent-model-status.error { color: var(--alert); }
.output-warnings { padding: 7px 10px; border-left: 2px solid var(--amber); background: var(--wash); color: var(--amber); font-size: 12px; line-height: 1.55; }
.review-box { display: grid; gap: 8px; border-top: 1px solid var(--line); padding: 10px 0 0; }
.between { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.preview {
  margin: 0;
  max-height: 55vh;
  min-height: 185px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--wash);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  line-height: 1.65;
}
.plan-card { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 9px; }
.plan-card textarea { min-height: 76px; }
.draft-sources { display: grid; justify-items: start; gap: 8px; }
.draft-sources details { width: 100%; min-width: 0; }
.draft-sources summary { width: fit-content; color: var(--accent); font-size: 13px; }
.draft-sources details .file-list { margin-top: 7px; }

.admin-sections { gap: 26px; }
.filter { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 0 0 12px; }
.filter input, .filter select { width: auto; min-height: 35px; max-width: 100%; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 9px 0; }
.plans-section { display: grid; gap: 9px; border-top: 1px solid var(--line); padding-top: 16px; }
.plan-list { display: grid; gap: 8px; }
.plan-list article { display: grid; gap: 8px; border-top: 1px solid var(--line); padding: 9px 0; }

dialog {
  width: min(665px, calc(100vw - 24px));
  max-height: 91vh;
  padding: 0;
  border: 1px solid var(--control-line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 12px 38px #26282030;
}
dialog::backdrop { background: #282b265c; }
.dialog-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.dialog-title h2 { font-size: 17px; }
.dialog-body { padding: 14px 16px; }
.dialog-body form > .actions:last-child { justify-content: flex-end; }
#toast {
  display: none;
  position: fixed;
  z-index: 12;
  bottom: 18px;
  right: 18px;
  max-width: min(450px, calc(100vw - 36px));
  padding: 9px 12px;
  border: 1px solid var(--control-line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 3px 12px #26282025;
  font-size: 13px;
}
#toast.show { display: block; }
.splash, .login { min-height: 100vh; display: grid; place-items: center; }
.splash { place-content: center; justify-items: center; gap: 10px; }
.splash p { color: var(--muted); }
.login-content { width: min(360px, calc(100% - 32px)); display: grid; gap: 9px; }
.login-content .brand { min-height: 0; margin: 0 0 7px; }
.login-content h1 { font-size: 24px; margin-bottom: 7px; }

@media (max-width: 1080px) {
  :root { --sidebar: 177px; }
  main.content { padding-inline: 24px; }
  .topbar { padding-inline: 24px; }
  .dashboard { grid-template-columns: minmax(0, 1fr) 194px; gap: 18px; }
  .deadlines { padding-left: 14px; }
  .columns { gap: 14px; }
}

@media (max-width: 830px) {
  :root { --sidebar: 53px; }
  .sidebar { padding-inline: 5px; }
  .sidebar .brand { margin: 0 0 10px; justify-content: center; }
  .sidebar .brand-name, .nav-label, .nav span, .id-copy, .identity > svg { display: none; }
  .nav { justify-content: center; padding: 9px 0; }
  .identity { justify-content: center; }
  .topbar { min-height: 51px; padding-inline: 16px; }
  main.content { padding: 22px 16px; }
  .page-head h1 { font-size: 24px; }
  .search-button { min-width: 0; }
  .search-button span, .search-button kbd { display: none; }
}

@media (max-width: 655px) {
  .dashboard, .columns { grid-template-columns: 1fr; }
  .deadlines { padding: 13px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .tabs { gap: 11px; }
  .tab { font-size: 12px; }
  .tab-count { margin-left: 3px; }
  .page-head { flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
  .head-date { font-size: 12px; }
  .page-head h1 { font-size: 21px; }
  .crumbs span, .crumbs svg, .connection-state { display: none; }
  .top-actions { gap: 6px; }
  .work-list th, .work-list td { padding-inline: 6px; }
  .work-list th:first-child { width: 54%; }
  .work-list th:nth-child(2) { width: 20%; }
  .task-link { padding-inline: 4px; gap: 4px; }
  .task-link strong { font-size: 13px; }
  .task-link small, .badge { font-size: 11px; }
  .work-list td:last-child { font-size: 12px; }
  .work-list .task-icon { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .file { flex-wrap: wrap; }
}
