﻿/* =======================================
 * 文章样式 - 包含：列表、详情、评论
 * ======================================= */

/* =======================================
 * 阅读进度条
 * ======================================= */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #913500, #b45a1a, #c97a3a);
    z-index: 9999;
    transition: width 0.2s ease;
    width: 0%;
}

/* =======================================
 * 页面 - 头部
 * ======================================= */
.article-page {
    
}

.page-header {
    background: linear-gradient(135deg, #913500 0%, #b45a1a 50%, #c97a2a 100%);
    color: #ffffff;
    padding: var(--spacing-xl) 0 var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.page-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.page-title {
    font-size: var(--font-size-xxxl);
    font-weight: 700;
    color: #ffffff;
    margin-bottom: var(--spacing-sm);
    line-height: 1.3;
}

.page-description {
    font-size: var(--font-size-md);
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

/* =======================================
 * 文章列表
 * ======================================= */
.article-section {
    padding: 0 0 var(--spacing-xl);
}

/* 文章网格 */
.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}

/* 文章卡片 */
.article-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.article-link {
    display: block;
    text-decoration: none;
    color: var(--color-text);
}

.article-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f0eb, #e8ddd0);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

/* Picture element for WebP support */
.article-cover picture {
    width: 100%;
    height: 100%;
    display: block;
}

.article-card:hover .article-cover img {
    transform: scale(1.05);
}

.article-info {
    padding: var(--spacing-md);
}

.article-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.article-summary {
    font-size: var(--font-size-md);
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* 文章列表 */
.article-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}

/* 文章卡片统计 */
.article-stats {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    border-top: 1px solid var(--color-border);
    margin-top: var(--spacing-sm);
}

.article-stats .stat-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.article-stats .icon {
    opacity: 0.6;
}

/* 文章分类标签 */
.article-category {
    display: inline-block;
    padding: 2px 8px;
    background-color: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
}

/* 文章标签 */
.badge {
    display: inline-block;
    padding: 2px 8px;
    background-color: var(--color-primary);
    color: #ffffff;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.badge-outline {
    background-color: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.article-dynasty {
    display: inline-block;
    padding: 2px 8px;
    background-color: rgba(145, 53, 0, 0.08);
    color: var(--color-primary);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
}

.article-date {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* 文章卡片操作按钮 */
.article-card .article-actions {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    opacity: 0;
    transform: translateX(8px);
    transition: all var(--transition-fast);
    pointer-events: none;
}

.article-card:hover .article-actions {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.meta-category {
    padding: 2px 8px;
    background-color: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
}

.meta-date,
.meta-views,
.meta-likes,
.meta-favs,
.meta-comments {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.meta-views svg,
.meta-likes svg,
.meta-favs svg,
.meta-comments svg {
    opacity: 0.55;
    flex-shrink: 0;
}

/* =======================================
 * 文章详情页
 * ======================================= */
.article-detail-section {
    padding: 0;
    margin-top: 0;
}

.article-detail-layout {
    display: flex;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    align-items: flex-start;
}

/* When page has no sidebar (1col mode): content takes full width */
body[data-layout="1col"] .article-detail-layout {
    max-width: 900px;
}

.article-action-nav {
    flex-shrink: 0;
    width: 48px;
}

.article-main {
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

/* Middle column: sidebar */
.article-sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background-color: #ffffff;
    border-radius: 12px;
    padding: 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.article-sidebar::-webkit-scrollbar {
    display: none;
}

/* Related content (was sidebar, now inside article main) */
.article-related-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 32px;
    padding: 20px;
    background: var(--card-bg, #fafafa);
    border-radius: 10px;
    border: 1px solid var(--border-color, #eee);
}
.related-block-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary, #333);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.related-block-title svg {
    color: var(--color-primary, #913500);
    flex-shrink: 0;
}
.related-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.related-list li {
    margin-bottom: 6px;
}
.related-list li a {
    font-size: 13px;
    color: var(--color-text-secondary, #666);
    text-decoration: none;
    line-height: 1.5;
    display: block;
    padding: 2px 0;
    transition: color 0.2s;
}
.related-list li a:hover {
    color: var(--color-primary, #913500);
}

/* 右栏：TOC 浮动目录（固定在最右侧，上下通栏背景） */
.article-toc-float {
    position: fixed;
    top: 0;
    right: 0;
    width: 240px;
    height: 100vh;
    overflow-y: auto;
    background: none;
    z-index: 100;
    padding-top: 90px;
    padding-right: 16px;
    padding-left: 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.article-toc-float::-webkit-scrollbar {
    display: none;
}

.article-toc-float .toc-body {
    padding: 8px 0;
}

.article-toc-float .toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-toc-float .toc-item {
    margin-bottom: 2px;
}

/* H1 - 一级标题：最深色、最大、加粗 */
.article-toc-float .toc-item.toc-h1 a {
    font-size: 15px;
    font-weight: 700;
    color: #222;
    padding-left: 12px;
    }

/* H2 - 二级标题：中深色、中等 */
.article-toc-float .toc-item.toc-h2 a {
    font-size: 14px;
    font-weight: 500;
    color: #444;
    padding-left: 20px;
    }

/* H3 - 三级标题：浅色、小号 */
.article-toc-float .toc-item.toc-h3 a {
    font-size: 13px;
    font-weight: 400;
    color: #888;
    padding-left: 32px;
    }

.article-toc-float .toc-item a {
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.article-toc-float .toc-item a:hover {
    color: #913500;
    background: rgba(145,53,0,0.06);
}

.article-toc-float .toc-item a.active {
    color: #913500;
    background: rgba(145,53,0,0.08);
    font-weight: 600;
}

.article-detail {
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 15px;
    padding: 48px;
}

/* 文章头部 */
.article-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
}

/* 分类标签 */
.article-categories {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.category-badge {
    display: inline-block;
    padding: 4px 14px;
    background: linear-gradient(135deg, #913500, #b45a1a);
    color: #ffffff;
    border-radius: 20px;
    font-size: var(--font-size-xs);
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.category-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(145, 53, 0, 0.3);
    color: #ffffff;
}

.dynasty-badge {
    display: inline-block;
    padding: 4px 14px;
    background-color: rgba(145, 53, 0, 0.08);
    color: var(--color-primary);
    border-radius: 20px;
    font-size: var(--font-size-xs);
    font-weight: 500;
}

/* 文章标题 */
.article-header .article-title {
    font-size: 34px;
    font-weight: 700;
    color: #222;
    margin-bottom: 24px;
    line-height: 1.45;
}

/* 作者信息 */
.article-author-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: 32px;
    padding: 20px 24px;
    background-color: #fafafa;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #913500, #b45a1a);
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
}

.author-meta {
    flex: 1;
}

.author-name {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}

.publish-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.publish-date,
.reading-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* 文章统计 */
.article-header .article-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
    padding: var(--spacing-md) 0;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    border-top: 1px solid var(--color-border);
    margin-top: var(--spacing-md);
}

/* 统计栏内联字体调整 */
.font-size-inline {
    margin-left: auto;
    padding-left: 16px;
}

.font-btn-sm {
    background: none;
    border: 1px solid var(--color-border);
    color: #888888;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s;
}

.font-btn-sm:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.font-size-display {
    font-size: 12px;
    margin: 0 4px;
}

.article-header .article-stats .stat-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.article-stats .stat-item svg {
    opacity: 0.7;
}

/* 文章摘要 */
.article-summary {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, rgba(145, 53, 0, 0.04), rgba(180, 90, 26, 0.04));
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    border-left: 3px solid var(--color-primary);
}

.summary-icon {
    flex-shrink: 0;
    color: var(--color-primary);
}

.article-summary p {
    margin: 0;
    font-size: 15px;
    color: var(--color-text-secondary);
    line-height: 1.8;
}

/* 文章正文 */
.article-body {
    flex: 1;
    max-width: 800px;
    line-height: 1.9;
    font-size: 18px;
    color: #333;
}

.article-body h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 48px 0 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--color-primary);
    color: #222;
    line-height: 1.45;
}

.article-body h3 {
    font-size: 24px;
    font-weight: 600;
    margin: 36px 0 16px;
    color: #333;
    line-height: 1.5;
}

.article-body h4 {
    font-size: 20px;
    font-weight: 600;
    margin: 28px 0 12px;
    color: #444;
    line-height: 1.5;
}

.article-body p {
    margin-bottom: 24px;
    line-height: 1.9;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 24px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.article-body ul,
.article-body ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

.article-body li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.article-body blockquote {
    margin: 24px 0;
    padding: 16px 24px;
    border-left: 4px solid var(--color-primary);
    background-color: rgba(145, 53, 0, 0.04);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: #555555;
    font-style: italic;
}

.article-body pre {
    max-width: 100%;
    overflow-x: auto;
    margin: 24px 0;
    padding: 20px;
    background-color: #f5f5f5;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.6;
}

.article-body table {
    max-width: 100%;
    overflow-x: auto;
    margin: 24px 0;
    border-collapse: collapse;
    width: 100%;
}

.article-body table th,
.article-body table td {
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    text-align: left;
}

.article-body table th {
    background-color: rgba(145, 53, 0, 0.06);
    font-weight: 600;
}

/* 文章工具栏 */
.article-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) 0;
    margin-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.font-size-control {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.font-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.font-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background-color: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 14px;
    font-weight: 600;
}

.font-btn:hover {
    background-color: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

.font-size-display {
    min-width: 32px;
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.share-tools {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.share-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background-color: var(--color-bg);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.share-btn:hover {
    background-color: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

/* 文章关键词 */
.article-keywords {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.article-keywords .keywords-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.article-keywords .keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.article-keywords .keyword-tag {
    display: inline-block;
    padding: 6px 16px;
    background-color: var(--color-bg-secondary);
    color: var(--color-primary);
    border-radius: 20px;
    font-size: 14px;
    text-decoration: none;
    transition: all var(--transition-fast);
    border: 1px solid var(--color-border);
}

.article-keywords .keyword-tag:hover {
    background-color: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

/* 文章操作按钮 */
.article-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 10px 24px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    background-color: #ffffff;
    color: #888888;
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.action-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.action-btn.active {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.action-btn .count {
    font-size: var(--font-size-xs);
    color: inherit;
    opacity: 0.8;
}

.like-btn.active svg {
    fill: var(--color-primary);
}

.collect-btn.active svg {
    fill: var(--color-primary);
}

/* 文章导航 */
.article-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding: var(--spacing-lg) 0;
    margin-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    background-color: var(--color-bg-secondary);
    color: var(--color-text);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
    max-width: 45%;
}

.nav-item:hover {
    background-color: var(--color-primary);
    color: #ffffff;
}

.nav-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-prev svg,
.nav-next svg {
    flex-shrink: 0;
}

.nav-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.nav-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.nav-item:hover .nav-label {
    color: rgba(255, 255, 255, 0.8);
}

.nav-title {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =======================================
 * 评论区
 * ======================================= */
.article-comments {
    padding: var(--spacing-xl) 0;
    max-width: 800px;
    margin: 0 auto;
}

.comments-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--color-bg-secondary);
}

/* 评论表单 */
.comment-form {
    margin-bottom: var(--spacing-xl);
}

.comment-form-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.comment-form-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-form-nickname {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text);
}

.comment-form textarea {
    width: 100%;
    padding: var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background-color: var(--color-bg);
    color: var(--color-text);
    font-size: var(--font-size-md);
    font-family: var(--font-family);
    resize: vertical;
    min-height: 100px;
    margin-bottom: var(--spacing-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(145, 53, 0, 0.08);
}

.comment-form-actions {
    display: flex;
    justify-content: flex-end;
}

.comment-login-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-xxl);
    background-color: var(--color-bg-secondary, #f9f9f9);
    border-radius: 12px;
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.comment-login-prompt svg {
    color: var(--color-text-muted);
}

.comment-login-prompt p {
    font-size: var(--font-size-md);
    color: var(--color-text-secondary);
    margin: 0;
}

.comment-login-prompt a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

/* 评论列表 */
.comment-list {
    
}

.comment-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-lg) 0;
    border-bottom: 1px solid var(--color-border-light, #f0f0f0);
    transition: background-color var(--transition-fast);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--color-border-light, #f0f0f0);
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-sm);
}

.comment-author {
    font-weight: 500;
    color: var(--color-text);
}

.comment-date {
    color: var(--color-text-muted);
}

.comment-text {
    font-size: var(--font-size-md);
    color: var(--color-text);
    line-height: 1.6;
    margin-bottom: var(--spacing-sm);
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.comment-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
}

.comment-action-btn:hover {
    background-color: var(--color-bg-secondary);
    color: var(--color-primary);
    transform: translateY(-1px);
}

/* Submit button in comment form */
.comment-form-actions .btn-primary {
    padding: 10px 28px;
    font-size: 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, #913500, #b45a1a);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(145, 53, 0, 0.2);
}

.comment-form-actions .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(145, 53, 0, 0.35);
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xxl) 0;
    color: var(--color-text-muted);
}

.empty-state svg {
    margin-bottom: var(--spacing-md);
}

.empty-state p {
    font-size: var(--font-size-lg);
}


/* 侧边栏区块 */
.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-section-title svg {
    color: #913500;
    flex-shrink: 0;
}

.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-list li {
    margin-bottom: 4px;
}

.sidebar-list a {
    display: block;
    padding: 5px 10px;
    border-radius: 6px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-list a:hover {
    color: #913500;
    background: rgba(145,53,0,0.04);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    margin-bottom: var(--spacing-sm);
}

.toc-item a {
    display: block;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
    border-left: 2px solid transparent;
    line-height: 1.4;
}

.toc-item a:hover {
    background-color: var(--color-bg-secondary);
    color: var(--color-primary);
    border-left-color: var(--color-primary);
}

.toc-item.toc-h1 {
    font-weight: 600;
}

.toc-item.toc-h2 {
    padding-left: 16px;
}

.toc-item.toc-h3 {
    padding-left: 28px;
    font-size: var(--font-size-xs);
}

.toc-item.toc-h4 {
    padding-left: 40px;
    font-size: var(--font-size-xs);
}

.toc-item a.active {
    background-color: rgba(145, 53, 0, 0.1);
    color: var(--color-primary);
    border-left-color: var(--color-primary);
    font-weight: 500;
}

.toc-empty {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    text-align: center;
    padding: var(--spacing-md);
}



/* =======================================
 * Article List Page - 2-Column Grid
 * ======================================= */

/* Grid container */
.article-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* Card item - horizontal (left image, right content) */
.article-list a {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

/* Left accent bar on hover */
.article-list a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--color-primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
    transform-origin: top;
}

.article-list a:hover::before {
    transform: scaleY(1);
}

.article-list a:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 20px rgba(145, 53, 0, 0.12);
    transform: translateY(-2px);
}

/* 文章列表封面图片 */
.article-list-cover,
img.article-list-cover {
    width: 180px;
    height: 130px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}
/* picture_tag() 输出的 <picture> 容器（内联样式已含尺寸，这里只需补充 hover 效果） */
.article-list picture:hover img,
.article-list picture.article-list-cover:hover img {
    transform: scale(1.03);
}

.article-list a:hover .article-list-cover {
    transform: scale(1.03);
}

/* No cover placeholder */
.article-list .no-cover {
    width: 180px;
    height: 130px;
    background: linear-gradient(135deg, #f5f0eb, #e8e0d4);
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c0b8a8;
    transition: transform 0.3s ease;
}

.article-list a:hover .no-cover {
    transform: scale(1.03);
}

/* Content area */
.article-list-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

/* Title */
.article-list-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color 0.3s ease;
}

.article-list a:hover .article-list-title {
    color: var(--color-primary);
}

/* Summary (shown below title) */
.article-list-summary {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Meta info (bottom of card) */
.article-list-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.article-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.article-meta-item svg {
    opacity: 0.6;
}

/* Empty state */
.article-list-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-muted);
}

/* =======================================
 * Responsive - Article List
 * ======================================= */
@media (max-width: 992px) {
    .article-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .article-list a {
        flex-direction: column;
        gap: 12px;
    }

    .article-list-cover,
    .article-list .no-cover {
        width: 100%;
        height: 140px;
    }

    .article-list-title {
        font-size: 15px;
    }
}

/* =======================================
 * 响应式
 * ======================================= */

@media (max-width: 1200px) {
    .article-content {
        flex-direction: column;
    }
    
    .article-sidebar {
        width: 100%;
    }
}

@media (max-width: 768px) {
    /* 头部响应式 */
    .page-header {
        padding: var(--spacing-lg) 0 var(--spacing-md);
    }
    
    .page-title {
        font-size: var(--font-size-xxl);
    }
    
    /* 筛选栏 */
    .filter-section {
        position: static;
        padding: var(--spacing-sm) 0;
    }
    
    .filter-form {
        gap: var(--spacing-sm);
    }
    
    .filter-search {
        max-width: none;
        min-width: 0;
        flex: 1;
    }
    
    .filter-select {
        padding: 6px 28px 6px 8px;
        font-size: var(--font-size-xs);
    }
    
    /* 文章网格 */
    .article-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .article-title {
        font-size: var(--font-size-xl);
    }
    
    .article-meta {
        flex-wrap: wrap;
    }
    
    .article-summary {
        -webkit-line-clamp: 1;
    }
    
    /* 文章详情 */
    .article-detail {
        padding: var(--spacing-lg);
    }
    
    .article-header .article-title {
        font-size: var(--font-size-xl);
    }
    
    .article-author-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* 导航 */
    .article-nav {
        flex-direction: column;
    }
    
    .nav-item {
        max-width: 100%;
    }
    
    /* 工具栏 */
    .article-toolbar {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    /* 侧边栏 */
    .article-toc-sidebar {
        display: none;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: var(--font-size-xl);
    }
    
    .page-description {
        font-size: var(--font-size-sm);
    }
    
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-search {
        width: 100%;
    }
    
    .filter-item {
        width: 100%;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .article-grid {
        grid-template-columns: 1fr;
    }
    
    .article-title {
        font-size: var(--font-size-lg);
    }
    
    .article-actions {
        flex-wrap: wrap;
    }
    
    .action-btn {
        flex: 1;
        justify-content: center;
    }
}

/* =======================================
 * Pagination (smart: max ~7 pages visible)
 * ======================================= */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: var(--spacing-xl) 0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 14px;
    text-decoration: none;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    background-color: #ffffff;
    transition: all 0.2s ease;
}

.pagination a:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background-color: rgba(145,53,0,0.04);
}

.pagination span.current,
.pagination span.active {
    background: linear-gradient(135deg, #913500, #b45a1a);
    border-color: #913500;
    color: #fff;
    font-weight: 600;
}

.pagination span.dots {
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: default;
    min-width: 28px;
}

.detail-comments-card {
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 15px;
    padding: 32px 40px;
    margin-top: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

/* ===== Comment Section - Final Override (v2026062301) ===== */
/* Force correct avatar size - prevent any override */
.detail-comments-card .comment-avatar {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    border: 2px solid #f0f0f0 !important;
    display: block !important;
}

.detail-comments-card .comment-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Comment item layout */
.detail-comments-card .comment-item {
    display: flex !important;
    gap: 14px !important;
    padding: 18px 0 !important;
    border-bottom: 1px solid #f5f5f5 !important;
    align-items: flex-start !important;
}

.detail-comments-card .comment-item:last-child {
    border-bottom: none !important;
}

/* Comment content area */
.detail-comments-card .comment-content {
    flex: 1 !important;
    min-width: 0 !important;
}

/* Comment header with user info */
.detail-comments-card .comment-header {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    margin-bottom: 8px !important;
}

.detail-comments-card .comment-author {
    font-weight: 600 !important;
    font-size: 14px !important;
    color: #333 !important;
}

.detail-comments-card .comment-date {
    color: #999 !important;
    font-size: 12px !important;
    margin-left: auto !important;
}

/* Comment text body */
.detail-comments-card .comment-text {
    font-size: 15px !important;
    color: #444 !important;
    line-height: 1.7 !important;
    margin-bottom: 8px !important;
    word-break: break-word !important;
}

/* Action buttons row */
.detail-comments-card .comment-actions {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    margin-top: 4px !important;
}

.detail-comments-card .comment-action-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    padding: 4px 10px !important;
    border: none !important;
    background: transparent !important;
    color: #888 !important;
    font-size: 13px !important;
    cursor: pointer !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
}

.detail-comments-card .comment-action-btn:hover {
    background: #f5f5f5 !important;
    color: #913500 !important;
}

/* Reply section */
.detail-comments-card .comment-replies {
    margin-top: 12px !important;
    padding-left: 16px !important;
    border-left: 2px solid #f0f0f0 !important;
    margin-left: 44px !important;
}

.detail-comments-card .comment-reply-item {
    display: flex !important;
    gap: 10px !important;
    padding: 10px 0 !important;
    border-bottom: 1px solid #fafafa !important;
    align-items: flex-start !important;
}

.detail-comments-card .comment-reply-item:last-child {
    border-bottom: none !important;
}

.detail-comments-card .comment-reply-avatar {
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
    object-fit: cover !important;
}

.detail-comments-card .comment-reply-content {
    flex: 1 !important;
    min-width: 0 !important;
}

.detail-comments-card .comment-reply-header {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
    font-size: 13px !important;
    margin-bottom: 4px !important;
}

.detail-comments-card .comment-reply-text {
    font-size: 13px !important;
    color: #555 !important;
    line-height: 1.6 !important;
    margin: 0 !important;
}

.detail-comments-card .comment-reply-actions {
    display: flex !important;
    gap: 8px !important;
    margin-top: 6px !important;
    flex-wrap: wrap !important;
}

/* User level badge */
.user-level-badge {
    display: inline-block !important;
    padding: 2px 8px !important;
    border-radius: 10px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    vertical-align: middle !important;
}

/* Follow button */
.follow-btn {
    padding: 3px 10px !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    border: 1px solid #1890ff !important;
    color: #1890ff !important;
    background: #fff !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    vertical-align: middle !important;
}

.follow-btn:hover { background: #e6f7ff !important; }
.follow-btn.followed { color: #999 !important; border-color: #ddd !important; background: #f5f5f5 !important; }

/* Like/Dislike active states */
.like-btn.active { color: #1890ff !important; }
.dislike-btn.active { color: #fa8c16 !important; }
.comment-delete-btn:hover { color: #ff4d4f !important; background: #fff1f0 !important; }

/* Count numbers */
.like-count, .dislike-count {
    font-weight: 600 !important;
    min-width: 10px !important;
}

/* Inline reply form */
.inline-reply-form {
    margin-top: 12px !important;
    padding: 12px !important;
    background: #fafbfc !important;
    border-radius: 8px !important;
    border: 1px solid #eee !important;
}

.reply-textarea {
    width: 100% !important;
    padding: 8px 10px !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    resize: vertical !important;
    min-height: 50px !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
}

.inline-reply-actions {
    display: flex !important;
    gap: 8px !important;
    justify-content: flex-end !important;
    margin-top: 8px !important;
}

/* Pagination */
.comment-pagination {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin: 20px 0 12px !important;
    flex-wrap: wrap !important;
}

.page-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 32px !important;
    height: 32px !important;
    padding: 0 8px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    background: #fff !important;
    color: #333 !important;
    font-size: 13px !important;
    text-decoration: none !important;
    cursor: pointer !important;
}

.page-btn:hover { border-color: #913500 !important; color: #913500 !important; }
.page-btn.active { background: #913500 !important; color: #fff !important; border-color: #913500 !important; }


/* ===== Merged from article-enhance.css ===== */
/**
 * article-enhance.css - Article detail page enhancement styles
 * version: 202606220100
 * NOTE: all comments must be English, GBK encoding on server breaks Chinese comments
 */

/* Detail page - remove main-content side padding */
.main-content {
    padding: 0 !important;
}

/* ===== Reading Progress Bar ===== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #eee;
    z-index: 9999;
}
.reading-progress .progress-fill {
    height: 100%;
    background: #C45537;
    width: 0%;
    transition: width 0.15s ease;
}

/* ===== Article Detail Section ===== */
.article-detail-section {
    background: #f5f5f0;
    min-height: 100vh;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #aaa;
    padding: 10px 0;
}
.breadcrumb a {
    color: #888;
    text-decoration: none;
}
.breadcrumb a:hover {
    color: #C45537;
}
.breadcrumb .breadcrumb-sep {
    color: #ccc;
}
.breadcrumb .active {
    color: #555;
}

/* ===== Article Layout ===== */
.article-detail-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

/* When page is 1col (no sidebar): article content centered */
body[data-layout="1col"] .article-detail-layout {
    max-width: 900px;
}

.article-main {
    flex: 1;
    min-width: 0;
    background: transparent;
    padding: 0;
    position: relative;
}

.article-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #fafaf6;
    border-left: 1px solid #eee;
    padding: 24px 20px;
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
}

/* ===== Admin Edit Bar ===== */
.admin-edit-bar {
    margin-bottom: 12px;
}
.admin-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: #FFF5F0;
    color: #C45537;
    border: 1px solid #C45537;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
    transition: background 0.15s;
}
.admin-edit-btn:hover {
    background: #C45537;
    color: #fff;
}

/* ===== Top Meta Tags ===== */
.article-top-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.meta-tag-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.meta-label {
    font-size: 11px;
    color: #999;
    margin-right: 2px;
}
.meta-label-dynasty {
    margin-left: 8px;
}
.tag-pill {
    display: inline-block;
    padding: 3px 11px;
    font-size: 11px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    line-height: 1.5;
    transition: all 0.15s;
    cursor: pointer;
}
.tag-primary {
    background: #C45537;
    color: #fff;
}
.tag-primary:hover {
    background: #a8482e;
    color: #fff;
}
.tag-outline {
    border: 1px solid #C45537;
    color: #C45537;
    background: transparent;
}
.tag-outline:hover {
    background: #FFF5F0;
}
.tag-small {
    background: #f0f0ea;
    color: #666;
    font-size: 10px;
    padding: 2px 8px;
}
.tag-small:hover {
    background: #e8e8e0;
    color: #333;
}
.tag-add-btn {
    border: 1px dashed #bbb;
    color: #999;
    background: transparent;
    cursor: pointer;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all 0.15s;
}
.tag-add-btn:hover {
    border-color: #C45537;
    color: #C45537;
    background: #FFF5F0;
}
.tag-placeholder {
    color: #ccc;
    font-size: 11px;
}

/* ===== Article Tags Row ===== */
.article-tags-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* ===== Article Title (Enhanced) ===== */
.article-title-enhanced {
    font-size: 30px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.4;
    margin: 8px 0 16px;
}

/* ===== Stats Row ===== */
.article-stats-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 8px;
}
.stats-left {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #888;
    align-items: center;
}
.stats-left svg {
    vertical-align: middle;
    margin-right: 2px;
}
.stats-right {
    font-size: 11px;
    color: #bbb;
}
.edit-date {
    color: #bbb;
}

/* ===== Author Row (below title) ===== */
.article-author-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    margin-bottom: 4px;
    flex-wrap: nowrap;
    gap: 10px;
    min-height: 40px;
}
.author-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #555;
}
.author-avatar-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #eee;
}
.author-name-sm {
    font-weight: 500;
    color: #333;
}
.author-sep {
    color: #ccc;
    margin: 0 2px;
}
.author-category-link {
    color: #1677ff;
    text-decoration: none;
    font-size: 12px;
}
.author-category-link:hover {
    text-decoration: underline;
}

.author-dynasty-link {
    color: #666;
    text-decoration: none;
    font-size: 12px;
    padding: 1px 6px;
    background: #f5f5f5;
    border-radius: 3px;
    border: 1px solid #e8e8e8;
}
.author-dynasty-link:hover {
    color: #1677ff;
    border-color: #1677ff;
    background: #f0f7ff;
}

.author-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.author-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    color: #555;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}
.author-edit-btn:hover {
    background: #e8e8e8;
    color: #333;
}

/* ===== Summary Box ===== */
.article-summary-box {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: #fafaf6;
    border-left: 3px solid #C45537;
    border-radius: 0 8px 8px 0;
    margin-bottom: 24px;
    align-items: flex-start;
}
.summary-accent {
    width: 3px;
    background: #C45537;
    border-radius: 2px;
    flex-shrink: 0;
    align-self: stretch;
}
.summary-text {
    font-size: 15px;
    color: #555;
    line-height: 1.8;
    margin: 0;
}

/* ===== Article Body Wrapper ===== */
.article-body-wrapper {
    position: relative;
}
.article-content.enhanced-content,
.encyclopedia-content.enhanced-content {
    font-size: 17px;
    line-height: 1.9;
    color: #333;
}
.article-content.enhanced-content p,
.encyclopedia-content.enhanced-content p {
    margin-bottom: 18px;
}
.article-content.enhanced-content h2,
.encyclopedia-content.enhanced-content h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 40px 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #C45537;
    color: #222;
    line-height: 1.4;
}
.article-content.enhanced-content h3,
.encyclopedia-content.enhanced-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 32px 0 14px;
    color: #333;
    line-height: 1.5;
}
.article-content.enhanced-content h4,
.encyclopedia-content.enhanced-content h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 10px;
    color: #444;
    line-height: 1.5;
}

/* ===== Auto-link Words (Wikipedia-style) ===== */
.autolink-word {
    color: #C45537;
    cursor: pointer;
    border-bottom: 1px dashed #C45537;
    position: relative;
    font-weight: 500;
    transition: background 0.15s;
}
.autolink-word:hover {
    background: #FFF5F0;
}

/* ===== Auto-link Popup ===== */
.autolink-popup {
    position: absolute;
    z-index: 1000;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border: 1px solid #eee;
    width: 280px;
    padding: 0;
    overflow: hidden;
    animation: popupFadeIn 0.15s ease;
}
@keyframes popupFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.popup-inner {
    display: flex;
    flex-direction: column;
}
.popup-image {
    width: 100%;
    height: 90px;
    background: #f0f0ea;
    background-size: cover;
    background-position: center;
    border-radius: 10px 10px 0 0;
    flex-shrink: 0;
}
.popup-info {
    padding: 10px 12px;
}
.popup-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}
.popup-summary {
    font-size: 11px;
    color: #888;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.popup-link {
    display: block;
    padding: 8px 12px;
    font-size: 11px;
    color: #C45537;
    text-decoration: none;
    border-top: 1px solid #f0f0ea;
    text-align: right;
}
.popup-link:hover {
    background: #fafaf6;
}

/* ===== Figure with Annotations ===== */
.annotated-image-figure {
    position: relative;
    margin: 20px 0;
}
.annotated-image-figure img {
    width: 100%;
    border-radius: 8px;
    display: block;
}
.image-annotation-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}
.image-annotation-layer .anno-dot {
    pointer-events: auto;
}
.anno-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #C45537;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: transform 0.15s;
    z-index: 3;
}
.anno-dot:hover {
    transform: translate(-50%, -50%) scale(1.5);
}
.anno-dot-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}
.anno-dot:hover .anno-dot-tooltip,
.anno-dot-tooltip.visible {
    opacity: 1;
}
.image-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    font-size: 11px;
    color: #999;
}
.anno-count {
    cursor: pointer;
}
.anno-count:hover {
    color: #C45537;
}
.fullscreen-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s;
}
.fullscreen-btn:hover {
    color: #C45537;
    background: #FFF5F0;
}

/* ===== Article Gallery Grid (from [gallery] shortcode) ===== */
.article-gallery-grid {
    display: grid;
    gap: 8px;
    margin: 20px 0;
}
.article-gallery-grid img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    transition: transform 0.2s;
}
.article-gallery-grid figure:hover img {
    transform: scale(1.02);
}

/* ===== Action Bar ===== */
.article-action-bar {
    display: flex;
    gap: 8px;
    padding: 16px 0;
    margin: 24px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
}

/* ===== Floating Action Nav Sidebar (left of content, outside article card) ===== */
.article-action-nav {
    position: sticky;
    left: -56px;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 50;
    height: fit-content;
}
.action-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid #e0e0e0;
    background: #fff;
    color: #666;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}
.action-nav-btn:hover {
    border-color: #C45537;
    color: #C45537;
    background: #FFF5F0;
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(196,85,55,0.15);
}
.action-nav-btn.active {
    background: #FFF5F0;
    border-color: #C45537;
    color: #C45537;
}
.action-nav-btn svg {
    width: 20px;
    height: 20px;
}
.action-nav-count {
    font-size: 9px;
    line-height: 1;
    margin-top: 1px;
    font-weight: 600;
}
/* Text label for nav buttons (e.g. annotation, quote) */
.action-nav-label {
    font-size: 9px;
    line-height: 1;
    margin-top: 1px;
    font-weight: 500;
}
.action-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.action-pill:hover {
    border-color: #C45537;
    color: #C45537;
    background: #FFF5F0;
}
.action-pill.active {
    background: #FFF5F0;
    color: #C45537;
    border-color: #C45537;
}
.action-pill svg {
    flex-shrink: 0;
}

/* ===== Global Related Content Section ===== */
.global-related-section {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 16px;
    margin: 24px 0;
    background: #fafaf6;
}
.related-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.related-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}
.related-globe-icon {
    flex-shrink: 0;
}
.related-hint {
    font-size: 10px;
    color: #999;
    font-weight: 400;
}
.related-count {
    font-size: 11px;
    color: #999;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.rel-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    overflow: hidden;
}
.rel-card:hover {
    border-color: #C45537;
    box-shadow: 0 2px 8px rgba(196,85,55,0.1);
}
.rel-card-img {
    width: 100%;
    height: 60px;
    background: #f0f0ea;
    border-radius: 6px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    overflow: hidden;
}
.rel-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.rel-card-title {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rel-card-type {
    font-size: 9px;
    color: #C45537;
    margin-top: 4px;
    font-weight: 500;
}

/* ===== Bottom Info Row ===== */
.bottom-info-row {
    display: flex;
    gap: 16px;
    margin: 24px 0;
    align-items: flex-start;
}

/* ===== My Notes Panel ===== */
.my-notes-panel {
    flex: 1;
    background: #fafaf6;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
    min-width: 0;
}
.panel-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
}
.notes-list {
    max-height: 300px;
    overflow-y: auto;
}
.notes-empty {
    font-size: 11px;
    color: #999;
    text-align: center;
    padding: 20px 0;
}
.note-item {
    background: #fff;
    border-left: 3px solid #f5a623;
    padding: 8px 10px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 8px;
    font-size: 11px;
    color: #555;
    line-height: 1.5;
    cursor: pointer;
    transition: background 0.15s;
}
.note-item:hover {
    background: #fef9f0;
}
.note-item-header {
    font-size: 10px;
    color: #999;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.note-item-color {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}
.note-item-text {
    font-size: 11px;
    color: #555;
    line-height: 1.5;
}
.note-item-selection {
    font-size: 10px;
    color: #999;
    font-style: italic;
    margin-top: 3px;
    padding-left: 8px;
    border-left: 2px solid #eee;
}

/* ===== Reading Bookmark Panel ===== */
.reading-bookmark-panel {
    width: 220px;
    flex-shrink: 0;
    background: #fafaf6;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
}
.bookmark-content {
    /* styles */
}
.bookmark-progress {
    margin-bottom: 8px;
}
.progress-label {
    font-size: 11px;
    color: #999;
}
.progress-label strong {
    font-size: 28px;
    font-weight: 700;
    color: #C45537;
}
.progress-meta {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}
.continue-read-btn {
    width: 100%;
    background: #C45537;
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.15s;
}
.continue-read-btn:hover {
    background: #a8482e;
}
.progress-bar-wrap {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    margin: 8px 0;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: #C45537;
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}
.progress-footer {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #999;
    margin-top: 4px;
}

/* ===== Comment Form ===== */
.comment-form {
    margin-bottom: 20px;
}
.comment-form-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.comment-form-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}
.comment-form-nickname {
    font-size: 12px;
    font-weight: 500;
    color: #333;
}
.comment-form textarea {
    width: 100%;
    border: 1px solid #e0e0d8;
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
    line-height: 1.6;
    transition: border-color 0.15s;
}
.comment-form textarea:focus {
    outline: none;
    border-color: #C45537;
}
.comment-form-actions {
    text-align: right;
    margin-top: 6px;
}
.comment-form-actions .btn {
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}
.comment-login-prompt {
    text-align: center;
    padding: 24px 0;
    color: #999;
}
.comment-login-prompt svg {
    display: block;
    margin: 0 auto 8px;
    color: #ddd;
}
.comment-login-prompt a {
    color: #C45537;
    text-decoration: none;
}
.comments-title {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

/* ===== Comment Items ===== */
.comment-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f0;
}
.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e8e8e0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
    overflow: hidden;
}
.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.comment-content {
    flex: 1;
    min-width: 0;
}
.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.comment-author {
    font-size: 12px;
    font-weight: 600;
    color: #333;
}
.comment-date {
    font-size: 11px;
    color: #bbb;
}
.comment-text {
    font-size: 12px;
    color: #555;
    line-height: 1.6;
    margin: 0;
}
.comment-actions {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}
.comment-action-btn {
    background: none;
    border: none;
    font-size: 11px;
    color: #999;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 0;
    transition: color 0.15s;
}
.comment-action-btn:hover {
    color: #C45537;
}
.comment-action-btn.active {
    color: #C45537;
}

/* ===== Sidebar Sections ===== */
.sidebar-section {
    margin-bottom: 20px;
}
.sidebar-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-list li {
    font-size: 11px;
    padding: 5px 0;
    border-bottom: 1px solid #f5f5f0;
}
.sidebar-list a {
    color: #555;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}
.sidebar-list a:hover {
    color: #C45537;
}

/* ===== TOC Float (right side sticky) ===== */
.article-toc-float {
    position: sticky;
    top: 70px;
    width: 240px;
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 100;
    max-height: calc(100vh - 90px);
    overflow: hidden;
    align-self: flex-start;
    margin-left: auto;
    margin-right: 16px;
    display: flex;
    flex-direction: column;
}
.toc-float-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.toc-float-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    padding: 0 2px;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.15s;
}
.toc-float-close:hover {
    color: #333;
    background: #f0f0f0;
}
.toc-body {
    padding: 8px 0;
    overflow-y: auto;
    flex: 1;
    font-size: 11px;
}
.toc-item {
    padding: 4px 0 4px 12px;
    color: #888;
    cursor: pointer;
    border-left: 2px solid #eee;
    margin-bottom: 2px;
    transition: all 0.15s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}
.toc-item:hover {
    color: #C45537;
    border-left-color: #C45537;
    background: rgba(196,85,55,0.04);
}
.toc-item.active {
    border-left-color: #C45537;
    color: #C45537;
    font-weight: 500;
    background: rgba(196,85,55,0.06);
}

/* ===== Note Modal ===== */
.note-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.note-modal {
    background: #fff;
    border-radius: 12px;
    width: 480px;
    max-width: 90vw;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    overflow: hidden;
}
.note-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #f0f0ea;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}
.note-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.note-modal-close:hover {
    color: #333;
}
.note-selected-text {
    padding: 10px 18px;
    font-size: 12px;
    color: #888;
    background: #fafaf6;
    border-bottom: 1px solid #f0f0ea;
    font-style: italic;
    max-height: 80px;
    overflow-y: auto;
}
.note-modal textarea {
    width: 100%;
    border: none;
    padding: 14px 18px;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    color: #333;
}
.note-modal textarea:focus {
    outline: none;
}
.note-color-picker {
    display: flex;
    gap: 8px;
    padding: 8px 18px;
    border-top: 1px solid #f0f0ea;
}
.color-option {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s, transform 0.15s;
}
.color-option:hover {
    transform: scale(1.2);
}
.color-option.active {
    border-color: #333;
}
.note-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 18px 14px;
    border-top: 1px solid #f0f0ea;
}
.note-cancel-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: all 0.15s;
}
.note-cancel-btn:hover {
    background: #f5f5f0;
}
.note-save-btn {
    background: #C45537;
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
.note-save-btn:hover {
    background: #a8482e;
}

/* ===== Quote Panel ===== */
.quote-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.quote-panel {
    background: #fff;
    border-radius: 12px;
    width: 520px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}
.quote-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #f0f0ea;
    font-size: 14px;
    font-weight: 600;
}
.quote-list {
    padding: 10px 18px;
}
.quote-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f0;
    cursor: pointer;
    transition: background 0.15s;
}
.quote-item:hover {
    background: #fafaf6;
    margin: 0 -18px;
    padding: 10px 18px;
}
.quote-item-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0ea;
    border-radius: 6px;
}
.quote-item-title {
    font-size: 12px;
    font-weight: 500;
    color: #333;
}
.quote-item-desc {
    font-size: 10px;
    color: #999;
    margin-top: 2px;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .article-detail-layout {
        flex-direction: column;
    }
    .article-sidebar {
        width: 100%;
        position: static;
        border-left: none;
        border-top: 1px solid #eee;
    }
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bottom-info-row {
        flex-direction: column;
    }
    .reading-bookmark-panel {
        width: 100%;
    }
    .article-toc-float {
        display: none !important;
    }
    .article-action-nav {
        display: none;
    }
    .article-action-bar {
        display: flex;
    }
    .article-author-row {
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    .article-main {
        padding: 16px 16px 32px;
    }
    .article-title-enhanced {
        font-size: 20px;
    }
    .related-grid {
        grid-template-columns: 1fr;
    }
    .article-action-bar {
        display: flex;
        gap: 6px;
    }
    .action-pill {
        padding: 5px 10px;
        font-size: 11px;
    }
}

/* ===== Tag Modal ===== */
.tag-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.tag-modal {
    background: #fff;
    border-radius: 12px;
    padding: 0;
    min-width: 360px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    overflow: hidden;
}
.tag-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    font-size: 15px;
    font-weight: 600;
}
.tag-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}
.tag-modal-close:hover {
    color: #333;
}
.tag-modal-body {
    padding: 20px;
    display: flex;
    gap: 10px;
}
.tag-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}
.tag-input:focus {
    border-color: #C45537;
}
.tag-save-btn {
    padding: 8px 18px;
    background: #C45537;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}
.tag-save-btn:hover {
    background: #a8452e;
}
.tag-modal-hint {
    padding: 0 20px 16px;
    font-size: 12px;
    color: #999;
}

/* ===== Quote Panel ===== */
.quote-panel-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.quote-panel {
    background: #fff;
    border-radius: 12px;
    padding: 0;
    min-width: 420px;
    max-width: 92vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.quote-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    font-size: 15px;
    font-weight: 600;
}
.quote-panel-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}
.quote-selected-text {
    padding: 16px 20px;
    font-size: 14px;
    color: #555;
    background: #f9f9f9;
    border-left: 3px solid #C45537;
    margin: 16px 20px 0;
    border-radius: 0 6px 6px 0;
    line-height: 1.7;
    max-height: 200px;
    overflow-y: auto;
}
.quote-note-input {
    width: calc(100% - 40px);
    margin: 12px 20px 0;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    outline: none;
    font-family: inherit;
}
.quote-note-input:focus {
    border-color: #C45537;
}
.quote-source-input {
    width: calc(100% - 40px);
    margin: 10px 20px 0;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
}
.quote-source-input:focus {
    border-color: #C45537;
}
.quote-panel-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
}
.quote-cancel-btn {
    padding: 7px 16px;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}
.quote-save-btn {
    padding: 7px 16px;
    background: #C45537;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}
.quote-save-btn:hover {
    background: #a8452e;
}

/* ===== Note Modal ===== */
.note-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.note-modal {
    background: #fff;
    border-radius: 12px;
    padding: 0;
    min-width: 420px;
    max-width: 92vw;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    overflow: hidden;
}
.note-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    font-size: 15px;
    font-weight: 600;
}
.note-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}
.note-modal-close:hover {
    color: #333;
}
.note-selected-text {
    padding: 16px 20px;
    font-size: 14px;
    color: #555;
    background: #f9f9f9;
    border-left: 3px solid #4A90D9;
    margin: 16px 20px 0;
    border-radius: 0 6px 6px 0;
    line-height: 1.7;
    max-height: 200px;
    overflow-y: auto;
}
#noteContentInput {
    width: calc(100% - 40px);
    margin: 12px 20px 0;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    outline: none;
    font-family: inherit;
}
#noteContentInput:focus {
    border-color: #4A90D9;
}
.note-color-picker {
    display: flex;
    gap: 8px;
    padding: 12px 20px 0;
}
.note-color-picker .color-option {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
}
.note-color-picker .color-option.active {
    border-color: #333;
}
.note-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
}
.note-cancel-btn {
    padding: 7px 16px;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}
.note-save-btn {
    padding: 7px 16px;
    background: #4A90D9;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}
.note-save-btn:hover {
    background: #3a7bc0;
}

/* ========== Selection Floating Toolbar (text select popup) ========== */
.selection-toolbar {
    position: absolute;
    display: none;
    z-index: 10000;
    background: #1a1a2e;
    border-radius: 10px;
    padding: 6px 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.08);
    gap: 4px;
    align-items: center;
    opacity: 0;
    transform: translateY(6px) scale(0.96);
    transition: opacity 0.18s ease, transform 0.18s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.selection-toolbar.st-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.st-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: transparent;
    color: #e0e0e0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.15s ease;
    line-height: 1;
}
.st-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}
.st-btn:active {
    transform: scale(0.95);
}
.st-quote-btn:hover {
    color: #6ec6ff;
    background: rgba(110,198,255,0.12);
}
.st-note-btn:hover {
    color: #ffd666;
    background: rgba(255,214,102,0.12);
}
.st-close-btn {
    padding: 6px 8px;
    color: #888;
}
.st-close-btn:hover {
    color: #ccc;
    background: rgba(255,255,255,0.08);
}
.st-divider {
    width: 1px;
    height: 18px;
    background: rgba(255,255,255,0.15);
    flex-shrink: 0;
}
