/* 微信公众号风格样式 */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #07c160;
    --primary-dark: #06ad56;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #e5e5e5;
    --link-color: #576b95;
    --code-bg: #f6f8fa;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 680px;
    margin: 0 auto;
    min-height: 100vh;
    background-color: var(--bg-color);
}

/* 头部 */
.header {
    background: linear-gradient(135deg, #512bd4 0%, #7c4dff 100%);
    padding: 40px 20px;
    text-align: center;
    color: white;
}

.logo {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
}

/* 导航标签 */
.nav-tabs {
    display: flex;
    background-color: var(--card-bg);
    padding: 0 16px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.tab-btn {
    flex: 1;
    padding: 16px 8px;
    border: none;
    background: none;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
}

.tab-btn.active {
    color: var(--primary-color);
    font-weight: 500;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* 内容区域 */
.tab-content {
    display: none;
    padding: 16px;
}

.tab-content.active {
    display: block;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 文章卡片 */
.article-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.article-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid var(--border-color);
}

.article-title {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.article-meta .date {
    color: var(--text-muted);
}

.article-meta .tags {
    display: flex;
    gap: 6px;
}

.tag {
    background-color: rgba(7, 193, 96, 0.1);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* 文章内容 */
.article-body {
    padding: 20px;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
}

.article-body h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 12px;
    color: var(--text-primary);
}

.article-body h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 10px;
}

.article-body p {
    margin-bottom: 16px;
}

.article-body strong {
    font-weight: 600;
    color: #000;
}

.article-body ul,
.article-body ol {
    margin: 12px 0;
    padding-left: 24px;
}

.article-body li {
    margin-bottom: 8px;
}

.article-body blockquote {
    background-color: #f0f9f4;
    border-left: 4px solid var(--primary-color);
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 0 8px 8px 0;
}

.article-body blockquote p {
    margin: 0;
    color: var(--text-secondary);
}

.article-body pre {
    background-color: var(--code-bg);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-size: 14px;
    line-height: 1.5;
}

.article-body code {
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    background-color: rgba(175, 184, 193, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.article-body pre code {
    background: none;
    padding: 0;
}

.article-body a {
    color: var(--link-color);
    text-decoration: none;
}

.article-body a:hover {
    text-decoration: underline;
}

.article-body hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 24px 0;
}

/* 文章底部 */
.article-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background-color: #fafafa;
}

.actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.action-btn:hover {
    background-color: var(--bg-color);
}

.action-btn.liked {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 新闻列表 */
.news-header,
.archive-header {
    text-align: center;
    padding: 20px 0;
}

.news-header h2,
.archive-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.news-desc {
    color: var(--text-muted);
    font-size: 14px;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-item {
    background-color: var(--card-bg);
    padding: 16px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s;
}

.news-item:hover {
    transform: translateY(-2px);
}

.news-item-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.news-source {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #512bd4, #7c4dff);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.news-title {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-primary);
}

.news-summary {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-left: 48px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    margin-left: 48px;
    font-size: 12px;
    color: var(--text-muted);
}

.news-category {
    background-color: var(--bg-color);
    padding: 2px 8px;
    border-radius: 4px;
}

/* 归档列表 */
.archive-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.archive-item {
    background-color: var(--card-bg);
    padding: 16px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s;
}

.archive-item:hover {
    transform: translateY(-2px);
}

.archive-item-title {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.archive-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.archive-item-tags {
    display: flex;
    gap: 6px;
}

/* 底部 */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.footer p {
    margin-bottom: 8px;
}

.footer-links a {
    color: var(--link-color);
    text-decoration: none;
}

.footer-links .divider {
    margin: 0 8px;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 24px;
    border-radius: 16px;
    width: 80%;
    max-width: 320px;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-content h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.share-options {
    display: flex;
    gap: 16px;
}

.share-option {
    flex: 1;
    padding: 16px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.share-option .icon {
    font-size: 24px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s;
    z-index: 2000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* 响应式 */
@media (max-width: 480px) {
    .container {
        max-width: 100%;
    }
    
    .article-title {
        font-size: 20px;
    }
    
    .article-body {
        font-size: 15px;
    }
}
