/*
 * Wudi X Club - shared visual theme
 * Keeps page-specific layout/behaviour intact while unifying surfaces,
 * typography, controls and responsive states across the project.
 */

:root {
    --wx-bg: #f3f5f9;
    --wx-bg-soft: #eef2f7;
    --wx-surface: rgba(255, 255, 255, 0.76);
    --wx-surface-strong: rgba(255, 255, 255, 0.92);
    --wx-border: rgba(255, 255, 255, 0.88);
    --wx-line: rgba(148, 163, 184, 0.20);
    --wx-ink: #111827;
    --wx-muted: #64748b;
    --wx-primary: #2563eb;
    --wx-primary-hover: #1d4ed8;
    --wx-primary-soft: rgba(37, 99, 235, 0.11);
    --wx-success: #16a34a;
    --wx-warning: #d97706;
    --wx-danger: #dc2626;
    --wx-shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.055);
    --wx-shadow: 0 20px 60px rgba(15, 23, 42, 0.09);
    --wx-shadow-lg: 0 32px 90px rgba(15, 23, 42, 0.12);
    --wx-radius-sm: 14px;
    --wx-radius: 22px;
    --wx-radius-lg: 32px;
    --wx-ease: cubic-bezier(.2, .8, .2, 1);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--wx-bg);
}

body.site-theme {
    min-height: 100vh;
    color: var(--wx-ink);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at 8% 3%, rgba(37, 99, 235, 0.10), transparent 28rem),
        radial-gradient(circle at 94% 34%, rgba(14, 165, 233, 0.075), transparent 30rem),
        linear-gradient(145deg, #fafbfc 0%, var(--wx-bg) 48%, #edf2f7 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    -webkit-tap-highlight-color: transparent;
}

body.site-theme::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -10;
    pointer-events: none;
    opacity: .32;
    background-image: radial-gradient(rgba(15, 23, 42, .12) .55px, transparent .55px);
    background-size: 20px 20px;
    mask-image: linear-gradient(to bottom, black, transparent 68%);
    -webkit-mask-image: linear-gradient(to bottom, black, transparent 68%);
}

body.site-theme.dark {
    --wx-bg: #0b0d12;
    --wx-bg-soft: #121722;
    --wx-surface: rgba(20, 24, 33, 0.76);
    --wx-surface-strong: rgba(24, 29, 40, 0.94);
    --wx-border: rgba(255, 255, 255, 0.10);
    --wx-line: rgba(255, 255, 255, 0.10);
    --wx-ink: #f8fafc;
    --wx-muted: #a1aab9;
    color-scheme: dark;
    background:
        radial-gradient(circle at 8% 3%, rgba(37, 99, 235, 0.16), transparent 30rem),
        radial-gradient(circle at 94% 34%, rgba(14, 165, 233, 0.10), transparent 32rem),
        linear-gradient(145deg, #090b10 0%, #11151d 52%, #080a0e 100%);
}

::selection {
    color: #fff;
    background: rgba(37, 99, 235, .82);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(100, 116, 139, .32);
    background-clip: padding-box;
}

body.site-theme a,
body.site-theme button,
body.site-theme input,
body.site-theme select,
body.site-theme textarea {
    font: inherit;
}

body.site-theme a,
body.site-theme button,
body.site-theme [role="button"] {
    -webkit-tap-highlight-color: transparent;
}

body.site-theme button:not(:disabled),
body.site-theme [role="button"]:not([aria-disabled="true"]) {
    cursor: pointer;
}

body.site-theme :focus-visible {
    outline: 3px solid rgba(37, 99, 235, .28);
    outline-offset: 3px;
}

body.site-theme input,
body.site-theme textarea,
body.site-theme select {
    accent-color: var(--wx-primary);
}

body.site-theme input::placeholder,
body.site-theme textarea::placeholder {
    color: #94a3b8;
    opacity: 1;
}

body.site-theme img {
    max-width: 100%;
}

/* Shared glass surfaces used by the landing, worker and order pages. */
body.site-theme .glass-card,
body.site-theme .glass-panel {
    border-color: var(--wx-border);
    box-shadow: var(--wx-shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .48);
}

body.site-theme .header,
body.site-theme .header-bar,
body.site-theme #header {
    border: 1px solid var(--wx-border);
    box-shadow: 0 12px 38px rgba(15, 23, 42, .08), inset 0 1px 0 rgba(255, 255, 255, .48);
}

body.site-theme .logo,
body.site-theme #header > div:first-child {
    letter-spacing: -.02em;
}

body.site-theme .btn,
body.site-theme .btn-submit,
body.site-theme .ios-button,
body.site-theme .back-button {
    min-height: 42px;
    transition: transform .2s var(--wx-ease), box-shadow .2s var(--wx-ease), background-color .2s ease, border-color .2s ease, opacity .2s ease;
}

body.site-theme .btn:hover,
body.site-theme .btn-submit:hover,
body.site-theme .ios-button:hover,
body.site-theme .back-button:hover {
    transform: translateY(-1px);
}

body.site-theme .btn:active,
body.site-theme .btn-submit:active,
body.site-theme .ios-button:active,
body.site-theme .back-button:active {
    transform: translateY(0) scale(.98);
}

body.site-theme .input-field,
body.site-theme input[type="text"],
body.site-theme input[type="password"],
body.site-theme input[type="email"],
body.site-theme input[type="number"],
body.site-theme textarea,
body.site-theme select {
    border-color: var(--wx-line);
    background-color: rgba(255, 255, 255, .78);
    color: var(--wx-ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

body.site-theme.dark .input-field,
body.site-theme.dark input[type="text"],
body.site-theme.dark input[type="password"],
body.site-theme.dark input[type="email"],
body.site-theme.dark input[type="number"],
body.site-theme.dark textarea,
body.site-theme.dark select {
    border-color: var(--wx-line);
    background-color: rgba(255, 255, 255, .07);
    color: var(--wx-ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

body.site-theme .input-field:focus,
body.site-theme input:focus,
body.site-theme textarea:focus,
body.site-theme select:focus {
    border-color: rgba(37, 99, 235, .62);
    box-shadow: 0 0 0 4px var(--wx-primary-soft), 0 10px 28px rgba(37, 99, 235, .08);
}

/* Landing/reference pages */
body.page-home .glass-card,
body.page-yyds .glass-card,
body.page-order .glass-card {
    background: var(--wx-surface);
    backdrop-filter: blur(30px) saturate(145%);
    -webkit-backdrop-filter: blur(30px) saturate(145%);
}

body.page-home #header,
body.page-yyds .header,
body.page-order .header {
    background: rgba(255, 255, 255, .74);
    backdrop-filter: blur(28px) saturate(165%);
    -webkit-backdrop-filter: blur(28px) saturate(165%);
}

body.page-home.dark #header,
body.page-yyds.dark .header,
body.page-order.dark .header {
    background: rgba(15, 18, 25, .78);
}

body.page-home section > .glass-card:first-child,
body.page-yyds .hero-content {
    position: relative;
    overflow: hidden;
    box-shadow: var(--wx-shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .68);
}

body.page-home section > .glass-card:first-child::after,
body.page-yyds .hero-content::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    top: -170px;
    right: -110px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, .17), transparent 68%);
    pointer-events: none;
}

body.page-yyds .glass-card,
body.page-order .service-card,
body.page-order .payment-card,
body.page-order .history-card,
body.page-dashboard .quick-item,
body.page-dashboard .order-card,
body.page-admin .quick-item,
body.page-admin .order-card {
    transition: transform .24s var(--wx-ease), box-shadow .24s var(--wx-ease), border-color .24s ease, background-color .24s ease;
}

body.page-yyds .glass-card:hover,
body.page-order .service-card:hover,
body.page-order .payment-card:hover {
    border-color: rgba(37, 99, 235, .22);
    box-shadow: 0 22px 54px rgba(15, 23, 42, .10);
}

body.page-order .announcement_bar {
    background: rgba(255, 255, 255, .80);
    border-color: var(--wx-border);
    box-shadow: var(--wx-shadow-sm);
}

body.page-order .service-card,
body.page-order .payment-card,
body.page-order .order-summary,
body.page-order .history-card,
body.page-order .step-chip {
    border-color: var(--wx-border);
    background: rgba(255, 255, 255, .68);
    box-shadow: var(--wx-shadow-sm);
}

body.page-order .service-card.selected,
body.page-order .payment-card.selected {
    border-color: rgba(37, 99, 235, .72);
    background: rgba(239, 246, 255, .92);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .10), 0 20px 42px rgba(37, 99, 235, .12);
}

body.page-order .btn-submit,
body.page-yyds .btn.black {
    background: linear-gradient(180deg, #1f2937, #0f172a);
    box-shadow: 0 12px 26px rgba(15, 23, 42, .20);
}

/* Authentication pages */
body.page-auth {
    background:
        radial-gradient(circle at 12% 8%, rgba(37, 99, 235, .16), transparent 28rem),
        radial-gradient(circle at 90% 92%, rgba(14, 165, 233, .11), transparent 28rem),
        linear-gradient(145deg, #fafcff 0%, #edf3fa 100%);
}

body.page-auth .glass-panel,
body.page-admin-login form {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--wx-border);
    background: var(--wx-surface);
    backdrop-filter: blur(30px) saturate(155%);
    -webkit-backdrop-filter: blur(30px) saturate(155%);
    box-shadow: var(--wx-shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .70);
}

body.page-auth .glass-panel::before,
body.page-admin-login form::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, .45), transparent);
}

body.page-auth .capsule-link {
    box-shadow: 0 6px 20px rgba(15, 23, 42, .04);
}

body.page-auth .btn-primary {
    background: linear-gradient(180deg, #3b82f6, #2563eb);
    box-shadow: 0 12px 26px rgba(37, 99, 235, .23);
}

body.page-admin-login {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

body.page-admin-login > div {
    width: 100%;
    min-height: auto !important;
    background: transparent !important;
}

body.page-admin-login form {
    width: min(100%, 430px) !important;
    max-width: 430px !important;
    margin: 0 auto !important;
    padding: clamp(26px, 6vw, 42px) !important;
    border-radius: var(--wx-radius-lg) !important;
}

body.page-admin-login form h2 {
    color: var(--wx-ink);
    letter-spacing: -.035em;
}

body.page-admin-login form button[type="submit"] {
    min-height: 48px;
    border-radius: 999px;
    background: linear-gradient(180deg, #3b82f6, #2563eb) !important;
    box-shadow: 0 12px 26px rgba(37, 99, 235, .23);
}

/* User/admin applications */
body.page-dashboard,
body.page-admin {
    --bg: var(--wx-bg);
    --card-bg: var(--wx-surface);
    --card-border: var(--wx-border);
    --card-shadow: var(--wx-shadow-sm);
    --text: var(--wx-ink);
    --text-sub: var(--wx-muted);
    --primary: var(--wx-primary);
    --primary-light: #dbeafe;
    --primary-glow: var(--wx-primary-soft);
    background: var(--wx-bg);
}

body.page-dashboard .bg-gradient-shell,
body.page-admin .bg-gradient-shell {
    background:
        radial-gradient(circle at 12% 4%, rgba(37, 99, 235, .13), transparent 34%),
        radial-gradient(circle at 92% 72%, rgba(14, 165, 233, .09), transparent 34%),
        linear-gradient(145deg, #f8fafc, #eef2f7);
}

body.page-dashboard .header-bar,
body.page-admin .header-bar {
    top: 10px;
    width: calc(100% - 24px);
    border-radius: 20px;
    background: rgba(248, 250, 252, .78);
    backdrop-filter: blur(28px) saturate(165%);
    -webkit-backdrop-filter: blur(28px) saturate(165%);
}

body.page-dashboard .app-container,
body.page-admin .app-container {
    padding-top: 20px;
}

body.page-admin .app-container,
body.page-admin .header-bar {
    max-width: 1440px;
}

body.page-dashboard .glass-panel,
body.page-admin .glass-panel {
    box-shadow: var(--wx-shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .58);
}

body.page-dashboard .glass-panel:hover,
body.page-admin .glass-panel:hover {
    border-color: rgba(37, 99, 235, .16);
}

body.page-dashboard .quick-item,
body.page-admin .quick-item,
body.page-dashboard .order-card,
body.page-admin .order-card {
    border: 1px solid rgba(255, 255, 255, .84);
    background: rgba(255, 255, 255, .68);
    box-shadow: 0 6px 20px rgba(15, 23, 42, .04);
}

body.page-dashboard .quick-item:hover,
body.page-admin .quick-item:hover,
body.page-dashboard .order-card:hover,
body.page-admin .order-card:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, .18);
    box-shadow: 0 14px 30px rgba(15, 23, 42, .075);
}

body.page-dashboard .bottom-nav,
body.page-admin .bottom-nav {
    border: 1px solid var(--wx-border);
    box-shadow: 0 -4px 30px rgba(15, 23, 42, .08);
}

body.page-dashboard .modal-overlay,
body.page-admin .modal-overlay {
    background: rgba(15, 23, 42, .34);
}

body.page-dashboard .modal-sheet,
body.page-admin .modal-sheet {
    border: 1px solid var(--wx-border);
    box-shadow: 0 30px 80px rgba(15, 23, 42, .18);
}

/* Payment result and HTML error states */
body.page-result {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

body.page-result > .result-card,
body.page-result .error-container {
    border: 1px solid var(--wx-border) !important;
    border-radius: var(--wx-radius-lg) !important;
    background: var(--wx-surface) !important;
    backdrop-filter: blur(30px) saturate(155%);
    -webkit-backdrop-filter: blur(30px) saturate(155%);
    box-shadow: var(--wx-shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .65) !important;
}

body.page-result h1,
body.page-result h2 {
    color: var(--wx-ink) !important;
    letter-spacing: -.035em;
}

body.page-result .error-message,
body.page-result p {
    color: var(--wx-muted);
}

body.page-result a {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px !important;
}

body.page-result .back-button {
    padding: 12px 28px;
    color: #fff;
    background: linear-gradient(180deg, #3b82f6, #2563eb);
    box-shadow: 0 12px 26px rgba(37, 99, 235, .22);
}

/* Legacy utilities retained for pages that already use them. */
.content-auto { content-visibility: auto; }
.text-shadow { text-shadow: 0 2px 4px rgba(0, 0, 0, .1); }
.text-gradient {
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}
.animate-float { animation: wx-float 6s ease-in-out infinite; }
.animate-float-delay-1 { animation: wx-float 6s ease-in-out 1s infinite; }
.animate-float-delay-2 { animation: wx-float 6s ease-in-out 2s infinite; }

@keyframes wx-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@media (max-width: 800px) {
    body.page-home #header,
    body.page-yyds .header,
    body.page-order .header {
        top: 12px !important;
        height: 62px !important;
        border-radius: 22px !important;
    }

    body.page-order .announcement_bar {
        top: 84px;
    }

    body.page-order .container-main {
        margin-top: 150px;
    }

    body.page-dashboard .header-bar,
    body.page-admin .header-bar {
        top: 6px;
        width: calc(100% - 16px);
        border-radius: 18px;
    }
}

@media (max-width: 520px) {
    body.site-theme .glass-card,
    body.site-theme .glass-panel {
        border-radius: 22px;
    }

    body.page-auth {
        background:
            radial-gradient(circle at 10% 2%, rgba(37, 99, 235, .13), transparent 20rem),
            linear-gradient(160deg, #f8fafc, #edf3f9);
    }

    body.page-order .service-grid,
    body.page-order .payment-grid {
        gap: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
