/* 站内公共版式：移动单列 + 桌面端顶栏/侧栏/宽内容区三栏结构 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f7f5; min-height: 100vh; color: #2E3B2E;
}
a { color: #7CB342; }
.hidden { display: none !important; }

.header {
    background: #fff; padding: 8px 12px; text-align: left;
    border-bottom: 1px solid #ECF0EC;
    position: sticky; top: 0; z-index: 60;
}
.header-bar { display: flex; align-items: center; gap: 8px; }
.logo {
    width: 30px; height: 30px; flex: 0 0 auto;
    background: url('/static/app-icon.png') center/cover no-repeat;
    border-radius: 8px; margin: 0;
}
.brand { display: flex; align-items: baseline; gap: 8px; flex: 0 0 72px; min-width: 0; overflow: hidden; }
.app-name { font-size: 16px; font-weight: bold; letter-spacing: 1px; white-space: nowrap; }
.slogan { font-size: 12px; color: #8FA08F; display: none; }
/* 与 nav.css 的 .sn 同一套左锚定：菜单起点固定，尾部按钮不挤压菜单 */
.nav-card {
    display: flex; gap: 2px; row-gap: 4px; flex: 1 1 auto; min-width: 0;
    justify-content: flex-start; flex-wrap: wrap; margin: 0;
}
.nav-card::-webkit-scrollbar { display: none; }
.nav-card a, .nav-card .nav-btn {
    flex: 0 0 auto; text-align: center; padding: 6px 9px; white-space: nowrap;
    border-radius: 8px; color: #2E3B2E; font-size: 13px; font-weight: 500;
    text-decoration: none; cursor: pointer;
}
.nav-card a.accent { color: #E67E22; }
.nav-card a:hover, .nav-card .nav-btn:hover { background: #F1F8E9; }
.nav-card .ico { display: none; }
.nav-card .nav-mini { display: none; }

/* 窄屏：隐藏站名文字、菜单改两字短标签，靠左排开、放不下自动折行，不再横滑 */
@media (max-width: 599px) {
    .header { padding: 8px 10px; }
    .header-bar { gap: 6px; }
    .brand { display: none; }
    .nav-card a, .nav-card .nav-btn { padding: 6px 6px; font-size: 12px; }
    .nav-card .nav-full { display: none; }
    .nav-card .nav-mini { display: inline; }
}

.layout { display: flex; flex-direction: column; }
.layout > * { min-width: 0; }
.layout > .container { order: 1; }
.layout > .rail { order: 2; }
.container { width: 100%; max-width: 560px; margin: 0 auto; padding: 20px 16px 40px; }
.container > .span-2 { grid-column: 1 / -1; }
.card {
    background: #fff; border-radius: 16px; padding: 20px;
    margin-bottom: 16px; box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.rail { max-width: 560px; margin: 0 auto; padding: 0 16px; width: 100%; box-sizing: border-box; }
.rail-group {
    background: #fff; border-radius: 16px; padding: 16px 18px; margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.rail-h { margin: 0 0 12px; font-size: 15px; font-weight: 600; color: #2E3B2E; }
.rail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rail-list a {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 9px 12px; border-radius: 10px; background: #F5F8F4;
    color: #2E3B2E; text-decoration: none; font-size: 14px;
}
.rail-list a em { font-style: normal; font-size: 12px; color: #9CAF88; }
.rail-list a.on { background: linear-gradient(135deg, #E8F5E9, #E0F2F1); font-weight: 600; }

h2.section { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
h2.section a { color: #2E3B2E; text-decoration: none; }
p.section-sub { font-size: 12px; color: #9CAF88; margin-bottom: 14px; line-height: 1.8; }
.intro { font-size: 13px; color: #6B7C6B; line-height: 1.9; }
.today-quote { padding: 18px; border-radius: 12px; background: linear-gradient(135deg, #FFF8E1, #FFF3E0); }
.today-quote p.q { font-size: 17px; line-height: 1.9; }
.today-quote p.a { font-size: 12px; color: #9CAF88; margin-top: 8px; }

ol.txt-list { list-style: none; padding: 0; }
ol.txt-list li {
    padding: 11px 10px; border-bottom: 1px dashed #E8F0E0; border-radius: 8px;
    font-size: 15px; line-height: 1.8; transition: background-color 0.15s ease-out;
}
ol.txt-list li:hover { background: #F4F9EF; }
ol.txt-list li:last-child { border-bottom: none; }
ol.txt-list li span.attr { display: block; font-size: 12px; color: #9CAF88; margin-top: 4px; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pager a {
    padding: 8px 14px; border-radius: 10px; background: #F1F8E9;
    color: #2E3B2E; text-decoration: none; font-size: 13px;
}
.pager span { font-size: 13px; color: #6B7C6B; }
.footer-nav { font-size: 12px; color: #9CAF88; line-height: 2; }
.footer-nav a { color: #7CB342; text-decoration: none; margin-right: 10px; }

/* 首页服务端渲染块：沉浸式大图 + 精选文案 + 壁纸网格 */
.ssr-hero {
    position: relative; margin-bottom: 22px; border-radius: 18px; overflow: hidden;
}
.ssr-hero-img { display: block; position: relative; text-decoration: none; box-shadow: 0 8px 26px rgba(0,0,0,0.12); }
.ssr-hero-img img { width: 100%; height: 260px; object-fit: cover; display: block; }
.ssr-hero-scrim {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.74));
}
.ssr-hero-zoom {
    position: absolute; top: 14px; right: 14px; padding: 7px 13px; border-radius: 999px;
    background: rgba(0,0,0,0.4); color: #fff; font-size: 13px; line-height: 1.4;
}
.ssr-hero-img:hover .ssr-hero-zoom { background: rgba(0,0,0,0.66); }
.ssr-hero-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 18px 18px; }
.ssr-hero-title {
    margin: 0; font-size: 19px; font-weight: 600; color: #fff;
    text-shadow: 0 1px 10px rgba(0,0,0,0.55);
}
.ssr-hero-desc {
    margin: 6px 0 0; font-size: 13px; color: rgba(255,255,255,0.9); line-height: 1.7;
    text-shadow: 0 1px 8px rgba(0,0,0,0.55);
}
.ssr-hero-note { margin: 10px 2px 0; font-size: 12px; color: #9CAF88; line-height: 1.7; }
.ssr-hero-note a { color: #7CB342; text-decoration: none; }
.ssr-h { margin: 0 0 10px; font-size: 15px; font-weight: 600; color: #2E3B2E; }
.ssr-h a { color: #2E3B2E; text-decoration: none; }
.ssr-note { margin: 10px 0 0; font-size: 12px; color: #9CAF88; line-height: 1.7; }
.ssr-note a { color: #7CB342; text-decoration: none; }
.ssr-text-list { margin: 0; padding: 0 0 0 18px; }
.ssr-text-list li {
    margin-bottom: 10px; padding: 4px 8px; border-radius: 8px;
    font-size: 14px; color: #2E3B2E; line-height: 1.8;
    transition: background-color 0.15s ease-out;
}
.ssr-text-list li:hover { background: #F4F9EF; }
.ssr-text-list .attr { color: #9CAF88; font-size: 12px; }
.ssr-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ssr-tile { text-decoration: none; display: block; }
.ssr-tile img { width: 100%; aspect-ratio: 3/4; height: auto; object-fit: cover; display: block; border-radius: 10px; }
.ssr-tile p {
    margin: 6px 0 0; min-height: 16px; font-size: 11px; color: #6B7C6B; line-height: 1.4;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}

/* 查看大图的样式、DOM 与开关统一在 viewer.css / site.js */

/* 小程序推广面板：DOM、样式与开关统一在 nav.css / nav.js */

@media (min-width: 1000px) {
    .ssr-hero-img img { height: 480px; }
    .ssr-hero-body { padding: 26px 32px 28px; }
    .ssr-hero-title { font-size: 28px; }
    .ssr-hero-desc { font-size: 15px; margin-top: 10px; max-width: 860px; }
    .ssr-h { font-size: 18px; margin-bottom: 16px; }
    .ssr-tile p { font-size: 13px; min-height: 19px; }
}

/* 壁纸图库分类页 */
.lib-h1 { font-size: 22px; font-weight: 600; margin-bottom: 6px; }
.lib-sub { font-size: 13px; color: #9CAF88; line-height: 1.8; margin-bottom: 18px; }
.lib-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lib-cell { text-decoration: none; display: flex; flex-direction: column; }
.lib-cell img {
    width: 100%; height: auto; aspect-ratio: 3/4; object-fit: cover; display: block;
    border-radius: 12px; background: #EEF2EC;
}
.lib-cell p {
    margin: 6px 0 0; min-height: 18px; font-size: 12px; color: #6B7C6B; line-height: 1.4;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}

@media (min-width: 1000px) {
    .header { padding: 14px 32px; z-index: 50; box-shadow: 0 1px 6px rgba(0,0,0,0.04); }
    .header-bar { max-width: 1440px; margin: 0 auto; gap: 20px; }
    .logo { width: 42px; height: 42px; border-radius: 12px; }
    .brand { flex-basis: 110px; }
    .app-name { font-size: 22px; }
    .nav-card { gap: 4px; }
    .nav-card a, .nav-card .nav-btn { padding: 9px 12px; font-size: 14px; border-radius: 10px; }

    .layout {
        display: grid; grid-template-columns: 210px minmax(0, 1fr);
        gap: 28px; max-width: 1440px; margin: 0 auto;
        padding: 24px 32px 60px; align-items: start;
    }
    .layout > .container, .layout > .rail { order: 0; }
    .container {
        max-width: none; padding: 0;
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-flow: row dense; gap: 0 24px; align-items: start;
    }
    /* 无侧栏的工具页：单列居中，避免被 210px 侧栏列挤窄 */
    .layout.no-rail { grid-template-columns: minmax(0, 1fr); }
    .layout.no-rail .container { grid-template-columns: minmax(0, 1fr); max-width: 920px; margin: 0 auto; }
    .rail { max-width: none; padding: 0; position: sticky; top: 78px; }
    .rail-group { padding: 14px 12px; margin-bottom: 18px; border-radius: 14px; }
    .rail-h { font-size: 14px; padding: 0 10px; }
    .rail-list { grid-template-columns: 1fr; gap: 1px; }
    .rail-list a { background: transparent; padding: 9px 10px; border-radius: 8px; font-size: 14px; }
    .rail-list a:hover { background: #F1F8E9; }
    .card { padding: 24px; margin-bottom: 24px; border-radius: 18px; }
    .txt-list { columns: 2; column-gap: 34px; padding-left: 20px; }
    .txt-list li { break-inside: avoid; font-size: 14px; }
    .lib-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
    .lib-cell img { border-radius: 14px; }
    .lib-cell p { font-size: 13px; min-height: 20px; }
    .lib-h1 { font-size: 26px; }
}

@media (min-width: 1000px) and (max-width: 1279px) {
    .lib-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .layout { max-width: 1180px; }
}

/* 宽屏：完整品牌位，与 nav.css 的 .sn 同一套尺寸 */
@media (min-width: 1350px) {
    .brand { flex-basis: 350px; gap: 14px; }
    .slogan { font-size: 13px; display: block; }
    .nav-card a, .nav-card .nav-btn { padding: 9px 14px; font-size: 15px; }
}

/* 超宽屏才加菜单图标 */
@media (min-width: 1500px) {
    .nav-card a, .nav-card .nav-btn { padding: 9px 16px; }
    .nav-card .ico { display: inline; }
}
