/* 世鼎科技官网 - 深蓝色主题 · 全响应式适配 */
:root {
    --sd-primary: #0a2a5e;      /* 深蓝主色 */
    --sd-primary-dark: #061c42; /* 更深蓝 */
    --sd-primary-light: #14418f;/* 亮蓝 */
    --sd-accent: #2e8cf0;       /* 强调蓝 */
    --sd-gold: #f0b429;         /* 金色点缀 */
    --sd-text: #3d4657;
    --sd-text-light: #6c757d;
    --sd-bg: #f5f7fb;
}

/* ===== 基础重置 ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--sd-text);
    background: var(--sd-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; }

/* ===== 顶部信息条 ===== */
.top-bar {
    background: var(--sd-primary-dark);
    color: rgba(255, 255, 255, .85);
    font-size: .82rem;
}
.top-bar .slogan { color: var(--sd-gold); font-weight: 600; }

/* ===== 导航栏 ===== */
.sd-navbar {
    background: linear-gradient(135deg, var(--sd-primary) 0%, var(--sd-primary-dark) 100%);
    box-shadow: 0 2px 12px rgba(6, 28, 66, .35);
    padding-top: .6rem;
    padding-bottom: .6rem;
}
.sd-navbar .navbar-brand .logo-badge,
.logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--sd-accent), var(--sd-primary-light));
    color: #fff; font-weight: 700; font-size: 1rem;
    box-shadow: 0 2px 8px rgba(46, 140, 240, .4);
}
.sd-navbar .navbar-brand .brand-logo-wrap {
    position: relative;
    display: inline-flex;
}
.sd-navbar .navbar-brand .brand-logo {
    height: 60px; width: auto; max-width: 180px;
    display: block;
}
.sd-navbar .navbar-brand .brand-sub {
    position: absolute;
    left: calc(100% + 10px);
    bottom: 2px;
    font-size: .95rem;
    line-height: 1.2;
    color: #fff;
    background: linear-gradient(135deg, rgba(20, 65, 143, .92), rgba(6, 28, 66, .92));
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 6px;
    padding: 2px 10px;
    white-space: nowrap;
    font-weight: 500;
    letter-spacing: .4px;
    box-shadow: 0 2px 6px rgba(6, 28, 66, .45);
}
.sd-navbar .brand-text { color: #fff; line-height: 1.15; font-size: 1.15rem; }
.sd-navbar .brand-text small { font-size: .68rem; color: rgba(255,255,255,.7); font-weight: 400; }
.sd-navbar .nav-link {
    color: rgba(255, 255, 255, .85);
    font-weight: 500;
    padding: .5rem 1.05rem;
    border-radius: 6px;
    transition: all .2s;
}
.sd-navbar .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.sd-navbar .nav-link.active { color: #fff; background: var(--sd-accent); }
.sd-navbar .navbar-toggler {
    border-color: rgba(255,255,255,.3);
    padding: .4rem .6rem;
}
.sd-navbar .navbar-toggler:focus { box-shadow: none; }

/* 右上角小人登录图标 */
.login-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    border-radius: 50%;
    color: rgba(255, 255, 255, .85);
    border: 1.5px solid rgba(255, 255, 255, .35);
    transition: all .25s;
    text-decoration: none;
}
.login-icon:hover {
    color: #fff;
    background: var(--sd-accent);
    border-color: var(--sd-accent);
    transform: scale(1.08);
}

/* ===== 通用 Banner ===== */
.page-banner {
    background: linear-gradient(120deg, var(--sd-primary-dark) 0%, var(--sd-primary) 55%, var(--sd-primary-light) 100%);
    color: #fff;
    padding: 52px 0 44px;
    position: relative;
    overflow: hidden;
}
.page-banner::after {
    content: "";
    position: absolute; right: -80px; top: -80px;
    width: 320px; height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(46,140,240,.28), transparent 70%);
}
.page-banner::before {
    content: "";
    position: absolute; left: 20%; bottom: -120px;
    width: 260px; height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240,180,41,.14), transparent 70%);
}
.page-banner h1 { font-size: 1.9rem; font-weight: 700; margin-bottom: .4rem; }
.page-banner p { color: rgba(255, 255, 255, .75); margin-bottom: 0; }
.page-banner a { color: rgba(255,255,255,.7); text-decoration: none; }
.page-banner a:hover { color: #fff; }

/* ===== 首页 Hero ===== */
.hero {
    background: linear-gradient(120deg, var(--sd-primary-dark) 0%, var(--sd-primary) 50%, #1b4fa0 100%);
    color: #fff;
    padding: 76px 0 66px;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: "";
    position: absolute; right: -100px; top: -100px;
    width: 480px; height: 480px; border-radius: 50%;
    background: radial-gradient(circle, rgba(46,140,240,.3), transparent 70%);
}
.hero::before {
    content: "";
    position: absolute; left: -80px; bottom: -160px;
    width: 420px; height: 420px; border-radius: 50%;
    background: radial-gradient(circle, rgba(240,180,41,.12), transparent 70%);
}
.hero h1 { font-size: 2.5rem; font-weight: 800; line-height: 1.25; }
.hero .lead { color: rgba(255,255,255,.82); font-size: 1.06rem; }
.hero .badge-pill {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff; font-weight: 500; font-size: .85rem;
    padding: .45rem .9rem; border-radius: 50rem;
}
.hero-stats .stat-item { text-align: center; }
.hero-stats .stat-num { font-size: 2rem; font-weight: 800; color: var(--sd-gold); }
.hero-stats .stat-label { color: rgba(255,255,255,.75); font-size: .85rem; }

/* ===== 按钮 ===== */
.btn-sd {
    background: var(--sd-accent); border-color: var(--sd-accent); color: #fff;
}
.btn-sd:hover { background: var(--sd-primary-light); border-color: var(--sd-primary-light); color: #fff; }
.btn-outline-sd {
    border: 1.5px solid var(--sd-accent); color: var(--sd-accent); background: transparent;
}
.btn-outline-sd:hover { background: var(--sd-accent); color: #fff; }

/* ===== 区块标题 ===== */
.section-title { text-align: center; margin-bottom: 2rem; }
.section-title h2 {
    font-weight: 700; color: var(--sd-primary);
    font-size: 1.7rem; position: relative; display: inline-block; padding-bottom: 12px;
}
.section-title h2::after {
    content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
    width: 56px; height: 3px; border-radius: 3px;
    background: linear-gradient(90deg, var(--sd-accent), var(--sd-gold));
}
.section-title p { color: #8a94a6; font-size: .92rem; }

/* ===== 卡片 ===== */
.sd-card {
    border: none; border-radius: 10px; overflow: hidden;
    box-shadow: 0 3px 14px rgba(10, 42, 94, .08);
    transition: transform .25s, box-shadow .25s;
    background: #fff;
}
.sd-card:hover { transform: translateY(-6px); box-shadow: 0 10px 28px rgba(10, 42, 94, .16); }
.sd-card .card-img-wrap { height: 170px; overflow: hidden; background: #e9eef6; position: relative; }
.sd-card .card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.sd-card:hover .card-img-wrap img { transform: scale(1.06); }
.sd-card .card-body { padding: 1.1rem; }
.sd-card .card-title { font-size: 1.02rem; font-weight: 700; color: var(--sd-primary); }
.sd-card .card-text { font-size: .87rem; color: var(--sd-text-light); }
.sd-card .cat-badge {
    position: absolute; left: 10px; top: 10px;
    background: rgba(10, 42, 94, .82); color: #fff;
    font-size: .72rem; padding: 3px 10px; border-radius: 50rem;
}

/* ===== 分类筛选按钮 ===== */
.filter-btn {
    border: 1px solid #d5ddec; color: #51607a; background: #fff;
    border-radius: 50rem; padding: .3rem 1.05rem; font-size: .88rem;
    margin: .25rem; transition: all .2s; text-decoration: none; display: inline-block;
}
.filter-btn:hover { border-color: var(--sd-accent); color: var(--sd-accent); }
.filter-btn.active { background: var(--sd-primary); border-color: var(--sd-primary); color: #fff; }

/* ===== 富文本内容区 ===== */
.rich-content { font-size: .95rem; line-height: 1.9; color: var(--sd-text); }
.rich-content img { max-width: 100%; height: auto; border-radius: 6px; margin: 8px 0; }
.rich-content h5, .rich-content h4 { color: var(--sd-primary); margin-top: 1.2rem; font-weight: 700; }
.rich-content h3 { color: var(--sd-primary); margin-top: 1.5rem; font-weight: 700; font-size: 1.25rem; }
.rich-content table { width: 100%; margin: 10px 0; border-collapse: collapse; }
.rich-content table td, .rich-content table th { border: 1px solid #dee2e6; padding: 6px 10px; }
.rich-content ul, .rich-content ol { padding-left: 1.5rem; }
.rich-content li { margin-bottom: .3rem; }
.rich-content p { margin-bottom: .8rem; }
.rich-content strong { color: var(--sd-primary); }

/* ===== 留言区 ===== */
.message-box {
    background: #fff; border-radius: 12px; padding: 1.6rem;
    box-shadow: 0 3px 14px rgba(10, 42, 94, .07);
}
.message-box h5 { color: var(--sd-primary); font-weight: 700; }
.message-box .editor-toolbar {
    border: 1px solid #d5ddec; border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: #f8fafd;
    max-width: 100%;
}
/* 工具栏按钮允许换行，绝不横向撑破容器 */
.message-box .editor-toolbar .w-e-bar { flex-wrap: wrap; max-width: 100%; }
/* wangEditor 要求编辑区必须有固定高度，否则输入区会塌陷无法输入 */
.message-box .editor-container {
    border: 1px solid #d5ddec;
    border-radius: 0 0 8px 8px;
    height: 220px;
    max-width: 100%;
}
.message-box .w-e-text-container { max-width: 100%; }

/* ===== 页脚 ===== */
.sd-footer { background: var(--sd-primary-dark); }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .55rem; }
.footer-links a { color: rgba(255,255,255,.6); text-decoration: none; font-size: .9rem; transition: color .2s; }
.footer-links a:hover { color: var(--sd-gold); }
.footer-contact { list-style: none; padding: 0; margin: 0; color: rgba(255,255,255,.6); font-size: .88rem; }
.footer-contact li { margin-bottom: .55rem; }

/* ===== 面包屑/列表 ===== */
.list-group-item.active { background: var(--sd-primary); border-color: var(--sd-primary); }
.text-sd { color: var(--sd-primary) !important; }
.bg-sd { background: var(--sd-primary) !important; }

/* ===== 新闻列表 ===== */
.news-item { transition: all .2s; border-radius: 10px; overflow: hidden; }
.news-item:hover { box-shadow: 0 8px 24px rgba(10, 42, 94, .13); transform: translateY(-3px); }
.news-item .news-date {
    background: var(--sd-primary); color: #fff; text-align: center;
    border-radius: 8px; padding: .5rem .7rem; min-width: 68px;
}
.news-item .news-date .day { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.news-item .news-date .ym { font-size: .72rem; opacity: .85; }

/* ===== 表格 ===== */
.table-sd thead th { background: var(--sd-primary); color: #fff; font-weight: 600; }
.table-responsive { border-radius: 8px; }

/* ===== 详情页侧栏 ===== */
.side-list .list-group-item { border-left: 3px solid transparent; transition: all .2s; }
.side-list .list-group-item:hover { border-left-color: var(--sd-accent); background: #f0f6ff; }

/* ===== 分页 ===== */
.pagination .page-link {
    color: var(--sd-primary);
    border-color: #d5ddec;
    margin: 0 .15rem;
    border-radius: 6px;
}
.pagination .page-link:hover {
    background: #f0f6ff;
    border-color: var(--sd-accent);
    color: var(--sd-accent);
}
.pagination .page-item.active .page-link {
    background: var(--sd-primary);
    border-color: var(--sd-primary);
    color: #fff;
}

/* ===== 后台 ===== */
.admin-sidebar {
    background: var(--sd-primary-dark); min-height: 100vh;
}
.admin-sidebar .nav-link {
    color: rgba(255,255,255,.75); border-radius: 8px; margin-bottom: 4px;
}
.admin-sidebar .nav-link:hover, .admin-sidebar .nav-link.active {
    background: var(--sd-primary-light); color: #fff;
}
.admin-topbar { background: var(--sd-primary); color: #fff; }

/* =====================================================
   响应式断点 - Bootstrap 5 标准断点
   xs: <576px  (手机竖屏)
   sm: ≥576px  (手机横屏/小平板)
   md: ≥768px  (平板)
   lg: ≥992px  (桌面)
   xl: ≥1200px (大屏)
   xxl: ≥1400px (超大屏)
   ===================================================== */

/* ---- 大屏优化 (≥1200px) ---- */
@media (min-width: 1200px) {
    .hero h1 { font-size: 2.8rem; }
    .hero { padding: 90px 0 80px; }
    .section-title h2 { font-size: 1.9rem; }
    .sd-card .card-img-wrap { height: 190px; }
    .container { max-width: 1180px; }
}

/* ---- 超大屏优化 (≥1400px) ---- */
@media (min-width: 1400px) {
    .hero h1 { font-size: 3rem; }
    .hero { padding: 100px 0 90px; }
    .container { max-width: 1320px; }
    .sd-card .card-img-wrap { height: 200px; }
}

/* ---- 平板端 (≤991px) ---- */
@media (max-width: 991.98px) {
    .hero h1 { font-size: 2rem; }
    .hero { padding: 60px 0 50px; }
    .hero .lead { font-size: .95rem; }
    .page-banner { padding: 42px 0 36px; }
    .page-banner h1 { font-size: 1.6rem; }
    .section-title h2 { font-size: 1.5rem; }
    .sd-card .card-img-wrap { height: 160px; }
    .sd-card .card-body { padding: .95rem; }
    .sd-card .card-title { font-size: .98rem; }
    .sd-card .card-text { font-size: .84rem; }
    /* 导航栏移动端 */
    .sd-navbar .navbar-nav { padding-top: .5rem; }
    .sd-navbar .nav-link { padding: .6rem .8rem; border-radius: 6px; }
    .sd-navbar .nav-item { margin-bottom: .2rem; }
    .login-icon { width: 38px; height: 38px; }
}

/* ---- 手机端 (≤767px) ---- */
@media (max-width: 767.98px) {
    .hero h1 { font-size: 1.65rem; }
    .hero { padding: 48px 0 40px; }
    .hero .lead { font-size: .9rem; }
    .hero .badge-pill { font-size: .78rem; padding: .35rem .7rem; margin-bottom: .3rem; }
    .hero-stats .stat-num { font-size: 1.6rem; }
    .hero-stats .stat-label { font-size: .78rem; }
    .hero .btn-lg { padding: .5rem 1rem; font-size: .95rem; }

    .page-banner { padding: 36px 0 30px; }
    .page-banner h1 { font-size: 1.4rem; }
    .page-banner p { font-size: .85rem; }

    .section-title { margin-bottom: 1.5rem; }
    .section-title h2 { font-size: 1.3rem; padding-bottom: 10px; }
    .section-title h2::after { width: 44px; height: 2.5px; }
    .section-title p { font-size: .85rem; }

    .sd-card .card-img-wrap { height: 150px; }
    .sd-card .card-body { padding: .85rem; }
    .sd-card .card-title { font-size: .95rem; }
    .sd-card .card-text { font-size: .82rem; }
    .sd-card .cat-badge { font-size: .68rem; padding: 2px 8px; }

    .filter-btn { font-size: .82rem; padding: .25rem .85rem; margin: .2rem; }

    .rich-content { font-size: .9rem; line-height: 1.8; }
    .rich-content h3 { font-size: 1.15rem; }
    .rich-content h4 { font-size: 1.05rem; }
    .rich-content h5 { font-size: 1rem; }

    .message-box { padding: 1.2rem; }
    .message-box .editor-container { height: 180px; }

    .news-item .news-date { min-width: 58px; padding: .4rem .55rem; }
    .news-item .news-date .day { font-size: 1.25rem; }
    .news-item .news-date .ym { font-size: .68rem; }

    /* 顶部信息条 */
    .top-bar { font-size: .75rem; padding: .3rem 0; }
    .top-bar .container { justify-content: center !important; text-align: center; }
    .top-bar .slogan { width: 100%; margin-bottom: .2rem; }

    /* 页脚 */
    .sd-footer { padding-top: 2.5rem !important; }
    .sd-footer h5, .sd-footer h6 { font-size: 1rem; }
    .footer-links a, .footer-contact { font-size: .85rem; }

    /* 品牌文字 */
    .sd-navbar .brand-text { font-size: 1rem; }
    .sd-navbar .brand-text small { font-size: .62rem; }
    .sd-navbar .logo-badge { width: 38px; height: 38px; font-size: .9rem; }
    .sd-navbar .navbar-brand .brand-logo { height: 44px; }
    .sd-navbar .navbar-brand .brand-sub { font-size: .75rem; }

    /* 主内容区间距 */
    main.py-4 { padding-top: 1.2rem !important; padding-bottom: 1.2rem !important; }

    /* 分页 */
    .pagination .page-link { padding: .35rem .6rem; font-size: .85rem; }
}

/* ---- 小屏手机 (≤575px) ---- */
@media (max-width: 575.98px) {
    .hero h1 { font-size: 1.45rem; }
    .hero { padding: 40px 0 34px; }
    .hero .lead { font-size: .88rem; }
    .hero-stats .stat-num { font-size: 1.4rem; }
    .hero-stats .stat-label { font-size: .75rem; }
    .hero .btn { display: block; width: 100%; margin-bottom: .5rem; }
    .hero .btn + .btn { margin-left: 0 !important; }

    .page-banner { padding: 30px 0 26px; }
    .page-banner h1 { font-size: 1.25rem; }
    .page-banner p { font-size: .82rem; }

    .section-title h2 { font-size: 1.2rem; }
    .section-title p { font-size: .82rem; }

    .sd-card .card-img-wrap { height: 140px; }

    /* 卡片单列更紧凑 */
    .row.g-4 { --bs-gutter-y: 1rem; --bs-gutter-x: .75rem; }
    .row.g-3 { --bs-gutter-y: .75rem; --bs-gutter-x: .75rem; }

    /* 关于我们的理念四格 */
    .about-philosophy .col-6 { padding: .5rem; }
    .about-philosophy .fs-2 { font-size: 1.5rem !important; }

    /* 新闻列表 */
    .news-item { padding: .75rem !important; }
    .news-item .news-date { min-width: 52px; padding: .35rem .5rem; }
    .news-item .news-date .day { font-size: 1.1rem; }

    /* 详情页图片 */
    .rich-content img { margin: 6px 0; }

    /* 表格横向滚动 */
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* 留言表单 */
    .message-box { padding: 1rem; }
    .message-box h5 { font-size: 1.05rem; }
}

/* ---- 超小屏 (≤380px) ---- */
@media (max-width: 380px) {
    .hero h1 { font-size: 1.3rem; }
    .hero-stats .stat-num { font-size: 1.25rem; }
    .sd-navbar .brand-text strong { font-size: .9rem; }
    .sd-navbar .brand-text small { font-size: .58rem; }
    .sd-navbar .navbar-brand .brand-logo { height: 36px; }
    .sd-navbar .navbar-brand .brand-sub { font-size: .6rem; letter-spacing: .2px; }
    .filter-btn { font-size: .78rem; padding: .22rem .7rem; }
}

/* ===== 打印样式 ===== */
@media print {
    .top-bar, .sd-navbar, .sd-footer, .message-box, .filter-btn { display: none !important; }
    .sd-card { box-shadow: none; border: 1px solid #ddd; }
    main { padding: 0 !important; }
    body { background: #fff; }
}

/* ===== 减少动画偏好 ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
