:root {
  --bg: #f6efe4;
  --bg-deep: #efe2cc;
  --paper: rgba(255, 251, 244, 0.86);
  --paper-strong: rgba(255, 248, 238, 0.96);
  --line: rgba(110, 62, 41, 0.18);
  --line-strong: rgba(110, 62, 41, 0.3);
  --ink: #34231b;
  --muted: #6d5a4f;
  --accent: #9c2f24;
  --accent-soft: rgba(156, 47, 36, 0.12);
  --accent-bright: #c55429;
  --gold: #b88842;
  --green: #2c6f58;
  --green-soft: rgba(44, 111, 88, 0.12);
  --red-soft: rgba(156, 47, 36, 0.12);
  --shadow: 0 20px 60px rgba(91, 57, 30, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: auto;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(184, 136, 66, 0.16), transparent 26%),
    radial-gradient(circle at 85% 10%, rgba(156, 47, 36, 0.16), transparent 20%),
    linear-gradient(180deg, #f3e7d6 0%, #f7f2ea 28%, #f4e8d6 100%);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.home-scroll-lock {
  min-height: 100vh;
  overflow: auto;
}

.paper-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.06)),
    radial-gradient(rgba(131, 79, 48, 0.035) 0.8px, transparent 0.8px);
  background-size: 100% 100%, 14px 14px;
  mix-blend-mode: multiply;
  opacity: 0.8;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(280px, 1.2fr) minmax(0, 3.5fr);
  gap: 24px;
  padding: 24px clamp(18px, 3.8vw, 42px) 40px;
}

.app-sidebar,
.workspace {
  min-width: 0;
}

.app-sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
  padding: 18px;
  max-height: calc(100vh - 36px);
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sidebar-subtitle {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.7;
}

.sidebar-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.sidebar-selected,
.sidebar-note {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: rgba(255, 252, 246, 0.78);
  border: 1px solid var(--line);
}

.sidebar-selected h2 {
  font-size: 24px;
}

.sidebar-selected p + p {
  margin-top: 8px;
}

.sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.sidebar-note p {
  color: var(--muted);
  line-height: 1.8;
}

.view-nav {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.view-nav-button {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: rgba(255, 252, 246, 0.74);
  text-align: left;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.view-nav-button strong,
.view-nav-button span {
  display: block;
}

.view-nav-button strong {
  font-size: 16px;
  font-weight: 600;
}

.view-nav-button span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.view-nav-button.is-active {
  border-color: rgba(156, 47, 36, 0.24);
  background: linear-gradient(135deg, rgba(156, 47, 36, 0.1), rgba(184, 136, 66, 0.12));
  box-shadow: 0 14px 28px rgba(118, 71, 35, 0.1);
}

.workspace {
  display: grid;
  gap: 24px;
}

.workspace-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 24px;
  min-height: 92px;
}

.workspace-description {
  margin-top: 0;
  color: var(--muted);
  line-height: 1.8;
}

.workspace-description:empty {
  display: none;
}

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

.context-chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.82);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.view-panel {
  display: none;
}

.view-panel.is-active {
  display: block;
}

[data-view-panel="home"].is-active {
  display: grid;
  gap: 14px;
}

.home-shortcuts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.home-hero-card {
  min-height: 100%;
}

.home-dashboard {
  align-items: start;
}

.home-main-column {
  display: grid;
  gap: 12px;
  min-width: 0;
  align-content: start;
  position: sticky;
  top: 24px;
}

.home-side-column {
  display: block;
  align-self: start;
  min-width: 0;
}

.home-side-viewport {
  position: sticky;
  top: 24px;
  height: var(--home-side-height, auto);
  overflow: hidden;
}

.home-side-track {
  display: grid;
  gap: 14px;
  transform: translateY(calc(-1 * var(--home-side-offset, 0px)));
  will-change: transform;
}

.home-side-spacer {
  height: var(--home-side-spacer, 0px);
}

.home-shortcuts-card {
  padding: 18px;
}

.shortcut-card {
  padding: 14px 0 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.shortcut-card h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.shortcut-card p:last-child {
  color: var(--muted);
  line-height: 1.75;
}

.shortcut-card:hover {
  transform: translateX(2px);
  opacity: 0.88;
}

.topbar,
.shell {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px clamp(18px, 4vw, 48px) 10px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 16px;
}

.seal {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(135deg, #7f1813, #b9412a);
  color: #fff6ef;
  font-size: 28px;
  font-family: "STKaiti", "KaiTi", serif;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
}

h1,
h2,
h3 {
  font-family: "STSong", "Songti SC", "Noto Serif SC", serif;
}

p {
  margin: 0;
}

.eyebrow {
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}

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

.date-jump {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.72);
  backdrop-filter: blur(8px);
  color: var(--muted);
}

.date-jump input {
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.ghost-button,
.nav-button,
.day-cell {
  border: 0;
  cursor: pointer;
}

.ghost-button,
.nav-button {
  transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.ghost-button {
  padding: 12px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(52, 35, 27, 0.9), rgba(88, 56, 44, 0.92));
  color: #fff8f2;
}

.ghost-button:hover,
.nav-button:hover {
  transform: translateY(-1px);
}

.shell {
  padding: 8px clamp(18px, 4vw, 48px) 48px;
}

.card,
.hero-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 22px 24px;
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: auto auto -120px -40px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 136, 66, 0.18), transparent 68%);
}

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

.hero-main,
.hero-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-main {
  display: block;
}

.hero-main > .eyebrow {
  margin-bottom: 10px;
}

.hero-date-line {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.hero-date-line > div:last-child {
  min-width: 0;
}

.hero-day {
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
  border-radius: 36px;
  background:
    linear-gradient(135deg, rgba(156, 47, 36, 0.12), rgba(184, 136, 66, 0.18)),
    rgba(255, 252, 246, 0.8);
  border: 1px solid rgba(156, 47, 36, 0.16);
  font-family: "STSong", "Songti SC", serif;
  font-size: 72px;
  line-height: 1;
}

.hero-date-line h2 {
  font-size: clamp(28px, 4.2vw, 42px);
  line-height: 1.14;
}

.hero-date-line p {
  margin-top: 8px;
  color: var(--muted);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-self: start;
  padding-left: 140px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 248, 238, 0.86);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.tag.strong {
  color: var(--accent);
  border-color: rgba(156, 47, 36, 0.2);
  background: rgba(156, 47, 36, 0.08);
}

.hero-summary {
  align-items: stretch;
  justify-content: flex-start;
  padding-left: 140px;
  max-width: 680px;
}

.summary-chip {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--green-soft);
  border: 1px solid rgba(44, 111, 88, 0.18);
}

.summary-chip span {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--green);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.summary-chip.danger {
  background: var(--red-soft);
  border-color: rgba(156, 47, 36, 0.16);
}

.summary-chip.danger span {
  color: var(--accent);
}

.hero-advice {
  color: var(--muted);
  line-height: 1.75;
}

.dashboard {
  margin-top: 0;
  display: grid;
  grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.calendar-panel,
.month-overview,
.mini-metrics,
.detail-hero,
.info-card {
  padding: 22px;
}

.calendar-panel {
  min-width: 0;
  padding: 16px 16px 14px;
  background: rgba(255, 251, 245, 0.94);
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.nav-button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(156, 47, 36, 0.12), rgba(184, 136, 66, 0.18));
  color: var(--accent);
  font-size: 24px;
}

.calendar-title {
  text-align: center;
}

.calendar-title h2 {
  font-size: 22px;
  letter-spacing: 0.02em;
  color: #3a271f;
}

.week-header,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.week-header {
  margin-bottom: 2px;
  color: #7a6458;
  font-size: 13px;
  font-weight: 600;
}

.week-header div {
  padding: 8px 6px 4px;
  text-align: center;
}

.week-header div:nth-child(6),
.week-header div:nth-child(7) {
  color: var(--accent);
}

.calendar-grid {
  min-height: auto;
  grid-auto-rows: minmax(62px, auto);
}

.day-cell {
  min-height: 62px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.96);
  border: 1px solid rgba(110, 62, 41, 0.08);
  text-align: left;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.day-cell:hover {
  transform: translateY(-2px);
  border-color: rgba(156, 47, 36, 0.24);
  box-shadow: 0 10px 24px rgba(118, 71, 35, 0.12);
}

.day-cell.is-outside {
  opacity: 0.68;
  background: rgba(246, 239, 228, 0.65);
}

.day-cell.is-outside .solar-day,
.day-cell.is-outside .lunar-day {
  opacity: 0.78;
}

.day-cell.is-today {
  background: linear-gradient(180deg, rgba(156, 47, 36, 0.12), rgba(255, 248, 240, 1));
  border-color: rgba(156, 47, 36, 0.18);
}

.day-cell.is-selected {
  border-color: rgba(156, 47, 36, 0.52);
  box-shadow: inset 0 0 0 1px rgba(156, 47, 36, 0.28), 0 12px 28px rgba(118, 71, 35, 0.14);
}

.day-cell.is-weekend .solar-day {
  color: var(--accent);
}

.solar-day {
  font-size: 19px;
  font-weight: 600;
  color: #3a271f;
  font-family: "STSong", "Songti SC", serif;
}

.lunar-day {
  margin-top: 1px;
  font-size: 11px;
  color: #6a564b;
  line-height: 1.35;
  font-weight: 500;
}

.lunar-day.is-lunar {
  color: #6a564b;
}

.lunar-day.is-festival {
  color: #a16b19;
  font-weight: 700;
}

.lunar-day.is-term {
  color: #236b59;
  font-weight: 700;
}

.day-cell.is-selected .lunar-day.is-festival {
  color: #8c5b11;
}

.day-cell.is-selected .lunar-day.is-term {
  color: #1f5f50;
}

.day-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.mini-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  color: #b14d29;
  background: rgba(177, 77, 41, 0.08);
  border: 1px solid rgba(177, 77, 41, 0.1);
}

.mini-tag.term {
  color: #236b59;
  background: rgba(44, 111, 88, 0.14);
  border-color: rgba(44, 111, 88, 0.14);
}

.mini-tag.festival {
  color: #a16b19;
  background: rgba(184, 136, 66, 0.18);
  border-color: rgba(184, 136, 66, 0.16);
}

.side-column {
  display: grid;
  gap: 14px;
}

.today-strip {
  padding: 12px 16px 10px;
}

.today-strip-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.today-strip-body {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 1fr);
  gap: 10px;
  align-items: start;
  margin-top: 4px;
}

.today-strip-meta {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.today-strip-day {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(156, 47, 36, 0.08), rgba(184, 136, 66, 0.16)),
    rgba(255, 252, 246, 0.82);
  border: 1px solid rgba(156, 47, 36, 0.14);
  font-family: "STSong", "Songti SC", serif;
  font-size: 30px;
  line-height: 1;
}

.today-strip-copy strong {
  display: block;
  font-size: 22px;
  font-family: "STSong", "Songti SC", serif;
  line-height: 1.15;
  white-space: nowrap;
}

.today-strip-copy p {
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.4;
  white-space: nowrap;
}

.today-strip-items {
  display: grid;
  grid-column: 2 / 3;
  grid-row: 1 / span 2;
  grid-template-columns: 1fr;
  gap: 6px;
  min-width: 0;
}

.today-strip-line {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.82);
}

.today-strip-line span {
  font-size: 14px;
  font-weight: 600;
}

.today-strip-line strong {
  display: block;
  line-height: 1.45;
  font-size: 15px;
  white-space: nowrap;
}

.today-strip-line.good {
  color: var(--green);
  background: rgba(44, 111, 88, 0.08);
  border-color: rgba(44, 111, 88, 0.14);
}

.today-strip-line.bad {
  color: var(--accent);
  background: rgba(156, 47, 36, 0.08);
  border-color: rgba(156, 47, 36, 0.14);
}

.today-strip-advice {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
  padding-left: 0;
}

.query-shell {
  margin-top: 0;
  padding: 22px;
}

.query-head,
.query-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.query-toggle {
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border-radius: 999px;
  background: rgba(109, 90, 79, 0.12);
}

.query-toggle-button {
  min-width: 68px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.query-toggle-button.is-active {
  background: linear-gradient(135deg, #ff9e5e, #ff7a42);
  color: #fff9f3;
}

.query-summary {
  margin-top: 16px;
  color: var(--muted);
  line-height: 1.8;
}

.query-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.query-action-button {
  min-height: 72px;
  padding: 16px 14px;
  border: 1px solid rgba(191, 138, 84, 0.18);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(245, 234, 221, 0.92), rgba(248, 240, 231, 0.88));
  color: #df6b31;
  font-size: 18px;
  font-family: "STSong", "Songti SC", serif;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.query-action-button:hover {
  transform: translateY(-1px);
  border-color: rgba(223, 107, 49, 0.28);
}

.query-action-button.is-active {
  background: linear-gradient(135deg, rgba(255, 159, 94, 0.9), rgba(255, 122, 66, 0.92));
  color: #fff9f3;
  box-shadow: 0 14px 28px rgba(223, 107, 49, 0.18);
}

.query-result-head {
  margin-top: 24px;
}

.query-result-count {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(184, 136, 66, 0.12);
  border: 1px solid rgba(184, 136, 66, 0.18);
  color: #8a6228;
  font-size: 12px;
}

.query-result-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.query-result-card,
.query-empty {
  display: block;
  width: 100%;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.82);
  text-align: left;
}

.query-result-card {
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.query-result-card:hover {
  transform: translateY(-1px);
  border-color: rgba(223, 107, 49, 0.26);
  box-shadow: 0 12px 24px rgba(118, 71, 35, 0.1);
}

.query-result-main {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.query-result-main strong {
  display: block;
  font-size: 18px;
}

.query-result-main span,
.query-result-subtitle {
  color: var(--muted);
  font-size: 13px;
}

.query-result-subtitle {
  margin-top: 8px;
}

.query-match-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.query-match-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(44, 111, 88, 0.08);
  color: var(--green);
  border: 1px solid rgba(44, 111, 88, 0.12);
  font-size: 12px;
}

.query-match-tag.bad {
  color: var(--accent);
  background: rgba(156, 47, 36, 0.08);
  border-color: rgba(156, 47, 36, 0.12);
}

.query-empty p {
  margin-top: 0;
  color: var(--muted);
  line-height: 1.8;
}

.section-head {
  margin-bottom: 14px;
}

.month-highlights,
.fact-list {
  display: grid;
  gap: 12px;
}

.highlight-item,
.fact-item {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 252, 246, 0.76);
  border: 1px solid var(--line);
}

.highlight-item strong,
.fact-item strong {
  display: block;
  font-weight: 600;
}

.highlight-item span,
.fact-item span {
  color: var(--muted);
  font-size: 13px;
}

.detail-shell {
  margin-top: 0;
}

.detail-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.detail-subtitle,
#detailSubtitle {
  margin-top: 8px;
  color: var(--muted);
}

.festival-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.detail-ring-group {
  display: flex;
  gap: 16px;
}

.status-ring {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  background: rgba(255, 252, 246, 0.8);
  border: 1px solid var(--line);
}

.status-ring.good {
  box-shadow: inset 0 0 0 12px rgba(44, 111, 88, 0.08);
}

.status-ring.bad {
  box-shadow: inset 0 0 0 12px rgba(156, 47, 36, 0.08);
}

.status-ring span {
  color: var(--muted);
  font-size: 13px;
}

.status-ring strong {
  margin-top: 6px;
  font-size: 28px;
  font-family: "STSong", "Songti SC", serif;
}

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

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

.fortune-card {
  padding-top: 24px;
}

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

.fortune-highlight {
  padding: 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.92), rgba(249, 241, 231, 0.82));
  border: 1px solid var(--line);
}

.fortune-highlight span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.fortune-highlight strong {
  display: block;
  line-height: 1.7;
  font-size: 16px;
}

.fortune-highlight.emphasis {
  border-color: rgba(156, 47, 36, 0.16);
  background: linear-gradient(180deg, rgba(156, 47, 36, 0.08), rgba(255, 249, 244, 0.9));
}

.fortune-highlight.direction {
  border-color: rgba(44, 111, 88, 0.14);
  background: linear-gradient(180deg, rgba(44, 111, 88, 0.08), rgba(255, 251, 246, 0.9));
}

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

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

.info-item {
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 252, 246, 0.76);
  border: 1px solid var(--line);
}

.info-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.info-item strong {
  display: block;
  line-height: 1.6;
}

.double-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.good-text {
  color: var(--green);
}

.bad-text {
  color: var(--accent);
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.78);
  border: 1px solid var(--line);
}

.pill.good {
  color: var(--green);
  background: rgba(44, 111, 88, 0.08);
  border-color: rgba(44, 111, 88, 0.14);
}

.pill.bad {
  color: var(--accent);
  background: rgba(156, 47, 36, 0.08);
  border-color: rgba(156, 47, 36, 0.16);
}

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

.hour-card {
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 252, 246, 0.78);
  border: 1px solid var(--line);
}

.hour-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hour-card strong {
  font-size: 16px;
}

.hour-card .hour-time {
  color: var(--muted);
  font-size: 12px;
}

.hour-card .hour-status {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.hour-card.good .hour-status {
  color: var(--green);
  background: rgba(44, 111, 88, 0.12);
}

.hour-card.neutral .hour-status {
  color: #8a6b1f;
  background: rgba(184, 136, 66, 0.16);
}

.hour-card.bad .hour-status {
  color: var(--accent);
  background: rgba(156, 47, 36, 0.12);
}

.hour-card p {
  margin-top: 10px;
  line-height: 1.7;
  color: var(--muted);
  font-size: 13px;
}

.notes {
  display: grid;
  gap: 12px;
  color: var(--muted);
  line-height: 1.8;
}

.history-shell {
  padding: 22px;
}

.mobile-dock {
  display: none;
}

.mobile-dock-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 12px 10px;
  font: inherit;
  cursor: pointer;
}

.mobile-dock-button.is-active {
  color: var(--accent);
  font-weight: 600;
}

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

.history-summary {
  color: var(--muted);
  line-height: 1.8;
}

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

.source-tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(184, 136, 66, 0.12);
  border: 1px solid rgba(184, 136, 66, 0.18);
  color: #8a6228;
  font-size: 12px;
}

.source-tag.online {
  color: var(--green);
  background: rgba(44, 111, 88, 0.1);
  border-color: rgba(44, 111, 88, 0.16);
}

.source-tag.fallback {
  color: var(--accent);
  background: rgba(156, 47, 36, 0.08);
  border-color: rgba(156, 47, 36, 0.14);
}

.text-button {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.82);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.text-button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.text-button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-item,
.history-empty,
.history-skeleton {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 252, 246, 0.76);
  border: 1px solid var(--line);
}

.history-year {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 8px 10px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(156, 47, 36, 0.1), rgba(184, 136, 66, 0.12));
  color: var(--accent);
  font-family: "STSong", "Songti SC", serif;
  font-size: 24px;
}

.history-body {
  min-width: 0;
}

.history-body p {
  line-height: 1.8;
  color: var(--ink);
}

.history-link-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.history-title-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(184, 136, 66, 0.1);
  color: #8a6228;
  font-size: 12px;
}

.history-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
}

.history-link:hover {
  text-decoration: underline;
}

.history-empty {
  grid-template-columns: 1fr;
}

.history-empty p {
  color: var(--muted);
  line-height: 1.8;
}

.history-skeleton::before,
.history-skeleton::after {
  content: "";
  display: block;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(239, 226, 204, 0.7), rgba(255, 251, 244, 0.95), rgba(239, 226, 204, 0.7));
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}

.history-skeleton::before {
  min-height: 54px;
}

.history-skeleton::after {
  min-height: 78px;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

@media (max-width: 1120px) {
  body.home-scroll-lock {
    height: auto;
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .dashboard,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .home-side-column {
    align-self: auto;
    min-height: auto;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .home-side-viewport {
    position: static;
    height: auto;
    overflow: visible;
  }

  .home-side-track {
    transform: none;
  }

  .home-side-spacer {
    display: none;
  }

  .home-main-column {
    position: static;
    top: auto;
  }

  .today-strip-body {
    grid-template-columns: 1fr;
  }

  .today-strip-items {
    grid-column: auto;
    grid-row: auto;
    grid-template-columns: 1fr;
  }

  .detail-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-ring-group {
    justify-content: center;
  }

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

@media (max-width: 760px) {
  .app-shell {
    padding-bottom: 96px;
  }

  .app-sidebar {
    padding: 18px;
  }

  .view-nav {
    display: none;
  }

  .workspace-topbar,
  .workspace-actions,
  .hero-date-line {
    flex-direction: column;
    align-items: flex-start;
  }

  .mobile-dock {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 4;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 8px;
    border-radius: 22px;
    background: rgba(255, 248, 238, 0.94);
    border: 1px solid var(--line);
    box-shadow: 0 18px 32px rgba(91, 57, 30, 0.12);
  }

  .query-head,
  .query-result-head,
  .query-result-main {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .today-strip-head,
  .today-strip-meta {
    display: grid;
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .today-strip-day {
    width: 64px;
    height: 64px;
    font-size: 30px;
    border-radius: 18px;
  }

  .today-strip-copy strong {
    font-size: 24px;
  }

  .sidebar-selected h2 {
    font-size: 26px;
  }

  .history-head,
  .history-item,
  .history-skeleton {
    grid-template-columns: 1fr;
  }

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

  .hero-day {
    width: 96px;
    height: 96px;
    font-size: 56px;
  }

  .week-header,
  .calendar-grid,
  .double-column,
  .info-grid,
  .hour-grid {
    gap: 6px;
  }

  .calendar-grid {
    min-height: auto;
  }

  .day-cell {
    min-height: 70px;
    padding: 8px;
    border-radius: 14px;
  }

  .week-header div {
    padding-inline: 0;
    font-size: 12px;
  }

  .solar-day {
    font-size: 17px;
  }

  .lunar-day,
  .mini-tag {
    font-size: 10px;
  }

  .double-column,
  .info-grid,
  .hour-grid,
  .fortune-highlight-grid,
  .fortune-info-grid {
    grid-template-columns: 1fr;
  }

  .status-ring {
    width: 112px;
    height: 112px;
  }
}
