body.variant-a,
body.variant-b {
    --bw-sheet-bg: linear-gradient(180deg, #ffffff, #f8f5fc);
    --bw-sheet-solid: #ffffff;
    --bw-text: #2f2740;
    --bw-accent: #7850d5;
    --bw-muted: #8e8798;
    --bw-line: rgba(120, 80, 213, .18);
    --bw-highlight: rgba(120, 80, 213, .08);
    --bw-shadow: rgba(38, 25, 66, .2);
}

body.variant-a.theme-chinese,
body.variant-b.theme-chinese {
    --bw-sheet-bg: linear-gradient(180deg, #fdfcf9, #f7f0e5);
    --bw-sheet-solid: #fdfcf9;
    --bw-text: #2b211b;
    --bw-accent: #a82e2e;
    --bw-muted: #78685c;
    --bw-line: rgba(168, 46, 46, .18);
    --bw-highlight: rgba(168, 46, 46, .07);
    --bw-shadow: rgba(72, 39, 25, .22);
}

body.variant-c {
    --bw-sheet-bg:
        radial-gradient(circle at 50% 0, rgba(29, 83, 127, .28), transparent 44%),
        linear-gradient(180deg, #0b1c32, #050d1b);
    --bw-sheet-solid: #08172a;
    --bw-text: #f2ead8;
    --bw-accent: #e6c980;
    --bw-muted: #74869a;
    --bw-line: rgba(111, 159, 195, .28);
    --bw-highlight: rgba(230, 201, 128, .09);
    --bw-shadow: rgba(0, 0, 0, .48);
}

body.variant-d {
    --bw-sheet-bg:
        radial-gradient(circle at 50% 0, rgba(112, 68, 130, .3), transparent 42%),
        linear-gradient(180deg, #2b1b36, #180f21);
    --bw-sheet-solid: #21142b;
    --bw-text: #f2e5c8;
    --bw-accent: #ffdc7a;
    --bw-muted: #93879a;
    --bw-line: rgba(225, 189, 105, .2);
    --bw-highlight: rgba(225, 189, 105, .08);
    --bw-shadow: rgba(0, 0, 0, .45);
}

.birth-wheel-trigger {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    appearance: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.birth-wheel-trigger span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.birth-wheel-trigger i {
    color: var(--bw-accent);
    font-size: 13px;
    font-style: normal;
}

.form-group .birth-wheel-trigger {
    min-height: 48px;
    padding: 0 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: #928b9c;
    background: #fff;
    font-size: 1rem;
}

.form-group .birth-wheel-trigger.has-value {
    color: var(--text-color);
}

.form-group .birth-wheel-trigger:focus-visible {
    outline: none;
    border-color: var(--primary-color);
}

.field .birth-wheel-trigger {
    height: 48px;
    padding: 0 13px;
    border: 1px solid #ded7e8;
    border-radius: 10px;
    color: #aaa4b3;
    background: #fff;
    font-size: 15px;
}

.field .birth-wheel-trigger.has-value {
    color: #1f1932;
}

.field .birth-wheel-trigger:focus-visible {
    outline: none;
    border-color: #8055e9;
    box-shadow: 0 0 0 3px rgba(128, 85, 233, .12);
}

.astro-field .birth-wheel-trigger {
    height: 36px;
    padding: 0 9px;
    border: 1px solid rgba(101, 145, 179, .38);
    border-radius: 5px;
    color: #607080;
    background: rgba(2, 9, 20, .74);
    font-size: 10px;
}

.astro-field .birth-wheel-trigger.has-value {
    color: #e9e2d3;
}

.astro-field .birth-wheel-trigger:focus-visible {
    outline: none;
    border-color: #e6c980;
    box-shadow: 0 0 0 2px rgba(230, 201, 128, .08);
}

.birth-professional {
    margin: 0 0 16px;
    border: 1px solid var(--bw-line);
    border-radius: 9px;
    background: rgba(255, 255, 255, .82);
    background: color-mix(in srgb, var(--bw-sheet-solid) 82%, transparent);
    overflow: hidden;
}

.birth-professional summary {
    min-height: 40px;
    padding: 0 12px;
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 8px;
    color: var(--bw-muted);
    cursor: pointer;
    list-style: none;
    font-size: 12px;
}

.birth-professional summary::-webkit-details-marker {
    display: none;
}

.birth-professional summary::before {
    content: "◇";
    color: var(--bw-accent);
    font-size: 9px;
}

.birth-professional summary span {
    color: var(--bw-text);
    font-weight: 700;
}

.birth-professional summary i {
    justify-self: end;
    color: var(--bw-accent);
    font-size: 13px;
    font-style: normal;
    transition: transform .2s ease;
}

.birth-professional[open] summary {
    border-bottom: 1px solid var(--bw-line);
    background: var(--bw-highlight);
}

.birth-professional[open] summary i {
    transform: rotate(180deg);
}

.birth-professional-fields {
    padding: 14px 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.birth-professional-fields .form-group,
.birth-professional-fields .field,
.birth-professional-fields .astro-field {
    margin: 0;
}

body.variant-c .birth-professional {
    border-radius: 5px;
    background: rgba(2, 9, 20, .5);
}

body.variant-c .birth-professional summary {
    min-height: 34px;
    padding: 0 9px;
    font-size: 9px;
}

body.variant-c .birth-professional-fields {
    padding: 9px;
    gap: 8px;
}

body.wheel-open {
    overflow: hidden;
}

.d-wheel-overlay[hidden] {
    display: none;
}

.d-wheel-overlay {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(8, 4, 12, .62);
    backdrop-filter: blur(5px);
}

.d-wheel-sheet {
    width: min(100%, 500px);
    padding: 0 16px 18px;
    padding: 0 16px max(18px, env(safe-area-inset-bottom));
    border: 1px solid var(--bw-line);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    color: var(--bw-text);
    background: var(--bw-sheet-bg);
    box-shadow: 0 -18px 60px var(--bw-shadow);
    animation: birth-wheel-rise .22s ease-out;
}

@keyframes birth-wheel-rise {
    from {
        transform: translateY(24px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.d-wheel-toolbar {
    height: 56px;
    display: grid;
    grid-template-columns: 58px 1fr 58px;
    align-items: center;
    border-bottom: 1px solid var(--bw-line);
}

.d-wheel-toolbar h2 {
    margin: 0;
    color: var(--bw-text);
    font-family: "Songti SC", "STSong", serif;
    font-size: 15px;
    text-align: center;
    letter-spacing: .08em;
}

.d-wheel-toolbar button {
    min-height: 44px;
    padding: 0;
    border: 0;
    color: var(--bw-muted);
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
}

.d-wheel-toolbar button:last-child {
    color: var(--bw-accent);
    font-weight: 700;
}

.d-wheel-toolbar button:focus-visible,
.d-wheel-column:focus-visible {
    outline: 2px solid var(--bw-accent);
    outline-offset: -2px;
}

.d-wheel-labels {
    padding: 11px 0 2px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    color: var(--bw-muted);
    font-size: 9px;
    text-align: center;
}

.d-wheel-picker {
    position: relative;
    height: 220px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
}

.d-wheel-picker::before,
.d-wheel-picker::after {
    content: "";
    position: absolute;
    z-index: 3;
    left: 0;
    right: 0;
    height: 80px;
    pointer-events: none;
}

.d-wheel-picker::before {
    top: 0;
    background: linear-gradient(var(--bw-sheet-solid) 12%, transparent);
}

.d-wheel-picker::after {
    bottom: 0;
    background: linear-gradient(transparent, var(--bw-sheet-solid) 88%);
}

.d-wheel-selection {
    position: absolute;
    z-index: 0;
    top: 88px;
    left: 0;
    right: 0;
    height: 44px;
    border-top: 1px solid var(--bw-line);
    border-bottom: 1px solid var(--bw-line);
    background: var(--bw-highlight);
}

.d-wheel-column {
    position: relative;
    z-index: 1;
    height: 220px;
    padding: 88px 0;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.d-wheel-column::-webkit-scrollbar {
    display: none;
}

.d-wheel-option {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bw-muted);
    cursor: pointer;
    scroll-snap-align: center;
    font-size: 13px;
    white-space: nowrap;
    user-select: none;
    transition: color .15s ease, transform .15s ease;
}

.d-wheel-option.is-selected {
    color: var(--bw-accent);
    font-size: 15px;
    font-weight: 700;
}

.d-wheel-tip {
    margin: 4px 0 0;
    color: var(--bw-muted);
    font-size: 9px;
    text-align: center;
    letter-spacing: .04em;
}

@media (prefers-reduced-motion: reduce) {
    .d-wheel-sheet {
        animation: none;
    }

    .d-wheel-option,
    .birth-professional summary i {
        transition: none;
    }
}

@media (max-width: 520px) {
    .birth-professional-fields {
        grid-template-columns: 1fr;
    }
}
