/**
 * Article Content Styles
 * 文章内容排版样式
 * 
 * @package Jinguan_Electric
 */

/* ========================================
   文章容器基础样式
   ======================================== */
.article-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-dark);
}

.article-content h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 40px 0 20px;
    color: var(--text-dark);
    border-bottom: 3px solid var(--primary);
    padding-bottom: 10px;
}

.article-content h3 {
    font-size: 22px;
    font-weight: 600;
    margin: 30px 0 15px;
    color: var(--text-dark);
}

.article-content h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 25px 0 12px;
    color: var(--text-dark);
}

.article-content p {
    margin-bottom: 20px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.article-content ul,
.article-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.article-content li {
    margin-bottom: 10px;
}

/* ========================================
   信息框样式（内联样式）
   ======================================== */

/* 主要信息框 - 蓝色背景 */
.info-box-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 30px;
    border-radius: 12px;
    margin: 30px 0;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.info-box-primary h2,
.info-box-primary h3,
.info-box-primary h4 {
    color: white;
    border: none;
    margin-top: 0;
}

.info-box-primary p {
    margin-bottom: 0;
}

.info-box-primary a {
    color: white;
    text-decoration: underline;
}

/* 成功/提示框 - 绿色背景 */
.info-box-success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    padding: 20px 25px;
    border-radius: 8px;
    margin: 25px 0;
}

.info-box-success strong {
    color: #155724;
}

/* 警告框 - 黄色背景 */
.info-box-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 20px 25px;
    border-radius: 8px;
    margin: 25px 0;
}

.info-box-warning strong {
    color: #856404;
}

/* 危险/重要框 - 红色背景 */
.info-box-danger {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    padding: 20px 25px;
    border-radius: 8px;
    margin: 25px 0;
}

.info-box-danger strong {
    color: #721c24;
}

/* 信息框 - 浅蓝色背景 */
.info-box-info {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    padding: 20px 25px;
    border-radius: 8px;
    margin: 25px 0;
}

.info-box-info strong {
    color: #0c5460;
}

/* ========================================
   特色内容块
   ======================================== */

/* 引用块 */
.article-content blockquote {
    background: var(--bg-light);
    border-left: 4px solid var(--primary);
    padding: 20px 25px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

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

.article-content code {
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #e83e8c;
}

.article-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* ========================================
   表格样式
   ======================================== */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.article-content table thead {
    background: var(--primary);
    color: white;
}

.article-content table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.article-content table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
}

.article-content table tbody tr:nth-child(even) {
    background: var(--bg-light);
}

.article-content table tbody tr:hover {
    background: #e8f4f8;
}

/* ========================================
   特色列表样式
   ======================================== */

/* 图标列表 */
.icon-list {
    list-style: none;
    padding: 0;
    margin: 25px 0;
}

.icon-list li {
    padding: 12px 0 12px 35px;
    position: relative;
    border-bottom: 1px solid var(--border);
}

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

.icon-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
    font-size: 18px;
}

/* 数字列表 */
.numbered-list {
    list-style: none;
    padding: 0;
    margin: 25px 0;
    counter-reset: item;
}

.numbered-list li {
    padding: 15px 0 15px 50px;
    position: relative;
    border-bottom: 1px solid var(--border);
    counter-increment: item;
}

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

.numbered-list li:before {
    content: counter(item);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 35px;
    height: 35px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* ========================================
   图片布局
   ======================================== */

/* 图片居中 */
.image-center {
    text-align: center;
    margin: 30px 0;
}

.image-center img {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* 图片带说明 */
.image-caption {
    margin: 30px 0;
}

.image-caption img {
    width: 100%;
    border-radius: 8px;
}

.image-caption figcaption {
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
    margin-top: 10px;
    font-style: italic;
}

/* 两列图片 */
.image-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

.image-grid-2 img {
    width: 100%;
    border-radius: 8px;
}

/* 三列图片 */
.image-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

.image-grid-3 img {
    width: 100%;
    border-radius: 8px;
}

/* ========================================
   响应式调整
   ======================================== */
@media (max-width: 768px) {
    .article-content h2 {
        font-size: 24px;
    }
    
    .article-content h3 {
        font-size: 20px;
    }
    
    .info-box-primary,
    .info-box-success,
    .info-box-warning,
    .info-box-danger,
    .info-box-info {
        padding: 15px 20px;
    }
    
    .image-grid-2,
    .image-grid-3 {
        grid-template-columns: 1fr;
    }
    
    .article-content table {
        font-size: 14px;
    }
    
    .article-content table th,
    .article-content table td {
        padding: 10px;
    }
}

/* ========================================
   文章链接样式 - 加粗突出显示
   ======================================== */

/* 内链和外链统一样式 */
.article-content a,
.entry-content a,
.post-content a {
    font-weight: 700;
    color: var(--color-primary, #00d2e2);
    text-decoration: underline;
    text-decoration-color: rgba(0, 210, 226, 0.4);
    text-underline-offset: 2px;
    transition: all 0.2s ease;
}

.article-content a:hover,
.entry-content a:hover,
.post-content a:hover {
    color: var(--color-primary-hover, #00a8b5);
    text-decoration-color: var(--color-primary-hover, #00a8b5);
}

/* 外链图标提示 */
.article-content a[target="_blank"]:not(.wp-block-button__link):not(.wp-block-file__button)::after,
.entry-content a[target="_blank"]:not(.wp-block-button__link):not(.wp-block-file__button)::after {
    content: " \f08e";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.75em;
    vertical-align: super;
    margin-left: 3px;
    opacity: 0.7;
}

/* 确保按钮链接不受影响 */
.article-content .wp-block-button__link,
.entry-content .wp-block-button__link,
.article-content .wp-block-file__button,
.entry-content .wp-block-file__button {
    font-weight: inherit;
    text-decoration: none;
}

/* 信息框内的链接保持白色 */
.info-box-primary a {
    color: white !important;
    font-weight: 700;
}

.info-box-success a,
.info-box-info a {
    font-weight: 700;
}
