.sh-layout-mobile {
  display: none;
}

.sh-d-shell {
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px 32px 96px;
}

.sh-d-header {
  display: grid;
  gap: 20px;
  margin-bottom: 28px;
}

.sh-d-brand {
  display: flex;
  align-items: center;
  gap: 28px;
}

.sh-d-bagua {
  flex: 0 0 auto;
  margin: 0;
}

.sh-d-title {
  position: relative;
  margin: 0 0 12px;
  padding-bottom: 20px;
  font-family: "Noto Serif TC", serif;
  font-size: var(--fs-2xl);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.04em;
  color: var(--sh-paper);
}

.sh-d-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(100%, 320px);
  height: 12px;
  background: var(--sh-cinnabar);
  -webkit-mask: var(--sh-brush) center / 100% 100% no-repeat;
  mask: var(--sh-brush) center / 100% 100% no-repeat;
}

.sh-d-lead {
  margin: 0;
  max-width: 680px;
  line-height: 1.6;
  color: rgba(var(--cream-rgb), 0.78);
}

.sh-d-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(var(--gold-rgb), 0.25);
}

.sh-d-tab {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 64px;
  color: rgba(var(--cream-rgb), 0.72);
  text-decoration: none;
  font-family: "Noto Serif TC", serif;
  font-size: var(--fs-xs);
  font-weight: 600;
  transition: color 0.2s ease;
}

.sh-d-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 48px;
  padding: 0 4px;
  box-sizing: border-box;
  border: 2px solid rgba(var(--sh-cinnabar-rgb), 0.8);
  border-radius: var(--radius-sm);
  color: var(--sh-cinnabar);
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.sh-d-tab:hover {
  color: var(--cream);
}

.sh-d-tab:hover .sh-d-seal {
  transform: rotate(-3deg);
}

.sh-d-tab.is-active {
  color: var(--sh-leaf);
}

.sh-d-tab.is-active .sh-d-seal {
  border-color: var(--sh-cinnabar);
  background: var(--sh-cinnabar);
  color: var(--sh-paper);
  box-shadow: inset 0 0 0 2px var(--sh-cinnabar), inset 0 0 0 3px rgba(var(--sh-paper-rgb), 0.55);
  transform: rotate(-3deg);
}

.sh-d-body {
  display: grid;
  gap: 28px;
}

.sh-d-panel {
  columns: 3 240px;
  column-gap: 40px;
  padding: 28px 32px;
  border-top-width: 4px;
  border-bottom-width: 4px;
  border-top-color: var(--sh-leaf);
  border-bottom-color: var(--sh-leaf);
}

.sh-d-panel > * {
  break-inside: avoid;
}

.sh-d-panel > .sh-card-title,
.sh-d-panel > .sh-btn,
.sh-d-panel > .sh-shio-picker,
.sh-d-panel > .year-picker,
.sh-d-panel > .yearly-lichun,
.sh-d-panel > .sh-d-year-label,
.sh-d-panel > .sh-shio-picker ~ .sh-hint,
.sh-d-panel > .sh-d-quiz-join,
.sh-d-panel > .sh-d-quiz-join ~ .sh-hint {
  column-span: all;
}

.sh-d-panel > .sh-label {
  break-after: avoid;
}

.sh-d-panel > .sh-shio-picker {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.sh-d-panel > .sh-btn-block {
  display: flex;
  width: fit-content;
  min-width: 280px;
  margin: 8px auto 0;
}

.sh-d-panel > #d-destiny-submit {
  display: inline-flex;
  width: auto;
  margin: 8px 0 0;
}

.sh-d-panel > .sh-d-quiz-join {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
}

.sh-d-quiz-join .sh-field {
  margin-bottom: 0;
}

.sh-d-quiz-join .sh-btn-block {
  width: auto;
  min-width: 200px;
}

.sh-d-quiz-create .quiz-option-group > .sh-label,
.sh-d-quiz-create .quiz-hint {
  text-align: center;
}

.sh-d-quiz-create .quiz-option-group .choice-chips {
  justify-content: center;
}

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

.sh-d-results {
  min-width: 0;
}

.sh-d-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px 0;
  border: none;
  background: none;
  color: rgba(var(--cream-rgb), 0.72);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
}

.sh-d-back:hover {
  color: var(--gold);
}

.sh-btn-primary:hover {
  box-shadow: inset 0 0 0 3px rgba(var(--sh-ink-rgb), 0.35), inset 0 0 0 4px rgba(var(--gold-rgb), 0.7),
    0 0 20px rgba(var(--sh-cinnabar-rgb), 0.45);
}

.sh-btn-ghost:hover {
  border-color: var(--gold);
  background: rgba(var(--sh-lacquer-rgb), 0.35);
}

.sh-d-hub {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px 24px;
  padding-top: 8px;
}

.sh-d-hub .sh-hub-card {
  min-height: 260px;
  padding: 32px 72px 28px 24px;
  border-top: none;
  border-bottom: none;
}

.sh-d-hub .sh-hub-card::before,
.sh-d-hub .sh-hub-card::after {
  content: "";
  position: absolute;
  left: -8px;
  right: -8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--sh-leaf), var(--sh-leaf-deep));
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.sh-d-hub .sh-hub-card::before {
  top: -4px;
}

.sh-d-hub .sh-hub-card::after {
  bottom: -4px;
}

.sh-d-hub .sh-hub-hanzi {
  position: absolute;
  top: 28px;
  right: 20px;
  writing-mode: vertical-rl;
  letter-spacing: 0.12em;
}

.sh-d-hub .sh-hub-card-wide {
  grid-column: 1 / -1;
  min-height: 0;
  padding: 28px 32px 28px 120px;
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
}

.sh-d-hub .sh-hub-card-wide::before,
.sh-d-hub .sh-hub-card-wide::after {
  display: none;
}

.sh-d-hub .sh-hub-card-wide .sh-hub-hanzi {
  writing-mode: horizontal-tb;
  letter-spacing: 0.08em;
  top: 50%;
  left: 32px;
  right: auto;
  font-size: var(--fs-2xl);
  transform: translateY(-50%);
}

.sh-hub-card:hover {
  border-color: var(--gold);
  transform: rotate(-1deg);
}

.sh-d-almanac-panel {
  columns: auto;
}

.sh-d-almanac-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px 40px;
}

.sh-d-almanac-top .sh-almanac-head {
  margin-bottom: 0;
}

.sh-d-almanac-date {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.sh-d-almanac-date .sh-field {
  width: 240px;
  margin-bottom: 0;
}

.sh-d-almanac-date .sh-btn {
  margin: 0;
  white-space: nowrap;
}

.sh-d-daily-pillar {
  max-width: none;
  margin: 24px 0 0;
  padding: 24px 0 0;
  border: none;
  border-top: 1px solid rgba(var(--gold-rgb), 0.2);
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.sh-d-year-label {
  margin: 24px 0 8px;
  text-align: center;
}

.sh-d-panel .yearly-lichun {
  margin: 16px 0;
}

.sh-d-results .yearly-card {
  margin: 0 0 20px;
  max-width: none;
}

.sh-d-panel .sh-hint:last-child {
  margin: 16px 0 0;
}

.sh-d-guardian-card {
  max-width: none;
}

.sh-d-cookie-card {
  padding: 32px;
  overflow: hidden;
}

.sh-d-cookie-card .cookie-slip {
  margin-top: 16px;
}

.sh-d-compat-form {
  margin-bottom: 24px;
}

.sh-d-compat-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.sh-d-compat-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.sh-d-compat-row .sh-label {
  margin-top: 0;
}

.sh-d-compat-hint {
  margin: 16px 0 0;
}

.sh-d-compat-hint a {
  color: var(--gold);
}

.sh-d-compat-result {
  margin-top: 0;
}

.sh-d-roast-hint {
  margin: 16px 0 20px;
}

.sh-d-roast-toolbar {
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 16px;
}

.sh-d-panel .destiny-gender {
  margin-bottom: 4px;
}

.sh-d-destiny-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(10, 2, 2, 0.88);
}

.sh-d-destiny-link {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(var(--gold-rgb), 0.25);
  color: rgba(var(--cream-rgb), 0.8);
  font-size: var(--fs-xs);
  text-decoration: none;
}

.sh-d-destiny-link:hover {
  border-color: var(--gold);
  color: var(--gold);
}

#d-destiny-sections .destiny-block {
  scroll-margin-top: 72px;
}

.sh-d-quiz-modes {
  max-width: none;
  margin: 0 0 20px;
}

.sh-d-quiz-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.sh-d-quiz-submit {
  margin-top: 20px;
}

.sh-d-room-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.sh-d-room-bar .quiz-room-mode {
  margin: 0 0 4px;
}

.sh-d-room-notice {
  max-width: none;
  margin: 0 0 20px;
}

.sh-d-room-side {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  padding: 0;
}

.sh-d-results .quiz-card {
  max-width: none;
  margin: 0 0 16px;
}

.sh-d-room-compat {
  margin-top: 0;
}

.sh-d-body-single {
  grid-template-columns: minmax(0, 1fr);
}

.sh-d-body-single > .sh-d-room-side {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .sh-btn-primary:hover,
  .sh-hub-card:hover,
  .sh-d-tab:hover .sh-d-seal {
    transform: none;
  }
}
