/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: #F08080;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.8;
}

/* 布局容器 */
.mmm {
    width: 90%;
    max-width: 1200px;
    margin: 2rem auto;
    display: flex;
    gap: 2rem;
}

/* 面包屑导航 */
.breadcrumb-container {
    width: 90%;
    max-width: 1200px;
    margin: 1.5rem auto 1rem;
}

.breadcrumb {
    background: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.breadcrumb ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
}

.breadcrumb li {
    margin-right: 1rem;
    font-size: 0.9rem;
    color: #64748b;
    position: relative;
}

.breadcrumb li:not(:first-child)::before {
    content: "/";
    position: absolute;
    left: -0.7rem;
    color: #cbd5e1;
}

.breadcrumb .active {
    color: #334155;
    font-weight: 500;
}

/* 主要内容区 */
.book-details-page {
    flex: 1;
    background: #fff;
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.content-wrapper {
    padding: 1rem 0;
    border-bottom: 1px solid red;
}

h2 {
    font-size: 1.75rem;
    color: #1e293b;
    margin-bottom: 1rem;
    line-height: 1.3;
    font-weight: 600;
}

.ppt-container {
    padding: 1.5rem 0;
    margin-top: 1rem;
}

/* 文章内容样式 */
#article-content {
    line-height: 1.8 !important;
    font-size: 16px;
    color: #333;
    text-align: justify;
}

#article-content div {
    line-height: inherit !important;
    margin-bottom: 1em;
}

#article-content p {
    line-height: inherit !important;
    margin-bottom: 1em;
    /*text-indent: 2em;*/
}

#article-content ul,
#article-content ol {
    line-height: inherit !important;
    margin-bottom: 1em;
    padding-left: 2em;
}

#article-content li {
    line-height: inherit !important;
    margin-bottom: 0.5em;
}

/* 图片样式 */
#article-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 1.5em auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: zoom-in;
    transition: all 0.3s ease;
}

#article-content img:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* 图片标题样式 */
#article-content img + br + span,
#article-content img + span {
    display: block;
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-top: -1em;
    margin-bottom: 1.5em;
    font-style: italic;
}

/* 响应式图片容器 */
#article-content .image-container {
    text-align: center;
    margin: 1.5em 0;
}

/* 多图排列样式 */
#article-content .image-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 1.5em 0;
    flex-wrap: wrap;
}

#article-content .image-item {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
    text-align: center;
}

#article-content .image-item img {
    margin: 0;
}

/* 大图和小图的不同样式 */
#article-content img[width*="100"] {
    width: 100% !important;
}

#article-content img[width*="50"] {
    max-width: 50% !important;
}

#article-content img[width*="30"] {
    max-width: 30% !important;
}

/* 图片对齐样式 */
#article-content img[style*="float: left"],
#article-content img[align="left"] {
    float: left;
    margin: 0 1em 1em 0;
    max-width: 50% !important;
}

#article-content img[style*="float: right"],
#article-content img[align="right"] {
    float: right;
    margin: 0 0 1em 1em;
    max-width: 50% !important;
}

#article-content img[style*="margin: auto"],
#article-content img[align="center"] {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* 清除浮动 */
#article-content::after {
    content: "";
    display: table;
    clear: both;
}

/* 图片模态框样式优化 */
#imageModal {
    background-color: rgba(0, 0, 0, 0.9);
}

#imageModal .modal-content {
    max-height: 80vh;
    max-width: 90vw;
    object-fit: contain;
}

#imageModal #caption {
    color: white;
    text-align: center;
    padding: 10px;
    font-size: 16px;
}

/* 表格样式 */
#article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#article-content table th,
#article-content table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

#article-content table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

/* 链接样式 */
#article-content a {
    color: #007bff;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

#article-content a:hover {
    color: #0056b3;
    border-bottom-color: #0056b3;
}

/* 引用块样式 */
#article-content blockquote {
    border-left: 4px solid red;
    background-color: #f8f9fa;
    padding: 1em 1.5em;
    margin: 1.5em 0;
    font-style: italic;
    color: #555;
}

/* 代码块样式 */
#article-content pre,
#article-content code {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 0.5em;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

#article-content pre {
    padding: 1em;
    overflow-x: auto;
}

/* 横线样式 */
#article-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        #ddd 20%,
        #bbb 50%,
        #ddd 80%,
        transparent 100%);
    margin: 2.5em auto;
    width: 100%;
}

#article-content div {
    position: relative;
}

#article-content div:has(> br + br)::after {
    content: "";
    display: block;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ddd, transparent);
    margin: 2em 0;
    width: 100%;
}

/* 装饰性横线 */
#article-content .divider {
    border: none;
    height: 1px;
    background-image: linear-gradient(to right,
        rgba(0,0,0,0),
        rgba(0,0,0,0.3),
        rgba(0,0,0,0));
    margin: 2em 0;
}

#article-content .divider-dotted {
    border: none;
    height: 1px;
    background: repeating-linear-gradient(90deg,
        #ddd, #ddd 2px, transparent 2px, transparent 6px);
    margin: 2em 0;
}

/* 章节分隔横线 */
#article-content hr.chapter-divider {
    height: 4px;
    background:red;
    border-radius: 2px;
    margin: 3em auto;
    width: 100%;
    position: relative;
}

#article-content hr.chapter-divider::before {
    content: "❦";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 0 15px;
    color: red;
    font-size: 18px;
}

/* 文章信息栏 */
.social-iconss {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-top: 1rem;
}

.info-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: #64748b;
}

.author-name {
    font-weight: 500;
    color: red;
}

.read-count {
    background: #f1f5f9;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
}

.icon-containers {
    width: 2.5rem;
    height: 2.5rem;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.QQWEIX{
    display: flex;
    gap: 2rem;
}

.icon-containers img {
    width: 1.2rem;
    height: 1.2rem;
}

#wechatQrCodeContainer,
#qqQrCodeContainer {
    position: absolute;
    bottom: 3.5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 10;
}

/* 侧边栏 */
.account-summary {
    width: 320px;
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 1rem;
    height: fit-content;
}

.avatar-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.avatar-circle {
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.username {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.bio {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.account-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
    background-color: whitesmoke;
    border-radius: 10px;
    padding: 10px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

.stat-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.follow-button,
.message-button {
    flex: 1;
    padding: 0.6rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-size: 0.9rem;
}

.follow-button {
    background: red;
    color: white;
}

.message-button {
    background: #475569;
    color: white;
}

.divider {
    height: 1px;
    background: #e2e8f0;
    margin: 1.5rem 0;
}

/* 互动区域 */
.interaction-area {
    margin-top: 2rem;
    padding: 1.5rem 0;
    border-top: 0.5px solid red;
}

.interaction-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.interaction-buttons button {
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.interaction-buttons button:hover {
    background: #f1f5f9;
}

.interaction-buttons button.liked {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}

.interaction-buttons button.favorited {
    color: #ea580c;
    border-color: #fed7aa;
    background: #fff7ed;
}

.interaction-buttons button.followed {
    color: #059669;
    border-color: #a7f3d0;
    background: #ecfdf5;
}

/* 评论区域 */
.comments-section {
    padding: 1rem;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.comments-section h4 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #1e293b;
    display: flex;
    align-items: center;
}

.comments-count {
    margin-left: 0.5rem;
    background: #e2e8f0;
    border-radius: 1rem;
    padding: 0.1rem 0.75rem;
    font-size: 0.9rem;
    color: #64748b;
}

.comment-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.comment-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.comment-user img {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    margin-left: 3.25rem;
    line-height: 1.5;
    color: #334155;
    font-size: 0.95rem;
}

.comment-meta {
    margin-left: 3.25rem;
    font-size: 0.85rem;
    color: #94a3b8;
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
}

.comment-meta .reply-btn {
    color: red;
    cursor: pointer;
}

.comment-reply {
    margin-left: 3.25rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    margin-top: 1rem;
    border-left: 3px solid #cbd5e1;
}

.no-comments {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
    font-style: italic;
}

.comment-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.submit-comment {
    background: red;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.submit-comment:hover {
    background: red;
}

.submit-comment:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

/* 评论表单样式 */
#comment-form {
    display: none;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

#comment-form.show {
    display: block;
}

.comment-actions {
    margin-top: 10px;
    text-align: right;
}

/* 回复表单 */
.reply-form {
    margin-left: 3.25rem;
    margin-top: 1rem;
}

.reply-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    font-size: 0.95rem;
}

.reply-form button {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
}

.submit-reply {
    background: red;
    color: white;
    border: none;
}

.cancel-reply {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

/* 回复列表 */
.replies-container {
    margin-left: 3.25rem;
    margin-top: 1rem;
}

.reply-content {
    margin-left: 2.75rem;
    line-height: 1.5;
    color: #334155;
    font-size: 0.9rem;
}

/* 提示消息样式 */
.toast-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 1000;
    display: none;
    font-size: 14px;
}

/* 按钮状态样式 */
.like-btn.liked,
.favorite-btn.favorited {
    background-color: #e6f7ff !important;
    color: red !important;
    border-color: #91d5ff !important;
}

.like-btn.liked .action-text,
.favorite-btn.favorited .action-text {
    color: red;
    font-weight: 500;
}

/* 禁用状态样式 */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 交互反馈 */
.like-btn:hover, .favorite-btn:hover, .follow-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.like-btn:active, .favorite-btn:active, .follow-button:active {
    transform: translateY(0);
}

/* 移动端图片优化 */
@media (max-width: 768px) {
    #article-content img {
        margin: 1em auto;
        border-radius: 6px;
    }

    #article-content .image-row {
        flex-direction: column;
        gap: 10px;
    }

    #article-content .image-item {
        min-width: 100%;
        max-width: 100%;
    }

    #article-content img[style*="float: left"],
    #article-content img[style*="float: right"],
    #article-content img[align="left"],
    #article-content img[align="right"] {
        float: none;
        margin: 1em auto;
        max-width: 100% !important;
    }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .mmm {
        flex-direction: column;
    }

    .account-summary {
        width: 100%;
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    .mmm {
        width: 95%;
    }

    .book-details-page,
    .account-summary {
        padding: 1.25rem;
    }

    .interaction-buttons {
        flex-wrap: wrap;
    }

    .info-bar {
        flex-wrap: wrap;
    }
}