/* ============================================================
   GYAN SKIN for TBlog — 仿 gyan.dev/ffmpeg/builds 视觉
   zhangpu.blog 专用（按 Host 切换主题，见 include/router.php）
   设计令牌全部取自 https://www.gyan.dev/ffmpeg/codexffmpeg-gyan-dev.css
   ============================================================ */

:root {
    /* 背景 / 面板 */
    --gy-bg-a:        rgb(121, 158, 136);
    --gy-bg-b:        rgb(171, 171, 138);
    --gy-panel:       rgb(212, 215, 201);   /* #d4d7c9 文章底 */
    --gy-panel-2:     rgb(204, 216, 207);   /* #ccd8cf 页脚 */
    --gy-masthead:    rgb(233, 227, 210);   /* #e9e3d2 顶栏 */
    --gy-sections:    rgb(185, 215, 204);   /* #b9d7cc 导航条 */
    --gy-sidebar:     rgba(212, 215, 201, .78);
    --gy-emboss:      rgb(222, 216, 199);   /* #ded8c7 浮雕字 */
    --gy-title-blue:  rgb(43, 88, 111);     /* #2b586f */
    --gy-title-grey:  rgb(107, 108, 110);   /* #6b6c6e 标题字 */
    --gy-text:        rgb(51, 51, 51);
    --gy-text-soft:   rgb(116, 120, 106);
    --gy-link:        rgb(16, 109, 151);    /* #106d97 */
    --gy-link-2:      rgb(129, 64, 79);
    --gy-keyword:     rgb(135, 90, 180);
    --gy-rule:        rgba(112, 112, 112, .30);
    --gy-rule-solid:  rgb(157, 177, 159);
    --gy-green:       rgb(121, 156, 145);
    --gy-shadow:      4px 4px 6px rgba(97, 96, 92, .5), -4px 0px 3px rgba(97, 96, 92, .5);
    --gy-shadow-soft: 2px 3px 4px rgba(132, 115, 105, .66);
    --gy-code-bg:     rgb(42, 79, 102);
    --gy-inline-bg:   rgb(185, 211, 193);

    --gy-sans:    "Lato", "Helvetica", "Arial", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --gy-display: "Oswald", "Alfa Slab One", "Bookman Old Style", "PingFang SC", "Microsoft YaHei", serif;
    --gy-serif:   "Alfa Slab One", "Lato", "Songti SC", "Noto Serif SC", serif;
    --gy-cond:    "Roboto Condensed", "Bookman Old Style", "PingFang SC", "Microsoft YaHei", sans-serif;
    --gy-mono:    "Inconsolata", "SFMono-Regular", Menlo, Consolas, "Courier New", monospace;
    --gy-noise:   url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='160' height='32'%3E%3Cfilter id='vnoise' x='0' y='0'%3E%3CfeTurbulence type='turbulence' baseFrequency='1.0 0.01' numOctaves='2' seed='16807' stitchTiles='stitch' result='noise'/%3E%3CfeBlend mode='color-dodge' in='SourceGraphic' in2='noise'/%3E%3C/filter%3E%3Crect width='160' height='32' filter='url(%23vnoise)' fill='%23ccc5' opacity='0.35'/%3E%3C/svg%3E");
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
    font-family: var(--gy-sans);
    font-size: max(0.825vw, 15px);
    scroll-behavior: smooth;
    /* 背景挂在 html 上：body 高度不足一屏时底部不会露白 */
    background-color: rgb(171, 171, 138);
    background-image: var(--gy-noise),
        linear-gradient(90deg, rgb(121,158,136) 5%, rgb(171,171,138) 28% 72%, rgb(121,158,136) 95%);
    /* 注意：根元素用 background-attachment:fixed 会导致背景不向 canvas 传播，
       页面底部会露白；这里保持默认 scroll（渐变是水平方向，滚动无影响）。 */
    background-attachment: scroll, scroll;
}
img { max-width: 100%; height: auto; }
ul, ol { margin: 0; padding: 0; list-style: none; }

body {
    color: var(--gy-text);
    font-family: var(--gy-sans);
    font-size: 1rem;
    line-height: 1.75;
    background: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--gy-link); text-decoration: none; transition: color .18s, background-color .18s; }
a:hover { color: rgb(40, 93, 160); text-decoration: underline; }
strong { color: rgb(129, 64, 79); font-weight: 700; }
em { font-style: oblique 5deg; color: rgb(101, 31, 122); }

/* ---------- 容器 / 栅格 ---------- */
.rt-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
}
.rt-row { display: flex; flex-wrap: wrap; margin: 0 -10px; }
.rt-col-1,.rt-col-2,.rt-col-3,.rt-col-4,.rt-col-5,.rt-col-6,
.rt-col-7,.rt-col-8,.rt-col-9,.rt-col-10,.rt-col-11,.rt-col-12 {
    position: relative; padding: 0 10px; width: 100%;
}
.rt-col-8 { flex: 0 0 66.6667%; max-width: 66.6667%; }
.rt-col-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
.rt-hidden-tb { display: block; }

/* ---------- 顶部 banner（仿 gyan #banner / #masthead） ---------- */
#rt-header {
    position: sticky;
    top: 0;
    z-index: 99;
    background: var(--gy-masthead);
    box-shadow: 2px 2px 3px rgba(38, 103, 97, .67);
    border-bottom: 0;
    overflow: hidden;
}
/* 左右浮雕字 */
#rt-header::before,
#rt-header::after {
    content: "zhangpu.blog";
    position: absolute;
    top: 12px;
    font-family: Impact, "Alfa Slab One", serif;
    font-size: 3rem;
    line-height: 1;
    color: var(--gy-emboss);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}
#rt-header::before { left: 12px; }
#rt-header::after  { right: 12px; }

#rt-header .rt-container { position: relative; z-index: 1; }
.rt-site-name { padding: 14px 0 10px; text-align: center; }
#rt-logo {
    display: inline-block;
    font-family: var(--gy-serif);
    font-weight: 400;
    font-size: 2.5rem;
    line-height: 1.1;
    letter-spacing: .04rem;
    color: var(--gy-title-blue);
    border-bottom: 0;
    text-shadow: 1px 1px 0 rgba(255,255,255,.55);
}
#rt-logo:hover { color: rgb(40, 93, 160); text-decoration: none; }
.rt-description {
    margin: 4px 0 0;
    font-family: "Roboto", var(--gy-sans);
    font-size: .9rem;
    font-style: normal;
    letter-spacing: .1rem;
    color: rgba(129, 64, 79, .69);
}
.rt-site-search { padding-top: 18px; text-align: right; }
#rt-search input.rt-text {
    width: 62%;
    padding: 5px 10px;
    border: 1px solid #7f857a;
    border-radius: 0;
    outline-offset: 2px;
    background: rgba(255, 255, 255, .55);
    font-family: var(--gy-sans);
    font-size: .85rem;
    color: var(--gy-text);
}
#rt-search button.rt-submit {
    padding: 5px 14px;
    background: rgba(11, 104, 160, .44);
    color: #e4ebef;
    border: 0;
    border-radius: 0;
    cursor: pointer;
    font-family: var(--gy-cond);
    font-size: .85rem;
    letter-spacing: .08rem;
}
#rt-search button.rt-submit:hover { background: rgb(11, 104, 160, .72); color: #fff; }

/* 导航条 = gyan #site-sections-bar */
#rt-nav-menu {
    background: var(--gy-sections);
    border-top: 0;
    border-bottom: 0;
    border-radius: 0;
    padding: 6px 10px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    max-width: 960px;
    margin: 0 auto;
}
#rt-nav-menu a {
    color: rgb(51, 51, 51);
    font-family: var(--gy-sans);
    font-weight: 400;
    font-size: .9rem;
    text-transform: none;
    letter-spacing: .05rem;
    padding: 2px 6px;
    margin: 0 4px;
    border: 0;
}
#rt-nav-menu a.current,
#rt-nav-menu a:hover {
    color: var(--gy-title-blue);
    background: transparent;
    border: 0;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ---------- 主区布局（gyan #content-container：侧栏 14% / 正文 84%） ---------- */
.rt-main { padding: 54px 0 40px; }
.rt-main > .rt-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 28px;
    align-items: flex-start;
}
/* 侧栏置左（gyan 原站侧栏在左），正文自适应 —— 需覆盖 .rt-col-4/.rt-col-8 的百分比宽度 */
.rt-main > .rt-row > #rt-secondary {
    order: 1;
    flex: 0 0 240px;
    width: 240px;
    max-width: 240px;
    position: sticky;
    top: 130px;
}
.rt-main > .rt-row > #rt-primary {
    order: 2;
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    min-width: 0;
}

/* ---------- 侧栏导航面板（gyan #current-page-navigation） ---------- */
.rt-widget {
    background: linear-gradient(145deg, rgba(206,233,254,.40) 0%, rgba(184,192,189,.30) 25%,
                                rgba(174,183,169,.09) 75%, rgba(205,220,226,.40) 100%),
                var(--gy-sidebar);
    box-shadow: 4px 2px 6px rgba(198, 228, 233, .5), -1px 0px 5px rgba(198, 228, 233, .4);
    border: 0;
    border-radius: 0;
    padding: 0 18px 16px;
    margin-bottom: 22px;
    overflow: hidden;
}
.rt-widget-title {
    font-family: var(--gy-display);
    font-weight: 300;
    font-size: 1.15rem;
    letter-spacing: .15rem;
    text-align: center;
    color: rgb(204, 215, 222);
    background: rgba(11, 104, 160, .44);
    box-shadow: 0 4px 10px rgba(64, 64, 64, .5);
    margin: 0 -18px 18px;
    padding: 10px 6px;
}
.rt-widget-list { padding: 0; margin: 0; }
.rt-widget-list li {
    padding: 7px 2px;
    border-bottom: 1px solid rgba(157, 177, 159, .35);
    text-align: center;
    font-family: var(--gy-cond);
    font-weight: 300;
    font-size: 1rem;
    letter-spacing: .08rem;
}
.rt-widget-list li:last-child { border-bottom: 0; }
.rt-widget-list a {
    color: rgba(76, 88, 90, .93);
    border-bottom: 0;
}
.rt-widget-list a:hover { color: var(--gy-link); text-decoration: none; }

/* ---------- 文章卡片（gyan #article-body） ---------- */
.rt-post {
    position: relative;
    background: var(--gy-panel);
    box-shadow: var(--gy-shadow);
    border: 0;
    border-radius: 0;
    padding: 26px 30px 28px;
    margin: 0 0 34px;
}
.rt-post::before { display: none; }
.rt-post:hover { background: rgb(216, 219, 205); }

.rt-post-title {
    font-family: var(--gy-display);
    font-weight: 300;
    font-size: 1.6rem;
    line-height: 1.35;
    letter-spacing: .06rem;
    color: var(--gy-title-grey);
    margin: 0 0 12px;
}
.rt-post-title a { color: var(--gy-title-grey); border-bottom: 0; }
.rt-post-title a:hover { color: var(--gy-link); text-decoration: none; }
.rt-post-title.rt-solo { font-size: 2rem; color: var(--gy-title-blue); }

.rt-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
    font-family: var(--gy-sans);
    font-size: .8rem;
    color: var(--gy-text-soft);
    margin: 0 0 16px;
    padding: 0 0 10px;
    border-bottom: 1px dotted var(--gy-rule);
}
.rt-post-meta a { color: var(--gy-text-soft); border-bottom: 1px dotted rgba(112,112,112,.35); }
.rt-post-meta a:hover { color: var(--gy-link); border-bottom-color: var(--gy-link); }

.rt-post-content {
    font-family: var(--gy-sans);
    font-size: 1rem;
    line-height: 1.8;
    color: var(--gy-text);
    margin-bottom: 18px;
}
.rt-post-content p { margin: 0 0 14px; }
.rt-post-content h1,
.rt-post-content h2,
.rt-post-content h3 {
    font-family: var(--gy-display);
    font-weight: 400;
    color: rgb(124, 123, 112);
    letter-spacing: .05rem;
    margin: 30px 0 16px;
    padding: 6px 20px;
    display: block;
    width: max-content;
    max-width: 100%;
    background: linear-gradient(90deg, rgb(189,190,172) 18px, rgb(196,197,182) 18px calc(100% - 18px), rgb(189,190,172) calc(100% - 18px));
    box-shadow: var(--gy-shadow-soft);
}
.rt-post-content h1 { font-size: 1.35rem; }
.rt-post-content h2 { font-size: 1.25rem; }
.rt-post-content h3 { font-size: 1.1rem; }
.rt-post-content ul, .rt-post-content ol { padding-left: 26px; margin: 0 0 16px; list-style: disc; }
.rt-post-content ol { list-style: decimal; }
.rt-post-content li { margin: 0 0 6px; }
.rt-post-content blockquote {
    margin: 0 0 18px;
    padding: 12px 16px;
    background: rgba(187, 209, 181, .55);
    border-left: 8px solid rgba(118, 137, 109, .54);
    border-right: 8px solid rgba(154, 170, 145, .78);
    box-shadow: 0 2px 5px rgba(139, 136, 122, .58);
    color: rgb(65, 87, 87);
}
.rt-post-content code {
    background: var(--gy-inline-bg);
    color: rgb(34, 52, 36);
    padding: 1px 5px;
    border: 0;
    border-radius: 0;
    font-family: var(--gy-mono);
    font-size: .92em;
}
.rt-post-content pre {
    margin: 0 0 18px;
    padding: 16px 18px;
    background: var(--gy-code-bg);
    color: rgb(214, 217, 211);
    border: 3px solid #a7a7a7;
    border-radius: 0;
    overflow-x: auto;
    font-family: var(--gy-mono);
    font-size: .9rem;
    line-height: 1.6;
    white-space: pre;
}
.rt-post-content pre code { background: none; padding: 0; color: inherit; }
.rt-post-content table {
    display: block; width: 100%; max-width: 100%; overflow-x: auto;
    border-collapse: collapse; margin: 0 0 18px; font-size: .92em;
    background: rgb(208, 208, 187);
}
.rt-post-content th, .rt-post-content td {
    border: 1px solid var(--gy-green); padding: 8px 10px; text-align: left; vertical-align: top;
}
.rt-post-content th { background: rgb(189, 190, 172); font-weight: 600; }
.rt-post-content hr {
    border: 0;
    border-top: 3px dotted var(--gy-rule);
    width: 40%;
    margin: 36px auto 20px;
}
.rt-post-content img {
    display: block;
    margin: 18px auto;
    padding: 10px;
    background: rgba(204, 205, 188);
    box-shadow: 2px 2px 4px rgba(97, 96, 92, .35);
}
.rt-post-content iframe, .rt-post-content video { max-width: 100%; }
.rt-post-content a { color: var(--gy-link); }
.rt-post-content a:hover { color: rgb(40, 93, 160); }

/* 阅读更多（gyan .link-block） */
.rt-read-more { margin: 0; }
.rt-more-link {
    display: inline-block;
    padding: 6px 14px;
    background: rgb(200, 211, 185);
    border: 1px solid #7f857a;
    color: rgb(52, 70, 50);
    font-family: var(--gy-sans);
    font-weight: 400;
    text-transform: none;
    letter-spacing: .03rem;
    font-size: .9rem;
}
.rt-more-link:hover { background: var(--gy-sections); color: rgb(40, 70, 50); text-decoration: none; }

.rt-empty { text-align: center; padding: 40px 0; color: var(--gy-text-soft); font-style: italic; }

/* ---------- 单篇 / 归档标题（gyan .section-title-box） ---------- */
.rt-archive-title,
.rt-post-title.rt-solo {
    font-family: var(--gy-display);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: .05rem;
    color: rgb(124, 123, 112);
    padding: 6px 40px 6px 20px;
    margin: 0 0 26px;
    display: block;
    width: max-content;
    max-width: 100%;
    background: linear-gradient(90deg, rgb(189,190,172) 18px, rgb(196,197,182) 18px calc(100% - 18px), rgb(189,190,172) calc(100% - 18px));
    box-shadow: var(--gy-shadow-soft);
    border: 0;
}
.rt-single-post { background: var(--gy-panel); box-shadow: var(--gy-shadow); padding: 30px 34px; border: 0; border-radius: 0; }
.rt-single-post::before { display: none; }
.rt-single-title { font-family: var(--gy-display); font-weight: 300; font-size: 2rem; letter-spacing: .06rem; color: var(--gy-title-blue); margin: 0 0 14px; }
.rt-single-content { font-family: var(--gy-sans); font-size: 1rem; line-height: 1.85; color: var(--gy-text); }
.rt-post-near {
    display: flex; justify-content: space-between; gap: 16px;
    margin-top: 20px; padding-top: 14px;
    border-top: 1px dotted var(--gy-rule);
    font-family: var(--gy-cond); font-size: .95rem; letter-spacing: .06rem;
}
.rt-prev, .rt-next { color: var(--gy-link); }
.rt-tags { margin-top: 16px; font-family: var(--gy-cond); font-size: .9rem; }
.rt-tags-label { color: var(--gy-text-soft); margin-right: 8px; }
.rt-tag {
    display: inline-block; margin: 0 4px 4px 0; padding: 2px 8px;
    background: rgba(157, 177, 159, .35); color: rgb(52, 70, 50); border: 1px solid #7f857a;
}
.rt-tag:hover { background: var(--gy-sections); color: var(--gy-title-blue); text-decoration: none; }

/* 归档列表 */
.rt-archive-section { margin-bottom: 26px; }
.rt-archive-month {
    font-family: var(--gy-display); font-weight: 400; font-size: 1.1rem;
    letter-spacing: .08rem; color: var(--gy-text-soft); margin-bottom: 8px;
}
.rt-archive-list { border-top: 2px solid rgba(178, 189, 184, .8); }
.rt-archive-date { color: var(--gy-text-soft); font-size: .85rem; }
.rt-archive-link { color: var(--gy-link); }

/* ---------- 分页 ---------- */
.rt-page-navigator {
    margin: 26px 0;
    padding: 14px 0;
    text-align: center;
    border-top: 3px dotted var(--gy-rule);
    border-bottom: 3px dotted var(--gy-rule);
    font-family: var(--gy-sans);
}
.rt-page-navigator a, .rt-page-navigator .rt-current {
    display: inline-block;
    margin: 0 4px;
    padding: 4px 12px;
    border: 1px solid #7f857a;
    color: rgb(52, 70, 50);
    background: rgb(200, 211, 185);
    font-weight: 400;
    letter-spacing: .05rem;
}
.rt-page-navigator a:hover { background: var(--gy-sections); color: var(--gy-title-blue); text-decoration: none; }
.rt-page-navigator .rt-current { background: var(--gy-title-blue); color: #fff; border-color: var(--gy-title-blue); }

/* ---------- 评论区 ---------- */
#rt-comments {
    margin-top: 30px;
    padding: 24px 26px;
    background: var(--gy-panel);
    box-shadow: var(--gy-shadow);
}
.rt-comment-title {
    font-family: var(--gy-display); font-weight: 300; font-size: 1.2rem;
    letter-spacing: .1rem; color: var(--gy-title-grey); margin: 0 0 18px;
}
.rt-comment-list { margin-bottom: 24px; }
.rt-comment-item {
    padding: 12px 0;
    border-bottom: 1px dotted var(--gy-rule);
    font-size: .95rem;
}
.rt-comment-item.odd { background: rgba(255, 255, 255, .16); }
.rt-comment-cite { font-family: var(--gy-cond); letter-spacing: .06rem; color: var(--gy-text-soft); font-size: .85rem; }
.rt-comment-author { color: var(--gy-link-2); font-weight: 700; }
.rt-comment-meta { float: right; font-size: .8rem; color: var(--gy-text-soft); }
.rt-comment-body { margin-top: 6px; color: var(--gy-text); }
.rt-comment-form input, .rt-comment-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #7f857a;
    border-radius: 0;
    background: rgba(255, 255, 255, .55);
    font-family: var(--gy-sans);
    font-size: .95rem;
    margin-bottom: 10px;
    outline: none;
}
.rt-comment-form .rt-btn-submit {
    padding: 8px 24px;
    background: rgba(11, 104, 160, .44);
    color: #e4ebef;
    border: 0;
    cursor: pointer;
    font-family: var(--gy-cond);
    font-size: .95rem;
    letter-spacing: .08rem;
}
.rt-comment-form .rt-btn-submit:hover { background: rgb(11, 104, 160, .72); color: #fff; }
.rt-no-comments, .rt-comment-error, .rt-comment-success { color: var(--gy-text-soft); font-size: .95rem; }

/* ---------- 页脚（gyan #article-footer） ---------- */
#rt-footer {
    background: var(--gy-panel-2);
    box-shadow: 4px 4px 6px rgba(97, 96, 92, .5), -4px 0px 3px rgba(97, 96, 92, .5);
    border-top: 0;
    text-align: center;
    padding: 28px 16px 34px;
    font-family: var(--gy-sans);
    font-size: .95rem;
    color: var(--gy-text);
}
#rt-footer p { margin: 4px 0; }
#rt-footer a {
    color: rgb(88, 79, 85);
    border: 2px solid #b6c0b8;
    padding: 1px 4px;
    background: #d7d8c6;
}
#rt-footer a:hover { background: var(--gy-title-blue); color: #fff; border-color: var(--gy-title-blue); text-decoration: none; }
.rt-footer-meta { font-size: .85rem; color: var(--gy-text-soft); }

/* ---------- 长 URL / 长单词不撑破页面（沿用 retro-4c 的 2026-10-30 修复） ---------- */
.rt-post-content,
.rt-post-content p,
.rt-post-content li,
.rt-post-content td,
.rt-post-content th,
.rt-post-content a,
.rt-post-content blockquote,
.rt-post-content h1,
.rt-post-content h2,
.rt-post-content h3,
.rt-post-content h4 {
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}
.rt-post-content pre { overflow-x: auto; max-width: 100%; }
.rt-post-content pre code,
.rt-post-content code { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.rt-post-content img,
.rt-post-content video,
.rt-post-content iframe,
.rt-post-content table { max-width: 100%; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
    html { font-size: 15px; }
    .rt-row { margin-left: 0; margin-right: 0; }
    .rt-main > .rt-row { flex-wrap: wrap; gap: 20px; }
    .rt-main > .rt-row > #rt-secondary {
        order: 2; flex: 1 1 100%; width: 100%; max-width: 100%; position: static;
    }
    .rt-main > .rt-row > #rt-primary { order: 1; flex: 1 1 100%; width: 100%; max-width: 100%; }
    #rt-header::before, #rt-header::after { display: none; }
    .rt-site-search { padding-top: 6px; text-align: center; }
    #rt-search input.rt-text { width: 70%; }
    #rt-logo { font-size: 2rem; }
}
@media (max-width: 600px) {
    #rt-nav-menu a { font-size: .82rem; padding: 2px 4px; }
    .rt-post, .rt-single-post { padding: 18px 16px; }
    .rt-post-title { font-size: 1.3rem; }
    .rt-post-title.rt-solo { font-size: 1.5rem; }
    .rt-single-title { font-size: 1.5rem; }
    .rt-archive-title { padding: 6px 16px; font-size: 1.05rem; }
    #rt-comments { padding: 18px 14px; }
}
