/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* PopCash 推荐链接样式 */
.affiliate-banner {
    background-color: #fff;
    padding: 10px 0;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.affiliate-banner a {
    display: inline-block;
    transition: opacity 0.3s ease;
}

.affiliate-banner a:hover {
    opacity: 0.8;
}

.affiliate-banner img {
    max-width: 728px;
    width: 100%;
    height: auto;
    max-height: 90px;
    object-fit: contain;
}

/* 导航栏样式 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.logo h1 {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.logo .tagline {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    margin: 0;
    font-style: italic;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: #ecf0f1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: #3498db;
}

/* 主要内容区域 */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 广告容器样式 */
.ad-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    background-color: #f1f2f6;
    border: 2px dashed #ddd;
    border-radius: 8px;
    min-height: 90px;
}

.ad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-style: italic;
    text-align: center;
    width: 100%;
}

.top-ad, .bottom-ad {
    max-width: 728px;
    height: 90px;
}

.middle-ad {
    max-width: 300px;
    height: 250px;
    margin: 30px auto;
}

.sidebar-ad, .sidebar-ad-bottom {
    width: 100%;
    height: 250px;
    margin-bottom: 20px;
}

.sidebar-ad-bottom {
    height: 600px;
    overflow: hidden; /* 防止内容超出容器 */
}

/* Roxy Browser Ad Optimization */
.roxy-browser-ad {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px;
    height: 100%;
    box-sizing: border-box;
}

.roxy-ad-img {
    max-width: 160px;
    max-height: 580px; /* 限制最大高度，留出padding空间 */
    width: 160px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
    object-fit: contain; /* 保持比例，防止变形 */
}

.roxy-ad-img:hover {
    transform: scale(1.01); /* 减小悬停放大效果 */
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* 英雄区域 - 博客风格 */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 4rem 2rem;
    margin: 20px 0;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h2 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.hero-content .hero-subtitle {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2rem;
    line-height: 1.6;
    opacity: 0.9;
}

.author-intro {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.author-avatar {
    font-size: 3rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.author-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.author-info p {
    margin: 0;
    opacity: 0.8;
    font-size: 1rem;
}

/* 内容布局 */
.content-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.main-content {
    background-color: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 章节样式 */
.section {
    margin-bottom: 3rem;
}

.section h2 {
    color: #2c3e50;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid #3498db;
    padding-bottom: 0.5rem;
}

/* 博客文章样式 */
.blog-posts {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.blog-post {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.blog-post::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.blog-post:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.blog-post:hover::before {
    transform: scaleY(1);
}

.post-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.post-date {
    color: #6c757d;
    background-color: #f8f9fa;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 500;
}

.post-category {
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.85rem;
}

.blog-post h3 {
    margin-bottom: 1rem;
    font-size: 1.4rem;
    line-height: 1.4;
}

.blog-post h3 a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-post h3 a:hover {
    color: #667eea;
}

.post-excerpt {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
}

.read-time {
    color: #6c757d;
    font-size: 0.9rem;
}

.read-more {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.read-more:hover {
    color: #764ba2;
    transform: translateX(5px);
}

/* 侧边栏样式 - 博客风格 */
.widget {
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.widget:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.widget h3 {
    color: #2c3e50;
    margin-bottom: 1.2rem;
    font-size: 1.2rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.popular-posts, .category-list {
    list-style: none;
}

.popular-posts li, .category-list li {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.popular-posts li:last-child, .category-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.popular-posts a, .category-list a {
    color: #555;
    text-decoration: none;
    transition: color 0.3s ease;
    line-height: 1.4;
    flex: 1;
    font-size: 0.95rem;
}

.popular-posts a:hover, .category-list a:hover {
    color: #667eea;
}

.post-views, .count {
    font-size: 0.8rem;
    color: #999;
    background-color: #f8f9fa;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    white-space: nowrap;
    margin-left: 0.5rem;
}

/* 作者卡片样式 */
.author-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #e9ecef;
}

.author-profile {
    text-align: center;
}

.author-avatar-large {
    font-size: 4rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.author-details h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.author-details p {
    color: #666;
    line-height: 1.5;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.social-links {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
}

.social-links a {
    color: #667eea;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid #667eea;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* 页脚样式 */
footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 2rem 1rem;
}

.footer-section h4 {
    color: #3498db;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #3498db;
}

.footer-bottom {
    background-color: #1a252f;
    text-align: center;
    padding: 1rem;
    border-top: 1px solid #34495e;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .affiliate-banner {
        padding: 5px 0;
    }
    
    .affiliate-banner img {
        max-width: 95%;
        max-height: 70px;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .top-ad, .bottom-ad {
        max-width: 320px;
        height: 50px;
    }
    
    .middle-ad {
        max-width: 300px;
        height: 250px;
    }
    
    .hero {
        padding: 2rem 1rem;
        margin: 10px 0;
    }
    
    .section h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    .nav-menu {
        gap: 0.5rem;
        font-size: 0.9rem;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .article-card {
        padding: 1rem;
    }
    
    .widget {
        padding: 1rem;
    }
    
    .top-ad, .bottom-ad {
        max-width: 280px;
        height: 50px;
    }
}

/* 广告响应式优化 */
@media (max-width: 320px) {
    .top-ad, .bottom-ad {
        max-width: 250px;
        height: 50px;
    }
    
    .middle-ad {
        max-width: 250px;
        height: 200px;
    }
}

/* 提升可访问性 */
a:focus, button:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.article-card:focus-within {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* 打印样式 */
@media print {
    .ad-container, .navbar, .sidebar {
        display: none;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    body {
        background: white;
    }
    
    .main-content {
        box-shadow: none;
        background: white;
    }
}

/* Dynamic Content Loading Styles */
.content-loading {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.blog-posts, .popular-posts {
    transition: opacity 0.3s ease;
}

/* Fresh content indicator */
.fresh-content::before {
    content: "🔥 ";
    font-size: 0.8em;
}

/* API status indicator (for debugging) */
.api-status {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    background: #28a745;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.api-status.show {
    opacity: 1;
}

.api-status.loading {
    background: #ffc107;
    color: #000;
}

.api-status.error {
    background: #dc3545;
}

.api-status.success {
    background: #28a745;
}

/* Developer Tools Section Styles */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.tool-card {
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    position: relative;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-color: #667eea;
}

.tool-card h3 {
    color: #1a202c;
    margin: 0 0 8px 0;
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-card p {
    color: #718096;
    margin: 0 0 16px 0;
    font-size: 0.9em;
    line-height: 1.4;
}

.tool-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.tool-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85em;
    min-width: 70px;
}

.tool-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.tool-btn.secondary {
    background: #a0aec0;
}

.tool-btn.secondary:hover {
    background: #8b9bb3;
}

.tool-output {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-output textarea {
    flex: 1;
    min-height: 50px;
    max-height: 80px;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.8em;
    resize: vertical;
    background: #f8fafc;
}

.copy-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75em;
    transition: background 0.2s ease;
    white-space: nowrap;
    align-self: flex-start;
}

.copy-btn:hover {
    background: #38a169;
}

.json-container, .base64-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.json-input, .json-output, .base64-input, .base64-output {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.json-input label, .json-output label, .base64-input label, .base64-output label {
    font-weight: 500;
    color: #4a5568;
    font-size: 0.85em;
}

.json-input textarea, .json-output textarea, .base64-input textarea, .base64-output textarea {
    min-height: 100px;
    max-height: 120px;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.8em;
    resize: vertical;
    background: #f8fafc;
}

.json-output, .base64-output {
    position: relative;
}

.json-output .copy-btn, .base64-output .copy-btn {
    position: static;
    margin-top: 4px;
    align-self: flex-start;
}

.tool-status {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
}

.tool-status.success {
    background: #f0fff4;
    color: #276749;
    border: 1px solid #9ae6b4;
}

.tool-status.error {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.timestamp-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timestamp-input, .timestamp-output {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.timestamp-input input, .timestamp-output input {
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85em;
    background: #f8fafc;
}

.timestamp-output {
    position: relative;
}

.timestamp-output .copy-btn {
    position: static;
    margin-top: 4px;
    align-self: flex-start;
}

#uuidVersion {
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 0.85em;
    min-width: 140px;
}

.section-intro {
    color: #718096;
    font-size: 1.05em;
    margin-bottom: 8px;
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Mobile Responsive Styles for Tools */
@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .tool-card {
        padding: 16px;
        margin: 0 5px;
    }
    
    .tool-controls {
        justify-content: flex-start;
        gap: 6px;
    }
    
    .tool-btn {
        padding: 7px 12px;
        font-size: 0.8em;
    }
    
    .tool-output {
        flex-direction: column;
        gap: 8px;
    }
    
    .json-container, .base64-container {
        gap: 10px;
    }
    
    .timestamp-container {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .json-output .copy-btn, .base64-output .copy-btn, .timestamp-output .copy-btn {
        position: static;
        align-self: flex-start;
        margin-top: 4px;
    }
    
    .json-input textarea, .json-output textarea, .base64-input textarea, .base64-output textarea {
        min-height: 80px;
        max-height: 100px;
    }
}

@media (max-width: 480px) {
    .tool-card {
        padding: 12px;
        margin: 0;
    }
    
    .section-intro {
        font-size: 1em;
        padding: 0 10px;
    }
}