/* ========== 方法列表页 - 瀑布流 ========== */
.methods-page {
    padding: 20px 0 60px;
}
.methods-container {
    padding-left: 10%;
    padding-right: 10%;
    text-align: left;
}
.methods-grid {
    column-count: 3;
    column-gap: 20px;
}
.method-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eee;
    transition: transform 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease-out forwards;
    height: auto;
    break-inside: avoid;
    margin-bottom: 20px;
}
.method-card:hover {
    transform: translateY(-5px);
}
.method-card a {
    text-decoration: none;
    display: block;
}
.method-image {
    width: calc(100% - 36px);
    overflow: hidden;
    background: #f5f5f5;
    margin-top: 18px;
    margin-left: 18px;
    margin-right: 18px;
    border-radius: 8px;
}
.method-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}
.method-card:hover .method-image img {
    transform: scale(1.03);
}
.method-info {
    padding: 18px;
}
.method-info h3 {
    font-size: 18px;
    color: #212121;
    font-weight: 500;
    margin-bottom: 2px;
    line-height: 1.2;
    transition: color 0.3s ease;
}
.method-info h4 {
    font-size: 14px;
    color: #212121;
    font-weight: 400;
    margin-bottom: 10px;
    line-height: 1.2;
    transition: color 0.3s ease;
}
.method-card:hover .method-info h3,
.method-card:hover .method-info h4 {
    color: #B82525;
}
.method-info .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 12px;
    color: #999;
}
.method-info .meta span {
    color: #999;
}

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

/* 响应式 */
@media (max-width: 768px) {
    .methods-page {
        padding: 20px 0 40px;
    }
    .methods-container {
        padding-left: 20px;
        padding-right: 20px;
    }
    .methods-grid {
        column-count: 2;
        column-gap: 15px;
    }
    .method-card {
        margin-bottom: 15px;
    }
    .method-image {
        width: calc(100% - 24px);
        margin-top: 12px;
        margin-left: 12px;
        margin-right: 12px;
    }
    .method-info {
        padding: 12px;
    }
    .method-info h3 {
        font-size: 14px;
    }
    .method-info h4 {
        font-size: 12px;
        margin-bottom: 6px;
    }
    .method-info .meta {
        font-size: 10px;
        gap: 10px;
    }
}
@media (max-width: 480px) {
    .methods-grid {
        column-count: 1;
    }
    .method-image {
        width: calc(100% - 24px);
        margin-top: 12px;
        margin-left: 12px;
        margin-right: 12px;
    }
}

/* ========== 方法详情页 ========== */
.method-detail-page {
    padding: 40px 0 40px;
}
.method-detail-container {
    padding-left: 10%;
    padding-right: 10%;
    text-align: left;
}
.method-detail-image {
    margin-bottom: 26px;
}
.method-detail-image img {
    display: block;
    border-radius: 12px;
    height: auto;
}
.method-detail-title {
    margin-bottom: 6px;
}
.method-detail-title h1 {
    font-size: 32px;
    color: #212121;
    font-weight: 500;
    margin-bottom: 6px;
    line-height: 1.2;
}
.method-detail-title h2 {
    font-size: 20px;
    color: #212121;
    font-weight: 400;
    margin-bottom: 6px;
    line-height: 1.3;
}
.method-detail-title .scenario {
    font-size: 14px;
    color: #212121;
    margin-bottom: 6px;
}
.method-detail-meta {
    font-size: 13px;
    color: #999;
    margin-bottom: 6px;
}
.method-detail-content {
    margin-bottom: 10px;
}
.method-detail-content .content-section {
    margin-bottom: 6px;
}
.method-detail-content .content-cn {
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    margin-bottom: 0;
}
.method-detail-content .content-en {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: #666;
    margin-bottom: 0;
}

/* 详情页底部导航 - 三个链接都在左侧 */
.method-detail-back {
    margin-top: 30px;
    text-align: left;
}
.method-detail-back a {
    display: inline-block;
    margin-right: 24px;
    height: 32px;
    line-height: 32px;
    color: #999;
    text-decoration: none;
    font-size: 14px;
}
.method-detail-back a:last-child {
    margin-right: 0;
}
.method-detail-back a:hover {
    color: #B82525;
}
/* 上一篇箭头 */
.prev-link::before {
    content: "← ";
}
/* 下一篇箭头 */
.next-link::after {
    content: " →";
}

/* 响应式 */
@media (max-width: 768px) {
    .method-detail-page {
        padding: 30px 0 40px;
    }
    .method-detail-container {
        padding-left: 20px;
        padding-right: 20px;
    }
    .method-detail-image {
        margin-bottom: 16px;
    }
    .method-detail-image img {
        width: 100%;
        max-width: 100%;
        height: auto;
        display: block;
    }
    .method-detail-title h1 {
        font-size: 24px;
    }
    .method-detail-title h2 {
        font-size: 16px;
    }
    .method-detail-content .content-cn {
        font-size: 14px;
        line-height: 1.5;
    }
    .method-detail-content .content-en {
        font-size: 13px;
        line-height: 1.5;
    }
    .method-detail-back {
        margin-top: 20px;
    }
    .method-detail-back a {
        margin-right: 16px;
        height: 28px;
        line-height: 28px;
        font-size: 12px;
    }
}

/* ========== 手机端模态框 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
}
.modal-content {
    position: relative;
    width: 90%;
    height: 90%;
    margin: 5% auto;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}
.modal-loading {
    text-align: center;
    padding: 40px;
    color: #999;
}
.modal-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 16px 20px;
    gap: 24px;
    border-top: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
}
.modal-prev, .modal-next {
    width: 36px;
    height: 36px;
    background: #e0e0e0;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}
.modal-prev:hover, .modal-next:hover {
    background: #ccc;
    color: #B82525;
}
.modal-close {
    background: #B82525;
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}
.modal-close:hover {
    background: #8e1c1c;
}

/* 滑动动画 */
@keyframes slideInRight {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideInLeft {
    from { transform: translateX(-30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 电脑端不显示模态框，保持正常跳转 */
@media (min-width: 769px) {
    .modal {
        display: none !important;
    }
}