:root {
    --bg: #f7f8ff;
    --card: rgba(255, 255, 255, .86);
    --text: #101828;
    --muted: #667085;
    --primary: #635bff;
    --primary2: #14b8a6;
    --danger: #ef4444;
    --border: rgba(99, 91, 255, .14);
    --shadow: 0 24px 80px rgba(16, 24, 40, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
code { padding: 3px 7px; border-radius: 8px; background: #eef2ff; color: #4338ca; }
.container { width: min(1160px, calc(100% - 36px)); margin: 0 auto; }
.hidden { display: none !important; }

.app-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 8%, rgba(124, 58, 237, .14), transparent 28%),
        radial-gradient(circle at 88% 18%, rgba(245, 158, 11, .15), transparent 26%),
        linear-gradient(120deg, #fff7ed 0%, #f8fbff 28%, #f5f3ff 54%, #ecfeff 78%, #fff7ed 100%);
    background-size: 120% 120%, 120% 120%, 420% 420%;
    animation: brightGradientFlow 18s ease-in-out infinite;
    position: relative;
    overflow-x: hidden;
}
.app-shell::before,
.app-shell::after {
    content: '';
    position: fixed;
    z-index: 0;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(4px);
    opacity: .9;
    animation: floatingOrb 12s ease-in-out infinite;
}
.app-shell::before { width: 300px; height: 300px; left: -90px; top: 80px; background: radial-gradient(circle, rgba(167, 139, 250, .30), rgba(167, 139, 250, 0) 68%); }
.app-shell::after { width: 360px; height: 360px; right: -140px; bottom: -90px; background: radial-gradient(circle, rgba(251, 191, 36, .28), rgba(251, 191, 36, 0) 70%); animation-delay: -5s; }
.redeem-shell { --shine-a: rgba(255,255,255,.72); }
.redeem-shell .page-public::before {
    content: '';
    position: fixed;
    z-index: -1;
    width: 240px;
    height: 240px;
    left: 58%;
    top: 8%;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(45, 212, 191, .20), rgba(45, 212, 191, 0) 68%);
    animation: floatingOrbAlt 15s ease-in-out infinite;
}
@keyframes brightGradientFlow {
    0%, 100% { background-position: 0% 50%, 100% 50%, 0% 50%; }
    33% { background-position: 18% 36%, 78% 42%, 55% 45%; }
    66% { background-position: 8% 68%, 88% 30%, 100% 60%; }
}
@keyframes floatingOrb {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(34px, -26px, 0) scale(1.08); }
}
@keyframes floatingOrbAlt {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: .78; }
    50% { transform: translate3d(-46px, 30px, 0) scale(1.12); opacity: .96; }
}
.page-public { position: relative; z-index: 1; width: min(920px, calc(100% - 36px)); margin: 0 auto; padding: 56px 0; }
.redeem-hero { text-align: center; margin: 0 auto 22px; max-width: 840px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: #6d28d9; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; font-size: .76rem; }
.eyebrow::before, .eyebrow::after { content: ''; width: 22px; height: 1px; background: rgba(109, 40, 217, .32); }
.redeem-hero h1 { margin: 14px 0 12px; font-size: clamp(2.5rem, 7vw, 5.2rem); line-height: .96; letter-spacing: -.08em; color: #17120b; text-shadow: 0 10px 34px rgba(90, 74, 45, .08); }
.lead { margin: 0 auto; max-width: 760px; color: #655b4b; font-size: 1.02rem; line-height: 1.9; }
.service-notice { margin: 18px 0 0; padding: 15px 18px; border: 1px solid rgba(220, 38, 38, .34); border-left: 5px solid #dc2626; border-radius: 16px; background: linear-gradient(180deg, rgba(254, 242, 242, .92), rgba(254, 226, 226, .72)); color: #dc2626; font-weight: 850; text-align: left; box-shadow: 0 12px 34px rgba(220, 38, 38, .08); }
.redeem-panel { margin-top: 18px; padding: 28px; border-radius: 28px; background: rgba(255,255,255,.76); border: 1px solid rgba(255,255,255,.88); box-shadow: 0 24px 80px rgba(89, 67, 36, .16); backdrop-filter: blur(20px); }
.stack-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 14px; }
.stack-form label { grid-column: 1 / -1; color: #6f665a; font-weight: 900; letter-spacing: .02em; }
.stack-form input { width: 100%; border: 1px solid #eadfce; border-radius: 18px; padding: 17px 18px; background: rgba(255,250,242,.95); color: #201a12; font-size: clamp(1.05rem, 2.4vw, 1.25rem); font-weight: 900; letter-spacing: .08em; outline: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.9); }
.stack-form input::placeholder { color: #b7aa98; }
.stack-form input:focus { border-color: #8b5cf6; box-shadow: 0 0 0 4px rgba(139, 92, 246, .12), inset 0 1px 0 rgba(255,255,255,.9); }
.stack-form button, .button-row button { border: 0; border-radius: 16px; padding: 16px 24px; cursor: pointer; font-weight: 900; transition: .18s ease; white-space: nowrap; }
.stack-form button { min-width: 138px; color: white; background: linear-gradient(135deg, #5b5cf6, #8b5cf6); box-shadow: 0 16px 34px rgba(99,91,255,.26); }
.stack-form button:disabled, .button-row button:disabled { opacity: .58; cursor: not-allowed; box-shadow: none; }
.stack-form button:not(:disabled):hover, .button-row button:not(:disabled):hover { transform: translateY(-2px); }
.message { color: #655b4b; line-height: 1.75; margin: 16px 0 0; }
.message.error { color: #dc2626; font-weight: 900; }
.message.success { color: #166534; font-weight: 900; }
.message.info { color: #6d28d9; font-weight: 900; }
.status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.status-grid > div { min-width: 0; padding: 18px; border-radius: 20px; background: linear-gradient(180deg, rgba(255,250,242,.95), rgba(250,245,235,.78)); border: 1px solid rgba(234, 223, 206, .82); }
.label { display: block; color: #8a7b68; margin-bottom: 10px; font-size: .86rem; font-weight: 800; }
.status-grid strong { display: block; color: #1f160c; font-size: 1.12rem; word-break: break-word; }
.phone-line { display: flex; align-items: center; gap: 10px; }
.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; border: 0; border-radius: 13px; background: #efe4d2; color: #33291b; cursor: pointer; transition: .18s ease; }
.icon-button:not(:disabled):hover { transform: translateY(-1px); background: #e7d8bf; }
.icon-button:disabled { opacity: .55; cursor: not-allowed; }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.button-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 24px; }
.button-row .secondary { background: #efe4d2; color: #3a2f21; box-shadow: 0 10px 22px rgba(90, 74, 45, .10); }
.button-row .danger { background: linear-gradient(135deg, #e58b7f, #dc7268); color: white; box-shadow: 0 12px 26px rgba(220, 114, 104, .22); }
.cancel-control { display: flex; align-items: center; gap: 12px; }
.countdown { color: #8a6d3b; font-size: .92rem; font-weight: 900; }

.site-header { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(18px); background: rgba(247, 248, 255, .78); border-bottom: 1px solid rgba(255,255,255,.75); }
.nav { height: 74px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 850; }
.brand-mark { width: 38px; height: 38px; border-radius: 14px; display: inline-grid; place-items: center; color: white; background: linear-gradient(135deg, var(--primary), var(--primary2)); box-shadow: 0 14px 30px rgba(99,91,255,.28); font-weight: 900; }
.brand-mark.large { width: 62px; height: 62px; border-radius: 22px; font-size: 1.8rem; }
.nav-links { display: flex; gap: 24px; color: var(--muted); font-weight: 650; }
.nav-links a:hover { color: var(--primary); }
.btn { border: 0; border-radius: 999px; padding: 13px 22px; display: inline-flex; justify-content: center; align-items: center; cursor: pointer; font-weight: 850; transition: .2s ease; }
.btn.primary { color: white; background: linear-gradient(135deg, var(--primary), #7c3aed); box-shadow: 0 16px 34px rgba(99,91,255,.28); }
.btn.ghost { background: white; border: 1px solid var(--border); color: #344054; }
.btn.full { width: 100%; }
.btn:hover { transform: translateY(-2px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

.admin-body { min-height: 100vh; background: #f5f7fb; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(430px, 100%); border-radius: 32px; padding: 34px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.8); }
.login-card h1 { margin: 18px 0 6px; letter-spacing: -.05em; }
.login-card p, .form-msg, .back-link { color: var(--muted); }
.form-stack { display: grid; gap: 16px; margin-top: 24px; }
.form-stack label { display: grid; gap: 8px; font-weight: 750; }
.form-stack input { width: 100%; border: 1px solid #d0d5dd; border-radius: 16px; padding: 13px 15px; font-size: 1rem; outline: none; }
.form-stack input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99,91,255,.12); }
.form-msg { min-height: 22px; }
.form-msg.error { color: var(--danger); }
.back-link { display: inline-block; margin-top: 18px; }
.admin-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: #101828; color: white; padding: 24px 18px; }
.sidebar .brand { margin-bottom: 28px; }
.side-link { width: 100%; border: 0; color: #cbd5e1; background: transparent; padding: 13px 14px; border-radius: 16px; text-align: left; cursor: pointer; font-weight: 800; margin-bottom: 8px; }
.side-link:hover, .side-link.active { background: rgba(255,255,255,.10); color: white; }
.side-link.danger { color: #fecaca; }
.admin-main { padding: 30px; overflow: auto; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.admin-topbar h1 { margin: 5px 0 0; letter-spacing: -.05em; }
.status-pill { border-radius: 999px; padding: 10px 14px; color: #065f46; background: #d1fae5; font-weight: 850; }
.admin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 18px; }
.stat { border-radius: 24px; padding: 24px; }
.stat strong { display: block; font-size: 1.8rem; letter-spacing: -.04em; }
.stat span { color: var(--muted); }
.panel, .stat { background: var(--card); border: 1px solid rgba(255,255,255,.8); box-shadow: 0 16px 50px rgba(16,24,40,.08); backdrop-filter: blur(18px); }
.panel { border-radius: 26px; padding: 26px; margin-bottom: 18px; }
.panel h2 { margin: 8px 0 10px; font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.05em; }
.nice-list { line-height: 2; color: #475467; }
.info-list p { padding: 12px 0; border-bottom: 1px solid #eef2f7; }
.console-box { margin-top: 18px; min-height: 260px; max-height: 460px; overflow: auto; padding: 18px; border-radius: 18px; background: #0b1220; color: #dbeafe; white-space: pre-wrap; }
.update-status-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.update-status-card > div { border: 1px solid #eef2ff; border-radius: 18px; padding: 16px; background: #f8fafc; }
.update-status-card span { display: block; margin-bottom: 6px; }
.update-status-card strong { font-size: 1.35rem; letter-spacing: -.03em; }

.install-body { min-height: 100vh; background: #eef2ff; }
.install-page { min-height: 100vh; display: grid; place-items: center; padding: 36px 18px; }
.install-card { width: min(1120px, 100%); display: grid; grid-template-columns: .9fr 1.1fr; overflow: hidden; border-radius: 34px; background: rgba(255,255,255,.86); box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.82); backdrop-filter: blur(18px); }
.install-hero { padding: 46px; color: white; background: radial-gradient(circle at 20% 18%, rgba(255,255,255,.22), transparent 30%), linear-gradient(145deg, #4f46e5, #7c3aed); }
.install-hero h1 { margin: 22px 0 14px; font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.05; letter-spacing: -.06em; }
.install-hero p { line-height: 1.85; color: rgba(255,255,255,.84); }
.install-tips { display: grid; gap: 12px; margin-top: 28px; }
.install-tips span { padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.18); font-weight: 800; }
.install-form-wrap { padding: 42px; }
.install-form-wrap h2 { margin: 0 0 10px; font-size: 2rem; letter-spacing: -.05em; }
.muted { color: var(--muted); line-height: 1.7; }
.alert { padding: 13px 15px; border-radius: 16px; margin: 16px 0; font-weight: 750; }
.alert.danger { color: #991b1b; background: #fee2e2; }
.alert.success { color: #166534; background: #dcfce7; }
.install-form { display: grid; gap: 18px; margin-top: 22px; }
.install-form h3 { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; font-size: 1.05rem; }
.install-form h3 span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; color: white; background: linear-gradient(135deg, var(--primary), #7c3aed); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.form-grid label { display: grid; gap: 8px; font-weight: 800; color: #344054; }
.form-grid label.wide { grid-column: 1 / -1; }
.form-grid input { width: 100%; border: 1px solid #d0d5dd; border-radius: 16px; padding: 13px 15px; font-size: 1rem; outline: none; }
.form-grid input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99,91,255,.12); }
.done-box { min-height: 420px; display: flex; flex-direction: column; justify-content: center; }
.done-box h2 { font-size: 2.4rem; }

@media (max-width: 900px) {
    .page-public { padding: 34px 0; }
    .stack-form { grid-template-columns: 1fr; }
    .stack-form button { width: 100%; }
    .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .button-row { align-items: stretch; flex-direction: column; }
    .cancel-control { align-items: stretch; flex-direction: column; }
    .admin-shell { grid-template-columns: 1fr; }
    .install-card { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .update-status-card { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .status-grid { grid-template-columns: 1fr; }
    .redeem-panel { padding: 20px; }
    .service-notice { font-size: .95rem; }
}
