/*
Theme Name: TYPower (拓阳电力)
Theme URI: https://www.tuoyangpower.com
Author: AI Developer
Description: 专为石家庄拓阳电力器具有限公司定制的高端响应式企业展示主题。
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: typower
*/

:root {
    --primary-color: #0A4D8C;
    --secondary-color: #F5A623;
    --text-dark: #333333;
    --text-light: #666666;
    --bg-light: #F4F7F6;
    --white: #FFFFFF;
}

body { font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif; color: var(--text-dark); line-height: 1.6; margin: 0; padding: 0;}
a { text-decoration: none; color: var(--primary-color); transition: 0.3s; }
a:hover { color: var(--secondary-color); }
img { max-width: 100%; height: auto; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* ================= 头部导航 ================= */
.site-header { background: var(--white); box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 1000; }
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 80px; }
.site-logo img { max-height: 50px; }
.site-logo a { font-size: 24px; font-weight: bold; color: var(--primary-color); } /* 没图片时显示文字Logo的样式 */

.main-nav ul { list-style: none; display: flex; gap: 30px; margin: 0; padding: 0; }
.main-nav a { font-size: 16px; font-weight: 500; color: var(--text-dark); }
.main-nav a:hover, .main-nav .current-menu-item a { color: var(--primary-color); border-bottom: 2px solid var(--secondary-color); }

.hamburger { display: none; font-size: 24px; background: none; border: none; cursor: pointer; color: var(--primary-color); }

/* ================= 移动端侧边栏菜单 (全局隐藏，修复PC端多出一列的问题) ================= */
.mobile-menu {
    position: fixed; 
    top: 0; 
    right: -100%; /* 关键：默认隐藏在屏幕右侧外面 */
    width: 80%; 
    max-width: 300px; 
    height: 100vh;
    background: var(--white); 
    z-index: 10001; 
    transition: 0.3s; 
    padding: 20px; 
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    overflow-y: auto;
}
.mobile-menu.active { right: 0; } /* 激活时滑入屏幕 */
.mobile-menu ul { list-style: none; padding: 0; margin-top: 50px; }
.mobile-menu li { border-bottom: 1px solid #eee; }
.mobile-menu a { display: block; padding: 15px 0; font-size: 16px; color: var(--text-dark); }
.close-menu { background:none; border:none; font-size:24px; position:absolute; top:20px; right:20px; cursor:pointer; color: var(--text-dark); }

/* ================= 移动端底部固定导航 ================= */
.mobile-bottom-nav {
    display: none; position: fixed; bottom: 0; left: 0; width: 100%; height: 60px;
    background: var(--white); box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 9999; justify-content: space-around; align-items: center;
}
.mobile-bottom-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--text-dark); font-size: 12px; flex: 1; height: 100%;
}
.mobile-bottom-nav a i { font-size: 20px; margin-bottom: 4px; color: var(--primary-color); }
.mobile-bottom-nav a.active i, .mobile-bottom-nav a:hover i { color: var(--secondary-color); }

/* ================= 微信弹窗 ================= */
.wechat-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 10000; justify-content: center; align-items: center; }
.wechat-modal.active { display: flex; }
.wechat-modal-content { background: #fff; padding: 30px; border-radius: 10px; text-align: center; position: relative; max-width: 90%; }
.wechat-modal-content img { max-width: 200px; }
.close-modal { position: absolute; top: 10px; right: 15px; font-size: 24px; cursor: pointer; }

/* ================= 首页样式 ================= */
.hero-banner { background: linear-gradient(rgba(10,77,140,0.85), rgba(10,77,140,0.85)), url('https://images.unsplash.com/photo-1581092918056-0c4c3acd3789?auto=format&fit=crop&w=1920&q=80'); background-size: cover; background-position: center; color: #fff; padding: 120px 0; text-align: center; }
.hero-banner h1 { font-size: 48px; margin-bottom: 20px; font-weight: 700; }
.hero-banner p { font-size: 20px; opacity: 0.9; margin-bottom: 30px; }
.btn-primary { background: var(--secondary-color); color: #fff; padding: 14px 35px; border-radius: 5px; font-weight: bold; display: inline-block; font-size: 16px; }
.btn-primary:hover { background: #e09510; color: #fff; }

.section-title { text-align: center; margin: 80px 0 50px; }
.section-title h2 { font-size: 32px; color: var(--primary-color); position: relative; display: inline-block; padding-bottom: 15px; }
.section-title h2::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 60px; height: 4px; background: var(--secondary-color); border-radius: 2px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-bottom: 80px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 25px; margin-bottom: 80px; }

.card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.05); transition: 0.3s; border: 1px solid #f0f0f0; }
.card:hover { transform: translateY(-8px); box-shadow: 0 12px 30px rgba(0,0,0,0.12); border-color: var(--secondary-color); }
.card img { width: 100%; height: 220px; object-fit: cover; }
.card-body { padding: 20px; }
.card-body h3 { margin: 0 0 10px; font-size: 18px; color: var(--text-dark); }
.card-body p { color: var(--text-light); font-size: 14px; margin: 0; line-height: 1.5; }

/* ================= 文章/页面通用 ================= */
.page-content { padding: 80px 0; min-height: 50vh; }
.page-content h1 { color: var(--primary-color); border-left: 5px solid var(--secondary-color); padding-left: 15px; margin-bottom: 40px; font-size: 28px; }
.entry-content { font-size: 16px; line-height: 1.8; color: #444; }
.entry-content img { border-radius: 8px; margin: 20px 0; }

/* ================= 响应式处理 (移动端) ================= */
@media (max-width: 992px) {
    .main-nav { display: none; } /* PC菜单隐藏 */
    .hamburger { display: block; } /* 汉堡按钮显示 */
    .mobile-bottom-nav { display: flex; } /* 底部导航显示 */
    body { padding-bottom: 60px; } /* 防止底部内容被遮挡 */
    
    .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 20px; }
    .hero-banner { padding: 80px 0; }
    .hero-banner h1 { font-size: 28px; }
    .hero-banner p { font-size: 16px; }
    .section-title { margin: 50px 0 30px; }
    .section-title h2 { font-size: 24px; }
}
