/* align.css — 全站视觉对齐（visual-align）。每个页面最后加载，只管边距、对齐、图标和细微的视觉重心，不改文字和配色。
   一条主轴：内容宽 1052px，居中；两侧留白桌面 24px、手机 16px。顶栏、正文、页脚都贴同一条线。
   工具页（塔罗/梅花/合盘）用 1200px 的工作台宽，标题和下面的面板左边对齐。 */
:root{--fc-rail:1052px;--fc-tool:1200px;--fc-gutter:24px;--fc-edge:max(var(--fc-gutter),calc((100% - var(--fc-rail)) / 2));--fc-ico-c:#9A7428}
:is(html[data-theme=night],html[data-tone=dark]):root{--fc-ico-c:#D4B062}
@media (max-width:760px){:root{--fc-gutter:16px}}
@media (min-width:761px){html:root{--rail:max(24px,calc((100vw - 1052px) / 2))}}

/* 1. 顶栏和页脚贴主轴（首页、知识库、文章、英文页、404） */
html:root body header.top{padding-left:var(--fc-edge)!important;padding-right:var(--fc-edge)!important}
html:root body footer.foot{padding-left:var(--fc-edge)!important;padding-right:var(--fc-edge)!important}
/* 首页：左右留白一致（原来左 194 右 24），首屏人物条照旧伸到右边 */
@media (min-width:761px){
  html:root body .home-main>.wrap{padding-right:var(--rail)!important}
  html:root body .home-main>.wrap>section.ha{margin-right:calc(24px - var(--rail))!important}
  html[data-theme] body .home-main>.wrap>section.ch:last-child{padding-right:var(--rail)!important}
}

/* 2. 排盘工作台顶栏：左右各 24px，和左侧命盘库同一条线 */
@media (min-width:761px){
  html:root body .app-header.site-header{padding-left:24px!important;padding-right:24px!important}
  html:root body.site-workspace .record-library-content{padding-left:24px!important;padding-right:24px!important}
}
@media (max-width:760px){
  html:root body .app-header.site-header{padding-left:16px!important;padding-right:16px!important}
}

/* 3. 塔罗、梅花、合盘：页面标题、说明和工作台同宽同左边 */
@media (min-width:761px){
  html:root body.site-workspace:is([data-active-screen=tarot],[data-active-screen=meihua],[data-active-screen=hepan]) main#main-content.shell{width:100%!important;max-width:calc(var(--fc-tool) + 2 * var(--fc-gutter))!important;margin-left:auto!important;margin-right:auto!important;padding-left:var(--fc-gutter)!important;padding-right:var(--fc-gutter)!important}
  html:root body.site-workspace:is([data-active-screen=tarot],[data-active-screen=meihua],[data-active-screen=hepan]) main#main-content.shell>:is(.xt-band,#xt-tz-keep,.screen){max-width:var(--fc-tool)!important;margin-left:auto!important;margin-right:auto!important;padding-left:0!important;padding-right:0!important}
  html:root body.site-workspace:is([data-active-screen=tarot],[data-active-screen=meihua],[data-active-screen=hepan]) main#main-content.shell>:is(#xt-tz-keep,.screen)>:is(header,section){margin-left:0!important;margin-right:0!important;max-width:none!important}
}
/* 八字等带命盘库的页面：示例条和标题左边对齐 */
html:root body .xt-mini{margin-left:var(--fc-band-in,25px)!important;margin-right:auto!important}
@media (max-width:760px){html:root body .xt-mini{margin-left:0!important;margin-right:0!important}}

/* 4. 排版细节：标题均衡断行，正文避免末行孤字，数字等宽，手机输入框不小于 16px（避免点开时页面被放大） */
html:root body main :is(h1,h2,h3):not(.fx-h):not(.huge){text-wrap:balance}
html:root body main :is(p,li,dd,summary){text-wrap:pretty}
html:root body main :is(table,time,.xt-sample){font-variant-numeric:tabular-nums}
@media (max-width:760px){html:root body :is(input:not([type=radio]):not([type=checkbox]):not([type=range]),select,textarea){font-size:max(16px,1em)!important}}

/* 图标形状（24 格线条图标） */
:root{
  --fc-i-home: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3.5l9 7'/%3E%3Cpath d='M5 9.5V20h14V9.5'/%3E%3Cpath d='M9.5 20v-5.5h5V20'/%3E%3C/svg%3E");
  --fc-i-bazi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='2.5' height='15.5' rx='1.25'/%3E%3Crect x='8.5' y='4' width='2.5' height='15.5' rx='1.25'/%3E%3Crect x='13' y='4' width='2.5' height='15.5' rx='1.25'/%3E%3Crect x='17.5' y='4' width='2.5' height='15.5' rx='1.25'/%3E%3Cpath d='M3 20h18'/%3E%3C/svg%3E");
  --fc-i-ziwei: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11.40 3.90L13.69 9.74L19.96 10.12L15.11 14.11L16.69 20.18L11.40 16.80L6.11 20.18L7.69 14.11L2.84 10.12L9.11 9.74z'/%3E%3Ccircle cx='20.2' cy='4' r='1' fill='black' stroke='none'/%3E%3C/svg%3E");
  --fc-i-western: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Cpath d='M21 12h-4M16.5 19.8l-2-3.5M7.5 19.8l2-3.5M3 12h4M7.5 4.2l2 3.5M16.5 4.2l-2 3.5'/%3E%3C/svg%3E");
  --fc-i-jyotish: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='1'/%3E%3Cpath d='M3 3l18 18M21 3L3 21M12 3l9 9-9 9-9-9z'/%3E%3C/svg%3E");
  --fc-i-meihua: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12.00' cy='7.20' r='3.5'/%3E%3Ccircle cx='16.95' cy='10.79' r='3.5'/%3E%3Ccircle cx='15.06' cy='16.61' r='3.5'/%3E%3Ccircle cx='8.94' cy='16.61' r='3.5'/%3E%3Ccircle cx='7.05' cy='10.79' r='3.5'/%3E%3Ccircle cx='12' cy='12.4' r='1.3'/%3E%3C/svg%3E");
  --fc-i-tarot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8.2 6.2l-2.9.7a1.4 1.4 0 0 0-1 1.7l2.8 11.5a1.4 1.4 0 0 0 1.7 1l2.2-.5'/%3E%3Crect x='9' y='2.8' width='10.5' height='17' rx='1.6'/%3E%3Cpath d='M14.25 8.6l.85 1.95 1.95.85-1.95.85-.85 1.95-.85-1.95-1.95-.85 1.95-.85z'/%3E%3C/svg%3E");
  --fc-i-hepan: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8.6' cy='12' r='6.4'/%3E%3Ccircle cx='15.4' cy='12' r='6.4'/%3E%3C/svg%3E");
  --fc-i-learn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 6.5C10 4.8 7.2 4.5 4 4.5v14c3.2 0 6 .3 8 2'/%3E%3Cpath d='M12 6.5c2-1.7 4.8-2 8-2v14c-3.2 0-6 .3-8 2'/%3E%3Cpath d='M12 6.5v14'/%3E%3C/svg%3E");
  --fc-i-mine: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M4.5 20c.7-3.9 3.8-6 7.5-6s6.8 2.1 7.5 6'/%3E%3C/svg%3E");
  --fc-i-chart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Cpath d='M9 3v18M15 3v18M3 9h18M3 15h18'/%3E%3C/svg%3E");
  --fc-i-calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 9h18M8 3v4M16 3v4'/%3E%3Ccircle cx='9' cy='14' r='1' fill='black' stroke='none'/%3E%3C/svg%3E");
  --fc-i-zodiac: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='1.3'/%3E%3Cpath d='M20.4 12 18.9 12M19.27 16.2 17.98 15.45M16.2 19.27 15.45 17.98M12 20.4 12 18.9M7.8 19.27 8.55 17.98M4.73 16.2 6.02 15.45M3.6 12 5.1 12M4.73 7.8 6.02 8.55M7.8 4.73 8.55 6.02M12 3.6 12 5.1M16.2 4.73 15.45 6.02M19.27 7.8 17.98 8.55'/%3E%3C/svg%3E");
  --fc-i-lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='10' width='14' height='10' rx='2'/%3E%3Cpath d='M8 10V7.5a4 4 0 0 1 8 0V10'/%3E%3Ccircle cx='12' cy='14.5' r='1' fill='black' stroke='none'/%3E%3Cpath d='M12 15.5V18'/%3E%3C/svg%3E");
  --fc-i-suanming: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='6'/%3E%3Cpath d='M12 6.5l1.3 5.5-1.3 5.5-1.3-5.5z'/%3E%3Ccircle cx='12' cy='12' r='.8' fill='black' stroke='none'/%3E%3C/svg%3E");
  --fc-i-zhanbu: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='6.9' r='4.6'/%3E%3Crect x='10.9' y='5.800000000000001' width='2.2' height='2.2'/%3E%3Ccircle cx='7.4' cy='15.6' r='4.6'/%3E%3Crect x='6.300000000000001' y='14.5' width='2.2' height='2.2'/%3E%3Ccircle cx='16.6' cy='15.6' r='4.6'/%3E%3Crect x='15.500000000000002' y='14.5' width='2.2' height='2.2'/%3E%3C/svg%3E");
  --fc-i-moon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9z'/%3E%3Cpath d='M18.5 3.2l.7 1.6 1.6.7-1.6.7-.7 1.6-.7-1.6-1.6-.7 1.6-.7z'/%3E%3C/svg%3E");
  --fc-i-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12h18M15 6l6 6-6 6'/%3E%3C/svg%3E");
}

/* 5. 图标：同一套线条图标（24 格、1.5 线宽），颜色跟文字或金色走 */
.fc-ico{display:inline-block;width:1em;height:1em;vertical-align:-.125em;background:currentColor;-webkit-mask:var(--fc-i) center/contain no-repeat;mask:var(--fc-i) center/contain no-repeat;flex:none}
.fc-ico-lock{--fc-i:var(--fc-i-lock);margin-right:.35em;opacity:.85}
/* 手机底部导航：图标在上，文字在下 */
@media (max-width:760px){
  html:root body nav:is(.mnav,.fx-mnav,.xt-mnav)>:is(a,button){flex-direction:column!important;gap:4px!important;line-height:1!important}
  html:root body nav:is(.mnav,.fx-mnav,.xt-mnav)>:is(a,button)::before{content:""!important;display:block!important;position:static!important;width:20px!important;height:20px!important;margin:0!important;background:currentColor!important;opacity:.9;-webkit-mask:var(--fc-i) center/contain no-repeat;mask:var(--fc-i) center/contain no-repeat;border:0!important;transform:none!important}
  html:root body nav:is(.mnav,.fx-mnav,.xt-mnav)>:nth-child(1){--fc-i:var(--fc-i-home)}
  html:root body nav:is(.mnav,.fx-mnav,.xt-mnav)>:nth-child(2){--fc-i:var(--fc-i-suanming)}
  html:root body nav:is(.mnav,.fx-mnav,.xt-mnav)>:nth-child(3){--fc-i:var(--fc-i-zhanbu)}
  html:root body nav:is(.mnav,.fx-mnav,.xt-mnav)>:nth-child(4){--fc-i:var(--fc-i-learn)}
  html:root body nav:is(.mnav,.fx-mnav,.xt-mnav)>:nth-child(5){--fc-i:var(--fc-i-mine)}
}
/* 栏目卡片：右上角一个小图标，不挤占文字那一列 */
html:root body :is(.xt-grid,.kb-grid)>a{position:relative}
html:root body :is(.xt-grid,.kb-grid)>a>b{padding-right:30px}
html:root body :is(.xt-grid,.kb-grid)>a:is([href$="/bazi"],[href$="/learn/bazi"],[href$="/bazi/app"]){--fc-i:var(--fc-i-bazi)}
html:root body :is(.xt-grid,.kb-grid)>a:is([href$="/ziwei"],[href$="/learn/ziwei"],[href$="/ziwei/app"]){--fc-i:var(--fc-i-ziwei)}
html:root body :is(.xt-grid,.kb-grid)>a:is([href$="/western"],[href$="/learn/western"],[href$="/astrology"],[href$="/western/app"]){--fc-i:var(--fc-i-western)}
html:root body :is(.xt-grid,.kb-grid)>a:is([href$="/jyotish"],[href$="/learn/jyotish"],[href$="/jyotish/app"]){--fc-i:var(--fc-i-jyotish)}
html:root body :is(.xt-grid,.kb-grid)>a:is([href$="/meihua"],[href$="/learn/meihua"],[href$="/meihua/app"]){--fc-i:var(--fc-i-meihua)}
html:root body :is(.xt-grid,.kb-grid)>a:is([href$="/tarot"],[href$="/learn/tarot"],[href$="/tarot/app"]){--fc-i:var(--fc-i-tarot)}
html:root body :is(.xt-grid,.kb-grid)>a:is([href$="/hepan"],[href$="/learn/hepan"],[href$="/hepan/app"]){--fc-i:var(--fc-i-hepan)}
html:root body :is(.xt-grid,.kb-grid)>a:is([href$="/learn"]){--fc-i:var(--fc-i-learn)}
html:root body :is(.xt-grid,.kb-grid)>a:is([href$="/rizhu"]){--fc-i:var(--fc-i-bazi)}
html:root body :is(.xt-grid,.kb-grid)>a:is([href$="/suanming"]){--fc-i:var(--fc-i-suanming)}
html:root body :is(.xt-grid,.kb-grid)>a:is([href$="/zhanbu"]){--fc-i:var(--fc-i-zhanbu)}
html:root body :is(.xt-grid,.kb-grid)>a:is([href*="shengxiao"],[href*="zodiac"]){--fc-i:var(--fc-i-zodiac)}
html:root body :is(.xt-grid,.kb-grid)>a:is([href*="/sucha"],[href*="cheat"]){--fc-i:var(--fc-i-chart)}
html:root body :is(.xt-grid,.kb-grid)>a:is([href*="2027"]){--fc-i:var(--fc-i-calendar)}
html:root body :is(.xt-grid,.kb-grid)>a:is([href*="shuini"],[href*="jinni"],[href*="retrograde"],[href*="season"],[href*="jieqi"]){--fc-i:var(--fc-i-moon)}
html:root body :is(.xt-grid,.kb-grid)>a:is([href$="/bazi"],[href$="/learn/bazi"],[href$="/ziwei"],[href$="/learn/ziwei"],[href$="/western"],[href$="/learn/western"],[href$="/astrology"],[href$="/jyotish"],[href$="/learn/jyotish"],[href$="/meihua"],[href$="/learn/meihua"],[href$="/tarot"],[href$="/learn/tarot"],[href$="/hepan"],[href$="/learn/hepan"],[href$="/learn"],[href$="/rizhu"],[href*="shengxiao"],[href*="zodiac"],[href*="/sucha"],[href*="cheat"],[href*="2027"],[href*="shuini"],[href*="jinni"],[href*="retrograde"],[href*="season"],[href*="jieqi"],[href$="/bazi/app"],[href$="/ziwei/app"],[href$="/western/app"],[href$="/jyotish/app"],[href$="/meihua/app"],[href$="/tarot/app"],[href$="/hepan/app"],[href$="/suanming"],[href$="/zhanbu"])::before{content:""!important;display:block!important;position:absolute!important;top:18px;right:18px;width:22px;height:22px;background:var(--fc-ico-c)!important;opacity:.9;-webkit-mask:var(--fc-i) center/contain no-repeat;mask:var(--fc-i) center/contain no-repeat;pointer-events:none}
@media (max-width:760px){html:root body :is(.xt-grid,.kb-grid)>a::before{top:14px!important;right:14px!important;width:20px!important;height:20px!important}html:root body :is(.xt-grid,.kb-grid)>a>b{padding-right:28px}}
