/* ===== 暗黑纪元 全局样式 ===== */

:root {
    --bg-dark: #0a0a0f;
    --bg-card: #1a1a2e;
    --bg-input: #16213e;
    --accent: #e94560;
    --accent-glow: rgba(233, 69, 96, 0.4);
    --gold: #ffd700;
    --text: #eee;
    --text-dim: #888;
    --border: #2a2a4a;
    --success: #4ecca3;
    --danger: #e94560;
}

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

body {
    background: var(--bg-dark);
    color: var(--text);
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== 登录页 ===== */
.login-container {
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.login-logo {
    font-size: 48px;
    font-weight: bold;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
    margin-bottom: 10px;
    letter-spacing: 4px;
}

.login-subtitle {
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 60px;
}

.wx-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    background: #07c160;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.wx-login-btn:hover {
    background: #06ad56;
    box-shadow: 0 4px 20px rgba(7, 193, 96, 0.4);
}

.wx-login-btn:active {
    transform: scale(0.98);
}

.wx-icon {
    width: 24px;
    height: 24px;
    fill: white;
}

.login-footer {
    margin-top: 40px;
    color: var(--text-dim);
    font-size: 12px;
}

/* ===== 加载动画 ===== */
.loader {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-text {
    text-align: center;
    color: var(--text-dim);
}

/* ===== 角色创建页 ===== */
.role-container {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    border: 1px solid var(--border);
}

.role-title {
    font-size: 24px;
    color: var(--accent);
    text-align: center;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.form-input:focus {
    border-color: var(--accent);
}

.class-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.class-card {
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.class-card:hover {
    border-color: var(--accent);
}

.class-card.selected {
    border-color: var(--accent);
    background: rgba(233, 69, 96, 0.1);
    box-shadow: 0 0 15px var(--accent-glow);
}

.class-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.class-name {
    font-size: 16px;
    font-weight: bold;
}

.class-desc {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 4px;
}

.btn {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    background: #c73e55;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn:disabled {
    background: var(--border);
    cursor: not-allowed;
}

/* ===== 游戏主界面 ===== */
.game-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.game-header {
    background: var(--bg-card);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.player-name {
    font-size: 16px;
    font-weight: bold;
}

.player-class {
    font-size: 12px;
    color: var(--text-dim);
}

.player-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
}

.stat-icon {
    font-size: 16px;
}

.game-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
}

.game-placeholder {
    text-align: center;
    color: var(--text-dim);
}

.game-placeholder h2 {
    font-size: 32px;
    color: var(--accent);
    margin-bottom: 10px;
}

.game-placeholder p {
    font-size: 14px;
    line-height: 1.8;
}

/* ===== 提示弹窗 ===== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    animation: toastIn 0.3s ease;
}

.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--danger); color: var(--danger); }

@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, -20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== 响应式 ===== */
@media (max-width: 600px) {
    .player-stats { display: none; }
    .role-container { padding: 24px; }
    .class-grid { grid-template-columns: 1fr; }
}
