/* ============================================================
 * 幻想神域 - 游戏网站全局样式（V4 美化版）
 * 按 3.png 设计图 1:1 还原
 * ============================================================ */

/* 基础重置 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
    background-color: #0a1628;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================================
 * 多段背景层
 * ============================================================ */
.bg-section {
    width: 100%;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    position: relative;
}

.bg-section-1 {
    min-height: 100vh;
    background-image: url('../../images/bg1.jpg');
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 60px;
}

.bg-section-2 {
    min-height: 100vh;
    background-image: url('../../images/bj3.jpg');
    padding: 60px 20px;
}

/* ============================================================
 * 固定顶部导航栏
 * ============================================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    transition: background 0.3s;
    /* 始终深色背景，确保文字和图标清晰可见 */
    background: rgba(10, 22, 40, 0.95);
}

.site-header.scrolled {
    background: rgba(10, 22, 40, 0.95);
}

.header-logo {
    display: flex;
    align-items: center;
}

.header-logo img {
    height: 56px;
    width: auto;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 0.9rem;
}

.header-user .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    object-fit: cover;
}

.header-user .welcome-text {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.header-user .welcome-text strong {
    color: #f5a623;
}

.header-user .logout-btn {
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    color: #fff;
    font-size: 0.8rem;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.1);
}

.header-user .logout-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: #fff;
}

/* ============================================================
 * 主标题装饰区域
 * ============================================================ */
.hero-title {
    margin-top: 100px;
    text-align: center;
    color: #fff;
}

.hero-title h2 {
    font-size: 2.8rem;
    font-weight: bold;
    text-shadow: 0 2px 10px rgba(0, 100, 200, 0.6);
    letter-spacing: 8px;
    margin-bottom: 8px;
}

.hero-title p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 2px;
}

/* ============================================================
 * 半透明主卡片容器
 * ============================================================ */
.main-card {
    width: 92%;
    max-width: 1200px;
    margin-top: 30px;
    background: rgba(255, 255, 255, 0.88);
    border-radius: 16px;
    padding: 30px 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
}

/* ============================================================
 * 卡片顶部内容区：左侧用户信息 + 右侧新闻
 * ============================================================ */
.card-top {
    display: flex;
    gap: 40px;
    margin-bottom: 30px;
}

/* 左侧用户信息模块 */
.user-panel {
    width: 260px;
    flex-shrink: 0;
    text-align: center;
}

.user-panel .user-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(100, 180, 255, 0.4);
    margin-bottom: 12px;
}

.user-panel .user-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 4px;
}

.user-panel .user-id {
    font-size: 0.8rem;
    color: #8899aa;
    margin-bottom: 16px;
}

/* 点数行 */
.point-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: rgba(240, 245, 250, 0.8);
    border-radius: 8px;
}

.point-row .point-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.point-row .point-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.point-row .point-label {
    font-size: 0.85rem;
    color: #666;
}

.point-row .point-value {
    font-size: 1rem;
    font-weight: bold;
    color: #2c3e50;
    font-family: "Arial", sans-serif;
}

/* 用户面板按钮 */
.user-panel .btn-welfare {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 16px 0 10px;
    background: #4a90e2;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.user-panel .btn-welfare:hover {
    background: #357abd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

.user-panel .btn-welfare:disabled {
    background: #a0a0a0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.user-panel .btn-group-small {
    display: flex;
    gap: 8px;
}

.user-panel .btn-small {
    flex: 1;
    padding: 8px;
    background: #f0f4f8;
    color: #556677;
    border: 1px solid #dde3ea;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
}

.user-panel .btn-small:hover {
    background: #e2e8f0;
    border-color: #c0c8d0;
}

/* 右侧新闻公告模块 */
.news-panel {
    flex: 1;
    min-width: 0;
}

.news-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    border-bottom: 2px solid #e8ecf1;
    padding-bottom: 10px;
}

.news-panel-header h3 {
    font-size: 1.1rem;
    color: #2c3e50;
    font-weight: bold;
}

.news-panel-header .more-link {
    font-size: 0.8rem;
    color: #8899aa;
    transition: color 0.3s;
}

.news-panel-header .more-link:hover {
    color: #4a90e2;
}

/* 新闻列表 */
.news-list-top {
    list-style: none;
}

.news-list-top .news-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.2s;
}

.news-list-top .news-item:hover {
    background: rgba(240, 245, 250, 0.5);
}

.news-list-top .news-item:last-child {
    border-bottom: none;
}

.news-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.tag-blue {
    background: #e3f2fd;
    color: #1976d2;
}

.tag-red {
    background: #ffebee;
    color: #c62828;
}

.tag-green {
    background: #e8f5e9;
    color: #2e7d32;
}

.tag-orange {
    background: #fff3e0;
    color: #ef6c00;
}

.news-title-text {
    flex: 1;
    font-size: 0.9rem;
    color: #445566;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.news-date {
    font-size: 0.8rem;
    color: #aabbcc;
    flex-shrink: 0;
    font-family: "Arial", sans-serif;
}

/* ============================================================
 * 功能面板（替换原新闻公告）
 * ============================================================ */
.function-panel {
    flex: 1;
    min-width: 0;
    padding: 10px 10px 10px 20px;
}

.function-panel-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 22px;
    color: #24384f;
}

.function-panel-title h2 {
    font-size: 26px;
    font-weight: 800;
    margin: 0;
    color: #24384f;
}

.function-panel-title span {
    color: #8bbce8;
    font-size: 18px;
}

.function-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.function-card {
    height: 170px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(180, 210, 240, 0.45);
    box-shadow: 0 8px 24px rgba(80, 130, 180, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
    padding: 10px 0;
}

.function-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 14px 30px rgba(70, 130, 200, 0.22);
}

.function-card img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 14px;
}

.function-card strong {
    font-size: 20px;
    font-weight: 700;
    color: #1f3448;
    margin-bottom: 6px;
}

.function-card small {
    font-size: 13px;
    color: #9aaec0;
    letter-spacing: 1px;
    font-weight: 600;
    text-transform: uppercase;
}

/* 功能面板响应式 */
@media (max-width: 900px) {
    .function-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .function-panel {
        padding: 10px 0;
    }
}

@media (max-width: 600px) {
    .function-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
 * 四个功能按钮
 * ============================================================ */
.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid #e8ecf1;
}

.action-btn {
    flex: 1;
    max-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(180, 210, 240, 0.45);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(80, 130, 180, 0.1);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: #4a90e2;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(74, 144, 226, 0.2);
}

.action-btn img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    margin-bottom: 10px;
}

.action-btn .btn-text {
    font-size: 1.05rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 4px;
}

.action-btn .btn-sub {
    font-size: 0.8rem;
    color: #aabbcc;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================================
 * 底部新闻公告区域（第二段背景）
 * ============================================================ */
.bottom-news-section {
    max-width: 1200px;
    margin: 0 auto;
}

.bottom-news-title {
    text-align: center;
    color: #fff;
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 30px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 分类切换标签 */
.news-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.news-tab {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.news-tab:hover {
    background: rgba(255, 255, 255, 0.25);
}

.news-tab.active {
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    border-color: #fff;
    font-weight: bold;
}

/* 底部新闻列表 */
.bottom-news-list {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 20px 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.bottom-news-list .news-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f2f5;
}

.bottom-news-list .news-item:last-child {
    border-bottom: none;
}

/* ============================================================
 * 右侧浮动按钮
 * ============================================================ */
.float-buttons {
    position: fixed;
    right: 20px;
    bottom: 100px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.float-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    color: #4a90e2;
    font-size: 0.7rem;
}

.float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.float-btn .float-icon {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

/* ============================================================
 * 响应式适配
 * ============================================================ */
@media (max-width: 900px) {
    .card-top {
        flex-direction: column;
        gap: 30px;
    }

    .user-panel {
        width: 100%;
    }

    .action-buttons {
        flex-wrap: wrap;
    }

    .action-btn {
        max-width: calc(50% - 10px);
    }

    .site-header {
        padding: 0 16px;
    }

    .main-card {
        padding: 20px;
        width: 96%;
    }
}

@media (max-width: 520px) {
    .hero-title h2 {
        font-size: 1.8rem;
        letter-spacing: 4px;
    }

    .action-btn {
        max-width: 100%;
    }

    .float-buttons {
        right: 10px;
        bottom: 60px;
    }

    .float-btn {
        width: 44px;
        height: 44px;
        font-size: 0.6rem;
    }
}

/* ============================================================
 * 未登录状态覆盖层
 * ============================================================ */
.guest-overlay {
    text-align: center;
    padding: 60px 20px;
}

.guest-overlay h2 {
    color: #2c3e50;
    font-size: 1.6rem;
    margin-bottom: 16px;
}

.guest-overlay p {
    color: #8899aa;
    margin-bottom: 30px;
}

.guest-overlay .btn-group {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.guest-overlay .btn-guest {
    padding: 12px 36px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.guest-overlay .btn-guest-primary {
    background: #4a90e2;
    color: #fff;
}

.guest-overlay .btn-guest-primary:hover {
    background: #357abd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

.guest-overlay .btn-guest-secondary {
    background: #f0f4f8;
    color: #556677;
    border: 1px solid #dde3ea;
}

.guest-overlay .btn-guest-secondary:hover {
    background: #e2e8f0;
}

/* ============================================================
 * 登录 / 注册 / 修改密码 页面通用样式
 * ============================================================ */
.auth-page {
    min-height: 100vh;
    background-image: url('../../images/bg1.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 30, 60, 0.4);
    z-index: 0;
}

.auth-logo {
    position: absolute;
    top: 24px;
    left: 40px;
    z-index: 10;
}

.auth-logo img {
    height: 50px;
    width: auto;
}

.auth-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 16px;
    padding: 40px 36px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(8px);
}

.auth-card h2 {
    text-align: center;
    font-size: 1.6rem;
    color: #2c3e50;
    margin-bottom: 6px;
}

.auth-card .auth-subtitle {
    text-align: center;
    font-size: 0.9rem;
    color: #8899aa;
    margin-bottom: 28px;
}

/* 表单 */
.auth-form-group {
    margin-bottom: 18px;
}

.auth-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: #556677;
    font-weight: 500;
}

.auth-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d0d8e0;
    border-radius: 10px;
    background: #fff;
    color: #2c3e50;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    outline: none;
}

.auth-input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

.auth-input::placeholder {
    color: #aabbcc;
}

/* 按钮 */
.auth-btn {
    display: block;
    width: 100%;
    padding: 14px;
    margin-top: 8px;
    background: #4a90e2;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.auth-btn:hover {
    background: #357abd;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.35);
}

/* 提示信息 */
.auth-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 0.9rem;
}

.auth-alert-error {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #c0392b;
}

.auth-alert-success {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: #27ae60;
}

/* 底部链接 */
.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #8899aa;
}

.auth-footer a {
    color: #4a90e2;
    transition: color 0.3s;
}

.auth-footer a:hover {
    color: #357abd;
    text-decoration: underline;
}

.auth-email-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.auth-email-row .auth-input {
    flex: 1;
}

.auth-btn-small {
    width: auto;
    padding: 12px 16px;
    white-space: nowrap;
    font-size: 0.85rem;
    margin-top: 0;
    background: #4a90e2;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.auth-btn-small:hover {
    background: #357abd;
}

.auth-btn-small:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 响应式 */
@media (max-width: 520px) {
    .auth-logo {
        left: 20px;
        top: 16px;
    }

    .auth-logo img {
        height: 40px;
    }

    .auth-card {
        padding: 30px 24px;
        border-radius: 12px;
    }

    .auth-card h2 {
        font-size: 1.4rem;
    }

    .auth-email-row {
        flex-direction: column;
    }

    .auth-btn-small {
        width: 100%;
    }
}
