/* SOLAR-253 首页三块横排：左边开场动画，中间排盘，右边太阳系。三块都是同一款方框（细边、四角金弧），等高。
 * 天体数据不占首页：太阳系下面一个小按钮，点了才弹出。颜色全部引用全站变量。 */
/* 太阳系的方框：边线与四角金弧的写法同全站通用面板（fz_theme.css 第 1 节）；底色是深空的径向渐变，和左边动画那块成一对 */
.fz-solar { position: relative; min-width: 0; color: var(--fz-text); display: flex; flex-direction: column; justify-content: center;
    padding: 16px 18px 20px; overflow: hidden; border: 1px solid var(--fz-glass-border); border-radius: var(--fz-radius-lg);
    background: radial-gradient(120% 90% at 50% 40%, rgba(var(--fz-surface-rgb), .92) 0%, rgba(var(--fz-bg-rgb), .94) 50%, rgba(var(--fz-scrim-rgb), .96) 100%);
    box-shadow: var(--fz-glass-edge), var(--fz-shadow-2); }
.fz-solar::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3; border: 1px solid var(--fz-line-gold);
    -webkit-mask: linear-gradient(#000 0 0) left top / 18px 18px no-repeat, linear-gradient(#000 0 0) right top / 18px 18px no-repeat, linear-gradient(#000 0 0) left bottom / 18px 18px no-repeat, linear-gradient(#000 0 0) right bottom / 18px 18px no-repeat;
    mask: linear-gradient(#000 0 0) left top / 18px 18px no-repeat, linear-gradient(#000 0 0) right top / 18px 18px no-repeat, linear-gradient(#000 0 0) left bottom / 18px 18px no-repeat, linear-gradient(#000 0 0) right bottom / 18px 18px no-repeat; }
.fz-solar-stage { position: relative; width: 100%; aspect-ratio: 1 / 0.96; max-height: 490px; pointer-events: none; }
.fz-solar-canvas { position: absolute; left: -18px; top: -14px; width: calc(100% + 36px); height: calc(100% + 28px); display: block; }

/* 时间与流速：在太阳系下面，居中，不加底板 */
.fz-solar-hud { position: relative; z-index: 2; display: grid; justify-items: center; gap: 4px; margin-top: 2px; text-align: center; }
.fz-solar-time b { font-family: var(--fz-font-serif); font-size: 20px; font-weight: 500; letter-spacing: .06em; color: var(--fz-text-strong); font-variant-numeric: tabular-nums; }
.fz-solar-time span { margin-left: 8px; font-size: 11px; color: var(--fz-text-3); }
.fz-solar-sub { font-size: 12.5px; letter-spacing: .05em; color: var(--fz-gold); font-variant-numeric: tabular-nums; }
.fz-solar-follow { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--fz-cyan); }
.fz-solar-follow[hidden] { display: none; }
.fz-solar-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px; margin-top: 6px; }
.fz-solar-per { margin-right: 2px; font-size: 11px; color: var(--fz-text-3); }
.fz-solar-chip { height: 24px; padding: 0 10px; border: 1px solid var(--fz-line); border-radius: var(--fz-radius-pill); background: rgba(var(--fz-surface-rgb), .38); color: var(--fz-text-2); font-size: 12px; line-height: 22px; cursor: pointer; transition: color var(--fz-motion-fast), border-color var(--fz-motion-fast), background var(--fz-motion-fast); }
.fz-solar-chip:hover { border-color: var(--fz-line-gold-soft); color: var(--fz-text-strong); }
.fz-solar-chip.is-active { border-color: var(--fz-line-gold); background: var(--fz-warm-2); color: var(--fz-gold-bright); }
.fz-solar-icon { position: relative; width: 28px; height: 24px; margin-left: 3px; border: 1px solid var(--fz-line); border-radius: var(--fz-radius-pill); background: rgba(var(--fz-surface-rgb), .38); cursor: pointer; }
.fz-solar-icon::before, .fz-solar-icon::after { content: ''; position: absolute; top: 7px; width: 3px; height: 9px; background: var(--fz-text-2); border-radius: 1px; }
.fz-solar-icon::before { left: 9px; }
.fz-solar-icon::after { right: 9px; }
.fz-solar-icon.is-paused::before { left: 10px; top: 6px; width: 0; height: 0; background: none; border-radius: 0; border-style: solid; border-width: 5.5px 0 5.5px 9px; border-color: transparent transparent transparent var(--fz-gold-bright); }
.fz-solar-icon.is-paused::after { display: none; }
/* 第二行：两个文字按钮——回到现在、天体数据（小三角，点了弹出） */
.fz-solar-links { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 6px; }
.fz-solar-link { padding: 2px 0; border: 0; background: none; color: var(--fz-text-2); font-size: 12px; letter-spacing: .04em; cursor: pointer; transition: color var(--fz-motion-fast); }
.fz-solar-link:hover { color: var(--fz-gold-bright); }
.fz-solar-link.is-gold { color: var(--fz-gold); }
.fz-solar-link.is-data::before { content: ''; display: inline-block; margin-right: 6px; border-style: solid; border-width: 4px 0 4px 6px; border-color: transparent transparent transparent currentColor; vertical-align: 1px; }

/* 天体数据弹窗 */
.fz-solar-pop { position: fixed; inset: 0; z-index: 4000; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(var(--fz-scrim-rgb), .66); }
.fz-solar-pop[hidden] { display: none; }
.fz-solar-pop-card { width: min(720px, 100%); max-height: 88vh; overflow: auto; padding: 18px 22px 16px; border: 1px solid var(--fz-line-strong); border-radius: var(--fz-radius-lg); background: var(--fz-surface-1); box-shadow: var(--fz-shadow-3); color: var(--fz-text); animation: fz-solar-pop-in var(--fz-motion) var(--fz-ease-out); }
@keyframes fz-solar-pop-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.fz-solar-pop-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.fz-solar-pop-head b { font-family: var(--fz-font-serif); font-size: 17px; font-weight: 500; letter-spacing: .08em; color: var(--fz-text-strong); }
.fz-solar-pop-head span { font-size: 12px; color: var(--fz-gold); font-variant-numeric: tabular-nums; }
.fz-solar-pop-close { margin-left: auto; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--fz-text-2); font-size: 20px; line-height: 1; cursor: pointer; align-self: center; }
.fz-solar-pop-close:hover { background: var(--fz-warm-2); color: var(--fz-text-strong); }
.fz-solar-data { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fz-solar-data table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.fz-solar-data thead th { padding: 0 10px 7px 0; border-bottom: 1px solid var(--fz-line-gold-soft); color: var(--fz-text-3); font-weight: 400; font-size: 12px; text-align: right; white-space: nowrap; vertical-align: bottom; }
.fz-solar-data thead th small { display: block; font-size: 10px; color: var(--fz-text-faint); }
.fz-solar-data thead th:first-child, .fz-solar-data tbody th { text-align: left; }
.fz-solar-data tbody th { padding: 6px 10px 6px 0; font-weight: 500; color: var(--fz-text); white-space: nowrap; font-family: var(--fz-font-serif); }
.fz-solar-data tbody th i { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; vertical-align: 1px; }
.fz-solar-data tbody td { padding: 6px 10px 6px 0; text-align: right; color: var(--fz-text-2); white-space: nowrap; }
.fz-solar-data tbody tr { border-bottom: 1px solid var(--fz-line-soft); cursor: pointer; transition: background var(--fz-motion-fast); }
.fz-solar-data tbody tr:hover { background: rgba(var(--fz-gold-rgb), .07); }
.fz-solar-data tbody tr.is-ref th { color: var(--fz-gold-bright); }
.fz-solar-data tbody tr[data-key="sun"], .fz-solar-data tbody tr[data-key="moon"] { cursor: default; }
.fz-solar-note { margin: 10px 0 0; font-size: 12px; line-height: 1.7; color: var(--fz-text-3); }
.fz-solar-note button { margin-left: 6px; padding: 0; border: 0; background: none; color: var(--fz-gold); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* 电脑：三块横排 —— 动画 | 排盘 | 太阳系 */
@media (min-width: 1180px) {
    /* 三联画：排盘居中，动画与太阳系在两侧等宽，互为镜像；三块都带方框、拉成一样高（表单变高时两侧跟着高）；排盘整体缩小一档，不压过两边。
       整组在页头与页脚之间上下居中。 */
    #page-home .paipan-section { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(430px, 1.05fr) minmax(280px, 1fr); column-gap: 26px; align-items: stretch;
        margin-top: clamp(0px, calc((100vh - 790px) / 2), 56px); }
    #page-home .fz-sky { display: contents; }
    #page-home .instant-panel.fz-fate-panel { grid-column: 1; grid-row: 1; width: 100%; height: auto; min-height: 600px; }
    #page-home .input-panel { grid-column: 2; grid-row: 1; zoom: 0.86; padding: 26px 30px 28px; }
    #page-home .input-panel > .input-row { margin-bottom: 14px; }
    #page-home .input-panel > .fz-case-history-dock { zoom: 1.163; }   /* 贴在窗口右边的“历史档案”按钮不跟着缩 */
    #page-home .fz-solar { grid-column: 3; grid-row: 1; min-height: 600px; }
    /* 画面占满方框上部，时间与流速贴着方框下沿，和左边动画底部那一行齐平；“已对到所选的出生时刻”浮在日期上方，不挤动画面 */
    #page-home .fz-solar-stage { flex: 1 1 auto; min-height: 0; max-height: none; aspect-ratio: auto; }
    #page-home .fz-solar-follow { position: absolute; left: 0; right: 0; bottom: 100%; justify-content: center; margin-bottom: 2px; }
    /* 中间的排盘整体缩到 0.86，两侧方框的圆角与四角金弧跟着收到同一档，三个框看上去是一套 */
    #page-home .instant-panel.fz-fate-panel, #page-home .fz-solar { border-radius: calc(var(--fz-radius-lg) * 0.86) !important; }
    #page-home .instant-panel.fz-fate-panel::after, #page-home .fz-solar::after { -webkit-mask-size: 15.5px 15.5px; mask-size: 15.5px 15.5px; }
}
/* 三列刚排得下的宽度：流速那一行收紧一点，不折行 */
@media (min-width: 1180px) and (max-width: 1259px) {
    .fz-solar-controls { gap: 4px; }
    .fz-solar-chip { padding: 0 8px; }
    .fz-solar-time b { font-size: 18px; }
}
/* 首页的太阳系自己就是一座星盘：页面右上角那只装饰星盘在首页调暗，免得两套线条叠在一起 */
@media (min-width: 769px) {
    body:has(#page-home.active)::after { opacity: calc(var(--fz-art-ring-opacity) * 0.22); }
}
/* 窄一些的窗口：上面动画与太阳系各占一半、一样高，下面排盘 */
@media (min-width: 769px) and (max-width: 1179px) {
    #page-home .paipan-section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
    #page-home .fz-sky { display: contents; }
    #page-home .instant-panel.fz-fate-panel { grid-column: 1; grid-row: 1; min-height: 440px; height: auto; }
    #page-home .fz-solar { grid-column: 2; grid-row: 1; }
    .fz-solar-stage { max-height: 330px; aspect-ratio: auto; height: 330px; }
    #page-home .input-panel { grid-column: 1 / -1; grid-row: 2; }
}
.fz-solar-settings { display: contents; }
.fz-solar-settings-toggle { display: none; }

/* 编辑生辰时星盘停在品牌栏下方，展开「星图控制」可调节流速或查看天体数据。 */
@media (max-width: 768px) {
    #page-home .fz-sky { display: contents; }

    #page-home .fz-solar {
        position: sticky;
        top: calc(var(--fz-stitch-header-height) + env(safe-area-inset-top, 0px));
        z-index: 10;
        display: grid;
        grid-template-rows: minmax(0, 1fr) auto;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        height: var(--fz-solar-height);
        margin: 0;
        padding: 0 12px 8px;
        background-color: var(--fz-bg);
    }

    #page-home .fz-solar-stage {
        height: 100%;
        min-height: 0;
        max-height: none;
        aspect-ratio: auto;
    }
    .fz-solar-canvas { inset: 0; width: 100%; height: 100%; }

    .fz-solar-hud {
        grid-template-columns: minmax(0, 1fr) auto;
        justify-items: start;
        align-items: center;
        gap: 2px 8px;
        margin: 0;
        text-align: start;
    }
    .fz-solar-time { grid-column: 1; }
    .fz-solar-time b { font-size: clamp(13px, 3.8vw, 18px); letter-spacing: .02em; }
    .fz-solar-time span { margin-left: 5px; }
    .fz-solar-sub, .fz-solar-follow { grid-column: 1; grid-row: 2; font-size: 11px; }
    .fz-solar-hud:has(.fz-solar-follow:not([hidden])) .fz-solar-sub { visibility: hidden; }
    .fz-solar-settings-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        grid-column: 2;
        grid-row: 1 / 3;
        padding: 6px 10px;
        min-height: 36px;
        border: 1px solid var(--fz-line-gold-soft);
        border-radius: var(--fz-radius-pill);
        background: var(--fz-surface-1);
        color: var(--fz-gold);
        font: inherit;
        font-size: 12px;
    }
    .fz-solar-settings { display: none; }
    .fz-solar-settings-toggle[aria-expanded="true"] + .fz-solar-settings {
        display: block;
        position: absolute;
        right: 0;
        bottom: calc(100% + 4px);
        width: max-content;
        max-width: 100%;
        padding: 6px 8px;
        border: 1px solid var(--fz-line-gold-soft);
        border-radius: var(--fz-radius-lg);
        background: var(--fz-surface-1);
        box-shadow: var(--fz-shadow-2);
    }
    .fz-solar-controls, .fz-solar-links { margin-top: 0; gap: 4px; }
    .fz-solar-links { gap: 12px; }
    .fz-solar-chip, .fz-solar-icon { min-width: 28px; height: 30px; padding: 0 7px; }
    .fz-solar-icon::before, .fz-solar-icon::after { top: 9px; }
    .fz-solar-link { min-height: 30px; padding: 2px 0; }
    .fz-solar-pop { align-items: flex-end; padding: 0; }
    .fz-solar-pop-card { width: 100%; max-height: 86vh; border-radius: var(--fz-radius-lg) var(--fz-radius-lg) 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .fz-solar-chip, .fz-solar-link, .fz-solar-data tbody tr { transition: none; } .fz-solar-pop-card { animation: none; } }
