:root {
  --bg: #f3f1ec;
  --card: #fffdf9;
  --ink: #1c2430;
  --muted: #5d6773;
  --line: #e4e0d8;
  --accent: #0e6b5c;
  --accent-ink: #ffffff;
  --danger: #9d2c2c;
  --warn: #8a5a00;
  --flash: #e7f4ef;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

a { color: var(--accent); }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: #143f45;
  color: white;
}

.brand {
  color: white;
  font-weight: 700;
  text-decoration: none;
}

.top nav {
  display: flex;
  gap: 16px;
}

.top nav a {
  color: white;
  text-decoration: none;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.narrow { max-width: 420px; margin: 40px auto; }

h1, h2 { line-height: 1.3; margin: 0 0 12px; }
h2 { margin-top: 28px; font-size: 1.15rem; }

.muted { color: var(--muted); }
.error {
  background: #fdecec;
  color: var(--danger);
  padding: 10px 12px;
  border-radius: 8px;
}
.flash {
  background: var(--flash);
  padding: 10px 12px;
  border-radius: 8px;
}

label { display: block; margin: 14px 0 6px; font-weight: 700; }

input[type="text"], input[type="password"], input[type="search"], input[type="file"] {
  width: 100%;
  max-width: 520px;
  padding: 10px 12px;
  border: 1px solid #cfcabe;
  border-radius: 8px;
  background: white;
  font: inherit;
}

button, .button {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

button:disabled { opacity: 0.7; cursor: wait; }
button.danger { background: var(--danger); }

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.title-row h2 { margin: 0; }
.title-row form { margin: 0; }
.title-row button { margin-top: 0; }

.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 0;
}
.meta div { margin: 0; }
.meta dt { color: var(--muted); font-size: 0.85rem; }
.meta dd { margin: 0; font-weight: 700; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th { font-size: 0.9rem; color: var(--muted); }

.actions { display: flex; gap: 12px; }
.counts { padding-left: 18px; }
.dup {
  padding: 10px 12px;
  margin: 8px 0;
  background: #fff;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
}
.dup p { margin: 0; }
.dup-current { border-left-color: var(--warn); }
.dup-history { border-left-color: var(--danger); }

details { margin-top: 20px; }
summary { cursor: pointer; font-weight: 700; }
details ul { color: var(--muted); }

@media (max-width: 640px) {
  .top { align-items: flex-start; flex-direction: column; }
  .title-row { align-items: flex-start; }
}
