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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-color, #0f0f23);
    color: var(--text-color, #e0e0e0);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ====== 强制拦截弹窗（微信/QQ/微博） ====== */
.block-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.block-modal {
    background: var(--card-color, #1a1a2e);
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    animation: slideUp 0.4s ease;
}

.block-icon {
    color: #ff6b6b;
    margin-bottom: 20px;
}

.block-modal h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #fff;
}

.block-msg {
    font-size: 14px;
    color: #999;
    line-height: 1.6;
    margin-bottom: 28px;
}

.copy-box {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
}

.copy-box input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 14px;
    color: #ccc;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.copy-box input:focus {
    border-color: var(--accent-color, #6c63ff);
}

.btn-copy {
    background: var(--accent-color, #6c63ff);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 22px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-copy:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

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

.browser-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.browser-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #aaa;
}

.block-hint {
    font-size: 13px;
    color: #777;
    margin-bottom: 18px;
    margin-top: 4px;
}

/* ====== 首次安装凭据弹窗 ====== */
.cred-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.cred-modal {
    background: var(--card-color, #1a1a2e);
    border-radius: 24px;
    padding: 44px 40px;
    max-width: 460px;
    width: 90%;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(108, 99, 255, 0.2);
    animation: slideUp 0.4s ease;
}

.cred-icon {
    margin-bottom: 16px;
}

.cred-modal h2 {
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.cred-desc {
    font-size: 14px;
    color: #888;
    margin-bottom: 28px;
}

.cred-list {
    text-align: left;
    margin-bottom: 28px;
}

.cred-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.cred-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.cred-row:last-child {
    margin-bottom: 0;
}

.cred-label {
    font-size: 13px;
    color: #888;
    flex-shrink: 0;
    margin-right: 12px;
}

.cred-value {
    font-size: 14px;
    color: #ddd;
    font-family: 'Consolas', 'Monaco', monospace;
    word-break: break-all;
    text-align: right;
}

.cred-value a {
    color: var(--accent-color, #6c63ff);
    text-decoration: none;
}

.cred-value a:hover {
    text-decoration: underline;
}

.cred-highlight {
    background: rgba(108, 99, 255, 0.08);
    border-color: rgba(108, 99, 255, 0.25);
}

.cred-pw {
    color: var(--accent-color, #6c63ff);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 1px;
}

.cred-btn {
    background: var(--accent-color, #6c63ff);
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 15px 40px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.cred-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(108, 99, 255, 0.3);
}

/* ====== 密码验证页 ====== */
.auth-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-color, #0f0f23);
    position: relative;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(108, 99, 255, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(108, 99, 255, 0.05) 0%, transparent 50%);
    animation: bgShift 20s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes bgShift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-5%, -3%); }
}

.auth-card {
    background: var(--card-color, #1a1a2e);
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s ease;
}

.logo {
    margin-bottom: 24px;
}

.logo img {
    max-height: 64px;
    max-width: 200px;
    border-radius: 12px;
}

.auth-card h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 14px;
    color: #888;
    margin-bottom: 36px;
    line-height: 1.5;
}

/* 首次部署提示：远程访客看到，只说明怎么拿访问密码，不显示任何凭证 */
.first-run-hint {
    margin: -18px 0 26px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(108, 99, 255, 0.28);
    background: rgba(108, 99, 255, 0.08);
    color: #b7b1ff;
    font-size: 12px;
    line-height: 1.7;
    text-align: left;
}

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

.input-group {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s;
}

.input-group:focus-within {
    border-color: var(--accent-color, #6c63ff);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.input-group input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 16px 20px;
    color: #fff;
    font-size: 15px;
    outline: none;
    letter-spacing: 2px;
}

.input-group input::placeholder {
    color: #555;
    letter-spacing: 0;
}

.btn-submit {
    background: var(--accent-color, #6c63ff);
    border: none;
    padding: 16px 22px;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

.btn-submit:hover {
    filter: brightness(1.15);
}

.btn-submit svg {
    transition: transform 0.2s;
}

.btn-submit:hover svg {
    transform: translateX(3px);
}

.error-msg {
    color: #ff6b6b;
    font-size: 13px;
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(255, 107, 107, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(255, 107, 107, 0.15);
}

.footer-text {
    font-size: 12px;
    color: #555;
}

/* ====== 验证通过 ====== */
.welcome-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.welcome-card {
    background: var(--card-color, #1a1a2e);
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    animation: slideUp 0.5s ease;
}

.welcome-icon {
    margin-bottom: 20px;
}

.welcome-card h1 {
    font-size: 24px;
    color: #fff;
    margin-bottom: 8px;
}

.welcome-card p {
    color: #888;
    margin-bottom: 24px;
}

.btn-enter {
    display: inline-block;
    background: var(--accent-color, #6c63ff);
    color: #fff;
    text-decoration: none;
    padding: 14px 36px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-enter:hover {
    filter: brightness(1.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(108, 99, 255, 0.3);
}

.countdown-hint {
    font-size: 12px;
    color: #666;
    margin-top: 10px;
}

.countdown-display {
    margin: 16px 0 8px;
}

.countdown-number {
    display: inline-block;
    font-size: 48px;
    font-weight: 700;
    color: var(--accent-color, #6c63ff);
    line-height: 1;
    transition: transform 0.2s ease;
}

.redirect-fail {
    font-size: 12px;
    color: #ff6b6b;
    margin-top: 8px;
}

/* ====== 客服面板 ====== */
.cs-panel {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
}

.cs-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-color, #6c63ff);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(108, 99, 255, 0.4);
    transition: all 0.3s;
    position: relative;
}

.cs-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 32px rgba(108, 99, 255, 0.5);
}

.cs-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff6b6b;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.cs-window {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 300px;
    background: var(--card-color, #1a1a2e);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    transform: scale(0.9) translateY(10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom right;
}

.cs-window.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
}

.cs-header {
    background: linear-gradient(135deg, var(--accent-color, #6c63ff), #8b5cf6);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cs-header h3 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.cs-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.cs-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.cs-body {
    padding: 20px;
}

.cs-subtitle {
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
}

.cs-channels {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cs-channel {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text-color, #e0e0e0);
    transition: all 0.2s;
    cursor: pointer;
}

.cs-channel:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent-color, #6c63ff);
    transform: translateX(-3px);
}

.cs-channel-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.qq-icon {
    background: rgba(0, 120, 212, 0.15);
    color: #0078D4;
}

.wechat-icon {
    background: rgba(7, 193, 96, 0.15);
    color: #07C160;
}

.weibo-icon {
    background: rgba(230, 46, 0, 0.15);
    color: #E62E00;
}

.email-icon {
    background: rgba(108, 99, 255, 0.15);
    color: var(--accent-color, #6c63ff);
}

.cs-channel span {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
}

.cs-channel small {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

/* ====== 微信二维码弹窗 ====== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--card-color, #1a1a2e);
    border-radius: 20px;
    padding: 36px;
    text-align: center;
    position: relative;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    animation: slideUp 0.3s ease;
}

.modal-content h3 {
    font-size: 18px;
    color: #fff;
    margin-bottom: 20px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #aaa;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.qr-image {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.modal-content p {
    font-size: 13px;
    color: #888;
}

/* ====== 动画 ====== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ====== 响应式 ====== */
@media (max-width: 480px) {
    .block-modal, .auth-card, .welcome-card, .cred-modal {
        padding: 32px 20px;
        border-radius: 18px;
    }

    .block-modal h2 {
        font-size: 18px;
    }

    .auth-card h1 {
        font-size: 24px;
    }

    .browser-icons {
        gap: 14px;
    }

    .browser-item {
        font-size: 10px;
    }

    .browser-item svg {
        width: 26px;
        height: 26px;
    }

    .copy-box {
        flex-direction: column;
    }

    .cred-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .cred-value {
        text-align: left;
    }

    .cs-panel {
        right: 16px;
        bottom: 16px;
    }

    .cs-window {
        width: calc(100vw - 32px);
        right: -8px;
    }
}
