/* =================================== */
/*    Login/Register Choice Modal      */
/* =================================== */

/* Apply styles only when the modal is active */
body.login-modal-active {
    /* --- 重要：请将下面的 URL 替换为你自己的背景图片地址 --- */
    /* background-image: url('http://gjg.twex.lat/kv.png'); */ /* <-- 旧的硬编码 URL */
    background-image: var(--login-background-url, url('../assets/bg.webp')); /* <-- 使用 CSS 变量，并提供本地备用 */
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    overflow: hidden; /* Prevent body scroll when modal is open */
}

/* Dark overlay for the background image */
body.login-modal-active::before {
    content: '';
    position: fixed; /* Use fixed to cover viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Adjust overlay darkness */
    z-index: 998; /* Below the modal content */
}

/* Modal container - Boost Specificity and Override Defaults */
/* Use ID for higher specificity */
body.login-modal-active div#login-choice-modal.login-choice-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    background-color: transparent !important; /* Override any inherited background */
    border: none !important; /* Override inherited borders */
    padding: 20px;
    box-sizing: border-box;
    margin: 0 !important; /* Override margins */
    max-width: none !important; /* Override max-width */
}

/* --- 新增：移动到外部的主标题样式 --- */
body.login-modal-active h2.login-main-title {
    color: #ffffff;
    font-size: 2.8em;
    font-weight: 700;
    text-align: center;
    margin: -15vh 0 5px 0; /* --- 修改：使用负的视口高度单位大幅上移 --- */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1001;
    line-height: 1.2;
}

/* --- 新增：副标题样式 --- */
body.login-modal-active .login-subtitle {
    display: block;
    font-size: 0.5em;
    font-weight: 400;
    color: #f5d76e; /* --- 修改：颜色更偏黄 --- */
    margin-top: 5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.05em;
    margin-bottom: 15px;
}

/* Content Box Styling - Boost Specificity */
body.login-modal-active div#login-choice-modal .login-choice-content {
    background-color: rgba(30, 35, 45, 0.8);
    color: var(--dark-text-primary);
    padding: 15px 40px 30px 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-width: 450px;
    width: 100%;
    text-align: center;
    z-index: 1001;
    border: 1px solid rgba(255, 255, 255, 0.1); /* Reaffirm border */
    margin-top: 5px; /* --- 设置较小的顶部间距 --- */
}

/* Ensure other styles target the more specific path too if needed */
body.login-modal-active div#login-choice-modal .login-choice-content h2 {
    /* ... commented out ... */
}

body.login-modal-active div#login-choice-modal .login-choice-content p.login-description {
    margin-bottom: 30px; /* Spacing before buttons */
    font-size: 0.95em; /* Slightly smaller font */
    color: var(--dark-text-secondary); /* Lighter grey color */
    line-height: 1.7; /* Improved line spacing for readability */
}

/* 新增：VIP 同步信息样式 */
.vip-sync-info {
    color: #ffd700; /* 金色 */
    font-weight: bold;
    display: block; /* 确保换行符生效 */
    margin-top: 10px; /* 与上方文字增加间距 */
}

body.login-modal-active div#login-choice-modal .login-choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

body.login-modal-active div#login-choice-modal .login-choice-buttons form,
body.login-modal-active div#login-choice-modal .login-choice-buttons .login-choice-button {
    width: 100%;
    margin: 0;
}

/* Style for both button types */
.login-choice-button,
.login-choice-buttons form button {
    display: block;
    width: 100%;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s, transform 0.1s;
    box-sizing: border-box;
}

.login-choice-button:hover,
.login-choice-buttons form button:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

/* Specific button colors */
.auto-register-btn {
    background-color: var(--dark-accent-green);
    color: white;
}

.login-redirect-btn {
    background-color: var(--dark-accent-blue);
    color: white;
}

/* 新增：推广按钮特定样式 */
.promo-button {
    background-color: #9575cd; /* --- 修改：更深的紫色 --- */
    color: white;
    text-decoration: none; /* 移除链接下划线 */
    display: block; /* 确保独占一行 */
    box-sizing: border-box; /* 包含 padding 和 border */
    font-weight: bold; /* --- 新增：文字加粗 --- */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* --- 新增：添加阴影 --- */
}

.login-note {
    font-size: 0.85em;
    color: var(--dark-text-secondary);
    margin-top: 25px;
    font-style: italic;
}
