/* ====================================
   AI咨询 - 商务科技风
   配色: 深蓝科技 (#1a2a6c / #2563eb / #0ea5e9)
   布局: 顶部导航 + 左右两栏
   ==================================== */

:root {
    --primary: #1b54bc;
    --primary-dark: #1544a0;
    --primary-light: #eaf2ff;
    --accent: #5a9dff;
    --gradient: linear-gradient(135deg, #1b54bc 0%, #5a9dff 100%);
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --text: #0f172a;
    --text-light: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-hover: 0 10px 25px rgba(37,99,235,0.1), 0 4px 10px rgba(0,0,0,0.05);
    --radius: 8px;
    --radius-lg: 12px;
    --max-width: 1180px;
    --nav-height: 60px;
    --sidebar-width: 320px;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 15px;
}

/* ===== 顶部导航 ===== */
.topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    height: var(--nav-height);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* AI咨询 Logo */
.topbar-left {
    flex-shrink: 0;
}

.logo-link {
    text-decoration: none !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 36px;
    width: auto;
    display: block;
    border-radius: 6px;
}

.logo-icon {
    display: flex;
    align-items: center;
    gap: 0;
}

.logo-icon-a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px 0 0 6px;
    letter-spacing: 1px;
    height: 34px;
}

.logo-icon-z {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1a2a6c;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 0 6px 6px 0;
    height: 34px;
}

/* 中间导航菜单 */
.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 2px;
}

.nav-menu > li > a {
    display: block;
    padding: 8px 14px;
    color: var(--text);
    border-radius: 6px;
    font-size: 0.92rem;
    font-weight: 500;
    position: relative;
}

.nav-menu > li > a:hover,
.nav-menu > li > a.active {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-menu > li > a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

/* 右侧工具 */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.topbar-search-form {
    display: flex;
    align-items: center;
}

.topbar-search-input {
    width: 160px;
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    outline: none;
    background: #f1f5f9;
    transition: all 0.25s;
}

.topbar-search-input:focus {
    width: 200px;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.topbar-search-input::placeholder {
    color: #94a3b8;
    font-size: 0.82rem;
}

.topbar-search-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px 8px 6px 4px;
    color: var(--text-muted);
    transition: color 0.2s;
    margin-left: -36px;
}

.topbar-search-btn:hover {
    color: var(--primary);
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--text);
    display: none;
}

.menu-toggle:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* ===== 首页底部：各分类文章区块 ===== */
.cat-sections {
    margin-top: 25px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.cat-section {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.cat-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: #fafbfc;
}

.cat-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.cat-section-more {
    font-size: 0.8rem;
    color: #1b54bc;
}

.cat-section-more:hover {
    text-decoration: underline;
}

.cat-section-body {
    padding: 4px 0;
}

.cat-post-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 16px;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.15s;
}

.cat-post-item:last-child {
    border-bottom: none;
}

.cat-post-item:hover {
    background: #f8f9fa;
}

.cat-post-link {
    font-size: 0.85rem;
    color: #444;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 10px;
}

.cat-post-link:hover {
    color: #1b54bc;
}

.cat-post-date {
    font-size: 0.75rem;
    color: #999;
    flex-shrink: 0;
}

/* ===== 右侧边栏精选推荐 ===== */
.sidebar-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 16px;
    margin-bottom: 16px;
}

.sidebar-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-section h3::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    background: #1b54bc;
    border-radius: 2px;
}

.featured-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none !important;
    transition: background 0.15s;
}

.featured-item:last-child {
    border-bottom: none;
}

.featured-item:hover {
    background: #f8f9fa;
    margin: 0 -4px;
    padding-left: 4px;
    padding-right: 4px;
    border-radius: 4px;
}

.featured-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.featured-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.featured-title {
    font-size: 0.85rem;
    color: #444;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.featured-item:hover .featured-title {
    color: #1b54bc;
}

.featured-date {
    font-size: 0.72rem;
    color: #aaa;
}

/* ===== 首页轮播（兼容旧页面） ===== */
.carousel-section {
    margin-bottom: 24px;
    padding: 20px 0 10px;
}

.carousel-container {
    position: relative;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    gap: 20px;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.carousel-card {
    flex: 0 0 calc((100% - 40px) / 3);
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none !important;
    transition: transform 0.25s, box-shadow 0.25s;
    box-shadow: var(--shadow);
}

.carousel-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.carousel-card-img {
    width: 140px;
    min-height: 110px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
}

.carousel-card-body {
    padding: 16px 18px;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.carousel-card-cat {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 3px;
    font-size: 0.72rem;
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 500;
    margin-bottom: 6px;
    align-self: flex-start;
}

.carousel-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.carousel-card:hover .carousel-card-title {
    color: var(--primary);
}

.carousel-card-summary {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 轮播分页圆点 */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    cursor: pointer;
    transition: all 0.3s;
}

.carousel-dot.active {
    background: var(--primary);
    width: 24px;
    border-radius: 4px;
}

.carousel-dot:hover {
    background: var(--accent);
}

/* ===== 页面主体 ===== */
.main-wrap {
    padding: 25px 0;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 25px;
    align-items: start;
}

/* ===== 面包屑 ===== */
.breadcrumb {
    grid-column: 1 / -1;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.breadcrumb a {
    color: var(--text-muted);
}
.breadcrumb a:hover {
    color: var(--primary);
}

.page-title {
    grid-column: 1 / -1;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-light);
}

/* ===== 文章卡片 ===== */
.post-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 18px;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.post-card-inner {
    display: flex;
    padding: 20px;
    gap: 20px;
}

.post-thumb {
    width: 220px;
    min-height: 140px;
    flex-shrink: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 2rem;
}

.post-body {
    flex: 1;
    min-width: 0;
}

.post-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.post-cat {
    display: inline-block;
    padding: 1px 10px;
    border-radius: 3px;
    font-size: 0.78rem;
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 500;
}

.post-title {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}

.post-title a {
    color: var(--text);
}

.post-title a:hover {
    color: var(--primary);
}

.post-excerpt {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== 侧边栏 ===== */
.sidebar > div {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 18px;
    margin-bottom: 18px;
}

.sidebar h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: var(--primary);
    border-radius: 2px;
}

.sidebar p {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.7;
}

.category-list {
    list-style: none;
}

.category-list li {
    border-bottom: 1px dashed var(--border);
}

.category-list li:last-child {
    border-bottom: none;
}

.category-list a {
    display: block;
    padding: 8px 0;
    font-size: 0.88rem;
    color: var(--text-light);
}

.category-list a:hover {
    color: var(--primary);
    padding-left: 4px;
}

/* ===== 文章详情 ===== */
.post-detail {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 30px;
}

.post-detail-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.post-detail-header .post-title {
    font-size: 1.6rem;
    margin-bottom: 12px;
}

.post-detail-header .post-meta {
    font-size: 0.85rem;
}

.post-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #334155;
}

.post-content h2 {
    font-size: 1.35rem;
    margin: 1.2em 0 0.5em;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.post-content h3 {
    font-size: 1.15rem;
    margin: 1em 0 0.4em;
}

.post-content p {
    margin-bottom: 0.8em;
}

.post-content ul, .post-content ol {
    margin-bottom: 0.8em;
    padding-left: 1.5em;
}

.post-content li { margin-bottom: 0.3em; }

.post-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 10px 18px;
    margin: 1em 0;
    background: var(--primary-light);
    color: var(--text-light);
    border-radius: 0 6px 6px 0;
}

.post-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    color: #1e293b;
}

.post-content pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 18px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1em 0;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.post-content th, .post-content td {
    border: 1px solid var(--border);
    padding: 8px 12px;
}

.post-content th {
    background: #f8fafc;
    font-weight: 600;
}

.post-content img {
    max-width: 100%;
    border-radius: var(--radius);
    margin: 1em 0;
}

/* 上下篇导航 */
.post-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 35px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    gap: 20px;
}

.post-nav a {
    font-weight: 500;
}

.post-nav-label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

/* ===== 关于页面 ===== */
.about-page {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 30px;
}

.about-page h1 {
    font-size: 1.6rem;
    margin-bottom: 20px;
}

.about-card {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.about-card:last-child {
    border-bottom: none;
}

.about-card h2 {
    font-size: 1.15rem;
    margin-bottom: 10px;
}

.about-card p {
    color: var(--text-light);
    margin-bottom: 6px;
}

.skills { display: flex; flex-direction: column; gap: 10px; }

.skill-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.skill-name {
    width: 100px;
    font-size: 0.88rem;
    font-weight: 500;
    flex-shrink: 0;
}

.skill-bar {
    flex: 1;
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: var(--gradient);
    border-radius: 4px;
}

.contact-list {
    list-style: none;
}

.contact-list li {
    padding: 4px 0;
    color: var(--text-light);
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 25px;
    grid-column: 1 / 2;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text);
}

.page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===== 页脚 ===== */
.footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 35px 0 20px;
    margin-top: 30px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 15px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 20px;
}

.footer-section h3 {
    color: #e2e8f0;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.footer-section p, .footer-section li {
    font-size: 0.85rem;
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: #64748b;
}

.footer-section a:hover { color: #e2e8f0; }

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 15px;
    text-align: center;
    font-size: 0.82rem;
    color: #475569;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.empty-state p { margin-bottom: 10px; }

/* ===== 响应式 ===== */
@media (max-width: 1000px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 18px;
    }
    .sidebar > div { margin-bottom: 0; }
    .post-thumb { width: 180px; }
    .carousel-card {
        flex: 0 0 calc((100% - 20px) / 2);
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 8px;
        box-shadow: var(--shadow);
    }
    .nav-menu.active { display: flex; }
    .menu-toggle { display: block; }

    .topbar-search-input {
        width: 100px;
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    .topbar-search-input:focus {
        width: 130px;
    }
    .topbar-search-btn {
        font-size: 1rem;
        margin-left: -30px;
    }

    .post-card-inner {
        flex-direction: column;
    }
    .post-thumb {
        width: 100%;
        height: 180px;
    }
    .sidebar {
        grid-template-columns: 1fr;
    }
    .post-detail { padding: 20px; }
    .post-detail-header .post-title { font-size: 1.3rem; }
    .post-nav { flex-direction: column; gap: 10px; }
    .footer-content { flex-direction: column; text-align: center; }

    .carousel-card {
        flex: 0 0 100%;
    }
    .carousel-card-img {
        width: 110px;
    }
}
