/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    height: 100vh;
    background: linear-gradient(135deg, #0c0c1e 0%, #1a1a3e 50%, #0d0d2b 100%);
}

/* ========== Canvas 背景 ========== */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ========== 幕布效果 ========== */
.curtain {
    position: fixed;
    top: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(180deg,
        #1a0033 0%,
        #330066 15%,
        #1a0033 30%,
        #330066 45%,
        #1a0033 60%,
        #330066 75%,
        #1a0033 90%,
        #330066 100%
    );
    z-index: 1000;
    transition: transform 1.5s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.curtain::before {
    content: '';
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 30px,
        rgba(255, 215, 0, 0.03) 30px,
        rgba(255, 215, 0, 0.03) 32px
    );
}

.curtain::after {
    content: '';
    position: absolute;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg,
        #ffd700 0%,
        #b8860b 50%,
        #ffd700 100%
    );
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.curtain-left {
    left: 0;
    transform: translateX(0);
}

.curtain-right {
    right: 0;
    transform: translateX(0);
}

.curtain-left::after {
    right: 0;
}

.curtain-right::after {
    left: 0;
}

/* 幕布拉开动画 */
.curtain-open .curtain-left {
    transform: translateX(-100%);
}

.curtain-open .curtain-right {
    transform: translateX(100%);
}

/* ========== 主容器 ========== */
.container {
    position: relative;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.container.show {
    opacity: 1;
    transform: scale(1);
}

/* ========== 卡片样式 ========== */
.form-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 50px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.3),
        0 0 100px rgba(138, 43, 226, 0.1),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.form-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg at 50% 50%,
        transparent 0deg,
        rgba(138, 43, 226, 0.1) 90deg,
        transparent 180deg,
        rgba(0, 191, 255, 0.1) 270deg,
        transparent 360deg
    );
    animation: rotate 15s linear infinite;
    pointer-events: none;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.form-card::after {
    content: '';
    position: absolute;
    inset: 1px;
    background: rgba(20, 20, 40, 0.9);
    border-radius: 23px;
    pointer-events: none;
}

/* ========== 标题 ========== */
.form-card h2 {
    position: relative;
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #00d4ff 0%, #8a2be2 50%, #ff006e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    position: relative;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    margin-bottom: 35px;
    font-size: 14px;
}

/* ========== 表单样式 ========== */
form {
    position: relative;
    z-index: 1;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-bottom: 8px;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.input-wrapper {
    position: relative;
}

.form-group input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-group input:focus {
    border-color: #8a2be2;
    background: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 0 20px rgba(138, 43, 226, 0.3),
        inset 0 0 20px rgba(138, 43, 226, 0.05);
}

.form-group input:focus + .input-icon {
    color: #8a2be2;
    transform: scale(1.1);
}

.form-group label:focus-within {
    color: #8a2be2;
}

/* ========== 按钮样式 ========== */
.form-group button[type="submit"] {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #8a2be2 0%, #00d4ff 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.form-group button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.form-group button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(138, 43, 226, 0.4);
}

.form-group button[type="submit"]:hover::before {
    left: 100%;
}

.form-group button[type="submit"]:active {
    transform: translateY(0);
}

/* ========== 链接样式 ========== */
.form-group a {
    display: block;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    padding: 10px;
}

.form-group a:hover {
    color: #00d4ff;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

/* ========== 消息提示 ========== */
#message {
    padding: 15px 20px;
    background: rgba(255, 59, 48, 0.2);
    border: 1px solid rgba(255, 59, 48, 0.5);
    border-radius: 10px;
    color: #ff6b6b;
    text-align: center;
    margin-bottom: 25px;
    font-size: 14px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ========== 加载动画 ========== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== 响应式设计 ========== */
/* 平板设备 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .form-card {
        padding: 35px 25px;
        margin: 0;
        max-width: 100%;
        border-radius: 20px;
    }

    .form-card h2 {
        font-size: 26px;
    }

    .subtitle {
        font-size: 13px;
        margin-bottom: 25px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .form-group input {
        padding: 14px 16px;
        font-size: 15px;
    }

    .form-group button[type="submit"] {
        padding: 14px;
        font-size: 15px;
    }

    .deco-circle {
        width: 200px;
        height: 200px;
    }

    .deco-circle:nth-child(1) {
        top: -50px;
        left: -50px;
    }

    .deco-circle:nth-child(2) {
        bottom: -50px;
        right: -50px;
    }
}

/* 手机设备 */
@media (max-width: 480px) {
    body {
        overflow-y: auto;
    }

    .container {
        padding: 10px;
        min-height: 100vh;
    }

    .form-card {
        padding: 30px 20px;
        border-radius: 16px;
        box-shadow:
            0 15px 35px rgba(0, 0, 0, 0.3),
            0 0 60px rgba(138, 43, 226, 0.1),
            inset 0 1px 1px rgba(255, 255, 255, 0.1);
    }

    .form-card h2 {
        font-size: 24px;
        letter-spacing: 1px;
        margin-bottom: 8px;
    }

    .subtitle {
        font-size: 12px;
        margin-bottom: 20px;
    }

    .form-group {
        margin-bottom: 18px;
    }

    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .form-group input {
        padding: 14px 16px;
        font-size: 16px;
        /* iOS输入框自动缩放修复 */
        -webkit-appearance: none;
        /* 移除iOS输入框默认样式 */
        border-radius: 10px;
    }

    /* 禁用iOS自动放大 */
    input[type="text"],
    input[type="email"],
    input[type="password"] {
        font-size: 16px !important;
    }

    .form-group button[type="submit"] {
        padding: 15px;
        font-size: 15px;
        letter-spacing: 1px;
        /* 防止iOS按钮高亮 */
        -webkit-tap-highlight-color: transparent;
    }

    .form-group button[type="submit"]:active {
        transform: scale(0.98);
    }

    .form-group a {
        font-size: 13px;
        padding: 8px;
    }

    #message {
        padding: 12px 15px;
        font-size: 13px;
        margin-bottom: 20px;
    }

    /* 装饰元素缩小 */
    .deco-circle {
        width: 150px;
        height: 150px;
        filter: blur(30px);
    }

    .deco-circle:nth-child(1) {
        top: -30px;
        left: -30px;
    }

    .deco-circle:nth-child(2) {
        bottom: -30px;
        right: -30px;
    }
}

/* 超小屏幕设备 */
@media (max-width: 360px) {
    .form-card {
        padding: 25px 18px;
    }

    .form-card h2 {
        font-size: 22px;
    }

    .form-group input {
        padding: 12px 14px;
    }

    .form-group button[type="submit"] {
        padding: 14px;
        font-size: 14px;
    }
}

/* 横屏模式优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        min-height: auto;
        padding: 10px;
    }

    .form-card {
        padding: 20px;
        margin: 10px auto;
    }

    .form-card h2 {
        font-size: 20px;
        margin-bottom: 5px;
    }

    .subtitle {
        display: none;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .form-group label {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .form-group input {
        padding: 10px 14px;
        font-size: 14px;
    }

    .form-group button[type="submit"] {
        padding: 12px;
        font-size: 14px;
    }

    .decoration {
        display: none;
    }
}

/* 移动端触摸优化 */
@media (hover: none) and (pointer: coarse) {
    /* 移除hover效果在触摸设备上的影响 */
    .form-group button[type="submit"]:hover {
        transform: translateY(0);
    }

    .form-group a:hover {
        text-shadow: none;
    }

    /* 增加可触摸区域 */
    .form-group a {
        padding: 15px 10px;
    }
}

/* ========== 装饰元素 ========== */
.decoration {
    position: fixed;
    pointer-events: none;
    z-index: 2;
}

.deco-circle {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(138, 43, 226, 0.2) 0%, transparent 70%);
    filter: blur(40px);
    animation: float 8s ease-in-out infinite;
}

.deco-circle:nth-child(1) {
    top: -100px;
    left: -100px;
}

.deco-circle:nth-child(2) {
    bottom: -100px;
    right: -100px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.2) 0%, transparent 70%);
    animation-delay: -4s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 30px); }
}
