/* ============================================================
   heie.cn 全站公共样式（base.css）
   - 基础重置 / 布局 / 顶部导航栏（含搜索）/ 页脚 / 通用组件
   - 顶部导航栏为全站公用样式，各功能页复用
   静态资源域名: img.heie.cn（绑定 heiehtml/img 目录）
   ============================================================ */

/* ---------- 基础重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    font-size: 14px;
    line-height: 1.7;
}
a { color: #1677ff; text-decoration: none; transition: color .2s, background .2s; }
a:hover { color: #0958d9; }
img { max-width: 100%; vertical-align: middle; }
ul, ol { list-style: none; }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.4; }
input, button { font-family: inherit; outline: none; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 8px; padding-bottom: 12px; }

/* ---------- 顶部导航栏（公共样式，各功能页复用） ---------- */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e9edf2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    height: 64px;
    flex-wrap: nowrap;
    gap: 20px;
}

.logo { flex-shrink: 0; margin-right: 8px; }
.logo a {
    font-size: 22px;
    font-weight: 700;
    color: #1677ff;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #1677ff, #4096ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo a:hover { opacity: .85; }

.site-nav { flex: 1; min-width: 0; overflow: hidden; }
.site-nav ul { display: flex; flex-wrap: nowrap; }
.site-nav li { margin-right: 28px; flex-shrink: 0; }
.site-nav a {
    display: block;
    padding: 6px 2px;
    color: #444;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.site-nav a:hover { color: #1677ff; border-bottom-color: #1677ff; }

/* 顶部搜索框 */
.header-search {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    width: 240px;
    height: 36px;
    border: 1px solid #d9d9d9;
    border-radius: 18px;
    overflow: hidden;
    background: #fafafa;
    transition: border-color .2s, box-shadow .2s;
}
.header-search:focus-within {
    border-color: #1677ff;
    box-shadow: 0 0 0 2px rgba(22, 119, 255, .12);
    background: #fff;
}
.header-search input {
    flex: 1;
    height: 100%;
    border: none;
    background: transparent;
    padding: 0 12px 0 16px;
    font-size: 13px;
    color: #333;
}
.header-search input::placeholder { color: #bbb; }
.header-search button {
    height: 100%;
    border: none;
    background: linear-gradient(135deg, #1677ff, #4096ff);
    color: #fff;
    padding: 0 16px;
    font-size: 13px;
    cursor: pointer;
    transition: opacity .2s;
}
.header-search button:hover { opacity: .9; }

/* ---------- 页脚 ---------- */
.site-footer {
    background: #1f2937;
    color: #9ca3af;
    margin-top: 40px;
    padding: 32px 0 24px;
    font-size: 13px;
}
.site-footer .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 24px;
    margin-bottom: 16px;
}
.site-footer .footer-links a { color: #d1d5db; font-size: 14px; }
.site-footer .footer-links a:hover { color: #4096ff; }
.site-footer .footer-note {
    text-align: center;
    color: #6b7280;
    margin-bottom: 10px;
    font-size: 12px;
}
.site-footer .footer-copy {
    text-align: center;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.9;
}
.site-footer .footer-copy a { color: #9ca3af; }
.site-footer .footer-copy a:hover { color: #4096ff; }

/* 旧 footer 兼容（.foot 类） */
.foot {
    background: #1f2937;
    color: #9ca3af;
    margin-top: 40px;
    padding: 28px 16px;
    text-align: center;
    font-size: 13px;
}
.foot p { margin: 6px 0; color: #6b7280; }
.foot a { color: #9ca3af; }
.foot a:hover { color: #4096ff; }

/* ---------- 通用组件 ---------- */
.btn {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 6px;
    background: linear-gradient(135deg, #1677ff, #4096ff);
    color: #fff;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
}
.btn:hover { opacity: .9; color: #fff; }
.btn:active { transform: translateY(1px); }

.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    background: #f0f5ff;
    color: #1677ff;
    font-size: 12px;
    margin: 2px 4px 2px 0;
}

/* 回到顶部 */
.back-top {
    position: fixed;
    right: 24px;
    bottom: 40px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    color: #1677ff;
    font-size: 18px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99;
    transition: all .2s;
}
.back-top:hover { background: #1677ff; color: #fff; border-color: #1677ff; }
.back-top.show { display: flex; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
    .header-search { width: 180px; }
    .site-nav li { margin-right: 18px; }
}
@media (max-width: 768px) {
    .header-inner { height: auto; padding: 12px 0; flex-wrap: wrap; gap: 10px; }
    .logo { width: auto; margin-right: 0; }
    .site-nav { width: 100%; order: 3; }
    .site-nav ul { flex-wrap: wrap; }
    .site-nav li { margin: 0 16px 6px 0; }
    .header-search { width: 100%; order: 2; }
    .container { padding: 0 12px; }
}
