/* 产品详情页（projectInfo.html） */
.product-detail {
    padding-top: var(--spacing-4);
}

.product-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-6);
    margin-bottom: var(--spacing-8);
}

/* 产品信息区 */
.product-info {
    display: flex;
    flex-direction: column;
    padding: var(--spacing-4) var(--spacing-5);
    background: var(--color-surface);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 80px;
    z-index: 10;
    transition: border-radius 0.2s ease, border-color 0.2s ease;
}

/* 滚动后贴紧顶部导航，去掉缝隙与圆角 */
.product-info.is-stuck {
    top: 65px;
    border-radius: 0;
    border-color: transparent;
    border-top-color: var(--color-border);
}

.product-info .product-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-2) var(--spacing-3);
    margin-bottom: var(--spacing-2);
}

.product-info .product-title {
    flex: 1 1 240px;
    min-width: 0;
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-text);
    padding: 0;
    margin: 0;
    line-height: 1.35;
    white-space: normal;
    overflow: visible;
    -webkit-line-clamp: unset;
}

.product-info .product-head .action-buttons {
    flex: 0 0 auto;
    margin-left: auto;
    align-items: flex-start;
    margin-top: -2px;
}

/* 技术栈标签 */
.product-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--spacing-2);
}

.product-attributes .attribute {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
}

.product-attributes .attribute .label {
    color: var(--color-text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

.product-attributes .attribute .value {
    color: var(--color-text);
    font-weight: 700;
}

/* 了解更多 */
.learn-more {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-3);
    padding: 6px var(--spacing-3);
    margin-bottom: var(--spacing-2);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.learn-more:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.learn-more-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.learn-more-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
}

.learn-more-desc {
    font-size: 12px;
    color: var(--color-text-tertiary);
}

.learn-more-btn {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-primary);
    white-space: nowrap;
}

/* 板块标题 */
.section-heading {
    position: relative;
    padding-left: 14px;
    margin: 0 0 var(--spacing-4);
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-text);
}

.section-heading::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: linear-gradient(135deg, #2563eb, #4f8bff);
}

/* 产品截图（纵向大图） */
.product-gallery {
    padding: var(--spacing-6);
    background: var(--color-surface);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
}

.gallery-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
}

.gallery-image {
    width: 100%;
    display: block;
    border-radius: var(--radius-sm);
    background: #eef1f6;
    cursor: zoom-in;
    transition: opacity 0.2s ease;
}

.gallery-image:hover {
    opacity: 0.92;
}

/* 获取须知 */
.notice-section {
    padding: var(--spacing-5);
    background: var(--color-surface);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
}

.notice-section .notice-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.notice-section .notice-header h2 {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0;
}

.notice-section .notice-toggle {
    font-size: 12px;
    color: var(--color-primary);
    flex-shrink: 0;
    margin-left: var(--spacing-2);
}

.notice-section .notice-body {
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.25s ease, margin-top 0.25s ease;
    margin-top: var(--spacing-3);
    position: relative;
}

.notice-section.collapsed .notice-body {
    max-height: 58px;
}

.notice-section.collapsed .notice-body::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 24px;
    background: linear-gradient(transparent, var(--color-surface));
    pointer-events: none;
}

.notice-section p {
    font-size: 13px;
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.preview-btn {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.preview-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.qrcode-btn {
    background: linear-gradient(135deg, #2563eb, #4f8bff);
    color: #fff;
    border: none;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28);
}

.qrcode-btn:hover {
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.38);
}

.openDos-btn {
    position: relative;
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.openDos-btn:hover {
    border-color: #f59e0b;
    color: #ea580c;
}

.free-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    padding: 0 5px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fde047, #fbbf24);
    color: #7c2d12;
    font-size: 9px;
    font-weight: 700;
    line-height: 13px;
    letter-spacing: 0;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(234, 88, 12, 0.4);
    pointer-events: none;
}

/* 产品描述 */
.product-description {
    padding: var(--spacing-6);
    background: var(--color-surface);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
}

.description-content {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    line-height: 1.8;
    word-break: break-word;
}

.description-content img {
    border-radius: var(--radius-sm);
    margin: var(--spacing-3) 0;
    max-width: 100%;
}

.description-content p {
    margin-bottom: var(--spacing-3);
}

.description-content h1,
.description-content h2,
.description-content h3,
.description-content h4 {
    color: var(--color-text);
    margin-top: var(--spacing-5);
    margin-bottom: var(--spacing-2);
}

.description-content ul,
.description-content ol {
    padding-left: var(--spacing-6);
    margin-bottom: var(--spacing-3);
}

.description-content li {
    margin-bottom: var(--spacing-1);
    list-style: disc;
}

.description-content code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.875em;
    padding: 2px 4px;
    background: var(--color-bg);
    border-radius: 4px;
    color: var(--color-primary);
}

.description-content pre {
    background: var(--color-text);
    color: #e0e0e0;
    padding: var(--spacing-4);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: var(--spacing-3) 0;
}

.description-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.description-content table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-3) 0;
}

.description-content th,
.description-content td {
    padding: 6px 12px;
    border: 1px solid var(--color-border);
    text-align: left;
    font-size: var(--text-sm);
}

.description-content th {
    background: var(--color-bg);
    font-weight: 500;
}

@media (max-width: 768px) {
    .product-info,
    .product-gallery,
    .product-description,
    .notice-section {
        padding: var(--spacing-4);
    }

    .product-info {
        position: static;
    }

    .product-info.is-stuck {
        top: auto;
        border-radius: var(--radius);
        border-color: var(--color-border);
    }

    .product-info .product-title {
        font-size: var(--text-xl);
    }

    .product-info .product-head .action-buttons {
        flex: 1 1 100%;
        margin-left: 0;
    }
}

/* 操作按钮（产品详情/文档详情共用） */
.action-buttons {
    display: flex;
    gap: var(--spacing-2);
    flex-wrap: wrap;
    justify-content: flex-end;
}

.action-buttons button {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.action-buttons button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .action-buttons button {
        flex: 1;
        padding: 10px 16px;
    }
}

/* 图片/二维码模态框 */
.image-modal,
.qrcode-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 400;
    justify-content: center;
    align-items: center;
}

.image-modal .close-modal,
.qrcode-modal .close-modal {
    position: absolute;
    top: var(--spacing-4);
    right: var(--spacing-4);
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.modal-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: var(--radius);
}

.qrcode-container1 {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: var(--spacing-6);
    text-align: center;
    position: relative;
    max-width: 300px;
    width: 90%;
}

.qrcode-container1 .close-modal {
    color: var(--color-text-tertiary);
    top: var(--spacing-2);
    right: var(--spacing-3);
    font-size: 20px;
}

.qrcode-image-wrapper {
    width: 160px;
    height: 160px;
    margin: 0 auto var(--spacing-3);
}

.qrcode-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.qrcode-tip {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}
