/* ========== 排盘输入区 - 双栏布局 ========== */
.paipan-section {
    display: flex;
    gap: 24px;
    align-items: stretch;
    margin-bottom: 16px;
}

/* ===== 左侧：即时起局 ===== */
.instant-panel {
    flex: 0 0 38%;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 64px 24px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    position: relative;
    overflow: hidden;
}

.instant-meditation-figure {
    display: block;
    width: 140px;
    height: auto;
    position: absolute;
    top: 38.2%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    flex: 0 0 auto;
    opacity: 0.72;
    user-select: none;
    pointer-events: none;
}

body:not(.light-theme) .instant-meditation-figure {
    filter: invert(1);
    opacity: 0.82;
}

.instant-meditation-copy {
    position: absolute;
    top: calc(38.2% + 108px);
    left: 50%;
    z-index: 1;
    width: calc(100% - 48px);
    transform: translateX(-50%);
    text-align: center;
    font-family: 'Source Han Serif SC', 'Noto Serif CJK SC', 'Songti SC', 'STSong', serif;
    animation: instantMeditationBreath 8s ease-in-out infinite;
    pointer-events: none;
    user-select: none;
}

.instant-meditation-title {
    color: #9C7435;
    font-size: 28px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 8px;
    text-indent: 8px;
    white-space: nowrap;
}

.instant-meditation-subtitle {
    margin-top: 18px;
    color: #8C877E;
    font-size: 15px;
    font-weight: 300;
    line-height: 1.6;
    letter-spacing: 4px;
    text-indent: 4px;
    white-space: nowrap;
}

.instant-meditation-divider {
    display: block;
    width: 40px;
    height: 1px;
    margin: 18px auto 0;
    background: #C9A961;
    opacity: 0.7;
    transform: scaleY(0.5);
    transform-origin: center;
}

@keyframes instantMeditationBreath {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .instant-meditation-copy {
        animation: none;
        opacity: 1;
    }
}

.instant-panel .panel-title {
    font-size: 14px;
    color: var(--text-dim);
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

/* 时钟区域 */
.clock-container {
    position: relative;
    width: 140px;
    height: 140px;
    z-index: 1;
}

.clock-face {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--gold-dim);
    position: relative;
    background: var(--bg3);
    box-shadow: 0 0 20px rgba(201,169,110,0.1), inset 0 0 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* 太极图背景 */
.taiji-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 1;
    transition: transform 0.1s linear;
    pointer-events: none;
    z-index: 0;
}

.taiji-bg svg {
    width: 100%;
    height: 100%;
}

body.light-theme .taiji-bg {
    opacity: 1;
}

.clock-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.clock-hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    border-radius: 2px;
}

.clock-hand-hour {
    width: 3px;
    height: 30px;
    background: var(--text);
    margin-left: -1.5px;
}

.clock-hand-minute {
    width: 2px;
    height: 42px;
    background: var(--text-light);
    margin-left: -1px;
}

.clock-hand-second {
    width: 1px;
    height: 50px;
    background: var(--gold);
    margin-left: -0.5px;
    transition: none;
}

.clock-tick {
    position: absolute;
    top: 6px;
    left: 50%;
    width: 2px;
    height: 8px;
    background: var(--text-dim);
    transform-origin: center 64px;
    margin-left: -1px;
}

.clock-tick.major {
    height: 12px;
    width: 2px;
    background: var(--gold-dim);
}

/* 四柱展示 */
.instant-bazi {
    display: flex;
    gap: 12px;
    z-index: 1;
}

.instant-pillar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.5s ease;
}

.instant-pillar .pillar-label {
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.instant-pillar .tg {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    border-radius: 6px;
    background: rgba(201,169,110,0.1);
    border: 1px solid rgba(201,169,110,0.3);
    color: var(--gold);
    transition: all 0.6s ease;
}

.instant-pillar .dz {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    border-radius: 6px;
    background: var(--bg4);
    border: 1px solid var(--border);
    color: var(--text);
    transition: all 0.6s ease;
}

.instant-pillar.changing .tg,
.instant-pillar.changing .dz {
    animation: pillarPulse 0.6s ease;
}

@keyframes pillarPulse {
    0% { transform: scale(1); opacity: 1; }
    30% { transform: scale(1.15); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* 日期时间显示 */
.instant-datetime {
    text-align: center;
    z-index: 1;
}

.instant-datetime .lunar-date {
    font-size: 13px;
    color: var(--gold-dim);
    margin-bottom: 4px;
}

.instant-datetime .solar-date {
    font-size: 12px;
    color: var(--text-dim);
}

.instant-datetime .live-time {
    font-size: 24px;
    font-weight: 300;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
    margin-top: 4px;
}

.instant-datetime .live-time .seconds {
    color: var(--gold);
    font-size: 18px;
}

/* 即时起局按钮 */
.btn-instant {
    padding: 10px 28px;
    border: 1.5px solid var(--gold-dim);
    border-radius: 24px;
    color: var(--gold);
    font-size: 14px;
    font-weight: 500;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
    letter-spacing: 1px;
}

.btn-instant:hover {
    background: var(--gold);
    color: #000;
    box-shadow: 0 4px 16px rgba(201,169,110,0.3);
}

/* ===== 右侧：信息录入 ===== */
.input-panel {
    flex: 1;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 32px;
    position: relative;
}

.input-panel .panel-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 20px;
}

/* 性别 Radio */
.gender-radio {
    display: flex;
    gap: 16px;
    align-items: center;
}

.gender-radio label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 15px;
    color: var(--text);
}

.gender-radio input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.gender-radio input[type="radio"]:checked {
    border-color: var(--gold);
}

.gender-radio input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
}

/* 历法 Tab 切换 */
.calendar-tabs {
    display: flex;
    background: var(--bg3);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.calendar-tabs .tab-item {
    padding: 7px 18px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    flex: 1;
}

.calendar-tabs .tab-item.active {
    background: var(--gold);
    color: #000;
    font-weight: 600;
}

.calendar-tabs .tab-item:hover:not(.active) {
    color: var(--gold);
}

/* 表单行 */
.input-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.input-row .row-label {
    font-size: 14px;
    color: var(--text-dim);
    min-width: 70px;
    flex-shrink: 0;
}

.input-row .row-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 旧日期弹窗入口：企业/K线页继续使用，首页由下方滚轮选择器覆盖 */
.datetime-picker-btn {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.datetime-picker-btn:hover {
    border-color: var(--gold);
}

/* 首页日期时间滚轮选择器 */
.datetime-wheel-content {
    min-width: 0;
    flex-direction: column;
    align-items: stretch !important;
    gap: 7px !important;
}

.datetime-wheel-picker {
    --datetime-wheel-peek-row: 28px;
    --datetime-wheel-current-row: 40px;
    --datetime-wheel-edge-start: 7%;
    --datetime-wheel-edge-end: 93%;
    width: 100%;
    min-width: 0;
    height: calc((2 * var(--datetime-wheel-peek-row)) + var(--datetime-wheel-current-row));
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
    border-radius: 0;
    background: transparent;
}

.datetime-wheel-picker::before {
    content: '';
    position: absolute;
    z-index: 0;
    top: var(--datetime-wheel-peek-row);
    right: 0;
    left: 0;
    height: var(--datetime-wheel-current-row);
    background:
        linear-gradient(90deg,
            transparent 0%, rgba(201,169,110,0.28) var(--datetime-wheel-edge-start),
            rgba(201,169,110,0.28) var(--datetime-wheel-edge-end), transparent 100%) top / 100% 1px no-repeat,
        linear-gradient(90deg,
            transparent 0%, rgba(201,169,110,0.28) var(--datetime-wheel-edge-start),
            rgba(201,169,110,0.28) var(--datetime-wheel-edge-end), transparent 100%) bottom / 100% 1px no-repeat,
        linear-gradient(90deg,
            transparent 0%, rgba(201,169,110,0.055) var(--datetime-wheel-edge-start),
            rgba(201,169,110,0.055) var(--datetime-wheel-edge-end), transparent 100%) center / 100% calc(100% - 2px) no-repeat;
    pointer-events: none;
}

.datetime-wheel-picker::after {
    content: '';
    position: absolute;
    z-index: 3;
    inset: 0;
    background:
        linear-gradient(90deg,
            var(--bg2) 0%, transparent var(--datetime-wheel-edge-start),
            transparent var(--datetime-wheel-edge-end), var(--bg2) 100%),
        linear-gradient(180deg,
            var(--bg2) 0%, transparent 25%, transparent 75%, var(--bg2) 100%);
    pointer-events: none;
}

.wheel-select-group,
.pillar-wheel-cell {
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.datetime-wheel-frame > .wheel-leap-badge {
    position: absolute;
    z-index: 2;
    top: calc(var(--datetime-wheel-peek-row) + 4px);
    left: calc(50% + 11px);
    display: none;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 13px;
    border: 1px solid rgba(201,169,110,0.52);
    border-radius: 50%;
    background: var(--bg2);
    color: var(--gold);
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.16);
}

.datetime-wheel-frame > .wheel-leap-badge.show {
    display: flex;
}

.wheel-select-group::after,
.pillar-wheel-cell::after {
    content: '↕';
    position: absolute;
    right: 7px;
    bottom: 12px;
    color: var(--gold-dim);
    font-size: 11px;
    line-height: 1;
    pointer-events: none;
    opacity: 0.78;
}

#datetimeWheelPicker .wheel-select-group::after,
#corpDatetimeWheelPicker .wheel-select-group::after {
    display: none;
}

.datetime-wheel-frame {
    position: relative;
    z-index: 1;
    width: 100%;
    min-width: 0;
    height: 100%;
    box-sizing: border-box;
    display: grid;
    grid-template-rows: var(--datetime-wheel-peek-row) var(--datetime-wheel-current-row) var(--datetime-wheel-peek-row);
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: ns-resize;
    overscroll-behavior: contain;
}

.datetime-wheel-peek {
    position: relative;
    z-index: 1;
    min-width: 0;
    padding: 0 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.4;
    pointer-events: none;
}

.datetime-wheel-peek.is-empty {
    opacity: 0;
}

.datetime-wheel-peek.is-leap::after {
    content: '闰';
    position: absolute;
    top: 1px;
    left: calc(50% + 8px);
    color: var(--gold-dim);
    font-size: 7px;
    font-weight: 700;
    line-height: 1;
}

#datetimeWheelPicker .datetime-wheel-frame > .wheel-select,
#corpDatetimeWheelPicker .datetime-wheel-frame > .wheel-select {
    position: relative;
    z-index: 2;
    width: 100%;
    min-width: 0;
    height: var(--datetime-wheel-current-row);
    padding: 0 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    line-height: var(--datetime-wheel-current-row);
    transition: color 0.16s ease;
}

#datetimeWheelPicker .datetime-wheel-frame > .wheel-select:hover,
#datetimeWheelPicker .datetime-wheel-frame > .wheel-select:focus-visible,
#corpDatetimeWheelPicker .datetime-wheel-frame > .wheel-select:hover,
#corpDatetimeWheelPicker .datetime-wheel-frame > .wheel-select:focus-visible {
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--gold);
}

#datetimeWheelPicker .wheel-time .wheel-select,
#datetimeWheelPicker .wheel-time .datetime-wheel-peek,
#corpDatetimeWheelPicker .wheel-time .wheel-select,
#corpDatetimeWheelPicker .wheel-time .datetime-wheel-peek {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.2px;
}

.datetime-wheel-frame.is-wheel-next > .datetime-wheel-peek,
.datetime-wheel-frame.is-wheel-next > .wheel-select {
    animation: fzDatetimeWheelNext 140ms cubic-bezier(0.22, 1, 0.36, 1);
}

.datetime-wheel-frame.is-wheel-prev > .datetime-wheel-peek,
.datetime-wheel-frame.is-wheel-prev > .wheel-select {
    animation: fzDatetimeWheelPrev 140ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fzDatetimeWheelNext {
    from { transform: translateY(4px); filter: blur(0.2px); }
    to { transform: translateY(0); filter: blur(0); }
}

@keyframes fzDatetimeWheelPrev {
    from { transform: translateY(-4px); filter: blur(0.2px); }
    to { transform: translateY(0); filter: blur(0); }
}

@media (prefers-reduced-motion: reduce) {
    .datetime-wheel-frame.is-wheel-next > .datetime-wheel-peek,
    .datetime-wheel-frame.is-wheel-next > .wheel-select,
    .datetime-wheel-frame.is-wheel-prev > .datetime-wheel-peek,
    .datetime-wheel-frame.is-wheel-prev > .wheel-select {
        animation: none;
    }
}

.wheel-select {
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 8px 21px 8px 7px;
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(180deg, var(--bg3), var(--bg2));
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    text-align: center;
    text-align-last: center;
    cursor: ns-resize;
    outline: none;
    overscroll-behavior: contain;
    touch-action: manipulation;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.wheel-select:hover,
.wheel-select:focus-visible {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(201,169,110,0.14);
    background: var(--bg3);
}

.wheel-time .wheel-select {
    border-color: color-mix(in srgb, var(--gold-dim) 52%, var(--border));
}

.wheel-picker-help {
    display: block;
    color: var(--text-dim);
    font-size: 11px;
    line-height: 1.5;
}

/* 四柱输入模式 */
.pillar-input-area {
    display: none;
    gap: 8px;
    flex-wrap: wrap;
}

.pillar-input-area.active {
    display: flex;
}

.pillar-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.pillar-input-group label {
    font-size: 11px;
    color: var(--text-dim);
}

.pillar-input-group select {
    padding: 6px 8px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    width: 60px;
}

#page-home .pillar-input-area {
    width: 100%;
    gap: 0;
    flex-wrap: nowrap;
}

#page-home .pillar-input-area.active {
    display: block;
}

.pillar-wheel-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 52px repeat(4, minmax(54px, 1fr));
    gap: 7px 8px;
    align-items: center;
    margin-bottom: 6px;
}

.pillar-grid-corner {
    min-width: 0;
}

.pillar-column-label {
    color: var(--text-dim);
    font-size: 11px;
    line-height: 1;
    text-align: center;
}

.pillar-row-label {
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
}

.pillar-row-gan {
    color: var(--gold);
    background: rgba(201,169,110,0.1);
    border: 1px solid rgba(201,169,110,0.22);
}

.pillar-row-zhi {
    color: var(--text-dim);
    background: var(--bg3);
    border: 1px solid var(--border);
}

.pillar-wheel-cell .wheel-select {
    height: 42px;
    font-size: 17px;
    font-weight: 600;
}

.pillar-wheel-gan .wheel-select {
    color: var(--gold);
    background: rgba(201,169,110,0.08);
    border-color: rgba(201,169,110,0.28);
}

.pillar-wheel-zhi .wheel-select {
    background: var(--bg3);
}

/* 排盘选项开关 */
.options-toggle-group {
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 22px;
}

.option-toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    cursor: pointer;
    user-select: none;
}

.option-toggle-with-help {
    display: flex;
    align-items: center;
    gap: 5px;
}

.option-toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.toggle-switch {
    position: relative;
    width: 42px;
    height: 22px;
    background: var(--bg4);
    border-radius: 11px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.option-toggle-input:checked + .toggle-switch {
    background: var(--gold);
    border-color: var(--gold);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.option-toggle-input:checked + .toggle-switch::after {
    left: 22px;
}

.option-toggle-input:focus-visible + .toggle-switch {
    outline: 2px solid rgba(201,169,110,0.55);
    outline-offset: 3px;
}

.toggle-label {
    font-size: 13px;
    color: var(--text-light);
    white-space: nowrap;
}

.option-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: -3px;
}

.option-help-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    padding: 0;
    border: 1px solid rgba(201,169,110,0.45);
    border-radius: 50%;
    background: transparent;
    color: var(--gold-dim);
    font: 600 11px/1 sans-serif;
    cursor: help;
}

.option-help-trigger:focus-visible {
    outline: 2px solid rgba(201,169,110,0.55);
    outline-offset: 2px;
}

.option-tooltip {
    position: absolute;
    z-index: 30;
    left: 50%;
    bottom: calc(100% + 10px);
    width: min(300px, 72vw);
    padding: 10px 12px;
    border: 1px solid rgba(201,169,110,0.32);
    border-radius: 8px;
    background: var(--bg2);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    color: var(--text-light);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.65;
    letter-spacing: 0;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 4px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.option-help:hover .option-tooltip,
.option-help:focus-within .option-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

/* 案例分类 */
.category-row {
    display: none;
    margin-top: 12px;
}

.category-row.show {
    display: flex;
}

.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-chip {
    padding: 5px 14px;
    border-radius: 16px;
    font-size: 12px;
    border: 1px solid var(--border);
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
}

.category-chip.active {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(201,169,110,0.1);
}

/* 大号排盘按钮 */
.btn-paipan-large {
    width: 100%;
    padding: 14px;
    margin-top: 20px;
    background: linear-gradient(135deg, #1a1a1a, #333);
    color: var(--gold);
    font-size: 16px;
    font-weight: 600;
    border-radius: 28px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 2px;
}
/* 在flex容器中与案例导入按钮并排时，去掉margin-top并统一高度 */
div[style*="display:flex"] > .btn-paipan-large {
    margin-top: 0;
    padding: 14px;
}
div[style*="display:flex"] > .btn-case-import {
    padding: 14px 20px;
}

body.light-theme .btn-paipan-large {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    color: #e0c48a;
}

.btn-paipan-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* 真太阳时信息 */
.true-solar-info {
    display: none;
    font-size: 12px;
    color: var(--gold-dim);
    padding: 8px 12px;
    background: var(--bg3);
    border-radius: 6px;
    margin-top: 8px;
}

/* ===== 响应式：移动端 ===== */
/* 操作按钮行 - 桌面端 */
.btn-action-row {
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: center;
    flex-wrap: nowrap;
    margin-top: 12px;
}
.btn-action-row .btn-paipan-large {
    flex: 2 1 0%;
    width: auto;
    margin-top: 0;
}
.btn-action-row .btn-case-import {
    flex: 1 1 0%;
}

/* 平板宽度下首页双栏会压缩五列滚轮；仅首页提前改为上下布局。 */
@media (min-width: 769px) and (max-width: 900px) {
    #page-home .paipan-section {
        flex-direction: column;
    }

    #page-home .instant-panel {
        flex: none;
        order: 2;
        padding: 24px 20px;
    }

    #page-home .input-panel {
        flex: none;
        order: 1;
        max-width: 100% !important;
    }

    .instant-meditation-figure {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
    }

    .instant-meditation-copy {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        margin-top: 28px;
        transform: none;
    }
}



@media (max-width: 768px) {
    .paipan-section {
        flex-direction: column;
    }
    
    #page-home .instant-panel {
        display: none;
    }

    .instant-meditation-figure {
        width: 110px;
        position: relative;
        top: auto;
        left: auto;
        transform: none;
    }

    .instant-meditation-copy {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        margin-top: 24px;
        transform: none;
    }

    .instant-meditation-title {
        font-size: 24px;
    }
    
    .input-panel {
        flex: none;
        order: 1;
        padding: 20px 16px;
        max-width: 100% !important;
    }
    
    .btn-action-row {
        flex-direction: column !important;
        gap: 10px !important;
        align-items: stretch !important;
    }
    
    .btn-action-row .btn-paipan-large {
        flex: none !important;
        width: 100% !important;
    }
    
    .btn-action-row .btn-case-import {
        flex: none !important;
        width: 100%;
        font-size: 14px;
        padding: 12px 16px;
        white-space: nowrap;
        text-align: center;
        overflow: visible;
    }
    
    .input-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .input-row .row-label {
        min-width: auto;
    }
    
    .input-row .row-content {
        width: 100%;
    }

    .datetime-wheel-picker {
        --datetime-wheel-peek-row: 25px;
        --datetime-wheel-current-row: 38px;
        --datetime-wheel-edge-start: 5%;
        --datetime-wheel-edge-end: 95%;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 0;
    }

    .datetime-picker-btn {
        width: 100%;
    }

    .wheel-select {
        height: 42px;
        padding-right: 17px;
        padding-left: 4px;
        font-size: 13px;
    }

    .datetime-wheel-peek {
        font-size: 10px;
    }

    #datetimeWheelPicker .datetime-wheel-frame > .wheel-select,
    #corpDatetimeWheelPicker .datetime-wheel-frame > .wheel-select {
        height: var(--datetime-wheel-current-row);
        padding: 0 2px;
        font-size: 15px;
        line-height: var(--datetime-wheel-current-row);
    }

    #datetimeWheelPicker .datetime-wheel-frame,
    #datetimeWheelPicker .datetime-wheel-frame > .wheel-select,
    #corpDatetimeWheelPicker .datetime-wheel-frame,
    #corpDatetimeWheelPicker .datetime-wheel-frame > .wheel-select {
        touch-action: pan-x;
        overscroll-behavior: contain;
    }

    .datetime-wheel-frame > .wheel-leap-badge {
        top: calc(var(--datetime-wheel-peek-row) + 3px);
        left: calc(50% + 9px);
        width: 12px;
        height: 12px;
        font-size: 7px;
    }

    .datetime-wheel-peek.is-leap::after {
        left: calc(50% + 7px);
        font-size: 6px;
    }

    .wheel-select-group::after,
    .pillar-wheel-cell::after {
        right: 5px;
        bottom: 11px;
        font-size: 10px;
    }

    .pillar-wheel-grid {
        grid-template-columns: 42px repeat(4, minmax(0, 1fr));
        gap: 6px 5px;
    }

    .pillar-wheel-cell .wheel-select {
        font-size: 16px;
    }
    
    .clock-container {
        width: 110px;
        height: 110px;
    }
    
    .instant-bazi {
        gap: 8px;
    }
    
    .instant-pillar .tg,
    .instant-pillar .dz {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* 旧日期时间弹窗：企业/K线页仍依赖这些共享样式 */
.datetime-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.datetime-modal.show {
    display: flex;
}

.datetime-modal-content {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 360px;
}

.datetime-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gold);
    text-align: center;
    margin-bottom: 16px;
}

.datetime-selects {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.datetime-selects .dt-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.datetime-selects .dt-group label {
    font-size: 11px;
    color: var(--text-dim);
    text-align: center;
}

.datetime-selects .dt-group select {
    padding: 8px 4px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    text-align: center;
}

.datetime-modal-btns {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.datetime-modal-btns button {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.datetime-modal-btns .btn-cancel {
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text-light);
}

.datetime-modal-btns .btn-confirm {
    background: var(--gold);
    border: none;
    color: #000;
    font-weight: 600;
}

/* 从案例管理导入按钮 */
.btn-case-import {
    flex: 1;
    padding: 12px 20px;
    border-radius: 28px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    border: 1.5px solid var(--gold);
    background: linear-gradient(135deg, rgba(201,169,110,0.08), rgba(201,169,110,0.02));
    color: var(--gold);
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn-case-import::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(201,169,110,0.15), transparent);
    transition: left 0.5s;
}

.btn-case-import:hover::before {
    left: 100%;
}

.btn-case-import:hover {
    background: linear-gradient(135deg, rgba(201,169,110,0.15), rgba(201,169,110,0.05));
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201,169,110,0.2);
}

body.light-theme .btn-case-import {
    border-color: #b8963e;
    color: #8b6914;
    background: linear-gradient(135deg, rgba(201,169,110,0.1), rgba(201,169,110,0.03));
}

body.light-theme .btn-case-import:hover {
    background: linear-gradient(135deg, rgba(201,169,110,0.2), rgba(201,169,110,0.08));
    box-shadow: 0 4px 12px rgba(201,169,110,0.25);
}

/* 首页右侧历史案例快捷入口 */
:root {
    --fz-case-history-vh: 100vh;
    --fz-case-history-drawer-width: min(360px, calc(100vw - 48px));
    --fz-case-history-handle-width: 42px;
    --fz-case-history-handle-height: 112px;
    --fz-case-history-drawer-anchor-offset: 88px;
    --fz-case-history-anchor-y: clamp(
        var(--fz-case-history-drawer-anchor-offset),
        28vh,
        calc(100vh - var(--fz-case-history-drawer-anchor-offset))
    );
    --fz-case-history-drawer-top: calc(
        var(--fz-case-history-anchor-y) - var(--fz-case-history-drawer-anchor-offset)
    );
    /* 标题栏实际高59px；按钮半高56px，中心位于115px时其上边缘正对分割线。 */
    --fz-case-history-dock-center-offset: 115px;
    --fz-case-history-dock-anchor-y: calc(
        var(--fz-case-history-drawer-top) + var(--fz-case-history-dock-center-offset)
    );
    --fz-case-history-bottom-gap: max(12px, env(safe-area-inset-bottom));
    --fz-case-history-drawer-max-height: min(480px, calc(
        var(--fz-case-history-vh) - var(--fz-case-history-drawer-top) - var(--fz-case-history-bottom-gap)
    ));
    --fz-case-history-list-max-height: clamp(48px, calc(
        var(--fz-case-history-vh) - var(--fz-case-history-drawer-top) -
        var(--fz-case-history-bottom-gap) - 166px
    ), 280px);
    --fz-case-history-drawer-duration: 0.36s;
    --fz-case-history-drawer-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@supports (height: 100dvh) {
    :root {
        --fz-case-history-vh: 100dvh;
        --fz-case-history-anchor-y: clamp(
            var(--fz-case-history-drawer-anchor-offset),
            28dvh,
            calc(100dvh - var(--fz-case-history-drawer-anchor-offset))
        );
    }
}

.fz-case-history-dock {
    position: fixed;
    top: calc(28% + 27px);
    top: var(--fz-case-history-dock-anchor-y);
    right: 0;
    z-index: 190;
    width: var(--fz-case-history-handle-width);
    min-height: var(--fz-case-history-handle-height);
    padding: 12px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 2px;
    border: 1px solid rgba(201,169,110,0.58);
    border-right: 0;
    border-radius: 11px 0 0 11px;
    background: linear-gradient(180deg, var(--bg3), var(--bg2));
    color: var(--gold);
    font-size: 12px;
    font-weight: 700;
    box-shadow: -5px 5px 18px rgba(0,0,0,0.12);
    transform: translateY(-50%);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    will-change: transform;
}

.fz-case-history-dock[hidden] {
    display: none !important;
}

.fz-case-history-dock:hover,
.fz-case-history-dock:focus-visible {
    background: linear-gradient(180deg, var(--bg4), var(--bg3));
    box-shadow: -7px 7px 22px rgba(201,169,110,0.2);
}

body:not(.fz-case-history-open) .fz-case-history-dock:hover,
body:not(.fz-case-history-open) .fz-case-history-dock:focus-visible {
    transform: translate(-3px, -50%);
}

body.light-theme .fz-case-history-dock {
    color: #8b6914;
    border-color: rgba(184,150,62,0.62);
    background: linear-gradient(180deg, #fffdf7, #f7f1e4);
}

body.fz-modal-scroll-lock {
    overflow: hidden;
    overscroll-behavior: none;
}

.modal-overlay.fz-case-history-overlay {
    z-index: 10000;
    padding: 0;
    align-items: flex-start;
    justify-content: flex-end;
    overflow: hidden;
    background: rgba(9,7,4,0.72);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    overscroll-behavior: contain;
    animation: fzCaseHistoryShadeIn var(--fz-case-history-drawer-duration) ease-out both;
    transition: background-color var(--fz-case-history-drawer-duration) ease,
        backdrop-filter var(--fz-case-history-drawer-duration) ease;
}

body.light-theme .modal-overlay.fz-case-history-overlay {
    background: rgba(31,24,12,0.58);
}

.modal-overlay.fz-case-history-overlay.fz-case-history-closing,
body.light-theme .modal-overlay.fz-case-history-overlay.fz-case-history-closing {
    background: rgba(9,7,4,0);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    animation: none;
}

.modal.fz-case-history-dialog {
    position: absolute;
    top: var(--fz-case-history-drawer-top);
    right: 0;
    width: var(--fz-case-history-drawer-width);
    height: auto;
    min-width: 0;
    max-width: none;
    max-height: var(--fz-case-history-drawer-max-height);
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: translate3d(0, 0, 0);
    animation: fzCaseHistoryDrawerEnter var(--fz-case-history-drawer-duration)
        var(--fz-case-history-drawer-ease) both;
    transition: transform var(--fz-case-history-drawer-duration)
        var(--fz-case-history-drawer-ease);
    will-change: transform;
    outline: none;
}

body.light-theme .modal.fz-case-history-dialog {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.modal-overlay.fz-case-history-closing .modal.fz-case-history-dialog {
    transform: translate3d(100%, 0, 0);
    animation: none;
}

.modal.fz-case-history-dialog > .fz-case-history-dock {
    position: absolute;
    top: var(--fz-case-history-dock-center-offset);
    right: auto;
    left: calc(-1 * var(--fz-case-history-handle-width));
    z-index: 2;
    margin: 0;
    transform: translateY(-50%);
    transition: box-shadow 0.2s ease, background 0.2s ease;
    will-change: auto;
}

.fz-case-history-shell {
    width: 100%;
    height: auto;
    max-height: var(--fz-case-history-drawer-max-height);
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(201,169,110,0.42);
    border-right: 0;
    border-radius: 16px 0 0 16px;
    background: linear-gradient(155deg, var(--bg2), var(--bg3));
    background-clip: padding-box;
    box-shadow: -18px 0 60px rgba(0,0,0,0.38), 0 0 0 1px rgba(201,169,110,0.08);
    color: var(--text);
}

.fz-case-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    padding: 10px 12px 10px 18px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(90deg, rgba(201,169,110,0.1), transparent 70%);
}

.fz-case-history-heading {
    color: var(--gold);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1px;
}

.fz-case-history-close {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-dim);
    font-size: 25px;
    line-height: 1;
    transition: color 0.2s ease, background 0.2s ease;
}

.fz-case-history-close:hover,
.fz-case-history-close:focus-visible {
    color: var(--gold);
    background: rgba(201,169,110,0.12);
}

.fz-case-history-search-wrap {
    padding: 14px 16px 10px;
}

.fz-case-history-search-label,
.fz-case-history-list-label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-dim);
    font-size: 12px;
    letter-spacing: 0.5px;
}

.fz-case-history-search {
    width: 100%;
    height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--bg3);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fz-case-history-search:focus {
    border-color: var(--gold-dim);
    box-shadow: 0 0 0 3px rgba(201,169,110,0.12);
}

.fz-case-history-search::placeholder {
    color: var(--text-dim);
}

.fz-case-history-list-label {
    margin: 0;
    padding: 0 16px 7px;
}

.fz-case-history-list {
    flex: 0 1 auto;
    min-height: 0;
    max-height: var(--fz-case-history-list-max-height);
    padding: 0 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.fz-case-history-item {
    flex: 0 0 auto;
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--bg3);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px 112px;
    align-items: center;
    column-gap: 8px;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.fz-case-history-name {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--gold);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.25px;
    transition: color 0.16s ease;
}

.fz-case-history-calendar {
    width: 34px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(201,169,110,0.28);
    border-radius: 10px;
    background: rgba(201,169,110,0.08);
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1;
    white-space: nowrap;
    transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.fz-case-history-date {
    min-width: 0;
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.1px;
    line-height: 1;
    white-space: nowrap;
    text-align: right;
    opacity: 1;
    transition: color 0.16s ease, opacity 0.16s ease;
}

.fz-case-history-item:hover,
.fz-case-history-item:focus-visible {
    transform: translateX(2px);
    border-color: var(--gold-dim);
    background: rgba(201,169,110,0.1);
}

.fz-case-history-item:hover .fz-case-history-date,
.fz-case-history-item:focus-visible .fz-case-history-date {
    color: var(--text-light);
    opacity: 1;
}

.fz-case-history-item:hover .fz-case-history-name,
.fz-case-history-item:focus-visible .fz-case-history-name {
    color: var(--gold-light);
}

.fz-case-history-item:hover .fz-case-history-calendar,
.fz-case-history-item:focus-visible .fz-case-history-calendar {
    color: var(--text-light);
    border-color: rgba(201,169,110,0.52);
    background: rgba(201,169,110,0.14);
}

body.light-theme .fz-case-history-name,
body.light-theme .fz-case-history-item:hover .fz-case-history-name,
body.light-theme .fz-case-history-item:focus-visible .fz-case-history-name {
    color: #896714;
}

.fz-case-history-item:disabled {
    cursor: wait;
    opacity: 0.58;
}

.fz-case-history-status {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: var(--text-dim);
    font-size: 13px;
    text-align: center;
}

.fz-case-history-status.is-error {
    color: #d78672;
}

@keyframes fzCaseHistoryDrawerEnter {
    from { transform: translate3d(100%, 0, 0); }
    to { transform: translate3d(0, 0, 0); }
}

@keyframes fzCaseHistoryShadeIn {
    from { background-color: rgba(9,7,4,0); backdrop-filter: blur(0); }
    to { backdrop-filter: blur(2px); }
}

@media (max-width: 768px) {
    :root {
        --fz-case-history-dock-center-offset: calc(
            105px + max(10px, env(safe-area-inset-top))
        );
    }

    .fz-case-history-dock {
        width: var(--fz-case-history-handle-width);
        min-height: var(--fz-case-history-handle-height);
        padding: 10px 8px;
        box-shadow: -4px 4px 14px rgba(0,0,0,0.16);
    }

    .modal.fz-case-history-dialog {
        width: var(--fz-case-history-drawer-width);
        height: auto;
        max-width: none;
        max-height: var(--fz-case-history-drawer-max-height);
        margin: 0;
        transform: translate3d(100%, 0, 0);
        animation: none;
    }

    .modal-overlay.fz-case-history-overlay.fz-case-history-ready .modal.fz-case-history-dialog {
        transform: translate3d(0, 0, 0);
    }

    .modal-overlay.fz-case-history-overlay.fz-case-history-closing .modal.fz-case-history-dialog {
        transform: translate3d(100%, 0, 0);
    }

    .fz-case-history-shell {
        border-radius: 14px 0 0 14px;
    }

    .fz-case-history-header {
        padding-top: max(10px, env(safe-area-inset-top));
        padding-right: max(12px, env(safe-area-inset-right));
    }

    .fz-case-history-list {
        max-height: var(--fz-case-history-list-max-height);
        padding-bottom: max(14px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 380px) {
    .fz-case-history-item {
        padding-right: 10px;
        padding-left: 10px;
        grid-template-columns: minmax(0, 1fr) 30px 102px;
        column-gap: 6px;
    }

    .fz-case-history-name {
        font-size: 13px;
    }

    .fz-case-history-calendar {
        width: 30px;
        height: 18px;
        font-size: 9px;
    }

    .fz-case-history-date {
        font-size: 11px;
        letter-spacing: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal-overlay.fz-case-history-overlay,
    .modal.fz-case-history-dialog {
        animation: none;
        transition: none;
    }

    .fz-case-history-dock,
    .fz-case-history-item {
        transition: none;
    }
}
