* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    display: flex;
    width: 800px;
    height: 600px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.stage {
    width: 40%;
    background: linear-gradient(135deg, #c084fc 0%, #7c3aed 50%, #4f46e5 100%);
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 80px;
    overflow: hidden;
}

.stage::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.characters-group {
    display: flex;
    align-items: flex-end;
    gap: 0;
    position: relative;
    transform-style: preserve-3d;
    overflow: hidden;
    width: 260px;
    height: 200px;
    text-align: center;
}

.character {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    will-change: transform;
    margin: auto;
    margin-bottom: -5px;
}

.eyes {
    position: absolute;
    display: flex;
    gap: 8px;
    transition: opacity 0.3s;
}

.eye {
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 1);
    border-radius: 50%;
    position: relative;
    overflow: hidden;
}

.pupil {
    width: 10px;
    height: 10px;
    background: #1a202c;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease-out;
}

.char-red {
    width: 110px;
    height: 72px;
    background: #ff6b6b;
    border-radius: 88px 88px 0 0;
    transform-origin: center bottom;
    z-index: 100;
    margin-right: -66px;
    cursor: pointer;
}

.char-red .eyes {
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
}

.char-blue {
    width: 77px;
    height: 170px;
    background: #4c51bf;
    clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
    position: relative;
    margin-left: 8px;
    transform-origin: center bottom;
    transition: transform 0.2s ease-out, clip-path 0.2s ease-out;
    z-index: 1;
    cursor: pointer;
}

.char-blue .eyes {
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    transition: transform 0.2s ease-out;
}

.char-black {
    width: 55px;
    height: 121px;
    background: #1a202c;
    margin-left: -10px;
    position: relative;
    transform-origin: center bottom;
    z-index: 5;
    cursor: pointer;
}

.char-black .eyes {
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
}

.char-yellow {
    width: 66px;
    height: 109px;
    background: #f6e05e;
    border-radius: 33px 33px 0 0;
    margin-left: -10px;
    position: relative;
    transform-origin: center bottom;
    z-index: 1;
    cursor: pointer;
}

.char-yellow .eyes {
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
}

.char-yellow .mouth {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 3px;
    border: 3px solid #1a202c;
    border-top: none;
    border-radius: 0 0 6px 6px;
    background: transparent;
}

.character.turned {
    transform: rotateY(180deg) !important;
}

.character.turned .mouth,
.character.turned .eyes {
    opacity: 0;
}

.character.clicked {
    transform: scaleY(1.2) !important;
}

.status-indicator {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 30px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 200;
}

.status-indicator.show {
    opacity: 1;
}

.status-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #48bb78;
    animation: pulse 1.5s infinite;
}

.status-indicator.loading .dot {
    background: #f6e05e;
    animation: spin 1s linear infinite;
    border: 2px solid transparent;
    border-top-color: white;
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.status-indicator.success {
    background: rgba(72, 187, 120, 0.3);
}

.status-indicator.error {
    background: rgba(245, 101, 101, 0.3);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.9); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.login-panel {
    width: 60%;
    padding: 50px 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

.login-header {
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 26px;
    color: #1a202c;
    margin-bottom: 8px;
    font-weight: 700;
}

.login-header p {
    color: #718096;
    font-size: 14px;
}

.login-tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 25px;
}

.login-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #718096;
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.login-tab:hover { color: #818cf8; }

.login-tab.active {
    color: #818cf8;
    border-bottom-color: #818cf8;
}

.input-group {
    margin-bottom: 16px;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    color: #4a5568;
    font-size: 13px;
    font-weight: 500;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f7fafc;
    outline: none;
}

.input-wrapper input:focus {
    border-color: #818cf8;
    background: white;
}

.input-wrapper input.error {
    border-color: #fc8181;
    background: #fff5f5;
}

.input-wrapper input.success {
    border-color: #48bb78;
    background: #f0fff4;
}

.error-msg {
    color: #e53e3e;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.error-msg.show {
    display: block;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #718096;
    font-size: 14px;
    user-select: none;
    z-index: 10;
}

.password-match-hint {
    font-size: 12px;
    margin-top: 4px;
    height: 16px;
}

.password-match-hint.match { color: #48bb78; }
.password-match-hint.mismatch { color: #e53e3e; }

.login-btn {
    width: 100%;
    padding: 14px;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.login-btn:hover:not(:disabled) {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.35);
}

.login-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.login-form { display: none; }
.login-form.active { display: block; }

.signup-link {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: #718096;
}

.signup-link a {
    color: #818cf8;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.signup-link a:hover { text-decoration: underline; }

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    z-index: 9999;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 320px;
}

.toast.show { transform: translateX(0); }
.toast.success { border-left: 4px solid #818cf8; }
.toast.error { border-left: 4px solid #ef4444; }

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        width: 100%;
        height: auto;
        margin: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }
    .stage, .login-panel { width: 100%; }
    .stage { height: 240px; padding-bottom: 40px; }
    .login-panel { padding: 30px 25px; }
}

/* ========== 随机眨眼效果 ========== */

/* 眨眼动画 */
@keyframes blink {
  0%, 90% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
  100% { transform: scaleY(1); }
}

/* 眨眼状态类 */
.character.blinking .eye {
  animation: blink 0.2s ease-in-out;
}

/* 不同角色的眨眼细节 */
.char-red.blinking .eye {
  animation: blink 0.15s ease-in-out;
}

.char-blue.blinking .eye {
  animation: blink 0.25s ease-in-out;
}

.char-black.blinking .eye {
  animation: blink 0.2s ease-in-out;
}

.char-yellow.blinking .eye {
  animation: blink 0.18s ease-in-out;
}

/* ========== 增强眨眼效果（调试用） ========== */

/* 更明显的眨眼 - 使用 height 代替 scaleY */
.character.blinking .eye {
  animation: none;
  height: 2px !important;
  margin-top: 6px;
  transition: height 0.1s ease-in-out;
}

@keyframes blink-enhanced {
  0%, 100% { height: 15px; margin-top: 0; }
  50% { height: 2px; margin-top: 6px; }
}

.character.blinking-anim .eye {
  animation: blink-enhanced 0.2s ease-in-out;
}

/* ========== 登录框配色方案 - 白色背景 */

/* ========== 登录框配色方案 - 白色背景 ========== */

.login-panel {
    background: #ffffff;
}

/* 登录框内文字颜色 - 适配白色背景 */
.login-panel .login-header h1 {
    color: #1a202c;
}

.login-panel .login-header p {
    color: #718096;
}

.login-panel .login-tabs {
    border-bottom-color: #e2e8f0;
}

.login-panel .login-tab {
    color: #718096;
}

.login-panel .login-tab:hover {
    color: #818cf8;
}

.login-panel .login-tab.active {
    color: #818cf8;
    border-bottom-color: #818cf8;
}

.login-panel .input-group label {
    color: #4a5568;
}

.login-panel .signup-link {
    color: #718096;
}

.login-panel .signup-link a {
    color: #818cf8;
}
