:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --accent-color: #fe4b11;
    --text-color: #2c3e50;
    --text-muted: #7f8c8d;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f8f9fa;
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.navbar { box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.navbar-brand span { font-weight: bold; }
.navbar-brand { font-size: 1.3rem; letter-spacing: 0.5px; }
.nav-link { font-weight: 500; transition: color 0.2s; }

.hero-section {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 5rem 0;
    margin-bottom: 2rem;
    border-radius: 0 0 30px 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.hero-title {
    font-weight: 700;
    font-size: 3.2rem;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}
.hero-title .brand-51 { color: #fe4b11; }
.hero-title .brand-boxs { color: #f1c40f; }

.hero-subtitle {
    font-weight: 300;
    font-size: 1.4rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.tool-card {
    border: none;
    border-radius: 12px;
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 1.5rem;
    overflow: hidden;
    height: 100%;
    background: #fff;
}
.tool-card:hover { transform: translateY(-5px); box-shadow: 0 12px 24px rgba(0,0,0,0.12); }
.tool-card .card-body { padding: 1.5rem; }
.tool-card .card-title { font-weight: 600; color: var(--text-color); }
.tool-card .card-text { color: var(--text-muted); font-size: 0.9rem; }

.tool-icon { font-size: 2.5rem; margin-bottom: 1rem; color: var(--primary-color); }

.category-title {
    margin: 2.5rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-color);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--dark-color);
}

.footer {
    background: linear-gradient(180deg, #1a252f 0%, var(--dark-color) 100%);
    color: #fff;
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
    font-size: 0.95rem;
}
.footer-heading { font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; color: #fff; text-transform: uppercase; letter-spacing: 1px; }
.footer-text { color: rgba(255,255,255,0.7); margin-bottom: 0.5rem; }
.footer-links { margin-bottom: 0; }
.footer-links li { margin-bottom: 0.35rem; }
.footer-link { color: rgba(255,255,255,0.6); text-decoration: none; transition: color 0.2s; }
.footer-link:hover { color: #fff; text-decoration: underline; }
.footer-divider { border-color: rgba(255,255,255,0.15); margin: 1.5rem 0; }

/* ========== Blog Styles ========== */
.blog-highlight-section { background: linear-gradient(180deg, #f8f9fa 0%, #fff 100%); }

.blog-card {
    border: none;
    border-radius: 12px;
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
    height: 100%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.blog-card:hover { transform: translateY(-5px); box-shadow: 0 12px 24px rgba(0,0,0,0.12); }

.blog-card .card-img-top {
    height: 160px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.blog-card .card-body { padding: 1.25rem; }
.blog-card .card-title { font-weight: 600; color: var(--text-color); font-size: 1.05rem; line-height: 1.4; }
.blog-card .card-text { color: var(--text-muted); font-size: 0.85rem; line-height: 1.5; }

.blog-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.blog-category-badge {
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-frontend { background: rgba(52,152,219,0.1); color: #2980b9; }
.badge-backend { background: rgba(46,204,113,0.1); color: #27ae60; }
.badge-ai { background: rgba(155,89,182,0.1); color: #8e44ad; }
.badge-tools { background: rgba(243,156,18,0.1); color: #d35400; }
.badge-architecture { background: rgba(26,188,156,0.1); color: #16a085; }

.blog-search-box {
    max-width: 500px;
    position: relative;
}
.blog-search-box input {
    padding-left: 40px;
    border-radius: 100px;
    border: 2px solid var(--border-color, #dee2e6);
}
.blog-search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.blog-filter-tags .btn {
    border-radius: 100px;
    padding: 4px 16px;
    font-size: 0.85rem;
    font-weight: 500;
}
.blog-filter-tags .btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.blog-detail-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 4rem 0 3rem;
    border-radius: 0 0 30px 30px;
    margin-bottom: 2rem;
}
.blog-detail-title { font-weight: 700; font-size: 2.2rem; margin-bottom: 1rem; }
.blog-detail-meta { opacity: 0.85; font-size: 0.9rem; }

.blog-detail-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.blog-detail-content h3 { font-size: 1.4rem; font-weight: 600; margin: 1.5rem 0 0.75rem; color: var(--dark-color); }
.blog-detail-content p { line-height: 1.8; color: #4a5568; margin-bottom: 1rem; }
.blog-detail-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.blog-detail-content code { font-family: 'Consolas', 'Monaco', monospace; }
.blog-detail-content ul, .blog-detail-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.blog-detail-content li { margin-bottom: 0.5rem; line-height: 1.7; }
.blog-detail-content table { width: 100%; margin-bottom: 1rem; border-collapse: collapse; }
.blog-detail-content th, .blog-detail-content td { padding: 10px 14px; border: 1px solid #e2e8f0; }
.blog-detail-content th { background: #f8f9fa; font-weight: 600; }

.blog-nav-back { margin-bottom: 1.5rem; }
.blog-nav-back a { color: var(--primary-color); font-weight: 500; text-decoration: none; }
.blog-nav-back a:hover { text-decoration: underline; }

.btn-primary { background-color: var(--primary-color); border-color: var(--primary-color); font-weight: 500; }
.btn-primary:hover { background-color: #2980b9; border-color: #2980b9; }
.btn-light { font-weight: 600; color: var(--dark-color); }

.tool-container { max-width: 960px; margin: 2rem auto; }

.code-area {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    min-height: 200px;
    resize: vertical;
    border-radius: 6px;
}

.result-area {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    min-height: 200px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
}

.toast-container { position: fixed; bottom: 1rem; right: 1rem; z-index: 1060; animation: slideUp 0.3s ease; }
.toast { background: #333; color: #fff; border-radius: 8px; padding: 12px 20px; font-size: 0.95rem; box-shadow: 0 4px 12px rgba(0,0,0,0.2); opacity: 0.95; }
.toast-body { padding: 0; color: #fff; }

@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ========== 博客操作栏（点赞/收藏/分享） ========== */
.blog-actions-bar { display: flex; justify-content: center; }
.blog-action-btn {
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 50px;
    padding: 8px 18px;
    font-size: 0.9rem;
    color: #64748b;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.blog-action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
}
.blog-action-btn.liked {
    border-color: #e74c3c;
    color: #e74c3c;
    background: #fdf2f2;
}
.blog-action-btn.liked:hover { transform: none; box-shadow: none; }
.blog-action-btn.favorited {
    border-color: #f39c12;
    color: #f39c12;
    background: #fff9f0;
}
.blog-share-menu { animation: fadeIn 0.2s ease; }
.blog-share-menu .btn-sm { border-radius: 20px; font-size: 0.8rem; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 768px) {
    .hero-section { padding: 3rem 0; }
    .hero-title { font-size: 2.2rem; }
    .hero-subtitle { font-size: 1.1rem; }
    .footer .row > div { text-align: center !important; }
}
