/* ========================================
   世界瓷都陶瓷网 - 完整样式表
   ======================================== */

/* ---------- 全局重置 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', Roboto, 'Helvetica Neue', sans-serif;
    background: #fefcf8;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- 头部导航 ---------- */
.header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo img {
    max-height: 50px;
}

.nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav ul li {
    position: relative;
}

.nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

.nav ul li a:hover,
.nav ul li a.active {
    color: #b45f2b;
}

.sub-nav {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 10px 0;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 10;
}

.nav ul li:hover .sub-nav {
    opacity: 1;
    visibility: visible;
}

.sub-nav li {
    display: block;
}

.sub-nav li a {
    display: block;
    padding: 8px 20px;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

/* ---------- 横幅 Banner ---------- */
.hero-banner {
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
}

.hero-banner img {
    width: 100%;
    height: auto;
}

/* ---------- 个人信息卡片 ---------- */
.personal-card {
    background: #f5ede2;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
}

.avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.info p {
    margin: 0;
    color: #5e4b34;
}

/* ---------- 双栏布局 ---------- */
.main-layout {
    display: flex;
    gap: 40px;
    margin: 40px 0;
}

.main-content {
    flex: 2.5;
}

.sidebar {
    flex: 1.2;
}

/* ---------- 文章卡片 ---------- */
.article-card {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.article-title {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.article-title a {
    text-decoration: none;
    color: #2c3e2f;
}

.article-title a:hover {
    color: #b45f2b;
}

.article-meta {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.article-content {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.article-thumb {
    flex-shrink: 0;
    width: 200px;
}

.article-thumb img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
}

.article-summary {
    flex: 1;
}

.read-more {
    display: inline-block;
    margin-top: 10px;
    color: #b45f2b;
    text-decoration: none;
    font-weight: 500;
}

/* ---------- 侧边栏 ---------- */
.widget {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.widget h3 {
    font-size: 1.2rem;
    border-left: 3px solid #b45f2b;
    padding-left: 12px;
    margin-bottom: 15px;
}

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

.article-list li {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.article-list li a {
    text-decoration: none;
    color: #555;
    transition: color 0.3s;
}

.article-list li a:hover {
    color: #b45f2b;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-cloud a {
    background: #f5ede2;
    padding: 5px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    color: #5e4b34;
    transition: all 0.3s;
}

.tag-cloud a:hover {
    background: #b45f2b;
    color: #fff;
}

.search-widget form {
    display: flex;
    gap: 10px;
}

.search-widget input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.search-widget button {
    padding: 10px 20px;
    background: #b45f2b;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* ---------- 分页 ---------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: #555;
    transition: all 0.3s;
}

.pagination a:hover,
.pagination .current {
    background: #b45f2b;
    color: #fff;
    border-color: #b45f2b;
}

/* ---------- 文章详情页 ---------- */
.article-detail {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    margin: 40px auto;
}

.article-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.article-header h1 {
    font-size: 2rem;
    margin-bottom: 15px;
}

/* ---------- 文章内容排版（核心） ---------- */
.article-body {
    max-width: 100%;
    overflow-x: auto;
    word-wrap: break-word;
    word-break: break-word;
}

/* 图片样式 */
.article-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 段落间距 */
.article-body p {
    margin-bottom: 1.2em;
    text-align: justify;
}

/* 标题样式 */
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
    margin: 1.5em 0 0.8em;
    font-weight: 600;
    color: #2c3e2f;
}

.article-body h1 {
    font-size: 28px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.article-body h2 {
    font-size: 24px;
    border-left: 4px solid #b45f2b;
    padding-left: 15px;
}

.article-body h3 {
    font-size: 20px;
    color: #b45f2b;
}

.article-body h4 {
    font-size: 18px;
}

/* 引用块 */
.article-body blockquote {
    background: #f8f9fa;
    border-left: 4px solid #b45f2b;
    padding: 15px 25px;
    margin: 20px 0;
    color: #555;
    font-style: normal;
}

/* 列表 */
.article-body ul,
.article-body ol {
    margin: 1em 0 1em 2em;
    padding-left: 0;
}

.article-body li {
    margin-bottom: 0.5em;
    line-height: 1.7;
}

/* 表格 - 移动端可水平滚动 */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    display: block;
    overflow-x: auto;
}

.article-body th,
.article-body td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.article-body th {
    background: #f5f5f5;
    font-weight: 600;
}

/* 加粗文字高亮 */
.article-body strong,
.article-body b {
    color: #b45f2b;
    font-weight: 700;
}

/* 链接样式 */
.article-body a {
    color: #b45f2b;
    text-decoration: none;
    border-bottom: 1px dotted #b45f2b;
}

.article-body a:hover {
    color: #8b4513;
    border-bottom-color: #8b4513;
}

/* 水平线 */
.article-body hr {
    margin: 30px 0;
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ddd, transparent);
}

/* 代码块 */
.article-body pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    margin: 20px 0;
}

.article-body code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* 文章标签 */
.article-tags {
    margin: 30px 0;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.article-tags a {
    display: inline-block;
    background: #f5ede2;
    padding: 5px 12px;
    border-radius: 20px;
    margin-left: 10px;
    text-decoration: none;
    color: #5e4b34;
}

.article-share {
    margin: 20px 0;
}

.article-share a {
    margin-left: 15px;
    text-decoration: none;
    color: #666;
}

/* 相关文章 */
.related-articles {
    margin-top: 40px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 12px;
}

.related-articles h3 {
    margin-bottom: 15px;
}

.related-articles ul {
    list-style: none;
}

.related-articles li {
    margin-bottom: 10px;
}

/* 上下篇导航 */
.article-pagination {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.article-pagination .prev,
.article-pagination .next {
    font-size: 14px;
}

/* ---------- 友情链接 ---------- */
.friend-links {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 30px auto;
    text-align: center;
}

.friend-links a {
    margin: 0 10px;
    text-decoration: none;
    color: #666;
}

/* ---------- 页脚 ---------- */
.footer {
    background: #2c3e2f;
    color: #fff;
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #b45f2b;
}

.qrcode-item {
    position: relative;
}

.qrcode-img {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    display: none;
}

.qrcode-item:hover .qrcode-img {
    display: block;
}

.qrcode-img img {
    width: 100px;
    height: 100px;
}

.copyright {
    text-align: center;
    font-size: 0.85rem;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.copyright a {
    color: #ccc;
    text-decoration: none;
}

/* ---------- 返回顶部 ---------- */
#backtop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: #b45f2b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 99;
}

#backtop.show {
    opacity: 1;
    visibility: visible;
}

#backtop a {
    color: #fff;
    font-size: 20px;
    text-decoration: none;
}

/* ---------- 移动端响应式适配 ---------- */
@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }
    
    .nav ul {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    }
    
    .nav ul.show {
        display: flex;
    }
    
    .main-layout {
        flex-direction: column;
    }
    
    .article-content {
        flex-direction: column;
    }
    
    .article-thumb {
        width: 100%;
    }
    
    .personal-card {
        flex-direction: column;
        text-align: center;
    }
    
    /* 文章详情页移动端适配 - 强制覆盖内联样式 */
    .article-detail {
        padding: 20px;
    }
    
    .article-header h1 {
        font-size: 1.5rem;
    }
    
    .article-body,
    .article-body p,
    .article-body div,
    .article-body section,
    .article-body span,
    .article-body [style*="font-size"],
    .article-body [style*="line-height"] {
        font-size: 16px !important;
        line-height: 1.7 !important;
    }
    
    .article-body h1 {
        font-size: 24px !important;
        line-height: 1.3 !important;
    }
    
    .article-body h2 {
        font-size: 20px !important;
        line-height: 1.3 !important;
    }
    
    .article-body h3 {
        font-size: 18px !important;
        line-height: 1.3 !important;
    }
    
    .article-body img {
        width: 100%;
        height: auto;
    }
    
    .article-body blockquote {
        padding: 10px 15px;
    }
    
    .article-body ul,
    .article-body ol {
        margin-left: 1.2em;
    }
    
    .article-pagination {
        flex-direction: column;
        gap: 10px;
    }
    
    .footer-links {
        gap: 15px;
    }
}

/* ---------- 平板适配 ---------- */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
    
    .main-layout {
        gap: 25px;
    }
    
    .article-title {
        font-size: 1.3rem;
    }
}

/* ---------- 打印样式 ---------- */
@media print {
    .header,
    .sidebar,
    .footer,
    .personal-card,
    .friend-links,
    .article-tags,
    .article-share,
    .related-articles,
    .article-pagination,
    #backtop {
        display: none;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .article-detail {
        box-shadow: none;
        padding: 0;
    }
    
    .article-body {
        color: #000;
    }
}
/* 广告样式 */
.ad-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.sidebar-ad {
    margin-bottom: 20px;
}

.sidebar-ad-link {
    display: block;
    margin-bottom: 15px;
}

.sidebar-ad-link img {
    width: 100%;
    border-radius: 8px;
    transition: opacity 0.3s;
}

.sidebar-ad-link img:hover {
    opacity: 0.9;
}

.article-top-ad,
.article-bottom-ad {
    text-align: center;
    margin: 20px 0;
}

.article-top-ad img,
.article-bottom-ad img {
    max-width: 100%;
    border-radius: 8px;
}

.footer-ad {
    text-align: center;
    margin: 20px auto;
    max-width: 1200px;
    padding: 0 20px;
}

.ad-text-link {
    display: inline-block;
    padding: 5px 10px;
    color: #3398cc;
    text-decoration: none;
}

.ad-text-link:hover {
    text-decoration: underline;
}