/* ==========================================================================
   丹山社区网站 · 前台响应式样式（移动优先）
   ========================================================================== */

:root {
    --brand: #b71c1c;
    --brand-light: #d32f2f;
    --brand-dark: #8e1414;
    --gold: #d4a017;
    --text: #2b2b2b;
    --text-sub: #5c5c5c;
    --muted: #8a8a8a;
    --bg: #f4f5f7;
    --card: #ffffff;
    --border: #e9eaec;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(0, 0, 0, .06);
    --shadow-hover: 0 8px 24px rgba(183, 28, 28, .14);
    --header-h: 56px;
    --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial,
            "Hiragino Sans GB", "Heiti SC", sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: color .2s; }
a:hover { color: var(--brand); }
img { max-width: 100%; height: auto; display: block; border: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0 0 14px; }
h1, h2, h3, h4 { margin: 0 0 12px; font-weight: 700; line-height: 1.4; }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 14px;
}

/* ============================ 顶部工具条 ============================ */
.topbar {
    display: none;
    background: var(--brand-dark);
    color: rgba(255, 255, 255, .86);
    font-size: 13px;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; height: 34px; }
.topbar a { color: rgba(255, 255, 255, .86); }
.topbar a:hover { color: #fff; }
.topbar .tb-hi::before {
    content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
    background: var(--gold); margin-right: 8px; vertical-align: 1px;
}
.topbar .tb-links { display: flex; align-items: center; gap: 4px; }
.topbar .tb-links a {
    padding: 4px 10px; border-radius: 12px;
    transition: background .2s, color .2s;
}
.topbar .tb-links a:hover { background: rgba(255, 255, 255, .14); }

/* ============================ 头部导航 ============================ */
/* 顶部包裹层：PC 端随滚动自动隐藏 / 显示 */
.headwrap { position: relative; z-index: 999; }

.header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
}
.header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-h);
}
.logo { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; order: 1; }
.logo img { width: 34px; height: 34px; object-fit: contain; border-radius: 4px; }
.logo-txt { min-width: 0; }
.logo-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--brand);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.logo-sub { font-size: 11px; color: var(--muted); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-toggle {
    width: 40px; height: 40px;
    border: 0; background: transparent;
    cursor: pointer; padding: 9px;
    display: flex; flex-direction: column; justify-content: space-between;
    order: 2;
}
.nav-toggle span { display: block; height: 2px; background: var(--brand); border-radius: 2px; transition: .25s; }

.nav {
    display: none;
    order: 3;
    flex: 0 0 100%;
    background: #fff;
    border-top: 1px solid var(--border);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
}
.nav.open { display: block; }
.nav > ul > li { border-bottom: 1px solid #f2f2f2; }
.nav > ul > li > a {
    display: block;
    padding: 13px 4px;
    font-size: 15px;
    font-weight: 600;
    position: relative;
}
.nav > ul > li.active > a, .nav > ul > li > a:hover { color: var(--brand); }
.nav > ul > li.active > a::after {
    content: ''; position: absolute; left: 0; bottom: 0; width: 22px; height: 3px; background: var(--brand); border-radius: 2px;
}
/* 下拉：小屏用圆角标签平铺 */
.nav .sub {
    display: flex; flex-wrap: wrap; gap: 8px; padding: 0 4px 12px;
}
.nav .sub a {
    font-size: 13px; color: var(--text-sub);
    background: #f6f6f6; border-radius: 20px; padding: 4px 12px;
}
.nav .sub a:hover { background: var(--brand); color: #fff; }

/* ============================ 轮播 ============================ */
.slider { position: relative; overflow: hidden; background: #ddd; height: 200px; }
.slider .slides { position: relative; height: 100%; }
.slider .slide {
    position: absolute; inset: 0;
    opacity: 0; transition: opacity .6s;
    background-size: cover; background-position: center;
    display: flex; align-items: flex-end;
}
.slider .slide.active { opacity: 1; }
.slider .slide-mask {
    width: 100%;
    padding: 20px 14px 26px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .65));
    color: #fff;
}
.slider .slide-title { font-size: 18px; font-weight: 700; margin: 0; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.slider .slide-desc { font-size: 13px; opacity: .9; margin: 4px 0 0; }
.slider .dots { position: absolute; right: 12px; bottom: 10px; display: flex; gap: 6px; }
.slider .dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.5); cursor: pointer; }
.slider .dots i.on { background: #fff; width: 18px; border-radius: 4px; }

/* ============================ 公告 ============================ */
.notice {
    display: flex; align-items: center; gap: 10px;
    background: #fff8e6; border: 1px solid #f4e2b8;
    border-radius: var(--radius); padding: 10px 12px; margin: 14px 0 0;
    font-size: 13px; color: #8a6d1f;
}
.notice .tag { flex: none; background: var(--gold); color: #fff; border-radius: 4px; padding: 1px 8px; font-weight: 700; }
.notice .txt { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ============================ 快捷入口 ============================ */
.quick {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
    background: #fff; border-radius: var(--radius); padding: 16px 8px; margin-top: 14px;
    box-shadow: var(--shadow);
}
.quick a { text-align: center; display: block; padding: 4px 2px; }
.quick .ico {
    width: 44px; height: 44px; margin: 0 auto 6px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--brand-light), var(--brand));
    color: #fff; font-size: 19px; font-weight: 700;
}
.quick .ico.g { background: linear-gradient(135deg, #e0a52a, var(--gold)); }
.quick span { font-size: 12px; color: var(--text-sub); }

/* ============================ 通用区块 ============================ */
.section { margin-top: 18px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.section-hd {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 14px 10px;
    border-bottom: 1px solid var(--border);
}
.section-hd h2 {
    margin: 0; font-size: 17px; color: var(--brand);
    padding-left: 10px; border-left: 4px solid var(--brand);
    line-height: 1.2;
}
.section-hd .more { font-size: 13px; color: var(--muted); }
.section-bd { padding: 12px 14px; }

/* ============================ 首页：焦点新闻 ============================ */
.focus-grid { display: grid; gap: 12px; }
.focus-main {
    position: relative; display: block; border-radius: var(--radius); overflow: hidden; height: 190px;
    background: #eee center/cover no-repeat;
}
.focus-main .mask {
    position: absolute; inset: auto 0 0 0; padding: 30px 12px 12px;
    background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff;
}
.focus-main .mask h3 { font-size: 16px; margin: 0; }
.focus-main .mask p { margin: 4px 0 0; font-size: 12px; opacity: .85; }
.focus-side { display: grid; gap: 10px; }

/* ============================ 列表样式 ============================ */
.news-list li {
    display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px dashed #eee;
}
.news-list li:last-child { border-bottom: 0; }
.news-list .date {
    flex: none; width: 46px; text-align: center;
    background: #f8f8f8; border-radius: 6px; padding: 4px 0; color: var(--muted);
}
.news-list .date b { display: block; font-size: 18px; color: var(--brand); line-height: 1.1; }
.news-list .date i { font-style: normal; font-size: 11px; }
.news-list .info { flex: 1; min-width: 0; }
.news-list .info h3 {
    margin: 0 0 4px; font-size: 15px; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.news-list .info p {
    margin: 0; font-size: 12.5px; color: var(--muted);
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.news-list.with-img .thumb { flex: none; width: 110px; height: 72px; border-radius: 6px; object-fit: cover; }

.dot-list li {
    position: relative; padding: 9px 0 9px 16px; border-bottom: 1px dashed #f0f0f0;
    font-size: 14.5px;
}
.dot-list li::before {
    content: ''; position: absolute; left: 2px; top: 18px;
    width: 6px; height: 6px; border-radius: 50%; background: var(--brand-light);
}
.dot-list li .meta { float: right; font-size: 12px; color: var(--muted); margin-left: 10px; }
.dot-list li a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================ Tab 切换 ============================ */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px 0; border-bottom: 1px solid var(--border); }
.tabs button {
    flex: none; border: 0; background: #f4f4f4; color: var(--text-sub);
    padding: 7px 16px; border-radius: 20px; font-size: 14px; cursor: pointer;
}
.tabs button.on { background: var(--brand); color: #fff; }
.tab-panel { display: none; padding: 6px 14px 14px; }
.tab-panel.on { display: block; }

/* ============================ 相册网格 ============================ */
.grid-album { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.grid-album .item {
    position: relative; border-radius: 8px; overflow: hidden; background: #eee; aspect-ratio: 4 / 3;
}
.grid-album .item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.grid-album .item:hover img { transform: scale(1.06); }
.grid-album .item .cap {
    position: absolute; inset: auto 0 0 0; padding: 16px 8px 7px;
    background: linear-gradient(transparent, rgba(0,0,0,.68)); color: #fff; font-size: 13px;
}
.grid-album .item .cap b { display: block; font-size: 14px; }
.grid-album .item .cap span { font-size: 11px; opacity: .85; }

/* ============================ 视频卡片 ============================ */
.grid-video { display: grid; gap: 12px; }
.grid-video .item { border-radius: 8px; overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.grid-video .item .cover { position: relative; aspect-ratio: 16/9; background: #222 center/cover no-repeat; }
.grid-video .item .cover .play {
    position: absolute; inset: 0; margin: auto; width: 50px; height: 50px;
    border-radius: 50%; background: rgba(0,0,0,.45); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 20px;
    border: 2px solid rgba(255,255,255,.8);
}
.grid-video .item h3 { font-size: 15px; margin: 0; padding: 10px 12px 4px; }
.grid-video .item p { font-size: 12.5px; color: var(--muted); margin: 0; padding: 0 12px 12px; }

/* ============================ 红色旅游 CTA ============================ */
.cta {
    position: relative; border-radius: var(--radius); overflow: hidden; color: #fff;
    background: linear-gradient(135deg, #8e1414, #d32f2f);
    padding: 24px 18px;
}
.cta::after {
    content: ''; position: absolute; right: -30px; top: -30px; width: 150px; height: 150px;
    border-radius: 50%; background: rgba(255,255,255,.07);
}
.cta h2 { font-size: 20px; margin: 0 0 8px; }
.cta p { font-size: 13.5px; opacity: .92; margin: 0 0 16px; }
.cta .btn {
    display: inline-block; background: #fff; color: var(--brand);
    padding: 9px 22px; border-radius: 24px; font-weight: 700; font-size: 14px;
}
.cta .btn:hover { background: var(--gold); color: #fff; }

/* ============================ 面包屑 ============================ */
.crumb {
    font-size: 13px; color: var(--muted); padding: 12px 0 0;
}
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--brand); }
.crumb span { margin: 0 6px; }

/* ============================ 内页布局 ============================ */
.page-wrap { display: grid; gap: 16px; margin-top: 12px; }
.side-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.side-card h3 {
    margin: 0; padding: 13px 14px; font-size: 16px; color: var(--brand);
    border-bottom: 1px solid var(--border); border-left: 4px solid var(--brand); line-height: 1.2;
}
.side-nav li a {
    display: block; padding: 11px 14px; font-size: 14.5px; border-bottom: 1px solid #f4f4f4;
}
.side-nav li a.on, .side-nav li a:hover { background: #fdf1f1; color: var(--brand); font-weight: 600; }

.article-hd { padding: 18px 16px 8px; text-align: center; border-bottom: 1px solid var(--border); }
.article-hd h1 { font-size: 20px; margin: 0 0 10px; line-height: 1.45; }
.article-meta { font-size: 12.5px; color: var(--muted); }
.article-meta span { margin: 0 8px; }
.article-bd { padding: 16px; font-size: 15.5px; line-height: 1.95; color: #333; }
.article-bd img { max-width: 100%; height: auto; border-radius: 6px; margin: 10px auto; }
.article-bd p { margin: 0 0 16px; text-align: justify; }
.article-bd h2, .article-bd h3 { color: var(--brand); margin-top: 22px; }
.article-bd ul, .article-bd ol { padding-left: 22px; margin-bottom: 16px; }
.article-bd ul li { list-style: disc; }
.article-bd ol li { list-style: decimal; }
.article-bd blockquote {
    margin: 0 0 16px; padding: 10px 14px; background: #fafafa;
    border-left: 4px solid var(--gold); color: var(--text-sub);
}
.article-bd table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.article-bd table th, .article-bd table td { border: 1px solid var(--border); padding: 8px; }

.article-neighbor { display: grid; gap: 8px; padding: 12px 16px 18px; font-size: 14px; }
.article-neighbor a { color: var(--text-sub); }
.article-neighbor a:hover { color: var(--brand); }

/* ============================ 分页 ============================ */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 18px 0 4px; }
.pagination a, .pagination span {
    padding: 6px 13px; border-radius: 6px; background: #fff; border: 1px solid var(--border);
    font-size: 13.5px; color: var(--text-sub);
}
.pagination a:hover { border-color: var(--brand); color: var(--brand); }
.pagination .active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .disabled { opacity: .5; }

/* ============================ 表单 ============================ */
.form-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 14px; margin-bottom: 6px; color: var(--text-sub); }
.form-row label i { color: var(--brand); font-style: normal; }
.form-row input, .form-row select, .form-row textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 14.5px; font-family: var(--font);
    background: #fcfcfc; transition: border-color .2s;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
    outline: 0; border-color: var(--brand); background: #fff;
}
.form-row textarea { min-height: 110px; resize: vertical; }
.form-inline { display: flex; gap: 10px; }
.form-inline .form-row { flex: 1; }
.captcha-row { display: flex; gap: 10px; }
.captcha-row input { flex: 1; }
.captcha-row img { height: 42px; border-radius: 8px; cursor: pointer; border: 1px solid var(--border); }
.btn {
    display: inline-block; border: 0; cursor: pointer;
    background: var(--brand); color: #fff; padding: 11px 30px;
    border-radius: 26px; font-size: 15px; font-weight: 600; font-family: var(--font);
}
.btn:hover { background: var(--brand-dark); color: #fff; }
.btn-block { display: block; width: 100%; }
.btn-ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn-ghost:hover { background: var(--brand); color: #fff; }

/* ============================ 留言墙 ============================ */
.msg-item { padding: 12px 0; border-bottom: 1px dashed #eee; }
.msg-item:last-child { border-bottom: 0; }
.msg-item .hd { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.msg-item .hd b { color: var(--text); }
.msg-item .bd { font-size: 14.5px; margin-top: 6px; }
.msg-item .reply {
    margin-top: 8px; background: #fdf6f6; border-left: 3px solid var(--brand);
    padding: 8px 12px; font-size: 13.5px; color: var(--text-sub); border-radius: 0 6px 6px 0;
}
.msg-item .reply b { color: var(--brand); }

/* ============================ 联系信息 ============================ */
.contact-list li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #eee; font-size: 14.5px; }
.contact-list li:last-child { border-bottom: 0; }
.contact-list li b { flex: none; color: var(--brand); }

/* ============================ 页脚 ============================ */
.footer {
    margin-top: 26px; background: #2b2b2b; color: #c9c9c9;
    padding: 26px 0 70px; font-size: 13px;
}
.footer h4 { color: #fff; font-size: 15px; margin: 0 0 12px; }
.footer .f-grid { display: grid; gap: 20px; }
.footer a { color: #c9c9c9; }
.footer a:hover { color: var(--gold); }
.footer .links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.footer .bottom {
    margin-top: 22px; padding-top: 14px; border-top: 1px solid #3d3d3d;
    text-align: center; color: #8d8d8d; font-size: 12.5px; line-height: 2;
}

/* ============================ 移动端底部工具栏 ============================ */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
    display: flex; background: #fff; border-top: 1px solid var(--border);
    box-shadow: 0 -2px 10px rgba(0,0,0,.06);
}
.tabbar a {
    flex: 1; text-align: center; padding: 7px 0 6px; font-size: 11px; color: var(--muted);
}
.tabbar a i { display: block; font-size: 19px; font-style: normal; line-height: 1.3; }
.tabbar a.on { color: var(--brand); }

/* 返回顶部 */
.totop {
    position: fixed; right: 14px; bottom: 76px; z-index: 1000;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(0,0,0,.35); color: #fff; border: 0;
    display: none; align-items: center; justify-content: center; font-size: 18px; cursor: pointer;
}
.totop.show { display: flex; }

/* 图片查看器 */
.lightbox {
    position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.9);
    display: none; align-items: center; justify-content: center; flex-direction: column;
}
.lightbox.show { display: flex; }
.lightbox img { max-width: 94%; max-height: 78%; border-radius: 6px; }
.lightbox .lb-cap { color: #eee; margin-top: 14px; font-size: 14px; }
.lightbox .lb-close {
    position: absolute; right: 16px; top: 16px; color: #fff; font-size: 28px; cursor: pointer;
    background: none; border: 0;
}

.empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.empty i { font-size: 40px; display: block; margin-bottom: 10px; font-style: normal; opacity: .5; }

/* ============================ 断点：平板 ============================ */
@media (min-width: 768px) {
    body { font-size: 15.5px; }
    .container { padding: 0 20px; }
    :root { --header-h: 74px; }
    .slider { height: 300px; }
    .slider .slide-title { font-size: 26px; }
    .slider .slide-desc { font-size: 15px; }
    .slider .slide-mask { padding: 30px 26px 40px; }
    .quick { grid-template-columns: repeat(6, 1fr); gap: 6px; padding: 22px 10px; }
    .quick .ico { width: 52px; height: 52px; font-size: 22px; }
    .quick span { font-size: 13px; }
    .focus-grid { grid-template-columns: 1.2fr 1fr; }
    .focus-main { height: 280px; }
    .grid-album { grid-template-columns: repeat(3, 1fr); gap: 14px; }
    .grid-video { grid-template-columns: repeat(3, 1fr); }
    .footer { padding-bottom: 26px; }
    .footer .f-grid { grid-template-columns: 1.4fr 1fr 1fr; }
    .tabbar { display: none; }
    .totop { bottom: 24px; }
    .article-hd h1 { font-size: 26px; }
    .article-bd { padding: 24px 30px; font-size: 16px; }
}

/* ============================ 断点：桌面 ============================ */
@media (min-width: 1024px) {
    :root { --header-h: 80px; }

    /* ---- 顶部工具条 ---- */
    .topbar {
        display: block;
        background: #7f1212;
        border-bottom: 1px solid rgba(255, 255, 255, .08);
    }
    .topbar .container { height: 38px; font-size: 13px; }

    /* ---- 头部主行：LOGO 居左、导航居右同排 ---- */
    .header-inner {
        flex-wrap: nowrap;
        gap: 28px;
        height: var(--header-h);
    }
    .nav-toggle { display: none; }
    .logo { flex: 0 1 auto; }
    .logo img { width: 48px; height: 48px; border-radius: 10px; box-shadow: 0 2px 8px rgba(183, 28, 28, .16); }
    .logo-name { font-size: 22px; letter-spacing: .5px; }
    .logo-sub { font-size: 12.5px; letter-spacing: 1px; }

    /* ---- 桌面端导航 ---- */
    .nav {
        display: block !important;
        flex: 1 1 auto;
        border-top: 0;
        overflow: visible;
        max-height: none;
        background: transparent;
    }
    .nav > ul { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
    .nav > ul > li { position: relative; border-bottom: 0; }
    .nav > ul > li > a {
        display: block;
        padding: 10px 15px;
        font-size: 16px;
        font-weight: 500;
        color: #333;
        border-radius: 8px;
        white-space: nowrap;
        transition: color .2s, background .2s;
    }
    .nav > ul > li > a:hover,
    .nav > ul > li.active > a { color: var(--brand); background: #fdf1f1; }

    /* 底部指示条：hover / 当前页展开 */
    .nav > ul > li > a::after {
        content: '';
        position: absolute;
        left: 50%; bottom: 1px;
        width: 26px; height: 3px;
        background: var(--brand);
        border-radius: 3px;
        transform: translateX(-50%) scaleX(0);
        transform-origin: center;
        transition: transform .25s cubic-bezier(.4, 0, .2, 1);
    }
    .nav > ul > li:hover > a::after,
    .nav > ul > li.active > a::after { transform: translateX(-50%) scaleX(1); }

    /* hover 桥接区，避免移到下拉时断 hover */
    .nav > ul > li::before {
        content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 12px;
    }

    /* ---- 二级下拉卡片 ---- */
    .nav .sub {
        display: flex;
        position: absolute;
        left: 50%; top: 100%;
        min-width: 176px;
        margin-top: 8px;
        padding: 8px;
        background: #fff;
        border: 1px solid #f0f0f2;
        border-radius: 12px;
        box-shadow: 0 12px 32px rgba(0, 0, 0, .12);
        flex-direction: column;
        gap: 2px;
        opacity: 0;
        visibility: hidden;
        transform: translateX(-50%) translateY(6px);
        transition: opacity .2s ease, transform .2s ease, visibility .2s;
    }
    .nav > ul > li:hover .sub {
        opacity: 1; visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
    /* 末尾两项改为右对齐，避免溢出容器 */
    .nav > ul > li:nth-last-child(-n + 2) .sub {
        left: auto; right: 0;
        transform: translateY(6px);
    }
    .nav > ul > li:nth-last-child(-n + 2):hover .sub { transform: translateY(0); }

    .nav .sub a {
        display: flex; align-items: center; gap: 8px;
        padding: 9px 12px;
        font-size: 14px;
        color: #444;
        background: transparent;
        border-radius: 8px;
        white-space: nowrap;
        transition: background .18s, color .18s;
    }
    .nav .sub a::before {
        content: '';
        flex: none;
        width: 5px; height: 5px; border-radius: 50%;
        background: #d6d6d6;
        transition: background .18s, transform .18s;
    }
    .nav .sub a:hover {
        background: #fdf1f1;
        color: var(--brand);
    }
    .nav .sub a:hover::before { background: var(--brand); transform: scale(1.3); }

    /* ---- 吸顶 / 自动隐藏 ---- */
    body { padding-top: 120px; }          /* JS 会按实际高度校正；无 JS 时的兜底值 */
    .headwrap {
        position: fixed;
        top: 0; left: 0; right: 0;
        background: #fff;
        box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
        transition: transform .32s cubic-bezier(.4, 0, .2, 1), box-shadow .25s;
        will-change: transform;
    }
    .headwrap.solid {
        box-shadow: 0 6px 22px rgba(0, 0, 0, .14);
        background: rgba(255, 255, 255, .92);
        -webkit-backdrop-filter: saturate(180%) blur(10px);
        backdrop-filter: saturate(180%) blur(10px);
    }
    .headwrap.hide  { transform: translateY(-100%); }
    .header { position: static; box-shadow: none; border-bottom: 1px solid #f1f1f3; }

    /* 滚动后紧凑显示：收起顶部工具条、压缩 LOGO 与导航条 */
    .headwrap .topbar,
    .headwrap .header-inner,
    .headwrap .nav > ul > li > a,
    .headwrap .logo img,
    .headwrap .logo-name { transition: height .25s ease, padding .25s ease, font-size .25s ease, width .25s ease; }
    .headwrap.solid .topbar { height: 0; overflow: hidden; border-bottom: 0; }
    .headwrap.solid .header-inner { height: 62px; }
    .headwrap.solid .logo img { width: 38px; height: 38px; box-shadow: none; }
    .headwrap.solid .logo-name { font-size: 19px; }
    .headwrap.solid .logo-sub { font-size: 11.5px; }
    .headwrap.solid .nav > ul > li > a { padding: 8px 14px; font-size: 15px; }
    .headwrap.solid .nav > ul > li > a::after { bottom: 0; }

    .slider { height: 420px; }

    /* 内页两栏 */
    .page-wrap { grid-template-columns: 240px 1fr; align-items: start; }
    .page-wrap.no-side { grid-template-columns: 1fr; }
    .grid-album { grid-template-columns: repeat(4, 1fr); }

    .home-layout { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
}

/* 1024~1279：站名较长时压缩字号，保证导航不换行 */
@media (min-width: 1024px) and (max-width: 1279px) {
    .header-inner { gap: 18px; }
    .logo-name { font-size: 19px; }
    .logo-sub { font-size: 12px; }
    .nav > ul > li > a { padding: 10px 12px; font-size: 15px; }
}

@media (min-width: 1280px) {
    .container { max-width: 1240px; }
    :root { --header-h: 86px; }
    .nav > ul > li > a { padding: 10px 17px; font-size: 16.5px; }
}

/* 小屏细节优化 */
@media (max-width: 360px) {
    .quick { grid-template-columns: repeat(3, 1fr); }
    .logo-name { font-size: 15px; }
}
