/**
 * 软件详情页专用样式
 * 用于 /software.php 页面
 */

/* ========== 页面主容器 ========== */
.software-detail-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.detail-main-area {
    min-width: 0;
    flex: 1;
    overflow: hidden;
}
.detail-sidebar-area {
    width: 400px;
    flex: 0 0 auto;
    background: #ffffff;
    border-radius: 16px;
    padding: 20px 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: -webkit-sticky;
    position: sticky;
    top: 20px;
    bottom: 20px;                     /* 关键：限制底部边界，与左栏对齐 */
    align-self: flex-start;
    /* 不再设置 max-height 和 overflow，由 bottom 自动处理 */
}
.detail-header h1 {
    font-size: 1.9rem;
    color: #ffd966;
    margin-bottom: 10px;
    text-align: center;
}
.description-content h1,
.description-content h2,
.description-content h3,
.description-content h4,
.description-content h5,
.description-content h6 {
    color: #000000;
}
.header-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    color: #9aaec9;
    font-size: 0.85rem;
    margin-bottom: 15px;
}
.header-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ffcc00, #ffcc00, transparent);
    margin: 0 auto;
}

/* ========== 截图与信息两栏布局 ========== */
.info-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
    background: #ffffff;
    padding: 25px;
    border-radius: 16px;
    align-items: stretch;
    border: 1px solid #e5e7eb;
}
.info-grid .details-list li {
    color: #374151;
}
.info-grid .details-list li strong {
    color: #d97706;
}
.software-screenshot {
    flex: 0 0 auto;
    width: 55%;
    min-width: 200px;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}
.software-screenshot img {
    width: 100%;
    height: auto;
    min-height: 100%;
    object-fit: contain;
    border-radius: 12px;
}
.software-details {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.details-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.details-list li {
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e5e7eb;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
}
.details-list li strong {
    width: 85px;
    color: #d97706;
}
.download-link-item {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
}
.download-buttons-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.download-btn {
    display: inline-block;
    padding: 5px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}
.download-btn.local { background: #4caf50; color: white; }
.download-btn.pan { background: #3b5998; color: white; }
.download-btn.custom { background: #6c757d; color: white; }
.download-btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.pan-code {
    background: #f3f4f6;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    color: #374151;
}
.pan-code:hover { background: #ffcc00; color: #1e2a3a; }

/* ========== 摘要区域 ========== */
.software-summary {
    background: #fef9e6;
    border-left: 4px solid #ffcc00;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 12px;
}
.software-summary h3 {
    color: #d97706;
    margin-bottom: 8px;
    font-size: 1.1rem;
}
.summary-content {
    line-height: 1.6;
    min-height: 120px;
    max-height: 150px;
    overflow-y: auto;
    color: #374151;
}

/* ========== 详细介绍区（包含分享栏） ========== */
.software-description {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    margin-top: 25px;
    background: #ffffff;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
}
.software-description h3 {
    font-size: 1.3rem;
    color: #d97706;
    margin-bottom: 15px;
    border-left: 4px solid #ffcc00;
    padding-left: 12px;
}
.description-content {
    line-height: 1.8;
    overflow-x: auto;
}
.description-content p {
    text-indent: 2em;
    margin-bottom: 1em;
    color: #374151;
}
.description-content img {
    display: block;
    margin: 1rem auto;
    border-radius: 8px;
    max-width: 100%;
    height: auto;
    width: 800px;
}
@media (max-width: 768px) {
    .description-content img {
        width: 500px;
    }
}

/* 正文内的分享栏 */
.detail-share-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #d1d5db, transparent);
    margin: 25px 0 15px 0;
}
.detail-share-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.share-label {
    color: #6b7280;
    font-size: 0.9rem;
    margin-right: 5px;
    white-space: nowrap;
}
.detail-share-icons .share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #f3f4f6;
    transition: all 0.2s;
    text-decoration: none;
}
.detail-share-icons .share-btn:hover {
    background: rgba(255,204,0,0.2);
    transform: translateY(-2px);
}
.detail-share-icons .share-btn img {
    width: 22px;
    height: 22px;
    display: block;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.detail-share-icons .share-btn:hover img {
    opacity: 1;
}

/* ========== 评论区（白色圆角卡片） ========== */
.comments-section {
    max-width: 100%;
    margin: 30px 0 0 0;
    background: #ffffff;
    border-radius: 16px;
    padding: 25px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.comments-section h3 {
    color: #d97706;
    font-size: 1.3rem;
    margin-bottom: 20px;
    border-left: 4px solid #ffcc00;
    padding-left: 12px;
}
.comment-item {
    background: #f9fafb;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid #e5e7eb;
}
.comment-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #1f2937;
}
.comment-content {
    line-height: 1.6;
    color: #374151;
}
.no-comments {
    color: #6b7280;
    padding: 20px;
    text-align: left;
}
#comment-form {
    background: #f3f4f6;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}
#comment-form .form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}
#comment-form .form-group {
    flex: 1;
}
#comment-form .full-width {
    flex: 1 1 100%;
}
#comment-form label {
    margin-bottom: 6px;
    color: #374151;
}
#comment-form .required {
    color: #d97706;
}
.submit-comment {
    width: auto;
    padding: 10px 30px;
    margin-top: 10px;
}

/* 评论区表单控件：白色背景，黑色文字 */
#comment-form input,
#comment-form textarea {
    background: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #d1d5db;
}
/* 评论区未登录提示：白色背景，黑色文字 */
.comments-section > p {
    background: #ffffff;
    color: #000000;
    padding: 10px;
    border-radius: 6px;
}

/* ========== 右侧边栏卡片 ========== */
.sidebar-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 14px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.sidebar-news-box h3 {
    color: #d97706;
    font-size: 1.1rem;
    margin-bottom: 12px;
    border-left: 3px solid #ffcc00;
    padding-left: 10px;
}
.latest-software-list {
    list-style: none;
    padding: 0;
}
.latest-software-list li {
    margin-bottom: 8px;
    background: #f9fafb;
    border-radius: 10px;
    transition: 0.2s;
}
.latest-software-list li:hover {
    background: #fffbeb;
    transform: translateX(5px);
}
.latest-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    text-decoration: none;
    color: #1f2937 !important;
}
.latest-icon {
    width: 40px;
    height: 40px;
    background: #f3f4f6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.latest-icon img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
}
.latest-info {
    flex: 1;
    min-width: 0;
}
.latest-name {
    font-weight: 500;
    margin-bottom: 2px;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #374151;
}
.latest-meta {
    font-size: 0.7rem;
    color: #6b7280;
}

/* ========== 推荐软件卡片 ========== */
.sidebar-recommend-box {
    margin-bottom: 20px;
}
.sidebar-recommend-box h3 {
    color: #d97706;
    font-size: 1.1rem;
    margin-bottom: 12px;
    border-left: 3px solid #ffcc00;
    padding-left: 10px;
}
.rec-home-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #ffffff;
    border-radius: 16px;
    padding: 18px 16px;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.rec-home-card:hover {
    background: #fffbeb;
    border-color: #fcd34d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.rec-home-card:hover .rec-home-title,
.rec-home-card:hover .rec-home-desc,
.rec-home-card:hover .rec-home-category {
    color: #1f2937;
}
.rec-home-category {
    display: block;
    font-size: 0.7rem;
    text-align: center;
    margin-bottom: 6px;
    color: #6b7280;
    opacity: 0.8;
}
.rec-home-card:hover .rec-home-category {
    color: #d97706;
}
.rec-home-icon {
    font-size: 2rem;
    margin-bottom: 10px;
    text-align: center;
}
.rec-home-icon img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 12px;
}
.rec-home-title {
    font-size: 1rem;
    color: #1f2937;
    margin-bottom: 8px;
    font-weight: 600;
    text-align: center;
}
.rec-home-desc {
    color: #4b5563;
    margin-bottom: 12px;
    font-size: 0.8rem;
    text-align: center;
    line-height: 1.4;
}
.rec-home-btn {
    display: block;
    width: 80%;
    padding: 8px 12px;
    background: #f3f4f6;
    color: #374151;
    text-decoration: none;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}
.rec-home-btn:hover {
    background: #d97706;
    border-color: #d97706;
    color: white;
}
.rec-home-card:hover .rec-home-btn {
    background: #d97706;
    border-color: #d97706;
    color: white;
}

/* ========== 广告位容器 ========== */
.detail-sidebar-area .sidebar-ad-box {
    background: #f9fafb !important;
    border-radius: 8px !important;
    padding: 8px !important;
    margin-bottom: 25px !important;
    text-align: center !important;
    border: 1px solid #e5e7eb !important;
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow: hidden !important;
}
.sidebar-ad-box img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    height: auto;
}
.detail-sidebar-area .sidebar-ad-box::before {
    content: "广告" !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    background: rgba(0,0,0,0.5) !important;
    color: #fff !important;
    font-size: 9px !important;
    padding: 2px 6px !important;
    border-radius: 0 0 4px 0 !important;
    z-index: 10 !important;
    pointer-events: none !important;
}
.detail-sidebar-area .sidebar-ad-box .ad-placeholder {
    color: #6b7280 !important;
    font-size: 0.75rem !important;
    padding: 20px 0 !important;
    text-align: center !important;
}

/* ========== 响应式 ========== */
@media (max-width: 992px) {
    .software-detail-container {
        flex-direction: column;
    }
    .detail-sidebar-area {
        width: 100%;
        position: static;
    }
}
@media (max-width: 768px) {
    .info-grid {
        flex-direction: column;
    }
    .software-screenshot {
        width: 100%;
    }
    .software-screenshot img {
        height: auto;
        object-fit: contain;
    }
    .details-list li {
        flex-direction: column;
    }
    .details-list li strong {
        margin-bottom: 5px;
    }
    .download-link-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .header-meta {
        gap: 10px;
    }
}

/* 页脚全宽修复 */
footer {
    width: 100% !important;
    max-width: 100% !important;
}
/* 回复按钮 */
.reply-btn {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: #d97706;
    cursor: pointer;
    text-decoration: none;
}
.reply-btn:hover {
    text-decoration: underline;
}
/* 回复表单 */
.reply-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: #000000;
    resize: vertical;
    box-sizing: border-box;
}