/* 前端用户界面样式 */

/* 应用容器 */
.app {
    max-width: 414px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    position: relative;
    padding-bottom: 70px;
}

/* 头部 */
.header {
    background: #007AFF;
    color: white;
    padding: 15px 20px;
    /* display: flex; */
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

/* 表单容器 */
.form-container {
    padding: 30px 20px;
}

/* 搜索框 */
.search-container {
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #eee;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    background: #f8f8f8;
}

/* 筛选框 */
.filter-container {
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #eee;
}

.filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

/* 文章列表 */
.article-list {
    padding: 0 20px;
    background: #f5f5f5;
}

.article-item {
    background: white;
    margin: 10px 0;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.article-item:hover {
    transform: translateY(-2px);
}

.article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.article-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    flex: 1;
    margin-right: 10px;
}

.article-price {
    color: #FF3B30;
    font-weight: 600;
    font-size: 14px;
    background: #fff5f5;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid #ffebee;
}

.article-summary {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 10px;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
}

.article-category {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}

.article-date,
.article-views {
    font-size: 11px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-text {
    font-size: 16px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    gap: 15px;
}

.pagination-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 14px;
    color: #666;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 414px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    padding: 8px 0;
    z-index: 9999;
}

.nav-item {
    flex: 1;
    text-align: center;
    padding: 8px 5px;
    color: #666;
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s;
}

.nav-item.active {
    color: #007AFF;
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 2px;
}

.nav-label {
    font-size: 10px;
}

/* 文章详情 */
.article-detail {
    padding: 20px;
}

.article-detail-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.article-detail-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.article-detail-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #666;
}

.article-detail-content {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
}

.article-detail-content p {
    margin-bottom: 12px;
}

/* 文章内容中的图片响应式处理 */
.article-detail-content img,
.premium-content-text img,
.free-content img,
.premium-content-unlocked img,
[v-html] img,
div[v-html] img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    border-radius: 8px;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: block;
    object-fit: contain;
}

/* 确保包含图片的容器也是响应式的 */
.article-detail-content,
.premium-content-text,
.free-content,
.premium-content-unlocked {
    overflow-x: hidden;
    word-wrap: break-word;
}

/* 强制所有图片元素响应式 */
img {
    max-width: 100% !important;
    height: auto !important;
}

.paid-content-divider {
    text-align: center;
    margin: 30px 0;
    position: relative;
}

.paid-content-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
}

.paid-content-divider span {
    background: white;
    padding: 0 15px;
    color: #666;
    font-size: 14px;
}

.purchase-prompt {
    text-align: center;
    padding: 30px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.purchase-prompt-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 15px;
}

.purchase-price {
    font-size: 24px;
    font-weight: 600;
    color: #FF3B30;
    margin-bottom: 20px;
}

/* 加载状态 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: white;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007AFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 16px;
    color: #666;
    font-size: 14px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 骨架屏加载动画 */
@keyframes loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* 响应式设计 */
@media (max-width: 414px) {
    .app {
        max-width: 100%;
    }
    
    .bottom-nav {
        max-width: 100%;
    }
}

@media (min-width: 415px) {
    .app {
        box-shadow: 0 0 20px rgba(0,0,0,0.1);
    }
}