/* ====== Reset & Base ====== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Comic Neue', cursive, -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: #333;
}

/* ====== Background Video ====== */
.bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background-color: #e6f7ff
}
#video-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    position: absolute;
    top: 0;
    left: 0;
}
#default-bg {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: none;
}

/* ====== Top Navigation ====== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 60px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    transition: transform 0.35s ease, background 0.3s;
}

.navbar--hidden {
    transform: translateY(-100%);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.navbar-brand img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    opacity: 0.9;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn {
    padding: 6px 18px;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
}
.nav-btn-primary {
    background: rgba(154, 151, 196, 0.4);
    border-color: rgba(154, 151, 196, 0.6);
}
.nav-btn-primary:hover {
    background: rgba(154, 151, 196, 0.6);
}

.nav-user-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    padding: 0 6px;
    text-decoration: none;
    cursor: pointer;
    transition: opacity .2s;
}
.nav-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255,255,255,0.3);
    border: 1.5px solid rgba(255,255,255,0.6);
    flex-shrink: 0;
}
.nav-user-name:hover { opacity: .8; }

/* ====== 设置按钮 & 下拉菜单 ====== */
.settings-wrap {
    position: relative;
}
.settings-btn {
    font-size: 16px;
    padding: 4px 12px !important;
    line-height: 1;
    user-select: none;
}
.settings-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: rgba(245, 245, 252, 0.97);
    backdrop-filter: blur(20px);
    border-radius: 10px;
    padding: 10px 0;
    min-width: 165px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    border: 1px solid rgba(184,181,212,0.25);
    z-index: 600;
}
.settings-dropdown.show {
    display: block;
}
.settings-divider {
    height: 1px;
    background: rgba(154,151,196,0.15);
    margin: 6px 12px;
}
.settings-dropdown .settings-title {
    font-size: 12px;
    color: #9999b8;
    padding: 4px 16px 8px;
    letter-spacing: 1px;
}
.settings-dropdown .settings-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    cursor: pointer;
    color: #4a4a6a;
    font-size: 13px;
    transition: background 0.15s;
    font-family: inherit;
}
.settings-dropdown .settings-option:hover {
    background: rgba(154,151,196,0.08);
}
.s-radio {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #b0b0c8;
    flex-shrink: 0;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.settings-option.active .s-radio {
    border-color: #9a97c4;
    background: #9a97c4;
    box-shadow: inset 0 0 0 3px #fff;
}

/* ====== 背景收藏/默认按钮（左下角小按钮，仅图片模式显示） ====== */
.bg-fav-bar {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.bg-fav-btn {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(20, 20, 30, 0.32);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.bg-fav-btn svg { width: 16px; height: 16px; }
.bg-fav-btn:hover {
    transform: scale(1.12);
    background: rgba(20, 20, 30, 0.5);
}
.bg-fav-btn.on { color: #ff5f7e; background: rgba(255, 95, 126, 0.22); border-color: rgba(255, 95, 126, 0.4); }
.bg-fav-btn.on svg { fill: currentColor; }

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 65vh;
    padding: 100px 24px 60px;
    text-align: center;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.4);
    margin-bottom: 16px;
    letter-spacing: 2px;
    line-height: 1.2;
}
.hero .hero-sub {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 6px rgba(0,0,0,0.3);
    max-width: 600px;
    line-height: 1.7;
    margin-bottom: 32px;
}
/* 导航栏一言（居中，仅桌面端显示，移动端隐藏） */
.nav-hitokoto {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: 44vw;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 4px rgba(0,0,0,0.35);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}
@media (min-width: 768px) {
    .nav-hitokoto { display: block; }
}
.nav-hitokoto .hito-src { font-size: 0.78rem; color: rgba(255, 255, 255, 0.6); margin-left: 6px; }
.hero .hero-cta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
}
.hero-cta .cta-btn {
    padding: 10px 32px;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 1px;
}
.hero-cta .cta-btn-primary {
    background: linear-gradient(135deg, #9a97c4, #8582b5);
    color: #fff;
    box-shadow: 0 4px 20px rgba(154, 151, 196, 0.35);
}
.hero-cta .cta-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(154, 151, 196, 0.5);
}
.hero-cta .cta-btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(6px);
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
}
.hero-cta .cta-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}
.hero-cta .cta-btn-download {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    backdrop-filter: blur(6px);
}
.hero-cta .cta-btn-download:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}
.hero-cta .cta-btn-download .dl-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ====== Section Common ====== */
.section {
    padding: 60px 24px;
}
.section-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0,0,0,0.3);
    margin-bottom: 40px;
    letter-spacing: 1px;
}
.section-title span {
    display: inline-block;
    padding-bottom: 8px;
    border-bottom: 3px solid rgba(154, 151, 196, 0.6);
}

/* ====== Features Grid ====== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 28px 24px;
    transition: all 0.35s ease;
    cursor: default;
}
.feature-card:hover {
    transform: translateY(-6px);
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.feature-card .card-icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
    display: block;
}
.feature-card h3 {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.feature-card p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 14px;
}
.feature-card .card-link {
    color: rgba(180, 200, 255, 0.9);
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}
.feature-card .card-link:hover {
    color: #fff;
}

/* ====== Register CTA Section ====== */
.register-cta {
    text-align: center;
    padding: 50px 24px;
}
.register-cta-inner {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 40px 32px;
}
.register-cta h2 {
    color: #fff;
    font-size: 1.6rem;
    margin-bottom: 12px;
    text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}
.register-cta p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 24px;
}
.register-cta .cta-btn {
    padding: 10px 36px;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #9a97c4, #8582b5);
    color: #fff;
    box-shadow: 0 4px 20px rgba(154, 151, 196, 0.35);
}
.register-cta .cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(154, 151, 196, 0.5);
}

/* ====== Footer ====== */
footer {
    text-align: center;
    padding: 28px 24px;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
footer p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    line-height: 1.8;
}
footer a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.2s;
}
footer a:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* ====== Login Modal ====== */
.login-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.login-overlay.show { display: flex; }

.login-modal-box {
    display: flex;
    width: 780px;
    max-width: 92vw;
    max-height: 90vh;
    background: rgba(245, 245, 252, 0.97);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: 1px solid rgba(184,181,212,0.25);
    overflow: hidden;
    position: relative;
    animation: modalIn 0.35s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92) translateY(16px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.login-modal-close {
    position: absolute;
    top: 14px; right: 16px;
    width: 30px; height: 30px;
    border: none;
    background: rgba(0,0,0,0.04);
    color: #999;
    font-size: 18px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.login-modal-close:hover {
    background: rgba(0,0,0,0.1);
    color: #555;
}

.login-modal-left {
    flex: 0 0 38%;
    background: linear-gradient(160deg, #d5d3e8, #c8d5e6);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.login-modal-left::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 30% 70%, rgba(255,255,255,0.25) 0%, transparent 60%),
                radial-gradient(ellipse 60% 80% at 70% 20%, rgba(184,181,212,0.15) 0%, transparent 50%);
    pointer-events: none;
}
.login-modal-left img {
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0.9;
    mix-blend-mode: multiply;
}

.login-modal-right {
    flex: 1;
    padding: 32px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

.login-header {
    text-align: center;
    margin-bottom: 18px;
}
.login-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #4a4a6a;
    letter-spacing: 1px;
}
.login-header p {
    font-size: 13px;
    color: #9999b8;
    margin-top: 2px;
}

.login-tabs {
    display: flex;
    background: rgba(184,181,212,0.12);
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 22px;
    border: 1px solid rgba(184,181,212,0.2);
}
.tab-btn {
    flex: 1;
    padding: 8px 0;
    border: none;
    background: transparent;
    color: #b0b0c8;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.25s;
    font-family: inherit;
}
.tab-btn.active {
    background: #fff;
    color: #9a97c4;
    box-shadow: 0 1px 8px rgba(154,151,196,0.15);
    font-weight: 600;
}

.auth-form-wrapper {
    transition: height 0.4s ease;
    overflow: hidden;
}

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

.auth-form .input-group {
    margin-bottom: 16px;
    position: relative;
}
.auth-form .input-group input {
    width: 100%;
    padding: 10px 0 8px;
    border: none;
    border-bottom: 2px solid rgba(184,181,212,0.3);
    background: transparent;
    font-size: 14px;
    color: #4a4a6a;
    outline: none;
    transition: border-color 0.25s;
    font-family: inherit;
}
.auth-form .input-group input:focus {
    border-bottom-color: #9a97c4;
}
.auth-form .input-group input::placeholder {
    color: #b8b8d0;
}

.code-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
.code-row input { flex: 1; }

.code-btn {
    flex-shrink: 0;
    height: 36px;
    padding: 0 14px;
    border: none;
    background: #9a97c4;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
    font-family: inherit;
}
.code-btn:hover { background: #8582b5; }
.code-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.submit-btn {
    width: 100%;
    padding: 11px 0;
    border: none;
    background: #9a97c4;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: 2px;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 2px;
    font-family: inherit;
}
.submit-btn:hover { background: #8582b5; }
.submit-btn:active { transform: scale(0.98); }

.form-tip {
    font-size: 13px;
    color: #c47a7a;
    min-height: 20px;
    margin-top: 8px;
    text-align: center;
}
.form-links {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
}
.form-links a {
    font-size: 13px;
    color: #b0b0c8;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}
.form-links a:hover { color: #9a97c4; }

/* ====== 其他登录方式（QQ） ====== */
.oauth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 14px 0;
    color: #b0b0c8;
    font-size: 12px;
}
.oauth-divider::before,
.oauth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(184, 181, 212, 0.3);
}
.oauth-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 0;
    border: 1px solid rgba(184, 181, 212, 0.3);
    background: rgba(240, 240, 250, 0.6);
    color: #4a4a6a;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.25s;
}
.oauth-btn svg {
    color: #12b7f5;
}
.oauth-btn:hover {
    background: #fff;
    border-color: #12b7f5;
    box-shadow: 0 2px 10px rgba(18, 183, 245, 0.15);
}

.hidden { display: none !important; }
.btn-spinner { font-size: 16px; }

/* ====== Mobile ====== */
@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
        height: 52px;
    }
    .navbar-brand { font-size: 17px; }
    .navbar-brand img { width: 26px; height: 26px; }
    .nav-btn { padding: 4px 14px; font-size: 12px; }
    .settings-btn { font-size: 14px !important; padding: 3px 10px !important; }
    .nav-user-name { font-size: 12px; }
    .nav-avatar { width: 26px; height: 26px; }

    .hero { min-height: 55vh; padding: 80px 20px 40px; }
    .hero h1 { font-size: 2.4rem; }
    .hero .hero-sub { font-size: 1rem; }
    .hero-cta .cta-btn { padding: 8px 24px; font-size: 14px; }

    .section { padding: 40px 16px; }
    .section-title { font-size: 1.4rem; margin-bottom: 28px; }
    .features-grid { grid-template-columns: 1fr; gap: 16px; }

    .register-cta-inner { padding: 28px 20px; }
    .register-cta h2 { font-size: 1.3rem; }

    .login-modal-box {
        flex-direction: column;
        height: auto;
        max-height: 92vh;
    }
    .login-modal-left { display: none; }
    .login-modal-right { padding: 24px 20px; }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.8rem; }
    .hero .hero-sub { font-size: 0.9rem; }
}
