/* 项目详情页专用样式 - 与 index.html 风格保持一致 */
html {
    --more-button-height: 40px;
    --more-button-width: 400px;
    --more-button-init-width: 40px;
    --card-background-color: rgba(68, 150, 239, 0.5);
    --web-title-background-color: rgba(26, 109, 197, 0.5);
    --sub-card-background-color: rgba(89, 178, 246, 0.2);
    --sub-card-hover-color: rgba(89, 178, 246, 0.4);
    --surface-shadow-color: rgba(22, 96, 226, 0.28);
    background-color: #000000;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    color: #ffffff;
}

::-webkit-scrollbar {
    display: none;
}

* {
    scrollbar-width: none;
}

.background-star-canvas {
    position: fixed;
    left: 0;
    top: 0;
    z-index: -1;
}

.project-container {
    position: relative;
    display: flex;
    justify-content: center;
    margin: 0 auto;
    max-width: 1240px;
    overflow: visible;
    flex: 1;
}

.project-layout {
    width: min(100%, 760px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    overflow: visible;
}

.project-layout--compact {
    width: min(100%, 620px);
}

.project-layout--regular {
    width: min(100%, 820px);
}

.project-layout--wide {
    width: min(100%, 1040px);
}

/* 通用卡片表面 */
.project-surface {
    background: var(--card-background-color);
    border-radius: 20px;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: none;
    box-shadow: 0 10px 32px var(--surface-shadow-color);
    padding: 22px 28px;
}

/* 标题卡片 - 对齐 index.html .web-title */
.project-hero {
    padding: 5px 28px;
    background: var(--web-title-background-color);
    border-radius: 99999px;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    text-align: center;
    min-width: 200px;
    max-width: 70%;
    margin: 30px auto 20px auto;
    align-self: center;
}

.project-title {
    font-size: 25px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    line-height: 1.4;
}

/* 描述区域 */
.description-section {
    background: var(--card-background-color);
    border-radius: 20px;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border: none;
    box-shadow: 0 10px 32px var(--surface-shadow-color);
    padding: 22px 28px;
}

.section-heading {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 16px 0;
}

.description-text {
    font-size: 17px;
    color: #ffffff;
    line-height: 1.7;
    min-height: 80px;
}

.description-text p:first-child {
    margin-top: 0;
}

.description-text p:last-child {
    margin-bottom: 0;
}

/* ===== Markdown 渲染样式 ===== */
.description-text h1,
.description-text h2,
.description-text h3,
.description-text h4,
.description-text h5,
.description-text h6 {
    color: #ffffff;
    line-height: 1.4;
    margin: 1.2em 0 0.6em 0;
    font-weight: 700;
}

.description-text h1 {
    font-size: 24px;
}

.description-text h2 {
    font-size: 21px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.description-text h3 {
    font-size: 19px;
}

.description-text h4 {
    font-size: 17px;
}

.description-text h5,
.description-text h6 {
    font-size: 16px;
}

.description-text > :first-child {
    margin-top: 0;
}

.description-text > :last-child {
    margin-bottom: 0;
}

.description-text ul,
.description-text ol {
    padding-left: 1.4em;
    margin: 0.6em 0;
}

.description-text li {
    margin: 0.25em 0;
}

.description-text li > ul,
.description-text li > ol {
    margin: 0.25em 0;
}

.description-text strong {
    color: #ffffff;
    font-weight: 700;
}

.description-text em {
    color: #e0e0e0;
}

.description-text blockquote {
    margin: 0.8em 0;
    padding: 0.6em 1em;
    border-left: 4px solid var(--underline-color, #1ea6ec);
    background: var(--sub-card-background-color);
    border-radius: 0 10px 10px 0;
    color: #d7e6f5;
}

.description-text blockquote p {
    margin: 0;
}

.description-text code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    background: rgba(0, 0, 0, 0.35);
    padding: 0.15em 0.4em;
    border-radius: 5px;
    font-size: 0.9em;
    color: #7ee0c0;
    word-break: break-all;
}

.description-text pre {
    background: rgba(0, 0, 0, 0.45);
    padding: 14px 16px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 0.8em 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.description-text pre code {
    background: transparent;
    padding: 0;
    color: #d5e6f7;
    font-size: 0.88em;
    line-height: 1.55;
}

.description-text hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin: 1.2em 0;
}

.description-text table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.8em 0;
    font-size: 0.95em;
    overflow-x: auto;
    display: block;
}

.description-text th,
.description-text td {
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 8px 12px;
    text-align: left;
}

.description-text th {
    background: var(--sub-card-background-color);
    color: #ffffff;
    font-weight: 600;
}

.description-text a {
    color: #5ab9ff;
    text-decoration: none;
    word-break: break-all;
    --underline-color: #1ea6ec;
    background: linear-gradient(to right, var(--underline-color), var(--underline-color)) right bottom no-repeat;
    background-size: 0px 2px;
    transition: background-size 0.3s ease;
}

.description-text a:hover {
    color: #7ec8ff;
    background-position: left bottom;
    background-size: 100% 2px;
}

.description-text a:active {
    color: #4a9fef;
}

.description-text img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 0.6em 0;
}

.description-text input[type="checkbox"] {
    margin-right: 6px;
}

.description-text .description-link {
    color: #5ab9ff;
    text-decoration: none;
    word-break: break-all;
    --underline-color: #1ea6ec;
    background: linear-gradient(to right, var(--underline-color), var(--underline-color)) right bottom no-repeat;
    background-size: 0px 2px;
    transition: background-size 0.3s ease;
}

.description-text .description-link:hover {
    color: #7ec8ff;
    background-position: left bottom;
    background-size: 100% 2px;
}

.description-link {
    color: #5ab9ff;
    text-decoration: none;
    word-break: break-all;
    --underline-color: #1ea6ec;
    background: linear-gradient(to right, var(--underline-color), var(--underline-color)) right bottom no-repeat;
    background-size: 0px 2px;
    transition: background-size 0.3s ease;
}

.description-link:hover {
    color: #7ec8ff;
    background-position: left bottom;
    background-size: 100% 2px;
    /* border-bottom-style: solid; */
    /* text-shadow: 0 0 8px rgba(126, 200, 255, 0.6); */
}

.description-link:active {
    color: #4a9fef;
    border-bottom-color: #4a9fef;
}

/* 中段网格 */
.project-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 20px;
    align-items: start;
    overflow: visible;
}

/* 元信息卡片 */
.meta-section {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.meta-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.meta-group+.meta-group {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.tag-container {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    background: var(--sub-card-background-color);
    color: #ffffff;
    border: none;
}

.version-tag {
    font-size: 12px;
    opacity: 0.85;
}

/* 操作卡片 */
.action-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: visible;
    z-index: 2;
}

.version-selector {
    width: 100%;
}

.version-dropdown {
    position: relative;
    z-index: 20;
}

.version-dropdown-trigger {
    padding: 14px 16px;
    background: var(--sub-card-background-color);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.version-dropdown-trigger:hover {
    background: var(--sub-card-hover-color);
}

.version-dropdown-trigger.active {
    background: var(--sub-card-hover-color);
    border-radius: 10px 10px 0 0;
    border-color: rgba(89, 178, 246, 0.55);
}

.version-dropdown-arrow {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.version-dropdown-trigger.active .version-dropdown-arrow {
    transform: rotate(180deg);
}

.version-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgb(49 120 175);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-top: none;
    border-radius: 0 0 10px 10px;
    transform-origin: top center;
    transform: scaleY(0);
    transition: transform 0.3s ease, opacity 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    z-index: 120;
    box-shadow: 0 18px 28px rgba(12, 52, 130, 0.32);
}

.version-dropdown-menu.open {
    transform: scaleY(1);
    opacity: 1;
}

.version-dropdown-item {
    padding: 14px 16px;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.version-dropdown-item:hover {
    background: var(--sub-card-hover-color);
    color: #ffffff;
}

.version-dropdown-item.selected {
    background: rgba(89, 178, 246, 0.38);
    color: #ffffff;
}

.version-dropdown-check {
    width: 18px;
    height: 18px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.version-dropdown-item.selected .version-dropdown-check {
    opacity: 1;
}

.version-latest-tag {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(89, 178, 246, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 2px 8px rgba(89, 178, 246, 0.3);
    }

    50% {
        box-shadow: 0 2px 12px rgba(89, 178, 246, 0.45);
    }

    100% {
        box-shadow: 0 2px 8px rgba(89, 178, 246, 0.3);
    }
}

.version-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.version-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--sub-card-background-color);
    border-radius: 10px;
    text-decoration: none;
    color: #e0e0e0;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.version-btn:hover {
    background: var(--sub-card-hover-color);
    box-shadow: 0 10px 24px rgba(68, 150, 239, 0.16);
    cursor: pointer;
}

.version-btn-text {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 500;
}

.version-btn-arrow {
    color: rgba(255, 255, 255, 0.78);
}

/* 底部项目 ID */
.project-id-card {
    text-align: center;
    font-size: 14px;
    color: #ffffff;
    padding: 14px 28px;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);   /* 模糊遮罩 */
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: rgb(20 93 150 / 51%);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.1s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: rgba(68, 150, 239, 0.2);
    border-radius: 12px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: 1px solid rgba(68, 150, 239, 0.3);
}

.modal-close:hover {
    background: var(--sub-card-hover-color);
    box-shadow: 0 0 10px rgba(68, 150, 239, 0.4);
}

.download-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.download-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgb(17 105 172 / 62%);
    border-radius: 10px;
    text-decoration: none;
    color: #e0e0e0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.download-option:hover {
    background: var(--sub-card-hover-color);
    box-shadow: 0 8px 18px rgba(68, 150, 239, 0.18);
}

.download-option-text {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 500;
}

.download-option-arrow {
    color: rgba(255, 255, 255, 0.78);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 加载/错误 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #5ab9ff;
    font-size: 18px;
}

.loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid rgba(90, 185, 255, 0.3);
    border-top-color: #5ab9ff;
    border-radius: 50%;
    margin-left: 12px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-message {
    text-align: center;
    padding: 40px;
    color: #ff6b6b;
    font-size: 18px;
}

/* 备案信息 */
.beian-box {
    position: relative;
    width: 100%;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: calc(50% - 50vw);
    padding-right: calc(50% - 50vw);
    background-color: rgba(46, 46, 46, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 0;
    margin-top: 20px;
}

.beian-text {
    font-family: Arial, Helvetica, sans-serif;
    margin-left: 20px;
    font-size: 13px;
    color: #ababab;
    text-decoration: none;
    font-weight: normal;
}

/* 响应式 */
@media (max-width: 768px) {
    .project-container {
        padding-top: 92px;
        padding-bottom: 24px;
        padding-left: 8px;
        padding-right: 8px;
    }

    .project-layout {
        gap: 16px;
    }

    .project-content-grid {
        grid-template-columns: 1fr;
    }

    .project-hero {
        margin: 20px auto 10px auto;
        max-width: 85%;
    }

    .project-title {
        font-size: 22px;
    }

    .project-surface,
    .description-section {
        padding: 18px 20px;
    }
}