/* ============================================================
   Login Common — 镇员/导师登录页公共样式
   ============================================================ */

/* ===== 主题变量（默认蓝色，可被页面 theme CSS 覆盖）===== */
:root {
    /* 主题 RGB 分量（方便 rgba() 使用） */
    --theme-1: 30,107,184;
    --theme-2: 45,143,213;
    --theme-3: 120,200,255;

    /* 主题 Hex（用于渐变） */
    --theme-hex-1: #1e6bb8;
    --theme-hex-2: #2d8fd5;
    --theme-hex-3: #3ba3e8;
    --theme-accent: #78c8ff;

    /* 背景 */
    --bg-top: #02060f;
    --bg-mid: #040c1a;
    --bg-bottom: #030a14;

    /* 卡片 */
    --card-bg-1: 20,40,70;
    --card-bg-2: 15,30,55;
    --card-width: 420px;

    /* 输入框 */
    --input-bg: 10,20,40;

    /* 文字 */
    --text-main: #e6f0fa;
    --text-muted: #8ba9c8;
    --text-muted-2: #6b8ba8;
    --text-placeholder: #4a6b8a;

    /* 版权区颜色分量 */
    --footer-rgb: 107,139,168;

    /* 品牌文字字距 */
    --brand-word-spacing: .06em;
}

/* ===== Reset ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: transparent;
    color: var(--text-main);
    overflow: hidden;
}

/* ===== 背景层1：深空渐变 ===== */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(900px 500px at 15% 20%, rgba(var(--theme-1), .18), transparent 60%),
        radial-gradient(800px 500px at 85% 80%, rgba(var(--theme-2), .15), transparent 60%),
        radial-gradient(1200px 700px at 50% 90%, rgba(var(--theme-1), .08), transparent 70%),
        linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 50%, var(--bg-bottom) 100%);
    z-index: 0;
}

/* ===== 背景层2：星点 ===== */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,.25), transparent),
        radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,.15), transparent),
        radial-gradient(1px 1px at 55% 30%, rgba(255,255,255,.2), transparent),
        radial-gradient(1px 1px at 75% 75%, rgba(255,255,255,.15), transparent),
        radial-gradient(1.5px 1.5px at 90% 40%, rgba(var(--theme-3), .35), transparent),
        radial-gradient(1px 1px at 45% 85%, rgba(255,255,255,.2), transparent),
        radial-gradient(1px 1px at 20% 90%, rgba(var(--theme-3), .25), transparent);
    z-index: 1;
    pointer-events: none;
    animation: starTwinkle 6s ease-in-out infinite;
}
@keyframes starTwinkle {
    0%, 100% { opacity: .2; }
    50%      { opacity: .4; }
}

/* ===== 背景层3：品牌文字 ===== */
.brand-layer {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}
.brand-word {
    position: absolute;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'PingFang SC', sans-serif;
    font-weight: 800;
    letter-spacing: var(--brand-word-spacing);
    color: rgba(var(--theme-3), .07);
    text-shadow: 0 0 30px rgba(var(--theme-3), .1);
    white-space: nowrap;
    user-select: none;
    will-change: transform, opacity, text-shadow;
    writing-mode: horizontal-tb;
}
.brand-word.us { color: rgba(var(--theme-3), .09); }
.brand-word.ts { color: rgba(var(--theme-2), .06); }
.brand-word.teacher { color: rgba(var(--theme-3), .07); }

/* 浮动动画 */
@keyframes floatA {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(40px, -30px); }
    50%  { transform: translate(20px, -60px); }
    75%  { transform: translate(-30px, -30px); }
    100% { transform: translate(0, 0); }
}
@keyframes floatB {
    0%   { transform: translate(0, 0); }
    33%  { transform: translate(-50px, -40px); }
    66%  { transform: translate(30px, -70px); }
    100% { transform: translate(0, 0); }
}
@keyframes floatC {
    0%   { transform: translate(0, 0); }
    50%  { transform: translate(60px, -50px); }
    100% { transform: translate(0, 0); }
}
@keyframes floatD {
    0%   { transform: translate(0, 0); }
    50%  { transform: translate(-40px, 40px); }
    100% { transform: translate(0, 0); }
}

/* 呼吸脉冲 */
@keyframes letterPulse {
    0%, 100% {
        opacity: .35;
        text-shadow: 0 0 20px rgba(var(--theme-3), .05);
    }
    50% {
        opacity: .85;
        text-shadow:
            0 0 20px rgba(var(--theme-3), .18),
            0 0 50px rgba(var(--theme-3), .08);
    }
}

.bw-1 { top: 8%;  left: 5%;  font-size: 72px; animation: floatA 24s ease-in-out infinite, letterPulse 4s ease-in-out infinite; }
.bw-2 { top: 15%; right: 8%; font-size: 56px; animation: floatB 30s ease-in-out infinite, letterPulse 5s ease-in-out infinite .8s; }
.bw-3 { top: 35%; left: 20%; font-size: 44px;  animation: floatC 22s ease-in-out infinite, letterPulse 3.5s ease-in-out infinite 1.6s;
 writing-mode: vertical-rl;text-orientation: upright;letter-spacing:.12em;}
.bw-4 { top: 55%; right: 5%; font-size: 88px; animation: floatA 35s ease-in-out infinite reverse, letterPulse 4.5s ease-in-out infinite 2.4s; }
.bw-5 { bottom: 12%; left: 12%; font-size: 52px; animation: floatB 28s ease-in-out infinite reverse, letterPulse 4s ease-in-out infinite 1.2s; }
.bw-6 { bottom: 8%; right: 18%; font-size: 40px; animation: floatD 26s ease-in-out infinite, letterPulse 3.8s ease-in-out infinite 2s; }
.bw-7 { top: 25%; left: 45%; font-size: 34px; animation: floatC 32s ease-in-out infinite, letterPulse 4.2s ease-in-out infinite .4s; }
.bw-8 { top: 75%; left: 80%; font-size: 60px; animation: floatD 36s ease-in-out infinite reverse, letterPulse 4.8s ease-in-out infinite 1.4s; }

/* ===== 网格层 ===== */
.grid-overlay {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(var(--theme-3), .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--theme-3), .04) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 3;
    pointer-events: none;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}

/* ===== 扫描线 ===== */
.scan-line {
    position: fixed;
    left: 0; right: 0;
    height: 1.5px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(var(--theme-3), .05) 15%,
        rgba(var(--theme-3), .35) 50%,
        rgba(var(--theme-3), .05) 85%,
        transparent 100%
    );
    box-shadow:
        0 0 15px rgba(var(--theme-3), .25),
        0 0 40px rgba(var(--theme-3), .1);
    z-index: 4;
    pointer-events: none;
    animation: scanVertical 12s linear infinite;
}
@keyframes scanVertical {
    0%   { top: -2px; opacity: 0; }
    5%   { opacity: 1; }
    95%  { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* ===== 登录卡片 ===== */
.login-wrap {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.card {
    width: 100%;
    max-width: var(--card-width);
    background: linear-gradient(145deg, rgba(var(--card-bg-1), .85) 0%, rgba(var(--card-bg-2), .75) 100%);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(var(--theme-2), .25);
    border-radius: 20px;
    padding: 36px 32px 30px;
    box-shadow:
        0 20px 60px rgba(0,0,0,.5),
        0 0 0 1px rgba(var(--theme-3), .08) inset,
        0 0 80px rgba(var(--theme-2), .15);
    position: relative;
    overflow: hidden;
    animation: cardEnter .6s cubic-bezier(.4,0,.2,1);
}
@keyframes cardEnter {
    from { opacity: 0; transform: translateY(20px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--theme-3), .9), transparent);
    animation: cardScan 3s linear infinite;
}
@keyframes cardScan {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
.card::after {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 180px; height: 180px;
    background: radial-gradient(circle, rgba(var(--theme-3), .25), transparent 70%);
    pointer-events: none;
    animation: cornerGlow 4s ease-in-out infinite;
}
@keyframes cornerGlow {
    0%, 100% { opacity: .6; transform: scale(1); }
    50%      { opacity: 1; transform: scale(1.15); }
}

/* ===== Logo 区 ===== */
.brand-header {
    text-align: center;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}
.logo-combo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 12px 22px;
    background: linear-gradient(135deg, rgba(var(--theme-1), .25), rgba(var(--theme-2), .12));
    border: 1px solid rgba(var(--theme-3), .35);
    border-radius: 16px;
    box-shadow:
        0 8px 24px rgba(var(--theme-2), .3),
        inset 0 1px 0 rgba(255,255,255,.1);
    position: relative;
    overflow: hidden;
    transition: all .3s;
}
.logo-combo:hover {
    box-shadow:
        0 12px 32px rgba(var(--theme-2), .5),
        inset 0 1px 0 rgba(255,255,255,.15);
    transform: translateY(-2px);
}
.logo-combo::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--theme-3), .15), transparent);
    animation: logoShine 4s ease-in-out infinite;
}
@keyframes logoShine {
    0%   { left: -100%; }
    50%  { left: 100%; }
    100% { left: 100%; }
}
.logo-icon-wrap {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--theme-2), .15);
    border: 1px solid rgba(var(--theme-3), .3);
    border-radius: 12px;
    box-shadow:
        0 4px 16px rgba(var(--theme-2), .2),
        inset 0 1px 0 rgba(255,255,255,.08);
    position: relative;
    flex-shrink: 0;
    padding: 5px;
    overflow: visible;
}
.logo-icon-wrap::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 17px;
    background: conic-gradient(from 0deg, transparent, rgba(var(--theme-3), .6), transparent);
    animation: logoRing 6s linear infinite;
    z-index: -1;
}
@keyframes logoRing {
    to { transform: rotate(360deg); }
}
.logo-icon-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.4));
}
.logo-icon-wrap .icon-fallback {
    font-size: 26px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -2px;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
}
.brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}
.brand-text .brand-name {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: .12em;
    line-height: 1;
    background: linear-gradient(90deg, #ffffff 0%, var(--theme-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-style: italic;
}
.brand-text .brand-sub {
    font-size: 11px;
    color: var(--theme-accent);
    letter-spacing: .3em;
    text-transform: uppercase;
    font-weight: 600;
    opacity: .85;
}

/* ===== 表单 ===== */
.form-group {
    position: relative;
    margin-bottom: 16px;
    z-index: 1;
}
.form-group .field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: .55;
    pointer-events: none;
    transition: opacity .25s;
}
input[type=text], input[type=password] {
    width: 100%;
    padding: 14px 16px 14px 42px;
    background: rgba(var(--input-bg), .6);
    border: 1.5px solid rgba(var(--theme-3), .2);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-main);
    transition: all .25s;
}
input[type=text]::placeholder,
input[type=password]::placeholder {
    color: var(--text-placeholder);
}
input[type=text]:focus, input[type=password]:focus {
    outline: none;
    border-color: rgba(var(--theme-3), .7);
    background: rgba(var(--input-bg), .85);
    box-shadow:
        0 0 0 4px rgba(var(--theme-2), .15),
        0 0 24px rgba(var(--theme-2), .3);
}
.form-group:focus-within .field-icon {
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(var(--theme-3), .8));
}

/* ===== 记住账号 ===== */
.remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-muted);
    user-select: none;
    position: relative;
    z-index: 1;
}
.remember-row input[type=checkbox] {
    width: 16px;
    height: 16px;
    accent-color: var(--theme-hex-2);
    cursor: pointer;
}
.remember-row label {
    cursor: pointer;
    transition: color .2s;
}
.remember-row label:hover { color: var(--theme-accent); }

/* ===== 登录按钮 ===== */
.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--theme-hex-1) 0%, var(--theme-hex-2) 50%, var(--theme-hex-3) 100%);
    background-size: 200% 200%;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all .3s;
    box-shadow:
        0 6px 20px rgba(var(--theme-2), .4),
        inset 0 1px 0 rgba(255,255,255,.2);
    position: relative;
    overflow: hidden;
    font-family: inherit;
    animation: btnGradient 4s ease infinite;
    z-index: 1;
}
@keyframes btnGradient {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}
.login-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
    transition: left .7s;
}
.login-btn:hover:not(:disabled)::before { left: 100%; }
.login-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow:
        0 12px 32px rgba(var(--theme-2), .6),
        inset 0 1px 0 rgba(255,255,255,.3);
}
.login-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 6px 20px rgba(var(--theme-2), .4);
}
.login-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    animation: none;
}

/* ===== 底部 ===== */
.tip {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted-2);
    position: relative;
    z-index: 1;
}
.tip a {
    color: var(--theme-accent);
    text-decoration: none;
    margin: 0 6px;
    transition: all .2s;
    text-shadow: 0 0 8px rgba(var(--theme-3), .3);
}
.tip a:hover {
    color: var(--text-main);
    text-shadow: 0 0 12px rgba(var(--theme-3), .8);
}
.tip .sep { opacity: .4; }

.footer-credit {
    text-align: center;
    margin-top: 18px;
    font-size: 11px;
    color: rgba(var(--footer-rgb), .6);
    letter-spacing: .15em;
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    position: relative;
    z-index: 1;
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
    .card { padding: 28px 22px 24px; border-radius: 16px; }
    .logo-icon-wrap { width: 46px; height: 46px; }
    .logo-icon-wrap img { width: 100%; height: 100%; }
    .brand-text .brand-name { font-size: 19px; }
    .brand-text .brand-sub { font-size: 10px; letter-spacing: .25em; }
    .bw-1 { font-size: 44px; }
    .bw-2 { font-size: 36px; }
    .bw-3 { font-size: 30px; }
    .bw-4 { font-size: 52px; }
    .bw-5 { font-size: 32px; }
    .bw-6 { font-size: 24px; }
    .bw-7 { font-size: 22px; }
    .bw-8 { font-size: 36px; }
}