/* ==================================================================
 * tpl-d.css — 模板 D · 侧栏博客式
 * 骨架前缀：tD-
 * 风格：带搜索框导航 / 左主右栏 / 侧栏小组件
 * 依赖：style.css、theme_css（CSS 变量）
 * ================================================================== */

* { box-sizing: border-box; }
body {
    margin: 0;
    color: #1f2937;
    background: var(--site-bg);
    font-family: var(--font);
    line-height: 1.75;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.tD-wrap { max-width: var(--container); margin: 0 auto; padding: 0 22px; }

/* ---------------- 顶部条 ---------------- */
.tD-top { background: var(--primary); color: #fff; font-size: 13px; text-align: center; padding: 7px 16px; }

/* ---------------- 导航（含搜索框） ---------------- */
.tD-head { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.07); position: sticky; top: 0; z-index: 50; }
.tD-head-in { display: flex; align-items: center; gap: 22px; height: 74px; }
.tD-logo { font-size: 21px; font-weight: 800; color: var(--primary); letter-spacing: .5px; white-space: nowrap; }
.tD-nav { display: flex; gap: 18px; font-size: 14.5px; flex: 1; flex-wrap: wrap; }
.tD-nav a { color: #4b5563; padding: 5px 12px; border-radius: var(--radius); transition: .2s; }
.tD-nav a:hover { background: rgba(0,0,0,.05); }
.tD-nav a.on { background: var(--primary); color: #fff; }
.tD-search { display: flex; align-items: center; border: 1px solid #e5e7eb; border-radius: var(--radius); overflow: hidden; }
.tD-search input { border: 0; outline: 0; padding: 9px 12px; font-size: 14px; width: 150px; font-family: inherit; }
.tD-search button { border: 0; background: var(--primary); color: #fff; padding: 9px 16px; font-size: 14px; cursor: pointer; font-family: inherit; }
.tD-search button:hover { filter: brightness(1.1); }

/* ---------------- Banner ---------------- */
.tD-banner { background: var(--site-bg); padding: 46px 0 38px; border-bottom: 1px solid rgba(0,0,0,.06); }
.tD-banner-in { text-align: center; }
.tD-banner h1 { font-size: 36px; color: var(--dark); letter-spacing: .5px; }
.tD-banner p { font-size: 16px; color: #6b7280; margin-top: 14px; }
.tD-banner-badge { font-size: 13px !important; color: var(--secondary) !important; letter-spacing: 2px; }
.tD-cta { display: inline-block; margin-top: 22px; background: var(--primary); color: #fff; padding: 11px 34px; border-radius: var(--radius); font-size: 15px; transition: .2s; }
.tD-cta:hover { filter: brightness(1.1); }

/* ---------------- 两栏布局 ---------------- */
.tD-main { padding: 40px 0 56px; }
.tD-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 34px; align-items: start; }
.tD-content { min-width: 0; }
.tD-catbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.tD-catbar a { font-size: 13.5px; color: #4b5563; background: #fff; border: 1px solid #e5e7eb; padding: 6px 16px; border-radius: 999px; }
.tD-catbar a:hover { border-color: var(--primary); color: var(--primary); }
.tD-sechead { margin-bottom: 18px; }
.tD-sechead h2 { font-size: 22px; color: var(--dark); }
.tD-sechead p { font-size: 14px; color: #9ca3af; margin-top: 6px; }
.tD-list { display: flex; flex-direction: column; gap: 16px; }
.tD-card { display: flex; gap: 18px; background: #fff; border-radius: var(--radius); padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06); transition: .22s; }
.tD-card:hover { box-shadow: 0 12px 28px -16px rgba(0,0,0,.35); transform: translateY(-2px); }
.tD-card > img { flex: 0 0 100px; width: 100px; height: 140px; object-fit: cover; border-radius: var(--radius); }
.tD-card-b { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.tD-card-b h3 { font-size: 19px; color: var(--dark); margin-bottom: 6px; }
.tD-card-m { font-size: 13px; color: #9ca3af; margin-bottom: 8px; }
.tD-card-d { font-size: 14.5px; color: #4b5563; }
.tD-card-f { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.tD-rate { font-size: 13px; font-weight: 700; color: #fff; background: var(--secondary); padding: 2px 11px; border-radius: 999px; }
.tD-tagline { display: flex; flex-wrap: wrap; gap: 8px; }
.tD-tagline span { font-size: 12px; color: #6b7280; background: #f3f4f6; padding: 2px 10px; border-radius: 999px; }
.tD-more { margin-top: 26px; }
.tD-more a { display: inline-block; padding: 10px 30px; border: 1px solid var(--primary); color: var(--primary); border-radius: var(--radius); font-size: 14.5px; }
.tD-more a:hover { background: var(--primary); color: #fff; }

/* ---------------- 指南 ---------------- */
.tD-guide { background: #fff; border-radius: var(--radius); padding: 28px 30px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-top: 30px; }
.tD-guide h2 { font-size: 20px; color: var(--dark); margin-bottom: 14px; }
.tD-guide p { font-size: 15px; color: #4b5563; margin-bottom: 12px; }
.tD-guide ul { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.tD-guide li { position: relative; padding-left: 20px; font-size: 14.5px; color: #4b5563; }
.tD-guide li::before { content: "›"; position: absolute; left: 4px; color: var(--primary); font-weight: 700; }
.tD-tail { color: #9ca3af !important; }

/* ---------------- 侧栏 ---------------- */
.tD-side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 92px; }
.tD-widget { background: #fff; border-radius: var(--radius); padding: 20px 22px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.tD-widget h3 { font-size: 16px; color: var(--dark); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--primary); }
.tD-widget ul { display: flex; flex-direction: column; gap: 10px; }
.tD-widget li a { display: block; font-size: 14.5px; color: #4b5563; }
.tD-widget li a:hover, .tD-widget li a.on { color: var(--primary); }
.tD-widget li em { display: block; font-style: normal; font-size: 12.5px; color: #9ca3af; margin-top: 2px; }
.tD-widget ol { counter-reset: dhot; display: flex; flex-direction: column; gap: 10px; }
.tD-widget ol li { counter-increment: dhot; position: relative; padding-left: 26px; }
.tD-widget ol li::before {
    content: counter(dhot);
    position: absolute; left: 0; top: 1px;
    width: 18px; height: 18px; line-height: 18px; text-align: center;
    font-size: 11px; color: #fff; background: var(--primary); border-radius: 4px;
}
.tD-widget ol li a { display: flex; justify-content: space-between; gap: 8px; font-size: 14.5px; color: #4b5563; }
.tD-widget ol li a:hover { color: var(--primary); }
.tD-widget ol li b { color: var(--secondary); font-size: 13px; }
.tD-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tD-cloud span { font-size: 12.5px; color: #4b5563; background: #f3f4f6; padding: 4px 12px; border-radius: 4px; }
.tD-cloud span:hover { background: var(--primary); color: #fff; }

/* ---------------- 分类页头 ---------------- */
.tD-chead { background: #fff; padding: 34px 0 26px; border-bottom: 1px solid #e5e7eb; }
.tD-chead h1 { font-size: 30px; color: var(--dark); }
.tD-chead p { font-size: 15px; color: #6b7280; margin-top: 10px; }
.tD-crumb { font-size: 13px; color: #9ca3af; margin-bottom: 12px; }
.tD-crumb a:hover { color: var(--primary); }
.tD-note { font-size: 14.5px; color: #4b5563; background: #fff; border-radius: var(--radius); padding: 18px 22px; margin-bottom: 22px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }

/* ---------------- 详情页 ---------------- */
.tD-post { padding: 36px 0 60px; }
.tD-leftnav { position: sticky; top: 92px; }
.tD-leftnav h3 { font-size: 15px; color: var(--dark); margin: 0 0 10px; padding-bottom: 8px; border-bottom: 2px solid var(--primary); }
.tD-leftnav h3 + ul { margin-bottom: 22px; }
.tD-leftnav ul { display: flex; flex-direction: column; gap: 8px; }
.tD-leftnav li a { font-size: 14px; color: #4b5563; }
.tD-leftnav li a:hover { color: var(--primary); }
.tD-postbody { background: #fff; border-radius: var(--radius); padding: 30px 34px; box-shadow: 0 1px 3px rgba(0,0,0,.06); min-width: 0; }
.tD-posthead { display: flex; gap: 22px; align-items: flex-start; margin-bottom: 20px; }
.tD-posthead img { flex: 0 0 130px; width: 130px; border-radius: var(--radius); }
.tD-posthead h1 { font-size: 28px; color: var(--dark); }
.tD-pm { font-size: 14px; color: #9ca3af; margin-top: 10px; }
.tD-pr { font-size: 18px; font-weight: 800; color: var(--secondary); margin-top: 10px; }
.tD-lead { font-size: 16px; color: #374151; font-weight: 500; padding: 14px 0; border-top: 1px solid #f3f4f6; border-bottom: 1px solid #f3f4f6; margin-bottom: 8px; }
.tD-postbody h2 { font-size: 20px; color: var(--dark); margin: 30px 0 12px; }
.tD-postbody > p, .tD-postbody > div > p { font-size: 15.5px; color: #4b5563; }
.tD-plats { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 12px; }
.tD-plats span { font-size: 13.5px; color: var(--primary); border: 1px solid #e5e7eb; padding: 5px 15px; border-radius: var(--radius); }
.tD-warn { font-size: 13px !important; color: #b91c1c !important; }
.tD-revs { display: flex; flex-direction: column; gap: 10px; }
.tD-revs p { border-left: 3px solid #e5e7eb; padding-left: 14px; }
.tD-faq { margin-bottom: 14px; }
.tD-faq h4 { font-size: 15px; color: var(--dark); margin-bottom: 5px; }
.tD-relgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tD-relcard { display: block; text-align: center; }
.tD-relcard img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--radius); margin-bottom: 8px; }
.tD-relcard h4 { font-size: 14px; color: var(--dark); }
.tD-relcard p { font-size: 12.5px; color: var(--secondary); }

/* ---------------- 页脚 ---------------- */
.tD-foot { background: var(--dark); color: #d1d5db; padding: 44px 0 26px; margin-top: 20px; }
.tD-foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 30px; }
.tD-foot-col h3 { color: #fff; font-size: 19px; margin-bottom: 12px; }
.tD-foot-col h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.tD-foot-col p, .tD-foot-col li { font-size: 13.5px; color: #9ca3af; line-height: 1.9; }
.tD-foot-col ul { display: flex; flex-direction: column; gap: 7px; }
.tD-foot-col a:hover { color: #fff; }
.tD-foot-tip { margin-top: 10px; font-size: 12.5px; color: #6b7280; }
.tD-foot-copy { text-align: center; font-size: 12.5px; color: #6b7280; margin-top: 28px; padding-top: 20px; border-top: 1px solid #374151; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1024px) {
    .tD-layout { grid-template-columns: 1fr; }
    .tD-side, .tD-leftnav { position: static; }
    .tD-relgrid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 780px) {
    .tD-head-in { height: auto; padding: 12px 0; flex-wrap: wrap; gap: 10px; }
    .tD-nav { order: 3; width: 100%; gap: 8px; }
    .tD-search { margin-left: auto; }
    .tD-search input { width: 110px; }
    .tD-banner h1 { font-size: 26px; }
    .tD-foot-grid { grid-template-columns: 1fr 1fr; gap: 22px; }
    .tD-posthead { flex-direction: column; }
    .tD-postbody { padding: 22px; }
    .tD-posthead h1 { font-size: 23px; }
}
@media (max-width: 560px) {
    .tD-card > img { flex: 0 0 84px; width: 84px; height: 118px; }
    .tD-card-b h3 { font-size: 17px; }
    .tD-foot-grid { grid-template-columns: 1fr; }
}
