/* ======================== 全局基础样式======================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    margin: 0 !important;
    padding: 0 !important;
}

body {
    font-family: "Helvetica Neue", "微软雅黑", "Hiragino Sans GB", Arial, sans-serif;
    background-color: #f9f3ed;
    color: #5a4a42;
    line-height: 1.8;
    font-size: 16px;
}

/* 帖子页使用 html.app-home 时，body 作为 flex 容器，不需要额外 padding */
html.app-home body {
    padding: 0 !important;
    margin: 0 !important;
}

/* ======================== 顶部横条导航（与主页同款） ======================== */
.top-nav {
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(230, 126, 34, 0.12);
    margin: 0 0 1.5rem;
    padding: 0;
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-logo {
    font-size: 1.3rem;
    font-weight: bold;
    color: #e67e22;
    letter-spacing: 0.5px;
}

.nav-tabs {
    display: flex;
    gap: 2rem;
    flex: 1;
    margin-left: 3rem;
}

.nav-tabs a {
    color: #5a4a42;
    font-size: 1rem;
    padding: 0.3rem 0;
    position: relative;
}

.nav-tabs a::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #e67e22, #d35400);
    transition: width 0.3s ease;
}

.nav-tabs a:hover::after,
.nav-tabs a.active::after {
    width: 100%;
}

.nav-tabs a:hover,
.nav-tabs a.active {
    color: #e67e22;
}

.nav-user {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-user a {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.nav-user .nav-login {
    background: #fde6d2;
    color: #d35400;
}

.nav-user .nav-login:hover {
    background: #fde6d2;
    color: #b04600;
}

.nav-user .nav-register {
    background: #e67e22;
    color: white;
}

.nav-user .nav-register:hover {
    background: #d35400;
    color: white;
}

.nav-user span {
    color: #666;
    font-size: 0.9rem;
}

/* 移动端导航适配 */
@media (max-width: 768px) {
    .nav-tabs {
        gap: 1rem;
        margin-left: 1rem;
    }

    .nav-user {
        gap: 0.5rem;
    }

    .nav-user a {
        padding: 0.3rem 0.7rem;
        font-size: 0.8rem;
    }
}

a {
    text-decoration: none;
    transition: all 0.2s ease;
}

ul, li {
    list-style: none;
}

/* ======================== 文章详情页布局 ======================== */
.post-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 200px 1fr 280px;
    gap: 2rem;
}

/* ======================== 左侧标签区 ======================== */
.post-tags-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.tags-header {
    font-size: 1.1rem;
    color: #e67e22;
    font-weight: 500;
    margin-bottom: 0.8rem;
}

.post-tags-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.post-tag-item {
    padding: 0.5rem 1rem;
    background-color: #fff5eb;
    border-radius: 8px;
    color: #d35400;
    font-size: 0.9rem;
    text-align: center;
    transition: all 0.2s ease;
}

.post-tag-item:hover {
    background-color: #fde6d2;
    transform: translateX(4px);
}

.back-home {
    padding: 0.6rem 1rem;
    background-color: #e67e22;
    color: white;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

.back-home:hover {
    background-color: #d35400;
}

/* ======================== 中间正文区 ======================== */
.post-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.post-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid #f0e6dc;
    padding-bottom: 1.5rem;
}

.post-title {
    font-size: 2rem;
    color: #333;
    margin-bottom: 1rem;
}

.post-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: #999;
}

.post-body {
    font-size: 1.05rem;
    color: #444;
}

.post-body p {
    margin-bottom: 1.5rem;
}

.post-body h2 {
    color: #e67e22;
    margin: 2rem 0 1rem;
    font-size: 1.5rem;
}

.post-body img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1rem 0;
}

/* 正文超链接样式 */
.post-body a {
    color: #e67e22;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px dotted #fde6d2;
}

/* 鼠标悬停效果 */
.post-body a:hover {
    color: #d35400;
    border-bottom: 1px solid #d35400;
    transition: all 0.2s ease;
}

/* ======================== 右侧附件下载卡片 ======================== */
.post-attachments {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.attachment-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.attachment-header {
    font-size: 1.1rem;
    color: #e67e22;
    font-weight: 500;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.attachment-header i {
    font-size: 1.2rem;
}

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    background-color: #fff5eb;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.attachment-item:hover {
    background-color: #fde6d2;
    transform: translateX(2px);
}

.attachment-icon {
    font-size: 1.2rem;
    color: #d35400;
    width: 24px;
    text-align: center;
}

.attachment-info {
    flex: 1;
}

.attachment-name {
    font-size: 0.95rem;
    color: #5a4a42;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.attachment-size {
    font-size: 0.8rem;
    color: #999;
}

.attachment-download {
    color: #e67e22;
    font-size: 1.1rem;
}

.attachment-download:hover {
    color: #d35400;
}

/* ======================== 密码弹窗样式 ======================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-box {
    background: #fff;
    border-radius: 14px;
    width: 90%;
    max-width: 380px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-box h3 {
    margin-bottom: 1rem;
    color: #e67e22;
    font-size: 1.2rem;
}

.modal-box p {
    color: #666;
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.modal-box input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #eee;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 0.4rem;
    outline: none;
    transition: border 0.2s ease;
}

.modal-box input:focus {
    border-color: #e67e22;
}

.error-tip {
    color: #e74c3c;
    font-size: 0.85rem;
    height: 1.2rem;
    margin-bottom: 1rem;
    text-align: center;
}

.modal-btns {
    display: flex;
    gap: 0.6rem;
}

.modal-btns button {
    flex: 1;
    padding: 0.8rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.btn-confirm {
    background: #e67e22;
    color: white;
}

.btn-confirm:hover {
    background: #d35400;
}

/* ======================== 响应式适配 ======================== */
@media (max-width: 992px) {
    .post-detail-container {
        grid-template-columns: 1fr;
    }

    .post-tags-sidebar, .post-attachments {
        position: static;
    }

    .post-tags-list {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .post-content {
        padding: 1.5rem 1rem;
    }

    .post-title {
        font-size: 1.6rem;
    }
}

/* 深色模式与浅色模式切换按钮 */

.theme-toggle-btn {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 9999;
    padding: 12px 18px;
    border: none;
    border-radius: 12px;
    background: rgba(255,255,255,0.95);
    color: #333;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    transform: translateY(-2px);
}

/* 深色模式 */

body.dark-mode {
    background: #121212;
    color: #e8e8e8;
}

/* 中间正文卡片 */
body.dark-mode .post-content,
body.dark-mode .attachment-card,
body.dark-mode .modal-box {
    background: #1e1e1e !important;
    color: #e8e8e8 !important;
    border-color: rgba(255,255,255,0.08);
}

/* 标题 */
body.dark-mode .post-title {
    color: #ffffff !important;
}

/* 时间 */
body.dark-mode .post-meta {
    color: rgba(255,255,255,0.65) !important;
}

/* 正文 */
body.dark-mode .post-body {
    color: rgba(255,255,255,0.88) !important;
}

/* 小标题 */
body.dark-mode .post-body h2 {
    color: #ff9d3d !important;
}

/* B站视频占位符 */
.bilibili-video {
    background: linear-gradient(135deg, #00a1d6 0%, #ff9d3d 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    margin: 20px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 161, 214, 0.3);
}

.bilibili-video:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 161, 214, 0.4);
}

/* 附件名称 */
body.dark-mode .attachment-name {
    color: #ffffff !important;
}

/* 附件大小 */
body.dark-mode .attachment-size {
    color: rgba(255,255,255,0.65) !important;
}

/* 附件卡片 */
body.dark-mode .attachment-item,
body.dark-mode .post-tag-item {
    background: rgba(255,255,255,0.06) !important;
    color: #ffffff !important;
}

/* 返回主页按钮 */
body.dark-mode .back-home {
    background: #e67e22 !important;
    color: #ffffff !important;
}

/* 弹窗输入框 */
body.dark-mode .modal-box input {
    background: #2a2a2a;
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.08);
}

/* 左下角按钮 */
body.dark-mode .theme-toggle-btn {
    background: rgba(30,30,30,0.95);
    color: #ffffff;
}

/* 手机适配 */
@media (max-width: 768px) {
    .theme-toggle-btn {
        left: 15px;
        bottom: 15px;
        padding: 10px 14px;
        font-size: 13px;
    }
}

/*代码块样式*/
        .code-block {
            margin: 1.8rem 0;
            border-radius: 12px;
            background-color: #f6f8fa;
            border: 1px solid #e1e4e8;
            overflow: hidden;
            transition: all 0.2s;
        }
        .code-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.6rem 1rem;
            background-color: #eef2f5;
            border-bottom: 1px solid #e1e4e8;
            font-size: 0.85rem;
            font-family: monospace;
        }
        .code-lang {
            color: #d35400;
            font-weight: 500;
            letter-spacing: 0.5px;
        }
        .copy-btn {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 0.8rem;
            color: #5a4a42;
            padding: 4px 10px;
            border-radius: 6px;
            transition: all 0.2s;
            font-family: inherit;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }
        .copy-btn:hover {
            background-color: rgba(0,0,0,0.05);
            color: #e67e22;
        }
        .copy-btn.copied {
            color: #27ae60;
        }
        .code-content {
            overflow-x: auto;
        }
        .code-content pre {
            margin: 0;
            padding: 1.2rem;
            background-color: #f6f8fa;
            font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
            font-size: 0.9rem;
            line-height: 1.5;
            color: #24292e;
            white-space: pre-wrap;
            word-wrap: break-word;
        }
        .code-content code {
            font-family: inherit;
        }
        /* 深色模式适配代码块 */
        body.dark-mode .code-block {
            background-color: #1e1e1e;
            border-color: #2d2d2d;
        }
        body.dark-mode .code-header {
            background-color: #2c2c2c;
            border-bottom-color: #3a3a3a;
        }
        body.dark-mode .code-lang {
            color: #ff9d3d;
        }
        body.dark-mode .copy-btn {
            color: #cccccc;
        }
        body.dark-mode .copy-btn:hover {
            background-color: rgba(255,255,255,0.1);
            color: #ff9d3d;
        }
        body.dark-mode .code-content pre {
            background-color: #1e1e1e;
            color: #e8e8e8;
        }
        /* 手机端微调 */
        @media (max-width: 768px) {
            .code-header {
                padding: 0.4rem 0.8rem;
                font-size: 0.75rem;
            }
            .code-content pre {
                padding: 0.8rem;
                font-size: 0.8rem;
            }
        }

/*iframe 视频样式方案*/
/*
所有 iframe 的全局样式*
iframe {
  width: 100%;
  max-width: 800px;
  height: auto;
  aspect-ratio: 16 / 9;
  display: block;
  margin: 0 auto;
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
*/
/*针对 .video-container 容器内的 iframe */
.video-container {
  width: 100%;
  max-width: 900px;
  margin: 20px auto;
  position: relative;
}

.video-container iframe {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  display: block;
  border: none;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 悬停效果 */
.video-container iframe:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

/* 方案三：多种尺寸预设（根据场景选择）
.video-small iframe {
  max-width: 560px;
}

.video-medium iframe {
  max-width: 800px;
}

.video-large iframe {
  max-width: 1200px;
}
*/
/*
方案四：圆形/特殊形状（可选
.video-rounded iframe {
  border-radius: 50%;
  aspect-ratio: 1 / 1; } /* 正方形 */

/* =========================================
   响应式设计（移动端适配）
   ========================================= */

/* 平板设备（768px 以下） */
@media (max-width: 768px) {
  .video-container {
    max-width: 100%;
    margin: 15px auto;
  }

  .video-container iframe {
    border-radius: 12px;
  }

  /* 悬停效果在触摸屏上禁用 */
  .video-container iframe:hover {
    transform: none;
  }
}

/* 手机设备（480px 以下） */
@media (max-width: 480px) {
  .video-container iframe {
    border-radius: 8px;
  }

  .video-container {
    margin: 10px auto;
  }
}

/* 大屏幕（1200px 以上） */
@media (min-width: 1200px) {
  .video-container {
    max-width: 1000px;
  }
}

/* =========================================
   深色模式适配
   ========================================= */
@media (prefers-color-scheme: dark) {
  .video-container iframe {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }
}

/* =========================================
   工具类（方便快速使用）
   ========================================= */

/* 居中工具类 */
.video-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.video-center iframe {
  margin: 0;
}

/* 全宽视频（撑满容器） */
.video-fullwidth iframe {
  max-width: 100%;
  border-radius: 0;
}

/* 带边框的视频 */
.video-bordered iframe {
  border: 2px solid #ddd;
  box-shadow: none;
}

/* 无圆角视频 */
.video-no-radius iframe {
  border-radius: 0;
}

/* 无阴影视频 */
.video-no-shadow iframe {
  box-shadow: none;
}

/* =========================================
   懒加载占位效果
   ========================================= */
.video-container {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 16px;
  overflow: hidden;
}

/* 加载完成后移除占位背景 */
.video-container iframe {
  background: transparent;
}

/* ======================== 评论区域样式 ======================== */
.comments-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.comments-section h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 1rem;
}

.comments-list {
    margin-top: 1rem;
}

.comment-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-avatar {
    flex-shrink: 0;
}

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

.comment-body {
    flex: 1;
}

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

.comment-author {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.user-title-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 6px;
    vertical-align: middle;
}

.comment-date {
    color: #999;
    font-size: 0.85rem;
}

.comment-delete {
    color: #e74c3c;
    font-size: 0.85rem;
    text-decoration: none;
    margin-left: 0.5rem;
}

.comment-delete:hover {
    text-decoration: underline;
}

.comment-report {
    color: #999;
    font-size: 0.85rem;
    text-decoration: none;
    margin-left: 0.5rem;
}

.comment-report:hover {
    color: #e74c3c;
    text-decoration: underline;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--white, #fff);
    border-radius: 12px;
    width: 90%;
    max-width: 420px;
    padding: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    font-size: 22px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #666;
}

.modal form {
    padding: 24px;
}

.modal .form-group {
    margin-bottom: 18px;
}

.modal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
    font-size: 14px;
}

.modal .form-group select,
.modal .form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.modal .form-group select:focus,
.modal .form-group textarea:focus {
    outline: none;
    border-color: #e67e22;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
}

.modal .form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.modal .form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal .btn-danger {
    flex: 1;
    background: #e74c3c;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.modal .btn-danger:hover {
    background: #c0392b;
}

.modal .btn-secondary {
    flex: 1;
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.modal .btn-secondary:hover {
    background: #e8e8e8;
}

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

.no-comments {
    color: #999;
    text-align: center;
    padding: 1rem;
}

.comment-form {
    margin-bottom: 1.5rem;
}

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

.comment-form textarea:focus {
    outline: none;
    border-color: #e67e22;
}

.login-prompt {
    color: #666;
    text-align: center;
    padding: 1rem;
}

.login-prompt a {
    color: #e67e22;
    text-decoration: none;
}

.login-prompt a:hover {
    text-decoration: underline;
}

/* ============================================================
   桌面端 App 化 + 流畅渐入动画系统（文章详情页）
   ============================================================ */

/* App 化基础：禁用文本选择 / 图片拖拽，营造原生应用质感 */
body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-touch-callout: none;
    background-image: linear-gradient(135deg, #f9f3ed 0%, #f3ece1 100%);
    background-attachment: fixed;
    animation: app-fadeIn 0.4s ease;
}

/* 允许选择内容的区域 */
.post-body,
.comment-content,
.agreement-scroll,
.code-content pre,
input,
textarea,
select {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* 禁用图片拖拽 */
img {
    -webkit-user-drag: none;
    user-drag: none;
}
.comment-avatar img,
.attachment-download img {
    pointer-events: auto;
}

/* App 化：文章详情容器窗口化 */
.post-detail-container {
    background: rgba(255, 255, 255, 0.45);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(90, 74, 66, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 1.5rem;
}

/* ---------- 关键帧定义 ---------- */
@keyframes app-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes app-fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes app-fadeDown {
    from { opacity: 0; transform: translateY(-24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes app-fadeLeft {
    from { opacity: 0; transform: translateX(-32px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes app-fadeRight {
    from { opacity: 0; transform: translateX(32px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes app-scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes app-popIn {
    0%   { opacity: 0; transform: scale(0.8) translateY(10px); }
    60%  { opacity: 1; transform: scale(1.03) translateY(0); }
    100% { opacity: 1; transform: scale(1); }
}

/* ---------- 通用动画工具类 ---------- */
.anim-fadeIn   { animation: app-fadeIn   0.6s ease both; }
.anim-fadeUp   { animation: app-fadeUp   0.6s ease both; }
.anim-fadeDown { animation: app-fadeDown 0.6s ease both; }
.anim-fadeLeft { animation: app-fadeLeft 0.6s ease both; }
.anim-fadeRight{ animation: app-fadeRight 0.6s ease both; }
.anim-scaleIn  { animation: app-scaleIn  0.5s ease both; }
.anim-popIn    { animation: app-popIn    0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

/* ---------- 交错延迟工具类 ---------- */
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.10s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.20s; }
.delay-5 { animation-delay: 0.25s; }
.delay-6 { animation-delay: 0.30s; }
.delay-7 { animation-delay: 0.35s; }
.delay-8 { animation-delay: 0.40s; }
.delay-9 { animation-delay: 0.45s; }
.delay-10 { animation-delay: 0.50s; }

/* ---------- 滚动揭示动画 ---------- */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    filter: blur(6px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), filter 0.6s ease;
    will-change: opacity, transform;
}
.reveal.reveal-left  { transform: translateX(-32px); }
.reveal.reveal-right { transform: translateX(32px); }
.reveal.reveal-scale { transform: scale(0.92); }
.reveal.in-view {
    opacity: 1;
    transform: translate(0, 0) scale(1);
    filter: blur(0);
}

/* App 化：卡片悬停微交互 */
.post-content,
.attachment-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* App 化：按钮按下反馈 */
button:active,
.back-home:active,
.btn-confirm:active,
.btn-confirm:active {
    transform: scale(0.96) !important;
}

/* App 化：聚焦光晕 */
input:focus,
textarea:focus,
select:focus,
button:focus-visible,
a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.18);
}

/* App 化：深色模式下窗口边框 */
body.dark-mode .post-detail-container {
    background: rgba(30, 30, 30, 0.4);
    border-color: rgba(255, 255, 255, 0.04);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

/* 尊重「减少动态」无障碍偏好 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

/* ============================================================
   帖子页：锁定视口，仅内部滚动
   ============================================================ */

/* 顶部导航固定，不随内容滚动 */
html.app-home .top-nav {
    flex-shrink: 0;
}

/* 详情容器填满剩余视口高度 */
html.app-home .post-detail-container {
    flex: 1;
    min-height: 0;
    max-width: 1200px;
    width: 100%;
    margin: 0.8rem auto 0.8rem;
    overflow: hidden;
}

/* 左右栏：独立滚动 */
html.app-home .post-tags-sidebar,
html.app-home .post-attachments {
    position: static;
    top: auto;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(230, 126, 34, 0.3) transparent;
}

html.app-home .post-tags-sidebar::-webkit-scrollbar,
html.app-home .post-attachments::-webkit-scrollbar {
    width: 6px;
}

html.app-home .post-tags-sidebar::-webkit-scrollbar-thumb,
html.app-home .post-attachments::-webkit-scrollbar-thumb {
    background: rgba(230, 126, 34, 0.3);
    border-radius: 3px;
}

/* 中间正文区：独立滚动 */
html.app-home .post-content {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(230, 126, 34, 0.3) transparent;
}

html.app-home .post-content::-webkit-scrollbar {
    width: 6px;
}

html.app-home .post-content::-webkit-scrollbar-thumb {
    background: rgba(230, 126, 34, 0.3);
    border-radius: 3px;
}

/* 移动端：允许整页滚动 */
@media (max-width: 992px) {
    html.app-home,
    html.app-home body {
        height: auto;
        overflow: auto;
    }

    html.app-home .post-detail-container {
        flex: none;
        overflow: visible;
    }

    html.app-home .post-tags-sidebar,
    html.app-home .post-attachments,
    html.app-home .post-content {
        height: auto;
        overflow: visible;
    }
}

/* ============================================================
   评论输入框 & 发表评论按钮样式
   ============================================================ */

.comment-form {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.comment-form textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1.5px solid #f0e6dc;
    border-radius: 12px;
    resize: vertical;
    min-height: 90px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #5a4a42;
    background: #faf7f4;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.comment-form textarea::placeholder {
    color: #c4b8b0;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #e67e22;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.12);
}

.comment-form .btn,
.comment-form .btn-primary {
    align-self: flex-end;
    padding: 0.6rem 1.8rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.25s ease, opacity 0.2s ease;
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
    font-family: inherit;
}

.comment-form .btn:hover,
.comment-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(230, 126, 34, 0.4);
}

.comment-form .btn:active,
.comment-form .btn-primary:active {
    transform: scale(0.96);
}

/* 深色模式：评论表单 */
body.dark-mode .comment-form textarea {
    border-color: rgba(255, 255, 255, 0.1);
    background: #1a1a1a;
    color: #e8e8e8;
}

body.dark-mode .comment-form textarea::placeholder {
    color: #666;
}

body.dark-mode .comment-form textarea:focus {
    border-color: #e67e22;
    background: #222;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.15);
}

/* ============================================================
   帖子页右下角版本信息
   ============================================================ */
.post-version-badge {
    position: fixed;
    right: 1rem;
    bottom: 0.5rem;
    color: #aaa;
    font-size: 0.7rem;
    user-select: none;
    pointer-events: none;
    z-index: 50;
    letter-spacing: 0.3px;
    text-align: right;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.post-version-badge .ver-line1,
.post-version-badge .ver-line2 {
    white-space: nowrap;
}

.post-version-badge .ver-line2 {
    font-size: 0.65rem;
    opacity: 0.9;
}

body.dark-mode .post-version-badge {
    color: #555;
}