/* css/index.css */

:root {
    /* ================= 变量定义：默认白昼模式 ================= */
    --color-bg: #f2f2f7;            /* 背景色 */
    --color-card: #ffffff;          /* 卡片/面板背景 */
    --color-text-main: #000000;     /* 主文字色 */
    --color-text-sub: #86868b;      /* 副文字色 */
    --color-primary: #0071e3;       /* 主题蓝 */
    --color-primary-hover: #0077ed;
    
    /* 按钮与表单 */
    --color-btn-black-bg: #000000;  /* 黑色按钮背景 */
    --color-btn-black-text: #ffffff;/* 黑色按钮文字 */
    --color-input-bg: #ffffff;      /* 输入框背景 */
    --color-input-border: #e5e5ea;  /* 输入框边框 */
    --color-auth-tab-bg: #f0f0f0;   /* 登录Tab底色 */
    
    /* 装饰与动画 */
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
    --shadow-device: 0 20px 50px rgba(0, 0, 0, 0.2);
    --radius-device: 0px;
    --font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ================= 变量定义：月蚀模式 (Dark Mode) ================= */
[data-theme="dark"] {
    --color-bg: #000000;
    --color-card: #1c1c1e;          /* 深灰面板 */
    --color-text-main: #ffffff;     /* 文字反白 */
    --color-text-sub: #a1a1a6;
    --color-primary: #0a84ff;       /* 深色模式下的蓝稍微亮一点 */
    
    /* 按钮反转：黑夜里按钮要是白的才能看见 */
    --color-btn-black-bg: #ffffff;
    --color-btn-black-text: #000000;
    
    --color-input-bg: #1c1c1e;
    --color-input-border: #38383a;
    --color-auth-tab-bg: #2c2c2e;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease; /* 添加背景过渡动画 */
}

/* PC端背景氛围 - 黑夜模式下隐藏这个亮色渐变 */
.ambient-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 50% 50%, #ffffff 0%, #e5e5ea 100%);
    z-index: -1;
    transition: opacity 0.3s;
}
[data-theme="dark"] .ambient-bg {
    opacity: 0.1; /* 变暗 */
}

/* 设备框架 */
.device-frame {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--color-card); /* 使用变量 */
    overflow: hidden;
}

/* 面板通用样式 */
.screen-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.hidden { display: none !important; }

/* ========================================= */
/*   场景A：时尚黑白启动页 (适配变量)         */
/* ========================================= */
#boot-logo-forced {
    font-family: 'Cinzel', serif !important;
    font-size: 2rem !important;
    color: var(--color-text-main) !important; /* 适配黑夜 */
    letter-spacing: 12px !important;
    text-indent: 12px !important;
    margin-bottom: 10px !important;
    font-weight: 500 !important;
    text-align: center;
}
#boot-screen {
    background-color: var(--color-card); /* 适配黑夜 */
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.boot-minimal-container {
    width: 100%;
    max-width: 320px; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* --- 1. Logo 区域 --- */
.boot-header {
    margin-bottom: 50px;
    text-align: center;
    animation: fadeInSlow 1s ease-out forwards;
}

.aesthetic-logo {
    font-size: 2.6rem;   
    letter-spacing: 12px; 
    text-indent: 12px; 
    color: var(--color-text-main); /* 适配黑夜 */
    font-weight: 500;
    margin-bottom: 12px;
    display: block;
}

.aesthetic-sub {
    font-size: 0.7rem;
    color: var(--color-text-sub);
    letter-spacing: 4px;
    font-weight: 600;
    text-transform: uppercase;
    display: block;
}

/* --- 2. 核心视觉区 --- */
.boot-visual {
    width: 100%;
    position: relative;
    margin-bottom: 40px;
}

.big-percentage {
    font-family: 'Share Tech Mono', monospace; 
    font-size: 6rem; 
    color: var(--color-text-main); /* 适配黑夜 */
    text-align: center;
    line-height: 1;
    margin-bottom: 10px;
    font-weight: 400; 
    letter-spacing: -2px; 
}

.line-progress-wrapper {
    width: 100%;
    height: 3px; 
    background: var(--color-input-border); /* 适配黑夜 */
    position: relative;
    overflow: hidden;
}

.line-progress-fill {
    width: 0%;
    height: 100%;
    background: var(--color-text-main); /* 适配黑夜 */
    transition: width 0.1s linear;
}

/* --- 3. 底部文字 --- */
.boot-status-mono {
    font-family: 'Noto Sans SC', sans-serif; 
    font-size: 0.9rem;
    color: var(--color-text-sub); /* 适配黑夜 */
    text-align: center;
    font-weight: 500;
    letter-spacing: 1px;
}

/* 动画 */
@keyframes fadeInSlow {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
#boot-screen {
    transition: opacity 0.5s ease;
}
#boot-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ================= 场景B：设置向导 (适配变量) ================= */
.setup-step {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    padding: 40px 20px;
    background: var(--color-card); /* 适配黑夜 */
    transition: transform 0.5s cubic-bezier(0.35, 0, 0.15, 1), opacity 0.4s ease, background-color 0.3s;
    display: flex;
    flex-direction: column;
}

/* 动画状态类 */
.setup-step.hidden-right { transform: translateX(100%); opacity: 0; pointer-events: none; }
.setup-step.hidden-left { transform: translateX(-30%); opacity: 0; pointer-events: none; }
.setup-step.active { transform: translateX(0); opacity: 1; pointer-events: auto; }

.step-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
    
    /* === 新增/修改代码开始 === */
    overflow-y: auto;          /* 如果内容太长，允许垂直滚动 */
    overflow-x: hidden;        /* 禁止水平乱动 */
    -webkit-overflow-scrolling: touch; /* 让 iOS 滚动像原生App一样丝滑 */
    min-height: 0;             /* Flex 容器嵌套滚动的关键修复 */
    padding-bottom: 20px;      /* 滚动到底部时留一点呼吸空间 */
    /* === 新增/修改代码结束 === */
}

/* 隐藏滚动条样式（可选，为了美观，让滚动条不占用宽度） */
.step-content::-webkit-scrollbar {
    width: 4px;
    background: transparent;
}
.step-content::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}


.center-align {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.step-header { margin-bottom: 30px; margin-top: 40px; }
.step-header h2 { font-size: 2rem; margin-bottom: 10px; color: var(--color-text-main); }
.step-header p { color: var(--color-text-sub); }

.acknowledgements { margin: 20px 0 40px; color: var(--color-text-sub); line-height: 1.6; }

/* 按钮与表单 */
.btn-primary {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 14px 34px;
    border-radius: 24px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s;
}
.btn-primary:active { transform: scale(0.96); }
.btn-large { padding: 16px 48px; font-size: 1.1rem; }

.btn-small {
     background: var(--color-auth-tab-bg); border: none; padding: 0 15px; border-radius: 8px; cursor: pointer; color: var(--color-text-main);
}

.mt-large { margin-top: 40px; }

.auth-tabs {
    display: flex; margin-bottom: 20px; background: var(--color-auth-tab-bg); padding: 4px; border-radius: 12px;
}
.tab-btn {
    flex: 1; border: none; background: transparent; padding: 8px; border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--color-text-sub);
}
.tab-btn.active { background: var(--color-input-bg); color: var(--color-text-main); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

.auth-form { display: none; flex-direction: column; gap: 15px; }
.auth-form.active-form { display: flex; }

.input-group { display: flex; flex-direction: column; gap: 6px; text-align: left;}
.input-group.row { flex-direction: row; gap: 10px; }
.input-group label { font-size: 0.85rem; color: var(--color-text-sub); margin-left: 4px; }
.input-group input {
    padding: 14px; 
    border: 1px solid var(--color-input-border); 
    background-color: var(--color-input-bg);
    color: var(--color-text-main);
    border-radius: 12px; font-size: 1rem; outline: none; transition: border 0.3s;
}
.input-group input:focus { border-color: var(--color-primary); }

/* 检查与加载 */
.check-icon-container { width: 80px; height: 80px; margin-bottom: 20px; position: relative; display: flex; justify-content: center; align-items: center; }
.spinner { width: 50px; height: 50px; border: 4px solid var(--color-auth-tab-bg); border-top-color: var(--color-primary); border-radius: 50%; animation: spin 1s linear infinite; }
.checkmark { font-size: 3rem; color: var(--color-primary); animation: scaleIn 0.4s ease; }

/* 个性化选择 */
.theme-selector { display: flex; gap: 20px; justify-content: center; margin-top: 20px; }
.theme-option { cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 10px; opacity: 0.6; transition: 0.3s; }
.theme-option.selected { opacity: 1; transform: scale(1.05); }
.preview { width: 80px; height: 80px; border-radius: 50%; display: flex; justify-content: center; align-items: center; border: 2px solid var(--color-input-border); }
.preview.light { background: #fff; color: #000; }
.preview.dark { background: #000; color: #fff; }
.theme-option span { color: var(--color-text-main); }

/* 进场动画类 */
.anim-text { opacity: 0; transform: translateY(20px); transition: 0.8s cubic-bezier(0.2, 1, 0.3, 1); }
.step-content:hover .anim-text, .setup-step.active .anim-text { opacity: 1; transform: translateY(0); }
.skew-up { transform: translateY(30px) skewY(2deg); }
.scale-in { transform: scale(0.8); }

.setup-step.active .skew-up { transform: translateY(0) skewY(0); }
.setup-step.active .scale-in { transform: scale(1); opacity: 1; }

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

/* 动画 */
@keyframes dropDownHeavy {
    0% { opacity: 0; transform: translateY(-80px) scale(1.1); }
    60% { transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeInSlowly {
    0% { opacity: 0; transform: translateY(15px); }
    100% { opacity: 1; transform: translateY(0); }
}

.anim-drop-title { opacity: 0; margin-bottom: 10px; animation: dropDownHeavy 1s cubic-bezier(0.2, 1, 0.3, 1) forwards; animation-delay: 0.2s; }
.anim-drop-subtitle { opacity: 0; margin-bottom: 40px; animation: dropDownHeavy 1s cubic-bezier(0.2, 1, 0.3, 1) forwards; animation-delay: 0.5s; }
.anim-fade-text { opacity: 0; margin-bottom: 50px; animation: fadeInSlowly 1.5s ease-out forwards; animation-delay: 1.6s; }
.anim-fade-btn { opacity: 0; animation: fadeInSlowly 1s ease-out forwards; animation-delay: 2.8s; }

.font-art-handwriting { font-family: 'Playball', cursive; font-size: 4.5rem; color: var(--color-text-main); margin-bottom: 5px; line-height: 1.2; text-shadow: 2px 2px 0px rgba(0,0,0,0.05); }
.font-art-roman { font-family: 'Cinzel', serif; font-size: 1.4rem; letter-spacing: 4px; text-transform: uppercase; color: var(--color-text-main); font-weight: 500; margin-bottom: 50px; }
.brand-name { color: var(--color-text-main); }

/* ========================================= */
/*     黑色极简风格按钮 (自动化适配黑夜)     */
/* ========================================= */
.btn-black {
    background-color: var(--color-btn-black-bg);
    color: var(--color-btn-black-text);
    border: none;
    padding: 14px 42px;
    border-radius: 100px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}
.btn-black:hover {
    opacity: 0.8;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}
.btn-black:active { transform: scale(0.98); }

.center-text { text-align: center; }

.agreement-group {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--color-text-sub);
    margin: 10px 0 20px 0;
    gap: 8px;
}
.agreement-group input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--color-text-main); cursor: pointer; }
.agreement-group a { color: var(--color-primary); text-decoration: none; font-weight: 500; }

.btn-black-form {
    background: var(--color-btn-black-bg);
    color: var(--color-btn-black-text);
    border: none;
    padding: 14px 34px;
    border-radius: 24px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}
.btn-black-form:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); }
.btn-black-form:active { transform: scale(0.98); }

/* 弹窗适配 */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; display: flex; justify-content: center; align-items: center; backdrop-filter: blur(5px); }
.modal-container {
    background: var(--color-card); /* 适配 */
    width: 90%; max-width: 500px; border-radius: 16px; display: flex; flex-direction: column; max-height: 80vh; box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}
.modal-header { padding: 20px; border-bottom: 1px solid var(--color-input-border); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 1.1rem; font-weight: 600; color: var(--color-text-main); }
.close-modal-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--color-text-sub); }
.modal-body { padding: 20px; overflow-y: auto; font-size: 0.9rem; line-height: 1.6; color: var(--color-text-main); }
.text-content { color: var(--color-text-main); }
.agreement-doc p { margin-bottom: 10px; line-height: 1.6; }
.agreement-doc h2 { margin-top: 20px; margin-bottom: 10px; color: var(--color-text-main); }
.modal-footer { padding: 20px; border-top: 1px solid var(--color-input-border); text-align: center; }

.note-text { color: var(--color-text-sub); font-size: 0.85rem; margin-top: 30px; margin-bottom: 10px; opacity: 0.8; }

/* Step 5 专属 */
.s5-brand { font-size: 4rem !important; margin-bottom: 10px !important; color: var(--color-text-main); font-weight: 400; }
.s5-text-gray { font-size: 1rem; color: var(--color-text-sub); margin-bottom: 5px; font-weight: 300; }
.s5-title { font-size: 1.8rem !important; font-weight: 700; color: var(--color-text-main); margin-bottom: 10px; margin-top: 0; }
.s5-btn { width: auto !important; padding-left: 50px !important; padding-right: 50px !important; min-width: 200px; }

.s5-anim-drop, .s5-anim-fade { opacity: 0; }
@keyframes step5Drop { 0% { opacity: 0; transform: translateY(-60px) scale(1.1); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes step5Fade { 0% { opacity: 0; transform: translateY(20px); } 100% { opacity: 1; transform: translateY(0); } }

.setup-step.active .s5-anim-drop { animation: step5Drop 1s cubic-bezier(0.2, 1, 0.3, 1) forwards; animation-delay: 0.2s; }
.setup-step.active .s5-anim-fade { animation: step5Fade 1s ease-out forwards; }
.setup-step.active .delay-1 { animation-delay: 0.8s; }
.setup-step.active .delay-2 { animation-delay: 1.4s; }
.setup-step.active .delay-3 { animation-delay: 1.8s; }
.setup-step.active .delay-4 { animation-delay: 2.4s; }
/* ================= 修复补丁：Step 3 版本检测页黑夜模式适配 ================= */

/* 强制让版本检测标题使用主文字变量 */
#version-title {
    color: var(--color-text-main) !important;
    margin-bottom: 10px;
}

/* 强制让版本描述文字使用副文字变量 */
#version-desc, .sub-text {
    color: var(--color-text-sub) !important;
}

/* 让加载圈圈的颜色也适配一下（底色变深灰，转动色变亮蓝） */
[data-theme="dark"] .spinner {
    border-color: rgba(255, 255, 255, 0.1);
    border-top-color: var(--color-primary);
}
/* === 新增样式：忘记密码功能 === */

/* 登录按钮下方的链接容器 */
.form-footer-link {
    text-align: center;
    margin-top: 15px;
}

/* 链接形式的按钮 */
.link-btn {
    font-size: 0.9rem;
    color: var(--color-text-sub);
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}
.link-btn:hover {
    color: var(--color-primary);
}

/* 找回密码表单顶部的标题区 */
.form-header-tip {
    text-align: center;
    margin-bottom: 20px;
}
.form-header-tip h3 {
    font-size: 1.2rem;
    color: var(--color-text-main);
    margin-bottom: 5px;
}
.form-header-tip p {
    font-size: 0.85rem;
    color: var(--color-text-sub);
}

/* 纯文字按钮（用于“返回登录”） */
.btn-text-only {
    background: transparent;
    border: none;
    color: var(--color-text-sub);
    padding: 10px;
    margin-top: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    width: 100%;
}
.btn-text-only:hover {
    color: var(--color-text-main);
}

/* 按钮垂直排列容器 */
.btn-group-vertical {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .boot-minimal-container { max-width: 300px; }
    #boot-logo-forced { font-size: 2rem !important; letter-spacing: 4px !important; text-indent: 4px !important; }
    .aesthetic-sub { margin-top: 5px !important; margin-bottom: 40px !important; }
    .big-percentage { font-size: 5rem; }
    .font-art-handwriting { font-size: 2.4rem !important; margin-bottom: 0px !important; }
    .font-art-roman { font-size: 0.7rem !important; letter-spacing: 2px !important; margin-bottom: 35px !important; }
    .brand-name { font-size: 0.85rem !important; }
    .acknowledgements p { font-size: 0.85rem; }
    .acknowledgements { margin-bottom: 35px !important; }
    .btn-black { padding: 10px 32px !important; font-size: 0.85rem !important; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important; }
    .s5-brand { font-size: 2.8rem !important; }
    .s5-title { font-size: 1.5rem !important; }
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes scaleIn { from { transform: scale(0); } to { transform: scale(1); } }
