/* ═══════════════════════════════════════════════════
   弱电技术社区 - 自定义样式 (美化升级版)
   ═══════════════════════════════════════════════════ */

/* ── 主题色 (深绿色系，呼应弱电/科技感) ── */
:root {
    --primary: #0F6E56;
    --primary-dark: #085041;
    --primary-light: #E1F5EE;
    --primary-rgb: 15, 110, 86;
    --accent: #2563EB;
    --accent-light: #EFF6FF;
    --surface: #F8FAFB;
    --text-primary: #1a2035;
    --text-secondary: #5a6577;
    --text-muted: #8c95a6;
    --border: #e5e9f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── 全局基础 ── */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: var(--surface);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Bootstrap primary 颜色覆盖 ── */
.bg-primary { background-color: var(--primary) !important; }
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: var(--transition);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #063d30 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.35);
}
.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 500;
    transition: var(--transition);
}
.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
}
.text-primary { color: var(--primary) !important; }
.navbar.bg-primary {
    background: rgba(15, 110, 86, 0.95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.15);
}
.page-item.active .page-link { background-color: var(--primary); border-color: var(--primary); }
.page-link { color: var(--primary); }
.page-link:hover { color: var(--primary-dark); }

/* ── 导航栏优化 ── */
.navbar {
    padding: 10px 0;
}
.navbar-brand {
    font-size: 1.15rem;
    letter-spacing: 0.5px;
}
.navbar .nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 14px !important;
    border-radius: 8px;
    transition: var(--transition);
    margin: 0 2px;
}
.navbar .nav-link:hover {
    background: rgba(255,255,255,0.12);
}
.navbar .nav-link.active {
    background: rgba(255,255,255,0.18);
}
.navbar .form-control {
    border-radius: 20px;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    padding: 6px 16px;
    font-size: 0.85rem;
    transition: var(--transition);
}
.navbar .form-control::placeholder {
    color: rgba(255,255,255,0.6);
}
.navbar .form-control:focus {
    background: rgba(255,255,255,0.25);
    box-shadow: none;
    outline: none;
}
.navbar .btn-outline-light {
    border-radius: 20px;
    padding: 6px 14px;
}

/* ── Hero 横幅 (大幅升级) ── */
.hero-banner {
    background: linear-gradient(135deg, #0a5c47 0%, var(--primary) 40%, #0d7a5f 70%, #085041 100%);
    border-radius: var(--radius-lg);
    min-height: 200px;
    position: relative;
    overflow: hidden;
    padding: 36px 32px;
    box-shadow: 0 8px 32px rgba(var(--primary-rgb), 0.3);
}
.hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.hero-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.hero-banner .badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255,255,255,0.18) !important;
    backdrop-filter: blur(4px);
    letter-spacing: 1px;
}
.hero-banner h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}
.hero-banner p {
    font-size: 0.9rem;
    line-height: 1.8;
    position: relative;
    z-index: 1;
}
.hero-banner .btn {
    font-weight: 500;
    padding: 8px 22px;
    border-radius: 10px;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}
.hero-banner .btn-light {
    color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.hero-banner .btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}
.hero-banner .btn-outline-light:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.15);
}
/* 统计数字区域 */
.hero-stats .stat-item {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    padding: 14px 8px;
    transition: var(--transition);
}
.hero-stats .stat-item:hover {
    background: rgba(255,255,255,0.18);
    transform: translateY(-2px);
}
.hero-stats .stat-num {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
}
.hero-stats .stat-label {
    font-size: 0.72rem;
    opacity: 0.7;
    margin-top: 4px;
}

/* ── 区域标题 ── */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.section-header h5 {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-header h5 i {
    font-size: 1.1rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}
.section-header .btn {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 5px 14px;
    border-radius: 8px;
}

/* ── 文章卡片 (大幅升级) ── */
.article-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    background: #fff;
    position: relative;
}
.article-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    opacity: 0;
    transition: var(--transition);
}
.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}
.article-card:hover::before {
    opacity: 1;
}
.article-card .card-body {
    padding: 20px 20px 12px;
}
.article-card .card-footer {
    padding: 10px 20px 14px;
    border-top: 1px solid var(--border);
}
.article-card .badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.3px;
}
.article-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 8px;
}
.article-card .card-title a {
    color: var(--text-primary);
    transition: var(--transition);
}
.article-card .card-title a:hover {
    color: var(--primary);
}
.article-card .card-text {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-card .card-footer small {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.article-card .card-footer small i {
    color: var(--primary);
    opacity: 0.6;
}

/* 产品分析卡片特殊样式 */
.article-card.border-warning-subtle {
    border-color: #fef3c7;
}
.article-card.border-warning-subtle::before {
    background: #f59e0b;
}

/* ── 讨论列表 (升级) ── */
.discussion-item {
    border: 1px solid var(--border);
    border-left: 4px solid transparent;
    border-radius: var(--radius);
    margin-bottom: 10px;
    padding: 16px 20px;
    transition: var(--transition);
    background: #fff;
}
.discussion-item:hover {
    border-left-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}
.discussion-item h6 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}
.discussion-item h6 a {
    color: inherit;
    text-decoration: none;
}
.discussion-item h6 a:hover {
    color: var(--primary);
}
.discussion-item .badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}
.discussion-item .badge.rounded-pill {
    background: var(--primary-light);
    color: var(--primary);
}

/* ── 侧边栏卡片 ── */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-sm);
}
.card-header {
    font-size: 0.85rem;
    font-weight: 700;
    background: #fff;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}
.card-header i {
    color: var(--primary);
}
.list-group-item {
    border-color: var(--border);
    padding: 10px 18px;
    font-size: 0.85rem;
    transition: var(--transition);
}
.list-group-item:hover {
    background: var(--primary-light);
    color: var(--primary);
    padding-left: 22px;
}

/* ── 页脚 ── */
footer {
    background: var(--text-primary) !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-top: 40px;
}
footer h6 {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 12px;
}
footer a {
    color: var(--text-muted);
    transition: var(--transition);
    font-size: 0.83rem;
}
footer a:hover {
    color: #fff;
    padding-left: 4px;
}

/* ── 文章详情正文样式 ── */
.article-content {
    font-size: 15px;
    line-height: 1.9;
    color: #333;
}
.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
}
.article-content h2 {
    font-size: 18px;
    font-weight: 700;
    margin-top: 32px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
    color: var(--text-primary);
}
.article-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-top: 24px;
    color: var(--primary);
}
.article-content p {
    margin-bottom: 16px;
}
.article-content ul, .article-content ol {
    padding-left: 22px;
    margin-bottom: 16px;
}
.article-content li {
    margin-bottom: 8px;
}
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
    border-radius: 8px;
    overflow: hidden;
}
.article-content table th,
.article-content table td {
    border: 1px solid var(--border);
    padding: 10px 14px;
}
.article-content table th {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}
.article-content table tr:nth-child(even) {
    background: #f8fafb;
}
.article-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: #e11d48;
}
.article-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.7;
    margin: 20px 0;
    box-shadow: var(--shadow-md);
}
.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 14px 20px;
    background: var(--primary-light);
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 20px 0;
    color: var(--text-secondary);
    font-style: italic;
}

/* ── 讨论详情正文 ── */
.discussion-content {
    font-size: 14px;
    line-height: 1.9;
    color: var(--text-secondary);
}

/* ── 回复者头像 ── */
.avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), #d1fae5);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(var(--primary-rgb), 0.2);
}

/* ── 悬停卡片 ── */
.hover-card {
    transition: var(--transition);
    border-radius: var(--radius);
}
.hover-card:hover {
    background: var(--primary-light);
    border-color: var(--primary) !important;
    transform: translateY(-1px);
}

/* ── 滚动条美化 ── */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--surface);
}
::-webkit-scrollbar-thumb {
    background: #c1c9d4;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a1aab5;
}

/* ── 响应式调整 ── */
@media (max-width: 767px) {
    .hero-banner {
        min-height: auto;
        padding: 24px 20px;
        border-radius: var(--radius);
    }
    .hero-banner h1 {
        font-size: 1.35rem;
    }
    .hero-banner .btn {
        padding: 7px 16px;
        font-size: 0.82rem;
    }
    .article-card .card-body {
        padding: 16px;
    }
    .article-card .card-footer {
        padding: 8px 16px 12px;
    }
    .discussion-item {
        padding: 12px 16px;
    }
    .article-content { font-size: 14px; }
}

/* ── 动画 ── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.hero-banner {
    animation: fadeInUp 0.6s ease-out;
}
.article-card {
    animation: fadeInUp 0.5s ease-out both;
}
.article-card:nth-child(2) {
    animation-delay: 0.1s;
}
.article-card:nth-child(3) {
    animation-delay: 0.2s;
}
.article-card:nth-child(4) {
    animation-delay: 0.3s;
}


/* ── 新页脚样式 ── */
.footer-new {
    background: linear-gradient(180deg, #1a2035 0%, #0d1321 100%);
    margin-top: 48px;
    border-radius: 20px 20px 0 0;
    position: relative;
    overflow: hidden;
}
.footer-new::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(15, 110, 86, 0.5), transparent);
}
.footer-new .footer-brand h5 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.footer-new .footer-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}
.footer-new .footer-links li {
    margin-bottom: 8px;
}
.footer-new .footer-links a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}
.footer-new .footer-links a:hover {
    color: #fff;
    padding-left: 4px;
}
.footer-new .footer-links a i {
    opacity: 0;
    transition: opacity 0.2s;
}
.footer-new .footer-links a:hover i {
    opacity: 1;
}
.footer-new .footer-contact li {
    font-size: 0.85rem;
}
.footer-new .footer-contact a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-new .footer-contact a:hover {
    color: #28a745;
}
.footer-new .footer-tags .badge {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 4px 8px;
}
.footer-new hr {
    border-color: rgba(255,255,255,0.1);
}
.footer-new a[href*="beian"] {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-new a[href*="beian"]:hover {
    color: #fff;
    text-decoration: underline;
}
.footer-new .btn-outline-success {
    border-color: #28a745;
    color: #28a745;
}
.footer-new .btn-outline-success:hover {
    background: #28a745;
    color: #fff;
}

