/* 第八轮：统一两套视觉（ui7 N-P1-3 / N-P1-4 / N-P2-4）。最后加载，只改外观。
   底色阶梯“越重要越深一档”：L0 页底 · L1 区块底带 · L2 卡片 · L3 选中/强调；输入框是唯一比页底亮的面。
   圆角：按钮 8px，卡片和盒子 12px，标签 999px，表格 0。 */
:root{--l0:#F3F2EF;--l1:#ECEAE5;--l2:#E5E2DA;--l3:#DCD7CC;--lin:#FAF9F6;--r-btn:8px;--r-card:12px;--acc-bar:#C24A2C}
:is(html[data-theme=night],html[data-tone=dark]){--l0:#121114;--l1:#19181C;--l2:#201F24;--l3:#29272E;--lin:#0D0C0F;
 --ui-bg:#121114;--ui-surface:#201F24;--ui-surface-2:#19181C;--ui-callout:#19181C;--ui-hero:#19181C;--ui-header-bg:#121114;--paper:#121114;--fc-nav-bg:#121114;
 --ui-btn-ink:#121114;--ui-sel-ink:#121114;--ui-logo-ink:#121114}
html:not([data-theme=night]):not([data-tone=dark]){--ui-surface:#E5E2DA;--ui-surface-2:#ECEAE5;--ui-callout:#ECEAE5;--ui-hero:#ECEAE5}
:is(html[data-theme=night],html[data-tone=dark]) body{background-color:#121114!important}
/* 拟物层的变量全部换成平涂：云纹、渐变卡、内凹槽、浮起阴影、颗粒 */
html[data-tone][data-tone],html[data-tone=dark][data-tone=dark],html[data-theme][data-theme]{--dp-clouds:linear-gradient(transparent,transparent);--dp-card:linear-gradient(var(--l2),var(--l2));--dp-up:none;--dp-up-hi:none;--dp-in:none;--dp-in-deep:none;--dp-groove:linear-gradient(var(--l2),var(--l2));--dp-grain:none}

/* 1. app 页的区块（L1）与卡片（L2）：去掉渐变、内凹阴影、双线，圆角 12 */
html[data-tone] body main :is(section.overview-block,.analysis-settings,.consult-start,section.rp-section,.fb-rate,.jy-sec,.sky-overview,.ziwei-pattern-overview,.zw-track,.ziwei-chart-scroll,.tz-board-wrap,.dock-grid){
 background-color:var(--l1)!important;background-image:none!important;box-shadow:none!important;border-color:transparent!important;border-radius:var(--r-card)!important}
html[data-tone] body main :is(.rp-glance,#rp-ten,.rp-ten-match,.practice-main-item,.rp-g-cards>li,.dock-col,.digest-row,.rp-element-item,details.rp-basis,details.item-evidence,summary.u044-q,.ziwei-chart,.ziwei-chart article,.fx-life,.ziwei-center,.ziwei-palace-reading,.sky-fragment,.jy-ovi,.jy-topic,.jy-s4c,.tz-board,.ziwei-chart-toolbar,.ziwei-scope){
 background-color:var(--l2)!important;background-image:none!important;box-shadow:none!important;border-color:transparent!important;border-radius:var(--r-card)!important}
/* 卡片嵌在卡片里时再深一档，选中项用 L3 */
html[data-tone] body main :is(.rp-glance,#rp-ten,.ziwei-chart) :is(.rp-ten-match,.rp-ten-item,article,details){background-color:var(--l3)!important}
html[data-tone] body main :is(.rp-ten-item,.dock-col,.digest-row){background-image:none!important;box-shadow:none!important;border-radius:var(--r-btn)!important}
html[data-tone] body main :is(.rp-ten-item,.dock-col,.digest-row):is([aria-selected=true],[aria-pressed=true],.is-active,.is-moving,.on){background-color:var(--l3)!important}
/* 工具页首屏的大块：平涂 L1 */
html[data-tone] body main :is(.fx-mh,.fx-look,#jy-hero){background-image:none!important;box-shadow:none!important;border-radius:0!important}
/* 紫微、经典塔罗首屏是深色卡（文字为浅色）：去渐变后保留实色深底，否则白天文字看不见 */
html[data-tone] body main :is(#fx-zw-hero,#fx-tz-hero){background-color:#201F24!important;border-radius:var(--r-card,12px)!important}
html[data-tone] body main :is(#fx-zw-hero,#fx-tz-hero) .fc-xk,html[data-tone] body main :is(#fx-zw-hero,#fx-tz-hero) .fc-xk a{color:#E8DFC8!important}
/* 2. 角落里的 CSS 云、月亮和装饰圆 */
html[data-tone] body :is(.fx-mh,.fx-look,#jy-hero,.fx-hero)::before,
html[data-tone] body :is(.fx-mh,.fx-look)::after,
html[data-tone] body main :is(.practice-main-item,.dock-col,.meihua-heading,.tz-head,.ziwei-center,.ziwei-pattern-overview,.ziwei-chart article,.sky-fragment,.jy-s4c,.jy-ovi)::before,
html[data-tone] body main :is(.practice-main-item,.dock-col,.meihua-heading,.tz-head,.ziwei-center,.ziwei-pattern-overview,.ziwei-chart article,.sky-fragment,.jy-s4c,.jy-ovi)::after{content:none!important;display:none!important}
/* 3. 按钮统一 8px；标签（chip）保留 999px */
html:root body :is(button,a):is(.btn,.dp-btn,.tz-btn,.hp-btn,.meihua-primary,.submit-button,.fb-more,.system-link,.reference-cross-link,.icon-button,.key-time-row,#dock-expand,#edit-birth,#astro-outline-open),
html body :is(.ha,.xt-hero,.xt-cta-line,.kb-cta,.y404page) :is(a,button).btn,html body .kb-cta a,html body .xt-cta-line a.btn{border-radius:var(--r-btn)!important}
html[data-tone] body :is(.relation-chip,.pattern-chip,.hp-chip){border-radius:999px!important}
html[data-tone] body main :is(.meihua-primary,.hp-btn-primary,#tz-go){background-image:none!important;box-shadow:none!important}
/* 4. 橙色渐变强调卡 → L3 底 + 左侧 4px 色条 */
html[data-tone] body main :is(.overview-all-now,.consult-start){background-color:var(--l3)!important;border-left:4px solid var(--acc-bar)!important}
/* 5. 输入框：唯一比页底亮的面，去掉内凹 */
html[data-tone] body main :is(input:not([type=radio]):not([type=checkbox]):not([type=range]),textarea){background-color:var(--lin)!important;background-image:none!important;box-shadow:none!important}
html[data-tone] body main select{background-color:var(--lin)!important;box-shadow:none!important}
/* 6. 间距步长 8/16/24/40/64/96：卡片内边距桌面 24 手机 16，卡片间距 16 */
html[data-tone] body main :is(section.overview-block,section.rp-section,.jy-sec,.sky-overview){padding:24px!important}
html[data-tone] body main :is(section.overview-block,section.rp-section,.jy-sec,.sky-overview)+:is(section.overview-block,section.rp-section,.jy-sec,.sky-overview){margin-top:16px!important}
@media (max-width:760px){html[data-tone] body main :is(section.overview-block,section.rp-section,.jy-sec,.sky-overview){padding:16px!important}}
/* 7. 知识库、404 的盒子也用 12px 圆角和同一套底色 */
html body :is(.kb-quick,.kb-data,.kb-cta,.xt-grid>a){border-radius:var(--r-card)!important}
html body .kb-data{background:var(--l3)!important;border-left:0!important}
html body .xt-grid>a{background:var(--l2)!important}
/* 十神选择卡：去掉描边和金色渐变，选中用 L3 */
html[data-tone] body main .rp-ten-item{border:0!important;background-color:var(--l2)!important;background-image:none!important}
html[data-tone] body main .rp-ten-item:is([aria-selected=true],[aria-pressed=true],.is-active,.on){background-color:var(--l3)!important;color:inherit!important}
html[data-tone] body main .rp-ten-item:is([aria-selected=true],[aria-pressed=true],.is-active,.on) *{color:inherit!important}
/* 8. 1440 下内容左缘：首页 hero 与导航首项、知识库对齐（容器 1052 居中） */
@media (min-width:1280px){html:root{--rail:max(24px,calc((100vw - 1052px)/2))}}

/* 分段切换（起卦方式、合盘分页、塔罗方式等）：圆角 8，选中项平涂 L3，不用金色渐变胶囊 */
html:root body main :is(.meihua-segment,.tz-seg,.ox-tabs,.seg-pill,.segmented,.topic-chips,.timing-views,.consult-topic-tabs,.ziwei-scope,.ziwei-chart-toolbar,.meihua-moving){border-radius:var(--r-btn)!important;background:var(--l2)!important;box-shadow:none!important}
html:root body main :is(.meihua-segment,.tz-seg,.ox-tabs,.seg-pill,.segmented,.topic-chips,.timing-views,.consult-topic-tabs,.ziwei-scope,.ziwei-chart-toolbar)::before{border-radius:6px!important;background-image:none!important;background-color:var(--ui-sel-bg,#292919)!important;box-shadow:none!important}
html:root body main :is(.meihua-segment,.meihua-moving) label>span,html:root body main :is(.tz-seg,.ox-tabs,.seg-pill,.segmented,.topic-chips,.timing-views,.consult-topic-tabs,.ziwei-scope,.ziwei-chart-toolbar) :is(button,a){border-radius:6px!important;background-image:none!important;box-shadow:none!important}
html:root body main :is(.meihua-segment,.meihua-moving) input:checked+span,html:root body main :is(.tz-seg,.ox-tabs,.seg-pill,.segmented,.topic-chips,.timing-views,.consult-topic-tabs,.ziwei-scope,.ziwei-chart-toolbar) :is(button,a):is([aria-pressed=true],[aria-selected=true],[aria-current],.on,.active,.is-active){background-image:none!important;box-shadow:none!important;font-weight:650}
html:root body main .meihua-workbench .meihua-segment.meihua-segment.meihua-segment input:checked+span,html:root body main .meihua-workbench .meihua-moving.meihua-moving input:checked+span{background-image:none!important;background-color:#C9A24B!important;color:#211A10!important;box-shadow:none!important;border-radius:6px!important}
/* 分段切换不再用滑块（伪元素位置常和标签错开），选中项直接画实色 */
html:root body main :is(.tz-seg,.ox-tabs,.seg-pill,.segmented,.topic-chips,.timing-views,.consult-topic-tabs,.ziwei-scope,.ziwei-chart-toolbar).seg-slide::before,html:root body main :is(.tz-seg,.ox-tabs,.seg-pill,.segmented,.topic-chips,.timing-views,.consult-topic-tabs,.ziwei-scope,.ziwei-chart-toolbar).seg-slide::after{display:none!important}
html:root body main :is(.tz-seg.tz-seg,.ox-tabs.ox-tabs,.seg-pill.seg-pill,.segmented.segmented,.topic-chips.topic-chips,.timing-views.timing-views,.consult-topic-tabs.consult-topic-tabs,.ziwei-scope.ziwei-scope,.ziwei-chart-toolbar.ziwei-chart-toolbar) :is(button,a):is([aria-pressed=true],[aria-selected=true],[aria-current=true],[aria-current=page],.on,.active,.is-active){background-color:var(--ui-sel-bg,#292919)!important;color:var(--ui-sel-ink,#F3F2EF)!important}
/* 底栏激活项：日间文字 #7A5A1E（约 5.6:1），上方 2px 指示条 #C9A24B；夜间保持浅金 */
html:root body nav:is(.mnav,.fx-mnav,.xt-mnav)>:is(a,button):is(.on,[aria-current]){color:#7A5A1E!important;box-shadow:inset 0 2px 0 #C9A24B!important}
:is(html[data-theme=night],html[data-tone=dark]):root body nav:is(.mnav,.fx-mnav,.xt-mnav)>:is(a,button):is(.on,[aria-current]){color:#E0C27A!important;box-shadow:inset 0 2px 0 #C9A24B!important}
/* 英文底栏：Divination 太挤——英文不加字距、按字宽分配，最长一项多给一点 */
html[lang^=en]:root body nav:is(.mnav,.fx-mnav,.xt-mnav)>:is(a,button){letter-spacing:0!important;font-size:12px!important;flex:1 1 auto!important;min-width:0!important;padding:0 4px!important;white-space:nowrap}
html[lang^=en]:root body nav:is(.mnav,.fx-mnav,.xt-mnav){gap:4px;padding:0 8px!important}
/* 年度推命表（ui7/pm7 P2-7）：1280 宽下“大运/流年/长生”被挤成竖排单字。前 16 列不换行，证据列给最小宽度，放不下就在表格框里横向滚动 */
@media (min-width:900px){
 html:root body .fortune-table-panel .table-wrap{overflow-x:auto}
 html:root body .fortune-table-panel .table-wrap table{min-width:1040px!important;font-size:14px}
 html:root body .fortune-table-panel .table-wrap :is(th,td):not(:last-child){white-space:nowrap}
 html:root body .fortune-table-panel .table-wrap :is(th,td):last-child{min-width:280px}
}
/* 15 对比度：浅色下金色小字加深到 4.5:1 以上 */
html[data-tone=light] body .yhome .tx b{color:#7A5A1E}
@media (prefers-color-scheme:light){html:not([data-tone]) body .yhome .tx b{color:#7A5A1E}}
html[data-theme]:not([data-tone=dark]) body .mnav a.on,html[data-theme]:not([data-tone=dark]) body .mnav a[aria-current=page]{color:#7A5A1E!important}
html body .fc-xk .fc-xk-l{opacity:.8}

html[data-tone=light] body .ynote .tx b{color:#7A5A1E}
@media (prefers-color-scheme:light){html:not([data-tone]) body .ynote .tx b{color:#7A5A1E}}

/* v61 对比度：浅色下按日主五行着色的小字/链接（含「细看」）加深到 4.5:1 以上；色相不变 */
html[data-tone=light][data-fx-el="木"]{--fx-acc:#316240}
html[data-tone=light][data-fx-el="火"]{--fx-acc:#983924}
html[data-tone=light][data-fx-el="土"]{--fx-acc:#6C531B}
html[data-tone=light][data-fx-el="金"]{--fx-acc:#55585C}
html[data-tone=light] body main .rp-section .rp-term{color:#59584C!important;opacity:1}
html[data-tone=light] body :is(#overview-title,.rp-ten-reading-head){--ui-wood:#316240;--ui-fire:#983924;--ui-earth:#6C531B;--ui-metal:#55585C}
/* v61 紫微格局标签、栏目小标题、格局按钮 */
html[data-tone=light] body .ziwei-panel :is(.zw-kick,.compact-head .panel-label){color:#665636!important}
html[data-tone=light] body .ziwei-panel .zw-kick::before,html[data-tone=light] body .ziwei-panel .compact-head .panel-label::before{background:#665636}
html[data-tone=light] body .ziwei-panel .pattern-chip{color:#655636!important}
/* v61 塔罗牌阵位置说明、场景卡说明 */
html[data-tone]:not([data-tone=dark]) body .tz-cap .tz-cap-pos{color:#72521A!important}
html[data-tone=light] body .tz-scene>span,html[data-tone=light] body .tz-scene>span em{color:#595948}
/* v61 梅花夜间「按当下时间起卦」：去掉渐变后底色透明、字看不见，补回实底 */
html[data-tone=dark] body main :is(#meihua-now,#meihua-form .meihua-primary){background:none!important;background-color:#EFE6CF!important;border-color:#EFE6CF!important;color:#16131C!important}
/* v61 紫微盘浅色：命宫格与盘心原是深色卡（浅色字），扁平化后底色被换成浅色，字看不清；补回深色底 */
html[data-tone]:not([data-tone=dark]) body main .ziwei-panel :is(#ziwei-chart>article.fx-life,#ziwei-center){background-color:#201F24!important}
