:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #10233f;
  --muted: #6f7d91;
  --line: #dde5ef;
  --blue: #2368b8;
  --blue-soft: #e8f1ff;
  --green: #19a66a;
  --amber: #c78a13;
  --shadow: 0 10px 30px rgba(22, 42, 72, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input {
  font: inherit;
}

textarea,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px clamp(18px, 4vw, 52px);
  background: rgba(245, 247, 251, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(221, 229, 239, 0.85);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.16;
  letter-spacing: 0;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.topbar-actions { display: flex; gap: 10px; align-items: center; }
.select-control { height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: #fff; color: var(--text); }
.task-list { display: grid; gap: 10px; }
.task-card { padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.task-card-head { display: flex; justify-content: space-between; gap: 16px; }
.task-card-head h3 { margin: 7px 0 4px; }
.task-card-head p { margin: 0; color: var(--muted); font-size: 13px; }
.task-status { display: inline-block; padding: 4px 9px; border-radius: 12px; background: #edf2f8; color: var(--muted); font-size: 12px; }
.task-status.running,.task-status.success { background: var(--blue-soft); color: var(--blue); }
.task-status.failed { background: #fff0f0; color: #b33b3b; }
.task-status.downloaded { background: #e6f6ed; color: var(--green); }
.progress { height: 7px; margin: 12px 0; overflow: hidden; border-radius: 4px; background: #edf1f6; }
.progress i { display: block; height: 100%; background: var(--blue); }
.task-meta,.task-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.task-meta { color: var(--muted); font-size: 13px; }
.task-actions { margin-top: 12px; }
.task-actions button { min-height: 34px; padding: 0 12px; }
.task-error { margin: 10px 0 0; color: #b33b3b; font-size: 13px; }
.task-form { width: 100%; }
.task-form label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.task-form input,.task-form select,#editDialog input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: #fff; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(16, 35, 63, 0.94);
  color: #fff;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}
.toast.hidden {
  display: none;
}

@media (max-width: 700px) {
  .topbar-actions { flex-wrap: wrap; }
  .export-toolbar,.form-grid { grid-template-columns: 1fr; flex-direction: column; }
  .export-toolbar .search-box,.export-toolbar .select-control,.export-toolbar .ghost-btn { width: 100%; }
}

.overview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.overview article,
.detail-card,
.toolbar,
.evidence-card,
dialog {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.overview article {
  padding: 18px;
}

.overview span,
.meta-grid span,
.muted {
  color: var(--muted);
}

.overview strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
  line-height: 1;
}

.category-panel {
  margin-top: 14px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.category-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.category-title h2 {
  margin: 0;
  font-size: 18px;
}

.category-title span {
  color: var(--muted);
  font-size: 14px;
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-filters button {
  min-height: 34px;
  padding: 0 12px;
  gap: 8px;
}

.category-filters button.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}

.category-filters strong {
  font-size: 13px;
  color: inherit;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 16px;
}

.search-box {
  display: flex;
  flex: 1 1 380px;
  min-width: 0;
  gap: 10px;
}

.search-box button {
  width: 76px;
  flex: 0 0 76px;
  white-space: nowrap;
}

.search-box input,
dialog input,
dialog textarea,
.notice-editor-card input,
.notice-editor-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: var(--text);
  background: #fff;
}

.search-box input,
dialog input,
.notice-editor-card input {
  height: 44px;
  padding: 0 14px;
}

dialog textarea,
.notice-editor-card textarea {
  min-height: 240px;
  padding: 12px 14px;
  line-height: 1.65;
  resize: vertical;
}

.search-box input:focus,
dialog input:focus,
dialog textarea:focus,
.notice-editor-card input:focus,
.notice-editor-card textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(35, 104, 184, 0.14);
}

button,
.primary-btn,
.ghost-btn,
.back-link {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.primary-btn {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.ghost-btn {
  background: #f8fafc;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filters button.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}

.list-head,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 0 12px;
}

.list-head h2,
.section-title h2 {
  margin: 0;
  font-size: 22px;
}

.list-head span,
.section-title span {
  color: var(--muted);
}

.evidence-list {
  display: grid;
  gap: 8px;
}

.evidence-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 12px;
  padding: 12px 14px;
  color: inherit;
  text-decoration: none;
}

.evidence-card h3 {
  margin: 6px 0 5px;
  font-size: 17px;
  line-height: 1.25;
}

.evidence-card p {
  margin-bottom: 8px;
  color: #33465f;
  font-size: 14px;
  line-height: 1.45;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.cover {
  width: 92px;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  background: linear-gradient(135deg, #eaf4f7, #edf3ff);
}

.cover.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: #fff4d7;
  color: var(--amber);
  font-weight: 700;
  font-size: 12px;
}

.status-badge.processing {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-badge.resolved {
  background: #e7f8ef;
  color: var(--green);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  color: #344054;
  font-size: 14px;
}

.page-arrow,
.page-numbers button {
  min-width: 28px;
  min-height: 28px;
  height: 28px;
  padding: 0 7px;
  border-radius: 7px;
}

.page-arrow {
  border-color: transparent;
  color: var(--muted);
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-numbers button.active {
  border-color: var(--green);
  color: var(--green);
  background: #fff;
}

.page-ellipsis {
  padding: 0 4px;
  color: var(--muted);
}

.jump-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.jump-box input {
  width: 54px;
  height: 28px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  padding: 0 6px;
}

.empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

.hidden {
  display: none;
}

dialog {
  width: min(420px, calc(100% - 32px));
  padding: 0;
}

#createDialog {
  width: min(720px, calc(100vw - 32px));
}

dialog::backdrop {
  background: rgba(10, 26, 48, 0.35);
}

.dialog-box {
  padding: 22px;
}

.dialog-box p {
  color: var(--muted);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.detail-topbar {
  justify-content: flex-start;
}

.detail-shell {
  display: grid;
  gap: 16px;
}

.detail-card {
  padding: 22px;
}

.detail-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.detail-desc {
  color: #263b55;
  line-height: 1.8;
  white-space: pre-wrap;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.meta-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.meta-grid strong {
  display: block;
  margin-top: 8px;
  line-height: 1.35;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.image-thumb {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.image-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #eef3f8;
  cursor: zoom-in;
}

.image-preview {
  width: min(1040px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  padding: 0;
  border: 0;
  background: rgba(9, 18, 32, 0.96);
  box-shadow: none;
}

.image-preview::backdrop {
  background: rgba(7, 14, 25, 0.72);
}

.image-preview img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 72px);
  margin: 44px auto 20px;
  object-fit: contain;
}

.preview-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font-size: 24px;
  line-height: 1;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline article {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.timeline time {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
  font-weight: 700;
}

.timeline p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.7;
}

.notice-body {
  background: #f7f9fc;
}

.notice-public-hero {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 14px;
}

.notice-public-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 6vw, 52px);
}

.notice-shell {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto 56px;
}

.notice-article,
.notice-admin-tip,
.notice-editor-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.notice-article {
  padding: clamp(22px, 4vw, 42px);
}

.notice-article h1 {
  margin: 0 0 18px;
  font-size: clamp(28px, 5vw, 44px);
}

.notice-article h2 {
  margin: 30px 0 12px;
  font-size: clamp(21px, 3vw, 28px);
}

.notice-article p,
.notice-article li {
  color: #33465f;
  font-size: 17px;
  line-height: 1.85;
}

.notice-article ul {
  padding-left: 22px;
}

.notice-article img {
  display: block;
  width: min(100%, 520px);
  max-height: 680px;
  margin: 22px auto;
  border-radius: 8px;
  object-fit: contain;
  background: #eef3f8;
}

.notice-admin-shell {
  display: grid;
  gap: 16px;
}

.notice-admin-tip {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.notice-admin-tip span {
  color: var(--muted);
}

.notice-editor-list {
  display: grid;
  gap: 14px;
}

.notice-editor-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.notice-editor-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.notice-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.notice-editor-head h2 {
  margin: 5px 0;
  font-size: 22px;
}

.notice-editor-head p {
  margin: 0;
  color: var(--muted);
}

.notice-channel {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 860px) {
  .overview,
  .meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination {
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .topbar-actions .ghost-btn,
  .topbar-actions .primary-btn,
  .topbar-actions button,
  .notice-editor-head button {
    width: 100%;
  }

  .notice-editor-head {
    align-items: stretch;
    flex-direction: column;
  }

  .overview,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .evidence-card {
    grid-template-columns: 1fr;
  }

  .cover {
    width: 100%;
    aspect-ratio: 16 / 9;
  }

  .search-box {
    flex-direction: row;
  }

  .export-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notice-article p,
  .notice-article li {
    font-size: 16px;
  }
}
