:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-subtle: #fbfcfe;
  --ink: #1d232b;
  --muted: #717b88;
  --line: #e3e8ef;
  --line-soft: #f0f3f7;
  --accent: #277c83;
  --accent-dark: #1d5e64;
  --accent-soft: #edf8f8;
  --highlight: #f59f00;
  --danger-bg: #fff1f2;
  --danger: #b42318;
  --danger-dark: #8f1d13;
  --success-bg: #ecfdf3;
  --success: #067647;
  --warn-bg: #fff7e6;
  --warn: #9a5b00;
  --shadow: 0 18px 42px rgba(30, 41, 59, 0.075);
  --shadow-soft: 0 10px 26px rgba(30, 41, 59, 0.045);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(39, 124, 131, 0.08), transparent 360px),
    linear-gradient(180deg, #ffffff 0, rgba(255,255,255,0) 260px),
    var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover { color: var(--accent-dark); text-decoration: underline; }

.site-header {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.brand::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--accent), #7ab8b4);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

nav a {
  color: #3e4854;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 8px 11px;
  font-size: 14px;
  line-height: 1;
}

nav a:hover {
  background: var(--accent-soft);
  border-color: var(--line);
  text-decoration: none;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 46px 24px 76px;
}

.hero {
  max-width: 820px;
  padding: 44px 0 48px;
}

.hero h1,
.post h1,
.vault h1,
.admin-layout h1,
.auth-panel h1 {
  margin: 0 0 12px;
  font-size: 45px;
  line-height: 1.1;
  letter-spacing: 0;
}

.hero p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.eyebrow,
.post-meta {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 14px;
  padding-top: 22px;
  border-top: 1px solid rgba(227, 232, 239, 0.8);
}

.section-head h2 {
  margin: 0;
  color: #27313b;
  font-size: 15px;
  font-weight: 800;
}

.content-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.82);
  color: #44505c;
  font-size: 14px;
  font-weight: 700;
}

.chip:hover,
.chip.active {
  background: var(--accent-soft);
  border-color: rgba(39, 124, 131, 0.28);
  color: var(--accent-dark);
  text-decoration: none;
}

.post-list-item {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.post-list-item::after {
  content: "";
  width: 34px;
  height: 3px;
  margin-top: 18px;
  border-radius: 999px;
  background: var(--accent-soft);
}

.post-list-item:hover {
  transform: translateY(-2px);
  border-color: #c9d4dd;
  box-shadow: var(--shadow);
}

.post-list-item h2 {
  margin: 0 0 10px;
  font-size: 23px;
  line-height: 1.32;
}

.post-list-item h2 a { color: var(--ink); }

.post-list-item p:not(.post-meta) {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

.read-link {
  width: fit-content;
  margin-top: auto;
  padding-top: 18px;
  font-size: 14px;
  font-weight: 800;
}

.post,
.auth-panel,
.vault,
.admin-layout {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  box-shadow: var(--shadow-soft);
}

.post,
.vault,
.admin-layout {
  position: relative;
}

.post::before,
.vault::before,
.admin-layout::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, rgba(39, 124, 131, 0.42), rgba(122, 184, 180, 0.08));
}

.post {
  max-width: 820px;
  margin: 0 auto;
}

.prose {
  color: #2c343d;
  font-size: 17px;
  line-height: 1.9;
}

.html-article {
  max-width: 1040px;
}

.html-frame {
  overflow: auto;
  margin-top: 18px;
  padding: 0;
  border-top: 1px solid var(--line);
}

form { margin: 0; }

label {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  color: #2e3742;
  font-size: 14px;
  font-weight: 800;
}

input,
textarea,
select,
button {
  width: 100%;
  min-height: 42px;
  font: inherit;
  border: 1px solid #d4dde6;
  border-radius: 7px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

input::placeholder { color: #99a3ae; }

input:focus,
textarea:focus,
select:focus {
  outline: 3px solid rgba(39, 124, 131, 0.14);
  border-color: var(--accent);
}

textarea {
  min-height: 170px;
  resize: vertical;
}

button {
  width: auto;
  min-height: 38px;
  cursor: pointer;
  background: linear-gradient(180deg, #2f8a91, var(--accent));
  color: #fff;
  border-color: var(--accent);
  font-weight: 800;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

button:hover {
  background: linear-gradient(180deg, #26777e, var(--accent-dark));
  border-color: var(--accent-dark);
  transform: translateY(-1px);
}

.danger-button {
  background: linear-gradient(180deg, #c4322a, var(--danger));
  border-color: var(--danger);
}

.danger-button:hover {
  background: linear-gradient(180deg, #a6261f, var(--danger-dark));
  border-color: var(--danger-dark);
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check input {
  width: auto;
  min-height: 0;
}

.error {
  padding: 11px 12px;
  background: var(--danger-bg);
  border: 1px solid #fecdd3;
  border-radius: 7px;
  color: var(--danger);
}

.auth-panel {
  max-width: 420px;
  margin: 56px auto 0;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 24px;
  align-items: start;
}

.editor {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), var(--surface-subtle));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.editor h2 {
  margin: 0 0 18px;
  font-size: 20px;
}

.side-stack {
  display: grid;
  gap: 16px;
}

.subhead {
  margin: 28px 0 12px;
  font-size: 20px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f9fbfd;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge-ok {
  border-color: #b7e4c7;
  background: var(--success-bg);
  color: var(--success);
}

.badge-warn {
  border-color: #ffd591;
  background: var(--warn-bg);
  color: var(--warn);
}

.badge-muted {
  background: #f1f4f7;
  color: #667085;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
  padding: 13px 12px;
  line-height: 1.55;
}

th {
  position: sticky;
  top: 0;
  background: #fafbfd;
  color: #5b6673;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

td { background: #fff; }

tbody tr:hover td { background: #fbfdff; }

td form button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}

td form {
  display: inline-flex;
}

.filters {
  display: grid;
  grid-template-columns: 240px minmax(190px, 1fr) 94px;
  gap: 10px;
  margin: 0 0 18px;
}

.table-wrap {
  overflow: auto;
  max-height: 68vh;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

.table-wrap table { min-width: 780px; }

.table-wrap td {
  max-width: 380px;
  word-break: break-word;
}

.pager {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
}

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

.muted { color: var(--muted); }

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 16px 20px;
  }

  nav { flex-wrap: wrap; }
  main { padding: 28px 16px 58px; }
  .hero { padding: 18px 0 34px; }

  .hero h1,
  .post h1,
  .vault h1,
  .admin-layout h1,
  .auth-panel h1 {
    font-size: 32px;
  }

  .post,
  .auth-panel,
  .vault,
  .admin-layout {
    padding: 20px;
  }

  .content-list { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  button { width: 100%; }
  td form button { width: auto; }
}
