/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    overflow: hidden;
}

#app {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* 登录页面 */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 400px;
    max-width: 90%;
}

.login-title {
    color: #333;
    font-size: 32px;
    text-align: center;
    margin-bottom: 30px;
    font-weight: bold;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    color: #555;
    font-size: 14px;
    font-weight: 500;
}

.form-input {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-primary {
    padding: 14px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.error-message {
    color: #e74c3c;
    font-size: 14px;
    text-align: center;
    margin-top: 10px;
}

/* 游戏主界面 */
.game-container {
    display: flex;
    height: 100vh;
    background: #1a1a2e;
}

.game-canvas-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.game-canvas {
    border: 2px solid #16213e;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.game-sidebar {
    width: 320px;
    background: rgba(22, 33, 62, 0.95);
    padding: 20px;
    overflow-y: auto;
    border-left: 2px solid #16213e;
}

.character-info {
    background: rgba(102, 126, 234, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.character-name {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #667eea;
}

.character-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.stat-value {
    font-size: 16px;
    font-weight: bold;
    color: #4ade80;
}

/* 进度条样式 */
.progress-bar {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin-top: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.health-bar .progress-fill {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.experience-bar .progress-fill {
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}

.vitality-bar .progress-fill {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

/* 技能栏 */
.martial-arts-list {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.section-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #667eea;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
    padding-bottom: 8px;
}

.martial-art-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s;
}

.martial-art-item:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateX(5px);
}

.martial-art-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #e0e7ff;
}

.martial-art-details {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: space-between;
}

/* 聊天框 */
.chat-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    height: 250px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 10px;
    padding-right: 5px;
}

.chat-message {
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
}

.chat-message.system {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.chat-message.world {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.chat-message.guild {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.chat-message.private {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.chat-input-area {
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 13px;
}

.chat-input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-send {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-send:hover {
    transform: scale(1.05);
}

/* 角色创建页面 */
.character-creation {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.creation-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 500px;
    max-width: 90%;
}

.origin-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.origin-card {
    background: rgba(102, 126, 234, 0.1);
    padding: 15px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.origin-card:hover {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(102, 126, 234, 0.2);
}

.origin-card.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.3);
}

.origin-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.origin-description {
    font-size: 12px;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .game-sidebar {
        width: 280px;
    }

    .game-canvas {
        max-width: calc(100vw - 280px);
    }
}

@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
    }

    .game-sidebar {
        width: 100%;
        height: 40vh;
        order: 2;
    }

    .game-canvas-area {
        height: 60vh;
        order: 1;
    }

    .game-canvas {
        max-width: 100%;
    }

    .login-box, .creation-box {
        width: 90%;
        padding: 30px 20px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Toast通知 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

.toast {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    min-width: 250px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.info {
    border-left: 4px solid #3b82f6;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== 注册页面样式 ==================== */
.register-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.register-box {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 450px;
    max-width: 100%;
}

.register-box h1 {
    color: #333;
    font-size: 32px;
    text-align: center;
    margin-bottom: 10px;
    font-weight: bold;
}

.register-box > p {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.register-box .form-group {
    margin-bottom: 20px;
}

.register-box label {
    display: block;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.register-box .form-hint {
    color: #888;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.register-box .message-box {
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: center;
    white-space: pre-line;
}

.register-box .error-message {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.register-box .success-message {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

.register-box .login-link {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.register-box .login-link p {
    color: #666;
    font-size: 14px;
}

.register-box .login-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.register-box .login-link a:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 500px)
{
    .register-box {
        padding: 30px 20px;
        width: 100%;
    }

    .register-box h1 {
        font-size: 24px;
    }
}
