/* 县委工作协作平台 · 样式
 * 目标：轻量、清晰、政务场合耐看。不用任何前端框架。
 */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --line: #e3e6ea;
  --text: #1b1f24;
  --text-sub: #5c6672;
  --brand: #b01f24;          /* 政务红，克制使用 */
  --brand-soft: #fdf2f2;
  --warn: #b7791f;
  --warn-soft: #fff8e6;
  --danger: #c53030;
  --danger-soft: #fdecec;
  --ok: #276749;
  --ok-soft: #ecf7f1;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; text-decoration: none; }

.page { max-width: 900px; margin: 0 auto; padding: 0 14px 48px; }

/* 顶栏 */
.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 12px;
}
.topbar .title { font-size: 17px; font-weight: 600; }
.topbar .who { font-size: 12px; color: var(--text-sub); }

/* 统计卡片 */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 10px;
  text-align: center;
}
.stat .num { font-size: 22px; font-weight: 600; line-height: 1.2; }
.stat .lab { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.stat.is-overdue .num { color: var(--danger); }
.stat.is-review .num { color: var(--warn); }

/* 任务列表 */
.section-title {
  font-size: 13px;
  color: var(--text-sub);
  margin: 18px 0 8px;
  padding-left: 2px;
}

.task {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.task:active { background: #fafbfc; }
.task.is-overdue { border-left: 3px solid var(--danger); }

.task-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.task-title {
  font-weight: 600;
  font-size: 15px;
  flex: 1 1 auto;
  min-width: 0;
}
.task-meta {
  font-size: 12px;
  color: var(--text-sub);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* 标签 */
.tag {
  display: inline-block;
  font-size: 11px;
  line-height: 18px;
  padding: 0 7px;
  border-radius: 9px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.tag.pending_accept { background: #eef1f4; color: #495260; }
.tag.in_progress    { background: var(--brand-soft); color: var(--brand); }
.tag.pending_review { background: var(--warn-soft); color: var(--warn); }
.tag.done           { background: var(--ok-soft); color: var(--ok); }
.tag.cancelled      { background: #eef1f4; color: #8a93a0; }
.tag.overdue        { background: var(--danger-soft); color: var(--danger); }
.tag.urgent         { background: var(--danger-soft); color: var(--danger); }
.tag.important      { background: var(--warn-soft); color: var(--warn); }

/* 进度条 */
.bar {
  height: 6px;
  background: #eceff3;
  border-radius: 3px;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 3px;
}
.bar.is-done > span { background: var(--ok); }
.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bar-row .bar { flex: 1; }
.bar-row .pct { font-size: 12px; color: var(--text-sub); min-width: 38px; text-align: right; }

/* 空状态 */
.empty {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 36px 16px;
  text-align: center;
  color: var(--text-sub);
  font-size: 14px;
}

/* 时间线 */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  position: relative;
  padding: 0 0 16px 18px;
  border-left: 1px solid var(--line);
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
}
.timeline .ev-head {
  font-size: 12px;
  color: var(--text-sub);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.timeline .ev-body { font-size: 14px; margin-top: 2px; white-space: pre-wrap; word-break: break-word; }

/* 提示条 */
.notice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  color: var(--text-sub);
}
.notice strong { color: var(--text); }

@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 台账 ---------- */

.quicknav {
  margin-bottom: 12px;
  font-size: 14px;
}
.quicknav a { color: #1a4b8c; }

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.tab {
  flex: 1;
  text-align: center;
  padding: 9px 0;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 14px;
  color: var(--text-sub);
}
.tab.is-on {
  background: #1a4b8c;
  border-color: #1a4b8c;
  color: #fff;
  font-weight: 600;
}

.daynav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
}
.daynav-btn { color: #1a4b8c; }
.daynav-now { font-weight: 600; }

.entry {
  display: flex;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
}
.entry-time {
  flex: 0 0 42px;
  font-size: 12px;
  color: var(--text-sub);
  padding-top: 2px;
}
.entry-main { flex: 1; min-width: 0; }
.entry-head {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.entry-title { font-weight: 600; font-size: 14px; }
.entry-who {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 4px;
}
.entry-body {
  font-size: 13px;
  margin-top: 6px;
  line-height: 1.55;
  word-break: break-word;
}

.person {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
}
.person-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.person-name { font-weight: 600; }
.person-dept {
  font-size: 12px;
  color: var(--text-sub);
  margin-left: 6px;
}
.person-last { font-size: 12px; color: var(--text-sub); }
.person-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
  text-align: center;
}
.person-grid .n { font-weight: 600; font-size: 15px; }
.person-grid .l { font-size: 11px; color: var(--text-sub); margin-top: 2px; }
.num-warn { color: #c0392b; }

/* 现场影像 */
.entry-wrap { margin-bottom: 8px; }
.entry-wrap .entry { margin-bottom: 0; }

.ev-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.photo-chip {
  display: inline-block;
  font-size: 13px;
  color: #1a4b8c;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
}

.photo-meta { margin-bottom: 10px; }
.photo-task { font-weight: 600; font-size: 14px; }
.photo-sub { font-size: 12px; color: var(--text-sub); margin-top: 4px; }
.photo-box {
  background: #0f1216;
  border-radius: 10px;
  overflow: hidden;
}
.photo-box img { display: block; max-width: 100%; margin: 0 auto; }

/* ---------- 自主工作上报 ---------- */
.tag.self { background: #eef4fb; color: #1a4b8c; }

.quicknav-sep { color: var(--line); margin: 0 6px; }

/* ---------- 导出按钮 ---------- */
.exports {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.export-btn {
  flex: 1;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: #1a4b8c;
}

.banner {
  background: var(--ok-soft);
  border: 1px solid #cfe8db;
  color: var(--ok);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  margin: 10px 0;
}
.banner-warn {
  background: var(--danger-soft);
  border-color: #f3cccc;
  color: var(--danger);
}

.hint {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 14px;
}
.hint strong { color: var(--text); }

.form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px;
}
.field { display: block; margin-bottom: 16px; }
.field-label {
  display: block;
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 6px;
}
.field-label i { font-style: normal; color: var(--danger); }
.field-tip { display: block; font-size: 12px; color: var(--text-sub); margin-top: 5px; }

.form input[type="text"],
.form select,
.form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font: inherit;
  color: var(--text);
  background: #fff;
}
.form textarea { resize: vertical; }
.form input[type="file"] { font-size: 13px; }

.radios { display: flex; gap: 16px; flex-wrap: wrap; }
.radio { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.radio input { width: auto; }

.btn {
  display: inline-block;
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 600;
}
.btn-primary { background: var(--brand); color: #fff; width: 100%; }

/* ---------- 周报 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}

.digest {
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.report-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.report-name { font-weight: 600; font-size: 15px; }

.report-body {
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.review-line {
  font-size: 13px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  line-height: 1.6;
}

.review-form { margin-top: 10px; }
.review-note {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  margin-bottom: 8px;
}
.review-btns { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-primary-sm { background: var(--brand); color: #fff; padding: 8px 14px; font-size: 13px; }
.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-sub);
  padding: 10px 16px;
  font-size: 13px;
  width: 100%;
}

.report-edit {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  margin-bottom: 10px;
}
