/* ============================================================
   注册工具 - Web 版样式
   品牌色取自应用 Logo：深蓝 #1c499e、绿色 #66933d
   ============================================================ */

:root {
    --brand-blue: #1c499e;
    --brand-blue-bright: #2f6bff;
    --brand-green: #66933d;
    --brand-green-bright: #8ac04f;
    --ink: #0f2038;
    --ink-muted: #64748b;
    --surface: #eef3fb;
    --card-radius: 18px;
}

@font-face {
    font-family: 'Alimama ShuHeiTi';
    src: url('../fonts/AlimamaShuHeiTi-Bold.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Material Icons';
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url('../fonts/material-icons.woff2') format('woff2');
}

.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--surface);
    color: var(--ink);
    font-family: 'Alimama ShuHeiTi', 'Segoe UI', 'Microsoft YaHei UI', 'Microsoft YaHei',
        'PingFang SC', 'HarmonyOS Sans SC', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1:focus {
    outline: none;
}

.muted {
    color: var(--ink-muted);
}

.button-spinner {
    margin-right: 10px;
}

/* ---------- 登录页 ---------- */

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
    box-sizing: border-box;
    background:
        radial-gradient(900px 560px at 50% -10%, #ffffff 0%, rgba(255, 255, 255, 0) 62%),
        linear-gradient(160deg, #f8fbff 0%, #eef3fb 50%, #e8eff8 100%);
}

.auth-card {
    width: min(420px, 100%);
    padding: 40px 36px 26px;
    border-radius: 24px;
    box-sizing: border-box;
    border: 1px solid rgba(28, 73, 158, .08);
    box-shadow: 0 30px 60px -34px rgba(15, 32, 56, .45);
}

.auth-brand {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo {
    display: block;
    width: 84px;
    height: 84px;
    margin: 0 auto;
    border-radius: 22px;
    box-shadow: 0 18px 36px -18px rgba(28, 73, 158, .55);
}

.auth-title {
    margin-top: 16px;
    font-weight: 700;
    letter-spacing: .12em;
    text-indent: .12em;
}

.auth-subtitle {
    margin-top: 2px;
    color: var(--ink-muted);
    letter-spacing: .26em;
    text-indent: .26em;
}

.auth-hint {
    display: block;
    margin: 10px 2px 0;
    line-height: 1.65;
    color: var(--ink-muted);
}

.auth-submit {
    margin-top: 22px;
    height: 46px;
    letter-spacing: .12em;
}

/* ---------- 主界面 ---------- */

.main-page {
    box-sizing: border-box;
    width: 100%;
    max-width: 1040px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 28px 20px 48px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background:
        radial-gradient(1000px 520px at 50% -14%, #ffffff 0%, rgba(255, 255, 255, 0) 60%),
        linear-gradient(160deg, #f8fbff 0%, #eef3fb 52%, #e9f0f9 100%);
}

.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 22px;
    border-radius: var(--card-radius);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.header-logo {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    flex: none;
    box-shadow: 0 12px 24px -14px rgba(28, 73, 158, .55);
}

.header-title {
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: .08em;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.main-card {
    padding: 26px 28px 30px;
    border-radius: var(--card-radius);
}

.section-title {
    font-weight: 700;
    letter-spacing: .06em;
}

.section-desc {
    display: block;
    margin-top: 2px;
    line-height: 1.6;
}

.action-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.period-row {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.period-label {
    font-weight: 600;
    white-space: nowrap;
}

.period-fields {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.period-fields > * {
    width: 116px;
    flex: 0 0 auto;
}

.field-height-button {
    height: 56px;
}

/* ---------- 404 ---------- */

.not-found {
    max-width: 520px;
    margin: 16vh auto 0;
    padding: 0 20px;
    text-align: center;
}

.not-found-action {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

/* ---------- 启动页 ---------- */

#app {
    min-height: 100vh;
}

.splash {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--ink);
    background:
        radial-gradient(1100px 700px at 50% -12%, #ffffff 0%, rgba(255, 255, 255, 0) 62%),
        linear-gradient(160deg, #f8fbff 0%, #eef3fb 50%, #e8eff8 100%);
}

.splash-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
}

.splash-glow-blue {
    top: -190px;
    left: -150px;
    width: 560px;
    height: 560px;
    background: radial-gradient(circle, rgba(47, 107, 255, .22) 0%, rgba(47, 107, 255, 0) 70%);
}

.splash-glow-green {
    right: -170px;
    bottom: -190px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(138, 192, 79, .20) 0%, rgba(138, 192, 79, 0) 70%);
}

.splash-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px;
    text-align: center;
}

.splash-logo-wrap {
    position: relative;
    display: grid;
    place-items: center;
    width: 150px;
    height: 150px;
    margin-bottom: 26px;
    animation: splash-float 6.5s ease-in-out infinite;
}

.splash-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg,
            rgba(47, 107, 255, 0) 0deg 46deg,
            #2f6bff 120deg,
            #8ac04f 210deg,
            rgba(138, 192, 79, 0) 300deg 360deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px));
    animation: splash-spin 1.6s linear infinite;
}

.splash-ring-soft {
    inset: 12px;
    opacity: .35;
    background: conic-gradient(from 180deg,
            rgba(28, 73, 158, 0) 0deg 90deg,
            rgba(28, 73, 158, .55) 160deg,
            rgba(138, 192, 79, 0) 260deg 360deg);
    animation: splash-spin 3.4s linear infinite reverse;
}

.splash-logo-tile {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 112px;
    height: 112px;
    border-radius: 30px;
    border: 1px solid rgba(28, 73, 158, .10);
    background: linear-gradient(150deg, #ffffff 0%, #f2f6ff 100%);
    box-shadow:
        0 26px 50px -22px rgba(28, 73, 158, .45),
        inset 0 1px 0 rgba(255, 255, 255, .95);
}

.splash-logo-tile img {
    display: block;
    width: 84px;
    height: 84px;
    user-select: none;
    -webkit-user-drag: none;
}

.splash-title {
    margin: 0;
    font-size: clamp(26px, 3.4vw, 32px);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: .14em;
    text-indent: .14em;
}

.splash-subtitle {
    margin: 10px 0 0;
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: .3em;
    text-indent: .3em;
    color: var(--ink-muted);
}

.splash-progress {
    width: min(360px, 72vw);
    margin-top: 42px;
}

.splash-progress-track {
    position: relative;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(28, 73, 158, .09);
    box-shadow: inset 0 1px 2px rgba(15, 32, 56, .12);
}

.splash-progress-fill {
    height: 100%;
    width: var(--blazor-load-percentage, 0%);
    border-radius: inherit;
    background: linear-gradient(90deg,
            var(--brand-blue) 0%,
            var(--brand-blue-bright) 52%,
            var(--brand-green-bright) 100%);
    box-shadow: 0 0 16px rgba(47, 107, 255, .45);
    transition: width .25s cubic-bezier(.25, .8, .35, 1);
}

.splash-progress-text {
    display: block;
    margin-top: 12px;
    min-height: 18px;
    font-size: 13px;
    letter-spacing: .02em;
    text-align: center;
    color: var(--ink-muted);
}

.splash-progress-text::after {
    content: var(--blazor-load-percentage-text, "正在启动应用…");
}

.noscript {
    position: absolute;
    z-index: 3;
    margin: 0;
    padding: 16px 22px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 20px 40px -24px rgba(15, 32, 56, .5);
    font-size: 14px;
}

/* ---------- Blazor 错误提示 ---------- */

#blazor-error-ui {
    color-scheme: light only;
    background: #fff4e5;
    border-top: 1px solid #f0c48a;
    bottom: 0;
    box-shadow: 0 -6px 18px rgba(15, 32, 56, .12);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
    font-size: 14px;
}

#blazor-error-ui .reload {
    color: var(--brand-blue);
    font-weight: 600;
    margin-left: 8px;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.9rem;
    top: 0.65rem;
}

.blazor-error-boundary {
    background: #fff1f0;
    border: 1px solid #ffb4a9;
    border-radius: 12px;
    padding: 1rem;
    color: #8c1d18;
}

/* ---------- 动画 ---------- */

@keyframes splash-spin {
    to {
        transform: rotate(1turn);
    }
}

@keyframes splash-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-7px);
    }
}

/* ---------- 响应式 ---------- */

@media (max-width: 720px) {
    .main-page {
        padding: 18px 12px 32px;
        gap: 14px;
    }

    .main-header {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
    }

    .header-actions {
        justify-content: space-between;
    }

    .main-card {
        padding: 20px 18px 24px;
    }

    .field-height-button {
        height: auto;
    }

    .period-fields > * {
        width: calc(33.33% - 8px);
        min-width: 88px;
    }

    .auth-card {
        padding: 32px 22px 22px;
    }
}

@media (max-width: 520px) {
    .splash-logo-wrap {
        width: 128px;
        height: 128px;
    }

    .splash-logo-tile {
        width: 96px;
        height: 96px;
        border-radius: 26px;
    }

    .splash-logo-tile img {
        width: 72px;
        height: 72px;
    }

    .splash-progress {
        margin-top: 34px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .splash-logo-wrap,
    .splash-ring,
    .splash-ring-soft {
        animation: none !important;
    }
}
