/* 易经六爻卜卦 —— 与 bazi.css 同一套纸墨语言（纸底、墨字、赭金强调），
   卦画部分自成一格：爻用横条画，动爻用赭金描边 + ○/✕ 标记。 */
.gm-ly {
	--ink: #28241f;
	--muted: #766f65;
	--gold: #a8793d;
	--line: #e3dbcf;
	--paper: #fffdf8;
	--wash: #faf6ee;
	max-width: 1120px;
	margin: 0 auto;
	padding: 54px 22px 90px;
	color: var(--ink);
}

/* —— 头 —— */
.gm-ly__hero { max-width: 780px; margin-bottom: 34px; }
.gm-ly__eyebrow {
	margin: 0 0 8px;
	color: var(--gold);
	font-size: 11px; letter-spacing: .18em;
}
.gm-ly__hero h1 { margin: 0 0 12px; font: 500 clamp(36px, 6vw, 64px)/1.08 "Songti SC", serif; }
.gm-ly__hero > p { color: var(--muted); line-height: 1.85; margin: 0 0 18px; }
.gm-ly__privacy {
	display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: baseline;
	padding: 12px 16px;
	border: 1px solid var(--line); border-radius: 12px; background: var(--wash);
	font-size: 12.5px;
}
.gm-ly__privacy strong { color: var(--gold); }
.gm-ly__privacy span { color: var(--muted); line-height: 1.7; }

/* —— 起卦面板 —— */
.gm-ly__panel {
	padding: 28px;
	border: 1px solid var(--line); border-radius: 20px; background: var(--paper);
	box-shadow: 0 18px 48px rgba(70, 55, 35, .06);
}
.gm-ly__intro h2 { margin: 0 0 8px; font-size: 22px; }
.gm-ly__intro p { margin: 0 0 22px; max-width: 720px; color: var(--muted); font-size: 13px; line-height: 1.85; }
.gm-ly__opts { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; margin-bottom: 22px; }
.gm-ly__field > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.gm-ly input[type="text"],
.gm-ly select {
	width: 100%; padding: 10px 12px;
	border: 1px solid var(--line); border-radius: 10px; background: #fff;
	color: var(--ink); font: inherit; font-size: 13px;
}
.gm-ly__modes label { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; font-size: 13px; }

.gm-ly__track { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gm-ly__slot {
	display: flex; flex-direction: column; gap: 4px;
	padding: 10px 12px;
	border: 1px dashed var(--line); border-radius: 12px; background: var(--wash);
}
.gm-ly__slot.is-on { border-style: solid; border-color: var(--gold); background: #fff; }
.gm-ly__slot small { color: var(--muted); font-size: 11px; }
.gm-ly__coins { font-size: 15px; letter-spacing: .32em; color: var(--muted); }
.gm-ly__slot.is-on .gm-ly__coins { color: var(--ink); }
.gm-ly__slot b { font-size: 13px; }

.gm-ly__acts { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 12px; }
.gm-ly button {
	padding: 10px 20px;
	border: 1px solid var(--ink); border-radius: 999px;
	background: var(--ink); color: #fff;
	font: inherit; font-size: 13px; cursor: pointer;
	transition: transform .12s ease, opacity .12s ease;
}
.gm-ly button.is-ghost { background: none; color: var(--ink); border-color: var(--line); }
.gm-ly button:hover:not(:disabled) { transform: translateY(-1px); }
.gm-ly button:disabled { opacity: .4; cursor: default; }
.gm-ly button.is-rolling { opacity: .55; }
.gm-ly__hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }

/* 手动录入 */
.gm-ly__manual { display: grid; gap: 10px; }
.gm-ly__mrow {
	display: grid; grid-template-columns: 84px auto 1fr; align-items: center; gap: 14px;
	padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--wash);
}
.gm-ly__mrow small { color: var(--muted); font-size: 12px; }
.gm-ly__mcoins { display: flex; gap: 8px; }
.gm-ly__coin {
	width: 44px; height: 44px; padding: 0;
	border-radius: 999px; border: 1px solid var(--ink);
	background: var(--ink); color: #fff; font-size: 14px;
}
.gm-ly__coin.is-bei { background: #fff; color: var(--muted); border-color: var(--line); }
.gm-ly__mnum { font-size: 13px; }

/* —— 结果 —— */
.gm-ly__result { margin-top: 30px; }
.gm-ly__head h2 { margin: 4px 0 6px; font: 500 clamp(26px, 4vw, 40px)/1.2 "Songti SC", serif; }
.gm-ly__q { margin: 0 0 22px; color: var(--muted); font-size: 13px; }

.gm-ly__figs {
	display: flex; flex-wrap: wrap; align-items: center; gap: 26px;
	padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper);
}
.gm-ly__fig { flex: 1 1 240px; min-width: 220px; }
.gm-ly__fig-title { margin: 0 0 12px; color: var(--gold); font-size: 11px; letter-spacing: .14em; }
.gm-ly__lines { display: flex; flex-direction: column; gap: 7px; }
.gm-ly__line { display: grid; grid-template-columns: 42px 1fr 54px; align-items: center; gap: 10px; }
.gm-ly__pos { font-style: normal; font-size: 12px; color: var(--muted); }
.gm-ly__bar { display: flex; gap: 12px; }
.gm-ly__bar u { display: block; height: 12px; border-radius: 2px; background: var(--ink); text-decoration: none; }
.gm-ly__bar.is-yang u { flex: 1; }
.gm-ly__bar.is-yin u { flex: 1; }
.gm-ly__line.is-moving .gm-ly__bar u { background: var(--gold); box-shadow: 0 0 0 1px rgba(168, 121, 61, .35); }
.gm-ly__num { font-style: normal; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gm-ly__line.is-moving .gm-ly__num { color: var(--gold); }
.gm-ly__fig-name { margin: 14px 0 2px; font-size: 20px; font-family: "Songti SC", serif; }
.gm-ly__fig-sub { margin: 0; color: var(--muted); font-size: 12px; }
.gm-ly__arrow { flex: 0 0 84px; text-align: center; color: var(--muted); }
.gm-ly__arrow span { display: block; font-size: 12px; color: var(--gold); }
.gm-ly__arrow i { display: block; font-style: normal; font-size: 28px; line-height: 1.4; }
.gm-ly__arrow small { font-size: 11px; }

/* 断辞 */
.gm-ly__judge { margin-top: 26px; padding: 24px; border: 1px solid var(--gold); border-radius: 20px; background: var(--wash); }
.gm-ly__judge h3 { margin: 0 0 16px; font-size: 17px; line-height: 1.7; }
.gm-ly__jlist { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.gm-ly__jitem { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.gm-ly__jitem.is-lead { border-color: var(--gold); box-shadow: 0 8px 24px rgba(168, 121, 61, .1); }
.gm-ly__jitem em { display: block; margin-bottom: 6px; color: var(--gold); font-style: normal; font-size: 11px; letter-spacing: .1em; }
.gm-ly__jitem p { margin: 0; font-size: 15.5px; line-height: 1.85; font-family: "Songti SC", serif; }
.gm-ly__jitem small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.gm-ly__basis { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; }

/* 本卦 / 之卦 卡片 */
.gm-ly__cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-top: 20px; }
.gm-ly__card { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.gm-ly__card em { color: var(--gold); font-style: normal; font-size: 11px; letter-spacing: .12em; }
.gm-ly__card h3 { margin: 8px 0 14px; font: 500 22px/1.3 "Songti SC", serif; }
.gm-ly__yuan { margin: 0 0 10px; font-size: 15px; line-height: 1.9; font-family: "Songti SC", serif; }
.gm-ly__yuan b { display: inline-block; margin-right: 8px; padding: 1px 7px; border-radius: 5px; background: var(--wash); color: var(--gold); font: 500 11px/1.8 system-ui, sans-serif; vertical-align: 2px; }
.gm-ly__tuan { color: #3d372f; font-size: 14px; }
.gm-ly__gist { margin: 14px 0 8px; padding: 12px 14px; border-left: 2px solid var(--gold); background: var(--wash); font-size: 13px; line-height: 1.85; }
.gm-ly__gist b { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 500; }
.gm-ly__tri { margin: 0; color: var(--muted); font-size: 12px; }

/* 六爻列表 */
.gm-ly__yaos { margin-top: 26px; }
.gm-ly__yaolist { list-style: none; margin: 10px 0 22px; padding: 0; border-top: 1px solid var(--line); }
.gm-ly__yao { padding: 14px 4px; border-bottom: 1px solid var(--line); }
.gm-ly__yao.is-moving { background: rgba(168, 121, 61, .05); }
.gm-ly__yao.is-focus { box-shadow: inset 3px 0 0 var(--gold); padding-left: 14px; }
.gm-ly__yao-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 5px; }
.gm-ly__yao-head b { font-size: 14px; }
.gm-ly__yao-num { color: var(--muted); font-size: 12px; }
.gm-ly__tagm, .gm-ly__tagf {
	padding: 1px 8px; border-radius: 999px;
	font-size: 11px; letter-spacing: .04em;
}
.gm-ly__tagm { background: var(--gold); color: #fff; }
.gm-ly__tagf { border: 1px solid var(--gold); color: var(--gold); }
.gm-ly__yao-text { margin: 0 0 4px; font-size: 15.5px; line-height: 1.9; font-family: "Songti SC", serif; }
.gm-ly__yao-xiang { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.8; }

/* 互错综 */
.gm-ly__rel { margin-top: 8px; }
.gm-ly__rellist { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 10px; }
.gm-ly__relitem { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.gm-ly__relitem em { color: var(--gold); font-style: normal; font-size: 11px; letter-spacing: .12em; }
.gm-ly__relitem b { display: block; margin: 6px 0; font: 500 19px/1.2 "Songti SC", serif; }
.gm-ly__relitem p { margin: 0 0 8px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.gm-ly__relitem small { font-size: 13px; line-height: 1.8; font-family: "Songti SC", serif; }

/* 结果操作 */
.gm-ly__resultacts { display: flex; gap: 10px; margin-top: 20px; }

/* 卦例 */
.gm-ly__hist { margin-top: 46px; }
.gm-ly__hist h2 { margin: 4px 0 6px; font: 500 26px/1.2 "Songti SC", serif; }
.gm-ly__hist header span { display: block; max-width: 720px; margin-bottom: 16px; color: var(--muted); font-size: 12.5px; line-height: 1.8; }
.gm-ly__hlist { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.gm-ly__hitem {
	display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px 10px;
	padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper);
}
.gm-ly__hitem b { grid-column: 1 / -1; font: 500 17px/1.3 "Songti SC", serif; }
.gm-ly__hitem small { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.gm-ly__hitem p { grid-column: 1; margin: 0; color: var(--muted); font-size: 12.5px; }
.gm-ly .gm-ly__hload, .gm-ly .gm-ly__hdel { padding: 5px 12px; font-size: 12px; }
.gm-ly .gm-ly__hdel { background: none; color: var(--muted); border-color: var(--line); }
.gm-ly__hempty { color: var(--muted); font-size: 13px; }

/* 方法 / 依据 / 页脚 */
.gm-ly__method, .gm-ly__evidence { margin-top: 52px; }
.gm-ly__method h2, .gm-ly__evidence h2 { margin: 4px 0 8px; font: 500 26px/1.2 "Songti SC", serif; }
.gm-ly__evidence header span { display: block; max-width: 760px; margin-bottom: 18px; color: var(--muted); font-size: 12.5px; line-height: 1.8; }
.gm-ly__msteps, .gm-ly__sources { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); margin-top: 16px; }
.gm-ly__msteps article, .gm-ly__sources article {
	padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper);
}
.gm-ly__msteps em, .gm-ly__sources em { color: var(--gold); font-style: normal; font-size: 11px; letter-spacing: .12em; }
.gm-ly__msteps h3, .gm-ly__sources h3 { margin: 8px 0 8px; font-size: 16px; }
.gm-ly__msteps p, .gm-ly__sources p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.85; }
.gm-ly__sources a { display: inline-block; margin-top: 10px; color: var(--gold); font-size: 12px; text-decoration: none; }
.gm-ly__sources a:hover { text-decoration: underline; }
.gm-ly__caveat { margin-top: 22px; padding: 22px; border: 1px solid var(--gold); border-radius: 18px; background: var(--wash); }
.gm-ly__caveat h3 { margin: 0 0 12px; font-size: 17px; }
.gm-ly__caveat p { margin: 0 0 12px; font-size: 13px; line-height: 1.95; }
.gm-ly__caveat p:last-child { margin-bottom: 0; }
.gm-ly__caveat strong { color: var(--gold); }
.gm-ly__footnote { margin-top: 46px; padding-top: 22px; border-top: 1px solid var(--line); }
.gm-ly__footnote p { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.9; }

@media (max-width: 820px) {
	.gm-ly { padding: 36px 16px 70px; }
	.gm-ly__panel { padding: 20px; }
	.gm-ly__opts { grid-template-columns: 1fr; }
	.gm-ly__track { grid-template-columns: repeat(2, 1fr); }
	.gm-ly__figs { gap: 18px; }
	.gm-ly__arrow { flex: 1 1 100%; }
	.gm-ly__arrow i { transform: rotate(90deg); }
	.gm-ly__mrow { grid-template-columns: 60px auto; }
	.gm-ly__mnum { grid-column: 2; }
}
