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

:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --secondary-color: #2ecc71;
    --accent-color: #e74c3c;
    --dark-color: #34495e;
    --light-color: #ecf0f1;
    --gray-color: #95a5a6;
    --text-color: #2c3e50;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease-in-out;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 4px;

    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}

.primary-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.secondary-btn {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.secondary-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 头部样式 */
header {
    background-color: white;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo h1 {
    font-size: 24px;
    color: var(--text-color);
}

.logo span {
    color: var(--primary-color);
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 25px;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    transition: var(--transition);
}

nav ul li a:hover,
nav ul li a.active {
    color: var(--primary-color);
}

nav ul li a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    bottom: 0;
    left: 0;
    transition: var(--transition);
}

nav ul li a:hover:after,
nav ul li a.active:after {
    width: 100%;
}

/* 英雄区域 */
.hero {
    background: linear-gradient(135deg, #3498db 0%, #8e44ad 100%);
    color: white;
    text-align: center;
    padding: 40px 0;
}

.hero h2 {
    font-size: 28px;
    margin-bottom: 12px;
}

.hero p {
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto 20px;
}

/* 主要内容区 */
main {
    padding: 50px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 25px;
}

.section-header h2 {
    font-size: 28px;
    color: var(--dark-color);
    margin-bottom: 8px;
}

.divider {
    height: 2px;
    width: 50px;
    background-color: var(--primary-color);
    margin: 8px auto;
}

/* 教程卡片 */
.tutorial-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    margin-bottom: 40px;
    transition: var(--transition);
}

.tutorial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.tutorial-content {
    padding: 30px;
}

.tutorial-content h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.tutorial-meta {
    display: flex;
    margin-bottom: 15px;
    color: var(--gray-color);
    font-size: 14px;
}

.tutorial-meta span {
    margin-right: 20px;
}

.tutorial-meta i {
    margin-right: 5px;
}

.tutorial-content p {
    margin-bottom: 25px;
}

.tutorial-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.tags {
    display: flex;
}

.tags span {
    background-color: #f1f2f6;
    color: var(--dark-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    margin-right: 10px;
}

#copy-notification {
    position: absolute;
    right: 0;
    bottom: 50px;
    background-color: #2ecc71;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

#copy-notification.show {
    opacity: 1;
    visibility: visible;
    bottom: 60px;
}

#copy-notification i {
    margin-right: 5px;
}

/* 教程网格 */
.tutorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.tutorial-item {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.tutorial-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.tutorial-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.tutorial-item h4 {
    padding: 15px 15px 10px;
    font-size: 18px;
    color: var(--dark-color);
}

.tutorial-item p {
    padding: 0 15px 15px;
    color: var(--gray-color);
}

/* 页脚样式 */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer-section h3 {
    font-size: 20px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h3:after {
    content: '';
    position: absolute;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
    bottom: 0;
    left: 0;
}

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

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #bdc3c7;
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: white;
    padding-left: 5px;
}

.social-icons {
    display: flex;
    margin-top: 15px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    margin-right: 10px;
    color: white;
    text-decoration: none;
    transition: var(--transition);
}

.social-icons a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tutorial-card {
        flex-direction: column;
    }
    
    .tutorial-image {
        flex: 0 0 auto;
        height: 200px;
    }
    
    .hero {
        padding: 30px 0;
    }
    
    .hero h2 {
        font-size: 24px;
        margin-bottom: 8px;
    }
    
    .hero p {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .section-header {
        margin-bottom: 20px;
    }
    
    .section-header h2 {
        font-size: 24px;
        margin-bottom: 6px;
    }
    
    .divider {
        height: 2px;
        width: 40px;
        margin: 6px auto;
    }
    
    nav ul {
        flex-wrap: wrap;
    }
    
    nav ul li {
        margin: 5px 15px 5px 0;
    }
}

@media (max-width: 480px) {
    header .container {
        flex-direction: column;
    }
    
    nav ul {
        margin-top: 15px;
    }
    
    .tutorial-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tags {
        margin-bottom: 15px;
    }
}

/* 微信分享弹窗 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
    position: relative;
    text-align: center;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--gray-color);
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--dark-color);
}

#qrcode-container {
    margin: 25px auto;
    width: 200px;
    height: 200px;
    background-color: #f1f2f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

#qrcode-container img {
    max-width: 100%;
    max-height: 100%;
}

.modal-hint {
    margin-bottom: 15px;
    color: var(--gray-color);
}

.copy-link-container {
    display: flex;
    margin: 15px 0;
}

#modal-link {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
}

#modal-copy-btn {
    padding: 10px 20px;
    border-radius: 0 4px 4px 0;
}

#modal-copy-message {
    color: var(--secondary-color);
    font-size: 14px;
    margin-top: 10px;
    height: 20px;
}

/* 三图布局 */
.tutorial-images-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 25px 0;
}

.tutorial-image-item {
    position: relative;
    width: 100%;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.tutorial-image-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px 8px 0 0;
}

.image-caption {
    padding: 12px 15px;
    font-size: 14px;
    text-align: center;
    color: var(--dark-color);
    font-weight: 500;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
}

/* 灯箱图片查看器 */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    text-align: center;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    animation: zoom 0.3s;
}

@keyframes zoom {
    from {transform: scale(0.8); opacity: 0;}
    to {transform: scale(1); opacity: 1;}
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.lightbox-close:hover {
    color: var(--primary-color);
    text-decoration: none;
}

#lightbox-caption {
    margin: 15px auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 30px;
}

/* 改善手机屏幕上的显示效果 */
@media (max-width: 768px) {
    .tutorial-images-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 20px 0;
    }
    
    .tutorial-image-item {
        margin-bottom: 10px;
    }
    
    .tutorial-image-item img {
        max-height: 300px;
        object-fit: contain;
    }
    
    .image-caption {
        padding: 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .tutorial-images-grid {
        gap: 12px;
    }
    
    .tutorial-image-item img {
        max-height: 250px;
    }
    
    .image-caption {
        padding: 8px;
        font-size: 12px;
    }
}

/* 微信提示样式 */
.wechat-tip {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    z-index: 9999;
}

.wechat-tip-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.tip-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
}

.tip-text {
    display: none;
}

@media (max-width: 768px) {
    .wechat-tip-content {
        padding: 0;
    }
}

/* 自定义 Alert 弹窗 */
.custom-alert {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.alert-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 300px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.alert-message {
    font-size: 16px;
    color: #333;
    line-height: 1.5;
    margin-bottom: 20px;
    white-space: pre-line;
}

.alert-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.alert-button:hover {
    background-color: var(--primary-dark);
}

@media (max-width: 768px) {
    .alert-content {
        padding: 15px;
        width: 85%;
    }
    
    .alert-message {
        font-size: 15px;
    }
}