* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft Yahei", "PingFang SC", sans-serif; color: #222; background: #f8f9fa; line-height: 1.6; }
a { text-decoration: none; color: #222; transition: color .2s; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* ========== 顶部导航 ========== */
.top-header { background: #fff; border-bottom: 2px solid #e63946; box-shadow: 0 2px 8px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 100000; }
.top-header .wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; height: 70px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 28px; font-weight: 900; color: #1a36d2; letter-spacing: 1px; }
.logo span { color: #e63946; }
.main-nav { display: flex; gap: 35px; font-size: 16px; align-items: center; }
.main-nav a:hover { color: #e63946; }
.lang-switch select { padding: 6px 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; }

/* ========== 主体布局 ========== */
.main-wrap { max-width: 1280px; margin: 20px auto; padding: 0 20px; display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; overflow: visible; position: relative; z-index: 1; }

/* ========== 左侧分类菜单 ========== */
.category-box {
    background: #fff;
    border-radius: 8px;
    overflow: visible !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 90px;
    z-index: 99999 !important;
}
.cate-title {
    background: #e63946;
    color: #fff;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
}
.cate-list { list-style: none; padding: 0; margin: 0; position: relative; }
.cate-list li {
    position: static !important;
    border-bottom: 1px solid #f0f0f0;
    list-style: none;
    overflow: visible !important;
    z-index: 99999;
}
.cate-list > li > a {
    display: block;
    padding: 12px 20px;
    font-size: 15px;
    color: #222;
    text-decoration: none;
    transition: all .2s;
}
.cate-list > li:hover > a,
.cate-list > li.active > a {
    background: #fff1f2;
    color: #e63946;
}

/* ========== 二级悬浮弹窗 ========== */
.cate-children {
    position: absolute !important;
    left: 100% !important;
    top: 0 !important;
    width: 880px;
    max-height: 85vh;
    overflow-y: auto;
    background: #fff;
    box-shadow: 4px 2px 16px rgba(0,0,0,0.1);
    padding: 20px;
    border-radius: 0 8px 8px 0;
    display: none !important;
    z-index: 999999 !important;
    border-left: 2px solid #e63946;
    box-sizing: border-box;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-content: flex-start !important;
    justify-items: start !important;
}
.cate-list li:hover .cate-children,
.cate-list li.active .cate-children {
    display: grid !important;
}
.child-group {
    display: block;
    width: 100%;
}
.child-group h4 {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f0f0f0;
}
.child-group .group-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.child-group .group-links a {
    font-size: 14px;
    color: #e63946;
    line-height: 1.8;
    white-space: nowrap;
}
.child-group .group-links a:hover {
    color: #b71c1c;
    text-decoration: underline;
}

/* ========== 右侧内容区 ========== */
.content-area { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06); position: relative; z-index: 1; }
.banner { width: 100%; height: 380px; background: #eee; position: relative; overflow: hidden; z-index: 1; }
.banner img { width: 100%; height: 100%; object-fit: cover; }
.section-title { font-size: 20px; font-weight: 600; padding: 20px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.section-title a { font-size: 14px; color: #999; font-weight: normal; }
.section-title a:hover { color: #e63946; }
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; padding: 20px; }
.product-card { border: 1px solid #f0f0f0; border-radius: 6px; overflow: hidden; transition: all .2s; background: #fff; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); border-color: #e63946; }
.product-card .cover { width: 100%; height: 180px; object-fit: cover; background: #f5f5f5; }
.product-card .title { padding: 10px 12px; font-size: 14px; line-height: 1.4; height: 50px; overflow: hidden; }

/* ========== 产品详情页 ========== */
.detail-box { background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.detail-box h1 { font-size: 24px; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #f0f0f0; }
.video-list { margin-bottom: 25px; padding: 15px; background: #f8f9fa; border-radius: 6px; }
.video-item { margin-bottom: 15px; }
.video-item video { width: 100%; max-width: 800px; border-radius: 4px; }
.video-item .download-btn { display: inline-block; margin-top: 8px; padding: 6px 14px; background: #e63946; color: #fff; border-radius: 4px; font-size: 14px; }
.video-item .download-btn:hover { opacity: 0.9; }

/* Markdown正文排版 */
.content-body {
    line-height: 1.8;
    font-size: 16px;
    color: #222;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}
.content-body p {
    margin: 12px 0;
}
.content-body img {
    max-width: 92%;
    display: block;
    margin: 16px auto;
    border-radius: 4px;
}
.content-body strong {
    font-weight: 700;
    font-size: 18px;
    margin-top: 20px;
    display: inline-block;
}
.content-body h1,
.content-body h2,
.content-body h3 {
    margin: 24px 0 12px;
    font-weight: 600;
    line-height: 1.4;
}
.content-body picture {
    display: block;
    width: 100%;
    margin: 16px auto;
}
.content-body video {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
    background: #000;
}
.content-body a {
    word-break: break-all;
    word-wrap: break-word;
    color: #e63946;
    text-decoration: underline;
}
.content-body a:hover {
    color: #b71c1c;
}

/* ========== 后台通用样式 ========== */
.admin-header { background: #222; color: #fff; padding: 12px 20px; }
.admin-header .wrap { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.admin-header a { color: #fff; margin-left: 20px; }
.admin-container { max-width: 1200px; margin: 20px auto; padding: 0 20px; }
.admin-form { background: #fff; padding: 25px; border-radius: 8px; }
.admin-form input, .admin-form textarea, .admin-form select { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; margin-bottom: 15px; font-size: 14px; }
.admin-form textarea { min-height: 300px; resize: vertical; }
.btn { padding: 10px 20px; background: #222; color: #fff; border: none; border-radius: 4px; cursor: pointer; transition: opacity .2s; }
.btn.primary { background: linear-gradient(135deg, #1a73e8, #0052cc); }
.btn.danger { background: #e63946; }
.btn:hover { opacity: 0.9; }
.admin-table { width: 100%; background: #fff; border-radius: 8px; overflow: hidden; }
.admin-table th, .admin-table td { padding: 12px; text-align: left; border-bottom: 1px solid #eee; }
.admin-table th { background: #f8f9fa; }

/* ========== 登录页样式 ========== */
.login-box { max-width: 420px; margin: 100px auto; background: #fff; padding: 30px; border-radius: 16px; box-shadow: 0 30px 60px rgba(0,0,0,0.25); }
.login-box h2 { text-align: center; margin-bottom: 20px; font-size: 22px; font-weight: 800; }
.login-box input { width: 100%; padding: 14px 16px; margin-bottom: 16px; border: 1px solid #cbd5e1; border-radius: 10px; font-size: 15px; outline: none; }
.login-box input:focus { border-color: #1a73e8; box-shadow: 0 0 0 3px rgba(26,115,232,0.15); }
.login-box .btn { width: 100%; padding: 14px; font-size: 16px; font-weight: bold; border-radius: 10px; }

/* ========== 手机端响应式 ========== */
@media (max-width: 768px) {
    .main-wrap { grid-template-columns: 1fr; }
    .cate-children {
        position: static;
        width: 100%;
        box-shadow: none;
        padding: 10px 20px 15px 30px;
        display: none !important;
        border-left: none;
        border-top: 1px solid #f0f0f0;
        grid-template-columns: 1fr;
    }
    .cate-list li.active .cate-children { display: block !important; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 15px; }
    .detail-box { padding: 15px; }
    .detail-box h1 { font-size: 18px; }
    .main-nav { gap: 15px; font-size: 14px; }
    .banner { height: 200px; }
    .content-body {
        font-size: 15px;
    }
    .content-body img {
        max-width: 100%;
    }
}