html.ux-starlit {
    --star-bg: #080e1b;
    --star-panel: #111c30;
    --star-edge: #2a3954;
    --star-text: #f1f5ff;
    --star-muted: #adbcd6;
    --star-cyan: #a4e7ff;
    --star-focus: #7fd7fc;
    --star-primary: linear-gradient(108deg, #3359b9, #6049aa);
    background: var(--star-bg) !important;
    color: var(--star-text);
}

.ux-starlit body {
    color: var(--star-text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: radial-gradient(ellipse at 66% -12%, #253c68 0%, transparent 44rem),
        linear-gradient(170deg, #0f192c 0%, #080e1b 65%) !important;
    animation: none;
}

.ux-home, .ux-task { height: auto; overflow-y: auto; }
.ux-home .container, .ux-task .container, .ux-query .container { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.ux-home .container { padding-top: max(16px, env(safe-area-inset-top)); }

.ux-home #site-opening-home {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    min-height: clamp(190px, 56vw, 252px);
    margin: 0 0 22px;
    padding: clamp(18px, 5vw, 28px);
    border: 1px solid #526a9666;
    border-radius: 20px;
    background: radial-gradient(ellipse at 88% 15%, #3f5994, #181f3b 43%, #101b31 76%);
    box-shadow: 0 12px 26px #050b1980;
}

.star-portrait {
    position: absolute;
    inset: 0 0 0 auto;
    width: min(76%, 424px);
    height: 100%;
    object-fit: cover;
    object-position: 55% 23%;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 27%);
    mask-image: linear-gradient(to right, transparent, #000 27%);
}

.ux-home #site-opening-home::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(90deg, #0d172b 1%, #0d172b70 48%, transparent 79%),
        linear-gradient(0deg, #0b152bdd, transparent 70%);
    pointer-events: none;
}

.star-hero-copy { position: relative; z-index: 2; max-width: min(75%, 30rem); }
.ux-home #site-opening-home h1 {
    margin: 0;
    color: #f3f8ff;
    font-size: clamp(31px, 9vw, 52px);
    font-weight: 760;
    line-height: 1.13;
    letter-spacing: .055em;
    text-shadow: 0 0 24px #5895f79c, 0 2px 6px #081125;
}
.ux-home #site-opening-home p {
    margin: 9px 0 0;
    color: #d3e3f7;
    font-size: 14px;
    line-height: 1.55;
    text-shadow: 0 1px 5px #050a19;
}

.ux-home .container > .home-section { margin-bottom: 22px; }
.ux-home .section-title {
    margin: 0 0 10px;
    padding: 0;
    color: var(--star-text);
    text-align: left;
    font-size: 19px;
    font-weight: 680;
}
.ux-home .section-title::after { display: none; }
.ux-home .category-grid { gap: 10px; }

.ux-home .category-card.ux-task-card,
.ux-home .query-card, .ux-query .query-box, .ux-task .intro-wrap,
.ux-query .result-card, .ux-query .countdown-card, .ux-step .block-wrap {
    border: 1px solid var(--star-edge);
    border-radius: 16px;
    background: linear-gradient(150deg, #192941, var(--star-panel) 78%);
    box-shadow: 0 5px 16px #03071133;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
.ux-home .category-card.ux-task-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 13px 12px 16px;
    text-align: left;
    text-decoration: none;
    animation: none;
    transition: border-color 140ms ease, background 140ms ease;
}
.ux-home .ux-task-card h3 {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    color: var(--star-text);
    font-size: 16px;
    line-height: 1.45;
    font-weight: 650;
    overflow-wrap: anywhere;
}
.ux-home .category-card.ux-task-card:active { transform: none; border-color: #91c9f0; }

.ux-action, .ux-home .ux-task-card .ux-card-action,
.ux-query .copy-btn, .ux-step .copy-btn, .ux-step .btn-next, .ux-step .modal-box button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
    padding: 9px 14px;
    border: 1px solid #779eff66;
    border-radius: 11px;
    color: #fff;
    background: var(--star-primary);
    box-shadow: inset 0 1px 0 #cbd6ff2b, 0 3px 10px #070d2340;
    font-size: 15px;
    font-weight: 670;
    line-height: 1.35;
    text-decoration: none;
    cursor: pointer;
    transition: transform 130ms ease, filter 150ms ease, box-shadow 150ms ease;
}
.ux-action { width: 100%; }
.ux-action[hidden] { display: none; }
.ux-home .ux-task-card .ux-card-action { flex: 0 0 auto; width: auto; min-height: 42px; font-size: 13px; }
.ux-action:disabled, .ux-step .step-footer button:disabled { opacity: .48; cursor: default; }

.ux-starlit :is(.ux-action, .ux-task-card, .ux-help, .step-back, .copy-btn, .step-footer button, .modal-box button):focus-visible {
    outline: 2px solid var(--star-focus);
    outline-offset: 3px;
}
.ux-starlit :is(.ux-action, .copy-btn, .step-footer button, .modal-box button):active:not(:disabled),
.ux-home .ux-task-card:active .ux-card-action {
    transform: scale(.975);
    filter: brightness(1.16);
    box-shadow: inset 0 0 1px 1px #a5e5ff94, 0 0 15px #5eabff55;
}
@media (hover: hover) {
    .ux-home .category-card.ux-task-card:hover { border-color: #648abd; transform: none; }
    .ux-starlit :is(.ux-action, .copy-btn, .step-footer button, .modal-box button):hover:not(:disabled) { filter: brightness(1.12); }
}

.ux-home .query-card, .ux-query .query-box { padding: 12px 15px 15px; }
.ux-query .query-wrap { padding: 3px 0 12px; animation: none; }
.ux-field-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.ux-field-head label { font-size: 15px; font-weight: 660; color: var(--star-text); }
.ux-help, .ux-back, .ux-step .step-back {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    color: var(--star-cyan);
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
}
.ux-help { padding: 0 8px; }
.ux-back { padding: 4px 0; }
.ux-help:active, .ux-starlit .step-back:active { border-radius: 8px; background: #92d5ff18; }

.ux-home .query-input, .ux-query .query-input {
    margin: 0 0 9px;
    color: var(--star-text);
    background: #0b1425;
    border: 1px solid #39486b;
    box-shadow: none;
    font-size: 16px;
}
.ux-starlit .query-input::placeholder { color: #a7b4ce; opacity: 1; }
.ux-starlit .query-input:focus { border-color: #82c7f5; background: #0f1b30; box-shadow: 0 0 0 3px #5da4ff2b; }
.ux-starlit .query-input[aria-invalid="true"] { border-color: #df849f; }
.ux-feedback { margin: 0 0 10px; color: #ffc4d3; font-size: 14px; line-height: 1.55; }
.ux-feedback:empty { margin: 0; }
.ux-muted, .ux-query .empty-tip, .ux-query .countdown-title, .ux-query .countdown-tip, .ux-query .file-tip { color: var(--star-muted); }
.ux-query .result-content, .ux-query .file-tip strong { color: var(--star-text); }
.ux-query .countdown-time { color: var(--star-cyan); background: none; -webkit-text-fill-color: currentColor; font-variant-numeric: tabular-nums; }
.ux-query .file-item { background: #10192a; border-color: var(--star-edge); }
.ux-query .copy-btn.copied { background: #19704f; }
.ux-task .intro-wrap { padding: 20px 16px; margin-bottom: 14px; animation: none; }
.ux-task .intro-wrap h1 { margin: 0 0 12px; color: var(--star-text); text-align: left; }
.ux-task .intro-wrap img { display: block; margin: 12px 0 0; box-shadow: none; }
.ux-task .intro-text { color: var(--star-muted); font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }

.ux-step .step-header, .ux-step .step-footer {
    color: var(--star-text);
    border-color: var(--star-edge);
    background: #101a2df5;
}
.ux-step .step-page { max-width: 820px; margin-inline: auto; }
.ux-step .step-index { color: var(--star-muted); font-variant-numeric: tabular-nums; }
.ux-step .step-progress { height: 6px; background: #293954; }
.ux-step .step-progress-bar { background: linear-gradient(90deg, #69caff, #a395ff); }
.ux-step .step-content h2 { color: var(--star-text); }
.ux-step .block-text { color: var(--star-text); border-color: var(--star-edge); font-size: 15px; }
.ux-step .copy-box {
    border-color: var(--star-edge) !important;
    background: #0e192d !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}
.ux-step .copy-box p { color: var(--star-text); }
.ux-step .step-footer { padding-bottom: max(16px, calc(8px + env(safe-area-inset-bottom))); }
.ux-step .btn-prev { border: 1px solid #3c4b70; color: #d5e4fa; background: #1c2a44; }
.ux-step .modal-box { border: 1px solid #435983; background: #17253d; color: var(--star-text); }
.ux-step .modal-box p { color: var(--star-muted); }
.ux-step .step-content { scrollbar-color: #53668a transparent; }

.ux-opening-handoff .ux-home .container { animation: star-settle 300ms ease-out both; }
@keyframes star-settle {
    from { opacity: .72; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (min-width: 700px) {
    .ux-home #site-opening-home { min-height: 252px; }
    .star-portrait { width: 60%; max-width: none; object-position: 55% 28%; }
}
@media (prefers-reduced-motion: reduce) {
    .ux-opening-handoff .ux-home .container, .ux-starlit :is(.ux-action, .ux-task-card, .copy-btn, .step-footer button, .modal-box button) {
        animation: none;
        transition: none;
    }
}
