/* 页面横幅样式 */
.page-banner {
    position: relative;
    height: 400px;
    background: url('https://picsum.photos/1920/400?random=5001');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    margin-top: -1px;
}

.page-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.page-banner-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
}

.page-banner-title {
    font-size: 48px;
    font-weight: 300;
    margin-bottom: 20px;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.page-banner-subtitle {
    font-size: 20px;
    line-height: 1.6;
    opacity: 0.95;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* 页面通用样式 */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px;
    min-height: calc(100vh - 200px);
}

.page-header {
    text-align: center;
    margin-bottom: 60px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.page-title {
    font-size: 42px;
    color: #333;
    margin-bottom: 15px;
    font-weight: 300;
    letter-spacing: 2px;
}

.page-subtitle {
    font-size: 18px;
    color: #666;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

.page-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.05);
    overflow: hidden;
}

/* 文章详情样式 */
.article-detail {
    padding: 50px 60px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    color: #666;
}

.article-meta .date {
    color: #e74c3c;
    font-weight: 500;
}

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

.article-body h2 {
    font-size: 28px;
    color: #333;
    margin: 40px 0 20px;
    padding-left: 15px;
    border-left: 4px solid #e74c3c;
    font-weight: 400;
}

.article-body h3 {
    font-size: 22px;
    color: #444;
    margin: 30px 0 15px;
    font-weight: 400;
}

.article-body p {
    margin-bottom: 20px;
    text-indent: 2em;
}

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

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

.article-image {
    width: 100%;
    max-width: 600px;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    margin: 30px auto;
    display: block;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* 卡片网格布局 */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 40px;
}

.feature-card {
    background: white;
    border-radius: 12px;
    padding: 40px 30px;
    text-align: center;
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    border-color: #e74c3c;
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    font-size: 32px;
}

.feature-card h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
    font-weight: 500;
}

.feature-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* 联系表单样式 */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #e74c3c;
}

.form-control.textarea {
    min-height: 120px;
    resize: vertical;
}

.btn-submit {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(231, 76, 60, 0.3);
}

/* 联系信息卡片 */
.contact-info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.contact-card {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    border-left: 4px solid #e74c3c;
}

.contact-card .icon {
    font-size: 32px;
    color: #e74c3c;
    margin-bottom: 15px;
}

.contact-card h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 18px;
}

.contact-card p {
    color: #666;
    margin: 5px 0;
}

/* 资源导航样式 */
.resource-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 12px 24px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
    text-decoration: none;
    font-weight: 500;
}

.nav-btn:hover,
.nav-btn.active {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
    transform: translateY(-2px);
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1px;
    background: #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
}

.resource-item {
    background: white;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
    border: none;
    min-height: 80px;
}

.resource-item:hover {
    background: #f8f9fa;
}

.resource-item .icon {
    width: 60px;
    height: 60px;
    background: #e74c3c;
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

/* 网站favicon样式 */
.website-favicon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: contain;
    background: white;
    padding: 2px;
    transition: opacity 0.3s ease;
}

.website-favicon:hover {
    opacity: 0.8;
}

/* 自定义上传图片样式 */
.resource-custom-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    background: white;
    padding: 0;
    transition: opacity 0.3s ease;
}

.resource-custom-image:hover {
    opacity: 0.8;
}

.fallback-icon {
    font-size: 18px;
    transition: opacity 0.3s ease;
}

/* 当有favicon时，调整图标区域的背景 */
.resource-item .icon:has(.website-favicon) {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

/* 如果浏览器不支持:has选择器，使用JavaScript来添加类 */
.resource-item .icon.has-favicon {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #495057;
}

.resource-item .content {
    flex: 1;
    min-width: 0;
}

.resource-item h3 {
    color: #333;
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
}

.resource-item p {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resource-item .url {
    display: none;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .resource-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 1024px) {
    .resource-grid {
        grid-template-columns: 1fr;
        gap: 1px;
    }
}

@media (max-width: 1200px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 25px !important;
    }
    
    .feature-card {
        padding: 30px 20px !important;
    }
}

@media (max-width: 900px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
    
    .feature-card {
        padding: 25px 15px !important;
    }
    
    .page-banner-title {
        font-size: 36px;
    }
}

@media (max-width: 600px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }
    
    .feature-card {
        padding: 20px 12px !important;
        font-size: 13px !important;
    }
    
    .feature-card h3 {
        font-size: 14px !important;
        margin-bottom: 10px !important;
    }
    
    .feature-card .feature-icon {
        width: 50px !important;
        height: 50px !important;
        margin-bottom: 10px !important;
    }
    
    .feature-card .feature-icon i {
        font-size: 20px !important;
    }
}

@media (max-width: 768px) {
    .page-banner {
        height: 300px;
        margin-top: -1px;
    }
    
    .page-banner-title {
        font-size: 32px;
    }
    
    .page-banner-subtitle {
        font-size: 16px;
    }
    
    .page-container {
        padding: 60px 15px;
    }
    
    .page-title {
        font-size: 32px;
    }
    
    .article-detail {
        padding: 30px 25px;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    /* 手机版资源网格：保持简约列表风格 */
    .resource-grid {
        grid-template-columns: 1fr;
        gap: 1px;
    }
    
    .resource-item {
        padding: 16px;
        min-height: 60px;
        gap: 12px;
    }
    
    .resource-item .icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .website-favicon,
    .resource-custom-image {
        width: 48px;
        height: 48px;
        padding: 0;
        object-fit: cover;
        border-radius: 6px;
    }
    
    .resource-item h3 {
        font-size: 15px;
        margin: 0 0 2px 0;
    }
    
    .resource-item p {
        font-size: 12px;
        margin: 0 0 2px 0;
    }
    
    .resource-item .url {
        display: none;
    }
    
    .contact-form {
        padding: 30px 20px;
    }
    
    /* 手机版联系信息卡片：一行两个 */
    .contact-info-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-bottom: 30px;
    }
    
    .contact-card {
        padding: 20px 15px;
        border-radius: 10px;
    }
    
    .contact-card .icon {
        font-size: 24px;
        margin-bottom: 10px;
    }
    
    .contact-card h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .contact-card p {
        font-size: 14px;
        margin: 3px 0;
    }
    
    .contact-card p[style*="font-size: 12px"] {
        font-size: 11px !important;
    }
    
    .article-body {
        font-size: 15px;
    }
    
    .article-body h2 {
        font-size: 24px;
    }
    
    .resource-nav {
        gap: 10px;
    }
    
    .nav-btn {
        padding: 10px 18px;
        font-size: 14px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    /* 资源网格：继续保持一行两个，但进一步优化 */
    .resource-grid {
        gap: 12px;
        padding: 15px 0;
    }
    
    .resource-item {
        padding: 12px;
        border-radius: 8px;
    }
    
    .resource-item h3 {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .resource-item p {
        font-size: 11px;
        line-height: 1.3;
        margin-bottom: 6px;
    }
    
    .resource-item .url {
        display: none;
    }
    
    .resource-item .icon {
        width: 45px;
        height: 45px;
        margin-bottom: 8px;
    }
    
    .resource-item .icon i {
        font-size: 18px;
    }
    
    .resource-custom-image {
        width: 45px;
        height: 45px;
        border-radius: 6px;
        object-fit: cover;
    }
    
    /* 联系信息卡片：继续保持一行两个，但进一步优化 */
    .contact-info-cards {
        gap: 12px;
        margin-bottom: 25px;
    }
    
    .contact-card {
        padding: 15px 12px;
        border-radius: 8px;
    }
    
    .contact-card .icon {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .contact-card h3 {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .contact-card p {
        font-size: 12px;
        margin: 2px 0;
    }
    
    .contact-card p[style*="font-size: 12px"] {
        font-size: 10px !important;
    }
}
