:root {
  --page: #eaf0df;
  --paper: #fffdf7;
  --paper-soft: #f6f5ea;
  --paper-warm: #eef0dd;
  --ink: #1d241e;
  --ink-soft: #5c655a;
  --line: rgba(42, 58, 39, 0.16);
  --line-strong: rgba(42, 58, 39, 0.28);
  --pku-red: #8f1d2c;
  --pku-red-dark: #671522;
  --field: #3f7045;
  --field-dark: #284d31;
  --shoot: #789257;
  --lake: #2f6370;
  --gold: #9b7a34;
  --danger: #9a392c;
  --success: #2f6a43;
  --shadow: 0 14px 32px rgba(28, 46, 27, 0.11);
  --shadow-soft: 0 8px 20px rgba(28, 46, 27, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(63, 112, 69, 0.07) 0 1px, transparent 1px 64px),
    linear-gradient(180deg, rgba(120, 146, 87, 0.08) 0 1px, transparent 1px 48px),
    linear-gradient(135deg, rgba(47, 99, 112, 0.08), transparent 36%),
    linear-gradient(180deg, var(--page), #f7f6ec 52%, #e4ead7);
  color: var(--ink);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.theme-winter {
  --page: #fff4cf;
  --paper: #fffdf6;
  --paper-soft: #fff8e6;
  --paper-warm: #ffe39b;
  --ink: #312114;
  --ink-soft: #7b6049;
  --line: rgba(222, 151, 34, 0.18);
  --line-strong: rgba(222, 151, 34, 0.32);
  --pku-red: #b94f20;
  --pku-red-dark: #873819;
  --field: #efa51f;
  --field-dark: #a96112;
  --shoot: #ffc861;
  --lake: #8c7a45;
  --gold: #f7b837;
  --shadow: 0 14px 32px rgba(157, 92, 14, 0.1);
  --shadow-soft: 0 8px 20px rgba(157, 92, 14, 0.075);
  background:
    linear-gradient(90deg, rgba(239, 165, 31, 0.07) 0 1px, transparent 1px 64px),
    linear-gradient(180deg, rgba(255, 200, 97, 0.08) 0 1px, transparent 1px 48px),
    linear-gradient(135deg, rgba(255, 225, 128, 0.58), transparent 42%),
    linear-gradient(180deg, #fff8df, #fffdf6 48%, #f9df9c);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.18) 0,
      rgba(255, 255, 255, 0.18) 1px,
      transparent 1px,
      transparent 7px
    );
  opacity: 0.34;
}

body.theme-winter::before {
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.26) 0,
      rgba(255, 255, 255, 0.26) 1px,
      transparent 1px,
      transparent 8px
    );
  opacity: 0.42;
}

a {
  color: var(--lake);
  text-decoration: none;
}

a:hover {
  color: var(--field-dark);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 253, 247, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.site-header::after {
  display: block;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, var(--field-dark), var(--shoot), var(--lake), var(--pku-red));
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 15px 0 14px;
}

.brand,
nav a {
  color: var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.brand::before {
  display: inline-grid;
  width: 38px;
  height: 28px;
  place-items: center;
  content: "耕读";
  background: var(--field-dark);
  border: 1px solid rgba(143, 29, 44, 0.34);
  color: #fff9ef;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  line-height: 1;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

nav a {
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

nav a:hover {
  background: rgba(63, 112, 69, 0.1);
  color: var(--field-dark);
}

.main-shell {
  padding: 34px 0 58px;
}

.site-footer {
  padding: 22px 0 28px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.9rem;
  text-align: center;
}

.site-footer a {
  color: var(--ink-soft);
}

.site-footer a:hover {
  color: var(--field-dark);
}

.hero-card,
.form-card,
.table-card,
.stat-card {
  background: rgba(255, 253, 247, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.hero-card {
  position: relative;
  padding: 34px 36px;
  margin-bottom: 24px;
  overflow: hidden;
  border-left: 6px solid var(--field);
  background:
    linear-gradient(90deg, rgba(63, 112, 69, 0.12), transparent 36%),
    linear-gradient(135deg, rgba(120, 146, 87, 0.1), transparent 48%),
    rgba(255, 253, 247, 0.94);
}

.hero-card::after {
  position: absolute;
  right: 28px;
  bottom: 22px;
  z-index: 0;
  width: 172px;
  height: 56px;
  content: "";
  border-top: 1px solid rgba(63, 112, 69, 0.24);
  border-bottom: 1px solid rgba(120, 146, 87, 0.22);
  transform: skewX(-18deg);
  opacity: 0.55;
}

.hero-card > * {
  position: relative;
  z-index: 1;
}

.hero-card.compact {
  padding: 28px 32px;
}

.home-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 286px;
}

.hero-copy {
  flex: 1 1 620px;
  min-width: 0;
}

.hero-visual {
  flex: 0 0 min(280px, 32%);
  min-width: 210px;
  opacity: 0.96;
}

.hero-visual svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 16px 18px rgba(40, 77, 49, 0.1));
}

.hero-visual img {
  display: block;
  width: 100%;
  max-height: 330px;
  object-fit: contain;
  border-radius: 8px;
}

body.theme-winter .hero-card {
  border-left-color: var(--field);
  background:
    linear-gradient(90deg, rgba(255, 223, 124, 0.5), transparent 40%),
    linear-gradient(135deg, rgba(239, 165, 31, 0.16), transparent 52%),
    rgba(255, 253, 246, 0.97);
}

body.theme-winter .form-card,
body.theme-winter .table-card,
body.theme-winter .stat-card {
  background: rgba(255, 253, 246, 0.95);
}

body.theme-winter .site-header {
  background: rgba(255, 253, 246, 0.93);
}

.field-line,
.book-page,
.leaf-stem,
.leaf,
.sun-mark {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.field-line {
  stroke: var(--shoot);
  stroke-width: 8;
}

.field-line.fine {
  stroke: rgba(63, 112, 69, 0.42);
  stroke-width: 4;
}

.book-page {
  fill: rgba(255, 253, 247, 0.76);
  stroke: var(--field-dark);
  stroke-width: 4;
}

.book-page.right {
  fill: rgba(246, 245, 234, 0.82);
}

.leaf-stem {
  stroke: var(--field-dark);
  stroke-width: 5;
}

.leaf {
  fill: rgba(120, 146, 87, 0.42);
  stroke: var(--field);
  stroke-width: 4;
}

.leaf.right {
  fill: rgba(63, 112, 69, 0.26);
}

.sun-mark {
  stroke: var(--pku-red);
  stroke-width: 4;
  opacity: 0.72;
}

.window-frame,
.desk-line,
.hearth,
.flame,
.tea-cup,
.ember-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.window-frame {
  stroke: rgba(93, 48, 43, 0.52);
  stroke-width: 4;
}

.window-frame.fine {
  stroke: rgba(82, 108, 103, 0.32);
  stroke-width: 3;
}

.desk-line {
  stroke: rgba(93, 48, 43, 0.42);
  stroke-width: 5;
}

.hearth {
  fill: rgba(155, 81, 56, 0.16);
  stroke: var(--field-dark);
  stroke-width: 4;
}

.flame.outer {
  fill: rgba(196, 102, 52, 0.28);
  stroke: var(--pku-red);
  stroke-width: 4;
}

.flame.inner {
  fill: rgba(255, 217, 129, 0.56);
  stroke: var(--gold);
  stroke-width: 3;
}

.tea-cup {
  stroke: var(--lake);
  stroke-width: 4;
}

.tea-cup.fine {
  stroke: rgba(82, 108, 103, 0.52);
  stroke-width: 3;
}

.ember-line {
  stroke: rgba(181, 122, 53, 0.52);
  stroke-width: 5;
}

body.theme-winter .hero-visual svg {
  filter: drop-shadow(0 16px 18px rgba(93, 48, 43, 0.12));
}

body.theme-winter .hero-visual img {
  filter: drop-shadow(0 18px 18px rgba(169, 97, 18, 0.14));
}

body.theme-winter .hero-notes span::before {
  border-radius: 10px 10px 3px 10px;
  background: linear-gradient(135deg, #ffd66f, var(--field));
  transform: rotate(-18deg);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--field-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-weight: 700;
}

h1 {
  max-width: 860px;
  font-size: 2.55rem;
  line-height: 1.18;
}

h2 {
  font-size: 1.42rem;
  line-height: 1.35;
}

h3 {
  font-size: 1.08rem;
  line-height: 1.4;
}

.lead {
  max-width: 820px;
  margin: 16px 0 0;
  color: var(--ink-soft);
  line-height: 1.8;
}

.hero-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-notes span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(63, 112, 69, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.48);
  color: var(--field-dark);
  font-family: "Noto Serif SC", "Songti SC", serif;
}

.hero-notes span::before {
  width: 10px;
  height: 14px;
  content: "";
  border-radius: 10px 10px 10px 2px;
  background: linear-gradient(135deg, var(--shoot), var(--field));
  transform: rotate(35deg);
}

.form-card,
.table-card {
  padding: 28px;
}

.form-card.narrow {
  max-width: 500px;
}

.form-hint {
  margin: 0 0 22px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.required-mark {
  color: var(--pku-red);
  font-weight: 800;
}

.spaced-card {
  margin-top: 18px;
}

.grid {
  display: grid;
  gap: 18px;
}

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

label {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  color: #34362f;
  font-size: 0.96rem;
  line-height: 1.5;
}

.field-title {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--ink);
  font-weight: 700;
}

.field-title::before {
  content: "";
  flex: 0 0 auto;
  width: 0.65em;
  color: transparent;
  font-weight: 800;
  text-align: center;
}

.field-title.is-required::before {
  content: "*";
  color: var(--pku-red);
}

.field-title > span:first-child {
  min-width: 0;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  font: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--pku-red);
}

input[type="file"] {
  padding: 10px;
  background: rgba(255, 255, 255, 0.58);
}

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

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(63, 112, 69, 0.58);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(63, 112, 69, 0.14);
}

.primary-button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--field), var(--field-dark));
  color: #fffaf0;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.primary-button:hover,
button:hover {
  filter: brightness(1.03);
  box-shadow: 0 8px 18px rgba(40, 77, 49, 0.18);
  transform: translateY(-1px);
}

.primary-button:active,
button:active {
  transform: translateY(0);
}

.flash-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.flash {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.9);
}

.flash-error {
  border-color: rgba(154, 57, 44, 0.24);
  background: rgba(154, 57, 44, 0.09);
  color: var(--danger);
}

.flash-success {
  border-color: rgba(47, 106, 67, 0.22);
  background: rgba(47, 106, 67, 0.1);
  color: var(--success);
}

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

.section-head.align-start {
  align-items: flex-start;
}

.section-description,
.help-text,
.warning-text {
  color: var(--ink-soft);
  line-height: 1.65;
}

.section-description {
  margin: 10px 0 0;
}

.warning-text {
  color: var(--danger);
}

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

.stat-card {
  padding: 18px 18px 16px;
  border-top: 4px solid var(--field);
  background:
    linear-gradient(180deg, rgba(63, 112, 69, 0.07), transparent 68%),
    rgba(255, 253, 247, 0.93);
}

.stat-card:nth-child(2n) {
  border-top-color: var(--shoot);
}

.stat-card:nth-child(3n) {
  border-top-color: var(--lake);
}

.stat-label {
  display: block;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.stat-value {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 2rem;
  line-height: 1;
}

.inline-form {
  display: grid;
  gap: 16px;
}

.filters-form,
.batch-toolbar,
.admit-form,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.filters-form label,
.batch-toolbar label,
.admit-form label {
  flex: 1 1 180px;
  margin-bottom: 0;
}

.action-row {
  justify-content: flex-end;
}

.link-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.link-button {
  border: 1px solid rgba(63, 112, 69, 0.2);
  background: rgba(63, 112, 69, 0.09);
  color: var(--field-dark);
}

.secondary-button {
  border: 1px solid rgba(63, 112, 69, 0.26);
  background: rgba(255, 255, 255, 0.66);
  color: var(--field-dark);
}

.danger-button {
  border: 1px solid rgba(154, 57, 44, 0.25);
  background: rgba(154, 57, 44, 0.1);
  color: var(--danger);
}

.link-button:hover,
.secondary-button:hover {
  background: rgba(63, 112, 69, 0.14);
  color: var(--field-dark);
}

.danger-button:hover {
  background: rgba(154, 57, 44, 0.16);
}

.table-action-form {
  display: inline-flex;
  margin: 4px 6px 4px 0;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid rgba(63, 112, 69, 0.16);
  border-radius: 6px;
  background: rgba(63, 112, 69, 0.09);
  color: var(--field-dark);
}

.chip.emphasis {
  border-color: rgba(143, 29, 44, 0.18);
  background: rgba(143, 29, 44, 0.08);
  color: var(--pku-red-dark);
}

.split-grid,
.detail-grid {
  display: grid;
  gap: 22px;
  margin-top: 24px;
}

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

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

.wide-card {
  grid-column: 1 / -1;
}

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

.table-wrap th,
.table-wrap td {
  vertical-align: middle;
}

.muted-row {
  color: var(--ink-soft);
  background: rgba(238, 232, 220, 0.34);
}

.muted-row a {
  color: inherit;
}

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

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(63, 112, 69, 0.18);
  border-radius: 6px;
  background: rgba(63, 112, 69, 0.1);
  color: var(--field-dark);
  white-space: nowrap;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.compact-meta {
  grid-template-columns: 1fr;
  margin: 0 0 18px;
}

.meta-grid div {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.54);
}

.meta-grid strong {
  overflow-wrap: anywhere;
}

.meta-label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.photo-block {
  margin-top: 24px;
}

.photo-block img {
  width: min(240px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.preview-card,
.answer-block,
.spaced-card {
  margin-top: 18px;
}

.preview-card,
.answer-block {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.answer-block {
  border-left: 4px solid rgba(63, 112, 69, 0.5);
}

.settings-group {
  margin: 8px 0 22px;
  padding: 18px;
  border: 1px solid rgba(63, 112, 69, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(63, 112, 69, 0.08), transparent 42%),
    rgba(255, 255, 255, 0.36);
}

.settings-group.compact {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
}

.settings-group.compact h2 {
  margin: 0 0 2px;
}

.rich-text {
  margin: 12px 0 0;
  color: var(--ink);
  font: inherit;
  line-height: 1.76;
  white-space: pre-wrap;
  word-break: break-word;
}

.editor-field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field-label {
  color: #34362f;
  font-size: 0.96rem;
  line-height: 1.5;
}

.rich-editor {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(63, 112, 69, 0.08), transparent 48%),
    rgba(255, 255, 255, 0.5);
}

.rich-toolbar .secondary-button,
.rich-toolbar .icon-button {
  width: auto;
  min-width: 38px;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 6px;
}

.rich-toolbar .icon-button {
  aspect-ratio: 1;
  padding: 0;
}

.color-tool {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  margin: 0;
  padding: 6px 9px;
  border: 1px solid rgba(63, 112, 69, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--field-dark);
  font-size: 0.9rem;
}

.color-picker-trigger {
  width: 32px;
  min-width: 32px;
  height: 30px;
  min-height: 30px;
  padding: 3px;
  border: 1px solid rgba(42, 58, 39, 0.28);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.color-mode-select {
  width: 68px;
  min-width: 68px;
  min-height: 32px;
  padding: 6px 7px;
  border-radius: 6px;
  font-size: 0.84rem;
}

.color-value-input {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 6px 8px;
  border-radius: 6px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.88rem;
}

.color-input-row {
  margin-top: 8px;
}

.color-triplet {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.color-value-input[hidden],
.color-triplet[hidden] {
  display: none;
}

.color-triplet label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.color-channel-input {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 6px 4px;
  border-radius: 6px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.84rem;
  text-align: center;
}

.color-value-input.invalid,
.color-channel-input.invalid {
  border-color: rgba(154, 57, 44, 0.7);
  box-shadow: 0 0 0 3px rgba(154, 57, 44, 0.12);
}

.color-preview {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(42, 58, 39, 0.28);
  border-radius: 50%;
  background: var(--preview-color, #fff);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.62);
}

.color-preview.large {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.color-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 25;
  width: 306px;
  max-width: calc(100vw - 32px);
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.98);
  box-shadow: var(--shadow);
}

.color-panel-head,
.color-panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.color-panel-head {
  margin-bottom: 10px;
}

.color-panel-close {
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 6px;
}

.color-field {
  position: relative;
  height: 132px;
  border: 1px solid rgba(42, 58, 39, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(0deg, #000, transparent),
    linear-gradient(90deg, #fff, var(--hue-color, #00ff00));
  cursor: crosshair;
  touch-action: none;
}

.color-field-cursor {
  position: absolute;
  left: 100%;
  top: 0;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.38);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hue-slider {
  --hue-track: linear-gradient(90deg, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%);
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  min-height: 12px;
  margin: 10px 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--hue-track);
  accent-color: auto;
  cursor: pointer;
}

.hue-slider::-webkit-slider-runnable-track {
  height: 12px;
  border-radius: 999px;
  background: var(--hue-track);
  box-shadow: inset 0 0 0 1px rgba(42, 58, 39, 0.2);
}

.hue-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -2px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--field-dark);
  box-shadow: 0 0 0 1px rgba(42, 58, 39, 0.38);
}

.hue-slider::-moz-range-track {
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: var(--hue-track);
  box-shadow: inset 0 0 0 1px rgba(42, 58, 39, 0.2);
}

.hue-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--field-dark);
  box-shadow: 0 0 0 1px rgba(42, 58, 39, 0.38);
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.preset-swatch {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  border: 1px solid rgba(42, 58, 39, 0.22);
  border-radius: 50%;
  background: var(--swatch-color, #fff);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.62);
}

.rich-editor-surface {
  min-height: 230px;
  padding: 14px 15px;
  outline: none;
  color: var(--ink);
  line-height: 1.76;
  word-break: break-word;
}

.rich-editor-surface:focus {
  background: #fff;
  box-shadow: inset 0 0 0 3px rgba(63, 112, 69, 0.12);
}

.rich-editor-source {
  display: none;
}

.rich-image-input {
  display: none;
}

.rich-editor-surface img,
.mail-preview-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 10px 0 14px;
  border-radius: 6px;
}

.attachment-field {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
}

.email-attachment-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.email-attachment-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.58);
}

.checkbox-row.compact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  margin: 0;
  font-size: 0.9rem;
}

.checkbox-row.compact input {
  width: auto;
  min-height: 0;
  padding: 0;
}

.mail-preview-body {
  margin: 12px 0 0;
  color: var(--ink);
  line-height: 1.76;
  word-break: break-word;
}

.mail-preview-body p,
.mail-preview-body div,
.rich-editor-surface p,
.rich-editor-surface div {
  margin: 0 0 12px;
}

.mail-preview-body ul,
.mail-preview-body ol,
.rich-editor-surface ul,
.rich-editor-surface ol {
  margin: 10px 0 10px 22px;
  padding: 0;
}

.simple-list {
  margin: 14px 0 0;
  padding-left: 20px;
}

.simple-list li {
  margin-bottom: 10px;
  line-height: 1.65;
}

.empty-state {
  margin: 14px 0 0;
  color: var(--ink-soft);
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

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

thead th {
  background: rgba(243, 234, 217, 0.66);
  color: #55584f;
  font-size: 0.92rem;
  font-weight: 700;
}

.sort-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.sort-link:hover,
.sort-link.active {
  color: var(--field-dark);
}

.sort-indicator {
  min-width: 1em;
  color: var(--accent);
  font-size: 0.82rem;
  line-height: 1;
}

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

tbody tr:hover {
  background: rgba(143, 29, 44, 0.035);
}

@media (max-width: 900px) {
  .stats-grid,
  .split-grid,
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 24px, 1120px);
  }

  .site-header .shell,
  .section-head,
  .table-tools {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    justify-content: flex-start;
  }

  .main-shell {
    padding-top: 24px;
  }

  .two-columns,
  .stats-grid,
  .split-grid,
  .detail-grid,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .form-card,
  .table-card {
    padding: 20px;
  }

  .hero-card::after {
    display: none;
  }

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

  .hero-visual {
    width: min(250px, 100%);
    min-width: 0;
    align-self: center;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.28rem;
  }

  .field-title {
    gap: 6px;
  }

  .filters-form,
  .batch-toolbar,
  .admit-form,
  .action-row {
    align-items: stretch;
  }

  .filters-form label,
  .batch-toolbar label,
  .admit-form label,
  .primary-button,
  button,
  .link-button,
  .secondary-button,
  .danger-button {
    width: 100%;
  }

  .rich-toolbar .secondary-button,
  .rich-toolbar .icon-button {
    width: auto;
  }
}
