* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

body {
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
}

.container {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 24px;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
}

.header-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* 特色功能展示区 */
.feature-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.feature-card h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 600;
}

.feature-card p {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* PHP技术文章板块 */
.php-section {
    margin-bottom: 24px;
}

.php-header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.php-header h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 600;
}

.php-header .subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.articles-list {
    display: grid;
    gap: 16px;
}

.article-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s;
    animation: fadeIn 0.3s ease-in;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.article-card h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.article-card .article-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card .article-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #999;
    flex-wrap: wrap;
}

.article-card .article-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.article-card .article-category {
    background: rgba(33, 150, 243, 0.1);
    color: #2196F3;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.article-detail {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.3s ease-in;
}

.btn-back {
    background: rgba(33, 150, 243, 0.1);
    color: #2196F3;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.btn-back:hover {
    background: #2196F3;
    color: white;
}

.article-content h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: #999;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
    flex-wrap: wrap;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

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

.article-body h2 {
    font-size: 22px;
    color: #333;
    margin: 24px 0 12px;
    font-weight: 600;
}

.article-body h3 {
    font-size: 18px;
    color: #333;
    margin: 20px 0 10px;
    font-weight: 600;
}

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

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

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

.article-body code {
    background: rgba(33, 150, 243, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #2196F3;
}

.article-body pre {
    background: #f5f5f5;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
}

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

.article-body blockquote {
    border-left: 4px solid #2196F3;
    padding-left: 16px;
    margin: 16px 0;
    color: #666;
    font-style: italic;
}

/* 快速导航 */
.quick-nav {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.quick-nav h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 12px;
    font-weight: 600;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: rgba(33, 150, 243, 0.1);
    color: #2196F3;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
}

.loading-area {
    text-align: center;
    padding: 40px 20px;
    animation: fadeIn 0.3s ease-in;
}

.spinner {
    border: 4px solid rgba(33, 150, 243, 0.1);
    border-top: 4px solid #2196F3;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hidden {
    display: none !important;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

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

.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 16px;
    text-align: center;
    font-size: 12px;
    color: #999;
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.footer p {
    margin: 0;
}

/* 全屏模式优化 */
@media (display-mode: standalone) {
    .header {
        padding-top: max(24px, env(safe-area-inset-top));
    }
    
    .footer {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}

/* 移动端优化 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 20px;
    }
    
    .header-subtitle {
        font-size: 13px;
    }
    
    .feature-section {
        grid-template-columns: 1fr;
    }
    
    .article-content h1 {
        font-size: 22px;
    }
    
    .article-body {
        font-size: 15px;
    }
}

/* 横屏模式 */
@media (orientation: landscape) {
    .container {
        height: 100vh;
    }
}
