/**
 * 文章样式 - 熏习15分钟
 * Article Styles
 */

/* 文章列表 */
.posts-section {
    padding: 20px 24px;
    max-width: 600px;
    margin: 0 auto;
}

/* 文章详情 */
.article-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 32px 24px 50px;
    background: var(--bg-content);
    min-height: calc(100vh - 86px);
}

/* 纯文字文章容器 */
.article-text-only {
    padding: 24px 28px;
    background: linear-gradient(135deg, var(--bg-page) 0%, var(--bg-content) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.article-text-only .article-title {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--border-color);
}

.article-text-only .article-content {
    padding: 8px 0;
}

.article-media {
    margin-bottom: 20px;
}

.article-media video,
.article-media audio {
    width: 100%;
}

.article-audio {
    margin-bottom: 20px;
    padding: 10px 14px;
    background: var(--bg-page);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
}

.article-audio audio {
    flex: 1;
    height: 28px;
}

.audio-duration {
    font-size: var(--font-size-xs);
    color: var(--text-light);
}

/* 文章标题 */
.article-title {
    font-family: var(--font-serif);
    font-size: var(--font-size-xl);
    font-weight: 500;
    color: var(--text-dark);
    line-height: 1.6;
    letter-spacing: 0.5px;
}

/* 正文 - 优化阅读体验 */
.article-content {
    font-family: var(--font-serif);
    font-size: 16px;
    line-height: 2;
    color: var(--text-dark);
    letter-spacing: 0.3px;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    word-break: break-word;
}

.article-content p {
    margin: 12px 0;
    text-align: justify;
    text-indent: 2em;
}

.article-content h2 {
    font-family: var(--font-sans);
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: 24px 0 12px;
    letter-spacing: 0.5px;
}

.article-content h3 {
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    font-weight: 600;
    margin: 18px 0 10px;
    letter-spacing: 0.3px;
}

.article-content blockquote {
    margin: 16px 0;
    padding: 12px 16px;
    background: var(--bg-page);
    border-left: 3px solid var(--primary-color);
    font-size: 15px;
    color: var(--text-normal);
    line-height: 1.8;
}

.article-content img {
    border-radius: var(--radius-sm);
    margin: 16px 0;
}

.article-content ul, .article-content ol {
    margin: 12px 0;
    padding-left: 2em;
    line-height: 1.9;
}

.article-content li {
    margin: 6px 0;
}

.article-content a {
    color: var(--primary-color);
    border-bottom: 1px dashed var(--primary-color);
}

.article-content a:hover {
    border-bottom-style: solid;
}

/* 文章信息落款 */
.article-footer {
    margin-top: 32px;
    text-align: right;
}

.article-meta {
    font-family: var(--font-serif);
    font-size: var(--font-size-sm);
    color: var(--text-light);
    line-height: 1.8;
}

.article-meta span {
    display: block;
}

.meta-author {
    color: var(--text-normal);
}

.meta-views {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

/* 标签 */
.article-tags {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.article-tag {
    padding: 2px 7px;
    background: var(--bg-page);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    color: var(--text-light);
    transition: all var(--transition-fast);
}

.article-tag:hover {
    background: var(--primary-color);
    color: #fff;
}

/* 文章卡片（可展开） */
.article-card {
    position: relative;
    margin-bottom: 20px;
    min-height: 32px;
}

.article-expand-btn {
    position: absolute;
    right: 0;
    top: 0;
    width: 32px;
    height: 32px;
    background: var(--bg-content);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.25s ease;
    z-index: 10;
}

.article-expand-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    transform: scale(1.05);
}

.article-card-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease,
                margin-top 0.3s ease;
    opacity: 0;
    background: var(--bg-content);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    width: 100%;
}

.article-card.expanded .article-card-content {
    max-height: 2000px; /* 展开时设置足够大的高度 */
    opacity: 1;
    margin-top: 0;
}

/* 展开时隐藏右上角按钮 */
.article-card.expanded .article-expand-btn {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}

.article-content-inner {
    padding: 32px 24px;
    background: var(--bg-content);
}

/* 标题与正文浑然一体 */
.article-content-inner .article-title {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
    letter-spacing: 0.5px;
    line-height: 1.7;
    margin-bottom: 16px;
}

.article-content-inner .article-content {
    padding-top: 0;
    font-family: var(--font-serif);
    font-size: 15px;
    line-height: 1.85;
    letter-spacing: 0.3px;
    font-weight: 400;
    color: var(--text-dark);
    /* 高分屏使用亚像素渲染，字体更清晰 */
    -webkit-font-smoothing: subpixel-antialiased;
    -moz-osx-font-smoothing: auto;
}

.article-content-inner .article-content p {
    margin: 14px 0;
    text-align: justify;
}

.article-content-inner .article-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.article-content-inner .article-tags {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.article-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-top: 24px;
    width: 32px;
    height: 32px;
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.25s ease;
}

.article-collapse-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    transform: scale(1.05);
}

/* ========================================
   听曲时长信息模块
   ======================================== */

.ting-listen-info {
    margin-top: 24px;
    padding: 16px 18px;
    background: var(--bg-page);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.ting-info-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ting-info-row:first-child {
    margin-bottom: 12px;
}

/* 进度条 */
.ting-progress-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ting-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.ting-progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.ting-progress-num {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--primary-color);
    min-width: 36px;
    text-align: right;
}

/* 时长信息 */
.ting-time-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-sm);
    color: var(--text-normal);
    flex-shrink: 0;
}

.ting-time-item {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.ting-time-item em {
    font-style: normal;
    font-size: var(--font-size-xs);
    color: var(--text-light);
}

.ting-time-item strong {
    font-weight: 500;
    color: var(--text-dark);
}

.ting-time-divider {
    color: var(--text-muted);
    margin: 0 2px;
}

/* 状态行 */
.ting-status-row {
    padding-top: 12px;
    border-top: 1px dashed var(--border-light);
}

.ting-status {
    font-size: var(--font-size-sm);
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 12px;
}

.ting-status.completed {
    background: rgba(76, 175, 80, 0.12);
    color: #4CAF50;
}

.ting-status.pending {
    background: rgba(255, 152, 0, 0.12);
    color: #FF9800;
}

.ting-category-complete {
    font-size: var(--font-size-sm);
    color: var(--primary-color);
    margin-left: auto;
}

.ting-next-push {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    margin-left: auto;
}

.ting-hint {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    margin-left: auto;
}

/* 历史统计数据 */
.ting-history-stats {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-light);
}

.ting-history-item {
    font-size: var(--font-size-xs);
    color: var(--text-light);
    background: var(--bg-content);
    padding: 3px 10px;
    border-radius: 12px;
}

/* 文章完成列表 */
.ting-articles-list {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--border-light);
}

.ting-articles-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.ting-articles-title {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-dark);
}

.ting-articles-count {
    font-size: var(--font-size-xs);
    color: var(--text-light);
    background: var(--bg-content);
    padding: 2px 8px;
    border-radius: 10px;
}

.ting-articles-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ting-article-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg-content);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    text-decoration: none;
    transition: all var(--transition-fast);
    max-width: 100%;
    overflow: hidden;
}

.ting-article-item.completed {
    border: 1px solid var(--border-light);
    color: var(--text-normal);
}

.ting-article-item.completed:hover {
    border-color: var(--primary-color);
    background: rgba(139, 115, 85, 0.04);
}

.ting-article-item.pending {
    opacity: 0.6;
    cursor: not-allowed;
    border: 1px dashed var(--border-color);
    color: var(--text-light);
}

.ting-article-index {
    width: 18px;
    height: 18px;
    background: var(--bg-page);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    flex-shrink: 0;
}

.ting-article-item.completed .ting-article-index {
    background: var(--primary-color);
    color: #fff;
}

.ting-article-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.ting-article-check {
    color: #4CAF50;
    flex-shrink: 0;
}

.ting-article-lock {
    font-size: 10px;
    flex-shrink: 0;
}
