/* style.css - 科技感暗黑微光志愿系统样式 */

/* ── 1. 全局样式重置与核心变量 ── */
:root {
    --bg-dark: #f0f4f8;
    --bg-card: #ffffff;
    --border-color: rgba(0, 0, 0, 0.08);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    
    --color-primary: #1e3a8a; /* 靛蓝 */
    --color-primary-glow: rgba(30, 58, 138, 0.15);
    --color-purple: #b45309; /* 紫罗兰 */
    
    --color-rush: #dc2626; /* 红色 - 冲 */
    --color-rush-glow: rgba(220, 38, 38, 0.15);
    
    --color-stable: #d97706; /* 橙色 - 稳 */
    --color-stable-glow: rgba(217, 119, 6, 0.15);
    
    --color-safe: #059669; /* 绿色 - 保 */
    --color-safe-glow: rgba(5, 150, 105, 0.15);
    
    --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ── 2. 动态氛围背景 (Stars & Glow Orbs) ── */
.stars-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(1px 1px at 20px 30px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 100px 150px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 200px 80px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 350px 240px, #rgba(0,0,0,0.7), rgba(0,0,0,0)),
        radial-gradient(1px 1px at 500px 400px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 650px 250px, #ffffff, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 800px 800px;
    opacity: 0.15;
    z-index: -3;
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.28;
    z-index: -2;
    pointer-events: none;
    animation: floatGlow 18s infinite alternate ease-in-out;
}

.orb-1 {
    top: -10%;
    right: 5%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--color-primary) 0%, rgba(0,0,0,0) 70%);
}

.orb-2 {
    bottom: -10%;
    left: 5%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--color-purple) 0%, rgba(0,0,0,0) 70%);
    animation-delay: -5s;
}

@keyframes floatGlow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, 40px) scale(1.15); }
}

/* ── 3. 主容器与磨砂玻璃卡片 ── */
.app-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%;
    max-width: 580px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    display: none; /* 默认隐藏 */
    transform: translateY(15px);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s ease;
}

.glass-card.active {
    display: block; /* JS 通过 rAF 双帧触发，初始痒登录面板由 HTML active class 直接生效 */
    transform: translateY(0);
    opacity: 1;
}

/* ── 4. 卡片头部与尾部 ── */
.card-header {
    text-align: center;
    margin-bottom: 35px;
}

.brand-logo {
    font-size: 48px;
    margin-bottom: 12px;
}

h1, h2, h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.5px;
}

h1 {
    font-size: 26px;
    background: linear-gradient(135deg, #dc2626 0%, #b45309 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

h2 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.card-footer {
    margin-top: 35px;
    text-align: center;
    font-size: 11px;
    color: rgba(0, 0, 0, 0.35);
    line-height: 1.5;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 20px;
}

/* ── 5. 表单输入与按钮 ── */
.input-group, .form-group {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
}

label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

input[type="text"], input[type="number"], select {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

input[type="text"]:focus, input[type="number"]:focus, select:focus {
    background: rgba(0, 0, 0, 0.07);
    border-color: var(--color-primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-sans);
    border-radius: 12px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-purple) 100%);
    color: #ffffff;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
}

.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,0.15) 100%);
    transform: skewX(-25deg);
    transition: none;
}

.btn-glow:hover::after {
    animation: flashGlow 1.2s ease;
}

@keyframes flashGlow {
    100% { left: 150%; }
}

.error-msg {
    color: #dc2626;
    font-size: 12px;
    margin-bottom: 15px;
    text-align: left;
    display: none;
}

/* ── 6. 填报表单专有布局与 Chips ── */
#form-panel {
    max-width: 780px; /* 填写表单页稍宽一些 */
}

.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 20px;
}

.cdkey-badge {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 12px;
    padding: 8px 14px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cdkey-badge .label {
    color: var(--text-secondary);
}

.cdkey-badge .value {
    color: var(--text-primary);
    font-weight: 600;
}

.cdkey-badge .badge {
    background: var(--color-primary);
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 10px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.flex-group-2 { flex: 2; }
.flex-group-1 { flex: 1; }

.score-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.score-input-wrapper input {
    width: 100%;
    padding-right: 140px; /* 给右侧的标签留白 */
}

.batch-tag {
    position: absolute;
    right: 12px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #3730a3;
    padding: 4px 10px;
    border-radius: 8px;
    pointer-events: none;
    transition: all 0.3s ease;
}

/* 专科模式特有黄色高亮 */
.batch-tag.junior-mode {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
    color: #92400e;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.subject-chips, .province-chips, .city-chips, .school-tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* 选科胶囊芯片 */
.chip {
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.chip:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.2);
}

.chip.selected {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-purple) 100%);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* 辅助型小芯片 */
.chip-sm {
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.chip-sm:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

.chip-sm.selected {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--color-primary);
    color: #3730a3;
}

.form-help {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.3);
    margin-top: 8px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 35px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 25px;
}

.form-actions .btn-secondary {
    flex: 1;
}

.form-actions .btn-primary {
    flex: 2;
}

/* ── 7. 结果看板布局 ── */
.result-layout {
    display: none; /* 默认隐藏 */
    width: 100%;
    max-width: 1280px;
    flex-direction: column;
    gap: 25px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.result-layout.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.result-header {
    width: 100%;
    max-width: 100% !important;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px 35px;
    /* 独立的玻璃卡片样式，不继承 .glass-card 的 opacity:0 */
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    opacity: 1;                /* ← 强制可见，不被 glass-card 影响 */
}

/* 顶行：左侧标题 + 右侧下载按钮 */
.result-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.summary-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-icon {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--text-secondary);
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
}

.download-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

/* 全新下载按钮样式 — 明显可见，不依赖 .btn 基类 */
.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s ease;
    white-space: nowrap;
    min-width: 200px;
}

.btn-download-txt {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #3730a3;                  /* 明亮的靛蓝色文字 */
}

.btn-download-txt:hover {
    background: rgba(99, 102, 241, 0.28);
    border-color: rgba(99, 102, 241, 0.7);
    color: #312e81;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.btn-download-xlsx {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border: 1px solid rgba(16, 185, 129, 0.5);
    color: #ffffff;                  /* 纯白文字 */
    box-shadow: 0 3px 12px rgba(16, 185, 129, 0.2);
}

.btn-download-xlsx:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
}

/* ── 8. 三栏看板排版 ── */
.kanban-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    width: 100%;
}

.kanban-col {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 25px 15px;
    display: flex;
    flex-direction: column;
    height: 75vh;
}

.col-header {
    padding: 0 10px 20px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.col-desc {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.col-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-right: 5px;
}

/* 滚动条美化 */
.col-list::-webkit-scrollbar {
    width: 4px;
}
.col-list::-webkit-scrollbar-track {
    background: transparent;
}
.col-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}
.col-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* 顶线分类颜色 */
.col-rush { border-top: 3px solid var(--color-rush); }
.col-rush h3 { color: var(--color-rush); }

.col-stable { border-top: 3px solid var(--color-stable); }
.col-stable h3 { color: var(--color-stable); }

.col-safe { border-top: 3px solid var(--color-safe); }
.col-safe h3 { color: var(--color-safe); }

/* ── 9. 单条志愿卡片设计 (Volunteer Card) ── */
.volunteer-card {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}

.volunteer-card:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    transform: translateX(2px);
}

.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.major-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.strategy-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.badge-rush { background: var(--color-rush-glow); color: #9f1239; border: 1px solid rgba(244, 63, 94, 0.3); }
.badge-stable { background: var(--color-stable-glow); color: #92400e; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-safe { background: var(--color-safe-glow); color: #065f46; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-super-safe { background: rgba(99, 102, 241, 0.15); color: #3730a3; border: 1px solid rgba(99, 102, 241, 0.3); }

.school-name {
    font-size: 12px;
    color: #374151;
    font-weight: 500;
}

.card-data-row {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.03);
    padding-top: 8px;
}

.card-data-row span {
    background: rgba(0, 0, 0, 0.02);
    padding: 2px 6px;
    border-radius: 4px;
}

.hint-row {
    font-size: 10px;
    color: rgba(0, 0, 0, 0.35);
    background: rgba(0, 0, 0, 0.01);
    padding: 4px 8px;
    border-radius: 4px;
    border-left: 2px solid rgba(0, 0, 0, 0.15);
}

.hint-row.relaxed {
    border-left-color: var(--color-stable);
    color: #92400e;
    background: rgba(245, 158, 11, 0.03);
}

/* ── 10. loading 遮罩动效 ── */
.loading-mask {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none; /* 默认隐藏 */
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.loader-box {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(99, 102, 241, 0.1);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin: 0 auto 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.loading-subtext {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ── 11. 响应式布局优化 ── */
@media (max-width: 1024px) {
    .kanban-container {
        grid-template-columns: 1fr; /* 平铺 */
    }
    .kanban-col {
        height: auto;
        max-height: 550px;
    }
    .result-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 20px;
    }
    .summary-info {
        flex-direction: column;
    }
}
@media (max-width: 580px) {
    .glass-card {
        padding: 25px 20px;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .form-actions {
        flex-direction: column-reverse;
    }
}

/* ── 12. 自由文本输入区 (v2.0 新增) ── */
.free-text-area {
    width: 100%;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.7;
    padding: 16px 18px;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    outline: none;
}

.free-text-area::placeholder {
    color: rgba(0, 0, 0, 0.22);
    font-size: 13px;
}

.free-text-area:focus {
    border-color: var(--color-primary);
    background: rgba(99, 102, 241, 0.04);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* 示例标签行 */
.free-text-examples {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.example-label {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.example-tag {
    font-size: 11px;
    color: rgba(165, 180, 252, 0.85);
    background: rgba(99, 102, 241, 0.07);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.example-tag:hover {
    background: rgba(99, 102, 241, 0.14);
    border-color: rgba(99, 102, 241, 0.35);
    color: #3730a3;
    transform: translateY(-1px);
}

/* ── 13. 结果页：AI 解析摘要栏 ── */
.ai-summary-bar {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: 10px;
    padding: 10px 16px;
    margin-top: 12px;
    font-size: 13px;
}

.ai-label {
    color: #3730a3;
    font-weight: 600;
    white-space: nowrap;
}

#ai-summary-text {
    color: rgba(0, 0, 0, 0.78);
    line-height: 1.6;
    flex: 1;
}

/* 专家策略指南面板 */
.strategy-guide-panel {
    background: linear-gradient(145deg, rgba(255, 250, 240, 0.9) 0%, rgba(255, 237, 213, 0.8) 100%);
    border: 1px solid rgba(217, 119, 6, 0.2);
    border-radius: 12px;
    padding: 18px 24px;
    margin-top: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.strategy-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 10px;
}

.strategy-header .icon {
    font-size: 18px;
}

.strategy-header h3 {
    font-size: 16px;
    color: #92400e;
    font-weight: 600;
    margin: 0;
}

.priority-badges {
    margin-left: auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

.priority-badge {
    background: rgba(99, 102, 241, 0.15);
    color: #3730a3;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.25);
    font-weight: 500;
}

.priority-arrow {
    color: rgba(0, 0, 0, 0.3);
    font-size: 12px;
}

.strategy-content p {
    color: rgba(0, 0, 0, 0.85);
    font-size: 14px;
    line-height: 1.7;
    margin: 0;
    text-align: justify;
}

/* ── 14. 结果页：邮件状态栏 ── */
.email-status-bar {
    font-size: 13px;
    padding: 9px 16px;
    border-radius: 10px;
    margin-top: 8px;
    font-weight: 500;
}

.email-status-bar.email-sent {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.22);
    color: #6ee7b7;
}

.email-status-bar.email-failed {
    background: rgba(245, 158, 11, 0.07);
    border: 1px solid rgba(245, 158, 11, 0.22);
    color: #92400e;
}

/* ── 15. 邮箱输入框专属样式 ── */
input[type="email"],
.email-input-field {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(16, 185, 129, 0.25);  /* 绿色边框提示"推荐填写" */
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    outline: none;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

input[type="email"]:focus,
.email-input-field:focus {
    background: rgba(16, 185, 129, 0.04);
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

input[type="email"]::placeholder,
.email-input-field::placeholder {
    color: rgba(0, 0, 0, 0.22);
    font-size: 13px;
}

/* "推荐填写" 标签 */
.label-recommend {
    font-size: 11px;
    font-weight: 400;
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.18);
    border-radius: 4px;
    padding: 1px 6px;
    margin-left: 6px;
    vertical-align: middle;
}

/* ── 16. 诊断记录折叠面板 ── */
.relax-log-panel {
    background: linear-gradient(145deg, rgba(255, 250, 240, 0.9) 0%, rgba(255, 237, 213, 0.8) 100%);
    border: 1px solid rgba(245, 158, 11, 0.18);
    border-radius: 14px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    width: 100%;
}

.relax-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 22px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
    background: rgba(245, 158, 11, 0.06);
    border-bottom: 1px solid rgba(245, 158, 11, 0.1);
    user-select: none;
    transition: background 0.2s ease;
}

.relax-log-header:hover {
    background: rgba(245, 158, 11, 0.1);
}

#relax-log-toggle-icon {
    font-size: 11px;
    transition: transform 0.3s ease;
}

.relax-log-content {
    padding: 16px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.relax-log-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    line-height: 1.6;
}

.relax-log-idx {
    font-size: 10px;
    font-weight: 700;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 4px;
    padding: 1px 6px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

.relax-log-text {
    color: rgba(0, 0, 0, 0.72);
}

.relax-log-empty {
    font-size: 12px;
    color: #6ee7b7;
    padding: 4px 0;
}

/* 响应式：宽屏下result-header的下载区域在右侧 */
@media (max-width: 1024px) {
    .result-header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .download-actions {
        flex-direction: row;
        width: 100%;
    }
    .btn-download {
        flex: 1;
        min-width: unset;
    }
}

/* ── 8. Header & Footer (Academic Style) ── */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, #dc2626 0%, #d97706 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.15);
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: #ffffff;
    font-size: 1.2rem;
}

.logo-badge {
    background: var(--color-purple);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: top;
    margin-left: 4px;
}

.header-nav {
    display: flex;
    gap: 24px;
}

.header-nav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    font-size: 0.95rem;
}

.header-nav a:hover {
    color: #ffffff;
}

.site-footer {
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 30px 20px;
    margin-top: auto;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-left p {
    margin-bottom: 8px;
}

.disclaimer {
    font-size: 0.8rem;
    color: #94a3b8;
}

.footer-right a {
    color: var(--color-primary);
    text-decoration: none;
}

.footer-right a:hover {
    text-decoration: underline;
}

/* ── 9. Mobile Responsive Media Queries ── */
@media (max-width: 768px) {
    .app-container {
        padding: 80px 10px 20px 10px;
    }
    
    .header-logo {
        font-size: 1rem;
    }

    .header-nav {
        display: flex;
        gap: 10px;
    }

    .header-nav a:not(#nav-user-guide) {
        display: none; /* Hide other links but keep user guide visible */
    }

    .flex-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .score-input-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .score-input-wrapper input {
        width: 100%;
        border-radius: 8px;
    }
    
    .batch-tag {
        border-radius: 8px;
        text-align: center;
    }
    
    .priority-selector {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .priority-buttons {
        flex-wrap: wrap;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .download-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .footer-container {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
}

/* ── 9. User Guide Modal ── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

.modal-card {
    background: var(--bg-card);
    border: 2px solid rgba(217, 119, 6, 0.2);
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    background: linear-gradient(135deg, #dc2626 0%, #d97706 100%);
    color: #ffffff;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #d97706;
}

.modal-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
}

.close-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s;
}

.close-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* Markdown parsing adjustments */
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    color: #b45309;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

.markdown-body h2 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.markdown-body hr {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
}

.markdown-body ul, .markdown-body ol {
    margin-left: 20px;
    margin-bottom: 1rem;
}

.markdown-body li {
    margin-bottom: 6px;
}

.markdown-body blockquote {
    border-left: 4px solid var(--color-stable);
    background: var(--bg-dark);
    padding: 10px 16px;
    margin: 1rem 0;
    border-radius: 4px;
}

/* GitHub Alert Box styling inside markdown */
.alert-box {
    padding: 14px 18px;
    margin: 18px 0;
    border-radius: 8px;
    border-left: 4px solid #ccc;
    font-size: 0.95rem;
    line-height: 1.5;
}

.alert-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.alert-note {
    background-color: rgba(30, 58, 138, 0.05);
    border-left-color: #1e3a8a;
    color: #1e293b;
}

.alert-note .alert-title {
    color: #1e3a8a;
}

.alert-important {
    background-color: rgba(220, 38, 38, 0.05);
    border-left-color: #dc2626;
    color: #1e293b;
}

.alert-important .alert-title {
    color: #dc2626;
}

.alert-tip {
    background-color: rgba(217, 119, 6, 0.05);
    border-left-color: #d97706;
    color: #1e293b;
}

.alert-tip .alert-title {
    color: #d97706;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* =========================================================
   意图解析卡（DeepSeek 意图 Tag）
   ========================================================= */
.ai-intent-card {
    background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(139,92,246,0.06) 100%);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 16px;
}

.ai-intent-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.ai-chip {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

.ai-intent-hint {
    color: #94a3b8;
    font-size: 12px;
}

.ai-intent-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.intent-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
    white-space: nowrap;
}

.intent-tag b { font-weight: 700; margin-right: 2px; }

.intent-tag--purple  { background: rgba(139,92,246,0.12);  border-color: rgba(139,92,246,0.3);  color: #a78bfa; }
.intent-tag--red     { background: rgba(239,68,68,0.10);   border-color: rgba(239,68,68,0.3);   color: #f87171; }
.intent-tag--blue    { background: rgba(59,130,246,0.10);  border-color: rgba(59,130,246,0.3);  color: #60a5fa; }
.intent-tag--green   { background: rgba(34,197,94,0.10);   border-color: rgba(34,197,94,0.3);   color: #4ade80; }
.intent-tag--teal    { background: rgba(20,184,166,0.10);  border-color: rgba(20,184,166,0.3);  color: #2dd4bf; }
.intent-tag--orange  { background: rgba(249,115,22,0.10);  border-color: rgba(249,115,22,0.3);  color: #fb923c; }
.intent-tag--indigo  { background: rgba(99,102,241,0.10);  border-color: rgba(99,102,241,0.3);  color: #818cf8; }

.intent-tag-empty {
    color: #64748b;
    font-size: 13px;
    font-style: italic;
}

/* =========================================================
   中外合作警示条 & 卡片标识
   ========================================================= */
.sino-foreign-warn-bar {
    background: linear-gradient(135deg, rgba(249,115,22,0.12), rgba(234,88,12,0.08));
    border: 1px solid rgba(249,115,22,0.35);
    border-radius: 10px;
    padding: 10px 16px;
    color: #fb923c;
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.6;
}

.sino-foreign-badge {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
    margin-left: 4px;
    vertical-align: middle;
    display: inline-block;
}

/* =========================================================
   填写模板按鈕
   ========================================================= */
.template-btn {
    margin-top: 8px;
    background: rgba(99,102,241,0.08);
    border: 1px dashed rgba(99,102,241,0.4);
    color: #818cf8;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.template-btn:hover {
    background: rgba(99,102,241,0.15);
    border-color: rgba(99,102,241,0.6);
    color: #a5b4fc;
    transform: translateY(-1px);
}

/* ─── Speaker Notice & QR Code ─── */
.speaker-notice {
    background: linear-gradient(90deg, rgba(30, 58, 138, 0.1), rgba(180, 83, 9, 0.1));
    border-bottom: 2px solid rgba(180, 83, 9, 0.3);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    border-radius: 12px 12px 0 0;
    margin-bottom: -1px;
    box-shadow: 0 4px 12px rgba(180, 83, 9, 0.15);
    animation: noticePulse 2.5s infinite alternate ease-in-out;
}

@keyframes noticePulse {
    0% { background: linear-gradient(90deg, rgba(30, 58, 138, 0.08), rgba(180, 83, 9, 0.08)); }
    100% { background: linear-gradient(90deg, rgba(30, 58, 138, 0.2), rgba(180, 83, 9, 0.2)); }
}

.marquee-container {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    font-size: 14px;
    color: var(--color-purple);
    font-weight: 600;
}

#speaker-text {
    display: inline-block;
    animation: marquee 15s linear infinite;
    /* pause when hover */
}

.speaker-notice:hover #speaker-text {
    animation-play-state: paused;
}

@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.qr-code-display {
    margin-top: 5px;
    animation: fade-in 0.5s ease-out;
}

/* ── 欢迎弹窗 Welcome Modal ── */
.welcome-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.welcome-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.welcome-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(240, 244, 248, 0.85); /* 适配亮色主题背景 */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.welcome-content {
    position: relative;
    z-index: 1;
    width: 90%;
    max-width: 400px;
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255,255,255,0.8);
}

.welcome-modal.show .welcome-content {
    transform: scale(1) translateY(0);
}

.welcome-image-container {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #f8fafc;
    display: flex;
    justify-content: center;
    align-items: center;
}

.welcome-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.welcome-text-container {
    padding: 30px 24px;
    text-align: center;
}

.welcome-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.welcome-subtitle {
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--color-primary), var(--color-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 24px;
}

.welcome-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    background: rgba(30, 58, 138, 0.03);
    padding: 16px;
    border-radius: 12px;
}

.welcome-features li {
    font-size: 0.95rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.welcome-features li i {
    color: var(--color-primary);
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.welcome-btn-glow {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    border-radius: 12px;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 var(--color-primary-glow); }
    70% { box-shadow: 0 0 0 15px rgba(30,58,138,0); }
    100% { box-shadow: 0 0 0 0 rgba(30,58,138,0); }
}

/* ── 内测阶段动画 ── */
.beta-finger-animation {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-rush);
    margin-bottom: 12px;
    animation: bounceUpDown 0.6s infinite alternate ease-in-out;
    pointer-events: none;
}

@keyframes bounceUpDown {
    0% { transform: translateY(0); }
    100% { transform: translateY(-8px); }
}
