:root {
  --yuhe-ink: #1f2a1c;
  --yuhe-muted: #3f4d3a;
  --yuhe-lime: #8bc34a;
  --yuhe-lime-deep: #689f38;
  --yuhe-pine: #1b5e20;
  --yuhe-mist: #f5f7f4;
  --yuhe-line: #b7c9a4;
  --yuhe-card: #ffffff;
  --yuhe-soft: #eef6e4;
  --yuhe-radius: 12px;
  --yuhe-shadow: 0 10px 30px rgba(85, 139, 47, 0.08);
}

html, body {
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(139, 195, 74, 0.18), transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(104, 159, 56, 0.12), transparent 50%),
    var(--yuhe-mist) !important;
  color: var(--yuhe-ink) !important;
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif !important;
}

#header {
  background: linear-gradient(120deg, #1b5e20 0%, #33691e 45%, #558b2f 100%) !important;
  border-bottom: none !important;
  box-shadow: 0 8px 24px rgba(27, 94, 32, 0.22);
  padding: 0.85rem 1.5rem !important;
}

#header a:link, #header a:visited, #branding h1, #branding h1 a:link, #branding h1 a:visited,
#site-name, #site-name a:link, #site-name a:visited, #logout-form button {
  color: #fff !important;
}

#branding h1 {
  font-family: "Noto Serif SC", "Songti SC", serif !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  font-size: 1.15rem !important;
}

#user-tools {
  font-size: 0.85rem;
}

div.breadcrumbs {
  background: transparent !important;
  color: var(--yuhe-muted) !important;
  padding: 0.85rem 1.5rem 0 !important;
  border: none !important;
}

div.breadcrumbs a {
  color: var(--yuhe-pine) !important;
}

#container {
  min-height: 100vh;
}

#content {
  padding: 1rem 1.5rem 2.5rem !important;
}

#content h1 {
  font-family: "Noto Serif SC", "Songti SC", serif !important;
  font-weight: 600 !important;
  letter-spacing: 0.03em;
  color: var(--yuhe-ink) !important;
  margin-bottom: 1rem !important;
}

.module, .dashboard .module, #changelist, .change-form .module,
#changelist-filter, .inline-group {
  background: var(--yuhe-card) !important;
  border: 1px solid var(--yuhe-line) !important;
  border-radius: var(--yuhe-radius) !important;
  box-shadow: var(--yuhe-shadow);
  overflow: hidden;
}

/* Change form: do not clip padded selects / related widgets */
.change-form .module,
.change-form .inline-group {
  overflow: visible;
}
.change-form .form-row {
  overflow: visible !important;
  padding: 0.7rem 1rem !important;
}
.change-form .flex-container {
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  min-height: 2rem;
}
.change-form select,
.change-form input[type="text"],
.change-form input[type="password"],
.change-form input[type="email"],
.change-form input[type="url"],
.change-form input[type="number"],
.change-form .vTextField {
  min-height: 2.1rem;
  line-height: 1.35 !important;
  box-sizing: border-box;
}
.change-form .readonly {
  display: block;
  max-width: 100%;
  padding: 0.35rem 0;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.change-form fieldset .form-row:last-child {
  border-bottom: none !important;
}

.module h2, .module caption, inline-group h2,
#changelist-filter h2, .aligned caption {
  background: var(--yuhe-soft) !important;
  color: var(--yuhe-pine) !important;
  border-bottom: 1px solid var(--yuhe-line) !important;
  font-family: "Noto Serif SC", "Songti SC", serif !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em;
  padding: 0.7rem 1rem !important;
}

/* App labels (e.g. 学习项目评估) — Django uses pale --header-color on current-app */
.module caption a,
.module caption a:link,
.module caption a:visited,
#nav-sidebar .module caption,
#nav-sidebar .module caption a,
#nav-sidebar .section:link,
#nav-sidebar .section:visited,
#nav-sidebar .current-app .section:link,
#nav-sidebar .current-app .section:visited {
  color: var(--yuhe-ink) !important;
  font-weight: 700;
}
#nav-sidebar .current-app .section:link,
#nav-sidebar .current-app .section:visited {
  color: var(--yuhe-pine) !important;
}

#changelist {
  padding: 0 !important;
  /* Filters above the table — never overlay / squeeze side columns */
  flex-direction: column !important;
  align-items: stretch !important;
  overflow: visible !important;
}

#changelist .changelist-form-container {
  width: 100%;
  min-width: 0;
}

#changelist .actions {
  background: var(--yuhe-soft) !important;
  border-bottom: 1px solid var(--yuhe-line) !important;
  padding: 0.65rem 1rem !important;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
}

.yuhe-actions-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--yuhe-pine);
  letter-spacing: 0.04em;
}

.yuhe-action-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.yuhe-action-btn {
  margin: 0 !important;
  box-shadow: none !important;
  background: #fff !important;
  color: var(--yuhe-ink) !important;
  border: 1.5px solid var(--yuhe-line) !important;
  border-radius: 999px !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  padding: 0.35rem 0.85rem !important;
  letter-spacing: 0.02em;
}

.yuhe-action-btn:hover {
  background: #fff !important;
  border-color: var(--yuhe-lime-deep) !important;
  color: var(--yuhe-pine) !important;
  transform: none;
  box-shadow: none !important;
}

.yuhe-action-btn.yuhe-action-danger {
  color: #c62828 !important;
  border-color: #ef9a9a !important;
  background: #fff5f5 !important;
}

.yuhe-action-btn.yuhe-action-danger:hover {
  background: #ffebee !important;
  border-color: #e57373 !important;
  color: #b71c1c !important;
}

#changelist .actions .action-counter,
#changelist .actions .all,
#changelist .actions .clear,
#changelist .actions .question {
  font-size: 0.78rem;
  color: var(--yuhe-muted);
}

#changelist .results {
  overflow-x: auto;
  width: 100%;
}

#changelist-filter {
  position: static !important;
  order: -1 !important;
  flex: none !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 0 0.85rem !important;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0;
  align-content: start;
}

#changelist-filter > h2 {
  grid-column: 1 / -1;
  margin: 0 !important;
}

#changelist-filter > details,
#changelist-filter > details + ul,
#changelist-filter > h3,
#changelist-filter > ul {
  margin: 0 !important;
  border-bottom: none !important;
  border-right: 1px solid var(--yuhe-line);
}

#changelist-filter > details,
#changelist-filter > h3 {
  padding-top: 0.35rem;
}

#changelist-filter ul {
  padding: 0.25rem 0.85rem 0.65rem !important;
  max-height: 9.5rem;
  overflow-y: auto;
}

/* 状态: show every pipeline state at once (no collapse / scroll clip) */
#changelist-filter details[data-filter-title="状态"] {
  grid-column: 1 / -1;
  border-right: none !important;
  border-bottom: 1px solid var(--yuhe-line);
}
#changelist-filter details[data-filter-title="状态"] ul {
  max-height: none !important;
  overflow: visible !important;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.15rem 0.85rem 0.75rem !important;
}
#changelist-filter details[data-filter-title="状态"] li {
  margin: 0;
  padding: 0 !important;
  border: none !important;
}
#changelist-filter details[data-filter-title="状态"] li.selected {
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}
#changelist-filter details[data-filter-title="状态"] li a {
  display: inline-block;
  padding: 0.28rem 0.7rem !important;
  border-radius: 999px;
  border: 1.5px solid var(--yuhe-line);
  background: #fff;
  color: var(--yuhe-muted) !important;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
#changelist-filter details[data-filter-title="状态"] li.selected a {
  background: var(--yuhe-soft) !important;
  border-color: var(--yuhe-pine);
  color: var(--yuhe-pine) !important;
  font-weight: 700;
}
#changelist-filter details[data-filter-title="状态"] li a:hover {
  background: var(--yuhe-soft) !important;
  color: var(--yuhe-ink) !important;
}

#changelist-filter h3 {
  color: var(--yuhe-ink) !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  text-transform: none !important;
  letter-spacing: 0.03em;
  padding: 0.65rem 1rem 0.25rem !important;
}

#changelist-filter details summary {
  padding: 0.55rem 0.85rem 0.25rem !important;
  color: var(--yuhe-ink) !important;
  font-weight: 700 !important;
  cursor: pointer;
}

#changelist-filter a {
  color: var(--yuhe-muted) !important;
}

#changelist-filter li.selected a {
  color: var(--yuhe-pine) !important;
  font-weight: 700;
}

/* Form / fieldset labels — keep strong contrast */
label, .form-row label, .aligned label,
.fieldset .form-row > div > label,
fieldset .form-row label {
  color: var(--yuhe-ink) !important;
  font-weight: 600 !important;
  opacity: 1 !important;
}

.help, .helptext, p.help, .form-row .help {
  color: var(--yuhe-muted) !important;
  opacity: 1 !important;
}

.quiet, .mini, .timezonewarning {
  color: var(--yuhe-muted) !important;
}

#result_list thead th,
#result_list thead th a,
#result_list thead th .text a {
  color: var(--yuhe-ink) !important;
  font-weight: 700 !important;
}

#changelist-filter a:focus, #changelist-filter a:hover,
#changelist-filter li.selected {
  background: var(--yuhe-soft) !important;
}

#result_list {
  border: none !important;
  width: 100%;
}

#result_list thead th {
  background: var(--yuhe-soft) !important;
  color: var(--yuhe-pine) !important;
  border-bottom: 1px solid var(--yuhe-line) !important;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

#result_list tbody tr:nth-child(even) {
  background: transparent !important;
}

#result_list td, #result_list th {
  border-bottom: 1px solid #e8efe0 !important;
  padding: 0.7rem 0.85rem !important;
  vertical-align: middle;
}

/* Pipeline row tint via status badge data-pipeline */
#result_list tbody tr > td:first-child {
  box-shadow: inset 3px 0 0 transparent;
}
#result_list tbody tr:has([data-pipeline="new"]) td {
  background: #eaf4ff !important;
}
#result_list tbody tr:has([data-pipeline="new"]) > td:first-child {
  box-shadow: inset 3px 0 0 #1e88e5;
}
#result_list tbody tr:has([data-pipeline="forwarded"]) td {
  background: #fff4e5 !important;
}
#result_list tbody tr:has([data-pipeline="forwarded"]) > td:first-child {
  box-shadow: inset 3px 0 0 #fb8c00;
}
#result_list tbody tr:has([data-pipeline="school_acked"]) td {
  background: #f6ecfb !important;
}
#result_list tbody tr:has([data-pipeline="school_acked"]) > td:first-child {
  box-shadow: inset 3px 0 0 #8e24aa;
}
#result_list tbody tr:has([data-pipeline="in_progress"]) td {
  background: #e6f8f9 !important;
}
#result_list tbody tr:has([data-pipeline="in_progress"]) > td:first-child {
  box-shadow: inset 3px 0 0 #00838f;
}
#result_list tbody tr:has([data-pipeline="enrolled"]) td {
  background: #eaf6ea !important;
}
#result_list tbody tr:has([data-pipeline="enrolled"]) > td:first-child {
  box-shadow: inset 3px 0 0 #43a047;
}
#result_list tbody tr:has([data-pipeline="closed"]) td {
  background: #f0ebe8 !important;
}
#result_list tbody tr:has([data-pipeline="closed"]) > td:first-child {
  box-shadow: inset 3px 0 0 #8d6e63;
}
#result_list tbody tr:has([data-pipeline="screen_only"]) td,
#result_list tbody tr:has([data-pipeline="not_qualified"]) td {
  background: #f3f3f3 !important;
}
#result_list tbody tr:has([data-pipeline="screen_only"]) > td:first-child,
#result_list tbody tr:has([data-pipeline="not_qualified"]) > td:first-child {
  box-shadow: inset 3px 0 0 #9e9e9e;
}
#result_list tbody tr:hover td {
  filter: brightness(0.97);
}

#toolbar {
  background: transparent !important;
  border: none !important;
  padding: 0 0 0.85rem !important;
}

#toolbar form input[type="submit"],
.button, input[type="submit"],
.submit-row input,
a.button {
  background: linear-gradient(135deg, var(--yuhe-lime) 0%, var(--yuhe-lime-deep) 100%) !important;
  border: none !important;
  border-radius: 999px !important;
  color: #fff !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 16px rgba(139, 195, 74, 0.28);
  padding: 0.45rem 1rem !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#toolbar form input[type="submit"]:hover,
.button:hover, input[type="submit"]:hover,
a.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(139, 195, 74, 0.36);
}

a.button.default, input[type="submit"].default, .submit-row input.default {
  background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%) !important;
}

.deletelink, a.deletelink {
  background: #e57373 !important;
  box-shadow: none !important;
}

input[type="text"], input[type="password"], input[type="email"],
input[type="url"], input[type="number"], input[type="search"],
textarea, select, .vTextField, .vLargeTextField {
  border: 1.5px solid var(--yuhe-line) !important;
  border-radius: 0.5rem !important;
  padding: 0.45rem 0.65rem !important;
  background: #fff !important;
  box-shadow: none !important;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--yuhe-lime) !important;
  outline: 3px solid rgba(139, 195, 74, 0.22) !important;
}

.submit-row {
  background: var(--yuhe-soft) !important;
  border: 1px solid var(--yuhe-line) !important;
  border-radius: var(--yuhe-radius) !important;
  padding: 0.85rem 1rem !important;
}

.object-tools {
  margin-bottom: 0.85rem !important;
}

.object-tools a {
  background: #fff !important;
  color: var(--yuhe-pine) !important;
  border: 1.5px solid var(--yuhe-line) !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  font-weight: 600;
}

.object-tools a:hover {
  border-color: var(--yuhe-lime) !important;
  background: var(--yuhe-soft) !important;
}

.messagelist li {
  border-radius: 0.65rem !important;
  border: none !important;
  box-shadow: var(--yuhe-shadow);
}

.messagelist li.success {
  background: #e8f5e9 !important;
  color: #1b5e20 !important;
}

/* Lead list pills */
.yuhe-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1.4;
}
.yuhe-pill-ok { background: #dcedc8; color: #1b5e20; }
.yuhe-pill-no { background: #e0e0e0; color: #37474f; }
.yuhe-pill-new { background: #bbdefb; color: #0d47a1; }
.yuhe-pill-fwd { background: #ffe0b2; color: #e65100; }
.yuhe-pill-acked { background: #e1bee7; color: #6a1b9a; }
.yuhe-pill-progress { background: #b2ebf2; color: #006064; }
.yuhe-pill-done { background: #e1bee7; color: #6a1b9a; } /* legacy */
.yuhe-pill-arch { background: #d7ccc8; color: #4e342e; }
.yuhe-ref {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--yuhe-pine);
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.yuhe-ref:hover { text-decoration: underline; }

#result_list td.field-name,
#result_list td.field-ref_code_link,
#result_list td.field-source {
  font-size: 0.75rem;
  white-space: nowrap;
}
#result_list td.field-name {
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yuhe-admin-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 1rem 1.15rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(241,248,233,0.9));
  border: 1px solid var(--yuhe-line);
  border-radius: var(--yuhe-radius);
  box-shadow: var(--yuhe-shadow);
}
.yuhe-admin-hero h1 {
  margin: 0 !important;
  font-size: 1.45rem !important;
}
.yuhe-admin-hero p {
  margin: 0.3rem 0 0;
  color: var(--yuhe-muted);
  font-size: 0.85rem;
}
.yuhe-admin-hero .links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.yuhe-admin-hero .links a {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1.5px solid var(--yuhe-line);
  background: #fff;
  color: var(--yuhe-pine);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
}
.yuhe-admin-hero .links a:hover {
  border-color: var(--yuhe-lime);
  background: var(--yuhe-soft);
}
.yuhe-admin-hero .links a.primary {
  background: linear-gradient(135deg, var(--yuhe-lime), var(--yuhe-lime-deep));
  border-color: transparent;
  color: #fff;
}

.yuhe-dest-hint {
  margin: 0.35rem 0 0 !important;
  font-size: 0.72rem !important;
  line-height: 1.45 !important;
  max-width: 28rem;
}
.yuhe-dest-hint strong {
  color: var(--yuhe-ink);
  font-weight: 700;
}
.yuhe-admin-hero .links.yuhe-dest-switch {
  align-items: stretch;
}
.yuhe-admin-hero .yuhe-dest-link {
  display: inline-flex !important;
  flex-direction: column;
  align-items: flex-start !important;
  gap: 0.15rem;
  max-width: 14rem;
  border-radius: 0.55rem !important;
  padding: 0.45rem 0.75rem !important;
  line-height: 1.25;
}
.yuhe-admin-hero .yuhe-dest-link span {
  font-size: 0.82rem;
  font-weight: 700;
}
.yuhe-admin-hero .yuhe-dest-link small {
  font-size: 0.6rem;
  font-weight: 500;
  opacity: 0.88;
  white-space: normal;
}
.yuhe-admin-hero .yuhe-dest-link.primary small {
  color: rgba(255, 255, 255, 0.9);
}
.yuhe-admin-hero .yuhe-dest-link.is-here {
  background: var(--yuhe-soft);
  border-color: var(--yuhe-pine);
  pointer-events: none;
}

.yuhe-quick-list .yuhe-dest-meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--yuhe-muted);
  line-height: 1.35;
}

.yuhe-forward-card {
  max-width: 40rem;
  background: #fff;
  border: 1px solid var(--yuhe-line);
  border-radius: var(--yuhe-radius);
  box-shadow: var(--yuhe-shadow);
  padding: 1.25rem;
}
.yuhe-forward-card textarea {
  width: 100%;
  min-height: 12rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

.yuhe-dashboard #content {
  max-width: 72rem;
  margin: 0 auto;
}
.yuhe-dashboard.dashboard #content-related {
  margin: 0 !important;
  float: none !important;
  width: auto !important;
}
.yuhe-dashboard.dashboard #content-main {
  float: none !important;
  width: auto !important;
}

.yuhe-dash-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1.15rem;
  padding: 1.35rem 1.4rem;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.98), rgba(241,248,233,0.92)),
    radial-gradient(500px 180px at 100% 0%, rgba(139,195,74,0.18), transparent 70%);
  border: 1px solid var(--yuhe-line);
  border-radius: calc(var(--yuhe-radius) + 2px);
  box-shadow: var(--yuhe-shadow);
}
.yuhe-dash-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--yuhe-lime-deep);
}
.yuhe-dash-hero h1 {
  margin: 0 !important;
  font-size: 1.65rem !important;
  color: var(--yuhe-ink) !important;
}
.yuhe-dash-hero-copy p:last-child {
  margin: 0.4rem 0 0;
  color: var(--yuhe-muted);
  font-size: 0.9rem;
  max-width: 28rem;
  line-height: 1.45;
}
.yuhe-dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.yuhe-dash-actions a {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1.5px solid var(--yuhe-line);
  background: #fff;
  color: var(--yuhe-pine);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
}
.yuhe-dash-actions a:hover {
  border-color: var(--yuhe-lime);
  background: var(--yuhe-soft);
}
.yuhe-dash-actions a.primary {
  background: linear-gradient(135deg, var(--yuhe-lime), var(--yuhe-lime-deep));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(139, 195, 74, 0.28);
}

.yuhe-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.15rem;
}
.yuhe-stat {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.95rem 1rem;
  background: #fff;
  border: 1px solid var(--yuhe-line);
  border-radius: var(--yuhe-radius);
  box-shadow: var(--yuhe-shadow);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.yuhe-stat:hover {
  transform: translateY(-2px);
  border-color: var(--yuhe-lime);
}
.yuhe-stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--yuhe-muted);
  letter-spacing: 0.04em;
}
.yuhe-stat-value {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--yuhe-pine);
  line-height: 1;
}
.yuhe-stat-new .yuhe-stat-value { color: #1565c0; }
.yuhe-stat-ok .yuhe-stat-value { color: #2e7d32; }
.yuhe-stat-arch .yuhe-stat-value { color: #6d4c41; }

.yuhe-dash-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(16rem, 1fr);
  gap: 1rem;
  align-items: start;
}
.yuhe-dash-main .module {
  margin-bottom: 1rem !important;
}
.yuhe-dash-main .module table {
  width: 100%;
  border-collapse: collapse;
}
.yuhe-dash-main .module th,
.yuhe-dash-main .module td {
  padding: 0.85rem 1rem !important;
  border-bottom: 1px solid #e8efe0 !important;
  vertical-align: middle;
  background: #fff !important;
  color: var(--yuhe-ink) !important;
}
.yuhe-dash-main .module tr:hover th,
.yuhe-dash-main .module tr:hover td {
  background: #f8fbf4 !important;
}
.yuhe-dash-main .module tr:last-child th,
.yuhe-dash-main .module tr:last-child td {
  border-bottom: none !important;
}
.yuhe-dash-main .module th a {
  color: var(--yuhe-ink) !important;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
}
.yuhe-dash-main .module th a:hover { color: var(--yuhe-pine) !important; }
.yuhe-dash-main .module td a {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1.5px solid var(--yuhe-line);
  background: #fff;
  color: var(--yuhe-pine) !important;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
}
.yuhe-dash-main .module td a:hover {
  border-color: var(--yuhe-lime);
  background: var(--yuhe-soft);
}
.yuhe-dash-main .module caption a {
  color: var(--yuhe-ink) !important;
  text-decoration: none;
  font-weight: 700;
}

.yuhe-quick-list {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
}
.yuhe-quick-list li {
  border-bottom: 1px solid #e8efe0;
}
.yuhe-quick-list li:last-child { border-bottom: none; }
.yuhe-quick-list a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--yuhe-ink) !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
}
.yuhe-quick-list a:hover {
  background: var(--yuhe-soft);
  color: var(--yuhe-pine) !important;
}

.yuhe-actionlist {
  margin: 0;
  padding: 0.25rem 0 0.5rem;
}
.yuhe-actionlist li {
  padding: 0.65rem 1rem !important;
  border-bottom: 1px solid #e8efe0;
}
.yuhe-actionlist li:last-child { border-bottom: none; }
.yuhe-empty {
  margin: 0;
  padding: 0.85rem 1rem 1rem;
  color: var(--yuhe-muted);
  font-size: 0.85rem;
}

/* Login */
body.login #container {
  max-width: none;
  margin: 0;
}
body.login #header {
  border-radius: 0;
}
body.login #content {
  padding: 2rem 1rem 3rem !important;
}
body.yuhe-login #content > h1 { display: none; }
.yuhe-login-shell {
  max-width: 26rem;
  margin: 1.5rem auto 0;
}
.yuhe-login-card {
  background: #fff;
  border: 1px solid var(--yuhe-line);
  border-radius: calc(var(--yuhe-radius) + 2px);
  box-shadow: var(--yuhe-shadow);
  padding: 1.5rem 1.45rem 1.25rem;
}
.yuhe-login-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--yuhe-lime-deep);
}
.yuhe-login-title {
  margin: 0 !important;
  font-family: "Noto Serif SC", "Songti SC", serif !important;
  font-size: 1.45rem !important;
  color: var(--yuhe-ink) !important;
}
.yuhe-login-sub {
  margin: 0.45rem 0 1rem;
  color: var(--yuhe-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}
.yuhe-login-back {
  margin: 1rem 0 0;
  text-align: center;
}
.yuhe-login-back a {
  font-size: 0.8rem;
  color: var(--yuhe-muted);
  text-decoration: none;
}
.yuhe-login-back a:hover {
  color: var(--yuhe-ink);
  text-decoration: underline;
}
body.login #login-form {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
body.login .form-row {
  padding: 0.55rem 0 !important;
  float: none !important;
}
body.login .form-row label {
  float: none !important;
  display: block;
  width: auto !important;
  padding: 0 0 0.35rem !important;
  color: var(--yuhe-ink) !important;
  font-weight: 700 !important;
}
body.login .form-row input {
  width: 100% !important;
  box-sizing: border-box;
}
body.login .submit-row {
  margin: 0.85rem 0 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  text-align: stretch;
  float: none !important;
}
body.login .submit-row input {
  width: 100%;
  border-radius: 0.65rem !important;
  padding: 0.7rem 1rem !important;
}

#footer {
  display: none;
}

@media (max-width: 900px) {
  .yuhe-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .yuhe-dash-layout { grid-template-columns: 1fr; }
}

/* Keep Django color tokens on the light palette — OS/dark toggle must not
   flip --body-quiet-color to #e0e0e0 while cards stay white. */
:root,
html[data-theme="dark"],
html[data-theme="auto"],
html[data-theme="light"] {
  color-scheme: light;
  --body-fg: var(--yuhe-ink);
  --body-bg: var(--yuhe-mist);
  --body-quiet-color: var(--yuhe-muted);
  --body-loud-color: var(--yuhe-ink);
  --darkened-bg: var(--yuhe-soft);
  --selected-bg: var(--yuhe-soft);
  --border-color: var(--yuhe-line);
  --hairline-color: var(--yuhe-line);
}

@media (prefers-color-scheme: dark) {
  :root,
  html[data-theme="auto"] {
    color-scheme: light;
    --body-fg: var(--yuhe-ink);
    --body-bg: var(--yuhe-mist);
    --body-quiet-color: var(--yuhe-muted);
    --body-loud-color: var(--yuhe-ink);
    --darkened-bg: var(--yuhe-soft);
    --selected-bg: var(--yuhe-soft);
    --border-color: var(--yuhe-line);
    --hairline-color: var(--yuhe-line);
  }
}

html[data-theme="dark"],
html[data-theme="auto"] {
  color-scheme: light;
}
html[data-theme="dark"] body,
html[data-theme="auto"] body,
html[data-theme="dark"] .module,
html[data-theme="auto"] .module,
html[data-theme="dark"] .dashboard .module,
html[data-theme="auto"] .dashboard .module,
html[data-theme="dark"] #changelist,
html[data-theme="auto"] #changelist,
html[data-theme="dark"] .yuhe-stat,
html[data-theme="auto"] .yuhe-stat,
html[data-theme="dark"] .yuhe-dash-hero,
html[data-theme="auto"] .yuhe-dash-hero,
html[data-theme="dark"] .yuhe-login-card,
html[data-theme="auto"] .yuhe-login-card {
  background: var(--yuhe-card) !important;
  color: var(--yuhe-ink) !important;
}
html[data-theme="dark"] .module caption,
html[data-theme="auto"] .module caption,
html[data-theme="dark"] .module h2,
html[data-theme="auto"] .module h2 {
  background: var(--yuhe-soft) !important;
  color: var(--yuhe-pine) !important;
}
html[data-theme="dark"] .yuhe-dash-main .module th,
html[data-theme="auto"] .yuhe-dash-main .module th,
html[data-theme="dark"] .yuhe-dash-main .module td,
html[data-theme="auto"] .yuhe-dash-main .module td,
html[data-theme="dark"] #result_list tbody tr,
html[data-theme="auto"] #result_list tbody tr {
  background: #fff !important;
  color: var(--yuhe-ink) !important;
}

/* Admin UI is forced light above — never use light text on white cards,
   even when OS prefers dark / Django theme is auto|dark. */
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] label,
  html[data-theme="auto"] .form-row label,
  html[data-theme="auto"] .aligned label,
  html[data-theme="auto"] fieldset .form-row label,
  html[data-theme="dark"] label,
  html[data-theme="dark"] .form-row label,
  html[data-theme="dark"] .aligned label,
  html[data-theme="dark"] fieldset .form-row label,
  html[data-theme="dark"] #changelist-filter h3,
  html[data-theme="auto"] #changelist-filter h3,
  html[data-theme="dark"] #result_list thead th,
  html[data-theme="auto"] #result_list thead th,
  html[data-theme="dark"] #content h1,
  html[data-theme="auto"] #content h1 {
    color: var(--yuhe-ink) !important;
  }
  html[data-theme="dark"] .help,
  html[data-theme="dark"] .helptext,
  html[data-theme="auto"] .help,
  html[data-theme="auto"] .helptext {
    color: var(--yuhe-muted) !important;
  }
}
