/* =====================================================================
 *  auth_demo  · 复刻 AB 互联登录页视觉  +  扩展到注册/找回/重置/后台
 *  Independent stylesheet -- not coupled to any abapp asset.
 * ===================================================================== */

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #e2e8f0;
    background: #0b1220;
}
button { font-family: inherit; }

a { color: #fbbf24; text-decoration: none; }
a:hover { text-decoration: underline; }

/* =========================================================
 * 1. Page background (aurora / grid / glow / streams / particles)
 * ========================================================= */
.login-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 60px 16px 40px;
    background: linear-gradient(160deg, #0b1220 0%, #131a36 45%, #1a1238 100%);
}
.login-scene {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.login-aurora {
    position: absolute;
    inset: -10%;
    background:
        radial-gradient(circle at 20% 25%, rgba(56, 189, 248, 0.28),  transparent 45%),
        radial-gradient(circle at 78% 22%, rgba(167, 139, 250, 0.26), transparent 50%),
        radial-gradient(circle at 50% 90%, rgba(251, 191, 36, 0.18),  transparent 55%);
    filter: blur(40px);
    opacity: 0.85;
    animation: aurora-shift 14s ease-in-out infinite alternate;
}
@keyframes aurora-shift {
    0%   { transform: scale(1)    rotate(0deg); }
    100% { transform: scale(1.05) rotate(2deg); }
}
.login-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.login-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    animation: glow-float 10s ease-in-out infinite;
}
.login-glow-one   { width: 320px; height: 320px; left:  10%; top:  20%;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.45), transparent 70%); }
.login-glow-two   { width: 360px; height: 360px; right:  8%; top:  40%; animation-delay: -3s;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.45), transparent 70%); }
.login-glow-three { width: 260px; height: 260px; left:  35%; bottom:  -8%; animation-delay: -6s;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.35), transparent 70%); }
@keyframes glow-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(15px, -20px) scale(1.05); }
}

/* gentle vertical light streams */
.login-stream {
    position: absolute;
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(251, 191, 36, 0.4), transparent);
    animation: stream-fall 6s linear infinite;
    opacity: 0.55;
}
.login-stream-one   { left: 15%;  animation-duration: 7s;  }
.login-stream-two   { left: 55%;  animation-duration: 8s; animation-delay: -2s; }
.login-stream-three { right: 18%; animation-duration: 6s; animation-delay: -4s; }
@keyframes stream-fall {
    0%   { transform: translateY(-100%); }
    100% { transform: translateY(100%);  }
}

.login-particles { position: absolute; inset: 0; }
.login-particle {
    position: absolute;
    width: 4px; height: 4px; border-radius: 50%;
    background: rgba(254, 240, 138, 0.85);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.7);
    animation: particle-rise 8s linear infinite;
    opacity: 0;
}
.login-particle-1 { left: 10%; animation-delay: 0s;   }
.login-particle-2 { left: 22%; animation-delay: 1.2s; }
.login-particle-3 { left: 38%; animation-delay: 2.4s; }
.login-particle-4 { left: 50%; animation-delay: 3.6s; }
.login-particle-5 { left: 62%; animation-delay: 4.8s; }
.login-particle-6 { left: 74%; animation-delay: 6.0s; }
.login-particle-7 { left: 86%; animation-delay: 7.2s; }
.login-particle-8 { left: 95%; animation-delay: 8.4s; }
@keyframes particle-rise {
    0%   { transform: translateY(110vh) scale(0.8); opacity: 0; }
    10%  { opacity: 0.9; }
    90%  { opacity: 0.4; }
    100% { transform: translateY(-10vh) scale(1.1); opacity: 0; }
}

/* =========================================================
 * 2. Card shell
 * ========================================================= */
.login-shell {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 440px;
}
.login-tip {
    margin: 18px 0 0;
    color: rgba(203, 213, 225, 0.55);
    font-size: 12px;
    letter-spacing: 0.5px;
    text-align: center;
}
.login-card {
    width: 100%;
    background:
        radial-gradient(ellipse 70% 55% at 50% 0%, rgba(251, 191, 36, 0.18) 0%, rgba(220, 38, 38, 0.08) 30%, transparent 65%),
        rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    padding: 60px 32px 30px;
    color: #e2e8f0;
    box-shadow:
        0 30px 70px rgba(2, 6, 23, 0.55),
        inset 0 1px 0 rgba(251, 191, 36, 0.35),
        inset 0 -1px 0 rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: -36px;
    position: relative;
}
.login-card::before {
    content: '';
    position: absolute;
    top: -1px; left: 18%; right: 18%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.85), rgba(220, 38, 38, 0.7), rgba(251, 191, 36, 0.85), transparent);
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
    pointer-events: none;
}
.login-card::after {
    content: '';
    position: absolute;
    top: 8px; left: 12px; right: 12px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    pointer-events: none;
}

.mood-sad .login-card { animation: shake 0.36s ease-in-out 2; }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-6px); }
    75%      { transform: translateX(6px); }
}

.login-brand        { text-align: center; margin-bottom: 6px; }
.login-brand-title  {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    background: linear-gradient(135deg, #fef9c3 0%, #fcd34d 50%, #f59e0b 100%);
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
    letter-spacing: 2px;
}
.login-brand-sub {
    margin: 6px 0 0;
    color: rgba(203, 213, 225, 0.6);
    font-size: 12px;
    letter-spacing: 4px;
}

.login-card label  { display: flex; flex-direction: column; gap: 6px; }
.login-card label > span:first-child {
    color: rgba(226, 232, 240, 0.78);
    font-size: 12px;
    letter-spacing: 1px;
}
.login-card input,
.login-card select,
.login-card textarea {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    width: 100%;
    outline: none;
}
.login-card input::placeholder { color: rgba(148, 163, 184, 0.55); }
.login-card input:focus,
.login-card select:focus,
.login-card textarea:focus {
    border-color: rgba(251, 191, 36, 0.6);
    background:   rgba(15, 23, 42, 0.6);
    box-shadow:   0 0 0 3px rgba(251, 191, 36, 0.18);
}
.login-card .input-error { border-color: rgba(248, 113, 113, 0.6); }
.field-error { color: #fca5a5; font-size: 12px; }

.login-error {
    margin: 4px 0 0;
    color: #fca5a5;
    font-size: 13px;
    text-align: center;
}
.login-error-cheer {
    display: block;
    margin-top: 4px;
    color: #fde68a;
    font-size: 12px;
    animation: cheer-pop 0.5s ease-out;
}
@keyframes cheer-pop {
    0%   { transform: scale(0.6); opacity: 0; }
    70%  { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

.primary-btn {
    margin-top: 6px;
    background: linear-gradient(135deg, #dc2626, #f59e0b);
    color: #fff;
    border: 0;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 18px 36px rgba(220, 38, 38, 0.4);
}
.primary-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 22px 44px rgba(245, 158, 11, 0.5);
}
.primary-btn:disabled { opacity: 0.7; cursor: not-allowed; }

.ghost-btn {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #e2e8f0;
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.ghost-btn:hover { background: rgba(15, 23, 42, 0.8); border-color: rgba(251, 191, 36, 0.4); }

.aux-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: rgba(203, 213, 225, 0.6);
    margin-top: 4px;
}

/* password input wrapper with eye toggle */
.password-input { position: relative; }
.password-input input { padding-right: 42px; }
.password-toggle {
    position: absolute;
    right: 8px; top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 16px;
    color: rgba(226, 232, 240, 0.7);
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}
.password-toggle:hover { background: rgba(255, 255, 255, 0.06); }

/* captcha row */
.captcha-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
.captcha-row input { flex: 1; }
.captcha-img {
    height: 46px;
    width: 130px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #0d111d;
    cursor: pointer;
    object-fit: cover;
}
.captcha-img:hover { border-color: rgba(251, 191, 36, 0.5); }

/* =========================================================
 * 3. Buddies row
 * ========================================================= */
.buddies {
    position: relative;
    z-index: 5;
    isolation: isolate;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 12px;
    padding: 0 8px 0;
    pointer-events: none;
    width: 100%;
}
.buddy {
    pointer-events: auto;
    position: relative;
    width: 96px; height: 110px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: filter 0.4s, opacity 0.4s;
}
.buddy::before {
    content: '';
    position: absolute;
    bottom: -10px; left: 50%;
    transform: translateX(-50%);
    width: 78%;
    height: 18px;
    background: radial-gradient(ellipse, rgba(251, 191, 36, 0.42) 0%, rgba(220, 38, 38, 0.18) 45%, transparent 75%);
    filter: blur(6px);
    pointer-events: none;
    z-index: -1;
    animation: spotlight-pulse 4s ease-in-out infinite;
}
.buddy-1::before { animation-delay: 0.5s; }
.buddy-2::before { animation-delay: 1.0s; }
.buddy-3::before { animation-delay: 1.5s; }
@keyframes spotlight-pulse {
    0%, 100% { opacity: 0.85; transform: translateX(-50%) scale(1);   }
    50%      { opacity: 1;     transform: translateX(-50%) scale(1.08); }
}

.buddy-0 { animation: buddy-bob 4.2s ease-in-out infinite; }
.buddy-1 { animation: buddy-bob 4.2s ease-in-out infinite 0.5s; }
.buddy-2 { animation: buddy-bob 4.2s ease-in-out infinite 1.0s; }
.buddy-3 { animation: buddy-bob 4.2s ease-in-out infinite 1.5s; }
@keyframes buddy-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
}

.buddies-curious .buddy { animation-duration: 1.6s; }
.buddies-sleeping .buddy { animation-duration: 8s;   opacity: 0.55; }
.buddies-yawning .buddy  { animation-duration: 6s;   opacity: 0.78; }
.buddies-shy .buddy      { opacity: 0.85; transform: translateY(2px) scale(0.95); }
.buddies-sad .buddy      { filter: grayscale(45%) saturate(0.7) brightness(0.92); }

.buddy-poked .buddy-body  { animation: buddy-squash 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes buddy-squash {
    0%   { transform: scale(1, 1); }
    25%  { transform: scale(1.18, 0.82); }
    55%  { transform: scale(0.92, 1.12); }
    80%  { transform: scale(1.04, 0.96); }
    100% { transform: scale(1, 1); }
}

.buddy-jumping { animation: buddy-jump 0.42s cubic-bezier(0.22, 1, 0.36, 1) !important; }
@keyframes buddy-jump {
    0%   { transform: translateY(0); }
    40%  { transform: translateY(-14px); }
    60%  { transform: translateY(-12px); }
    100% { transform: translateY(0); }
}

.buddies-wave .buddy-0 { animation: buddy-wave 0.45s ease-in-out 3; }
.buddies-wave .buddy-1 { animation: buddy-wave 0.45s ease-in-out 3 0.12s; }
.buddies-wave .buddy-2 { animation: buddy-wave 0.45s ease-in-out 3 0.24s; }
.buddies-wave .buddy-3 { animation: buddy-wave 0.45s ease-in-out 3 0.36s; }
@keyframes buddy-wave {
    0%, 100% { transform: translateY(0)    rotate(0); }
    25%      { transform: translateY(-12px) rotate(-8deg); }
    75%      { transform: translateY(-12px) rotate(8deg);  }
}

.buddy-body {
    position: relative;
    width: 96px; height: 110px;
    transform-origin: bottom center;
    transition: transform 0.2s;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.55));
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.buddy-img {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
    display: block;
    transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}
.buddy:hover .buddy-body { transform: translateY(-3px) scale(1.08); }

.speech-bubble {
    position: absolute;
    bottom: 100%; left: 50%;
    transform: translate(-50%, -2px);
    background: linear-gradient(135deg, #fef9c3 0%, #fcd34d 100%);
    color: #7c2d12;
    padding: 6px 12px;
    border-radius: 14px;
    border: 1.5px solid #b45309;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    z-index: 4;
    pointer-events: none;
    animation: bubble-in 0.18s ease-out;
}
@keyframes bubble-in {
    0%   { opacity: 0; transform: translate(-50%, 4px) scale(0.8); }
    100% { opacity: 1; transform: translate(-50%, -2px) scale(1);  }
}
.speech-bubble-tail {
    position: absolute;
    bottom: -5px; left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 8px; height: 8px;
    background: #fcd34d;
    border-right:  1.5px solid #b45309;
    border-bottom: 1.5px solid #b45309;
}
.combo-bubble {
    background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 60%, #f97316 100%);
    border-color: #b45309;
    color: #7c2d12;
    font-weight: 800;
    box-shadow: 0 8px 22px rgba(220, 38, 38, 0.45), 0 0 0 2px rgba(254, 240, 138, 0.5);
    animation: combo-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.combo-bubble .speech-bubble-tail {
    background: #f97316;
    border-right-color: #b45309;
    border-bottom-color: #b45309;
}
@keyframes combo-pop {
    0%   { transform: translate(-50%, 6px) scale(0.5);  }
    60%  { transform: translate(-50%, -6px) scale(1.18); }
    100% { transform: translate(-50%, -2px) scale(1);    }
}

.poke-bang {
    position: absolute;
    top: -12px; left: 50%;
    transform: translate(-50%, 0);
    font-size: 22px;
    font-weight: 800;
    color: #fbbf24;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    z-index: 5;
    pointer-events: none;
    animation: poke-pop 0.5s ease-out;
}
@keyframes poke-pop {
    0%   { opacity: 0; transform: translate(-50%, 8px) scale(0.4);   }
    60%  { opacity: 1; transform: translate(-50%, -10px) scale(1.3); }
    100% { opacity: 1; transform: translate(-50%, -4px) scale(1);    }
}

.snore {
    position: absolute;
    top: -2px; right: 4px;
    color: rgba(226, 232, 240, 0.85);
    font-style: italic;
    font-weight: 700;
    font-size: 16px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.55);
    animation: snore-rise 2s ease-out infinite;
    z-index: 4;
}
@keyframes snore-rise {
    0%   { transform: translate(0, 0)     scale(0.6); opacity: 0; }
    30%  { opacity: 1; }
    100% { transform: translate(8px, -16px) scale(1.1); opacity: 0; }
}

.caps-banner {
    position: absolute;
    top: -30px; left: 50%;
    transform: translate(-50%, 0);
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1f2937;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
    z-index: 5;
    pointer-events: none;
    animation: bubble-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.caps-banner::after {
    content: '';
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%);
    width: 2px; height: 8px;
    background: #1f2937;
}

.buddy-effects {
    position: absolute; inset: 0;
    pointer-events: none;
    overflow: visible;
    z-index: 4;
}
.buddy-effect {
    position: absolute;
    top: 30%; left: 50%;
    transform: translate(-50%, 0);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
    animation: buddy-effect-fly 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    opacity: 0;
    will-change: transform, opacity;
}
@keyframes buddy-effect-fly {
    0%   { opacity: 0; transform: translate(-50%, 8px) rotate(0); }
    18%  { opacity: 1; }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--angle, 0px)), calc(-1 * var(--dist, 80px))) rotate(var(--rot, 0deg));
    }
}

.buddy-alert .buddy-body { animation: buddy-alert-shake 0.7s ease-in-out infinite; }
@keyframes buddy-alert-shake {
    0%, 100% { transform: translateY(0)    rotate(0);    }
    25%      { transform: translateY(-3px) rotate(-4deg); }
    75%      { transform: translateY(-3px) rotate(4deg);  }
}

.confetti-layer {
    position: absolute; inset: 0;
    pointer-events: none;
    overflow: visible;
}
.confetti-piece {
    position: absolute;
    bottom: 50%;
    width: 8px; height: 12px;
    border-radius: 2px;
    animation: confetti-fly 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.confetti-shape-1 { width: 10px; height: 10px; border-radius: 50%; }
.confetti-shape-2 { width: 6px;  height: 14px; border-radius: 1px; }
.confetti-shape-3 { width: 12px; height: 8px;  border-radius: 50% / 60%; }
@keyframes confetti-fly {
    0%   { transform: translate(-50%, 0) rotate(0); opacity: 1; }
    100% {
        transform: translate(calc(-50% + var(--drift, 0px)), calc(-1 * var(--dist, 100px))) rotate(720deg);
        opacity: 0;
    }
}

/* =========================================================
 * 4. Celebration overlay (login success)
 * ========================================================= */
.celebration-rain {
    position: fixed; inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 65;
}
.celebration-piece {
    position: absolute;
    top: -6%;
    transform: translate(-50%, 0);
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    animation: celebration-fall linear forwards;
    will-change: transform, opacity;
}
@keyframes celebration-fall {
    0%   { transform: translate(-50%, -10vh) rotate(0); opacity: 0; }
    8%   { opacity: 1; }
    100% { transform: translate(calc(-50% + var(--drift, 0px)), 110vh) rotate(var(--rot, 360deg)); opacity: 0.95; }
}
.celebration-banner-wrap {
    position: fixed; inset: 0;
    z-index: 60;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    animation: bg-fade-in 0.5s ease-out;
}
@keyframes bg-fade-in { 0% { opacity: 0; } 100% { opacity: 1; } }
.celebration-banner-bg {
    position: absolute; inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(2, 6, 23, 0.72) 0%, rgba(2, 6, 23, 0.55) 28%, transparent 60%);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.celebration-banner {
    position: relative;
    z-index: 1;
    font-size: clamp(40px, 7.5vw, 88px);
    font-weight: 900;
    letter-spacing: 0.18em;
    background: linear-gradient(135deg, #fef9c3 0%, #fcd34d 35%, #f59e0b 65%, #dc2626 100%);
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(124, 45, 18, 0.55);
    filter: drop-shadow(0 6px 18px rgba(220, 38, 38, 0.5)) drop-shadow(0 0 14px rgba(251, 191, 36, 0.4));
    animation: banner-pop-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), banner-glow 1.6s ease-in-out 0.6s infinite alternate;
}
.celebration-banner-sub {
    position: relative;
    z-index: 1;
    font-size: clamp(13px, 1.4vw, 17px);
    color: #fef3c7;
    letter-spacing: 0.45em;
    padding-left: 0.45em;
    text-shadow: 0 2px 12px rgba(220, 38, 38, 0.7);
    opacity: 0;
    animation: sub-fade-in 0.6s ease-out 0.2s forwards;
}
@keyframes banner-pop-in {
    0%   { opacity: 0; transform: scale(0.4) rotate(-6deg); }
    65%  { opacity: 1; transform: scale(1.12) rotate(2deg);  }
    100% { opacity: 1; transform: scale(1) rotate(0);        }
}
@keyframes banner-glow {
    0%   { filter: drop-shadow(0 6px 18px rgba(220, 38, 38, 0.5)) drop-shadow(0 0 10px rgba(251, 191, 36, 0.35)); }
    100% { filter: drop-shadow(0 6px 22px rgba(220, 38, 38, 0.7)) drop-shadow(0 0 24px rgba(251, 191, 36, 0.65)); }
}
@keyframes sub-fade-in {
    0%   { opacity: 0;    transform: translateY(8px); }
    100% { opacity: 0.92; transform: translateY(0);   }
}

/* =========================================================
 * 5. Dashboard / inner pages (post-login)
 * ========================================================= */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    background: linear-gradient(180deg, rgba(11, 18, 32, 0.95), rgba(11, 18, 32, 0.85));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.app-title {
    margin: 0;
    font-size: 17px;
    background: linear-gradient(135deg, #fef9c3 0%, #fcd34d 50%, #f59e0b 100%);
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
    letter-spacing: 1.5px;
}
.app-nav {
    display: flex;
    gap: 4px;
    flex: 1;
}
.app-nav button {
    background: transparent;
    border: 0;
    color: rgba(226, 232, 240, 0.75);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s, color 0.2s;
}
.app-nav button.active,
.app-nav button:hover {
    background: rgba(251, 191, 36, 0.12);
    color: #fcd34d;
}
.app-userbox {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(226, 232, 240, 0.85);
    font-size: 13px;
}
.role-badge {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    background: rgba(251, 191, 36, 0.18);
    color: #fcd34d;
    border: 1px solid rgba(251, 191, 36, 0.35);
}
.role-badge.admin { background: rgba(220, 38, 38, 0.2); color: #fca5a5; border-color: rgba(248, 113, 113, 0.4); }

.app-main { padding: 28px 32px; max-width: 1360px; margin: 0 auto; width: 100%; }
.card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 18px;
    backdrop-filter: blur(8px);
}
.card h2 { margin: 0 0 12px; font-size: 16px; color: #fcd34d; letter-spacing: 1px; }
.kv {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 8px 14px;
    font-size: 13px;
    color: rgba(226, 232, 240, 0.85);
}
.kv > b { color: rgba(203, 213, 225, 0.6); font-weight: normal; }

.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.tbl th, .tbl td {
    text-align: left;
    padding: 16px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(226, 232, 240, 0.85);
    line-height: 1.55;
    vertical-align: middle;
}
.tbl th {
    color: rgba(251, 191, 36, 0.85);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 1px;
    padding-top: 12px;
    padding-bottom: 12px;
    white-space: nowrap;
}
.tbl tr:hover td { background: rgba(255, 255, 255, 0.03); }
.tbl .ok   { color: #6ee7b7; font-weight: 600; }
.tbl .fail { color: #fca5a5; font-weight: 600; }
.tbl .nowrap { white-space: nowrap; }
.tbl .col-time { white-space: nowrap; font-size: 12px; color: rgba(226, 232, 240, 0.7); }
.tbl .col-vip  { white-space: nowrap; min-width: 160px; }
.tbl .col-actions {
    min-width: 320px;
    padding-top: 12px;
    padding-bottom: 12px;
}
.tbl .col-actions .actions-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.tbl-btn {
    margin: 0 !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    letter-spacing: 0 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    line-height: 1.4 !important;
    white-space: nowrap;
}
.tbl-btn.primary-btn {
    box-shadow: 0 6px 14px rgba(220, 38, 38, 0.28) !important;
}
.tbl-btn.primary-btn.vip {
    background: linear-gradient(135deg, #a855f7, #6366f1) !important;
    box-shadow: 0 6px 14px rgba(99, 102, 241, 0.32) !important;
}
.danger-btn {
    background: rgba(220, 38, 38, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, 0.45);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.danger-btn:hover:not(:disabled) {
    background: rgba(220, 38, 38, 0.4);
    border-color: rgba(248, 113, 113, 0.8);
    color: #fff;
}

.toast {
    position: fixed;
    top: 18px; left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    padding: 10px 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fef9c3, #fcd34d);
    color: #7c2d12;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    animation: toast-in 0.3s ease-out;
}
.toast.err { background: linear-gradient(135deg, #fecaca, #f87171); color: #7f1d1d; }
@keyframes toast-in {
    0%   { opacity: 0; transform: translate(-50%, -8px); }
    100% { opacity: 1; transform: translate(-50%, 0);    }
}

/* =========================================================
 * 6. Generic form fields inside dashboard cards
 * ========================================================= */
.card label  { display: flex; flex-direction: column; gap: 6px; }
.card label > span:first-child {
    color: rgba(226, 232, 240, 0.78);
    font-size: 12px;
    letter-spacing: 1px;
}
.card input,
.card select,
.card textarea {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    width: 100%;
    outline: none;
    font-family: inherit;
}
.card input::placeholder,
.card textarea::placeholder { color: rgba(148, 163, 184, 0.5); }
.card input:focus,
.card select:focus,
.card textarea:focus {
    border-color: rgba(251, 191, 36, 0.6);
    background:   rgba(15, 23, 42, 0.6);
    box-shadow:   0 0 0 3px rgba(251, 191, 36, 0.18);
}
.card .input-error { border-color: rgba(248, 113, 113, 0.6); }

/* Hide spinner arrows on number inputs to keep the look clean */
.card input[type=number]::-webkit-inner-spin-button,
.card input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.card input[type=number] { -moz-appearance: textfield; }

/* =========================================================
 * 7. Modal (adjust points, etc.)
 * ========================================================= */
.modal-mask {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 20px;
    animation: modal-fade 0.18s ease-out;
}
@keyframes modal-fade {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}
.modal-panel {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(251, 191, 36, 0.18) 0%, rgba(220, 38, 38, 0.06) 28%, transparent 60%),
        rgba(15, 23, 42, 0.94);
    border: 1px solid rgba(251, 191, 36, 0.42);
    border-radius: 22px;
    padding: 26px 26px 22px;
    color: #e2e8f0;
    box-shadow:
        0 30px 70px rgba(2, 6, 23, 0.65),
        inset 0 1px 0 rgba(251, 191, 36, 0.45);
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: modal-pop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modal-pop {
    0%   { opacity: 0; transform: translateY(10px) scale(0.94); }
    100% { opacity: 1; transform: translateY(0)    scale(1);    }
}
.modal-panel h2 {
    margin: 0;
    font-size: 18px;
    color: #fcd34d;
    letter-spacing: 2px;
    text-align: center;
}
/* form fields inside the modal use the same dark glass look as .card */
.modal-panel label  { display: flex; flex-direction: column; gap: 6px; }
.modal-panel label > span:first-child {
    color: rgba(226, 232, 240, 0.78);
    font-size: 12px;
    letter-spacing: 1px;
}
.modal-panel input,
.modal-panel select,
.modal-panel textarea {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    width: 100%;
    outline: none;
    font-family: inherit;
}
.modal-panel input::placeholder,
.modal-panel textarea::placeholder { color: rgba(148, 163, 184, 0.5); }
.modal-panel input:focus,
.modal-panel select:focus,
.modal-panel textarea:focus {
    border-color: rgba(251, 191, 36, 0.6);
    background:   rgba(15, 23, 42, 0.6);
    box-shadow:   0 0 0 3px rgba(251, 191, 36, 0.18);
}
.modal-panel .input-error { border-color: rgba(248, 113, 113, 0.6); }
.modal-target {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    font-size: 13px;
}
.modal-target .target-info {
    display: flex; flex-direction: column; gap: 2px;
}
.modal-target .target-name { font-weight: 600; color: rgba(226, 232, 240, 0.95); font-size: 14px; }
.modal-target .target-id   { color: rgba(148, 163, 184, 0.7); font-size: 11px; letter-spacing: 0.5px; }
.modal-target .target-points {
    color: #fcd34d;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.5px;
}
.sign-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.sign-btn {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(226, 232, 240, 0.85);
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}
.sign-btn:hover { border-color: rgba(251, 191, 36, 0.5); }
.sign-btn.plus.active {
    background: linear-gradient(135deg, rgba(110, 231, 183, 0.24), rgba(56, 189, 248, 0.16));
    border-color: rgba(110, 231, 183, 0.6);
    color: #6ee7b7;
    box-shadow: 0 8px 22px rgba(110, 231, 183, 0.18);
}
.sign-btn.minus.active {
    background: linear-gradient(135deg, rgba(252, 165, 165, 0.24), rgba(248, 113, 113, 0.16));
    border-color: rgba(252, 165, 165, 0.6);
    color: #fca5a5;
    box-shadow: 0 8px 22px rgba(252, 165, 165, 0.18);
}
.amount-field { display: flex; flex-direction: column; gap: 8px; }
.amount-field > span:first-child {
    color: rgba(226, 232, 240, 0.78);
    font-size: 12px;
    letter-spacing: 1px;
    text-align: center;
}
.amount-field input {
    text-align: center;
    font-size: 26px !important;
    font-weight: 700;
    letter-spacing: 3px;
    padding: 14px 14px !important;
    color: #fcd34d !important;
    background: rgba(15, 23, 42, 0.6) !important;
}
.amount-field input::placeholder {
    color: rgba(226, 232, 240, 0.22);
    font-weight: 400;
    letter-spacing: 1px;
    font-size: 16px;
}
.amount-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}
.quick-btn {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(226, 232, 240, 0.85);
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.18s;
}
.quick-btn:hover {
    border-color: rgba(251, 191, 36, 0.55);
    color: #fcd34d;
    background: rgba(251, 191, 36, 0.08);
}
.modal-preview {
    text-align: center;
    color: rgba(226, 232, 240, 0.75);
    font-size: 13px;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px dashed rgba(251, 191, 36, 0.25);
    border-radius: 10px;
}
.modal-preview strong {
    color: #fcd34d;
    font-size: 18px;
    font-weight: 700;
    margin-left: 8px;
    letter-spacing: 0.5px;
}
.modal-preview.warn {
    border-color: rgba(252, 165, 165, 0.45);
    color: #fca5a5;
}
.modal-preview.warn strong { color: #fca5a5; }
.modal-actions {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
    margin-top: 4px;
}
.modal-actions .primary-btn { margin: 0; }

/* =========================================================
 * 8. Links table (protected URL list)
 * ========================================================= */
.card-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.card-toolbar h2 { color: #fcd34d; font-size: 16px; letter-spacing: 1px; }
.card-hint {
    margin: 0 0 14px;
    font-size: 12px;
    color: rgba(203, 213, 225, 0.6);
    line-height: 1.6;
}
.url-cell {
    display: inline-block;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    color: #fcd34d;
    text-decoration: none;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px;
}
.url-cell:hover { text-decoration: underline; color: #fde68a; }
.copy-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}
.copy-btn {
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.4);
    color: #fcd34d;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.18s, border-color 0.18s, transform 0.12s;
    flex-shrink: 0;
}
.copy-btn:hover {
    background: rgba(251, 191, 36, 0.22);
    border-color: rgba(251, 191, 36, 0.6);
}
.copy-btn:active { transform: scale(0.96); }
.status-pending {
    color: rgba(226, 232, 240, 0.5);
    font-size: 12px;
    font-style: italic;
}

/* =========================================================
 * 9. Dashboard cinematic FX (.dash-page)
 * ========================================================= */
.dash-page {
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
    background: #070d18;
}

.dash-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.dash-bg-aurora {
    position: absolute;
    inset: -15%;
    background:
        radial-gradient(circle at 18% 22%, rgba(56, 189, 248, 0.22), transparent 42%),
        radial-gradient(circle at 82% 18%, rgba(167, 139, 250, 0.2), transparent 48%),
        radial-gradient(circle at 52% 88%, rgba(251, 191, 36, 0.14), transparent 52%);
    filter: blur(36px);
    opacity: 0.95;
    animation: dash-aurora-drift 16s ease-in-out infinite alternate;
}
@keyframes dash-aurora-drift {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(2%, -1%) scale(1.04); }
}
.dash-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at 50% 38%, #000 20%, transparent 72%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 38%, #000 20%, transparent 72%);
    opacity: 0.7;
}
.dash-bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.42;
    animation: dash-float-orb 12s ease-in-out infinite;
}
.dash-bg-glow-a {
    width: 420px;
    height: 420px;
    left: -8%;
    top: 28%;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.5), transparent 68%);
}
.dash-bg-glow-b {
    width: 380px;
    height: 380px;
    right: -6%;
    bottom: 8%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.38), transparent 68%);
    animation-delay: -4s;
}
@keyframes dash-float-orb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-16px, 12px) scale(1.07); }
}
.dash-bg-shoot {
    position: absolute;
    top: -40%;
    left: 55%;
    width: 2px;
    height: 70%;
    background: linear-gradient(to bottom, transparent, rgba(251, 191, 36, 0.35), transparent);
    transform: rotate(22deg);
    opacity: 0.55;
    animation: dash-shoot 5s ease-in-out infinite;
}
@keyframes dash-shoot {
    0%, 100% { opacity: 0.35; transform: rotate(22deg) translateY(0); }
    50%      { opacity: 0.65; transform: rotate(22deg) translateY(24px); }
}

.dash-page .app-shell {
    position: relative;
    z-index: 2;
}

/* --- Hero splash overlay --- */
.dash-splash {
    position: fixed;
    inset: 0;
    z-index: 280;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 32px;
    background:
        radial-gradient(ellipse 80% 55% at 50% 42%, rgba(15, 23, 42, 0.25), transparent 55%),
        linear-gradient(165deg, #060911 0%, #0f172a 45%, #1e1038 100%);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.55s ease, visibility 0.55s ease;
}
.dash-splash--hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.dash-splash-noise {
    position: absolute;
    inset: 0;
    opacity: 0.06;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.dash-splash-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(28px);
    pointer-events: none;
}
.dash-splash-orb-a {
    width: 220px;
    height: 220px;
    top: 18%;
    left: 22%;
    background: rgba(251, 191, 36, 0.35);
    animation: dash-pulse-orb 2.8s ease-in-out infinite;
}
.dash-splash-orb-b {
    width: 180px;
    height: 180px;
    bottom: 22%;
    right: 20%;
    background: rgba(96, 165, 250, 0.35);
    animation: dash-pulse-orb 3.2s ease-in-out infinite 0.5s;
}
@keyframes dash-pulse-orb {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50%      { transform: scale(1.12); opacity: 1; }
}

.dash-splash-ring-wrap {
    position: relative;
    width: 112px;
    height: 112px;
    margin-bottom: 4px;
}
.dash-splash-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
}
.dash-splash-ring-outer {
    border-top-color: rgba(251, 191, 36, 0.95);
    border-right-color: rgba(248, 113, 113, 0.45);
    animation: dash-spin-slow 2.4s linear infinite;
    box-shadow:
        0 0 28px rgba(251, 191, 36, 0.35),
        inset 0 0 22px rgba(251, 191, 36, 0.08);
}
.dash-splash-ring-inner {
    inset: 12px;
    border-bottom-color: rgba(125, 211, 252, 0.85);
    border-left-color: rgba(167, 139, 250, 0.35);
    animation: dash-spin-slow 1.6s linear infinite reverse;
}
@keyframes dash-spin-slow {
    to { transform: rotate(360deg); }
}
.dash-splash-core {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #fef9c3;
    text-shadow: 0 0 24px rgba(251, 191, 36, 0.85);
    animation: dash-core-pop 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes dash-core-pop {
    0%   { transform: scale(0.2); opacity: 0; }
    60%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); }
}

.dash-splash-wordmark {
    font-size: clamp(26px, 5vw, 36px);
    font-weight: 800;
    letter-spacing: 0.35em;
    padding-left: 0.35em;
    background: linear-gradient(135deg, #fef9c3 0%, #fcd34d 38%, #f59e0b 72%, #f97316 100%);
    -webkit-background-clip: text;
            background-clip: text;
    color: transparent;
    filter: drop-shadow(0 8px 28px rgba(220, 38, 38, 0.35));
    animation: dash-title-rise 0.65s ease-out 0.15s both;
}
@keyframes dash-title-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
.dash-splash-tag {
    font-size: 13px;
    letter-spacing: 0.42em;
    padding-left: 0.42em;
    color: rgba(226, 232, 240, 0.55);
    animation: dash-title-rise 0.65s ease-out 0.28s both;
}
.dash-splash-dots {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.dash-splash-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fcd34d, #f97316);
    animation: dash-dot-bounce 1s ease-in-out infinite;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.55);
}
.dash-splash-dots span:nth-child(2) { animation-delay: 0.15s; }
.dash-splash-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dash-dot-bounce {
    0%, 100% { transform: translateY(0); opacity: 0.55; }
    50%      { transform: translateY(-6px); opacity: 1; }
}

/* --- Header & content entrance --- */
.dash-page .app-header {
    animation: dash-header-slide 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
    border-bottom-color: rgba(251, 191, 36, 0.12);
    box-shadow: 0 12px 40px rgba(2, 6, 23, 0.45);
}
@keyframes dash-header-slide {
    from { opacity: 0; transform: translateY(-14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dash-page .app-nav button {
    position: relative;
    overflow: hidden;
}
.dash-page .app-nav button::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 4px;
    width: 0;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, #fcd34d, #f97316, transparent);
    transform: translateX(-50%);
    transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s;
    opacity: 0;
}
.dash-page .app-nav button:hover::after,
.dash-page .app-nav button.active::after {
    width: 72%;
    opacity: 1;
}

.dash-page .app-main {
    animation: dash-main-in 0.75s ease-out 0.06s both;
}
@keyframes dash-main-in {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dash-page .card {
    position: relative;
    overflow: hidden;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
    animation: dash-card-glow-in 0.85s ease-out both;
}
@keyframes dash-card-glow-in {
    from { opacity: 0; transform: translateY(16px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.dash-page .card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        120deg,
        transparent 15%,
        rgba(251, 191, 36, 0.35) 45%,
        rgba(248, 113, 113, 0.22) 55%,
        transparent 85%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: 0.55;
    pointer-events: none;
    animation: dash-border-shimmer 6s linear infinite;
}
@keyframes dash-border-shimmer {
    0%   { filter: hue-rotate(0deg); opacity: 0.45; }
    50%  { opacity: 0.75; }
    100% { filter: hue-rotate(18deg); opacity: 0.45; }
}
.dash-page .card:hover {
    transform: translateY(-3px);
    border-color: rgba(251, 191, 36, 0.22);
    box-shadow:
        0 22px 50px rgba(2, 6, 23, 0.55),
        0 0 0 1px rgba(251, 191, 36, 0.08),
        0 0 48px rgba(251, 191, 36, 0.06);
}

.dash-page .primary-btn {
    transition: transform 0.2s ease, box-shadow 0.25s ease, filter 0.2s ease;
}
.dash-page .primary-btn:hover:not(:disabled) {
    filter: brightness(1.06);
}

.dash-page .tbl tbody tr {
    transition: background 0.18s ease, transform 0.18s ease;
}
.dash-page .tbl tbody tr:hover td {
    background: rgba(251, 191, 36, 0.045);
}

@media (prefers-reduced-motion: reduce) {
    .dash-bg-aurora,
    .dash-bg-glow,
    .dash-bg-shoot,
    .dash-splash-ring-outer,
    .dash-splash-ring-inner,
    .dash-splash-orb-a,
    .dash-splash-orb-b,
    .dash-splash-dots span,
    .dash-page .card::before {
        animation: none !important;
    }
    .dash-page .card {
        animation: none !important;
        opacity: 1;
        transform: none;
    }
    .dash-page .app-header,
    .dash-page .app-main {
        animation: none !important;
        opacity: 1;
        transform: none;
    }
    .dash-splash {
        transition: opacity 0.15s ease, visibility 0.15s ease;
    }
}

/* =========================================================
 * 9. Responsive: tablet & mobile
 * ========================================================= */

/* Horizontal-scroll wrapper for wide tables on narrow screens.
   Used by user mgmt / points logs / my links tables. */
.tbl-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.tbl-scroll::-webkit-scrollbar { height: 6px; }
.tbl-scroll::-webkit-scrollbar-thumb {
    background: rgba(251, 191, 36, 0.28);
    border-radius: 3px;
}
.tbl-scroll::-webkit-scrollbar-track { background: transparent; }

/* >>> Tablet (and small laptop) */
@media (max-width: 1024px) {
    .app-main { padding: 22px 18px; }
    .app-header { padding: 12px 18px; }
    .card { padding: 16px 14px; }
}

/* >>> Phone */
@media (max-width: 768px) {
    .app-main { padding: 14px 12px; }
    .app-header {
        flex-wrap: wrap;
        padding: 10px 14px;
        gap: 10px;
    }
    .app-title { font-size: 16px; letter-spacing: 1px; }

    /* Nav 横向可滚（避免按钮换行挤） */
    .app-nav {
        order: 3;
        flex-basis: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        gap: 2px;
        padding-bottom: 2px;
    }
    .app-nav::-webkit-scrollbar { height: 0; }
    .app-nav button {
        flex-shrink: 0;
        font-size: 12px;
        padding: 7px 11px;
    }

    .app-userbox {
        order: 2;
        margin-left: auto;
        gap: 8px;
        font-size: 12px;
    }
    .app-userbox > span { font-size: 12px; }
    .app-userbox .ghost-btn { padding: 6px 11px; font-size: 12px; }

    .card { padding: 14px 12px; border-radius: 14px; }
    .card-toolbar h2 { font-size: 15px; }
    .card-hint { font-size: 11px; line-height: 1.55; }

    /* Table 在手机上：wrapper 滚动 + 字体微调 */
    .tbl, .tbl th, .tbl td { font-size: 12px; }
    .tbl th, .tbl td { padding: 12px 10px; }
    .tbl-scroll .tbl { min-width: 880px; }

    .tbl-btn {
        padding: 5px 9px !important;
        font-size: 11px !important;
        border-radius: 7px !important;
    }
    .tbl .col-actions { min-width: 280px; }
    .tbl .col-actions .actions-grid { gap: 5px; }

    /* Modal: 全宽贴边 */
    .modal-mask { padding: 12px; align-items: flex-start; padding-top: 24px; }
    .modal-panel {
        max-width: 100%;
        width: 100%;
        padding: 22px 18px 18px;
        gap: 12px;
        max-height: calc(100vh - 48px);
    }
    .modal-panel h2 { font-size: 16px; letter-spacing: 1px; }

    .amount-quick { flex-wrap: wrap; gap: 6px; }
    .amount-quick .quick-btn {
        font-size: 12px;
        padding: 6px 12px;
        flex: 1 1 calc(33.33% - 6px);
        min-width: 0;
    }
    .sign-toggle .sign-btn { padding: 9px 14px; font-size: 13px; }

    /* 模态底部按钮：纵向叠放，主按钮在上 */
    .modal-actions {
        flex-direction: column-reverse;
        gap: 8px;
    }
    .modal-actions button { width: 100%; }
}

/* >>> Small phone */
@media (max-width: 480px) {
    .buddies      { gap: 4px; padding: 0 4px; }
    .buddy        { width: 78px; height: 92px; }
    .buddy-body   { width: 78px; height: 92px; }
    .login-card   { padding: 50px 22px 26px; }
    .login-shell  { max-width: 360px; }

    .app-header   { padding: 10px 12px; gap: 8px; }
    .app-title    { font-size: 14px; letter-spacing: 0.5px; }
    .app-userbox  { font-size: 11px; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
    .app-userbox > span:not(.role-badge) { font-size: 11px; }
    .app-userbox > span:not(.role-badge):not([style*="gradient"]) {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .app-userbox .role-badge { display: none; } /* 极窄屏隐藏 ADMIN/USER 徽章 */

    .kv           { grid-template-columns: 100px 1fr; }
    .modal-panel  { padding: 20px 16px 16px; gap: 11px; }
    .amount-field input { font-size: 20px !important; }
    .url-cell     { max-width: 160px; }

    .tbl, .tbl th, .tbl td { font-size: 11px; }
    .tbl th, .tbl td { padding: 10px 8px; }
    .tbl-scroll .tbl { min-width: 720px; }

    .dash-splash-wordmark { letter-spacing: 0.22em; padding-left: 0.22em; font-size: 22px; }
    .dash-splash-tag      { letter-spacing: 0.28em; padding-left: 0.28em; font-size: 11px; }
    .dash-splash-ring-wrap { width: 96px; height: 96px; }
}
