/* 项目信息面板：搜索框 + 2×6 网格（数据来自 Cloudflare Worker + KV） */
#mw-content-text {
    position: relative;
}

.proj-panel {
    z-index: 30;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 16vh;
    pointer-events: none;
}

.proj-search {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    max-width: 760px;
    margin: 0 auto 22px;
    pointer-events: auto;
}

.proj-search input {
    flex: 1;
    height: 48px;
    padding: 0 22px;
    font-size: 16px;
    color: #2b2b2b;
    background: rgba(255, 255, 255, 0.93);
    border: 2px solid #7fb3e8;
    border-radius: 24px;
    outline: none;
    box-sizing: border-box;
}

.proj-search input:focus {
    border-color: #4d8ae3;
    box-shadow: 0 0 0 3px rgba(77, 138, 227, 0.18);
}

.proj-search button {
    height: 48px;
    padding: 0 30px;
    font-size: 16px;
    color: #fff;
    background: linear-gradient(1deg, #4d8ae3 0%, #435eb8 86%);
    border: none;
    border-radius: 24px;
    cursor: pointer;
}

.proj-search button:hover {
    opacity: 0.9;
}

.proj-status {
    min-height: 22px;
    margin-bottom: 14px;
    text-align: center;
    font-size: 14px;
    color: #7a7a7a;
}

.proj-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 1fr;
    gap: 18px;
    margin-top: 21vh;
    pointer-events: auto;
}

.proj-card {
    min-height: 170px;
    padding: 16px 14px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 7px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #e3ecf7;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(46, 91, 166, 0.08);
}

.proj-card .proj-title {
    font-size: 15px;
    font-weight: 700;
    color: #2c3e6b;
    line-height: 1.4;
}

.proj-card .proj-deadline {
    font-size: 13px;
    font-weight: 600;
    color: #000;
}

.proj-card .proj-details {
    font-size: 13px;
    color: #555;
    line-height: 1.55;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.proj-empty {
    grid-column: 1 / -1;
    padding: 34px 0;
    text-align: center;
    color: #999;
    font-size: 14px;
}

@media (max-width: 1100px) {
    .proj-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .proj-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .proj-search {
        flex-direction: column;
    }

    .proj-search input,
    .proj-search button {
        width: 100%;
    }
}

/* 「点击了解更多」入口卡片 */
.proj-more {
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background: linear-gradient(1deg, #4d8ae3 0%, #435eb8 86%);
    border: none;
}

.proj-more:hover {
    opacity: 0.92;
}

.proj-more-inner {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-align: center;
}

/* 项目总览页 */
.proj-page {
    position: relative;
    z-index: 20;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 130px 24px 60px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.proj-page-title {
    margin: 0 0 22px;
    font-size: 28px;
    font-weight: 700;
    color: #2c3e6b;
    text-align: center;
}

/* 学术信息库页：搜索框下移 */
.proj-page .proj-search {
    margin-top: 10vh;
}

/* 分页控件 */
.proj-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 26px;
    flex-wrap: wrap;
}

.proj-pagination button {
    min-width: 40px;
    height: 36px;
    padding: 0 12px;
    font-size: 14px;
    color: #2c3e6b;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #cfe0f3;
    border-radius: 8px;
    cursor: pointer;
}

.proj-pagination button:hover:not(:disabled) {
    background: #e8f1fb;
}

.proj-pagination button:disabled {
    opacity: 0.5;
    cursor: default;
}

.proj-pagination button.proj-page-act {
    color: #fff;
    background: linear-gradient(1deg, #4d8ae3 0%, #435eb8 86%);
    border-color: transparent;
}

/* 项目详情弹窗 */
.proj-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.proj-modal-show {
    display: block;
}

.proj-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(20, 30, 60, 0.55);
}

.proj-modal-box {
    position: relative;
    width: min(640px, 92vw);
    margin: 16vh auto 0;
    padding: 28px 30px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
}

.proj-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 32px;
    height: 32px;
    line-height: 30px;
    text-align: center;
    font-size: 22px;
    color: #666;
    cursor: pointer;
    border-radius: 50%;
}

.proj-modal-close:hover {
    background: #f0f3f8;
    color: #222;
}

.proj-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e6b;
    line-height: 1.45;
    padding-right: 30px;
}

.proj-modal-deadline {
    margin-top: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #000;
}

.proj-modal-details {
    margin-top: 14px;
    font-size: 15px;
    line-height: 1.8;
    color: #444;
}

/* 即将截止（7 天内）提醒 */
.proj-card.proj-urgent {
    border-color: #f0b7b2;
    box-shadow: 0 4px 14px rgba(217, 83, 79, 0.18);
    position: relative;
}

.proj-card.proj-urgent .proj-deadline {
    color: #d9534f;
}

.proj-urgent-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 7px;
    font-size: 11px;
    line-height: 1.4;
    color: #fff;
    background: #d9534f;
    border-radius: 8px;
}

/* 搜索关键词高亮 */
.proj-hl {
    background: #ffe58f;
    color: #222;
    padding: 0 1px;
    border-radius: 2px;
}

/* 卡片结构化标签 */
.proj-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.proj-tag {
    padding: 2px 7px;
    font-size: 11px;
    line-height: 1.4;
    color: #2c3e6b;
    background: #e8f1fb;
    border-radius: 9px;
    white-space: nowrap;
}

/* 详情弹窗结构化信息 */
.proj-modal-details-text {
    margin-bottom: 10px;
}

.proj-modal-info {
    border-top: 1px dashed #dbe7f3;
    padding-top: 10px;
    margin-top: 4px;
}

.proj-modal-info-row {
    display: flex;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 14px;
    line-height: 1.6;
}

.proj-modal-info-row .k {
    flex: 0 0 72px;
    color: #8893a8;
}

.proj-modal-info-row .v {
    flex: 1;
    color: #333;
    word-break: break-all;
}

.proj-modal-info-row .v a {
    color: #2c6fd0;
    text-decoration: none;
}

.proj-modal-info-row .v a:hover {
    text-decoration: underline;
}
