:root {
  color-scheme: light;
  --ink: #142033;
  --muted: #637083;
  --line: #dfe5ec;
  --paper: #ffffff;
  --canvas: #f4f7fb;
  --primary: #155eef;
  --primary-dark: #1048bd;
  --danger: #c52a38;
  --success: #087a55;
  --shadow: 0 16px 50px rgba(18, 35, 58, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); font-size: 16px; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.site-header {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  min-height: 72px; padding: 12px clamp(20px, 5vw, 72px); background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(12px);
}
.brand { font-size: 1.1rem; font-weight: 800; letter-spacing: -.02em; }
.header-actions { display: flex; gap: 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 10px; font-weight: 700; transition: .18s ease; }
.button-primary { color: #fff; background: var(--primary); }
.button-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.button-secondary { background: #fff; border-color: var(--line); }
.button-secondary:hover { border-color: #aab6c5; }
.button-ghost { color: var(--muted); background: transparent; }
.full { width: 100%; }

.public-main, .admin-main { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: clamp(42px, 7vw, 88px) 0; }
.intro { max-width: 680px; margin-bottom: 34px; }
.eyebrow { margin: 0 0 8px; color: var(--primary); font-size: .8rem; font-weight: 800; letter-spacing: .14em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(2.2rem, 6vw, 4.5rem); line-height: 1.05; letter-spacing: -.055em; }
.intro > p:last-child { color: var(--muted); }
.notice { min-height: 26px; color: var(--muted); }
.record-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.record-card { padding: 28px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.record-card h2 { margin: 12px 0 10px; font-size: 1.35rem; line-height: 1.25; }
.category, .status { display: inline-flex; width: fit-content; padding: 3px 10px; border-radius: 999px; background: #eaf1ff; color: var(--primary-dark); font-size: .8rem; font-weight: 800; }
.record-content { color: #3b485b; white-space: pre-wrap; }
time { color: var(--muted); font-size: .82rem; }
footer { padding: 24px; color: var(--muted); text-align: center; font-size: .85rem; }

.login-panel { width: min(440px, 100%); margin: 5vh auto 0; }
.panel, .table-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.panel { padding: clamp(24px, 5vw, 38px); }
.login-panel h1 { font-size: 2.2rem; }
label { display: block; margin: 18px 0 6px; font-size: .9rem; font-weight: 750; }
input, textarea, select { width: 100%; padding: 11px 12px; color: var(--ink); background: #fff; border: 1px solid #b8c3d0; border-radius: 9px; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(21,94,239,.18); border-color: var(--primary); }
.login-panel .button { margin-top: 20px; }
.form-message { min-height: 24px; margin: 12px 0 0; color: var(--danger); }
.dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.dashboard-heading h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.6rem); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 16px 18px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: .8rem; letter-spacing: .04em; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.status-published { color: var(--success); background: #e4f7ef; }
.status-draft { color: #765200; background: #fff3ce; }
.row-actions { white-space: nowrap; }
.text-button { padding: 4px 8px; color: var(--primary); background: none; border: 0; font-weight: 700; }
.text-button.danger { color: var(--danger); }

dialog { width: min(620px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 30px 100px rgba(10,24,45,.28); }
dialog::backdrop { background: rgba(7,16,31,.58); backdrop-filter: blur(4px); }
dialog form { padding: 26px; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; }
.dialog-heading h2 { margin: 0; }
.icon-button { width: 40px; height: 40px; color: var(--muted); background: transparent; border: 0; font-size: 1.8rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

@media (max-width: 700px) {
  .site-header { min-height: 64px; padding-inline: 16px; }
  .public-main, .admin-main { width: min(100% - 28px, 1120px); padding-top: 40px; }
  .record-grid { grid-template-columns: 1fr; }
  .dashboard-heading { align-items: stretch; flex-direction: column; }
  th:nth-child(2), td:nth-child(2), th:nth-child(4), td:nth-child(4) { display: none; }
  th, td { padding: 13px 10px; }
  .header-actions .button { padding-inline: 10px; font-size: .88rem; }
}
