/**
 * AI学姐博客 - 文章内页样式
 */

/* 文章容器 */
.single-article {
    background-color: var(--bg-color);
    border-radius: 8px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.05);
    padding: 30px;
    margin-bottom: 40px;
}

/* 文章头部 */
.article-header {
    margin-bottom: 25px;
}

.article-category {
    margin-bottom: 15px;
}

.article-category a {
    background-color: var(--secondary-color);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.article-category a:hover {
    background-color: var(--hover-color);
    transform: translateY(-1px);
}

.article-title {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 20px;
    color: var(--text-color);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 25px;
    gap: 15px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.author-name {
    font-weight: 600;
    color: var(--primary-color);
}

.article-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.article-info i {
    margin-right: 5px;
    color: var(--secondary-color);
}

/* 文章摘要样式 */
.article-summary {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-color);
    margin-bottom: 30px;
    padding: 15px 20px;
    background-color: var(--secondary-soft-bg);
    border-left: 4px solid var(--secondary-color);
    border-radius: 0 5px 5px 0;
}

/* 文章内容 */
.article-content {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-color);
    margin-bottom: 30px;
}

.article-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 35px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.article-content h2::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
}

.article-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 30px 0 15px;
}

.article-content h4 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 25px 0 15px;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--link-color);
    transition: all 0.3s ease;
}

.article-content a:hover {
    color: var(--hover-color);
    border-bottom-color: var(--hover-color);
}

.article-content ul, .article-content ol {
    margin: 0 0 20px 20px;
    padding-left: 15px;
}

.article-content ul li, .article-content ol li {
    margin-bottom: 10px;
}

.article-content ul {
    list-style: none;
}

.article-content ul li::before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.article-content ol {
    list-style: none;
    counter-reset: item;
}

.article-content ol li {
    counter-increment: item;
}

.article-content ol li::before {
    content: counter(item) ". ";
    color: var(--primary-color);
    font-weight: bold;
    display: inline-block;
    width: 1.5em;
    margin-left: -1.5em;
}

.article-content blockquote {
    margin: 25px 0;
    padding: 20px 30px;
    background-color: var(--blockquote-bg);
    border-left: 4px solid var(--primary-color);
    font-style: italic;
    border-radius: 0 5px 5px 0;
}

.article-content blockquote p {
    margin: 0;
    color: var(--text-medium);
}

.note-box {
    margin: 25px 0;
    padding: 20px;
    background-color: var(--note-bg);
    border-radius: 8px;
    border: 1px solid var(--note-border);
}

.note-box h4 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.note-box p {
    margin-bottom: 0;
}

.article-updates {
    margin-top: 40px;
    padding: 15px;
    background-color: var(--updates-bg);
    border-radius: 5px;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* 文章标签 */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 30px 0;
    gap: 10px;
}

.tags-title {
    font-weight: 600;
    color: var(--text-medium);
    margin-right: 5px;
}

.tag-item {
    display: inline-block;
    padding: 5px 12px;
    background-color: var(--tag-bg);
    color: var(--tag-color);
    border-radius: 4px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tag-item:hover {
    background-color: var(--tag-hover-bg);
    color: var(--tag-hover-color);
    transform: translateY(-2px);
}

/* 文章分享 */
.article-share {
    display: flex;
    align-items: center;
    margin: 30px 0;
    gap: 15px;
}

.share-title {
    font-weight: 600;
    color: var(--text-medium);
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.share-button:hover {
    transform: translateY(-3px);
}

.share-button.weixin {
    background-color: #09BB07;
}

.share-button.weibo {
    background-color: #E6162D;
}

.share-button.twitter {
    background-color: #1DA1F2;
}

.share-button.facebook {
    background-color: #1877F2;
}

.share-button.link {
    background-color: #6c757d;
}

/* 支持作者部分 */
.support-section {
    margin: 40px 0 20px;
    padding: 25px;
    background-color: var(--bg-color);
    border-radius: 8px;
    text-align: center;
    border: 1px dashed var(--border-color);
    transition: all 0.3s ease;
}

.support-section:hover {
    border-color: var(--primary-color);
}

.support-section h3 {
    margin-top: 0;
    color: var(--text-color);
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.support-section p {
    color: var(--text-medium);
    margin-bottom: 0;
    font-size: 0.95rem;
}

.support-section a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--primary-color);
    transition: all 0.3s ease;
}

.support-section a:hover {
    border-bottom-style: solid;
}

/* 相关文章 */
.related-articles {
    margin-bottom: 50px;
}

.related-articles .section-title {
    position: relative;
    margin-bottom: 30px;
    font-size: 1.5rem;
}

.related-articles .section-title::after {
    content: "";
    display: block;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
    margin-top: 10px;
}

.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.related-articles .article-card {
    background-color: var(--bg-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.related-articles .article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.related-articles .article-content {
    padding: 20px;
    margin-bottom: 0;
}

.related-articles .article-content h4 {
    margin: 10px 0;
    font-size: 1.1rem;
}

.related-articles .article-content p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
    color: var(--text-medium);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.related-articles .article-meta {
    margin-bottom: 0;
    justify-content: flex-start;
    font-size: 0.85rem;
    color: var(--text-light);
}

.related-articles .article-meta span {
    margin-right: 15px;
}

.related-articles .article-meta i {
    margin-right: 5px;
}

.related-articles .category-tag {
    display: inline-block;
    padding: 5px 10px;
    background-color: var(--category-bg);
    color: var(--category-color);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 5px;
}

/* 代码块样式 */
.code-block {
    margin: 25px 0;
    background-color: var(--code-bg);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.code-block pre {
    margin: 0;
    padding: 20px;
    overflow-x: auto;
}

.code-block code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    display: block;
    color: var(--code-text);
    tab-size: 4;
}

/* 代码复制按钮样式 */
.copy-code-button {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.copy-code-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

.copy-code-button.copied {
    background-color: #28a745;
    color: #fff;
}

.copy-code-button.error {
    background-color: #dc3545;
    color: #fff;
}

/* 响应式样式 */
@media (max-width: 992px) {
    .article-title {
        font-size: 1.8rem;
    }
    
    .related-articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .article-header {
        text-align: center;
    }
    
    .article-content {
        font-size: 1rem;
    }
    
    .article-content h2 {
        font-size: 1.6rem;
    }
    
    .article-summary {
        font-size: 1rem;
    }
    
    .article-meta {
        justify-content: center;
    }
    
    .related-articles-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .article-title {
        font-size: 1.5rem;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .article-info {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .article-tags {
        justify-content: center;
    }
    
    .article-share {
        flex-direction: column;
    }
    
    .share-buttons {
        margin-top: 10px;
    }
    
    .support-section {
        padding: 20px 15px;
    }
}

/* 代码高亮样式 */
.language-python .keyword {
    color: var(--code-keyword);
}

.language-python .function {
    color: var(--code-function);
}

.language-python .string {
    color: var(--code-string);
}

.language-python .number {
    color: var(--code-number);
}

.language-python .comment {
    color: var(--code-comment);
}

.language-python .class {
    color: var(--code-class);
}

/* 暗黑模式适配 */
body.dark-mode .article-content code {
    background-color: var(--code-bg-dark);
    color: var(--code-text-dark);
}

body.dark-mode .note-box {
    background-color: var(--note-bg-dark);
    border-color: var(--note-border-dark);
}

/* 查找可放大的图片 */
.zoomable {
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.zoomable:hover {
    transform: scale(1.05);
}

/* 弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--bg-color);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-color);
}

.close-modal {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: var(--primary-color);
}

.modal-body {
    padding: 20px;
}

.qrcode-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#qrcode {
    width: 200px;
    height: 200px;
    margin: 20px auto;
    background-color: #fff;
    padding: 10px;
    border-radius: 5px;
}

.qrcode-container p {
    color: var(--text-medium);
    margin-top: 15px;
}

.donate-text {
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-medium);
}

.donate-options {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
}

.donate-option {
    text-align: center;
}

.donate-option img {
    width: 150px;
    height: 150px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    transition: transform 0.3s ease;
}

.donate-option img:hover {
    transform: scale(1.05);
}

.donate-option span {
    display: block;
    margin-top: 10px;
    color: var(--text-medium);
}

/* 提示条样式 */
.toast-message {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 14px;
    z-index: 1500;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast-message.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 暗黑模式适配 */
body.dark-mode .modal-content {
    background-color: var(--card-bg-dark);
    border: 1px solid var(--border-color-dark);
}

body.dark-mode .donate-text,
body.dark-mode .donate-option span {
    color: var(--text-medium-dark);
}

body.dark-mode .toast-message {
    background-color: rgba(255, 255, 255, 0.15);
} 