:root {
  color-scheme: light;
  --bg: #f7f8fc;
  --bg-soft: #eef2ff;
  --panel: #ffffff;
  --panel-muted: #fbfbff;
  --text: #171923;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --accent: #4f46e5;
  --accent-strong: #3730a3;
  --accent-soft: #eef2ff;
  --chart-primary: #6f7dfb;
  --chart-secondary: #a5b4fc;
  --chart-fill: rgba(111, 125, 251, 0.14);
  --chart-grid: #edf0f7;
  --warning: #f59e0b;
  --warning-soft: #fff7df;
  --danger: #ef4444;
  --danger-soft: #ffe4e0;
  --success: #10a37f;
  --success-soft: #e3f8f1;
  --shadow: 0 18px 40px rgba(23, 25, 35, 0.07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #ffffff 0%, var(--bg) 46%, #f0f2fb 100%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

button, input {
  font: inherit;
}

textarea {
  font: inherit;
}

button, .actions a {
  min-height: 44px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 650;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
  touch-action: manipulation;
}

button:hover, .actions a:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

button:focus-visible,
.actions a:focus-visible,
.module-card:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(111, 125, 251, 0.28);
  outline-offset: 2px;
}

button.secondary, .actions a.secondary {
  background: #e8eef6;
  color: var(--text);
  border-color: var(--line);
}

button.secondary:hover, .actions a.secondary:hover {
  background: #dde7f2;
}

button:disabled {
  cursor: progress;
  opacity: 0.72;
  transform: none;
}

.shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

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

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

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-lockup img,
.auth-logo {
  width: 58px;
  height: auto;
  aspect-ratio: 1;
  flex: 0 0 auto;
  display: block;
}

.auth-logo {
  width: 76px;
  margin-bottom: 16px;
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 760;
}

.brand-block p,
.hero-panel p,
.section-heading p {
  max-width: 62ch;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.15;
  font-weight: 760;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 20px;
  align-items: end;
  margin-bottom: 28px;
  padding: 28px 0;
  border-block: 1px solid var(--line);
}

.hero-panel h2,
.section-heading h2 {
  margin: 0;
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1.12;
}

.hero-panel p,
.section-heading p {
  margin: 10px 0 0;
  color: var(--muted);
}

.hero-summary {
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-summary span,
.module-label,
.metric-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.hero-summary strong {
  display: block;
  margin: 12px 0 4px;
  font-size: 28px;
  line-height: 1.1;
}

.hero-summary small,
.module-card small,
.metric-card small {
  color: var(--muted);
}

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

.section-heading h2 {
  font-size: 22px;
}

.module-grid, .metrics-grid {
  display: grid;
  gap: 14px;
}

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

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

.user-hero .hero-summary {
  border-color: rgba(16, 163, 127, 0.24);
  background: linear-gradient(180deg, #ffffff 0%, #f6fffb 100%);
}

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

.module-card, .metric-card, .auth-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.module-card {
  min-height: 178px;
  display: grid;
  gap: 10px;
  align-content: start;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.module-card-primary {
  border-color: rgba(111, 125, 251, 0.28);
  background: linear-gradient(180deg, #ffffff 0%, #f5f6ff 100%);
}

.module-card[href]:hover {
  border-color: rgba(111, 125, 251, 0.45);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.module-card strong {
  font-size: 34px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.module-card-muted {
  background: var(--panel-muted);
}

.metric-card {
  min-height: 148px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.metric-card-primary {
  border-top: 3px solid var(--chart-primary);
}

.metric-card strong {
  display: block;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.wide {
  grid-column: span 2;
}

.metric-bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #e9eef6;
}

.metric-bar div {
  height: 100%;
  width: 0;
  background: var(--chart-primary);
  transition: width 180ms ease;
}

.is-normal .metric-bar div {
  background: var(--success);
}

.is-warning {
  border-color: rgba(183, 121, 31, 0.45);
}

.is-warning .metric-bar div {
  background: var(--warning);
}

.is-danger {
  border-color: rgba(180, 35, 24, 0.45);
}

.is-danger .metric-bar div {
  background: var(--danger);
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

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

.chart-card {
  min-height: 286px;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.chart-card.compact {
  min-height: 246px;
}

.chart-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.chart-head strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.chart-head small {
  color: var(--subtle);
  font-size: 13px;
  white-space: nowrap;
}

.trend-chart {
  width: 100%;
  height: 180px;
  display: block;
  overflow: visible;
}

.compact-chart {
  height: 160px;
}

.chart-grid-line {
  stroke: var(--chart-grid);
  stroke-width: 1;
}

.chart-axis-label {
  fill: var(--subtle);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.chart-area {
  fill: var(--chart-fill);
}

.chart-line-primary {
  fill: none;
  stroke: var(--chart-primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-secondary {
  fill: none;
  stroke: var(--chart-secondary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-bar {
  fill: var(--chart-primary);
  opacity: 0.78;
}

.chart-bar-secondary {
  fill: var(--chart-secondary);
  opacity: 0.72;
}

.status-strip > div {
  min-height: 82px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.status-strip span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.status-strip strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.25;
}

.preview-list,
.detail-list {
  display: grid;
  gap: 10px;
  margin: 4px 0 0;
}

.preview-list div,
.detail-list div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

dt {
  color: var(--muted);
  font-size: 13px;
}

dd {
  margin: 0;
  min-width: 0;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.auth-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 0;
}

.auth-shell {
  width: min(440px, calc(100% - 28px));
}

.auth-panel {
  box-shadow: var(--shadow);
}

.auth-panel h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
}

.auth-panel p {
  color: var(--muted);
  margin: 10px 0 22px;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--muted);
  font-size: 14px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 46px;
  padding: 11px 12px;
  color: var(--text);
  background: #fff;
}

input[type="file"] {
  padding: 9px 12px;
}

input:focus {
  border-color: var(--accent);
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 92px;
  padding: 11px 12px;
  color: var(--text);
  background: #fff;
  resize: vertical;
}

textarea:focus {
  border-color: var(--accent);
}

.error {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(180, 35, 24, 0.24);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}

.text-link {
  color: var(--accent-strong);
  font-weight: 700;
  text-align: center;
}

.text-link:focus-visible {
  outline: 3px solid rgba(111, 125, 251, 0.28);
  outline-offset: 3px;
  border-radius: 6px;
}

.form-message {
  min-height: 22px;
  color: var(--muted);
  font-size: 14px;
}

.form-message.error {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(180, 35, 24, 0.24);
  border-radius: 8px;
  padding: 10px 12px;
}

.form-message.success {
  color: #08735f;
  background: var(--success-soft);
  border: 1px solid rgba(16, 163, 127, 0.24);
  border-radius: 8px;
  padding: 10px 12px;
}

.admin-shell .topbar {
  align-items: flex-start;
}

.admin-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
  padding: 20px 0;
  border-block: 1px solid var(--line);
}

.admin-settings h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.admin-settings p {
  margin: 8px 0 0;
  color: var(--muted);
}

.settings-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px auto;
  gap: 12px;
  align-items: end;
}

.toggle-row {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.toggle-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

.user-list {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, auto) minmax(220px, auto);
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.user-main {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.user-main strong {
  overflow-wrap: anywhere;
}

.user-main span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.chip-group,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f5f7fb;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.status-active {
  color: #08735f;
  background: var(--success-soft);
  border-color: rgba(16, 163, 127, 0.24);
}

.status-pending {
  color: #9a5b00;
  background: var(--warning-soft);
  border-color: rgba(245, 158, 11, 0.28);
}

.status-disabled,
.status-rejected {
  color: #b42318;
  background: var(--danger-soft);
  border-color: rgba(180, 35, 24, 0.24);
}

.role-chip {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: rgba(111, 125, 251, 0.24);
}

.row-actions button {
  min-height: 38px;
  padding: 8px 12px;
}

.compact-button {
  min-height: 38px;
  padding: 8px 12px;
}

.avatar-frame {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #eef4fb 100%);
  color: var(--accent-strong);
  font-weight: 780;
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.avatar-frame-large {
  width: 96px;
  height: 96px;
  font-size: 34px;
}

.user-avatar {
  margin-right: 10px;
}

.is-hidden {
  display: none !important;
}

.password-reset-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.password-reset-panel[hidden] {
  display: none;
}

.profile-shell .topbar {
  align-items: flex-start;
}

.profile-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
  padding: 24px 0;
  border-block: 1px solid var(--line);
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.profile-identity h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.profile-identity p,
.profile-panel p {
  margin: 8px 0 0;
  color: var(--muted);
}

.profile-meta {
  display: grid;
  gap: 10px;
  margin: 0;
}

.profile-meta div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.profile-meta div:last-child {
  border-bottom: 0;
}

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

.profile-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.profile-panel h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.warm-home {
  --warm-surface: #fffdf8;
  --warm-surface-strong: #fff7ea;
  --warm-mint: #e7f6f1;
  --warm-rose: #ffecef;
  --warm-ink: #241f21;
  color: var(--warm-ink);
}

.warm-topbar {
  align-items: flex-start;
}

.warm-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
  padding: 26px 0;
  border-block: 1px solid var(--line);
}

.warm-hero h2 {
  margin: 0;
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.08;
}

.warm-hero p {
  max-width: 64ch;
  margin: 10px 0 0;
  color: var(--muted);
}

.people-strip {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, var(--warm-surface-strong) 100%);
}

.person-pill {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 720;
}

.warm-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 14px;
  align-items: start;
  grid-auto-flow: dense;
}

.warm-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--warm-surface);
}

.note-section {
  grid-row: span 2;
  background: linear-gradient(180deg, #ffffff 0%, #fffaf2 100%);
}

.idiom-section {
  background: linear-gradient(180deg, #ffffff 0%, #fffaf6 100%);
}

.idiom-filter {
  margin: 0;
}

.warm-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.warm-section h2 {
  margin: 0;
  font-size: 23px;
  line-height: 1.2;
}

.quick-form,
.inline-form,
.stacked-form {
  display: grid;
  gap: 12px;
}

.inline-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

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

.compact-toggle {
  min-height: 44px;
  width: max-content;
  max-width: 100%;
}

.pinned-note,
.next-date {
  min-height: 92px;
}

.pinned-copy,
.next-date > div {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 16px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 8px;
  background: var(--warm-surface-strong);
}

.next-date > div {
  border-color: rgba(16, 163, 127, 0.22);
  background: var(--warm-mint);
}

.pinned-copy span,
.next-date span {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 760;
}

.pinned-copy strong,
.next-date strong {
  font-size: 20px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.pinned-copy small,
.next-date small {
  color: var(--muted);
}

.soft-list {
  display: grid;
  gap: 10px;
}

.soft-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: border-color 160ms ease;
}

.soft-item:hover {
  border-color: var(--line-strong);
}

.soft-item-stacked {
  align-items: start;
}

.soft-item-stacked > div {
  display: grid;
  gap: 4px;
}

.soft-muted {
  color: var(--muted);
}

.soft-item strong,
.soft-link {
  display: block;
  color: var(--text);
  font-weight: 760;
  overflow-wrap: anywhere;
}

.soft-link {
  color: var(--accent-strong);
}

.soft-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

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

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--success);
}

.check-row span {
  color: var(--text);
  font-size: 16px;
  font-weight: 720;
  overflow-wrap: anywhere;
}

.soft-item.is-done {
  background: #f7fbf9;
}

.soft-item.is-done .check-row span {
  color: var(--muted);
  text-decoration: line-through;
}

.warm-empty {
  background: #fff;
}

.danger-button {
  background: var(--danger);
}

.danger-button:hover {
  background: #b42318;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel-muted);
}

@media (max-width: 900px) {
  .hero-panel,
  .module-grid,
  .user-module-grid,
  .status-strip,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .admin-settings,
  .settings-form,
  .user-row,
  .profile-hero,
  .profile-grid,
  .password-reset-panel,
  .warm-hero,
  .warm-grid,
  .inline-form,
  .two-field-row {
    grid-template-columns: 1fr;
  }

  .chip-group,
  .row-actions {
    justify-content: flex-start;
  }

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

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

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

  .note-section,
  .idiom-section {
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  .shell { width: min(100% - 20px, 1120px); padding-top: 18px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .brand-lockup { align-items: flex-start; }
  .brand-lockup img { width: 52px; }
  .actions { width: 100%; }
  .actions a, .actions button { flex: 1; text-align: center; }
  .metrics-grid { grid-template-columns: 1fr; }
  .wide { grid-column: span 1; }
  .topbar h1 { font-size: 24px; }
  .hero-panel { padding: 22px 0; }
  .hero-summary { min-height: 120px; }
  .preview-list div,
  .detail-list div {
    grid-template-columns: 76px minmax(0, 1fr);
  }
  .chart-card { min-height: 242px; padding: 14px; }
  .chart-head { flex-direction: column; gap: 6px; }
  .trend-chart, .compact-chart { height: 150px; }
  .warm-section { padding: 14px; }
  .warm-hero h2 { font-size: 30px; }
  .inline-form button,
  .stacked-form button,
  .quick-form button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ============================================================
   「粉梦」首页主题 — 全部作用域限定在 .warm-home，不影响其他页面
   ============================================================ */

body:has(.warm-home) {
  background:
    radial-gradient(1100px 620px at 12% -8%, #ffe3f1 0%, rgba(255, 227, 241, 0) 60%),
    radial-gradient(960px 560px at 105% 6%, #e7ddff 0%, rgba(231, 221, 255, 0) 58%),
    radial-gradient(880px 700px at 50% 116%, #ffe9d6 0%, rgba(255, 233, 214, 0) 62%),
    linear-gradient(180deg, #fff6fb 0%, #fbf2ff 52%, #f4f0ff 100%);
  background-attachment: fixed;
}

.warm-home {
  --warm-surface: rgba(255, 255, 255, 0.72);
  --warm-surface-strong: rgba(255, 247, 252, 0.92);
  --warm-mint: #e6f7f0;
  --warm-rose: #ffe7f1;
  --warm-ink: #3a2740;
  --dream-pink: #ff8fc4;
  --dream-violet: #a98bff;
  --dream-peach: #ffb38a;
  --dream-accent: #d9529e;
  --dream-accent-strong: #b23a82;
  --dream-line: rgba(201, 142, 196, 0.26);
  --dream-line-strong: rgba(201, 142, 196, 0.46);
  --dream-glow: 0 22px 50px rgba(196, 110, 173, 0.18);
  --dream-glow-soft: 0 12px 30px rgba(169, 139, 255, 0.16);
  color: var(--warm-ink);
}

/* ---- 标题区 ---- */
.warm-home .eyebrow {
  color: var(--dream-accent);
  letter-spacing: 0.04em;
  text-transform: none;
}

.warm-home .topbar h1 {
  background: linear-gradient(96deg, var(--dream-accent) 0%, var(--dream-violet) 55%, var(--dream-peach) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 820;
}

.warm-home .brand-lockup img {
  filter: drop-shadow(0 8px 16px rgba(217, 82, 158, 0.28));
}

/* ---- Hero ---- */
.warm-home .warm-hero {
  position: relative;
  border: 1px solid var(--dream-line);
  border-radius: 28px;
  padding: 30px 30px 28px;
  background:
    radial-gradient(420px 200px at 88% -20%, rgba(169, 139, 255, 0.18), rgba(169, 139, 255, 0)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 240, 248, 0.82) 100%);
  box-shadow: var(--dream-glow);
  overflow: hidden;
}

.warm-home .warm-hero::before {
  content: "";
  position: absolute;
  inset: auto -40px -60px auto;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 143, 196, 0.35), rgba(255, 143, 196, 0));
  pointer-events: none;
}

.warm-home .warm-hero h2 {
  background: linear-gradient(100deg, var(--dream-accent-strong), var(--dream-violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 820;
}

.warm-home .warm-hero p {
  color: #7a5f76;
}

/* ---- 成员条 ---- */
.warm-home .people-strip {
  border: 1px solid var(--dream-line);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95) 0%, var(--warm-rose) 100%);
  box-shadow: var(--dream-glow-soft);
}

.warm-home .person-pill {
  color: var(--warm-ink);
}

.warm-home .avatar-frame {
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(150deg, var(--dream-pink) 0%, var(--dream-violet) 100%);
  color: #fff;
  box-shadow: 0 6px 16px rgba(217, 82, 158, 0.28);
}

/* ---- 模块卡片 ---- */
.warm-home .warm-section {
  position: relative;
  border: 1px solid var(--dream-line);
  border-radius: 24px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86) 0%, rgba(255, 250, 253, 0.78) 100%);
  box-shadow: var(--dream-glow-soft);
  backdrop-filter: blur(6px);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.warm-home .warm-section:hover {
  transform: translateY(-3px);
  box-shadow: var(--dream-glow);
}

/* 每个模块顶部一条柔和的渐变腰带 */
.warm-home .warm-section::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  border-radius: 24px 24px 0 0;
  background: linear-gradient(90deg, var(--dream-pink), var(--dream-violet));
  opacity: 0.85;
}

.warm-home .note-section {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 236, 245, 0.7) 100%);
}
.warm-home .note-section::before { background: linear-gradient(90deg, #ff9ec9, #ff7eb0); }

.warm-home .idiom-section {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(240, 236, 255, 0.72) 100%);
}
.warm-home .idiom-section::before { background: linear-gradient(90deg, #b79bff, #8e7bff); }

.warm-home .warm-section h2 {
  color: var(--warm-ink);
  font-weight: 800;
}

.warm-home .warm-section-head .eyebrow {
  color: var(--dream-violet);
}

.warm-home label span {
  color: #8a6f86;
  font-weight: 600;
}

/* ---- 输入框 ---- */
.warm-home input,
.warm-home textarea {
  border: 1px solid var(--dream-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.warm-home input:focus,
.warm-home textarea:focus {
  border-color: var(--dream-pink);
  box-shadow: 0 0 0 4px rgba(255, 143, 196, 0.18);
  outline: none;
}

/* ---- 按钮 ---- */
.warm-home button[type="submit"],
.warm-home .actions a:not(.secondary) {
  border: none;
  border-radius: 14px;
  background: linear-gradient(120deg, var(--dream-pink) 0%, var(--dream-violet) 100%);
  color: #fff;
  font-weight: 720;
  box-shadow: 0 10px 22px rgba(217, 82, 158, 0.26);
}

.warm-home button[type="submit"]:hover,
.warm-home .actions a:not(.secondary):hover {
  background: linear-gradient(120deg, #ff7eb8 0%, #9a82ff 100%);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(217, 82, 158, 0.32);
}

.warm-home button.secondary,
.warm-home .actions a.secondary {
  border: 1px solid var(--dream-line-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--dream-accent-strong);
  font-weight: 700;
}

.warm-home button.secondary:hover,
.warm-home .actions a.secondary:hover {
  background: rgba(255, 240, 248, 0.95);
  transform: translateY(-2px);
}

.warm-home .compact-button {
  box-shadow: none;
}

.warm-home button:focus-visible,
.warm-home .actions a:focus-visible,
.warm-home input:focus-visible {
  outline: 3px solid rgba(169, 139, 255, 0.4);
  outline-offset: 2px;
}

/* ---- 列表项 ---- */
.warm-home .soft-list {
  gap: 12px;
}

.warm-home .soft-item {
  border: 1px solid var(--dream-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.warm-home .soft-item:hover {
  transform: translateY(-2px);
  border-color: var(--dream-line-strong);
  box-shadow: 0 10px 22px rgba(196, 110, 173, 0.14);
}

.warm-home .soft-item strong { color: var(--warm-ink); }
.warm-home .soft-link { color: var(--dream-accent); }
.warm-home .soft-item small { color: #9a7f96; }
.warm-home .soft-muted { color: #b08bd8; }

.warm-home .check-row input { accent-color: var(--dream-accent); }
.warm-home .check-row span { color: var(--warm-ink); }
.warm-home .soft-item.is-done {
  background: rgba(243, 247, 255, 0.7);
}

/* ---- 置顶留言 / 下一个纪念日 ---- */
.warm-home .pinned-copy {
  border: 1px solid rgba(255, 143, 196, 0.4);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.92) 0%, var(--warm-rose) 100%);
}

.warm-home .next-date > div {
  border: 1px solid rgba(142, 123, 255, 0.32);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.92) 0%, #efeaff 100%);
}

.warm-home .pinned-copy span { color: var(--dream-accent); }
.warm-home .next-date span { color: var(--dream-violet); }
.warm-home .pinned-copy strong,
.warm-home .next-date strong { color: var(--warm-ink); }

/* ---- 空状态 ---- */
.warm-home .empty-state,
.warm-home .warm-empty {
  border: 1px dashed var(--dream-line-strong);
  border-radius: 16px;
  background: rgba(255, 252, 254, 0.7);
  color: #a584b8;
  text-align: center;
}

/* ---- 删除按钮在粉梦下保持柔和的危险色 ---- */
.warm-home .danger-button {
  background: linear-gradient(120deg, #ff7a98, #ff5d7a);
}

/* ---- 标签页导航 ---- */
.warm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  padding: 6px;
  border: 1px solid var(--dream-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--dream-glow-soft);
  backdrop-filter: blur(6px);
}

.warm-tab {
  flex: 1 1 auto;
  min-height: 46px;
  min-width: max-content;
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
  color: #8a6f86;
  font-weight: 720;
  box-shadow: none;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.warm-tab:hover {
  background: rgba(255, 240, 248, 0.8);
  color: var(--dream-accent-strong);
  transform: none;
}

.warm-tab.is-active {
  background: linear-gradient(120deg, var(--dream-pink) 0%, var(--dream-violet) 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(217, 82, 158, 0.26);
}

.warm-tab:focus-visible {
  outline: 3px solid rgba(169, 139, 255, 0.4);
  outline-offset: 2px;
}

/* ---- 面板：一次只显示一个模块 ---- */
.warm-panels {
  display: block;
}

.warm-panels [data-panel] {
  display: none;
}

.warm-panels [data-panel].is-active {
  display: grid;
  animation: warm-panel-in 220ms ease;
}

/* 面板模式下留言不再跨两行 */
.warm-home .warm-panels .note-section {
  grid-row: auto;
}

@keyframes warm-panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
