/*
 Theme Name: 徽阁仿古门窗
 Theme URI: https://example.com/
 Description: 长沙徽阁仿古门窗厂 —— 复古铝合金门窗企业官网主题，深咖色徽式古韵风格。
 Version: 1.0.0
 Requires at least: 6.0
 Tested up to: 7.0
 Requires PHP: 7.4
 Author: WP建站匠
 Author URI: https://example.com/
 Text Domain: huige
 Tags: custom-colors, custom-menu, editor-style, featured-images, translation-ready, responsive-layout
*/

/* =========================================================
   1. 设计变量（深咖色 · 徽式古韵）
   ========================================================= */
:root {
    --coffee-900: #22160f;   /* 最深，近黑咖 */
    --coffee-800: #2f2017;
    --coffee-700: #3e2a1d;   /* 主色深咖 */
    --coffee-600: #4f3724;
    --coffee-500: #6b4a30;   /* 中咖 */
    --coffee-400: #8a6443;
    --coffee-300: #b08d57;   /* 鎏金铜 */
    --bronze:     #c9a96a;   /* 古铜描金 */
    --bronze-soft:#e3cfa3;
    --paper:      #f7f1e7;   /* 宣纸底 */
    --paper-2:    #efe6d6;   /* 次级底 */
    --ink:        #2b1d16;   /* 正文墨色 */
    --ink-soft:   #5c4a3d;
    --line:       #d8c9b2;   /* 浅描边 */
    --white:      #fffdf9;

    --shadow-sm: 0 2px 8px rgba(34,22,15,.08);
    --shadow-md: 0 8px 24px rgba(34,22,15,.12);
    --shadow-lg: 0 18px 48px rgba(34,22,15,.18);

    --radius: 6px;
    --radius-lg: 12px;
    --container: 1200px;
    --header-h: 76px;

    --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", "Times New Roman", serif;
    --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
}

/* =========================================================
   2. 基础重置
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--sans);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.75;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 {
    font-family: var(--serif);
    color: var(--coffee-800);
    line-height: 1.35;
    font-weight: 700;
    margin: 0 0 .6em;
}
h1 { font-size: clamp(28px, 4vw, 44px); }
h2 { font-size: clamp(24px, 3vw, 34px); }
h3 { font-size: clamp(19px, 2vw, 24px); }
p { margin: 0 0 1.1em; }
a { color: var(--coffee-600); text-decoration: none; transition: color .2s; }
a:hover { color: var(--bronze); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0 0 1.1em; padding-left: 1.4em; }
blockquote {
    margin: 1.4em 0; padding: .8em 1.2em;
    border-left: 4px solid var(--bronze);
    background: var(--paper-2); color: var(--ink-soft);
    font-family: var(--serif); font-style: italic;
}
table { width: 100%; border-collapse: collapse; margin: 1em 0; }
th, td { border: 1px solid var(--line); padding: .6em .8em; text-align: left; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* 古韵分隔（印章式小标题） */
.section { padding: 72px 0; }
.section-head { text-align: center; margin-bottom: 44px; }
.section-head .kicker {
    display: inline-block; font-family: var(--serif);
    letter-spacing: .35em; color: var(--bronze);
    font-size: 13px; margin-bottom: 10px; padding-left: .35em;
}
.section-head h2 { margin: 0; }
.section-head .lead { color: var(--ink-soft); max-width: 640px; margin: 14px auto 0; }
.section-head::after {
    content: ""; display: block; width: 60px; height: 3px;
    margin: 18px auto 0; background: linear-gradient(90deg, transparent, var(--bronze), transparent);
}

/* =========================================================
   3. 马头墙装饰条（徽式建筑语言）
   ========================================================= */
.horse-wall { display: block; width: 100%; line-height: 0; color: var(--coffee-700); }
.horse-wall svg { display: block; width: 100%; height: 38px; }
.site-header .horse-wall { color: var(--coffee-800); }
.site-footer .horse-wall { color: var(--coffee-900); transform: scaleY(-1); }

/* =========================================================
   4. 顶部导航
   ========================================================= */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: linear-gradient(180deg, var(--coffee-800), var(--coffee-700));
    box-shadow: var(--shadow-md);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    min-height: var(--header-h); gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .custom-logo { max-height: 40px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name {
    font-family: var(--serif); font-weight: 700; color: var(--bronze-soft);
    font-size: 18px; letter-spacing: .02em;
}
.brand-sub { color: rgba(227,207,163,.7); font-size: 11px; letter-spacing: .18em; }

.main-nav { display: flex; align-items: center; }
.nav-menu { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.nav-menu > li { position: relative; }
.nav-menu > li > a {
    display: block; padding: 12px 10px; color: var(--bronze-soft);
    font-family: var(--serif); font-size: 16px; letter-spacing: 0;
    border-radius: var(--radius); transition: background .2s, color .2s;
}
.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a,
.nav-menu > li.current-menu-ancestor > a {
    background: rgba(201,169,106,.16); color: var(--white);
}
.nav-menu > li > a::after {
    content: ""; display: block; height: 2px; width: 0; margin: 4px auto 0;
    background: var(--bronze); transition: width .25s;
}
.nav-menu > li > a:hover::after,
.nav-menu > li.current-menu-item > a::after { width: 70%; }

.nav-toggle {
    display: none; background: transparent; border: 1px solid var(--bronze);
    border-radius: var(--radius); width: 44px; height: 40px; cursor: pointer;
    padding: 0; flex-direction: column; gap: 5px; align-items: center; justify-content: center;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--bronze-soft); border-radius: 2px; }

/* =========================================================
   5. 首页 Hero
   ========================================================= */
.hero {
    position: relative; overflow: hidden;
    background:
        radial-gradient(1200px 500px at 80% -10%, rgba(201,169,106,.18), transparent 60%),
        linear-gradient(160deg, var(--coffee-900) 0%, var(--coffee-700) 55%, var(--coffee-600) 100%);
    color: var(--paper);
    padding: 96px 0 120px;
}
.hero::before {
    /* 窗格纹底纹 */
    content: ""; position: absolute; inset: 0; opacity: .08; pointer-events: none;
    background-image:
        linear-gradient(var(--bronze) 1px, transparent 1px),
        linear-gradient(90deg, var(--bronze) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(circle at 70% 30%, #000, transparent 75%);
}
.hero-inner { position: relative; max-width: 760px; }
.hero .seal {
    display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px; border: 2px solid var(--bronze);
    border-radius: 8px; color: var(--bronze); font-family: var(--serif);
    font-weight: 700; font-size: 22px; margin-bottom: 22px;
    box-shadow: inset 0 0 0 4px rgba(201,169,106,.25);
}
.hero h1 { color: var(--white); margin-bottom: 18px; }
.hero h1 .accent { color: var(--bronze); }
.hero .subtitle { font-family: var(--serif); font-size: 19px; color: var(--bronze-soft); margin-bottom: 16px; }
.hero p.desc { color: rgba(247,241,231,.82); font-size: 16px; max-width: 620px; }
.hero-actions { margin-top: 30px; display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 13px 28px; border-radius: var(--radius);
    font-family: var(--serif); font-size: 16px; cursor: pointer;
    border: 1px solid transparent; transition: transform .15s, box-shadow .2s, background .2s;
}
.btn-primary { background: var(--bronze); color: var(--coffee-900); font-weight: 700; }
.btn-primary:hover { background: var(--bronze-soft); color: var(--coffee-900); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-ghost { background: transparent; border-color: var(--bronze); color: var(--bronze-soft); }
.btn-ghost:hover { background: rgba(201,169,106,.12); color: var(--white); }

/* Hero 数据条 */
.hero-stats { display: flex; gap: 40px; margin-top: 46px; flex-wrap: wrap; }
.hero-stats .stat .num { font-family: var(--serif); font-size: 34px; color: var(--bronze); font-weight: 700; }
.hero-stats .stat .label { color: rgba(247,241,231,.7); font-size: 13px; letter-spacing: .1em; }

/* =========================================================
   6. 卡片 / 网格
   ========================================================= */
.grid { display: grid; gap: 26px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius-lg); overflow: hidden;
    box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s;
    display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card-thumb { aspect-ratio: 4/3; overflow: hidden; background: var(--paper-2); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-thumb img { transform: scale(1.05); }
.card-body { padding: 20px 22px 24px; flex: 1; display: flex; flex-direction: column; }
.card-cat { color: var(--bronze); font-size: 12px; letter-spacing: .12em; margin-bottom: 8px; }
.card-title { font-size: 19px; margin: 0 0 10px; }
.card-title a { color: var(--coffee-800); }
.card-excerpt { color: var(--ink-soft); font-size: 14.5px; margin: 0 0 14px; }
.card-more { margin-top: auto; color: var(--coffee-600); font-family: var(--serif); font-size: 14px; }
.card-more::after { content: " →"; }

/* 知识/文章分类筛选 */
.tax-filter { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 26px; }
.tax-link {
    display: inline-block; padding: 7px 16px; border: 1px solid var(--coffee-300);
    border-radius: 999px; color: var(--coffee-700); font-size: 14px; font-family: var(--serif);
    transition: all .2s ease; text-decoration: none;
}
.tax-link:hover, .tax-link.is-active { background: var(--coffee-700); color: #fff; border-color: var(--coffee-700); }

/* 产品参数小标签 */
.spec-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.spec-tags span {
    font-size: 12px; color: var(--coffee-600); background: var(--paper-2);
    border: 1px solid var(--line); border-radius: 20px; padding: 4px 12px;
}

/* =========================================================
   7. 企业历程时间轴
   ========================================================= */
.timeline { position: relative; max-width: 880px; margin: 0 auto; padding: 10px 0; }
.timeline::before {
    content: ""; position: absolute; left: 50%; top: 0; bottom: 0;
    width: 2px; background: var(--line); transform: translateX(-50%);
}
.tl-item { position: relative; width: 50%; padding: 18px 40px; }
.tl-item:nth-child(odd) { left: 0; text-align: right; }
.tl-item:nth-child(even) { left: 50%; }
.tl-item .tl-dot {
    position: absolute; top: 28px; width: 16px; height: 16px; border-radius: 50%;
    background: var(--bronze); border: 3px solid var(--paper); box-shadow: var(--shadow-sm);
}
.tl-item:nth-child(odd) .tl-dot { right: -8px; }
.tl-item:nth-child(even) .tl-dot { left: -8px; }
.tl-year { font-family: var(--serif); font-size: 26px; color: var(--coffee-700); font-weight: 700; }
.tl-card {
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px 20px; box-shadow: var(--shadow-sm); margin-top: 8px; text-align: left;
}
.tl-card h4 { margin: 0 0 6px; font-size: 18px; }
.tl-card p { margin: 0; color: var(--ink-soft); font-size: 14.5px; }

/* =========================================================
   7.5 荣誉证书墙（网格）
   ========================================================= */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    margin-top: 10px;
}
.cert-item {
    margin: 0;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .25s, box-shadow .25s;
}
.cert-item:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.cert-item img { display: block; width: 100%; height: 260px; object-fit: cover; background: var(--paper-2); }
.cert-item figcaption {
    padding: 12px 14px;
    display: flex; flex-direction: column; gap: 4px;
    border-top: 1px solid var(--line);
}
.cert-title { font-family: var(--serif); font-size: 15px; color: var(--coffee-800); font-weight: 600; }
.cert-info { font-size: 12.5px; color: var(--ink-soft); }
@media (max-width: 980px) { .cert-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 680px) {
    .cert-grid { grid-template-columns: repeat(2, 1fr); }
    .cert-item img { height: 200px; }
}
@media (max-width: 420px) { .cert-grid { grid-template-columns: 1fr; } }

/* 证书墙：列表项可点击进入详情 */
.cert-link { display: block; text-decoration: none; color: inherit; }
.cert-link:hover .cert-item { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.cert-item { cursor: pointer; }          /* 提示可点击 */
.cert-item { position: relative; }       /* 为悬停徽标定位 */
.cert-item .cert-view {
    position: absolute; top: 10px; right: 10px;
    background: rgba(47,32,23,.86); color: #fff;
    font-size: 12px; letter-spacing: 1px; padding: 4px 11px; border-radius: 999px;
    opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s;
    pointer-events: none;
}
.cert-link:hover .cert-item .cert-view { opacity: 1; transform: translateY(0); }

/* 证书单篇详情：大图 600px + 文字介绍 */
.cert-detail { max-width: 760px; margin: 0 auto; }
.cert-detail-img { text-align: center; margin-bottom: 22px; }
.cert-single-img {
    display: inline-block;
    max-width: 600px;        /* 用户要求的证书大图宽度 */
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    background: var(--paper-2);
}
.cert-info-line { text-align: center; font-size: 14px; color: var(--ink-soft); margin: 0 0 18px; }
.cert-detail-text { font-size: 16px; line-height: 1.9; color: var(--ink); }
.cert-detail-text p { margin: 0 0 1em; }
.cert-back { margin-top: 30px; text-align: center; }

/* =========================================================
   8. 门窗问答（手风琴）
   ========================================================= */
.faq-list { max-width: 860px; margin: 0 auto; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); margin-bottom: 14px; overflow: hidden; }
.faq-q {
    width: 100%; text-align: left; background: transparent; border: none; cursor: pointer;
    padding: 18px 22px; font-family: var(--serif); font-size: 17px; color: var(--coffee-800);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq-q .ico { color: var(--bronze); font-size: 22px; transition: transform .25s; flex: none; }
.faq-item.open .faq-q .ico { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a .inner { padding: 0 22px 18px; color: var(--ink-soft); }

/* =========================================================
   8.5 菜单下方通屏大图位（顶部 Banner）
   ========================================================= */
.top-banner {
    position: relative;
    width: 100vw;
    /* 居中修正：以视口宽度铺满，并用左偏移抵消容器/父级 padding */
    margin-left: 50%;
    transform: translateX(-50%);
    left: 0;
    min-height: 320px;
    height: clamp(300px, 38vw, 460px);
    overflow: hidden;
    background-color: var(--coffee-800);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* 暗色渐变蒙版，保证其上文字可读（不遮挡花纹） */
.top-banner::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(34,22,15,.35), rgba(34,22,15,.55));
}
.top-banner .container { position: relative; text-align: center; }
.top-banner .tb-title {
    font-family: var(--serif); color: var(--white);
    font-size: clamp(26px, 4vw, 44px); margin: 0 0 10px; text-shadow: 0 2px 12px rgba(0,0,0,.45);
}
.top-banner .tb-sub {
    color: var(--bronze-soft); font-size: clamp(14px, 2vw, 18px);
    letter-spacing: .08em; text-shadow: 0 1px 8px rgba(0,0,0,.4);
}
.top-banner .tb-crumb {
    color: rgba(247,241,231,.75); font-size: 13px; margin-bottom: 12px; letter-spacing: .05em;
}
.top-banner .tb-crumb a { color: var(--bronze-soft); }

/* =========================================================
   9. 内页 Banner
   ========================================================= */
.page-banner {
    position: relative; color: var(--paper);
    background: linear-gradient(160deg, var(--coffee-800), var(--coffee-600));
    padding: 64px 0 72px; overflow: hidden;
}
.page-banner::before {
    content: ""; position: absolute; inset: 0; opacity: .07;
    background-image: linear-gradient(var(--bronze) 1px, transparent 1px), linear-gradient(90deg, var(--bronze) 1px, transparent 1px);
    background-size: 44px 44px;
}
.page-banner .container { position: relative; }
.page-banner h1 { color: var(--white); margin: 0; }
.page-banner .crumb { color: rgba(247,241,231,.66); font-size: 13px; margin-bottom: 10px; letter-spacing: .05em; }
.breadcrumb a { color: var(--bronze-soft); }

/* 正文排版 */
.entry { max-width: 820px; margin: 0 auto; }
.entry-content { font-size: 16.5px; color: var(--ink); }
.entry-content img { border-radius: var(--radius); margin: 1.2em 0; }

/* =========================================================
   10. 联系我们
   ========================================================= */
.contact-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.contact-info li { list-style: none; margin-bottom: 14px; display: flex; gap: 12px; }
.contact-info .ci-ico { color: var(--bronze); font-size: 18px; flex: none; width: 24px; text-align: center; }
.contact-form .field { margin-bottom: 16px; }
.contact-form label { display: block; font-family: var(--serif); color: var(--coffee-700); margin-bottom: 6px; font-size: 15px; }
.contact-form input, .contact-form textarea {
    width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
    font-family: var(--sans); font-size: 15px; background: var(--white); color: var(--ink);
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--bronze); box-shadow: 0 0 0 3px rgba(201,169,106,.18); }
.contact-form textarea { min-height: 140px; resize: vertical; }
.form-note { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }
.form-msg { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; font-size: 14.5px; }
.form-msg.ok { background: #eaf3e6; color: #2f6b1f; border: 1px solid #bcdcae; }
.form-msg.err { background: #fbe9e7; color: #b33227; border: 1px solid #e7b7ae; }
.hp-field { position: absolute; left: -9999px; }


/* =========================================================
   11. 页脚
   ========================================================= */
.site-footer { background: var(--coffee-900); color: rgba(247,241,231,.78); margin-top: 0; }
.footer-cols {
    display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 36px;
    padding: 56px 0 40px;
}
.footer-cols h4 { color: var(--bronze-soft); font-size: 17px; margin-bottom: 16px; letter-spacing: .05em; }
.footer-cols a { color: rgba(247,241,231,.78); }
.footer-cols a:hover { color: var(--bronze); }
.footer-cols ul { list-style: none; padding: 0; margin: 0; }
.footer-cols li { margin-bottom: 10px; font-size: 14.5px; }
.footer-brand .brand-name { color: var(--bronze-soft); font-size: 20px; }
.footer-brand p { font-size: 14px; margin-top: 12px; }
.footer-bottom {
    border-top: 1px solid rgba(201,169,106,.18); padding: 18px 0;
    text-align: center; font-size: 13px; color: rgba(247,241,231,.55);
}
.footer-bottom a { color: var(--bronze); }

/* 返回顶部 */
.to-top {
    position: fixed; right: 22px; bottom: 22px; width: 46px; height: 46px;
    border-radius: 50%; background: var(--coffee-700); color: var(--bronze-soft);
    border: 1px solid var(--bronze); cursor: pointer; display: none;
    align-items: center; justify-content: center; font-size: 20px; z-index: 90;
    box-shadow: var(--shadow-md); transition: background .2s, transform .2s;
}
.to-top.show { display: flex; }
.to-top:hover { background: var(--coffee-600); transform: translateY(-3px); }

/* =========================================================
   12. 归档 / 分页
   ========================================================= */
.archive-head { margin-bottom: 36px; }
.pagination { text-align: center; margin: 40px 0 10px; }
.pagination .page-numbers {
    display: inline-block; min-width: 38px; padding: 8px 12px; margin: 0 4px;
    border: 1px solid var(--line); border-radius: var(--radius); color: var(--coffee-700);
}
.pagination .page-numbers.current, .pagination .page-numbers:hover { background: var(--coffee-700); color: var(--bronze-soft); border-color: var(--coffee-700); }

/* 文章详情元信息 */
.entry-meta { color: var(--ink-soft); font-size: 14px; margin-bottom: 18px; }
.entry-meta span { margin-right: 16px; }

/* =========================================================
   13. 响应式
   ========================================================= */
@media (max-width: 992px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .footer-cols { grid-template-columns: 1fr 1fr; }
    .contact-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .main-nav { position: absolute; top: var(--header-h); right: 0; left: 0;
        background: var(--coffee-800); max-height: 0; overflow: hidden; transition: max-height .3s; box-shadow: var(--shadow-md); }
    .main-nav.open { max-height: 80vh; }
    .nav-menu { flex-direction: column; padding: 10px; gap: 2px; }
    .nav-menu > li > a { padding: 12px 16px; }
    .nav-menu > li > a::after { display: none; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .footer-cols { grid-template-columns: 1fr; gap: 28px; }
    .timeline::before { left: 18px; }
    .tl-item, .tl-item:nth-child(even) { width: 100%; left: 0; text-align: left; padding: 14px 0 14px 48px; }
    .tl-item:nth-child(odd) { text-align: left; }
    .tl-item:nth-child(odd) .tl-dot, .tl-item:nth-child(even) .tl-dot { left: 10px; right: auto; }
    .section { padding: 52px 0; }
}
