/*!
 * 六爻占卜 · liuyaozhanbu.com
 * 设计基调：Times New Roman + 中文宋体，蓝白灰三色，内容优先、卡片分隔。
 */
:root {
  --primary: #2d92d9;
  --primary-hover: #2278b7;
  --primary-deep: #1b5f92;
  --primary-soft: #eaf4fb;
  --bg: #eeeeee;
  --surface: #ffffff;
  --surface-alt: #f9f9f9;
  --text: #333333;
  --text-2: #666666;
  --muted: #6f6f6f;
  --inverse: #ffffff;
  --link: #4a73b6;
  --link-hover: #000000;
  --red: #d4473d;
  --red-soft: #fbeceb;
  --green: #3f7d4e;
  --green-soft: #edf6ef;
  --amber: #8a6220;
  --amber-soft: #fbf4e6;
  --border: #e5e5e5;
  --border-dark: #333333;
  --shadow: 0 4px 30px 0 rgba(232, 232, 237, 0.5);
  --radius-sm: 5px;
  --radius-md: 10px;
  --radius-lg: 15px;
  --wrap: 1200px;
  --header-h: 64px;
  --font: "Times New Roman", "Songti SC", "STSong", "SimSun", "Noto Serif SC", "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif CN", serif;
  --ease: ease-in-out;
  --fast: 0.2s;
  --base: 0.25s;
  --slow: 0.3s;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

body.nav-open {
  overflow: hidden;
}

img,
svg {
  max-width: 100%;
  vertical-align: middle;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--fast) var(--ease);
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

::selection {
  background: var(--primary);
  color: #fff;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  padding-left: 1.25em;
}

h1 {
  font-size: clamp(42px, 6.6vw, 76px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -1px;
}

h2 {
  font-size: 26px;
  line-height: 1.3;
  font-weight: 700;
}

h3 {
  font-size: 20px;
  line-height: 1.5;
  font-weight: 400;
}

h4 {
  font-size: 18px;
  line-height: 1.5;
  font-weight: 700;
}

.wrap {
  width: min(var(--wrap), calc(100% - 40px));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  transition: top var(--fast) var(--ease);
}

.skip-link:focus {
  top: 12px;
}

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--primary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--inverse);
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}

.brand:hover {
  color: var(--inverse);
  text-decoration: none;
}

.brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-sm);
}

.brand__mark svg {
  width: 22px;
  height: 22px;
}

.brand__text {
  letter-spacing: 1px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 13px;
  color: var(--inverse);
  font-size: 16px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition:
    background-color var(--fast) var(--ease),
    color var(--fast) var(--ease);
}

.nav-link:hover {
  background: var(--primary-hover);
  color: var(--inverse);
  text-decoration: none;
}

.nav-link[aria-current="page"] {
  background: var(--surface);
  color: var(--primary);
  font-weight: 700;
}

.nav-cta {
  margin-left: 8px;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  margin-left: auto;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-sm);
}

.nav-toggle__bars {
  display: block;
  width: 20px;
  height: 14px;
  margin: 0 auto;
  position: relative;
}

.nav-toggle__bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: #fff;
  transition: transform var(--base) var(--ease), top var(--base) var(--ease), opacity var(--fast) var(--ease);
}

.nav-toggle__bars span:nth-child(1) {
  top: 0;
}

.nav-toggle__bars span:nth-child(2) {
  top: 6px;
}

.nav-toggle__bars span:nth-child(3) {
  top: 12px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) {
  top: 6px;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(3) {
  top: 6px;
  transform: rotate(-45deg);
}

/* ---------- 首页 hero ---------- */
.hero {
  padding: 40px 0 0;
}

.hero__head {
  max-width: 920px;
  margin-bottom: 20px;
}

.hero h1 span {
  color: var(--primary-deep);
}

.hero__lead {
  max-width: 780px;
  margin-top: 16px;
  color: var(--text-2);
  font-size: 19px;
  line-height: 1.65;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 16px;
  color: var(--text-2);
  font-size: 15px;
}

.hero__meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero__meta svg {
  width: 15px;
  height: 15px;
  color: var(--primary);
}

.hero__tool {
  margin-top: 20px;
}

/* ---------- 卡片与版式 ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 20px;
}

.card--pad-lg {
  padding: 28px 20px;
}

.card--flush {
  padding: 0;
  overflow: hidden;
}

.section {
  padding: 40px 0 0;
}

.section--tight {
  padding-top: 20px;
}

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

.section-head h2 {
  font-size: 26px;
}

.section-head p {
  max-width: 720px;
  color: var(--text-2);
  font-size: 16px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--primary-deep);
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.eyebrow--light {
  color: var(--primary);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.layout--wide {
  grid-template-columns: minmax(0, 1fr) 360px;
}

.stack > * + * {
  margin-top: 20px;
}

.stack-sm > * + * {
  margin-top: 8px;
}

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

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

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

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

.grid--sidebar {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.prose {
  color: var(--text);
  font-size: 18px;
  line-height: 1.75;
}

.prose > * + * {
  margin-top: 16px;
}

.prose h2 {
  margin-top: 32px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.prose h3 {
  margin-top: 24px;
  font-weight: 700;
}

.prose p,
.prose li {
  color: #3d3d3d;
}

.prose ul,
.prose ol {
  padding-left: 1.35em;
}

.prose li + li {
  margin-top: 4px;
}

.prose strong {
  color: #222;
}

.prose a {
  text-decoration: underline;
  text-decoration-color: rgba(74, 115, 182, 0.35);
  text-underline-offset: 3px;
}

.prose blockquote {
  margin: 20px 0;
  padding: 16px 20px;
  background: var(--surface-alt);
  border-left: 3px solid var(--primary);
  color: var(--text-2);
  font-size: 17px;
}

.prose code {
  padding: 1px 5px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.88em;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.prose th,
.prose td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--surface-alt);
  font-weight: 700;
}

.lede {
  color: var(--text-2);
  font-size: 19px;
  line-height: 1.7;
}

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

.small {
  font-size: 16px;
}

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

.text-link {
  color: var(--link);
}

.text-link:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  white-space: nowrap;
}

.arrow-link::after {
  content: "→";
  transition: transform var(--fast) var(--ease);
}

.arrow-link:hover::after {
  transform: translateX(3px);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  text-decoration: none;
  transition:
    background-color var(--base) var(--ease),
    color var(--base) var(--ease),
    border-color var(--base) var(--ease),
    transform var(--fast) var(--ease);
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  background: var(--primary);
  color: var(--inverse);
}

.btn--primary:hover {
  background: var(--primary-hover);
  color: var(--inverse);
}

.btn--secondary {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border-dark);
}

.btn--secondary:hover {
  background: #e3e3e3;
  color: #000;
  border-color: #000;
}

.btn--ghost {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border);
}

.btn--ghost:hover {
  color: #000;
  border-color: #000;
}

.btn--small {
  min-height: 34px;
  padding: 4px 12px;
  font-size: 15px;
}

.btn--large {
  min-height: 50px;
  padding: 12px 28px;
  font-size: 18px;
}

.btn--block {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-row--center {
  justify-content: center;
}

/* ---------- 表单 ---------- */
.field {
  min-width: 0;
}

.field > label,
.field__label {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 15px;
}

.field__hint {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 16px;
  transition:
    border-color var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease);
}

.textarea {
  min-height: 84px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(45, 146, 217, 0.18);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  background: var(--bg);
  color: var(--muted);
  cursor: not-allowed;
}

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

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

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

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  cursor: pointer;
}

.radio input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 40px;
  padding: 3px 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  cursor: pointer;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}

.check:hover {
  border-color: var(--primary);
}

.check input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--primary);
}

.check:has(input:checked) {
  background: var(--primary-soft);
  border-color: var(--primary);
}

/* ---------- 起卦工具 ---------- */
.tool {
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tool__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.tool__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
}

.tool__badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  border-radius: 3px;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.tool__body {
  padding: 20px;
}

.tool__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 13px;
}

.tool__foot p {
  margin: 0;
}

.toss {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

.toss__stage {
  min-width: 0;
}

.coin-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 8px 0 16px;
}

.coin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #f7d77c, #c99a2e 72%);
  border: 2px solid #a97b1f;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.18), 0 2px 6px rgba(120, 85, 15, 0.18);
  color: #4a3308;
  font-size: 26px;
  font-weight: 700;
  user-select: none;
}

.coin--flip {
  animation: coin-flip 0.55s var(--ease);
}

@keyframes coin-flip {
  0% { transform: rotateY(0) translateY(0); }
  50% { transform: rotateY(540deg) translateY(-10px); }
  100% { transform: rotateY(720deg) translateY(0); }
}

.coin--back {
  background: radial-gradient(circle at 34% 30%, #f7d77c, #c99a2e 72%);
  color: #4a3308;
}

.coin--face {
  background: radial-gradient(circle at 34% 30%, #fbf4e3, #d8c79e 72%);
  border-color: #9a8a64;
  color: #5f4c1d;
}

.toss__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.toss__status {
  margin-bottom: 12px;
  color: var(--text-2);
  font-size: 15px;
}

.toss__status strong {
  color: var(--text);
}

.line-preview {
  display: grid;
  gap: 6px;
  padding: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.line-preview__row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  color: var(--text-2);
  font-size: 14px;
}

.line-preview__row--empty {
  opacity: 0.42;
}

.line-preview__label {
  white-space: nowrap;
}

.line-preview__value {
  text-align: right;
  white-space: nowrap;
}

.yao-line {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 18px;
}

.yao-line__bar {
  display: flex;
  gap: 20px;
  flex: 1;
  height: 8px;
}

.yao-line__bar i {
  display: block;
  height: 8px;
  background: var(--text);
  border-radius: 1px;
}

.yao-line__bar--yang i {
  width: 100%;
}

.yao-line__bar--yin i {
  width: calc(50% - 10px);
}

.yao-line--empty .yao-line__bar i {
  background: #d5d5d5;
}

.yao-line__mark {
  width: 16px;
  color: var(--red);
  font-size: 15px;
  text-align: center;
}

.toss__side {
  min-width: 0;
}

.toss__side .card {
  box-shadow: none;
  border: 1px solid var(--border);
  padding: 16px;
}

.toss__side h3 {
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 700;
}

.toss__side p,
.toss__side li {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.65;
}

.toss__side ul {
  margin: 0;
  padding-left: 1.15em;
}

/* ---------- 结果与排盘 ---------- */
.result {
  display: none;
}

.result.is-visible {
  display: block;
}

.toss > .result {
  grid-column: 1 / -1;
}

.result .analysis {
  max-width: 960px;
}

.result__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 16px 20px;
  background: var(--primary-soft);
  border: 1px solid #cfe7f7;
  border-radius: var(--radius-sm);
}

.result__kicker {
  color: var(--primary-deep);
  font-size: 13px;
  letter-spacing: 1px;
}

.result__title {
  margin-top: 2px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
}

.result__title small {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-2);
}

.result__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 6px;
  color: var(--text-2);
  font-size: 14px;
}

.result__summary {
  margin-top: 12px;
  color: var(--text-2);
  font-size: 15px;
}

.hex-pair {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.hex-chip {
  padding: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}

.hex-chip__label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.hex-chip__name {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  font-weight: 700;
}

.hex-chip--main {
  background: var(--primary-soft);
  border-color: #cfe7f7;
}

.chart-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.chart-hint {
  display: none;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.chart {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
  font-size: 15px;
}

.chart th,
.chart td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  text-align: left;
}

.chart thead th {
  background: var(--surface-alt);
  color: var(--text-2);
  font-weight: 400;
  font-size: 13px;
  white-space: nowrap;
}

.chart tbody tr:last-child td {
  border-bottom: 0;
}

.chart tbody tr:hover {
  background: #fcfcfc;
}

.chart__shen {
  width: 64px;
  color: var(--text-2);
  white-space: nowrap;
}

.chart__line {
  min-width: 220px;
}

.chart__pos {
  width: 52px;
  color: var(--text-2);
  white-space: nowrap;
}

.chart__mark {
  width: 58px;
  color: var(--red);
  text-align: center;
  white-space: nowrap;
}

.chart__shi {
  width: 44px;
  text-align: center;
  color: var(--primary-deep);
  white-space: nowrap;
}

.chart__change {
  min-width: 170px;
  color: var(--text-2);
}

.chart__lq {
  font-weight: 700;
}

.chart__najia {
  color: var(--text-2);
}

.chart__fu {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.chart__tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-left: 6px;
  vertical-align: 1px;
}

.tag {
  display: inline-block;
  padding: 0 5px;
  border-radius: 3px;
  font-size: 11px;
  line-height: 18px;
  white-space: nowrap;
}

.tag--move {
  background: var(--primary-soft);
  color: var(--primary-deep);
}

.tag--shi {
  background: #eef2fb;
  color: #3d5a97;
}

.tag--kong {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag--po {
  background: var(--red-soft);
  color: var(--red);
}

.tag--ys {
  background: #eaf5ee;
  color: var(--green);
}

.tag--plain {
  background: var(--surface-alt);
  color: var(--text-2);
}

.chart .is-yongshen {
  background: #f4fbf6;
}

.chart .is-yongshen td:first-child {
  box-shadow: inset 3px 0 0 var(--green);
}

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

.yao-symbol {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
  letter-spacing: 1px;
  white-space: nowrap;
}

.yao-symbol__yang {
  display: inline-block;
  width: 48px;
  height: 7px;
  background: var(--text);
  border-radius: 1px;
}

.yao-symbol__yin {
  display: inline-flex;
  gap: 9px;
}

.yao-symbol__yin i {
  display: block;
  width: 19px;
  height: 7px;
  background: var(--text);
  border-radius: 1px;
}

.yao-symbol__mark {
  color: var(--red);
  font-size: 14px;
}

.analysis {
  margin-top: 20px;
}

.analysis__block + .analysis__block {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.analysis__block h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
}

.analysis__block h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 16px;
  background: var(--primary);
  border-radius: 2px;
}

.analysis__block p {
  color: #3d3d3d;
  font-size: 16px;
  line-height: 1.75;
}

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

.caution {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--amber-soft);
  border: 1px solid #eddfc0;
  border-radius: var(--radius-sm);
  color: #5f4a22;
  font-size: 14px;
  line-height: 1.65;
}

.caution svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.empty-state {
  padding: 40px 20px;
  color: var(--text-2);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 18px;
}

/* ---------- 页面头部 ---------- */
.page-head {
  padding: 32px 0 0;
}

.page-head h1 {
  font-size: clamp(34px, 4.6vw, 52px);
  letter-spacing: -0.5px;
}

.page-head .lede {
  max-width: 860px;
  margin-top: 12px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumbs a {
  color: var(--text-2);
}

.breadcrumbs span[aria-hidden] {
  color: #b5b5b5;
}

/* ---------- 首页入口 ---------- */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.entry {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: transform var(--base) var(--ease), box-shadow var(--base) var(--ease);
}

.entry:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #d9e8f3;
  color: var(--text);
  text-decoration: none;
}

.entry__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  border-radius: var(--radius-sm);
}

.entry__icon svg {
  width: 21px;
  height: 21px;
}

.entry__title {
  font-size: 19px;
  font-weight: 700;
}

.entry__text {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.6;
}

.entry__more {
  margin-top: auto;
  padding-top: 4px;
  color: var(--link);
  font-size: 14px;
}

/* ---------- 步骤 ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 20px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 13px;
  letter-spacing: 1px;
}

.step h3 {
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 700;
}

.step p {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.65;
}

/* ---------- 侧栏 ---------- */
.sidebar {
  display: grid;
  gap: 16px;
}

.sidebar-card {
  padding: 20px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.sidebar-card h3 {
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 700;
}

.sidebar-card p {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.65;
}

.sidebar-card .btn {
  margin-top: 12px;
}

.sidebar-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar-list li + li {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.sidebar-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
  font-size: 15px;
  text-decoration: none;
}

.sidebar-list a:hover {
  color: var(--link);
  text-decoration: underline;
}

.sidebar-list span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.sticky {
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.toc {
  padding: 16px 20px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.toc p {
  margin-bottom: 8px;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--muted);
}

.toc ol {
  margin: 0;
  padding-left: 1.2em;
  color: var(--text-2);
  font-size: 15px;
}

.toc li + li {
  margin-top: 4px;
}

/* ---------- 数据表 ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.data-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 15px;
}

.data-table th,
.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.data-table thead th {
  background: var(--surface-alt);
  color: var(--text-2);
  font-weight: 400;
  font-size: 13px;
  white-space: nowrap;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: #fcfcfc;
}

.data-table caption {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
  caption-side: bottom;
}

/* ---------- 首页内容模块 ---------- */
.lead-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 20px;
  align-items: start;
}

.note-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.note-list li {
  position: relative;
  padding-left: 18px;
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.7;
}

.note-list li + li {
  margin-top: 8px;
}

.note-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
}

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

.palace-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.palace-card h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 17px;
  font-weight: 700;
}

.palace-card h3 span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.palace-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.palace-card li {
  font-size: 14px;
  color: var(--text-2);
}

.palace-card a {
  color: var(--text-2);
}

.palace-card a:hover {
  color: var(--link);
}

.quote-block {
  padding: 20px;
  background: var(--surface-alt);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.7;
}

.quote-block strong {
  color: var(--text);
}

/* ---------- 六十四卦列表 ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.filters__search {
  flex: 1 1 220px;
  min-width: 180px;
}

.filters__count {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.filter-btn {
  min-height: 36px;
  padding: 5px 11px;
  background: var(--surface-alt);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all var(--fast) var(--ease);
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary-deep);
}

.filter-btn[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.palace-section + .palace-section {
  margin-top: 28px;
}

.palace-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.palace-section__head h2 {
  font-size: 22px;
}

.palace-section__head p {
  color: var(--muted);
  font-size: 13px;
}

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

.gua-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

.gua-card:hover {
  border-color: #cfe7f7;
  box-shadow: var(--shadow);
}

.gua-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.gua-card__title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
}

.gua-card__title small {
  margin-left: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.gua-card__meta {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.gua-card__quote {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.65;
}

.gua-card__quote b {
  color: var(--text);
  font-weight: 400;
}

.gua-card__note {
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
}

.gua-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
  color: var(--link);
  font-size: 14px;
}

.gua-card .yao-mini {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  width: 26px;
}

.yao-mini i {
  display: block;
  height: 3px;
  background: var(--text-2);
  border-radius: 1px;
}

.yao-mini i.gap {
  background: transparent;
}

/* ---------- 64 卦详情 ---------- */
.gua-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start;
}

.gua-hero__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.gua-hero__title h1 {
  font-size: clamp(36px, 5vw, 56px);
}

.gua-hero__title span {
  color: var(--text-2);
  font-size: 20px;
}

.gua-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin-top: 16px;
  padding: 16px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
}

.gua-facts dt {
  color: var(--muted);
  font-size: 12px;
}

.gua-facts dd {
  margin: 0;
  color: var(--text);
}

.hexagram-figure {
  display: grid;
  gap: 7px;
  padding: 16px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.hexagram-figure__row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 18px;
}

.hexagram-figure__row span {
  width: 34px;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.hexagram-figure__bar {
  display: flex;
  gap: 8px;
  flex: 1;
  height: 9px;
}

.hexagram-figure__bar i {
  display: block;
  height: 9px;
  background: var(--text);
  border-radius: 1px;
}

.hexagram-figure__bar--yang i {
  width: 100%;
}

.hexagram-figure__bar--yin i {
  width: calc(50% - 4px);
}

.classical {
  padding: 16px 20px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.classical p + p {
  margin-top: 6px;
}

.classical__label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 1px;
}

.classical__text {
  font-size: 17px;
  line-height: 1.75;
}

.line-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.line-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.line-list li:last-child {
  border-bottom: 0;
}

.line-list__name {
  display: inline-block;
  min-width: 44px;
  color: var(--primary-deep);
  font-size: 14px;
}

.line-list__text {
  font-size: 16px;
}

.line-list__xiang {
  display: block;
  margin-top: 2px;
  padding-left: 48px;
  color: var(--muted);
  font-size: 13px;
}

.related-gua {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.related-gua a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 5px 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 14px;
}

.related-gua a:hover {
  border-color: var(--primary);
  color: var(--primary-deep);
  text-decoration: none;
}

/* ---------- FAQ ---------- */
.faq {
  display: grid;
  gap: 8px;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.faq summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: var(--primary);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "−";
}

.faq details[open] summary {
  border-bottom: 1px solid var(--border);
}

.faq__body {
  padding: 14px 20px 18px;
  color: var(--text-2);
  font-size: 16px;
  line-height: 1.75;
}

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

/* ---------- 文章 ---------- */
.article-list {
  display: grid;
  gap: 12px;
}

.article-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.article-item__date {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.article-item__title {
  font-size: 19px;
  font-weight: 700;
}

.article-item__title a {
  color: var(--text);
}

.article-item__title a:hover {
  color: var(--link);
}

.article-item__desc {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.65;
}

.article-head {
  padding: 32px 0 0;
}

.article-head h1 {
  font-size: clamp(32px, 4.2vw, 46px);
  line-height: 1.3;
}

.article-head__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.article-body {
  padding: 24px 0 0;
}

.article-body .prose {
  padding: 28px 20px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.article-body .prose h2 {
  font-size: 24px;
}

.article-body .prose h3 {
  font-size: 19px;
}

.article-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

/* ---------- 提示与标签 ---------- */
.notice {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.7;
}

.notice svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--primary);
}

.notice--warn {
  background: var(--amber-soft);
  border-color: #eddfc0;
  border-left-color: var(--amber);
  color: #5f4a22;
}

.notice--warn svg {
  color: var(--amber);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 20px;
}

.badge--blue {
  background: var(--primary-soft);
  color: var(--primary-deep);
}

.badge--green {
  background: var(--green-soft);
  color: var(--green);
}

.badge--red {
  background: var(--red-soft);
  color: var(--red);
}

.divider {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 20px 0;
}

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 40px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  gap: 28px;
  padding: 36px 0 28px;
}

.footer__brand .brand {
  color: var(--text);
  margin-bottom: 10px;
}

.footer__brand .brand__mark {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.footer__tagline {
  max-width: 380px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.7;
}

.footer__note {
  max-width: 420px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.footer__col {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.footer__title {
  margin-bottom: 2px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.footer__col a {
  color: var(--text-2);
  font-size: 14px;
}

.footer__col a:hover {
  color: var(--link);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 16px 0 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.footer__bottom p {
  margin: 0;
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer__legal a {
  color: var(--text-2);
}

.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity var(--base) var(--ease), transform var(--base) var(--ease), visibility var(--base);
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.to-top svg {
  width: 18px;
  height: 18px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  max-width: min(420px, calc(100vw - 40px));
  padding: 10px 18px;
  background: #333;
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 15px;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity var(--base) var(--ease), transform var(--base) var(--ease), visibility var(--base);
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

[hidden] {
  display: none !important;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1120px) {
  .site-nav {
    gap: 2px;
  }

  .nav-link {
    padding: 6px 9px;
    font-size: 15px;
  }

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

  .footer__top {
    grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
}

@media (max-width: 980px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 20px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-link {
    color: var(--text);
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
  }

  .nav-link:hover {
    background: var(--surface-alt);
    color: var(--primary-deep);
  }

  .nav-link[aria-current="page"] {
    background: var(--primary-soft);
    color: var(--primary-deep);
  }

  .nav-cta {
    margin: 8px 0 0;
  }

  .layout,
  .layout--wide,
  .grid--sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .sticky {
    position: static;
  }

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

  .toss__stage {
    order: 1;
  }

  .toss > .result {
    order: 2;
  }

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

  .gua-hero {
    grid-template-columns: minmax(0, 1fr);
  }

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

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

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

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

@media (max-width: 720px) {
  body {
    font-size: 17px;
  }

  .chart-hint {
    display: block;
  }

  .wrap {
    width: calc(100% - 32px);
  }

  .hero {
    padding-top: 28px;
  }

  .hero h1 {
    font-size: clamp(38px, 11vw, 52px);
  }

  .hero__lead {
    font-size: 17px;
  }

  .section {
    padding-top: 28px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .section-head h2 {
    font-size: 23px;
  }

  .grid--2,
  .grid--3,
  .grid--4,
  .form-grid--2,
  .form-grid--3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .entry-grid,
  .gua-grid,
  .steps,
  .palace-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

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

  .coin {
    width: 62px;
    height: 62px;
    font-size: 21px;
  }

  .coin-row {
    gap: 12px;
  }

  .tool__body {
    padding: 16px;
  }

  .tool__head {
    padding: 14px 16px;
  }

  .tool__foot {
    padding: 12px 16px;
  }

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

  .chart {
    min-width: 620px;
  }

  .chart th,
  .chart td {
    padding: 6px 8px;
  }

  .footer__top {
    grid-template-columns: minmax(0, 1fr);
    padding: 28px 0 20px;
  }

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

  .article-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .article-body .prose {
    padding: 20px 16px;
  }

  .article-body .prose h2 {
    font-size: 21px;
  }

  .article-body .prose h3 {
    font-size: 18px;
  }

  .gua-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .to-top {
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 420px) {
  .coin {
    width: 54px;
    height: 54px;
    font-size: 18px;
  }

  .filter-btn {
    min-height: 40px;
    padding: 4px 8px;
    font-size: 13px;
  }

  .badge {
    font-size: 11px;
  }
}

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

@media print {
  .site-header,
  .site-footer,
  .to-top,
  .toast,
  .nav-toggle,
  .btn,
  .toss__side,
  .filters {
    display: none !important;
  }

  body {
    background: #fff;
    font-size: 12pt;
  }

  .card,
  .tool {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .layout,
  .toss,
  .gua-hero {
    display: block;
  }
}
