/* 技能徽章 */
.skill-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.skill-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    border: none;
}
.skill-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    filter: brightness(1.1);
}
.skill-badge .badge-count {
    background: rgba(255,255,255,0.3);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.75rem;
}
.skill-extra {
    font-size: 0.85rem;
    color: #666;
    margin-top: 6px;
    line-height: 1.6;
}
/* 技能总览遮罩 */
.overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 900;
    animation: fadeIn 0.2s;
}
.overlay.active { display: block; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
/* 技能总览面板 */
.skill-panel {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 950;
    background: #f5f5f5;
    animation: slideUp 0.3s;
}
/* 头部固定在面板顶部，只有内容区滚动，返回按钮始终可见 */
.skill-panel.active {
    display: flex;
    flex-direction: column;
}
.skill-panel-body {
    flex: 1 1 auto;
    overflow-y: auto;
}
@keyframes slideUp { from{transform:translateY(30px);opacity:0} to{transform:translateY(0);opacity:1} }
.skill-panel-header {
    flex: 0 0 auto;
    background: white;
    padding: 20px 30px;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    z-index: 10;
}
.skill-panel-title {
    font-size: 1.4rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 12px;
}
.skill-panel-title .color-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    display: inline-block;
}
.skill-panel-stats {
    font-size: 0.9rem;
    color: #666;
    display: flex;
    gap: 16px;
}
.stat-item { display: flex; align-items: center; gap: 4px; }
.stat-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.btn-back {
    padding: 8px 20px;
    background: #2c5aa0;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
    /* 标题再长也只换行标题，按钮永远单行贴在右上角 */
    flex: 0 0 auto;
    white-space: nowrap;
}
.btn-back:hover { background: #1e3d6f; }
.skill-panel-header > div:first-child,
.question-panel-title {
    min-width: 0;
    overflow-wrap: anywhere;
}
/* 面板分区：关联项目 / 知识点与测评 */
.section-head {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 30px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.section-title {
    font-size: 1.05rem;
    font-weight: bold;
    color: #2c3e50;
    border-left: 4px solid #2c5aa0;
    padding-left: 10px;
}
.btn-expand {
    padding: 6px 16px;
    background: white;
    color: #2c5aa0;
    border: 1px solid #2c5aa0;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-expand:hover { background: #2c5aa0; color: white; }
.skill-section + .skill-section { border-top: 1px solid #e3e3e3; margin-top: 12px; }
.skill-section .skill-panel-stats {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px 4px;
}
/* 知识卡片网格 */
.cards-container {
    padding: 24px 30px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    max-width: 1400px;
    margin: 0 auto;
}
.knowledge-card {
    background: white;
    border-radius: 10px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid #ccc;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    min-height: 110px;
    position: relative;
}
.knowledge-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.knowledge-card.status-mastered { border-left-color: #27ae60; }
.knowledge-card.status-basic { border-left-color: #f39c12; }
.knowledge-card.status-weak { border-left-color: #e74c3c; }
.knowledge-card.status-not_tested { border-left-color: #bdc3c7; }
.card-title {
    font-size: 0.95rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}
.card-id {
    font-size: 0.75rem;
    color: #999;
    margin-bottom: 10px;
}
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}
.card-date {
    font-size: 0.78rem;
    color: #999;
}
.card-score {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    font-weight: bold;
}
.score-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: white;
}
.score-mastered { color: #27ae60; }
.score-mastered .score-icon { background: #27ae60; }
.score-basic { color: #f39c12; }
.score-basic .score-icon { background: #f39c12; }
.score-weak { color: #e74c3c; }
.score-weak .score-icon { background: #e74c3c; }
.score-not_tested { color: #bdc3c7; }
.score-not_tested .score-icon { background: #bdc3c7; }
/* 问题详情面板 */
.question-panel {
    display: none;
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(80vw, 900px);
    z-index: 1000;
    background: white;
    box-shadow: -5px 0 20px rgba(0,0,0,0.2);
    overflow: hidden;
    animation: slideIn 0.3s;
}
.question-panel.active {
    display: flex;
    flex-direction: column;
}
@keyframes slideIn { from{transform:translateX(100%)} to{transform:translateX(0)} }

/* 桌面端居中模态框 */
@media screen and (min-width: 1025px) {
    .question-panel {
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        transform: translate(-50%, -50%);
        width: 80vw;
        height: 100vh;
        box-shadow: 0 10px 40px rgba(0,0,0,0.3);
        border-radius: 12px;
        animation: fadeIn 0.3s;
    }
    @keyframes fadeIn { from{opacity:0; transform:translate(-50%, -50%) scale(0.95)} to{opacity:1; transform:translate(-50%, -50%) scale(1)} }
}
.question-panel-header {
    flex: 0 0 auto;
    background: white;
    padding: 16px 24px;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    z-index: 10;
}
.question-panel-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #2c5aa0;
}
.question-panel-content {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 24px;
    font-size: 0.95rem;
    line-height: 1.8;
    color: #333;
}
.question-panel-content h1 { font-size: 1.5rem; color: #2c5aa0; margin: 20px 0 12px; border-bottom: 2px solid #2c5aa0; padding-bottom: 8px; }
.question-panel-content h2 { font-size: 1.3rem; color: #2c5aa0; margin: 18px 0 10px; }
.question-panel-content h3 { font-size: 1.1rem; color: #333; margin: 14px 0 8px; }
.question-panel-content pre { background: #f6f8fa; padding: 14px; border-radius: 6px; overflow-x: auto; font-size: 0.88rem; line-height: 1.5; }
.question-panel-content code { background: #f0f0f0; padding: 2px 5px; border-radius: 3px; font-size: 0.88rem; }
.question-panel-content pre code { background: none; padding: 0; }
.question-panel-content table { border-collapse: collapse; width: 100%; margin: 12px 0; }
.question-panel-content th, .question-panel-content td { border: 1px solid #ddd; padding: 8px 12px; text-align: left; }
.question-panel-content th { background: #f6f8fa; font-weight: bold; }
.question-panel-content blockquote { border-left: 4px solid #2c5aa0; margin: 12px 0; padding: 8px 16px; background: #f8f9fa; color: #555; }
.question-panel-content ul, .question-panel-content ol { padding-left: 24px; margin: 8px 0; }
.question-panel-content li { margin-bottom: 4px; }
.question-panel-content hr { border: none; border-top: 1px solid #e0e0e0; margin: 20px 0; }
.question-panel-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: rgba(0,0,0,0.3);
    z-index: 999;
}
.question-panel-overlay.active { display: block; }
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1rem;
}
.loading-spinner::after {
    content: '';
    display: inline-block;
    width: 20px; height: 20px;
    border: 2px solid #ccc;
    border-top-color: #2c5aa0;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}
@keyframes spin { to{transform:rotate(360deg)} }
/* 响应式设计 */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
    }
    .resume-container {
        grid-template-columns: 1fr;
    }
    .sidebar {
        border-right: none;
        border-bottom: 3px solid #2c5aa0;
        padding: 30px 20px;
    }
    .main-content {
        padding: 30px 20px;
    }
    .section-title {
        font-size: 1.1rem;
    }
    .skills-table td {
        padding: 8px 6px;
        font-size: 0.85rem;
    }
    .skills-table td:first-child {
        width: 70px;
        font-size: 0.8rem;
    }
    .exp-header {
        flex-direction: column;
        gap: 5px;
    }
    .exp-date {
        min-width: auto;
    }
    .exp-list {
        padding-left: 20px;
        font-size: 0.85rem;
    }
    .project-desc {
        font-size: 0.85rem;
    }
}
@media screen and (max-width: 480px) {
    .name {
        font-size: 1.5rem;
    }
    .objective {
        font-size: 0.85rem;
    }
    .contact-item {
        font-size: 0.85rem;
    }
    .sidebar-content {
        font-size: 0.8rem;
    }
}
@media screen and (max-width: 1024px) {
    /* 窄屏也不让返回按钮跑到标题下方，保持右上角 */
    .skill-panel-header,
    .question-panel-header {
        padding: 14px 16px;
        gap: 10px;
    }
    .cards-container {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        padding: 16px;
    }
    .section-head {
        padding: 16px 16px 8px;
    }
    .skill-section .skill-panel-stats {
        padding: 0 16px 4px;
    }
    .question-panel {
        width: 100vw;
    }
    .skill-panel-stats {
        flex-wrap: wrap;
        gap: 8px;
    }
}
@media screen and (max-width: 480px) {
    .cards-container {
        grid-template-columns: 1fr;
        padding: 12px;
    }
    .skill-badge {
        font-size: 0.8rem;
        padding: 5px 10px;
    }
}