/* ========================================
   职位解析独立样式 job_parser.css
   基于 style.css 暗色主题，主色紫青渐变
   ======================================== */

/* ---------- 职位卡片网格 ---------- */
.job-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.job-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}
.job-card:hover {
    border-color: rgba(138, 107, 255, 0.4);
    background: rgba(138, 107, 255, 0.05);
}
.job-card.active {
    border-color: #6db3f2;
    background: linear-gradient(135deg, rgba(36, 221, 218, 0.08) 0%, rgba(138, 107, 255, 0.08) 100%);
    box-shadow: 0 0 0 1px rgba(36, 221, 218, 0.3), 0 4px 20px rgba(36, 221, 218, 0.08);
}
.job-card.custom {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.15);
}
.job-card.custom:hover {
    border-color: rgba(36, 221, 218, 0.4);
}
.job-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}
.job-tag {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* ---------- JD 编辑区 ---------- */
.jd-editor {
    background: rgba(12, 20, 40, 0.6);
    border-radius: 12px;
    padding: 20px;
    border-left: 3px solid #6db3f2;
    margin-bottom: 20px;
}
.jd-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.jd-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}
.jd-job-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}
.jd-field {
    margin-bottom: 16px;
}
.jd-field:last-child {
    margin-bottom: 0;
}
.jd-field-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}
.jd-textarea {
    width: 100%;
    min-height: 90px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px 14px;
    color: #fff;
    font-size: 14px;
    line-height: 1.7;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.jd-textarea:focus {
    outline: none;
    border-color: rgba(36, 221, 218, 0.5);
}
.jd-textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* 自定义职位输入框 */
.jd-custom-name {
    margin-bottom: 16px;
}
.jd-custom-name input {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px 14px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.jd-custom-name input:focus {
    outline: none;
    border-color: rgba(36, 221, 218, 0.5);
}

/* ---------- 底部操作栏 ---------- */
.parse-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.parse-tip {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}
.btn-start {
    background: linear-gradient(135deg, #60a5fa 0%, #6db3f2 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(138, 107, 255, 0.3);
}
.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(138, 107, 255, 0.4);
}
.btn-start:active {
    transform: translateY(0);
}
.btn-start:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ---------- 加载状态 ---------- */
.loading-container {
    text-align: center;
    padding: 80px 20px;
}
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(138, 107, 255, 0.2);
    border-top-color: #60a5fa;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 24px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.loading-text {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}
.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
}
.loading-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #60a5fa, #6db3f2);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* ---------- 结果区通用结构 ---------- */
.result-container {
    animation: fadeInUp 0.5s ease;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: linear-gradient(135deg, rgba(138, 107, 255, 0.1) 0%, rgba(36, 221, 218, 0.05) 100%);
    border: 1px solid rgba(138, 107, 255, 0.2);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
}
.result-header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}
.result-avatar {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, #60a5fa 0%, #6db3f2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.result-name-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.result-name {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}
.result-badge {
    background: rgba(36, 221, 218, 0.15);
    color: #6db3f2;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
}
.result-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}
.result-header-right {
    display: flex;
    gap: 10px;
}
.btn-result-action {
    background: rgba(138, 107, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(138, 107, 255, 0.3);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.btn-result-action:hover {
    background: rgba(138, 107, 255, 0.3);
}
.btn-result-action.secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}
.btn-result-action.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ---------- 结果分区卡片 ---------- */
.result-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 22px 24px;
    margin-bottom: 16px;
}
.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}
.section-dot {
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, #60a5fa, #6db3f2);
    border-radius: 2px;
}
.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #8affd2;
}

/* ---------- 三列信息网格 ---------- */
.info-grid {
    display: grid;
    gap: 14px 24px;
}
.info-grid.three-col {
    grid-template-columns: repeat(3, 1fr);
}
.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.info-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}
.info-value {
    font-size: 14px;
    color: #fff;
    font-weight: 500;
    line-height: 1.5;
}
.info-value.highlight {
    background: linear-gradient(135deg, #60a5fa, #6db3f2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 18px;
    font-weight: 700;
}

/* ---------- 岗位标签分组 ---------- */
.tag-groups {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.tag-group {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.tag-group-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    min-width: 80px;
    padding-top: 6px;
    flex-shrink: 0;
}
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}
.job-tag-item {
    background: rgba(138, 107, 255, 0.12);
    border: 1px solid rgba(138, 107, 255, 0.25);
    color: #c7d9fb;
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 13px;
    transition: all 0.2s;
}
.job-tag-item:hover {
    background: rgba(138, 107, 255, 0.25);
    border-color: rgba(138, 107, 255, 0.5);
}

/* ---------- 结果底部 ---------- */
.result-footer {
    text-align: center;
    margin-top: 30px;
    padding-bottom: 30px;
}
.btn-restart {
    background: linear-gradient(135deg, #60a5fa 0%, #6db3f2 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(138, 107, 255, 0.3);
    font-family: inherit;
}
.btn-restart:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(138, 107, 255, 0.4);
}
.result-tip {
    margin-top: 14px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
}

/* ---------- JSON 返回结果弹窗 ---------- */
.json-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.json-modal-content {
    background: #0f172a;
    border: 1px solid rgba(138, 107, 255, 0.2);
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.json-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.json-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #fff;
}
.json-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 28px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}
.json-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.json-modal-body {
    padding: 20px 24px;
    overflow: auto;
    flex: 1;
}
.json-modal-body pre {
    margin: 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.7;
    color: #c7d9fb;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ---------- 底部备注 ---------- */
.demo-note {
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 20px;
    padding-bottom: 40px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .job-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .info-grid.three-col {
        grid-template-columns: repeat(2, 1fr);
    }
    .result-header {
        flex-direction: column;
        gap: 16px;
    }
    .result-header-right {
        width: 100%;
    }
    .btn-result-action {
        flex: 1;
    }
    .parse-footer {
        flex-direction: column;
        gap: 14px;
        align-items: stretch;
    }
    .btn-start {
        width: 100%;
    }
    .tag-group {
        flex-direction: column;
        gap: 8px;
    }
    .result-meta {
        flex-wrap: wrap;
        gap: 10px;
    }
}
.contact-qr-grid {
    display: flex;
    gap: 24px;
    justify-content: center;
}
.contact-qr-item {
    text-align: center;
}
.contact-qr-img {
    width: 128px;
    height: 128px;
    border-radius: 12px;
    background: white;
    padding: 8px;
    margin-bottom: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}
.contact-qr-img img {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    object-fit: cover;
    display: block;
}
.contact-qr-item span {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}
/* ============================================================
   AI 输出美化（职位画像 / Mapping 推测）
   ============================================================ */
#aiJdContent, #aiMapGuess {
    white-space: normal !important;
    background: rgba(8, 16, 32, 0.55) !important;
    border: 1px solid rgba(110, 160, 255, 0.18) !important;
    border-left: 3px solid #6db3f2 !important;
    border-radius: 12px !important;
    padding: 18px 20px !important;
    max-height: 60vh !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 6px 20px rgba(0,0,0,.18);
    scrollbar-width: thin;
    scrollbar-color: rgba(120,160,255,.45) transparent;
}
#aiJdContent::-webkit-scrollbar, #aiMapGuess::-webkit-scrollbar { width: 8px; }
#aiJdContent::-webkit-scrollbar-track, #aiMapGuess::-webkit-scrollbar-track {
    background: rgba(255,255,255,.03); border-radius: 8px;
}
#aiJdContent::-webkit-scrollbar-thumb, #aiMapGuess::-webkit-scrollbar-thumb {
    background: rgba(120,160,255,.42); border-radius: 8px;
}
#aiJdContent::-webkit-scrollbar-thumb:hover, #aiMapGuess::-webkit-scrollbar-thumb:hover {
    background: rgba(120,160,255,.65);
}

#aiJdContent h2, #aiMapGuess h2 {
    font-size: 17px; font-weight: 700; color: #eaf2ff;
    margin: 4px 0 12px; padding-bottom: 8px;
    border-bottom: 1px solid rgba(120,160,255,.18);
}
#aiJdContent h3, #aiMapGuess h3 {
    font-size: 15px; font-weight: 700; color: #cfe0ff;
    margin: 18px 0 8px; padding-left: 10px;
    border-left: 3px solid #6db3f2;
}
#aiJdContent h4, #aiMapGuess h4 {
    font-size: 14px; font-weight: 600; color: #b9cdf0;
    margin: 14px 0 6px;
}
#aiJdContent p, #aiMapGuess p {
    font-size: 13.5px; line-height: 1.95; color: rgba(255,255,255,.78);
    margin: 0 0 10px;
}
#aiJdContent ul, #aiMapGuess ul {
    margin: 6px 0 12px; padding-left: 20px; list-style: none;
}
#aiJdContent li, #aiMapGuess li {
    position: relative; font-size: 13.5px; line-height: 1.9;
    color: rgba(255,255,255,.76); margin-bottom: 6px; padding-left: 14px;
}
#aiJdContent li::before, #aiMapGuess li::before {
    content: ''; position: absolute; left: 0; top: 11px;
    width: 5px; height: 5px; border-radius: 50%;
    background: #6db3f2; opacity: .8;
}
#aiJdContent ul.ai-ol, #aiMapGuess ul.ai-ol { padding-left: 22px; }
#aiJdContent ul.ai-ol li, #aiMapGuess ul.ai-ol li { padding-left: 30px; }
#aiJdContent ul.ai-ol li::before, #aiMapGuess ul.ai-ol li::before { content: none; }
#aiJdContent .ai-num, #aiMapGuess .ai-num {
    position: absolute; left: 0; top: 0;
    min-width: 22px; font-weight: 700; color: #7fb6f5; font-size: 13px;
}
#aiJdContent strong, #aiMapGuess strong { color: #dbe9ff; font-weight: 700; }
#aiJdContent code, #aiMapGuess code {
    background: rgba(120,160,255,.14); color: #a9cbff;
    padding: 1px 6px; border-radius: 4px; font-size: 12.5px;
}
#aiJdContent hr, #aiMapGuess hr {
    border: none; border-top: 1px dashed rgba(120,160,255,.22); margin: 14px 0;
}
