/* 全局样式重置 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.8;
    color: #2d3436;
    transition: color 0.3s;
}

/* 夜间模式样式 */
body.dark-mode {
    color: #dfe6e9;
}

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

/* 文章主体 */
.post-content { padding: 60px 0; }
.back-link { display: inline-block; margin-bottom: 30px; color: #0984e3; text-decoration: none; font-size: 0.9rem; transition: color 0.3s; }
.back-link:hover { text-decoration: underline; }

/* 防止页面切换闪屏 */
html {
    background-color: #f8f9fa;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 呼吸跳动动画 */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0.33px 0 rgba(0, 0, 0, 0.09),
                    0 0 0 0.25px rgba(0, 0, 0, 0.16),
                    0 2px 8px rgba(0, 0, 0, 0.03),
                    0 8px 50px rgba(0, 0, 0, 0.08),
                    0 1px 3px rgba(0, 0, 0, 0.04),
                    inset 0 0.5px 0 rgba(255, 255, 255, 0.9);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0.33px 0 rgba(0, 0, 0, 0.09),
                    0 0 0 0.25px rgba(0, 0, 0, 0.16),
                    0 4px 12px rgba(0, 0, 0, 0.05),
                    0 12px 60px rgba(0, 0, 0, 0.12),
                    0 2px 6px rgba(0, 0, 0, 0.06),
                    inset 0 0.5px 0 rgba(255, 255, 255, 0.95);
    }
}

/* 夜间模式呼吸跳动 */
@keyframes breatheDark {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0.33px 0 rgba(255, 255, 255, 0.06),
                    0 0 0 0.25px rgba(255, 255, 255, 0.12),
                    0 2px 8px rgba(0, 0, 0, 0.08),
                    0 8px 50px rgba(0, 0, 0, 0.35),
                    0 1px 3px rgba(0, 0, 0, 0.15),
                    inset 0 0.5px 0 rgba(255, 255, 255, 0.08);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0.33px 0 rgba(255, 255, 255, 0.06),
                    0 0 0 0.25px rgba(255, 255, 255, 0.12),
                    0 4px 12px rgba(0, 0, 0, 0.12),
                    0 12px 60px rgba(0, 0, 0, 0.45),
                    0 2px 6px rgba(0, 0, 0, 0.2),
                    inset 0 0.5px 0 rgba(255, 255, 255, 0.12);
    }
}

/* 通用呼吸跳动类 - 适用于所有内容卡片 */
.breathe-animation {
    animation: breathe 4s ease-in-out infinite;
}

/* 夜间模式呼吸跳动 */
body.dark-mode .breathe-animation, html.dark-mode .breathe-animation {
    animation: breatheDark 4s ease-in-out infinite;
}

/* 文章卡片 - iOS 26 最新风格毛玻璃效果 */
.article-card {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.75) 0%,
        rgba(255, 255, 255, 0.62) 100%
    );
    backdrop-filter: blur(50px) saturate(190%) contrast(1.05);
    -webkit-backdrop-filter: blur(50px) saturate(190%) contrast(1.05);
    box-shadow: 0 0.33px 0 rgba(0, 0, 0, 0.09),
                0 0 0 0.25px rgba(0, 0, 0, 0.16),
                0 2px 8px rgba(0, 0, 0, 0.03),
                0 10px 60px rgba(0, 0, 0, 0.08),
                0 1px 3px rgba(0, 0, 0, 0.04),
                inset 0 0.5px 0 rgba(255, 255, 255, 0.9);
    border: 0.5px solid rgba(0, 0, 0, 0.06);
    padding: 40px;
    border-radius: 24px;
    margin-bottom: 40px;
    transition: transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                background 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                box-shadow 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                border-color 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform, box-shadow;
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.article-card:hover {
    transform: translateY(-4px) translateZ(0);
    box-shadow: 0 0.33px 0 rgba(0, 0, 0, 0.09),
                0 0 0 0.25px rgba(0, 0, 0, 0.16),
                0 2px 8px rgba(0, 0, 0, 0.03),
                0 14px 70px rgba(0, 0, 0, 0.12),
                0 3px 9px rgba(0, 0, 0, 0.06),
                inset 0 0.5px 0 rgba(255, 255, 255, 0.95);
}

/* 文章头部信息 */
.post-header { margin-bottom: 40px; }
.post-header h1 { font-size: 2.5rem; line-height: 1.3; margin-bottom: 15px; color: #2d3436; transition: color 0.3s; }
.post-meta { color: #b2bec3; font-size: 0.95rem; transition: color 0.3s; }
.post-meta span { margin-right: 15px; }

/* 正文样式排版 - 关键部分 */
.entry-content { font-size: 1.1rem; color: #2d3436; transition: color 0.3s; }
.entry-content p { margin-bottom: 25px; text-align: left; }
.entry-content h2 { margin: 40px 0 20px; font-size: 1.8rem; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.entry-content h3 { margin: 30px 0 15px; font-size: 1.4rem; }

/* 代码块样式 */
.entry-content pre {
    background: #2d3436;
    color: #dfe6e9;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 25px 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
}

/* 引用样式 */
.entry-content blockquote {
    border-left: 4px solid #0984e3;
    padding: 10px 20px;
    background: #f1f2f6;
    margin: 25px 0;
    color: #636e72;
    font-style: italic;
}

.entry-content img { 
    max-width: 100% !important; 
    height: auto !important; 
    aspect-ratio: auto !important;
    object-fit: contain !important;
    border-radius: 8px; 
    margin: 20px 0; 
}
.entry-content figure {
    max-width: 100%;
    margin: 20px 0;
}
.entry-content figure img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    aspect-ratio: auto !important;
}

/* 文章底部分类标签 */
.post-tags { margin-top: 50px; padding-top: 20px; border-top: 1px solid #eee; }
.tag { display: inline-block; background: #f1f2f6; padding: 4px 12px; border-radius: 4px; font-size: 0.85rem; color: #636e72; margin-right: 10px; }

/* 评论区 */
.comment-area { margin-top: 80px; border-top: 1px solid #f1f2f6; padding-top: 40px; transition: border-top 0.3s; }
.comment-area h3 { font-size: 1.4rem; color: #2d3436; margin-bottom: 30px; transition: color 0.3s; }

/* 消息提示 */
.message { padding: 15px; border-radius: 6px; margin-bottom: 30px; }
.message.success { background: #d4edda; color: #155724; }
.message.error { background: #f8d7da; color: #721c24; }

/* 评论表单 */
.comment-form-container {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid #f1f2f6;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 50px;
    transition: background 0.3s, border-color 0.3s;
}

.input-groups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: #636e72;
    margin-bottom: 8px;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 6px;
    font-size: 0.95rem;
    outline: none;
    transition: border 0.3s;
}

.input-group textarea {
    resize: vertical;
}

.comment-form-container button {
    background: #fff;
    color: #636e72;
    border: 1px solid #636e72;
    padding: 12px 30px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.comment-form-container button:hover {
    background: #f8f9fa;
}

/* 评论关闭提示 */
.comments-closed {
    text-align: center;
    padding: 40px 0;
    color: #95a5a6;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 50px;
}

/* 评论列表 */
.comment-list {
    margin-top: 40px;
}

.comment-item {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px dashed #eee;
}

.comment-item.reply {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed #f1f2f6;
    margin-left: 60px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: #0984e3;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.user-avatar.small {
    width: 40px;
    height: 40px;
    background: #2d3436;
    font-size: 0.8rem;
}

.comment-main {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-name {
    font-weight: 700;
    color: #2d3436;
}

.author-location {
    font-size: 0.75rem;
    color: #868e96;
}

.comment-time {
    font-size: 0.8rem;
    color: #b2bec3;
}

.comment-content {
    font-size: 0.95rem;
    color: #636e72;
    line-height: 1.6;
}

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

.reply-btn {
    font-size: 0.85rem;
    color: #0984e3;
    text-decoration: none;
}

.reply-btn:hover {
    text-decoration: underline;
}

/* 无评论提示 */
.no-comments {
    text-align: center;
    padding: 60px 0;
    color: #95a5a6;
}

/* 页脚 */
footer { text-align: center; padding: 40px 0; color: #b2bec3; border-top: 1px solid #eee; margin-top: 60px; transition: color 0.3s, border-top 0.3s; }

footer a {
    color: #b2bec3;
    text-decoration: none;
}

/* 夜间模式样式 */
body.dark-mode .article-card {
    background: rgba(40, 40, 40, 0.85);
}

body.dark-mode .back-link { color: #74b9ff; }
body.dark-mode .post-header h1 { color: #dfe6e9; }
body.dark-mode .post-meta { color: #636e72; }
body.dark-mode .entry-content { color: #dfe6e9; }
body.dark-mode .entry-content h2 { border-bottom-color: #2d3436; }
body.dark-mode .entry-content blockquote { background: #2d3436; color: #b2bec3; }
body.dark-mode .tag { background: #2d3436; color: #b2bec3; }
body.dark-mode .post-tags { border-top-color: #2d3436; }
body.dark-mode .comment-area { border-top-color: #2d3436; }
body.dark-mode .comment-area h3 { color: #dfe6e9; }

/* 深色模式下评论表单容器样式 */
body.dark-mode .comment-form-container,
html.dark-mode .comment-form-container {
    background: rgba(40, 40, 40, 0.85) !important;
    border-color: #2d3436 !important;
}

/* 深色模式下评论表单元素样式 */
body.dark-mode .comment-form-container label {
    color: #b2bec3 !important;
}

body.dark-mode .comment-form-container input,
body.dark-mode .comment-form-container textarea {
    background: #1e272e !important;
    border-color: #2d3436 !important;
    color: #dfe6e9 !important;
}

body.dark-mode .comment-form-container button {
    background: #1e272e !important;
    color: #74b9ff !important;
}

body.dark-mode .comment-form-container button:hover {
    background: #2d3436 !important;
}

/* 深色模式下placeholder文本样式 */
body.dark-mode .comment-form-container input::placeholder,
body.dark-mode .comment-form-container textarea::placeholder {
    color: #636e72 !important;
}

/* 深色模式下评论列表样式 */
body.dark-mode .comment-item {
    border-bottom-color: #2d3436 !important;
}

body.dark-mode .comment-item .comment-main span {
    color: #b2bec3 !important;
}

body.dark-mode .comment-item .comment-main p {
    color: #dfe6e9 !important;
}

body.dark-mode .comment-item .comment-main a {
    color: #74b9ff !important;
}

body.dark-mode .comment-item .user-avatar {
    background: #74b9ff !important;
}

body.dark-mode footer { color: #636e72; border-top-color: #2d3436; }
body.dark-mode footer a { color: #636e72; }