/*此处定义全局变量和全局样式重置*/
/* 根变量：全局主题配置 */
:root {
    /* 导航栏背景色（深蓝色）*/
    --nav-bg-color: #003366;
    /* 深色背景上的白色文字/图标 */
    --text-on-dark: #ffffff;
    /* 主题强调色（紫色）*/
    --mtr-accent-purple: #540a5e;
    /* 正文默认色：深灰色 */
    --body-text-color: #333333;
    /* 品牌红色（用于按钮、强调等）*/
    --brand-red: #e60012;
    /* 全局字体策略：英文优先 Georgia，中文优先宋体系列；原文 Arial/黑体作为兜底 */
    --body-font: Georgia, "Times New Roman", "Songti SC", "Noto Serif SC", "Arial", "SimHei", "Microsoft YaHei", serif;
    /* 头部固定高度，方便布局计算 */
    --header-height: 64px;
    /* 页面文章/声明/新闻正文字体 */
    --article-text-font: "KaiTi", "STKaiti", sans-serif;
    /* h1 标题尺寸：统一页面主标题样式 */
    --heading-h1-size: 2rem;
    /* 功能区固定高度 */
    --function-bar-height: 120px;
    /* 首页英雄区大字尺寸（可直接修改）*/
    --hero-banner-title-size: 40px;
    /* 导航高亮色（黄色，暂未使用）*/
    --nav-highlight-color: #ffcc00;
    /* 文章标题底部装饰线颜色 */
    --accent-line-color: #a60c0c;
}

/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 标题（h1-h6）与品牌名等从 body 继承 Georgia，文章正文由 .content-card 覆盖为楷体 */
h1 { font-size: var(--heading-h1-size); }

html, body {height: 100%;}

/* 确保页面内锚点跳转时不会被固定头部遮挡*/
[id] {scroll-margin-top: calc(max(var(--header-height), calc(var(--nav-rows, 1) * var(--nav-row-height, 64px))) + 12px);}

/*全局平滑滚动（页面内锚点/脚本滚动优先）*/
html {
    scroll-behavior: smooth;
}

/* 隐藏页面最右侧滚动条，保留滚动功能 */
html,
body {
    scrollbar-width: none;            /* Firefox */
    -ms-overflow-style: none;         /* IE/Edge */
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;                    /* Chrome/Safari/新Edge */
}

body {
    display: flex;
    background-color: #f5f5f5;
    flex-direction: column;
    min-height: 100vh;
    font-family: var(--body-font), sans-serif;
    color: var(--body-text-color);
    overflow-x: hidden;
    /* padding-top 由 JavaScript 动态设置，确保与 header 实际高度一致 */
}

/* 列表重置 */
ul, li {
    list-style: none;
}

/* 链接样式 */
a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

/* 图片自适应 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

/* main 区域伸展 */
main {
    flex: 1 0 auto;
    display: block;
}

/* 输入框重置 */
input {
    font-family: inherit;
    outline: none;
    border: none;
}

/* ========== 页面加载动画 ==========
加载时：header和footer显示，main区域显示loading动画
加载完成后：移除loading类，显示实际内容*/

/* Loading遮罩层 */
.page-loading-overlay {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: #f5f5f5;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.page-loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.page-loading-overlay .loading-text {
    margin-top: 12px;
    font-size: 14px;
    color: #999;
}

/* Loading旋转动画（全站通用） */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top-color: #c00000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 加载时隐藏main内容 */
body.is-loading main {
    opacity: 0;
    visibility: hidden;
}