/* ============================================================
   style.css - 基础样式（重置 + 字体 + 颜色 + 通用布局）
   逆袭人生 V3.0 Demo
   ============================================================ */

/* --- Reset --- */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; overflow: hidden; user-select: none; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
    background: #1a1a1a;
    color: #fff;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    /* V3.0 PC 端：暗色背景 + 模拟手机壳的视觉提示 */
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* V3.0 PC 端手机模拟器：场景居中且限宽 480px（手机宽度） */
@media (min-width: 481px) {
    body {
        background: linear-gradient(135deg, #0d0d0d 0%, #1a1a2e 50%, #0d0d0d 100%);
        overflow-y: auto;          /* PC 端允许 body 滚动（防止内容过高看不到） */
    }
    .scene {
        max-width: 480px !important;
        margin: 20px auto !important;     /* 上下留白 + 左右居中 */
        border-radius: 24px;              /* 模拟手机圆角 */
        box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 8px #2a2a2a, 0 0 0 10px #444;
        position: relative !important;    /* 覆盖 fixed，配合 body flex 居中 */
        top: auto !important;
        left: auto !important;
        height: auto !important;
        min-height: calc(100vh - 40px) !important;
        max-height: calc(100vh - 40px) !important;
    }
}

/* V3.0 PC 端：滚动条加粗到 8px（4px 太细看不见） */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
::-webkit-scrollbar-thumb { background: rgba(212,165,116,0.4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(212,165,116,0.7); }

/* --- 颜色变量 --- */
:root {
    --primary-red: #8B1A1A;
    --primary-red-light: #C0392B;
    --secondary-yellow: #D4A574;
    --bg-dark: #1a1a1a;
    --bg-mid: #2a2a2a;
    --bg-light: #3a3a3a;
    --text-primary: #fff;
    --text-secondary: #aaa;
    --text-tertiary: #666;
    --border: #444;
    --success: #2ecc71;
    --warning: #f39c12;
    --error: #e74c3c;
    --info: #3498db;
}

/* --- 场景切换 --- */
.scene {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: none;
    overflow-y: auto;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a1a1a 100%);
}
.scene.active {
    display: flex;
    flex-direction: column;
}

/* --- 通用按钮 --- */
button {
    font-family: inherit;
    border: none;
    cursor: pointer;
    outline: none;
    background: transparent;
    color: inherit;
}
button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* --- 通用动效 --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 5px rgba(212, 165, 116, 0.5); } 50% { box-shadow: 0 0 20px rgba(212, 165, 116, 1); } }
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

/* --- Toast 容器 --- */
.toast-container {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    z-index: 1000;
}

.toast {
    background: linear-gradient(135deg, rgba(139, 26, 26, 0.95) 0%, rgba(192, 57, 43, 0.95) 100%);
    border: 1px solid var(--secondary-yellow);
    border-radius: 8px;
    padding: 12px 20px;
    min-width: 280px;
    max-width: 90%;
    color: var(--text-primary);
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    opacity: 0;
    transform: translateY(-30px);
    transition: all 0.3s ease-out;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
}
.toast.show {
    opacity: 1;
    transform: translateY(0);
}
.toast.hide {
    opacity: 0;
    transform: translateY(-30px);
}
.toast-info { border-left: 4px solid var(--info); }
.toast-success { border-left: 4px solid var(--success); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-error { border-left: 4px solid var(--error); }
.toast-title {
    font-size: 14px;
    font-weight: bold;
    color: var(--secondary-yellow);
    margin-bottom: 4px;
}
.toast-content {
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
}
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--secondary-yellow);
    animation: toastProgress linear forwards;
}
@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}