:root {
  --ink: #080707;
  --ink-soft: #171211;
  --ink-card: #211817;
  --paper: #fff8ec;
  --paper-soft: #f4ead9;
  --paper-line: #e5d4b9;
  --pku-red: #b40005;
  --pku-red-deep: #780006;
  --cloud-red: #c9653d;
  --gold: #c7a66b;
  --teal: #2d786f;
  --blue: #526f9b;
  --text: #29221f;
  --muted: #776d64;
  --muted-dark: #d7c8ad;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --radius: 8px;
  --front-bg: #f7efe4;
  --front-paper: #fffaf0;
  --front-paper-strong: #fffdf8;
  --front-ink: #241817;
  --front-muted: #6f6258;
  --front-red: #a30005;
  --front-red-deep: #650104;
  --front-cinnabar: #b85f42;
  --front-smoke: #bdb7ad;
  --front-shadow: 0 16px 38px rgba(45, 25, 18, 0.09);
  --front-shell-max: 1600px;
  --front-shell: min(1280px, calc(100% - 48px));
}

body[data-auth-required="true"]:not([data-auth-state="ready"]) > * {
  visibility: hidden;
}

body[data-auth-required="true"]:not([data-auth-state="ready"]) .topbar,
body[data-auth-required="true"]:not([data-auth-state="ready"]) .reader-header {
  visibility: visible;
}

body[data-page="home"][data-auth-required="true"]:not([data-auth-state="ready"]) > * {
  visibility: visible;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: #f2f3f1;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 78% 4%, rgba(180, 0, 5, 0.3), transparent 27rem),
    linear-gradient(180deg, #080707 0%, #16100f 54%, #290d0b 100%);
  color: var(--paper);
  font-family:
    "Inter", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  top: 60px;
  right: 6vw;
  z-index: -1;
  width: 440px;
  height: 255px;
  background: url("./assets/cloud-gray-top.png") center / contain no-repeat;
  opacity: 0.32;
  pointer-events: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

[hidden] {
  display: none !important;
}

.site-shell {
  width: var(--front-shell);
  margin: 0 auto;
}

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0 10px;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--paper);
  text-decoration: none;
}

.logo-plate {
  width: 238px;
  height: 48px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(255, 248, 236, 0.36);
  border-radius: var(--radius);
  background: rgba(255, 248, 236, 0.96);
  overflow: hidden;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.02rem;
}

.brand small {
  margin-top: 3px;
  color: var(--muted-dark);
  font-size: 0.8rem;
}

.brand-copy {
  min-width: 0;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(255, 248, 236, 0.16);
  border-radius: var(--radius);
  background: rgba(8, 7, 7, 0.62);
  backdrop-filter: blur(16px);
}

.topnav a,
.nav-logout {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-dark);
  padding: 0 13px;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 780;
  white-space: nowrap;
}

.topnav a:hover,
.topnav a.active,
.nav-logout:hover {
  background: var(--pku-red);
  color: #fff;
}

.front-hero,
.module-page-hero,
.admin-hero,
.login-card {
  position: relative;
  border: 1px solid rgba(255, 248, 236, 0.16);
  border-radius: var(--radius);
  background: linear-gradient(110deg, rgba(8, 7, 7, 0.96), rgba(38, 13, 11, 0.86));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.front-hero,
.module-page-hero {
  min-height: 280px;
  display: grid;
  align-items: end;
  margin-top: 8px;
  padding: 42px 34px 32px;
}

.front-hero::before,
.module-page-hero::before,
.admin-hero::before {
  content: "";
  position: absolute;
  left: 0;
  right: 18%;
  top: 92px;
  height: 74px;
  background: var(--pku-red);
  opacity: 0.94;
}

.front-hero-copy,
.module-page-hero > div,
.admin-hero > div {
  position: relative;
  z-index: 1;
}

.cloud-motif,
.login-cloud {
  position: absolute;
  z-index: 0;
  max-width: none;
  pointer-events: none;
}

.cloud-motif-one {
  right: -40px;
  top: 38px;
  width: 620px;
  opacity: 0.88;
}

.cloud-motif-admin {
  right: -70px;
  top: 40px;
  width: 700px;
  opacity: 0.78;
}

.hero-red-ribbon {
  position: absolute;
  right: 6%;
  bottom: 20px;
  width: min(520px, 58%);
  height: 116px;
  background: url("./assets/cloud-bottom-left.png") left bottom / contain no-repeat;
  opacity: 0.74;
}

.notice-strip {
  width: fit-content;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.notice-strip span,
.chip {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 248, 236, 0.18);
  border-radius: 999px;
  background: rgba(8, 7, 7, 0.66);
  color: var(--paper);
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 860;
}

.front-hero h1,
.module-page-hero h1,
.admin-hero h1,
.login-card h1 {
  margin-bottom: 14px;
  color: #fff8ec;
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-weight: 760;
  line-height: 1.13;
  letter-spacing: 0;
}

.front-hero h1 {
  max-width: 760px;
  font-size: 3rem;
}

.module-page-hero h1,
.admin-hero h1 {
  font-size: 2.6rem;
}

.front-hero p,
.module-page-hero p,
.admin-hero p,
.login-card p {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted-dark);
  font-size: 1rem;
  line-height: 1.85;
}

.module-entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.module-entry {
  min-height: 188px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border: 1px solid rgba(255, 248, 236, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 248, 236, 0.96), rgba(244, 234, 217, 0.96)),
    url("./assets/cloud-linework-right.png") right -120px bottom -100px / 360px auto no-repeat;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
}

.module-entry:hover {
  transform: translateY(-2px);
}

.module-entry span {
  color: var(--pku-red);
  font-weight: 900;
}

.module-entry strong {
  display: block;
  margin-top: 18px;
  font-size: 1.5rem;
}

.module-entry p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.home-latest,
.module-board,
.admin-panel {
  margin-bottom: 28px;
  padding: 24px;
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  background: rgba(255, 248, 236, 0.97);
  color: var(--text);
  box-shadow: var(--shadow);
}

.module-board {
  margin-top: 22px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 3px 0 0;
  font-size: 1.55rem;
  line-height: 1.2;
}

.section-heading a {
  color: var(--teal);
  font-weight: 850;
  text-decoration: none;
}

.section-heading a:hover,
.source-link:hover {
  text-decoration: underline;
}

.eyebrow {
  display: block;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.control-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
}

.search-line {
  display: grid;
  gap: 8px;
}

label,
.search-line label {
  color: #3b332e;
  font-size: 0.88rem;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  background: #fffdf8;
  color: var(--text);
  outline: none;
}

input,
select {
  min-height: 44px;
  padding: 10px 12px;
}

textarea {
  min-height: 130px;
  padding: 12px;
  resize: vertical;
  line-height: 1.65;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(180, 0, 5, 0.62);
  box-shadow: 0 0 0 3px rgba(180, 0, 5, 0.14);
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  background: #eee0c8;
}

.segmented button,
.admin-sidebar button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 6px 12px;
  font-weight: 850;
  white-space: nowrap;
}

.segmented button.active {
  background: #fffdf8;
  color: var(--pku-red-deep);
  box-shadow: 0 6px 18px rgba(42, 36, 33, 0.08);
}

.content-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.content-tools p {
  margin: 0;
  color: var(--muted);
  font-weight: 780;
}

.content-tools select {
  width: 170px;
}

.stack-list,
.record-list {
  display: grid;
  gap: 10px;
}

.list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  background: #fffdf8;
}

.list-item h3,
.content-card h3,
.record-row h3 {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.38;
}

.list-item p,
.content-card p,
.record-row p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin: 0 0 10px;
}

.chip {
  border-color: rgba(42, 36, 33, 0.12);
  background: #f8ead6;
  color: var(--pku-red-deep);
}

.chip.teal {
  background: #e9f5f2;
  color: var(--teal);
}

.chip.gold {
  background: #f5e9cf;
  color: #79540f;
}

.chip.blue {
  background: #edf2f9;
  color: var(--blue);
}

.chip.muted {
  background: #efe4d2;
  color: var(--muted);
}

.date-badge {
  min-width: 78px;
  display: grid;
  place-items: center;
  align-self: stretch;
  border-radius: 6px;
  background: var(--pku-red);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.content-card {
  min-height: 246px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #fffdf8, #fff8ec);
}

.content-card::before {
  content: "";
  display: block;
  width: 76px;
  height: 5px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: var(--pku-red);
}

.card-top {
  display: grid;
  gap: 12px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #eadcc7;
}

.card-footer small,
.record-row small {
  color: var(--muted);
}

.source-link {
  color: var(--teal);
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(42, 36, 33, 0.16);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--text);
  padding: 9px 14px;
  text-decoration: none;
  font-weight: 850;
}

.button:hover {
  border-color: rgba(180, 0, 5, 0.44);
  color: var(--pku-red-deep);
}

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

.button.primary:hover {
  background: var(--pku-red-deep);
  color: #fff;
}

.button.subtle {
  background: #f4ead9;
}

.button.danger {
  border-color: rgba(180, 0, 5, 0.22);
  background: #fff1ef;
  color: var(--pku-red-deep);
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed #cbb999;
  border-radius: var(--radius);
  background: #fff9ed;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

.login-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}

.login-cloud-top {
  top: 4vh;
  left: 50%;
  width: 380px;
  opacity: 0.62;
}

.login-cloud-band {
  right: -120px;
  bottom: 16vh;
  width: 860px;
  opacity: 0.82;
}

.login-card {
  z-index: 1;
  width: min(430px, 100%);
  display: grid;
  gap: 15px;
  padding: 26px;
}

.login-card label,
.login-card h1 {
  color: var(--paper);
}

.login-logo {
  width: 260px;
}

.login-error {
  min-height: 20px;
  margin: 0;
  color: #ffd3cb;
  font-size: 0.9rem;
}

.admin-console {
  padding-bottom: 44px;
}

.admin-hero {
  min-height: 250px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: end;
  margin: 8px 0 22px;
  padding: 42px 28px 26px;
}

.admin-hero::before {
  top: 86px;
  height: 64px;
}

.admin-hero-card {
  position: relative;
  z-index: 1;
  padding: 18px;
  border: 1px solid rgba(255, 248, 236, 0.18);
  border-radius: var(--radius);
  background: rgba(16, 12, 11, 0.78);
}

.admin-hero-card span,
.admin-hero-card small {
  display: block;
  color: var(--muted-dark);
}

.admin-hero-card strong {
  display: block;
  margin: 10px 0;
  color: var(--paper);
  font-size: 1.3rem;
}

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

.admin-sidebar {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(255, 248, 236, 0.16);
  border-radius: var(--radius);
  background: rgba(8, 7, 7, 0.78);
  box-shadow: var(--shadow);
}

.admin-side-title {
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 900;
}

.admin-sidebar button {
  justify-content: flex-start;
  color: var(--muted-dark);
  text-align: left;
}

.admin-sidebar button.active,
.admin-sidebar button:hover {
  background: var(--pku-red);
  color: #fff;
}

.admin-main {
  display: grid;
  gap: 18px;
}

.admin-panel {
  margin-bottom: 0;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  min-height: 100px;
  padding: 15px;
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  background: #fffdf8;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-weight: 850;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  color: var(--pku-red-deep);
  font-size: 2rem;
}

.admin-editor {
  display: grid;
  gap: 13px;
}

.admin-editor label {
  display: grid;
  gap: 7px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-field-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.admin-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px;
  gap: 10px;
}

.record-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  background: #fffdf8;
}

.record-main {
  min-width: 0;
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

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

.workflow-grid div {
  min-height: 126px;
  padding: 16px;
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fffdf8, #f6eddf);
}

.workflow-grid strong,
.workflow-grid span {
  display: block;
}

.workflow-grid span {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.65;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: 360px;
  padding: 12px 14px;
  border: 1px solid rgba(45, 120, 111, 0.24);
  border-radius: var(--radius);
  background: #fffdf8;
  color: var(--text);
  box-shadow: var(--shadow);
}

body[data-page="home"],
body[data-page="module"] {
  position: relative;
  overflow-x: hidden;
  --module-accent: var(--front-red);
  background:
    radial-gradient(circle at -8% 18%, rgba(101, 1, 4, 0.08), transparent 24rem),
    radial-gradient(circle at 84% -8%, rgba(189, 183, 173, 0.32), transparent 26rem),
    linear-gradient(180deg, #f8f0e3 0%, #efe2d0 46%, #fbf6ee 100%);
  color: var(--front-ink);
}

body[data-page="module"][data-module="note"] {
  --module-accent: var(--front-cinnabar);
}

body[data-page="module"][data-module="qa"] {
  --module-accent: #3d4a47;
}

body[data-page="home"]::before,
body[data-page="module"]::before {
  top: -104px;
  right: -128px;
  z-index: 0;
  width: min(820px, 72vw);
  height: 360px;
  background: url("./assets/cloud-lower-ribbon.png") right top / contain no-repeat;
  opacity: 0.13;
  filter: saturate(0.72) contrast(0.96);
}

body[data-page="home"] .site-shell,
body[data-page="module"] .site-shell {
  position: relative;
  z-index: 1;
}

body[data-page="home"] .topbar,
body[data-page="module"] .topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 74px;
  padding: 10px 0;
  background: rgba(248, 240, 227, 0.88);
  backdrop-filter: blur(18px);
}

body[data-page="home"] .brand,
body[data-page="module"] .brand {
  color: var(--text);
}

body[data-page="home"] .brand small,
body[data-page="module"] .brand small {
  color: var(--muted);
}

body[data-page="home"] .logo-plate,
body[data-page="module"] .logo-plate {
  width: 292px;
  height: 56px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body[data-page="home"] .brand-copy,
body[data-page="module"] .brand-copy {
  padding-left: 4px;
}

body[data-page="home"] .brand strong,
body[data-page="module"] .brand strong {
  color: var(--front-ink);
  font-size: 0.98rem;
}

body[data-page="home"] .brand small,
body[data-page="module"] .brand small {
  font-size: 0.78rem;
}

body[data-page="home"] .topnav,
body[data-page="module"] .topnav {
  border: 0;
  background: rgba(255, 253, 248, 0.54);
  box-shadow: none;
}

body[data-page="home"] .topnav a,
body[data-page="module"] .topnav a {
  color: #3b312d;
}

body[data-page="home"] .topnav a:hover,
body[data-page="home"] .topnav a.active,
body[data-page="module"] .topnav a:hover,
body[data-page="module"] .topnav a.active {
  background: rgba(101, 1, 4, 0.1);
  color: var(--front-red-deep);
}

body[data-page="home"] .front-hero,
body[data-page="module"] .module-page-hero {
  width: 100vw;
  min-height: 238px;
  margin-left: calc(50% - 50vw);
  border: 0;
  border-radius: 0;
  padding-left: max(24px, calc((100vw - var(--front-shell-max)) / 2 + 34px));
  padding-right: max(24px, calc((100vw - var(--front-shell-max)) / 2 + 34px));
  background:
    radial-gradient(circle at 92% 0, rgba(189, 183, 173, 0.42), transparent 20rem),
    linear-gradient(105deg, rgba(255, 250, 240, 0.99) 0%, rgba(244, 232, 216, 0.97) 62%, rgba(226, 220, 211, 0.88) 100%);
  box-shadow: none;
}

body[data-page="home"] .front-hero::before,
body[data-page="module"] .module-page-hero::before {
  top: auto;
  right: auto;
  bottom: 0;
  width: min(560px, 54%);
  height: 8px;
  background: linear-gradient(90deg, var(--module-accent) 0%, var(--front-cinnabar) 100%);
  opacity: 1;
}

body[data-page="home"] .front-hero::after,
body[data-page="module"] .module-page-hero::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -86px;
  width: min(700px, 62vw);
  height: 210px;
  background: url("./assets/cloud-red-band.png") right top / contain no-repeat;
  opacity: 0.15;
  filter: saturate(0.78);
  pointer-events: none;
}

body[data-page="home"] .cloud-motif-one,
body[data-page="module"] .cloud-motif-one {
  display: none;
}

body[data-page="home"] .front-hero-copy,
body[data-page="module"] .module-page-hero > div {
  max-width: 760px;
}

body[data-page="home"] .notice-strip span,
body[data-page="module"] .notice-strip span {
  border: 0;
  background: rgba(101, 1, 4, 0.08);
  color: var(--front-red-deep);
}

body[data-page="home"] .notice-strip span:first-child {
  background: rgba(36, 24, 23, 0.9);
  color: var(--front-paper);
}

body[data-page="home"] .notice-strip span:nth-child(2) {
  background: rgba(163, 0, 5, 0.1);
}

body[data-page="home"] .front-hero h1,
body[data-page="module"] .module-page-hero h1 {
  max-width: 720px;
  color: var(--module-accent);
  text-shadow: none;
}

body[data-page="home"] .front-hero h1 {
  font-size: 2.55rem;
}

body[data-page="home"] .front-hero p,
body[data-page="module"] .module-page-hero p {
  max-width: 620px;
  color: #4b403a;
  font-size: 1.04rem;
}

body[data-page="home"] .hero-red-ribbon {
  display: none;
}

body[data-page="home"] .module-entry,
body[data-page="module"] .content-card,
body[data-page="home"] .home-latest,
body[data-page="module"] .module-board {
  box-shadow: var(--front-shadow);
}

body[data-page="home"] .module-entry {
  --entry-accent: var(--front-red);
  position: relative;
  min-height: 168px;
  border: 0;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(247, 239, 226, 0.98)),
    url("./assets/cloud-linework-right.png") right -130px bottom -110px / 340px auto no-repeat;
  overflow: hidden;
}

body[data-page="home"] .note-entry {
  --entry-accent: var(--front-cinnabar);
}

body[data-page="home"] .qa-entry {
  --entry-accent: #3d4a47;
}

body[data-page="home"] .module-entry::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 0;
  width: 48px;
  height: 4px;
  border-radius: 999px;
  background: var(--entry-accent);
}

body[data-page="home"] .module-entry:hover {
  box-shadow: 0 18px 42px rgba(45, 25, 18, 0.13);
  transform: translateY(-2px);
}

body[data-page="home"] .module-entry span {
  color: var(--entry-accent);
}

body[data-page="home"] .module-entry strong,
body[data-page="module"] .content-card h3,
body[data-page="home"] .list-item h3 {
  color: var(--front-ink);
}

body[data-page="home"] .module-entry p,
body[data-page="module"] .content-card p,
body[data-page="home"] .list-item p {
  color: var(--front-muted);
}

body[data-page="home"] .section-heading h2,
body[data-page="module"] .section-heading h2 {
  color: var(--front-ink);
}

body[data-page="home"] .eyebrow,
body[data-page="module"] .eyebrow {
  color: #8a5b35;
}

body[data-page="home"] .section-heading a,
body[data-page="module"] .source-link {
  color: #365f59;
}

body[data-page="home"] .date-badge,
body[data-page="module"] .date-badge {
  background: linear-gradient(145deg, var(--front-red-deep), var(--front-red));
}

body[data-page="home"] .home-latest,
body[data-page="module"] .module-board {
  border: 0;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.68), rgba(247, 239, 226, 0.56));
  box-shadow: none;
}

body[data-page="module"] .module-board {
  margin-top: 18px;
}

body[data-page="home"] .list-item,
body[data-page="module"] .content-card {
  border: 0;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(247, 239, 226, 0.98));
  box-shadow: 0 10px 28px rgba(45, 25, 18, 0.08);
}

body[data-page="home"] .list-item {
  padding: 16px;
}

body[data-page="home"] .chip,
body[data-page="module"] .chip {
  border: 0;
}

body[data-page="home"] .chip,
body[data-page="module"] .chip {
  background: rgba(163, 0, 5, 0.08);
  color: var(--front-red-deep);
}

body[data-page="home"] .chip.teal,
body[data-page="module"] .chip.teal {
  background: rgba(61, 74, 71, 0.1);
  color: #2d514d;
}

body[data-page="home"] .chip.gold,
body[data-page="module"] .chip.gold {
  background: rgba(184, 95, 66, 0.12);
  color: #7b3d29;
}

body[data-page="home"] .chip.blue,
body[data-page="module"] .chip.blue {
  background: rgba(101, 108, 116, 0.12);
  color: #46515a;
}

body[data-page="home"] .chip.muted,
body[data-page="module"] .chip.muted {
  background: rgba(189, 183, 173, 0.22);
  color: var(--front-muted);
}

body[data-page="module"] .segmented {
  border: 0;
  background: rgba(189, 183, 173, 0.22);
}

body[data-page="module"] .segmented button.active {
  background: var(--front-paper-strong);
  color: var(--front-red-deep);
  box-shadow: 0 7px 18px rgba(45, 25, 18, 0.08);
}

body[data-page="module"] input,
body[data-page="module"] select {
  border-color: transparent;
  background: var(--front-paper-strong);
  box-shadow: 0 8px 20px rgba(45, 25, 18, 0.06);
}

body[data-page="module"] input:focus,
body[data-page="module"] select:focus {
  border-color: rgba(163, 0, 5, 0.42);
}

body[data-page="module"] .card-footer {
  border-top: 0;
  padding-top: 10px;
}

body[data-page="home"] .empty-state,
body[data-page="module"] .empty-state {
  border: 0;
  background: rgba(255, 253, 248, 0.76);
  box-shadow: inset 0 0 0 1px rgba(101, 1, 4, 0.05);
}

body[data-page="module"] .card-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body[data-page="module"] .content-card {
  min-height: 214px;
  border: 0;
}

body[data-page="module"] .content-card h3 {
  font-size: 1.1rem;
}

body[data-page="module"] .content-card::before {
  height: 4px;
  background: linear-gradient(90deg, var(--module-accent), var(--front-cinnabar));
}

@media (max-width: 1040px) {
  .front-hero,
  .module-page-hero,
  .admin-hero,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .card-grid,
  .module-entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-sidebar {
    position: static;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .admin-side-title {
    grid-column: 1 / -1;
  }

  .admin-metrics,
  .workflow-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-shell {
    width: min(100% - 22px, var(--front-shell-max));
  }

  .topbar,
  .section-heading,
  .content-tools,
  .control-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    min-height: 0;
    height: auto;
    justify-content: flex-start;
    gap: 4px;
    padding: 8px 0 4px;
  }

  .topbar,
  .section-heading,
  .content-tools {
    display: flex;
  }

  .brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .logo-plate {
    width: min(100%, 270px);
  }

  .topnav,
  .segmented {
    overflow-x: auto;
  }

  .front-hero,
  .module-page-hero,
  .admin-hero,
  .home-latest,
  .module-board,
  .admin-panel {
    padding: 16px;
  }

  .front-hero,
  .module-page-hero {
    min-height: 260px;
  }

  .front-hero::before,
  .module-page-hero::before,
  .admin-hero::before {
    top: 72px;
    height: 56px;
  }

  .cloud-motif-one,
  .cloud-motif-admin {
    right: -170px;
    width: 540px;
  }

  .hero-red-ribbon {
    display: none;
  }

  .front-hero h1 {
    font-size: 2.1rem;
  }

  .module-page-hero h1,
  .admin-hero h1,
  .login-card h1 {
    font-size: 2rem;
  }

  .module-entry-grid,
  .card-grid,
  .field-row,
  .admin-field-row,
  .admin-metrics,
  .workflow-grid,
  .admin-sidebar,
  .record-row,
  .admin-filter {
    grid-template-columns: 1fr;
  }

  .list-item {
    grid-template-columns: 1fr;
  }

  .date-badge {
    min-height: 42px;
  }

  .content-tools select {
    width: 100%;
  }

  .record-actions {
    justify-content: flex-start;
  }

  .login-cloud-band {
    right: -430px;
  }
}

@media (max-width: 760px) {
  body[data-page="home"] .front-hero,
  body[data-page="module"] .module-page-hero {
    padding-left: 16px;
    padding-right: 16px;
  }

  body[data-page="home"] .front-hero::before,
  body[data-page="module"] .module-page-hero::before {
    top: auto;
    bottom: 0;
    width: 62%;
    height: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .module-entry:hover {
    transform: none;
  }

  @view-transition {
    navigation: none;
  }

  .nsd-page-overlay,
  html.nsd-page-enter main,
  body[data-auth-required="true"][data-auth-state="ready"] main {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

@view-transition {
  navigation: auto;
}

::view-transition-group(root) {
  animation-duration: 280ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

::view-transition-old(root) {
  animation: 260ms cubic-bezier(0.22, 1, 0.36, 1) both nsd-vt-leave;
}

::view-transition-new(root) {
  animation: 300ms cubic-bezier(0.22, 1, 0.36, 1) both nsd-vt-enter;
}

::view-transition-old(site-chrome) {
  animation: 240ms cubic-bezier(0.22, 1, 0.36, 1) both nsd-vt-chrome-leave;
}

::view-transition-new(site-chrome) {
  animation: 280ms cubic-bezier(0.22, 1, 0.36, 1) both nsd-vt-chrome-enter;
}

@keyframes nsd-vt-leave {
  to { opacity: 0; }
}

@keyframes nsd-vt-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes nsd-vt-chrome-leave {
  to { opacity: 0.42; }
}

@keyframes nsd-vt-chrome-enter {
  from { opacity: 0.42; }
}

.topbar,
.reader-header {
  view-transition-name: site-chrome;
}

.nsd-page-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: #f2f3f1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

.nsd-page-overlay.is-open {
  opacity: 1;
}

html.nsd-page-enter main,
body[data-auth-required="true"][data-auth-state="ready"].nsd-page-ready main {
  animation: nsd-page-arrive 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes nsd-page-arrive {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
