* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2em;
    font-weight: 600;
    flex: 1;
}

.datetime {
    font-size: 16px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 6px;
    backdrop-filter: blur(10px);
    font-family: 'Courier New', monospace;
}

/* 国家导航栏 */
.country-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.country-nav::-webkit-scrollbar {
    width: 6px;
}

.country-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.country-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.country-link {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.country-link:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* 语言切换 */
.lang-switch {
    position: absolute;
    top: 20px;
    right: 20px;
}

.lang-switch form {
    display: inline;
}

.lang-switch button {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-switch button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.search-box {
    max-width: 500px;
    margin: 0 auto;
}

.search-box form {
    display: flex;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 12px 18px;
    border: none;
    border-radius: 20px;
    font-size: 15px;
    outline: none;
    transition: box-shadow 0.3s;
}

.search-box input:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.search-box button {
    padding: 12px 24px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.search-box button:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.back-link {
    display: inline-block;
    margin-top: 15px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.back-link:hover {
    color: #ffcccb;
}

main {
    padding: 30px 20px;
}

/* 信息流样式 */
.feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feed-item {
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
}

.feed-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: #667eea;
}

/* 信息流头部 */
.feed-header {
    background: linear-gradient(to right, #f8f9fa, #ffffff);
    padding: 20px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feed-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.feed-actions {
    display: flex;
    gap: 10px;
}

.action-link {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
}

.action-link:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 完整内容容器 */
.feed-content {
    padding: 20px;
    overflow-x: auto;
}

.feed-content * {
    max-width: 100%;
}

/* Markdown 样式 */
.feed-content h1,
.feed-content h2,
.feed-content h3,
.feed-content h4,
.feed-content h5,
.feed-content h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

.feed-content h1 {
    font-size: 28px;
    border-bottom: 2px solid #e8e8e8;
    padding-bottom: 8px;
}

.feed-content h2 {
    font-size: 24px;
    border-bottom: 1px solid #e8e8e8;
    padding-bottom: 6px;
}

.feed-content h3 {
    font-size: 20px;
}

.feed-content h4 {
    font-size: 18px;
}

.feed-content h5 {
    font-size: 16px;
}

.feed-content h6 {
    font-size: 14px;
    color: #666;
}

.feed-content p {
    margin: 16px 0;
    line-height: 1.7;
    color: #333;
}

.feed-content ul,
.feed-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.feed-content li {
    margin: 8px 0;
    line-height: 1.6;
}

.feed-content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #e74c3c;
}

.feed-content pre {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
    margin: 16px 0;
}

.feed-content pre code {
    background: none;
    padding: 0;
    color: #333;
}

.feed-content blockquote {
    border-left: 4px solid #667eea;
    padding: 10px 16px;
    margin: 16px 0;
    background: #f8f9fa;
    color: #666;
    font-style: italic;
}

.feed-content blockquote p {
    margin: 0;
}

.feed-content a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.feed-content a:hover {
    border-bottom-color: #667eea;
}

.feed-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    overflow-x: auto;
}

.feed-content th,
.feed-content td {
    border: 1px solid #e8e8e8;
    padding: 12px;
    text-align: left;
}

.feed-content th {
    background: #f8f9fa;
    font-weight: 600;
}

.feed-content tr:nth-child(even) {
    background: #fafafa;
}

.feed-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 16px 0;
}

.feed-content hr {
    border: none;
    border-top: 1px solid #e8e8e8;
    margin: 24px 0;
}

/* 预览文本样式（用于搜索结果） */
.feed-preview {
    color: #666;
    line-height: 1.6;
    font-size: 14px;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.match-text {
    background: #f0f7ff;
    border-left: 3px solid #667eea;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #555;
    line-height: 1.6;
    border-radius: 0 4px 4px 0;
}

.match-text strong {
    color: #667eea;
}

.feed-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e8e8e8;
}

.file-name {
    font-size: 13px;
    color: #999;
}

.update-time {
    font-size: 12px;
    color: #bbb;
}

.search-item {
    background: #fafcff;
}

.result-count {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* 分页样式 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    padding: 15px;
}

.page-link {
    display: inline-block;
    padding: 10px 24px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.page-link:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.page-link:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.page-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

footer {
    background: #f8f9fa;
    padding: 15px;
    text-align: center;
    color: #999;
    border-top: 1px solid #eee;
    font-size: 13px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header {
        padding: 20px 10px;
    }

    .header-top {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    header h1 {
        font-size: 1.5em;
    }

    .datetime {
        font-size: 14px;
        padding: 6px 12px;
    }

    .lang-switch {
        position: static;
        margin-bottom: 10px;
    }

    .lang-switch button {
        font-size: 12px;
        padding: 6px 12px;
    }

    .country-nav {
        max-height: 150px;
        padding: 10px;
        gap: 6px;
    }

    .country-link {
        font-size: 13px;
        padding: 5px 10px;
    }

    main {
        padding: 20px 15px;
    }

    .feed-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .feed-title {
        font-size: 18px;
    }

    .feed-content {
        padding: 15px;
    }

    .search-box form {
        flex-direction: column;
    }

    .search-box input,
    .search-box button {
        width: 100%;
    }

    .feed-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 10px;
    }

    .page-link {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* ==================== 新增样式 ==================== */

/* Logo 样式 */
.site-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    margin-right: 20px;
}

.site-logo img {
    height: 50px;
    width: auto;
    transition: opacity 0.3s;
}

.site-logo:hover img {
    opacity: 0.8;
}

.site-logo-text {
    font-size: 24px;
    font-weight: 600;
    color: white;
}

.header-title {
    font-size: 1.5em;
    font-weight: 600;
}

/* Footer 链接样式 */
.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #5a6fd8;
    text-decoration: underline;
}

/* AdSense 广告位样式 */
.adsense-container {
    width: 100%;
    text-align: center;
    margin: 20px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.adsense-header {
    margin-top: 10px;
}

.adsense-content {
    margin: 30px 0;
}

.adsense-footer {
    margin-bottom: 10px;
}

/* Cookie 弹窗样式 */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 9999;
    padding: 20px;
}

.cookie-content {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.cookie-content p {
    margin-bottom: 15px;
    color: #333;
    line-height: 1.6;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.cookie-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.cookie-btn.accept {
    background: #667eea;
    color: white;
}

.cookie-btn.accept:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.cookie-btn.settings {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e8e8e8;
}

.cookie-btn.settings:hover {
    background: #e8e8e8;
    color: #333;
}

/* 文章页面样式 */
.article-content {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.article-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
}

.article-title {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 15px;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    gap: 20px;
    align-items: center;
    font-size: 14px;
    flex-wrap: wrap;
}

.article-meta .icon {
    margin-right: 5px;
}

.article-meta a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
}

.article-meta a:hover {
    color: white;
}

.article-body {
    padding: 30px;
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.article-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #e8e8e8;
}

.article-tags {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.tag-label {
    font-weight: 600;
    color: #666;
    margin-right: 10px;
}

.tag {
    display: inline-block;
    padding: 6px 14px;
    background: #667eea;
    color: white;
    border-radius: 20px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s;
}

.tag:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.article-share {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.share-label {
    font-weight: 600;
    color: #666;
    margin-right: 10px;
}

.share-btn {
    display: inline-block;
    padding: 8px 16px;
    background: white;
    color: #667eea;
    border: 1px solid #667eea;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s;
}

.share-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.last-updated {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
}

.content-page {
    background: white;
    border-radius: 8px;
    padding: 40px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.content-header {
    border-bottom: 2px solid #667eea;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.content-header h1 {
    font-size: 28px;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.content-body {
    line-height: 1.8;
    color: #333;
}

.content-body h2 {
    font-size: 24px;
    color: #1a1a1a;
    margin: 30px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8e8e8;
}

.content-body h3 {
    font-size: 20px;
    color: #1a1a1a;
    margin: 25px 0 10px 0;
}

.content-body p {
    margin: 16px 0;
}

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

.content-body li {
    margin: 8px 0;
    line-height: 1.6;
}

.content-body a {
    color: #667eea;
    text-decoration: none;
}

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

.back-home-btn {
    display: inline-block;
    margin-bottom: 20px;
}

/* 响应式设计 - Tablet */
@media (max-width: 1024px) {
    .container {
        max-width: 95%;
    }

    .article-title {
        font-size: 28px;
    }

    .article-body {
        padding: 25px;
        font-size: 15px;
    }
}

/* 响应式设计 - Mobile */
@media (max-width: 768px) {
    .footer-links {
        flex-direction: column;
        gap: 15px;
    }

    .cookie-content {
        padding: 15px;
    }

    .cookie-buttons {
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
    }

    .article-header {
        padding: 20px;
    }

    .article-title {
        font-size: 24px;
    }

    .article-body {
        padding: 20px;
        font-size: 15px;
    }

    .article-footer {
        padding: 15px 20px;
    }

    .article-tags,
    .article-share {
        flex-direction: column;
        align-items: flex-start;
    }

    .content-page {
        padding: 25px 15px;
    }

    .content-header h1 {
        font-size: 24px;
    }
}

/* 响应式设计 - Small Mobile */
@media (max-width: 480px) {
    .article-title {
        font-size: 20px;
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .article-body {
        padding: 15px;
        font-size: 14px;
    }

    .content-page {
        padding: 20px 10px;
    }

    .content-header h1 {
        font-size: 20px;
    }

    .content-body {
        font-size: 14px;
    }
}

/* PWA - 移动设备优化 */
@media (display-mode: standalone) {
    body {
        padding: 0;
    }

    .container {
        border-radius: 0;
        box-shadow: none;
    }

    header {
        padding-top: env(safe-area-inset-top);
    }

    .cookie-consent {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
}

/* 深色模式支持（可选） */
@media (prefers-color-scheme: dark) {
    /* 可以在这里添加深色模式的样式 */
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .feed-item,
    .content-page,
    .article-content {
        border-width: 2px;
    }
}
