:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #1d4ed8;
  --danger: #b91c1c;
  --ok-bg: #dcfce7;
  --ok-text: #14532d;
  --draft-bg: #fff7ed;
  --draft-text: #9a3412;
  --header-bg: #111827;
  --header-text: #ffffff;
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

.container {
  width: min(940px, 92%);
  margin: 0 auto;
}

.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 14px 0;
  margin-bottom: 24px;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  color: var(--header-text);
  text-decoration: none;
  font-size: 20px;
  font-weight: 700;
}

nav a {
  color: color-mix(in srgb, var(--header-text) 75%, #94a3b8);
  text-decoration: none;
  margin-left: 14px;
}

nav a:hover { color: var(--header-text); }
h1, h2 { margin-top: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 16px;
}

.card img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 8px;
  margin: 12px 0;
}

.post-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
}

.content { line-height: 1.75; }

.form-grid { display: grid; gap: 12px; }
.form-inline { display: flex; gap: 10px; align-items: center; }
.form-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input[type="text"],
input[type="password"],
input[type="datetime-local"],
select,
textarea,
input[type="file"] {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px;
  margin-top: 6px;
  background: #fff;
}

button,
.button {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover { opacity: 0.92; }

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: 10px;
  overflow: hidden;
}

.table th,
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.actions { white-space: nowrap; }
.inline-form { display: inline; }
.danger { background: var(--danger); }

.flash-list { list-style: none; padding: 0; }
.flash-list li {
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 8px;
}
.flash-success { background: #dcfce7; color: #14532d; }
.flash-error { background: #fee2e2; color: #7f1d1d; }

.badge {
  display: inline-block;
  border-radius: 999px;
  font-size: 12px;
  padding: 3px 10px;
}

.badge-ok {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.badge-draft {
  background: var(--draft-bg);
  color: var(--draft-text);
}

.small-image {
  width: min(260px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.narrow {
  max-width: 420px;
  margin: 20px auto;
}

code {
  background: color-mix(in srgb, var(--surface) 55%, #e2e8f0);
  padding: 2px 6px;
  border-radius: 6px;
}

@media (max-width: 760px) {
  .admin-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .form-split {
    grid-template-columns: 1fr;
  }

  .table,
  .table thead,
  .table tbody,
  .table tr,
  .table th,
  .table td {
    display: block;
    width: 100%;
  }

  .table tr {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 10px;
  }

  .table th { display: none; }
}
