/* 灵犀 AI CMS 默认模板样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --text-color: #333;
    --text-light: #666;
    --bg-light: #f8fafc;
    --border-color: #e5e7eb;
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif; line-height: 1.7; color: var(--text-color); background: var(--bg-light); }
a { color: var(--text-color); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--primary-color); }
img { max-width: 100%; height: auto; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.header { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.08); position: sticky; top: 0; z-index: 100; }
.header .container { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.logo { font-size: 24px; font-weight: 700; color: var(--primary-color); letter-spacing: -0.5px; }
.logo:hover { color: var(--primary-color); }
.nav { display: flex; align-items: center; gap: 32px; }
.nav a { font-size: 15px; font-weight: 500; color: var(--text-color); position: relative; }
.nav a::after { content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px; background: var(--primary-color); transition: width 0.3s; }
.nav a:hover::after, .nav a.active::after { width: 100%; }
.nav a.active { color: var(--primary-color); }

/* 子菜单 */
.menu-item { position: relative; }
.menu-item > a::after { content: ''; }
.menu-item:hover > a { color: var(--primary-color); }
.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s;
    z-index: 1000;
}
.menu-item:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.sub-menu a {
    display: block;
    padding: 10px 20px;
    font-size: 14px;
    color: var(--text-color);
    position: relative;
}
.sub-menu a:hover {
    background: #f8fafc;
    color: var(--primary-color);
}

/* Banner */
.banner { background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%); color: #fff; padding: 100px 0; position: relative; overflow: hidden; }
.banner::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); opacity: 0.5; }
.banner .container { position: relative; z-index: 1; text-align: center; }
.banner h1 { font-size: 48px; font-weight: 800; margin-bottom: 20px; letter-spacing: -1px; }
.banner p { font-size: 20px; opacity: 0.9; max-width: 600px; margin: 0 auto; }

/* Search Box */
.search-box { background: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); max-width: 600px; margin: 30px auto 0; }
.search-box form { display: flex; gap: 10px; }
.search-box input { flex: 1; padding: 14px 20px; border: 2px solid var(--border-color); border-radius: 8px; font-size: 16px; outline: none; transition: border-color 0.3s; }
.search-box input:focus { border-color: var(--primary-color); }
.search-box button { padding: 14px 30px; background: var(--primary-color); color: #fff; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: background 0.3s; }
.search-box button:hover { background: var(--primary-hover); }

/* Section */
.section { padding: 80px 0; }
.section-title { font-size: 32px; font-weight: 700; text-align: center; margin-bottom: 15px; color: var(--text-color); }
.section-subtitle { text-align: center; color: var(--text-light); margin-bottom: 50px; font-size: 16px; }
.section-title::after { content: ''; display: block; width: 60px; height: 4px; background: var(--primary-color); margin: 15px auto 0; border-radius: 2px; }

/* Features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 50px; }
.feature-item { background: #fff; padding: 40px 30px; border-radius: 12px; text-align: center; transition: transform 0.3s, box-shadow 0.3s; }
.feature-item:hover { transform: translateY(-8px); box-shadow: 0 12px 40px rgba(0,0,0,0.1); }
.feature-icon { width: 64px; height: 64px; margin: 0 auto 20px; background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.feature-item h3 { font-size: 18px; margin-bottom: 12px; }
.feature-item p { color: var(--text-light); font-size: 14px; }

/* Article List */
.article-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 30px; }
.article-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.04); transition: transform 0.3s, box-shadow 0.3s; }
.article-card:hover { transform: translateY(-6px); box-shadow: 0 12px 32px rgba(0,0,0,0.1); }
.article-cover { display: block; height: 200px; overflow: hidden; background: #f1f5f9; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.article-card:hover .article-cover img { transform: scale(1.08); }
.article-content { padding: 24px; }
.article-content h3 { font-size: 18px; font-weight: 600; margin-bottom: 10px; line-height: 1.5; }
.article-content h3 a:hover { color: var(--primary-color); }
.article-summary { font-size: 14px; color: var(--text-light); margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.6; }
.article-meta { font-size: 13px; color: #94a3b8; display: flex; gap: 16px; }
.article-meta span { display: flex; align-items: center; gap: 4px; }

/* Category/Tag Header */
.page-header { background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%); color: #fff; padding: 60px 0; text-align: center; }
.page-header h1 { font-size: 36px; margin-bottom: 10px; }
.page-header p { font-size: 16px; opacity: 0.9; }
.category-desc { text-align: center; color: var(--text-light); margin-bottom: 40px; font-size: 16px; }

/* Search Result */
.search-result { text-align: center; color: var(--text-light); margin: 20px 0 30px; font-size: 15px; }
.search-form { max-width: 600px; margin: 0 auto 30px; display: flex; gap: 10px; }
.search-form input { flex: 1; padding: 14px 20px; border: 2px solid var(--border-color); border-radius: 8px; font-size: 16px; outline: none; }
.search-form input:focus { border-color: var(--primary-color); }
.search-form button { padding: 14px 30px; background: var(--primary-color); color: #fff; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; }
.search-form button:hover { background: var(--primary-hover); }

/* Article Detail */
.article-detail { padding: 60px 0; }
.article-header { text-align: center; margin-bottom: 40px; padding-bottom: 30px; border-bottom: 1px solid var(--border-color); }
.article-header h1 { font-size: 36px; font-weight: 700; margin-bottom: 20px; line-height: 1.3; }
.article-header .article-meta { justify-content: center; font-size: 14px; }
.article-body { background: #fff; padding: 50px; border-radius: 12px; font-size: 17px; line-height: 1.9; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.article-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 20px 0; }
.article-body h2 { font-size: 26px; margin: 1.8em 0 0.8em; font-weight: 600; }
.article-body h3 { font-size: 22px; margin: 1.6em 0 0.7em; font-weight: 600; }
.article-body h4 { font-size: 18px; margin: 1.4em 0 0.6em; font-weight: 600; }
.article-body p { margin-bottom: 1.2em; }
.article-body ul, .article-body ol { margin: 1em 0 1.2em 1.5em; }
.article-body li { margin-bottom: 0.5em; }
.article-body blockquote { border-left: 4px solid var(--primary-color); padding-left: 20px; margin: 1.5em 0; color: var(--text-light); font-style: italic; }
.article-body code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-family: 'Monaco', 'Menlo', monospace; font-size: 0.9em; }
.article-body pre { background: #1e293b; color: #e2e8f0; padding: 20px; border-radius: 8px; overflow-x: auto; margin: 1.5em 0; }
.article-body pre code { background: none; padding: 0; color: inherit; }
.article-tags { margin-top: 40px; padding-top: 30px; border-top: 1px solid var(--border-color); }
.article-tags span { font-weight: 600; margin-right: 10px; }
.article-tags a { display: inline-block; padding: 6px 14px; margin: 0 6px 8px 0; background: #f1f5f9; border-radius: 20px; font-size: 13px; transition: all 0.3s; }
.article-tags a:hover { background: var(--primary-color); color: #fff; }

/* Breadcrumb */
.breadcrumb { padding: 15px 0; font-size: 14px; color: var(--text-light); }
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary-color); }
.breadcrumb span { margin: 0 8px; color: #cbd5e1; }

/* Page Detail */
.page-detail { padding: 40px 0 60px; }
.page-detail h1 { font-size: 36px; text-align: center; margin-bottom: 40px; }
.page-body { background: #fff; padding: 50px; border-radius: 12px; font-size: 17px; line-height: 1.9; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 50px; }
.pagination a, .pagination span { padding: 10px 18px; border-radius: 8px; font-size: 14px; }
.pagination a { background: #fff; color: var(--text-color); border: 1px solid var(--border-color); transition: all 0.3s; }
.pagination a:hover { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }
.pagination .page-info { color: var(--text-light); }

/* Empty State */
.empty { text-align: center; padding: 60px 20px; color: var(--text-light); font-size: 16px; }

/* 轮播图 */
.carousel { position: relative; height: 900px; overflow: hidden; background: #000; }
.carousel-container { display: flex; height: 100%; transition: transform 0.5s ease; }
.carousel-slide { min-width: 100%; height: 100%; background-size: cover; background-position: center; position: relative; display: flex; align-items: center; justify-content: center; }
.carousel-slide::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); }
.carousel-content { position: relative; z-index: 1; text-align: center; color: #fff; max-width: 1000px; padding: 0 20px; }
.carousel-content h2 { font-size: 48px; font-weight: 700; margin-bottom: 20px; opacity: 0.8; text-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.carousel-content p { font-size: 20px; margin-bottom: 30px; opacity: 0.8; text-align: left;}
.carousel-btn { display: inline-block; padding: 14px 40px; background: var(--primary-color); color: #fff; border-radius: 30px; font-size: 16px; font-weight: 500; transition: all 0.3s; }
.carousel-btn:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(37,99,235,0.3); color: #fff; }
.carousel-dots { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 10; }
.carousel-dots .dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,0.5); cursor: pointer; transition: all 0.3s; border: none; padding: 0; }
.carousel-dots .dot.active { background: #fff; transform: scale(1.2); }
.carousel-dots .dot:hover { background: rgba(255,255,255,0.8); }

/* 轮播图搜索框 */
.carousel-search-box { position: absolute; top: 80%; left: 50%; transform: translate(-50%, -50%); z-index: 10; width: 100%; max-width: 600px; padding: 0 20px; }
.carousel-search-box form { display: flex; gap: 10px; background: rgba(255,255,255,0.3); padding: 20px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); transition: all 0.3s ease; }
.carousel-search-box:hover form { background: rgba(255,255,255,0.95); box-shadow: 0 8px 30px rgba(0,0,0,0.25); }
.carousel-search-box input { flex: 1; padding: 14px 20px; border: 2px solid rgba(229,231,235,0.8); border-radius: 8px; font-size: 16px; outline: none; transition: all 0.3s; background: rgba(255,255,255,0.9); }
.carousel-search-box:hover input { background: #fff; border-color: var(--primary-color); }
.carousel-search-box input:focus { border-color: var(--primary-color); background: #fff; }
.carousel-search-box button { padding: 14px 30px; background: var(--primary-color); color: #fff; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.3s; opacity: 0.9; }
.carousel-search-box:hover button { opacity: 1; }
.carousel-search-box button:hover { background: var(--primary-hover); }

/* 友情链接 */
.friend-links { background: #f1f5f9; padding: 40px 0; border-top: 1px solid var(--border-color); }
.friend-links h4 { font-size: 16px; color: var(--text-color); margin-bottom: 20px; }
.friend-links-list { display: flex; flex-wrap: wrap; gap: 15px 25px; }
.friend-links-list a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; background: #fff; border-radius: 6px; font-size: 14px; color: var(--text-light); border: 1px solid var(--border-color); transition: all 0.3s; }
.friend-links-list a:hover { color: var(--primary-color); border-color: var(--primary-color); box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1); }
.friend-links-list .friend-logo { width: 20px; height: 20px; object-fit: contain; border-radius: 3px; }

/* Footer */
.footer { background: #0f172a; color: #94a3b8; padding: 60px 0 30px; }
.footer .container { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer-brand h3 { color: #fff; font-size: 20px; margin-bottom: 15px; }
.footer-brand p { font-size: 14px; line-height: 1.8; }
.footer-col h4 { color: #fff; font-size: 16px; margin-bottom: 20px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 12px; }
.footer-col a { color: #94a3b8; font-size: 14px; }
.footer-col a:hover { color: #fff; }
.footer-bottom { margin-top: 40px; padding-top: 30px; border-top: 1px solid #1e293b; text-align: center; font-size: 14px; }

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 22px;
    cursor: pointer;
    z-index: 200;
}
.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s;
}
.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}
.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Responsive */
@media (max-width: 992px) {
    .features { grid-template-columns: repeat(2, 1fr); }
    .footer .container { grid-template-columns: 1fr; text-align: center; }
}
@media (max-width: 768px) {
    .header .container { flex-direction: row; height: 60px; padding: 0 20px; position: relative; }
    .mobile-menu-toggle { display: flex; }
    .nav {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        gap: 0;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        transform: translateY(-150%);
        transition: transform 0.3s ease;
        z-index: 99;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }
    .nav a::after {
        background: #FFFFFF;
    }
    .nav.active { transform: translateY(0); }
    .nav > a, .nav > .menu-item {
        width: 100%;
        padding: 12px 0;
        border-bottom: 1px solid var(--border-color);
    }
    .nav > a:last-child, .nav > .menu-item:last-child {
        border-bottom: none;
    }
    .nav > a { font-size: 16px; }
    .menu-item { position: static; }
    .menu-item.has-sub > a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 16px;
        position: relative;
        padding-right: 30px;
    }
    .menu-item.has-sub > a::after,
    .nav .menu-item.has-sub > a::after {
        content: '+' !important;
        font-size: 18px;
        transition: transform 0.3s;
        position: absolute !important;
        right: 0 !important;
        left: auto !important;
        top: 50% !important;
        bottom: auto !important;
        transform: translateY(-50%);
        width: 20px !important;
        height: 20px !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: none !important;
    }
    .menu-item.has-sub.expanded > a::after,
    .nav .menu-item.has-sub.expanded > a::after {
        content: '−' !important;
    }
    .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    .menu-item.expanded .sub-menu {
        max-height: 500px;
    }
    .sub-menu a {
        padding: 10px 0 10px 20px;
        border-left: 2px solid var(--border-color);
        margin-left: 10px;
    }
    .banner { padding: 60px 0; }
    .banner h1 { font-size: 32px; }
    .banner p { font-size: 16px; }
    .search-box { margin: 20px 15px 0; }
    .search-box form { flex-direction: column; }
    .section { padding: 50px 0; }
    .section-title { font-size: 26px; }
    .features { grid-template-columns: 1fr; }
    .article-list { grid-template-columns: 1fr; }
    .article-body, .page-body { padding: 24px; }
    .article-header h1, .page-detail h1 { font-size: 26px; }
    .search-form { flex-direction: column; }
    .pagination { flex-wrap: wrap; }
    .carousel { height: 400px; }
    .carousel-content { padding: 0 30px; }
    .carousel-content h2 { font-size: 24px; margin-bottom: 12px; }
    .carousel-content p { font-size: 14px; margin-bottom: 20px; }
    .carousel-btn { padding: 10px 28px; font-size: 14px; }
    .carousel-search-box { top: 70%; max-width: 90%; }
    .carousel-search-box form { flex-direction: column; padding: 15px; }
    .carousel-search-box input { padding: 12px 15px; font-size: 14px; }
    .carousel-search-box button { padding: 12px 20px; font-size: 14px; }
    .carousel-dots { bottom: 15px; }
    .carousel-dots .dot { width: 10px; height: 10px; }
}
