:root {
  --red-700: #a50f24;
  --red-600: #c51632;
  --red-500: #df2540;
  --red-100: #ffe4e8;
  --red-50: #fff4f5;
  --ink: #24171a;
  --muted: #78686c;
  --line: #eadde0;
  --surface: #ffffff;
  --background: #f9f4f5;
  --shadow: 0 18px 50px rgba(91, 20, 33, 0.1);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--background); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(223, 37, 64, 0.1), transparent 30%),
    linear-gradient(180deg, #fffafa 0%, var(--background) 100%);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

a { color: inherit; }
button, input, textarea { font: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(234, 221, 224, 0.9);
  background: rgba(255, 250, 250, 0.92);
  backdrop-filter: blur(16px);
}

.nav-wrap {
  width: min(1120px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 750;
  text-decoration: none;
}

.brand-mark, .login-icon {
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--red-500), var(--red-700));
  box-shadow: 0 10px 28px rgba(197, 22, 50, 0.25);
}

.brand-mark { width: 38px; height: 38px; border-radius: 13px; }

.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links > a, .nav-button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  text-decoration: none;
  cursor: pointer;
}
.nav-links > a:hover, .nav-links > a.active, .nav-button:hover {
  color: var(--red-700);
  background: var(--red-50);
}
.nav-links form { margin: 0; }

.page-shell {
  width: min(1000px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0 88px;
}

.hero-line {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(32px, 5vw, 50px); letter-spacing: -0.04em; }
h2 { margin-bottom: 8px; }
.eyebrow {
  margin-bottom: 10px;
  color: var(--red-600);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}
.muted { margin-bottom: 0; color: var(--muted); line-height: 1.7; }

.panel, .login-card {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}
.form-panel { padding: 34px; }

.stack-form { display: grid; gap: 22px; }
.stack-form > div { display: grid; gap: 9px; }
label { font-weight: 700; }
.required { color: var(--red-600); }
.optional { margin-left: 7px; color: #a38e93; font-size: 13px; font-weight: 500; }

input, textarea {
  width: 100%;
  border: 1px solid #dccbd0;
  border-radius: 13px;
  outline: 0;
  color: var(--ink);
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
input { height: 52px; padding: 0 16px; }
textarea { min-height: 132px; padding: 15px 16px; resize: vertical; line-height: 1.6; }
input:focus, textarea:focus {
  border-color: var(--red-500);
  box-shadow: 0 0 0 4px rgba(223, 37, 64, 0.11);
}

.primary-button, .secondary-button, .count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 13px;
  font-weight: 750;
  text-decoration: none;
}
.primary-button {
  border: 0;
  color: white;
  background: linear-gradient(135deg, var(--red-500), var(--red-700));
  box-shadow: 0 12px 26px rgba(197, 22, 50, 0.23);
  cursor: pointer;
}
.primary-button:hover { filter: brightness(0.96); }
.secondary-button, .count-pill {
  border: 1px solid #edcbd2;
  color: var(--red-700);
  background: var(--red-50);
}

.flash-stack { display: grid; gap: 10px; margin-bottom: 18px; }
.flash { padding: 14px 16px; border-radius: 12px; font-weight: 650; }
.flash.success { color: #17623a; border: 1px solid #bce1cb; background: #eefaf3; }
.flash.error { color: #8c1024; border: 1px solid #f0bec7; background: #fff0f2; }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}
.login-card { width: min(440px, 100%); padding: 42px; }
.login-card h1 { font-size: 34px; }
.login-card .muted { margin-bottom: 28px; }
.login-icon { width: 58px; height: 58px; margin-bottom: 26px; border-radius: 18px; font-size: 20px; font-weight: 800; }

.table-panel { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 18px 20px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #765f65; background: #fff6f7; font-size: 13px; letter-spacing: 0.03em; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fffbfb; }
.record-link { display: block; max-width: 430px; color: var(--red-700); overflow-wrap: anywhere; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.date-cell { width: 180px; white-space: nowrap; color: var(--muted); }
.note-cell { min-width: 220px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 18px; padding: 20px; border-top: 1px solid var(--line); color: var(--muted); }
.pagination a { color: var(--red-700); font-weight: 700; }
.empty-state { padding: 76px 24px; text-align: center; }
.empty-state p { margin: 0; color: var(--muted); }
.empty-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 18px; color: var(--red-700); background: var(--red-100); font-size: 24px; }

@media (max-width: 700px) {
  .nav-wrap { width: min(100% - 24px, 1120px); min-height: 64px; }
  .brand > span:last-child { display: none; }
  .nav-links { gap: 2px; }
  .nav-links > a, .nav-button { min-height: 38px; padding: 0 9px; font-size: 14px; }
  .page-shell { width: min(100% - 24px, 1000px); padding: 42px 0 64px; }
  .hero-line { align-items: flex-start; flex-direction: column; }
  .form-panel, .login-card { padding: 24px; border-radius: 21px; }
  h1 { font-size: 36px; }
  th, td { padding: 15px 16px; }
}

