:root {
  --navy: #1a3365;
  --navy-soft: #2a4a7a;
  --peach: #ffb085;
  --peach-soft: #fff1e8;
  --orange: #e87a2f;
  --bg: #faf9f7;
  --surface: #ffffff;
  --ink: #1a3365;
  --muted: #6a7385;
  --line: #e4e0da;
  --danger: #c62828;
  --ok: #2e7d4f;
  --radius: 8px;
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}

a {
  color: var(--navy);
  text-decoration: none;
}

a:hover {
  color: var(--orange);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-link:hover {
  text-decoration: none;
}

.brand-logo {
  height: 36px;
  width: auto;
  display: block;
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 14px;
  font-size: 0.92rem;
}

.nav-actions a {
  color: var(--muted);
}

.nav-actions a:hover {
  color: var(--navy);
}

.nav-actions .sep {
  color: var(--line);
}

.nav-user {
  color: var(--muted);
}

.btn,
button.btn,
input[type="submit"].btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: none;
  background: var(--navy);
  color: #fff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  background: var(--navy-soft);
  color: #fff;
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  background: var(--peach-soft);
  color: var(--navy);
  border-color: var(--peach);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #a81f1f;
  color: #fff;
}

.hero {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 72px;
  text-align: center;
}

.hero-logo {
  width: min(280px, 70vw);
  height: auto;
  margin: 0 0 16px;
  display: block;
}

.hero-brand {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.hero-sub {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 400;
}

.hero-more {
  margin: 20px 0 0;
}

.hero-more a {
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-more a:hover {
  color: var(--navy);
}

.search-row {
  width: min(560px, 100%);
  display: flex;
  gap: 10px;
}

.search-row input[type="search"],
.search-row input[type="text"] {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font: inherit;
  outline: none;
}

.search-row input:focus {
  border-color: var(--navy);
}

.search-row .btn {
  min-height: 48px;
  padding: 0 20px;
}

.page {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.page-title {
  margin: 8px 0 16px;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--navy);
}

.muted {
  color: var(--muted);
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--peach-soft);
  color: var(--navy);
  border: 1px solid #f0d8c4;
  margin-bottom: 16px;
}

.alert-error {
  background: #fdecea;
  color: var(--danger);
  border-color: #f5c6c2;
}

.alert-ok {
  background: #eaf6ef;
  color: var(--ok);
  border-color: #c5e5d1;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.list a.item {
  display: block;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}

.list a.item:hover {
  border-color: var(--navy);
  text-decoration: none;
  color: inherit;
}

.item-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--navy);
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  background: var(--peach-soft);
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 500;
}

.detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.detail dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px 12px;
  margin: 0;
}

.detail dt {
  color: var(--muted);
}

.detail dd {
  margin: 0;
  word-break: break-word;
}

.form {
  width: min(480px, 100%);
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.form label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

.form .field {
  margin-bottom: 14px;
}

.form input,
.form textarea,
.form select {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  background: #fff;
}

.form input:focus,
.form textarea:focus,
.form select:focus {
  border-color: var(--navy);
  outline: none;
}

.form textarea {
  min-height: 96px;
  resize: vertical;
}

.form .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.stat strong {
  display: block;
  font-size: 1.6rem;
  color: var(--navy);
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

table.data th,
table.data td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}

table.data th {
  background: #f6f5f3;
  color: var(--muted);
  font-weight: 600;
}

table.data tr:last-child td {
  border-bottom: none;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inline-actions .btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 51, 101, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: min(560px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.upload-thumb {
  position: relative;
  width: 96px;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #f6f5f3;
}

.upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.upload-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 4px;
  background: rgba(26, 51, 101, 0.75);
  color: #fff;
  cursor: pointer;
  line-height: 1;
  font-size: 14px;
  padding: 0;
}

.evidence-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.evidence-gallery a {
  display: block;
  width: min(180px, 40vw);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.evidence-gallery img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: top;
}

@media (max-width: 640px) {
  .brand-logo {
    height: 32px;
  }

  .hero-logo {
    width: min(220px, 72vw);
  }

  .search-row {
    flex-direction: column;
  }

  .search-row input,
  .search-row .btn {
    width: 100%;
  }

  .detail dl {
    grid-template-columns: 1fr;
  }

  .detail dt {
    margin-top: 6px;
  }
}
