/* -------------------------------------- */
/* 基础设置 */
/* -------------------------------------- */
:root {
    /* 使用Logo的主色调 */
    --main-color: rgba(24, 46, 69, 0.76);
    /* 浅色辅助色，用于按钮或背景 */
    --light-main-color: #dc3545;
    /* 深色文字 */
    --text-color: #f0f0f0;
    /* 深色背景 */
    --bg-color: #2b2e3a;
    /* 字体设置 */
    --font-family: 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', sans-serif;
    --primary-color: rgba(24, 46, 69, 0.76);
    --error-color: #dc3545;
    --secondary-color: rgb(48, 68, 94);
    --tag-bg-color: rgba(24, 46, 69, 0.76);
    --tag-text-color: #f6f6f6;
    --bs-body-font-family: var(--bs-font-sans-serif);
    --bs-body-font-size: 1rem;
    --bs-body-font-weight: 400;
    --bs-body-line-height: 1.5;
    --bs-body-color: #212529;
    --bs-body-color-rgb: 33,37,41;
    --bs-body-bg:  #17181c;
    --bs-body-bg-rgb: 255,255,255;
    --bs-body-text-align:left;
}

*,::after,::before {
    box-sizing: border-box
}

@media (prefers-reduced-motion:no-preference) {
    :root {
        scroll-behavior: smooth
    }
}

/* 全局重置 */
body {
    margin: 0;
    padding: 0 6px;
    line-height: 1.6;
    color: var(--text-color);
    font-family: var(--bs-body-font-family);
    font-size: var(--bs-body-font-size);
    font-weight: var(--bs-body-font-weight);
    line-height: var(--bs-body-line-height);
    text-align: var(--bs-body-text-align);
    background-color: var(--bs-body-bg);
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent
}

/* 链接基础样式 */
a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--light-main-color);
}

/* -------------------------------------- */
/* 头部 (Header) & 导航 (Nav) */
/* -------------------------------------- */

header {
    /*border-bottom: 1px solid #eee;*/
    padding: 9px 0 9px 0;
    /* Flex布局使得Logo和Nav在同一行 */
    display: flex;
    align-items: center;
    justify-content: center;
}
.container,.container-fluid,.container-lg,.container-md,.container-sm,.container-xl,.container-xxl {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 0;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    max-width:1600px;
}

/* 修改 header .container 样式 */
header .container {
    background: var(--main-color, #1eae3d);
    display: flex;
    flex-wrap: wrap;          /* 允许内容换行 */
    align-items: center;
    justify-content: center;  /* 换行后居中显示 */
    gap: 12px 30px;           /* 第一个值是行间距，第二个是列间距 */
    padding: 15px;
    border-radius: 12px;
}

/* 容器：处理单行溢出与布局 */
.hot-tags {
    display: flex;
    flex-wrap: nowrap;       /* 强制单行 */
    overflow: hidden;        /* 超出隐藏 */
    align-items: center;
    gap: 10px;               /* 标签间距 */
    padding: 0 15px 9px 15px;
    max-width: 1600px;
    margin: 0 auto;
    /* 右侧渐变消失，暗示还有更多内容 */
    -webkit-mask-image: linear-gradient(to right, #000 98%, transparent 100%);
    mask-image: linear-gradient(to right, #000 98%, transparent 100%);
    width: 90%;
}

/* 标签包装器：防止被压扁 */
.hot-tag {
    flex-shrink: 0;
}

/* 标签链接：核心美化 */
.hot-tag-link-internal {
    display: inline-block;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    color: #d6d6d6;
    background: #273b6e;      /* 浅灰色背景 */
    padding: 3px 6px;
    border-radius: 12px;      /* 全圆角胶囊设计 */
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 选中后的样式 */
.hot-tag-link-internal.active {
    background-color: #2563eb !important; /* 强制覆盖原背景 */
    color: #ffffff !important;           /* 文字变白 */
    border-color: #2563eb;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
    font-weight: 600;
}

/* 选中状态下取消悬停的位移，或者保持位移 */
.hot-tag-link-internal.active:hover {
    background-color: #1d4ed8 !important;
    transform: none; /* 选中时不需要再跳动 */
}

/* 悬停效果：更有活力的蓝色 */
.hot-tag-link-internal:hover {
    color: #eb2525;           /* 蓝色文字 */
    background: #eff6ff;      /* 极浅蓝背景 */
    border-color: #bfdbfe;    /* 浅蓝边框 */
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/*!* 第一个标签高亮 (可选，增加视觉层次) *!*/
/*.hot-tag:first-child .hot-tag-link-internal {*/
/*    background: #fff7ed;*/
/*    color: #ea580c;*/
/*    border-color: #ffedd5;*/
/*}*/



/* 修改 .logo 样式 */
.header.logo { /* 匹配 header.html 中的 class="header logo" */
    display: flex;
    align-items: center; /* 垂直居中对齐 logo 和搜索框 */
    gap: 30px; /* logo 和搜索框之间的间距 */
    flex-shrink: 0;
}

/* 确保 Logo 图片大小合适 */
.header.logo img {
    width: auto;
}
/* -------------------------------------- */
/* 搜索框 (Search) 样式 */
/* -------------------------------------- */

.search-container {
    /* 允许搜索容器在一定程度上缩放，但不要过度拉伸 */
    flex-grow: 1;
    min-width: 250px; /* 设置一个合理的最小换行触发点 */
    max-width: 800px;
    display: flex;         /* 开启弹性布局 */
    align-items: center;   /* 垂直居中对齐输入框和数字 */
    gap: 12px;             /* 输入框和数字之间的间距 */
}

.search-container label {
    display: inline-block;
    margin: 0;
    width: auto;     /* 去掉固定 380px 宽度 */
    flex-grow: 1;
}

.search-container #sfx_total {
    white-space: nowrap;  /* 强制数字不换行 */
    font-weight: bold;    /* 可选：让数字更显眼 */
    color: #919191;          /* 可选：设置颜色 */
    margin-left: 38px;
    font-size: 12px;
}

/* 搜索输入框 */
.search-container input[type="text"] {
    background: #55647a;
    width: 100%;
    padding: 10px 15px;
    /* 去掉默认边框，使用自定义样式 */
    border: 2px solid #4b5f6c;
    border-radius: 20px; /* 圆角边框 */
    font-size: 16px;
    color: var(--text-color);
    /* 移除浏览器默认焦点外框 */
    outline: none;
    /* 动画过渡，让交互更平滑 */
    transition: border-color 0.3s, box-shadow 0.3s;

    /* 修正 th:value="搜索" 导致的默认显示问题，应使用 placeholder */
    /* **注意：这需要在你的 header.html 中将 th:value 替换为 placeholder ** */
}

/* 搜索框聚焦时的样式 */
.search-container input[type="text"]:focus {
    border-color: var(--main-color); /* 聚焦时使用主色调 */
    box-shadow: 0 0 0 3px rgba(30, 174, 61, 0.2); /* 淡淡的光晕效果 */
}
.search-container input::placeholder { /* 标准语法 */
    color: #AAAAAA; /* 设定你想要的颜色，这里是一个浅灰色 */
    opacity: 1; /* 确保在 Firefox 中颜色不会变淡 */
}

.search-container input::-webkit-input-placeholder { /* Webkit 内核 (Chrome, Safari, Opera) */
    color: #AAAAAA;
}

.search-container input:-moz-placeholder { /* 旧版 Firefox (Firefox 18 及其之前版本) */
    color: #AAAAAA;
    opacity: 1;
}

.search-container input::-moz-placeholder { /* 标准 Firefox */
    color: #AAAAAA;
    opacity: 1;
}

input:-ms-input-placeholder { /* 旧版 IE/Edge */
    color: #AAAAAA;
}
/* -------------------------------------- */
/* 4. Logo 样式 (确保 Logo 容器不会占据多余空间) */
/* -------------------------------------- */
/* Logo 样式 */
.logo {
    display: flex;
    align-items: flex-end; /* 使 .com 靠近底部对齐 */
    margin-right: 80px;
    /* 确保 Logo 容器只占据内容所需的空间，而不是 Flex 布局的默认拉伸 */
    flex-shrink: 0;
}

.logo-text {
    font-size: 28px;
    font-weight: 700;
    color: var(--main-color); /* 使用Logo的绿色 */
    letter-spacing: -1px;
}

.logo-slogan {
    font-size: 14px;
    color: var(--text-color);
    margin-left: 4px;
    opacity: 0.7;
    padding-bottom: 2px;
}
.nav-wrapper {
    flex-grow: 1;
    min-width: auto; /* 去掉之前的 400px，允许它收缩到屏幕宽度内 */
    display: flex;
    justify-content: center;
}

/* 导航栏样式 */
/* 导航栏样式 */
nav {
    /* Nav 元素现在在 Flex 布局中，占据剩余空间 */
    /* 移除之前的 margin-top */
    margin-top: 0;
    /* 可选：设置最小宽度，确保导航在没有足够链接时也不会太窄 */
    min-width: auto; /* 同样去掉最小宽度 */
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;

    /* === 核心修改：让列表项在 nav-wrapper 占据的全部右侧空间内居中 === */
    justify-content: center;
}

nav ul li {
    /* 保持左右间距一致，让居中效果更平衡 */
    margin: 0 18px;
}

nav ul li a {
    color: var(--text-color);
    font-size: 16px;
    padding: 5px 0;
    position: relative;
    /* 简洁的下划线动画效果 */
}

nav ul li a:hover {
    color: var(--light-main-color);
}

nav ul li a::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--main-color);
    transition: width 0.3s;
    position: absolute;
    bottom: -5px;
    left: 0;
}

nav ul li a:hover::after {
    width: 100%;
}


/* -------------------------------------- */
/* 主视觉区 (Hero Section) */
/* -------------------------------------- */

.hero {
    /*background-color: var(--bg-color); */
    padding: 16px 0;
    text-align: center;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 15px;
    color: var(--text-color);
    font-weight: 800;
    line-height: 1.2;
}

.hero p {
    font-size: 20px;
    color: #666;
    margin-bottom: 30px;
}

/* 行为召唤按钮 (Call to Action) */
.cta-button {
    display: inline-block;
    background-color: var(--main-color);
    color: white;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 18px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s, transform 0.2s;
}

.cta-button:hover {
    background-color: #168631; /* 按钮深色hover效果 */
    transform: translateY(-2px);
    color: white; /* 保持白色文字 */
}

/* -------------------------------------- */
/* 快速链接区 (Quick Links) */
/* -------------------------------------- */

.quick-links {
    padding: 30px 0;
    text-align: center;
}

.quick-links h2 {
    font-size: 32px;
    margin-bottom: 40px;
}

.link-grid {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    flex-wrap: wrap; /* 适应小屏幕 */
}

.link-item {
    flex: 1; /* 平均分配空间 */
    min-width: 200px; /* 最小宽度 */
    padding: 30px 20px;
    border: 1px solid #676d7e;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    background: rgba(24, 46, 69, 0.76);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.link-item:hover {
    border-color: var(--main-color);
    background-color: #f0fdf2; /* 浅绿背景 */
    color: var(--main-color);
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(30, 174, 61, 0.1);
}

/* -------------------------------------- */
/* 底部 (Footer) */
/* -------------------------------------- */

footer {
    background-color: #2b2e3a;
    color: white;
    padding: 20px 0;
    font-size: 14px;
    text-align: center;
    margin-top:20px;
}

footer a {
    color: #ccc;
    margin: 0 10px;
}

footer a:hover {
    color: var(--light-main-color);
}

/* 遮罩层 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
}

.download-modal h3, .download-modal h4, .download-modal h5, .download-modal h6 {
    text-align: center;
    font-size: 14px;
}

.download-modal h3 {
    font: bold 14px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* 对话框主体 */
.download-modal {
    border: none;
    border-radius: 12px;
    padding: 0;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 1000;
}

.download-modal::backdrop { background: transparent; }

.modal-content {
    padding: 24px;
    position: relative;
    background: #fff;
    text-align: center;
}

.close-modal-btn {
    position: absolute;
    right: 12px; top: 8px;
    background: none; border: none; font-size: 24px; cursor: pointer; color: #999;
}

/* 状态样式 */
.info-item { margin: 10px 0; color: #666; font-size: 14px; }
.auth-warning, .auth-warning a, .auth-warning a:link { color: #e74c3c; font-weight: bold; margin: 15px 0; }

.btn-primary {
    display: inline-block;
    background: #4CAF50; color: white;
    padding: 10px 20px; border-radius: 5px; text-decoration: none; margin-top: 15px;
    border: 0;
}

.hot-tags-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden; /* 防止意外滚动 */
}

.hot-tags {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap; /* 默认不换行 */
    transition: height 0.2s ease;
}

.hot-tags.collapsed {
    flex-wrap: nowrap;
    overflow: hidden;
    white-space: nowrap;
}

.hot-tags.expanded {
    flex-wrap: wrap;
    max-width: none;
}

.more-tags-btn {
    background: #444;
    color: #66BB6A;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 14px;
    cursor: pointer;
    min-width: 40px;
    text-align: center;
}

.more-tags-btn:hover {
    background: #555;
}