/* 全站头部与页脚（2026-11 改版）
 * 由 frontend/views/layouts/_site-header.php / _site-footer.php 引用，全站唯一来源。
 * 白色头部 + 底边浅灰车道虚线；当前导航红字 + 红色下划线；页脚浅色多列。
 * 登录入口由 static 上的 log-in.js 插入 body 最前面的 .register，这里把它定位到头部右侧。
 * communal.css 用 * 选择器强制了字体，所以头尾内部逐层覆盖回系统字体。
 */
:root {
    --sh-brand: #ec2139;
    --sh-brand-ink: #d0192e;
    --sh-ink: #1a1e23;
    --sh-text: #30363d;
    --sh-muted: #5a616a;
    --sh-line: #e1dfd8;
    --sh-lane: #cfccc3;
    --sh-surface: #ffffff;
    --sh-surface-2: #f8f7f4;
    --sh-wrap: 960px;
    --sh-head-h: 64px;
    --sh-login-w: 112px;
    --sh-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Source Han Sans CN", sans-serif;
}

.sh-head, .sh-head *, .sh-foot, .sh-foot *, .register, .register * {
    box-sizing: border-box;
    font-family: var(--sh-font);
}

.sh-wrap {
    width: min(var(--sh-wrap), 100% - 32px);
    margin: 0 auto;
}

/* ---------- 头部 ---------- */
.sh-head {
    position: relative;
    background: var(--sh-surface);
}
.sh-head::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--sh-lane) 0 28px, transparent 28px 52px) 0 0 / 52px 2px repeat-x;
}
.sh-head .sh-wrap {
    display: flex;
    align-items: center;
    gap: 24px;
    height: var(--sh-head-h);
}
.sh-logo {
    display: block;
    flex: none;
}
.sh-logo img {
    display: block;
    width: auto;
    height: 40px;
}
.sh-nav {
    display: flex;
    flex: 1;
    min-width: 0;
    height: 100%;
}
.sh-nav a {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 14px;
    color: var(--sh-text);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
}
.sh-nav a:hover {
    color: var(--sh-ink);
}
.sh-nav a[aria-current="page"] {
    color: var(--sh-brand-ink);
}
.sh-nav a[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 10px;
    height: 3px;
    border-radius: 2px;
    background: var(--sh-brand);
}
.sh-tools {
    display: flex;
    align-items: center;
    flex: none;
    margin-right: var(--sh-login-w);
}
.sh-pc {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid var(--sh-line);
    border-radius: 999px;
    color: var(--sh-ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
}
.sh-pc:hover {
    border-color: var(--sh-ink);
}
.sh-head a:focus-visible, .sh-foot a:focus-visible, .register a:focus-visible {
    outline: 3px solid #1764d4;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- 登录条：log-in.js 插入的 .register 收进头部右侧 ---------- */
.register {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    height: 0;
    background: none;
    box-shadow: none;
    line-height: normal;
}
.register > div {
    position: relative;
    width: min(var(--sh-wrap), 100% - 32px);
    height: 0;
    margin: 0 auto;
}
.register > div .right {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding-left: 12px;
    float: none;
    width: var(--sh-login-w);
    min-width: 0;
    max-width: none;
    height: var(--sh-head-h);
    color: var(--sh-text);
    font-size: 14px;
    white-space: nowrap;
}
.register .right .log-in {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 4px;
    color: var(--sh-text);
    font-size: 14px;
    font-weight: 600;
}
.register .right .log-in:hover {
    color: var(--sh-brand-ink);
}
.register .right img {
    flex: none;
    width: 28px;
    height: 28px;
    margin: 0;
    border-radius: 50%;
}
.register > div .right > span {
    display: inline-block;
    max-width: 72px;
    margin: 0;
    overflow: hidden;
    color: var(--sh-ink);
    font-size: 14px;
    line-height: 1.4;
    text-overflow: ellipsis;
}
.register .right .quit {
    position: absolute;
    top: calc(var(--sh-head-h) - 10px);
    right: 0;
    width: 96px;
    padding: 6px 0;
    border: 1px solid var(--sh-line);
    border-radius: 8px;
    background: var(--sh-surface);
    box-shadow: 0 8px 24px -12px rgba(20, 24, 28, .25);
    font-size: 14px;
    line-height: 30px;
    text-align: center;
}
.register .right .quit a {
    color: var(--sh-text);
}
.register .right .quit:hover a {
    color: var(--sh-brand-ink);
}

/* ---------- 页脚 ---------- */
.sh-foot {
    position: relative;
    margin-top: 48px;
    background: var(--sh-surface);
    color: var(--sh-muted);
    font-size: 14px;
    line-height: 1.75;
}
.sh-foot::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--sh-lane) 0 28px, transparent 28px 52px) 0 0 / 52px 2px repeat-x;
}
.sh-foot a {
    color: var(--sh-muted);
    text-decoration: none;
}
.sh-foot a:hover {
    color: var(--sh-ink);
}
.sh-foot-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(0, 1fr)) auto;
    gap: 28px;
    padding: 40px 0 28px;
}
.sh-foot-brand img {
    display: block;
    width: auto;
    height: 40px;
    margin-bottom: 12px;
}
.sh-foot-brand p {
    margin: 0;
}
.sh-foot-title {
    margin: 0 0 10px;
    color: var(--sh-ink);
    font-size: 15px;
    font-weight: 700;
}
.sh-foot-col ul {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.sh-foot-qr {
    text-align: center;
}
.sh-foot-qr img {
    display: block;
    width: 104px;
    height: 104px;
    margin: 0 auto;
    padding: 4px;
    border: 1px solid var(--sh-line);
    border-radius: 8px;
    background: #fff;
}
.sh-foot-qr span {
    display: block;
    margin-top: 6px;
    font-size: 13px;
}
.sh-foot-legal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 24px;
    padding: 14px 0 24px;
    border-top: 1px solid var(--sh-line);
    font-size: 13px;
}
.sh-foot-legal span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.sh-foot-legal img {
    display: block;
    width: 16px;
    height: auto;
}

@media (prefers-reduced-motion: no-preference) {
    .sh-head a, .sh-foot a, .register a {
        transition: color .15s, border-color .15s;
    }
}

/* ---------- 窄屏 ---------- */
@media (max-width: 980px) {
    .sh-foot-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .sh-foot-brand {
        grid-column: 1 / -1;
    }
}
@media (max-width: 760px) {
    :root {
        --sh-head-h: 56px;
    }
    .sh-head .sh-wrap {
        flex-wrap: wrap;
        gap: 0 12px;
        height: auto;
    }
    .sh-logo {
        display: flex;
        align-items: center;
        height: var(--sh-head-h);
    }
    .sh-logo img {
        height: 34px;
    }
    .sh-tools {
        margin-left: auto;
    }
    .sh-nav {
        order: 3;
        flex-basis: calc(100% + 32px);
        height: 44px;
        margin: 0 -16px;
        padding: 0 4px;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .sh-nav::-webkit-scrollbar {
        display: none;
    }
    .sh-nav a {
        padding: 0 12px;
        font-size: 15px;
    }
    .sh-nav a[aria-current="page"]::after {
        left: 12px;
        right: 12px;
        bottom: 6px;
    }
    .sh-foot-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px;
        padding: 32px 0 20px;
    }
    .sh-foot-col:last-of-type {
        grid-column: 1 / -1;
    }
    .sh-foot-col:last-of-type ul {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 22px;
    }
    .sh-foot-qr {
        display: flex;
        grid-column: 1 / -1;
        align-items: center;
        gap: 12px;
        text-align: left;
    }
    .sh-foot-qr img {
        margin: 0;
    }
    .sh-foot-qr span {
        margin: 0;
    }
}
