:root {
  --paper: #f4efe4;
  --paper-deep: #ebe3d4;
  --surface: #fcfaf5;
  --surface-muted: #f7f2e8;
  --ink: #1f1c17;
  --ink-soft: #454036;
  --muted: #756d60;
  --line: #dcd3c4;
  --line-strong: #c7bcaa;
  --accent: #9b3f2f;
  --accent-dark: #7d3023;
  --accent-soft: #f4e4dc;
  --green: #386a53;
  --green-soft: #e7f0e9;
  --amber: #94641d;
  --amber-soft: #f7ecd8;
  --red: #a64135;
  --red-soft: #f7e5e1;
  --serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", Georgia, serif;
  --sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius: 12px;
  --shadow: 0 16px 40px rgba(72, 55, 32, 0.08);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 255, 255, 0.7), transparent 36rem),
    var(--paper);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; }

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(252, 250, 245, 0.92);
  backdrop-filter: blur(12px);
}

.topbar__inner {
  width: min(1120px, calc(100% - 48px));
  min-height: 70px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 34px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.brand:hover { color: var(--ink); }

.brand__mark {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #faf6ed;
  font-family: var(--serif);
  font-size: 17px;
}

.brand__text {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.brand__text small {
  margin-left: 4px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 25px;
  min-width: 0;
}

.nav__link {
  position: relative;
  padding: 23px 0 21px;
  color: var(--ink-soft);
  font-size: 13px;
  white-space: nowrap;
}

.nav__link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: transparent;
}

.nav__link:hover { color: var(--accent); }
.nav__link.is-active { color: var(--accent); }
.nav__link.is-active::after { background: var(--accent); }
.nav__link--accent { color: var(--accent); font-weight: 600; }

.topbar__account {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  white-space: nowrap;
}

.account__name { font-size: 13px; font-weight: 600; }
.account__role { color: var(--muted); font-size: 11px; }

.text-button,
.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.text-button:hover,
.link-button:hover { color: var(--accent); }
.link-button { font-size: 12.5px; }
.link-button--danger { color: var(--red); }
.inline-form { display: inline; }

.shell {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 42px 0 56px;
}

.eyebrow {
  color: var(--accent);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.eyebrow--light { color: #d9b7a7; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 30px;
}

.page-head h1 {
  margin-top: 7px;
  font-size: clamp(30px, 4vw, 43px);
  line-height: 1.14;
}

.page-head__copy {
  max-width: 630px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
}

.page-head__actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.page-head--compact { margin-bottom: 23px; }
.page-head--compact h1 { font-size: clamp(28px, 3.5vw, 36px); }

.button {
  display: inline-flex;
  min-height: 37px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1;
  white-space: nowrap;
  transition: 160ms ease;
}

.button:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--surface);
}

.button--primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #faf6ed;
}

.button--primary:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.button--quiet { border-color: var(--line); background: var(--surface); }
.button--danger { border-color: #dbb9b1; color: var(--red); background: transparent; }
.button--danger:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.button--wide { width: 100%; }

.flash-stack { display: grid; gap: 8px; margin-bottom: 22px; }

.flash {
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  background: var(--surface);
  font-size: 13px;
}

.flash--success { border-left-color: var(--green); background: var(--green-soft); }
.flash--error { border-left-color: var(--red); background: var(--red-soft); }
.flash--info { border-left-color: var(--amber); background: var(--amber-soft); }

.paper-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  min-height: 155px;
  padding: 19px 20px 17px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: 160ms ease;
}

.stat-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-muted);
  color: var(--ink);
  transform: translateY(-2px);
}

.stat-card__label { color: var(--muted); font-size: 12px; }
.stat-card__value {
  margin-top: auto;
  font-family: var(--serif);
  font-size: 43px;
  font-weight: 500;
  line-height: 1.1;
}
.stat-card__note { margin-top: 5px; color: var(--muted); font-size: 10.5px; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(240px, 0.75fr);
  gap: 18px;
}

.dashboard-grid > .paper-card { padding: 24px 25px; }
.paper-card--muted { background: var(--surface-muted); }

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 13px;
}

.section-head h2 { margin-top: 5px; font-size: 23px; }
.text-link { color: var(--accent); font-size: 12px; }
.text-link:hover { color: var(--accent-dark); }

.listing { border-top: 1px solid var(--line); }
.listing__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 78px 15px;
  align-items: center;
  gap: 13px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.listing__row:hover { color: var(--ink); }
.listing__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listing__meta { color: var(--muted); font-size: 11px; text-align: right; }
.listing__arrow { color: var(--muted); font-size: 13px; }

.side-title { margin-top: 4px; font-size: 21px; line-height: 1.35; }
.steps { display: grid; gap: 13px; margin: 19px 0 18px; padding: 0; list-style: none; }
.steps li { display: flex; align-items: baseline; gap: 12px; font-size: 12px; }
.steps span { color: var(--accent); font-family: var(--mono); font-size: 10px; }
.side-note { color: var(--muted); font-size: 11px; line-height: 1.7; }

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.filter-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.filter-tab {
  padding: 6px 11px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.filter-tab:hover { color: var(--ink); background: var(--surface-muted); }
.filter-tab.is-active { color: var(--accent); background: var(--accent-soft); }

.search-form { display: flex; gap: 7px; min-width: 260px; }
.search-form input {
  width: 100%;
  min-height: 35px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: none;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
}
.search-form input:focus { border-color: var(--ink-soft); background: var(--surface); }
.search-form .button { min-height: 35px; padding: 0 12px; }

.table-wrap { overflow-x: auto; }

.article-table {
  width: 100%;
  min-width: 810px;
  border-collapse: collapse;
  text-align: left;
}
.article-table th {
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  white-space: nowrap;
}
.article-table td {
  padding: 14px 15px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  vertical-align: middle;
}
.article-table tbody tr:last-child td { border-bottom: 0; }
.article-table tbody tr:hover { background: #faf6ed; }
.actions-col { width: 150px; }
.nowrap { white-space: nowrap; }

.table-title { display: block; max-width: 300px; font-size: 13px; font-weight: 600; }
.table-title:hover { color: var(--accent); }
.table-id {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.05em;
}
.row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.row-actions a { color: var(--ink-soft); font-size: 11.5px; }
.row-actions a:hover { color: var(--accent); }

.status {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10px;
  white-space: nowrap;
}
.status--draft { color: var(--muted); background: #eeeae1; }
.status--pending { color: var(--amber); background: var(--amber-soft); }
.status--published { color: var(--green); background: var(--green-soft); }
.status--rejected { color: var(--red); background: var(--red-soft); }

.empty-state { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.empty-state--bordered { border-top: 1px solid var(--line); }
.empty-state__title { margin-bottom: 5px; color: var(--ink); font-family: var(--serif); font-size: 20px; }
.empty-state .button { margin-top: 15px; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.pagination a:hover { color: var(--accent); }
.pagination .is-disabled { opacity: 0.35; }

.back-link { margin-bottom: 16px; color: var(--muted); font-size: 12px; }
.back-link a:hover { color: var(--accent); }

.article-card { padding: 32px 34px; }
.article-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }
.article-head h1 { max-width: 720px; margin-top: 12px; font-size: clamp(27px, 4vw, 41px); line-height: 1.2; }
.article-meta { margin-top: 9px; color: var(--muted); font-family: var(--mono); font-size: 10px; }
.article-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 7px; padding-top: 3px; }
.article-actions .button { min-height: 33px; }

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 28px 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.meta-grid > div { padding: 0 18px; border-left: 1px solid var(--line); }
.meta-grid > div:first-child { padding-left: 0; border-left: 0; }
.meta-grid dt { color: var(--muted); font-size: 10px; letter-spacing: 0.04em; }
.meta-grid dd { margin-top: 4px; font-size: 12px; }
.meta-grid--compact { margin: 24px 0; }

.article-body {
  max-width: 780px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.95;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.review-note {
  max-width: 780px;
  margin-top: 30px;
  padding: 18px 20px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
}
.review-note p:last-child { margin-top: 7px; color: var(--ink-soft); font-size: 13px; white-space: pre-wrap; }

.notice {
  margin-top: 16px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}
.notice--warm { border-left-color: var(--amber); background: var(--amber-soft); }

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 18px;
  align-items: start;
}
.review-layout > .article-card { padding: 28px 30px; }
.review-title { margin-top: 12px; font-size: 30px; line-height: 1.25; }
.review-panel { padding: 25px; }
.review-panel h2 { margin: 5px 0 20px; font-size: 25px; }
.review-panel .stack-form { margin-top: 0; }

.choice-group { display: grid; gap: 8px; margin: 0 0 18px; padding: 0; border: 0; }
.choice-group legend { margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--ink-soft); background: var(--surface-muted); }
.choice input { margin-top: 4px; accent-color: var(--accent); }
.choice strong { display: block; font-size: 12.5px; }
.choice small { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; line-height: 1.55; }

.editor-form { padding: 27px 30px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: block; margin-bottom: 19px; }
.field:last-child { margin-bottom: 0; }
.field__label { display: block; margin-bottom: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 600; }
.field__label em { margin-left: 4px; color: var(--accent); font-size: 9px; font-style: normal; font-weight: 400; }
.field input,
.field textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  outline: none;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  transition: 150ms ease;
}
.field input { min-height: 42px; }
.field textarea { resize: vertical; line-height: 1.75; }
.field input:focus,
.field textarea:focus { border-color: var(--ink); background: var(--surface); box-shadow: 0 0 0 3px rgba(31, 28, 23, 0.06); }
.field input.is-invalid,
.field textarea.is-invalid { border-color: var(--red); background: var(--red-soft); }
.field__hint { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.field__error { display: block; margin-top: 5px; color: var(--red); font-size: 10.5px; }
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 27px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}
.form-actions__right { display: flex; gap: 8px; }

.stack-form { display: grid; gap: 17px; margin-top: 22px; }
.stack-form .field { margin-bottom: 0; }
.form-alert {
  padding: 11px 14px;
  border: 1px solid #dfb7af;
  border-radius: 5px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
}

.auth-body { background: var(--paper); }
.auth-layout {
  width: min(1120px, calc(100% - 48px));
  min-height: calc(100vh - 180px);
  margin: 44px auto 55px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(390px, 0.95fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.auth-story {
  position: relative;
  padding: 68px 62px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at 90% 5%, rgba(155, 63, 47, 0.3), transparent 26rem),
    #201d18;
  color: #f6f0e5;
  overflow: hidden;
}
.auth-story::after {
  content: "日";
  position: absolute;
  right: -28px;
  bottom: -80px;
  color: rgba(255, 255, 255, 0.045);
  font-family: var(--serif);
  font-size: 310px;
  line-height: 1;
  pointer-events: none;
}
.auth-story h1 { position: relative; z-index: 1; margin-top: 19px; font-size: clamp(36px, 5vw, 56px); line-height: 1.2; }
.auth-story__copy { position: relative; z-index: 1; max-width: 440px; margin-top: 26px; color: #c7beb0; font-size: 13px; line-height: 1.85; }
.auth-story__rule { width: 55px; height: 1px; margin: 37px 0 18px; background: #a86553; }
.auth-story__meta { position: relative; z-index: 1; color: #9e9587; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 62px 58px; }
.auth-panel__head h2 { margin-top: 9px; font-size: 35px; }
.auth-panel__head p:last-child { margin-top: 7px; color: var(--muted); font-size: 12px; }
.auth-panel .stack-form { margin-top: 28px; }
.auth-panel__foot { margin-top: 25px; color: var(--muted); font-size: 10.5px; }
.auth-panel .field__label { font-size: 11px; }

.error-state { max-width: 700px; margin: 80px auto; padding: 55px 55px 50px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: center; }
.error-code { color: var(--accent); font-family: var(--serif); font-size: 82px; line-height: 1; }
.error-state h1 { margin-top: 14px; font-size: 30px; }
.error-state p:not(.error-code) { margin-top: 12px; color: var(--muted); font-size: 13px; }
.error-actions { margin-top: 25px; }

.footer {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 22px 0 30px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .topbar__inner { flex-wrap: wrap; gap: 15px 25px; padding: 12px 0; }
  .nav { order: 3; width: 100%; gap: 21px; }
  .nav__link { padding: 2px 0 9px; }
  .topbar__account { margin-left: auto; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .review-layout { grid-template-columns: 1fr; }
  .review-panel { max-width: none; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-story { min-height: 300px; padding: 45px 40px; }
  .auth-panel { padding: 45px 40px; }
  .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; }
  .meta-grid > div:nth-child(3) { padding-left: 0; border-left: 0; }
}

@media (max-width: 680px) {
  .topbar__inner, .shell, .footer, .auth-layout { width: min(100% - 30px, 1120px); }
  .shell { padding-top: 28px; }
  .brand__text small { display: none; }
  .account__role { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 18px; }
  .page-head__actions { width: 100%; }
  .page-head__actions .button { flex: 1; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { min-height: 125px; padding: 15px; }
  .stat-card__value { font-size: 34px; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .search-form { min-width: 0; }
  .dashboard-grid > .paper-card, .article-card, .editor-form, .review-layout > .article-card { padding: 22px 18px; }
  .article-head { flex-direction: column; gap: 18px; }
  .article-head h1 { font-size: 29px; }
  .article-actions { width: 100%; }
  .article-actions .button { flex: 1; }
  .article-body { font-size: 16px; }
  .meta-grid { grid-template-columns: 1fr; }
  .meta-grid > div, .meta-grid > div:nth-child(3) { padding: 8px 0; border-left: 0; border-top: 1px solid var(--line); }
  .meta-grid > div:first-child { border-top: 0; padding-top: 0; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .form-actions__right { flex-direction: column; }
  .form-actions .button { width: 100%; }
  .pagination { flex-wrap: wrap; }
  .auth-story, .auth-panel { padding: 32px 24px; }
  .auth-story h1 { font-size: 38px; }
  .auth-panel__head h2 { font-size: 30px; }
  .error-state { margin: 30px auto; padding: 35px 22px; }
  .error-code { font-size: 65px; }
  .footer { font-size: 8px; }
}
