.cr-page {
    --cr-ink: #f6e8c8;
    --cr-muted: rgba(246, 232, 200, 0.68);
    --cr-line: rgba(224, 184, 106, 0.28);
    --cr-gold: #e0b86a;
    --cr-ember: #c4783a;
    --cr-deep: #0a0c12;
    --cr-panel: rgba(12, 14, 20, 0.78);
    position: relative;
    isolation: isolate;
    min-height: calc(100vh - 50px);
    margin-top: 50px;
    padding: 0 0 72px;
    color: var(--cr-ink);
    background:
        radial-gradient(1200px 700px at 50% -10%, rgba(196, 120, 58, 0.22), transparent 55%),
        radial-gradient(900px 500px at 85% 30%, rgba(224, 184, 106, 0.08), transparent 50%),
        linear-gradient(180deg, #12151e 0%, var(--cr-deep) 45%, #07080c 100%);
    overflow: hidden;
}

.cr-bg {
    pointer-events: none;
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
    opacity: 0.45;
    z-index: 0;
}

.cr-hero,
.cr-main {
    position: relative;
    z-index: 1;
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.cr-hero {
    padding: 28px 0 8px;
}

.cr-hero .content-instance-box-breadcrumb {
    margin-bottom: 18px;
}

.cr-kicker {
    margin: 0 0 8px;
    font-size: 12px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--cr-gold);
}

.cr-hero h1 {
    margin: 0;
    font-family: "Cinzel", "Songti SC", "Noto Serif SC", Georgia, serif;
    font-size: clamp(40px, 7vw, 72px);
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.05;
    color: #fff6df;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), 0 0 40px rgba(224, 184, 106, 0.18);
}

.cr-hero h1 span {
    color: var(--cr-gold);
}

.cr-lead {
    margin: 14px 0 0;
    max-width: 34em;
    font-size: 15px;
    line-height: 1.65;
    color: var(--cr-muted);
}

.cr-main {
    display: grid;
    gap: 28px;
    padding-top: 12px;
}

.cr-stage {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: center;
    justify-items: center;
}

/* 有结果卡片时：转盘靠左，右侧出结果 */
.cr-stage.has-result {
    grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.75fr);
    justify-items: stretch;
}

.cr-wheel-shell {
    position: relative;
    width: min(720px, 100%);
    margin: 0 auto;
    aspect-ratio: 1;
    transition: width 0.28s ease;
}

.cr-stage.has-result .cr-wheel-shell {
    margin: 0;
    width: min(640px, 100%);
}

.cr-wheel-frame {
    position: absolute;
    inset: 4.5%;
    border-radius: 50%;
    box-shadow:
        0 0 0 2px rgba(224, 184, 106, 0.45),
        0 0 0 10px rgba(10, 12, 18, 0.85),
        0 0 0 12px rgba(224, 184, 106, 0.2),
        0 24px 60px rgba(0, 0, 0, 0.55);
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.08), transparent 45%), #151821;
    overflow: hidden;
}

#cr-canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform: rotate(0deg);
    will-change: transform;
}

.cr-ring-glow {
    position: absolute;
    inset: 4%;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, transparent 58%, rgba(224, 184, 106, 0.12) 72%, transparent 78%);
    animation: cr-pulse 3.6s ease-in-out infinite;
}

@keyframes cr-pulse {
    0%, 100% { opacity: 0.55; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.015); }
}

.cr-pointer {
    position: absolute;
    z-index: 5;
    top: 1.5%;
    left: 50%;
    width: 34px;
    height: 48px;
    transform: translateX(-50%);
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
}

.cr-pointer span {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #ffe7a8 0%, var(--cr-gold) 42%, var(--cr-ember) 100%);
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    border-radius: 4px 4px 0 0;
}

.cr-page button.cr-hub,
.cr-hub {
    position: absolute;
    z-index: 6;
    left: 50%;
    top: 50%;
    width: clamp(96px, 24%, 136px) !important;
    height: clamp(96px, 24%, 136px) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    aspect-ratio: 1 / 1;
    box-sizing: border-box !important;
    transform: translate(-50%, -50%);
    border: 0 !important;
    border-radius: 50% !important;
    cursor: pointer;
    color: #1a1208 !important;
    background:
        radial-gradient(circle at 35% 30%, #fff1c8, #e0b86a 48%, #a66b2d 100%) !important;
    box-shadow:
        0 0 0 4px rgba(10, 12, 18, 0.9),
        0 0 0 6px rgba(224, 184, 106, 0.55),
        0 10px 28px rgba(0, 0, 0, 0.45) !important;
    display: grid !important;
    place-content: center;
    place-items: center;
    gap: 2px;
    line-height: 1.1 !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.cr-hub strong {
    display: block;
    font-size: clamp(18px, 2.2vw, 24px);
    letter-spacing: 0.16em;
    font-weight: 800;
    color: inherit;
}

.cr-hub em {
    display: block;
    font-style: normal;
    font-size: 11px;
    letter-spacing: 0.28em;
    opacity: 0.7;
    color: inherit;
}

.cr-page button.cr-hub:hover:not(:disabled),
.cr-hub:hover:not(:disabled) {
    transform: translate(-50%, -50%) scale(1.04);
    box-shadow:
        0 0 0 4px rgba(10, 12, 18, 0.9),
        0 0 0 7px rgba(255, 226, 138, 0.75),
        0 14px 34px rgba(224, 184, 106, 0.35) !important;
}

.cr-hub:disabled {
    cursor: wait;
    filter: saturate(0.85) brightness(0.92);
}

.cr-hub.is-spinning strong {
    letter-spacing: 0.08em;
}

.cr-result {
    min-height: 280px;
    padding: 28px 26px;
    border-radius: 18px;
    border: 1px solid var(--cr-line);
    background:
        linear-gradient(160deg, rgba(224, 184, 106, 0.1), transparent 40%),
        var(--cr-panel);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    animation: cr-fade-up 0.45s ease both;
}

.cr-result[hidden] {
    display: none;
}

@keyframes cr-fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.cr-result-kicker {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--cr-gold);
}

.cr-result-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cr-result-card img {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 12px 28px rgba(0, 0, 0, 0.35);
    object-fit: cover;
    background: #111;
}

.cr-result-class {
    margin: 0 0 4px;
    font-size: 13px;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.cr-result-card h2 {
    margin: 0;
    font-size: clamp(26px, 4vw, 36px);
    line-height: 1.15;
    letter-spacing: 0.04em;
}

.cr-result-meta {
    margin: 8px 0 0;
    color: var(--cr-muted);
    font-size: 14px;
}

.cr-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.cr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-decoration: none !important;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.cr-btn-primary {
    color: #1a1208 !important;
    background: linear-gradient(180deg, #ffe7a8, var(--cr-gold));
    border-color: rgba(255, 226, 138, 0.55);
}

.cr-btn-primary:hover {
    transform: translateY(-1px);
    background: linear-gradient(180deg, #fff0c0, #efc57a);
}

.cr-btn-ghost {
    color: var(--cr-ink) !important;
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--cr-line);
}

.cr-btn-ghost:hover {
    border-color: rgba(224, 184, 106, 0.55);
    background: rgba(224, 184, 106, 0.1);
}

/* 再转一次：墨底铜边，区别于中心金钮 */
.cr-btn-again {
    color: #ffe9c7 !important;
    background: linear-gradient(180deg, rgba(196, 120, 58, 0.35), rgba(28, 18, 12, 0.92));
    border-color: rgba(196, 120, 58, 0.75);
    box-shadow: inset 0 1px 0 rgba(255, 226, 168, 0.18), 0 6px 16px rgba(0, 0, 0, 0.28);
}

.cr-btn-again:hover {
    transform: translateY(-1px);
    color: #fff6df !important;
    border-color: rgba(255, 196, 120, 0.9);
    background: linear-gradient(180deg, rgba(224, 140, 70, 0.5), rgba(40, 22, 12, 0.95));
    box-shadow: inset 0 1px 0 rgba(255, 226, 168, 0.28), 0 8px 20px rgba(196, 120, 58, 0.28);
}

.cr-filters,
.cr-history,
.cr-stats {
    padding: 22px 24px;
    border-radius: 16px;
    border: 1px solid rgba(240, 225, 207, 0.1);
    background: rgba(10, 12, 18, 0.55);
}

.cr-stats-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.cr-stats-head h2,
.cr-stats-block h3 {
    margin: 0;
    font-size: 15px;
    letter-spacing: 0.12em;
}

.cr-stats-block h3 {
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--cr-muted);
}

.cr-stats-total {
    margin: 0;
    font-size: 13px;
    color: var(--cr-muted);
}

.cr-stats-total strong {
    color: var(--cr-gold);
    font-size: 16px;
}

.cr-stats-cols {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 20px;
}

.cr-stats-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cr-stats-item {
    display: grid;
    grid-template-columns: 88px 1fr 52px;
    gap: 10px;
    align-items: center;
}

.cr-stats-specs .cr-stats-item {
    grid-template-columns: 28px minmax(0, 1fr) 52px;
}

.cr-stats-item img {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.35);
}

.cr-stats-name {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cr-stats-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.cr-stats-bar > i {
    display: block;
    height: 100%;
    border-radius: inherit;
    width: 0;
    transition: width 0.35s ease;
}

.cr-stats-pct {
    font-size: 12px;
    color: var(--cr-muted);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.cr-stats.is-empty .cr-stats-cols {
    display: none;
}

.cr-stats:not(.is-empty) #cr-stats-empty {
    display: none;
}

.cr-filters-head,
.cr-history h2,
.cr-filters h2 {
    margin: 0;
    font-size: 15px;
    letter-spacing: 0.12em;
}

.cr-filters-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.cr-filters-actions {
    display: flex;
    gap: 8px;
}

.cr-mini {
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(240, 225, 207, 0.16);
    background: transparent;
    color: var(--cr-muted);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.cr-mini:hover {
    color: var(--cr-ink);
    border-color: rgba(224, 184, 106, 0.45);
}

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

.cr-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 12px 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    color: var(--cr-ink);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.cr-chip img {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.35);
}

.cr-chip.is-on {
    border-color: var(--chip-color);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 18px rgba(224, 184, 106, 0.18);
}

.cr-chip:not(.is-on) {
    opacity: 0.45;
}

.cr-hint {
    margin: 12px 0 0;
    font-size: 12px;
    color: var(--cr-muted);
}

.cr-history h2 {
    margin-bottom: 12px;
}

.cr-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.cr-history-list:empty::after {
    content: '还没有结果，点开始转起来。';
    color: var(--cr-muted);
    font-size: 13px;
}

.cr-history-item {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.cr-history-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    text-decoration: none !important;
    color: inherit;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.cr-history-item:hover {
    border-color: rgba(224, 184, 106, 0.4);
    background: rgba(224, 184, 106, 0.08);
}

.cr-history-item img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    flex-shrink: 0;
}

.cr-history-item strong {
    display: block;
    font-size: 13px;
}

.cr-history-item span {
    font-size: 11px;
    color: var(--cr-muted);
}

.cr-page.is-celebrating .cr-result-card {
    animation: cr-pop 0.55s cubic-bezier(0.2, 0.9, 0.2, 1.2);
}

@keyframes cr-pop {
    0% { transform: scale(0.86); filter: brightness(1.4); }
    100% { transform: scale(1); filter: brightness(1); }
}

@media (max-width: 900px) {
    .cr-stage,
    .cr-stage.has-result {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .cr-result {
        order: 2;
        min-height: 0;
        width: 100%;
    }

    .cr-wheel-shell,
    .cr-stage.has-result .cr-wheel-shell {
        width: min(560px, 94vw);
        margin: 0 auto;
    }

    .cr-stats-cols {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .cr-hero {
        padding-top: 20px;
    }

    .cr-filters,
    .cr-history,
    .cr-stats {
        padding: 18px 16px;
    }

    .cr-stats-item {
        grid-template-columns: 72px 1fr 48px;
    }
}
