:root {
    --red-900: #6F1D1B;
    --red-700: #B92F2A;
    --red-600: #D84435;
    --red-500: #EA573F;
    --gold-500: #E8AD3B;
    --gold-300: #F4D58A;
    --gold-100: #FFF1C9;
    --jade-700: #12675F;
    --jade-500: #1B8A78;
    --ink-900: #172D2E;
    --ink-700: #3C4E4D;
    --ink-500: #6D7A77;
    --paper: #FFF9EC;
    --paper-deep: #F4E7C8;
    --white: #FFFFFF;
    --line: rgba(111, 29, 27, .13);
    --shadow-soft: 0 20px 60px rgba(81, 39, 24, .12);
    --shadow-card: 0 26px 70px rgba(86, 35, 21, .18);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --font-cn: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    --font-display: "STKaiti", "KaiTi", "Songti SC", "SimSun", serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--paper);
    -webkit-text-size-adjust: 100%;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--ink-900);
    font-family: var(--font-cn);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(27, 138, 120, .28);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.front-page {
    position: relative;
    overflow-x: hidden;
    background:
        linear-gradient(180deg, #FFFBEF 0%, #FFF7E7 54%, #F7E8C8 100%);
}

.paper-pattern {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .5;
    background-image:
        linear-gradient(90deg, rgba(185, 47, 42, .035) 1px, transparent 1px),
        linear-gradient(rgba(185, 47, 42, .035) 1px, transparent 1px),
        radial-gradient(circle at 50% 50%, rgba(232, 173, 59, .18) 0 1px, transparent 1.5px);
    background-size: 72px 72px, 72px 72px, 18px 18px;
    mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .3) 78%, transparent 100%);
}

.site-header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1180px, calc(100% - 40px));
    min-height: 86px;
    margin: 0 auto;
    border-bottom: 1px solid rgba(111, 29, 27, .1);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: inherit;
    text-decoration: none;
}

.brand img {
    display: block;
    width: 48px;
    height: 48px;
}

.brand > span {
    display: grid;
    gap: 2px;
}

.brand strong {
    color: var(--red-900);
    font-family: var(--font-display);
    font-size: 19px;
    line-height: 1.15;
}

.brand small {
    color: var(--ink-500);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .18em;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 13px;
    border: 1px solid rgba(23, 45, 46, .12);
    border-radius: 999px;
    color: var(--ink-700);
    background: rgba(255, 255, 255, .72);
    box-shadow: 0 5px 18px rgba(79, 48, 27, .06);
    font-size: 12px;
    font-weight: 800;
    backdrop-filter: blur(10px);
}

.status-pill span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ink-500);
}

.status-pill.is-live {
    color: var(--jade-700);
    border-color: rgba(27, 138, 120, .18);
    background: rgba(233, 249, 244, .84);
}

.status-pill.is-live span {
    background: var(--jade-500);
    box-shadow: 0 0 0 5px rgba(27, 138, 120, .1);
    animation: statusPulse 2.2s ease-out infinite;
}

.status-pill.is-paused {
    color: #896527;
    background: rgba(255, 244, 216, .86);
}

.status-pill.is-paused span {
    background: var(--gold-500);
}

.front-main {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.hero-section {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
    align-items: center;
    min-height: 470px;
    padding: 48px 0 42px;
    overflow: hidden;
}

.hero-copy {
    position: relative;
    grid-column: 1;
    grid-row: 1;
    z-index: 2;
    max-width: 620px;
    align-self: start;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    color: var(--red-700);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .12em;
}

.eyebrow span {
    width: 30px;
    height: 2px;
    background: var(--red-600);
}

.hero-copy h1 {
    margin: 0;
    color: var(--ink-900);
    font-family: var(--font-display);
    font-size: clamp(46px, 5.5vw, 76px);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: .01em;
}

.hero-copy h1 em {
    position: relative;
    display: inline-block;
    color: var(--red-700);
    font-style: normal;
}

.hero-copy h1 em::after {
    position: absolute;
    right: 0;
    bottom: -7px;
    left: 0;
    height: 9px;
    content: "";
    opacity: .5;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 12'%3E%3Cpath d='M2 8c65-8 129 5 194-2 43-4 72-1 102 4' fill='none' stroke='%23E8AD3B' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

.hero-copy h1 em::after {
    background: linear-gradient(90deg, transparent, var(--gold-500) 12%, var(--gold-500) 88%, transparent) center 100% / 100% 3px no-repeat;
}

.hero-subtitle {
    max-width: 520px;
    margin: 28px 0 0;
    color: var(--ink-700);
    font-size: 17px;
    line-height: 1.8;
}

.draw-stats {
    display: flex;
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    align-items: center;
    gap: 24px;
    margin-top: 34px;
}

.draw-stats > div {
    display: grid;
    gap: 2px;
}

.draw-stats strong {
    color: var(--red-700);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 31px;
    font-weight: 700;
    line-height: 1;
}

.draw-stats span {
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 700;
}

.draw-stats i {
    width: 1px;
    height: 36px;
    background: rgba(111, 29, 27, .14);
}

.fortune-visual {
    position: relative;
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    width: 100%;
    height: 390px;
}

.sun-disc {
    position: absolute;
    top: 10px;
    right: 75px;
    width: 230px;
    height: 230px;
    border: 1px solid rgba(232, 173, 59, .36);
    border-radius: 50%;
    background:
        repeating-conic-gradient(from 0deg, rgba(232, 173, 59, .14) 0deg 4deg, transparent 4deg 12deg),
        radial-gradient(circle, #FFE6A1 0 54%, rgba(255, 230, 161, .35) 55% 62%, transparent 63%);
    animation: sunTurn 46s linear infinite;
}

.mountain {
    position: absolute;
    right: 0;
    bottom: 12px;
    width: 470px;
    height: 170px;
    clip-path: polygon(0 100%, 12% 62%, 25% 78%, 42% 23%, 59% 71%, 73% 46%, 100% 100%);
}

.mountain-back {
    right: 20px;
    bottom: 40px;
    height: 190px;
    opacity: .58;
    background: repeating-linear-gradient(120deg, rgba(27, 138, 120, .26) 0 4px, rgba(27, 138, 120, .12) 4px 10px);
}

.mountain-front {
    background:
        repeating-linear-gradient(120deg, rgba(23, 45, 46, .2) 0 5px, rgba(23, 45, 46, .08) 5px 12px),
        var(--jade-700);
    filter: drop-shadow(0 18px 24px rgba(18, 103, 95, .16));
}

.fortune-tube {
    position: absolute;
    right: 130px;
    bottom: 62px;
    z-index: 3;
    width: 152px;
    height: 220px;
    filter: drop-shadow(0 22px 28px rgba(111, 29, 27, .25));
}

.tube-body {
    position: absolute;
    right: 12px;
    bottom: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 128px;
    height: 142px;
    border: 3px solid var(--red-900);
    border-radius: 19px 19px 32px 32px;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .12), transparent 34%),
        linear-gradient(180deg, var(--red-500), var(--red-700) 74%, var(--red-900));
}

.tube-body::before,
.tube-body::after {
    position: absolute;
    right: 8px;
    left: 8px;
    height: 7px;
    content: "";
    border: 2px solid rgba(255, 241, 201, .72);
    border-radius: 999px;
}

.tube-body::before {
    top: 18px;
}

.tube-body::after {
    bottom: 20px;
}

.tube-body b {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 2px solid var(--gold-300);
    border-radius: 50%;
    color: var(--gold-100);
    font-family: var(--font-display);
    font-size: 27px;
}

.stick {
    position: absolute;
    bottom: 128px;
    z-index: 1;
    width: 18px;
    height: 100px;
    border: 2px solid rgba(111, 29, 27, .38);
    border-radius: 9px 9px 3px 3px;
    background: linear-gradient(90deg, #E9C785, #FFF2C9 48%, #DFB96F);
    transform-origin: 50% 100%;
}

.stick::after {
    position: absolute;
    top: 10px;
    left: 50%;
    width: 6px;
    height: 6px;
    content: "";
    border-radius: 50%;
    background: var(--red-700);
    transform: translateX(-50%);
}

.stick-1 {
    right: 22px;
    transform: rotate(-13deg);
}

.stick-2 {
    right: 48px;
    height: 112px;
    transform: rotate(-5deg);
}

.stick-3 {
    right: 77px;
    height: 92px;
    transform: rotate(5deg);
}

.stick-4 {
    right: 103px;
    transform: rotate(13deg);
}

.floating-seal {
    position: absolute;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 2px solid rgba(185, 47, 42, .72);
    color: var(--red-700);
    font-family: var(--font-display);
    font-size: 21px;
    transform: rotate(-8deg);
}

.seal-one {
    top: 88px;
    left: 28px;
    animation: gentleFloat 4s ease-in-out infinite;
}

.seal-two {
    right: 52px;
    bottom: 30px;
    width: 38px;
    height: 38px;
    font-size: 17px;
    transform: rotate(10deg);
    animation: gentleFloat 4.5s ease-in-out infinite reverse;
}

.draw-section {
    position: relative;
    z-index: 5;
    padding: 34px 0 52px;
    border-top: 1px solid rgba(111, 29, 27, .1);
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.section-index {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 50px;
    height: 50px;
    border: 1px solid rgba(185, 47, 42, .24);
    color: var(--red-700);
    background: rgba(255, 255, 255, .58);
    font-family: var(--font-display);
    font-size: 23px;
    transform: rotate(-3deg);
}

.section-heading h2 {
    margin: 0;
    color: var(--ink-900);
    font-family: var(--font-display);
    font-size: 27px;
    line-height: 1.2;
}

.section-heading p {
    margin: 5px 0 0;
    color: var(--ink-500);
    font-size: 13px;
}

.section-title-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.section-total {
    display: inline-grid;
    gap: 2px;
    justify-items: start;
    color: var(--ink-500);
    font-family: var(--font-cn);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.05;
    white-space: nowrap;
}

.section-total strong {
    color: var(--red-700);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    line-height: 1;
}

.notice-strip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 760px;
    margin-bottom: 20px;
    padding: 14px 16px;
    border-left: 4px solid var(--jade-500);
    color: var(--jade-700);
    background: rgba(226, 246, 239, .68);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.notice-strip svg {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.notice-strip p {
    margin: 0;
    font-size: 14px;
    line-height: 1.65;
}

.draw-form {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 16px 22px;
    align-items: end;
    max-width: 920px;
    padding: 26px;
    border: 1px solid rgba(111, 29, 27, .12);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .95), rgba(255, 249, 236, .86));
    box-shadow: var(--shadow-soft);
}

.draw-form::before {
    position: absolute;
    top: -1px;
    right: 32px;
    width: 92px;
    height: 3px;
    content: "";
    background: linear-gradient(90deg, transparent, var(--gold-500), transparent);
}

.draw-form label {
    grid-column: 1;
    margin-bottom: -7px;
    color: var(--ink-700);
    font-size: 13px;
    font-weight: 800;
}

.input-shell {
    position: relative;
    grid-column: 1;
    display: flex;
    align-items: center;
    min-height: 60px;
    overflow: hidden;
    border: 1px solid rgba(23, 45, 46, .16);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, .88);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.input-shell:focus-within {
    border-color: rgba(27, 138, 120, .7);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(27, 138, 120, .09);
}

.input-shell > svg {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin-left: 18px;
    fill: none;
    stroke: var(--jade-700);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.input-shell input {
    width: 100%;
    min-width: 0;
    height: 58px;
    padding: 0 14px;
    border: 0;
    outline: 0;
    color: var(--ink-900);
    background: transparent;
    font-size: 17px;
}

.input-shell input::placeholder {
    color: #9A9F98;
}

.input-count {
    flex: 0 0 auto;
    margin-right: 16px;
    color: #A0A59F;
    font-size: 11px;
}

.input-count b {
    color: var(--jade-700);
}

.draw-button {
    position: relative;
    grid-column: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 60px;
    padding: 0 24px;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius-md);
    color: #fff;
    background: linear-gradient(145deg, var(--red-500), var(--red-700));
    box-shadow: 0 12px 28px rgba(185, 47, 42, .25);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.draw-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(185, 47, 42, .3);
    filter: saturate(1.08);
}

.draw-button:active:not(:disabled) {
    transform: translateY(1px);
}

.draw-button:disabled {
    cursor: not-allowed;
    filter: grayscale(.45);
    opacity: .66;
}

.draw-button svg {
    position: relative;
    z-index: 2;
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.draw-button b {
    position: relative;
    z-index: 2;
    font-size: 16px;
}

.proxy-draw-button {
    grid-column: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 52px;
    padding: 0 20px;
    border: 1px solid rgba(27, 138, 120, .28);
    border-radius: var(--radius-md);
    color: var(--jade-700);
    background: rgba(231, 248, 242, .82);
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.proxy-draw-button:hover {
    border-color: rgba(27, 138, 120, .5);
    background: rgba(224, 246, 239, .96);
    box-shadow: 0 10px 24px rgba(27, 138, 120, .11);
    transform: translateY(-1px);
}

.proxy-draw-button:active {
    transform: translateY(1px);
}

.proxy-draw-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.proxy-draw-button b {
    font-size: 14px;
}

.button-glow {
    position: absolute;
    top: -70%;
    left: -35%;
    width: 45%;
    height: 240%;
    background: rgba(255, 255, 255, .22);
    transform: rotate(18deg);
    transition: left .5s ease;
}

.draw-button:hover .button-glow {
    left: 115%;
}

.form-note {
    grid-column: 1 / -1;
    margin: -5px 0 0;
    color: var(--ink-500);
    font-size: 12px;
}

.existing-result {
    max-width: 920px;
    padding: 27px;
    border: 1px solid rgba(27, 138, 120, .18);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(135deg, rgba(231, 248, 242, .9), rgba(255, 255, 255, .94));
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.result-kicker {
    display: block;
    color: var(--jade-700);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .14em;
}

.existing-result .result-number {
    display: block;
    margin: 5px 0 2px;
    color: var(--red-700);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 58px;
    line-height: 1.1;
}

.existing-result p {
    margin: 5px 0 14px;
    color: var(--ink-700);
    font-size: 14px;
}

.text-button {
    padding: 8px 14px;
    border: 1px solid rgba(27, 138, 120, .28);
    border-radius: 999px;
    color: var(--jade-700);
    background: #fff;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.site-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: min(1180px, calc(100% - 40px));
    padding: 20px 0 24px;
    margin: 0 auto;
    border-top: 1px solid rgba(111, 29, 27, .1);
    color: var(--ink-500);
    font-size: 12px;
    line-height: 1.7;
    text-align: center;
}

.footer-main,
.footer-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 10px;
}

.footer-brand {
    color: var(--ink-500);
    font-weight: 800;
}

.footer-meta {
    color: var(--ink-500);
    font-size: 11px;
}

.site-footer i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--gold-500);
}

.icp-link {
    color: inherit;
    text-decoration: none;
}

.icp-link:hover {
    text-decoration: underline;
}

.site-footer .admin-entry {
    padding: 2px 4px;
    color: inherit;
    font-size: 11px;
    text-decoration: none;
    transition: text-decoration-color .2s ease;
}

.site-footer .admin-entry:hover {
    text-decoration: underline;
}

.tech-support {
    color: var(--ink-500);
}

.tech-support a {
    color: var(--ink-500);
    font-weight: 800;
    text-decoration: none;
}

.drawing-overlay,
.result-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(17, 35, 35, .76);
    backdrop-filter: blur(12px);
}

.drawing-overlay {
    background: rgba(18, 36, 36, .86);
}

.drawing-stage {
    position: relative;
    width: min(360px, 100%);
    color: #fff;
    text-align: center;
}

.mini-tube {
    position: relative;
    width: 110px;
    height: 126px;
    margin: 0 auto 28px;
    filter: drop-shadow(0 17px 20px rgba(0, 0, 0, .25));
}

.mini-tube span {
    position: absolute;
    bottom: 64px;
    left: 38px;
    width: 12px;
    height: 62px;
    border-radius: 7px 7px 2px 2px;
    background: linear-gradient(90deg, #D7AC5E, #FFF1C9, #D8AE65);
    transform-origin: 50% 100%;
}

.mini-tube span:nth-child(1) {
    --tx: -22px;
    animation: tubeShake .46s ease-in-out infinite;
}

.mini-tube span:nth-child(2) {
    --tx: -7px;
    animation: tubeShake .54s ease-in-out infinite reverse;
}

.mini-tube span:nth-child(3) {
    --tx: 8px;
    animation: tubeShake .5s ease-in-out infinite;
}

.mini-tube span:nth-child(4) {
    --tx: 23px;
    animation: tubeShake .58s ease-in-out infinite reverse;
}

.mini-tube > div {
    position: absolute;
    bottom: 0;
    left: 17px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 76px;
    height: 83px;
    border: 2px solid var(--gold-300);
    border-radius: 13px 13px 22px 22px;
    color: var(--gold-100);
    background: linear-gradient(180deg, var(--red-500), var(--red-700));
    font-family: var(--font-display);
    font-size: 31px;
}

.drawing-ripple {
    position: absolute;
    top: 38px;
    left: 50%;
    width: 150px;
    height: 150px;
    border: 1px solid rgba(244, 213, 138, .44);
    border-radius: 50%;
    transform: translateX(-50%);
    animation: ripple 1.4s ease-out infinite;
}

.drawing-stage h2 {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: 29px;
}

.drawing-stage p {
    margin: 0;
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
}

.result-overlay {
    overflow: hidden;
    padding:
        max(14px, env(safe-area-inset-top))
        14px
        max(14px, env(safe-area-inset-bottom));
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 219, 132, .18), transparent 44%),
        rgba(31, 20, 17, .84);
}

.result-card {
    position: relative;
    z-index: 3;
    width: min(438px, 100%);
    max-height: min(760px, calc(100vh - 28px));
    max-height: min(760px, calc(100dvh - 28px));
    overflow: auto;
    border: 1px solid rgba(255, 235, 178, .86);
    border-radius: 26px;
    background:
        linear-gradient(180deg, #FFFDF8 0%, #FFF5E1 100%);
    box-shadow:
        0 30px 90px rgba(34, 12, 8, .42),
        0 0 0 6px rgba(255, 247, 226, .08);
    scrollbar-color: rgba(185, 47, 42, .28) transparent;
    scrollbar-width: thin;
    animation: resultEnter .48s cubic-bezier(.2, .8, .22, 1.08) both;
}

.result-card::-webkit-scrollbar {
    width: 5px;
}

.result-card::-webkit-scrollbar-thumb {
    border-radius: 99px;
    background: rgba(185, 47, 42, .24);
}

.result-card::before {
    position: absolute;
    top: -70px;
    right: -45px;
    width: 190px;
    height: 190px;
    content: "";
    pointer-events: none;
    border-radius: 50%;
    background: rgba(255, 225, 150, .12);
}

.result-card-top {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 94px;
    padding: 16px 66px 17px 78px;
    overflow: hidden;
    border-radius: 25px 25px 0 0;
    color: #FFF9E9;
    background:
        radial-gradient(circle at 88% 0%, rgba(255, 222, 139, .2), transparent 34%),
        linear-gradient(135deg, #7F1C1A 0%, #B92F2A 52%, #8E211E 100%);
    box-shadow: 0 10px 24px rgba(111, 29, 27, .22);
}

.result-card-top::before {
    position: absolute;
    inset: 8px;
    content: "";
    pointer-events: none;
    border: 1px solid rgba(255, 235, 180, .25);
    border-radius: 19px;
}

.result-card-top::after {
    position: absolute;
    right: 22px;
    bottom: 0;
    left: 22px;
    height: 3px;
    content: "";
    background: linear-gradient(90deg, transparent, var(--gold-300), transparent);
}

.result-card-top img {
    position: absolute;
    top: 50%;
    left: 19px;
    z-index: 1;
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 7px 12px rgba(58, 8, 6, .34));
    transform: translateY(-50%);
}

.result-heading {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 3px;
    min-width: 0;
    text-align: left;
}

.result-heading small {
    color: rgba(255, 241, 205, .72);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
}

.result-heading strong {
    overflow: hidden;
    color: #FFF9E9;
    font-family: var(--font-display);
    font-size: 25px;
    font-weight: 700;
    letter-spacing: .08em;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.close-result {
    position: absolute;
    top: 50%;
    right: 17px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(255, 240, 200, .26);
    border-radius: 50%;
    color: #FFF7DC;
    background: rgba(255, 255, 255, .1);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background .2s ease, border-color .2s ease;
}

.close-result:hover {
    border-color: rgba(255, 240, 200, .46);
    background: rgba(255, 255, 255, .18);
}

.close-result svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.result-card-main {
    padding: 16px 16px 13px;
    text-align: center;
}

.result-poster {
    display: block;
    width: 100%;
    height: auto;
    border: 7px solid #FFFDF8;
    border-radius: 19px;
    outline: 1px solid rgba(185, 47, 42, .18);
    background: #FFF3D5;
    box-shadow:
        0 16px 34px rgba(94, 31, 22, .17),
        0 0 0 4px rgba(232, 173, 59, .09);
}

.result-fallback {
    padding: 5px 6px 9px;
}

.result-name {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0 0 14px;
    padding: 7px 15px;
    border: 1px solid rgba(185, 47, 42, .1);
    border-radius: 999px;
    color: var(--ink-500);
    background: rgba(255, 255, 255, .66);
    font-size: 13px;
}

.result-name b {
    color: var(--red-900);
}

.lucky-number-wrap {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 206px;
    overflow: hidden;
    border: 1px solid rgba(160, 35, 31, .25);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .74), transparent 44%),
        radial-gradient(circle, rgba(232, 173, 59, .22) 0 1.6px, transparent 2.2px) 0 0 / 16px 16px,
        linear-gradient(145deg, #FFF9E9, #FFE9B9);
    box-shadow:
        inset 0 0 0 7px rgba(255, 255, 255, .42),
        inset 0 0 0 8px rgba(232, 173, 59, .23),
        0 12px 28px rgba(111, 29, 27, .1);
}

.lucky-number-wrap::before {
    position: absolute;
    inset: 12px;
    content: "";
    border: 1px dashed rgba(185, 47, 42, .2);
    border-radius: 12px;
}

.lucky-number-wrap::after {
    position: absolute;
    top: 50%;
    left: 50%;
    content: "签";
    color: rgba(185, 47, 42, .05);
    font-family: var(--font-display);
    font-size: 168px;
    line-height: 1;
    pointer-events: none;
    transform: translate(-50%, -48%) rotate(-9deg);
}

.lucky-label {
    position: relative;
    z-index: 1;
    padding: 6px 15px;
    border: 1px solid rgba(232, 173, 59, .48);
    border-radius: 999px;
    color: var(--red-700);
    background: rgba(255, 253, 247, .92);
    box-shadow: 0 5px 14px rgba(111, 29, 27, .08);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .18em;
}

.lucky-number {
    position: relative;
    z-index: 1;
    display: block;
    max-width: 100%;
    margin: -4px 0 2px;
    color: var(--red-700);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(70px, 21vw, 112px);
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 3px 0 rgba(255, 255, 255, .62);
    word-break: break-word;
}

.result-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    margin: 17px 0 11px;
}

.result-divider span {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(232, 173, 59, .75));
}

.result-divider span:last-child {
    background: linear-gradient(90deg, rgba(232, 173, 59, .75), transparent);
}

.result-divider b {
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    border: 1px solid rgba(185, 47, 42, .38);
    border-radius: 5px;
    color: var(--red-700);
    background: rgba(255, 255, 255, .5);
    font-family: var(--font-display);
    font-size: 16px;
    transform: rotate(-5deg);
}

.result-tip {
    margin: 0;
    color: var(--ink-500);
    font-size: 12px;
}

.result-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 0 16px 18px;
}

.primary-action,
.secondary-action,
.tertiary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 0 13px;
    border-radius: 13px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.result-actions button:active {
    transform: translateY(1px) scale(.99);
}

.primary-action {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 54px;
    border: 1px solid rgba(255, 230, 164, .26);
    color: #fff;
    background:
        radial-gradient(circle at 85% 10%, rgba(255, 230, 164, .2), transparent 38%),
        linear-gradient(145deg, var(--red-500), var(--red-700));
    box-shadow:
        inset 0 0 0 1px rgba(255, 239, 199, .15),
        0 12px 25px rgba(185, 47, 42, .25);
}

.primary-action:hover {
    box-shadow:
        inset 0 0 0 1px rgba(255, 239, 199, .24),
        0 14px 30px rgba(185, 47, 42, .3);
}

.secondary-action {
    grid-column: 1;
    grid-row: 2;
    border: 1px solid rgba(232, 173, 59, .42);
    color: var(--red-900);
    background: linear-gradient(180deg, #FFFDF6, #FFF2D4);
    box-shadow: 0 7px 18px rgba(111, 29, 27, .08);
}

.tertiary-action {
    grid-column: 2;
    grid-row: 2;
    border: 1px solid rgba(27, 138, 120, .24);
    color: var(--jade-700);
    background: linear-gradient(180deg, #F8FFFD, #E6F5EF);
    box-shadow: 0 7px 18px rgba(18, 103, 95, .07);
}

.result-actions button:disabled {
    cursor: wait;
    opacity: .62;
}

.result-actions svg {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.confetti-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.confetti {
    position: absolute;
    top: -12vh;
    left: var(--x);
    width: var(--w);
    height: calc(var(--w) * .55);
    border-radius: 2px;
    background: var(--color);
    animation: confettiFall var(--duration) linear var(--delay) forwards;
}

.toast {
    position: fixed;
    right: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    left: 20px;
    z-index: 200;
    width: fit-content;
    max-width: min(440px, calc(100% - 40px));
    margin: 0 auto;
    padding: 13px 18px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 12px;
    color: #fff;
    background: rgba(23, 45, 46, .94);
    box-shadow: 0 14px 36px rgba(0, 0, 0, .2);
    font-size: 13px;
    line-height: 1.55;
    text-align: center;
    animation: toastIn .28s ease both;
}

.toast.is-error {
    background: rgba(139, 37, 32, .96);
}

.noscript-tip {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 300;
    padding: 14px;
    color: #fff;
    background: var(--red-700);
    text-align: center;
}

@keyframes statusPulse {
    0% { box-shadow: 0 0 0 0 rgba(27, 138, 120, .28); }
    70% { box-shadow: 0 0 0 9px rgba(27, 138, 120, 0); }
    100% { box-shadow: 0 0 0 0 rgba(27, 138, 120, 0); }
}

@keyframes sunTurn {
    to { transform: rotate(360deg); }
}

@keyframes gentleFloat {
    0%, 100% { transform: translateY(0) rotate(-8deg); }
    50% { transform: translateY(-10px) rotate(-4deg); }
}

@keyframes tubeShake {
    0%, 100% { transform: translateX(var(--tx, 0)) rotate(-7deg); }
    50% { transform: translateX(var(--tx, 0)) rotate(8deg); }
}

@keyframes ripple {
    0% { opacity: .8; transform: translateX(-50%) scale(.55); }
    100% { opacity: 0; transform: translateX(-50%) scale(1.45); }
}

@keyframes resultEnter {
    from { opacity: 0; transform: translateY(30px) scale(.94); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes confettiFall {
    0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg); }
    100% { opacity: .9; transform: translate3d(var(--drift), 120vh, 0) rotate(var(--spin)); }
}

@media (max-width: 900px) {
    .hero-section {
        grid-template-columns: 1fr;
        min-height: auto;
        padding-top: 40px;
    }

    .hero-copy,
    .draw-stats,
    .fortune-visual {
        grid-column: 1;
        grid-row: auto;
    }

    .hero-copy {
        max-width: 680px;
    }

    .fortune-visual {
        height: 330px;
        margin-top: 8px;
    }

    .sun-disc {
        right: 15%;
    }

    .mountain {
        right: 0;
    }

    .fortune-tube {
        right: 30%;
    }

    .draw-form {
        grid-template-columns: minmax(0, 1fr) 190px;
    }
}

@media (max-width: 680px) {
    .site-header,
    .front-main,
    .site-footer {
        width: min(100% - 28px, 1180px);
    }

    .front-main {
        display: flex;
        flex-direction: column;
    }

    .site-header {
        min-height: 74px;
    }

    .brand img {
        width: 42px;
        height: 42px;
    }

    .brand strong {
        font-size: 16px;
    }

    .brand small {
        display: none;
    }

    .status-pill {
        min-height: 30px;
        padding: 0 10px;
        font-size: 11px;
    }

    .hero-section {
        display: contents;
    }

    .hero-copy {
        order: 1;
        max-width: none;
        padding: 18px 0 8px;
    }

    .eyebrow {
        margin-bottom: 10px;
        font-size: 11px;
    }

    .hero-copy h1 {
        font-size: clamp(34px, 10vw, 42px);
    }

    .hero-subtitle {
        margin-top: 12px;
        font-size: 14px;
    }

    .draw-stats {
        order: 2;
        justify-content: center;
        margin: 22px 0 4px;
    }

    .draw-stats strong {
        font-size: 27px;
    }

    .fortune-visual {
        order: 4;
        height: 285px;
        margin-top: 0;
        overflow: hidden;
    }

    .sun-disc {
        top: 5px;
        right: 4%;
        width: 185px;
        height: 185px;
    }

    .mountain {
        bottom: 2px;
        width: 108%;
        height: 136px;
    }

    .mountain-back {
        right: -5%;
        bottom: 24px;
        height: 148px;
    }

    .fortune-tube {
        right: 34%;
        bottom: 40px;
        width: 132px;
        height: 190px;
        transform: scale(.88);
        transform-origin: bottom center;
    }

    .seal-one {
        top: 57px;
        left: 2%;
        width: 39px;
        height: 39px;
        font-size: 18px;
    }

    .seal-two {
        right: 3%;
        bottom: 14px;
    }

    .draw-section {
        order: 3;
        padding: 18px 0 34px;
        border-top: 0;
        border-bottom: 1px solid rgba(111, 29, 27, .1);
    }

    .section-heading {
        gap: 12px;
        margin-bottom: 20px;
    }

    .section-index {
        width: 43px;
        height: 43px;
        font-size: 20px;
    }

    .section-heading h2 {
        font-size: 22px;
    }

    .section-heading p {
        font-size: 12px;
    }

    .notice-strip {
        padding: 12px 13px;
    }

    .draw-form {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 20px;
        border-radius: 22px;
    }

    .draw-form label,
    .input-shell,
    .draw-button,
    .proxy-draw-button,
    .form-note {
        grid-column: 1;
    }

    .draw-button {
        width: 100%;
        min-height: 58px;
    }

    .proxy-draw-button {
        width: 100%;
    }

    .input-shell input {
        font-size: 16px;
    }

    .existing-result {
        padding: 23px 18px;
        border-radius: 22px;
    }

    .site-footer {
        gap: 8px;
        padding: 18px 0 22px;
    }

    .footer-main {
        flex-direction: column;
        gap: 4px;
    }

    .footer-main > i {
        display: none;
    }

    .footer-meta {
        gap: 3px 9px;
        font-size: 10px;
    }


    .result-card {
        max-height: min(760px, calc(100vh - 20px));
        max-height: min(760px, calc(100dvh - 20px));
        border-radius: 22px;
    }

    .result-card-top {
        min-height: 86px;
        padding: 14px 58px 14px 68px;
        border-radius: 21px 21px 0 0;
    }

    .result-card-top img {
        left: 16px;
        width: 42px;
        height: 42px;
    }

    .result-heading strong {
        font-size: 22px;
    }

    .close-result {
        right: 14px;
        width: 34px;
        height: 34px;
    }

    .result-card-main {
        padding: 13px 13px 11px;
    }

    .result-actions {
        gap: 8px;
        padding: 0 13px 14px;
    }

    .primary-action,
    .secondary-action,
    .tertiary-action {
        min-height: 48px;
        font-size: 13px;
    }

    .primary-action {
        min-height: 52px;
    }

    .lucky-number-wrap {
        min-height: 182px;
    }
}

@media (max-width: 390px) {
    .status-pill {
        max-width: 114px;
        overflow: hidden;
        white-space: nowrap;
    }

    .result-actions {
        gap: 7px;
        padding-right: 11px;
        padding-left: 11px;
    }

    .secondary-action,
    .tertiary-action {
        padding: 0 8px;
        font-size: 12px;
    }

    .result-actions svg {
        width: 17px;
        height: 17px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
