/* ===== 智能体科研局 - Medical SaaS Design ===== */

/* --- Base --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
    background: #f8fafc;
    min-height: 100vh;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* --- Pages --- */
.page { display: none; animation: fadeIn 0.35s ease-out; }
.page.active { display: block; }
.page.login-page.active {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #ffffff;
}

/* --- Header --- */
.header {
    background: #fff;
    padding: 20px 22px;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
    position: relative;
    z-index: 10;
}
.header h1 { 
    font-size: 19px; 
    font-weight: 700; 
    color: #1e3a5f; 
    letter-spacing: -0.2px; 
}
.header p { 
    font-size: 13px; 
    color: #64748b; 
    margin-top: 4px; 
}
.header .back {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    font-size: 14px; color: #2563eb; cursor: pointer; font-weight: 500;
    transition: all 0.2s;
}
.header .back:hover { color: #1d4ed8; transform: translateY(-50%) translateX(-2px); }
.header .logout {
    position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
    font-size: 12px; color: #94a3b8; cursor: pointer;
    padding: 5px 12px; border: 1px solid #e2e8f0; border-radius: 8px;
    transition: all 0.2s;
}
.header .logout:hover { border-color: #cbd5e1; color: #64748b; background: #f8fafc; }

/* --- Container --- */
.container { max-width: 640px; margin: 0 auto; padding: 18px 16px; }

/* --- Cards --- */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 28px 24px;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: border-color 0.2s ease;
}
.card:hover { 
    border-color: #bfdbfe;
}
.card-title {
    font-size: 16px; 
    font-weight: 700; 
    color: #1e293b;
    margin-bottom: 16px; 
    display: flex; 
    align-items: center; 
    gap: 10px;
}
.card-title .badge {
    font-size: 11px;
    background: #eff6ff;
    color: #2563eb;
    padding: 4px 12px;
    border-radius: 14px;
    font-weight: 500;
    border: 1px solid #bfdbfe;
}
.card-subtitle {
    font-size: 12px; color: #94a3b8; margin-bottom: 12px; line-height: 1.5;
}

/* --- Buttons --- */
.btn {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 15px 26px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn:hover { 
    background: #1d4ed8;
}
.btn:active { transform: translateY(0); }
.btn:disabled { 
    background: #e2e8f0; 
    color: #94a3b8; 
    cursor: not-allowed; 
    box-shadow: none; 
}
.btn-outline {
    background: #fff; 
    color: #2563eb;
    border: 2px solid #2563eb; 
    box-shadow: none;
}
.btn-outline:hover { 
    background: #eff6ff; 
}
.btn-green {
    background: #059669;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn-green:hover { 
    background: #047857;
}
.btn-group { display: flex; gap: 12px; margin-top: 18px; }
.btn-group .btn { flex: 1; }

/* --- Login --- */
.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 50px 40px 42px;
    width: 380px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02), 0 12px 40px rgba(0,0,0,0.06);
    text-align: center;
    position: relative;
    border: 1px solid #e5e7eb;
}
.login-avatar {
    width: 76px; height: 76px;
    border-radius: 50%;
    margin-bottom: 22px;
    object-fit: cover;
    box-shadow: 0 4px 18px rgba(37,99,235,0.15);
    border: 3px solid #fff;
}
.login-card h1 {
    font-size: 26px; font-weight: 700; color: #1e293b;
    margin-bottom: 8px; letter-spacing: -0.4px;
}
.login-card .subtitle { font-size: 14px; color: #94a3b8; margin-bottom: 34px; }
.login-card input {
    width: 100%;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px 18px;
    font-size: 14px;
    margin-bottom: 16px;
    outline: none;
    transition: all 0.2s;
    background: #f8fafc;
}
.login-card input:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}
.login-card .code-row { display: flex; gap: 12px; align-items: center; }
.login-card .code-row input { flex: 2; min-width: 0; }
.login-card .code-row button {
    flex: 1;
    white-space: nowrap;
    background: #eff6ff;
    border: 2px solid #bfdbfe;
    border-radius: 8px;
    padding: 13px 14px;
    font-size: 13px;
    color: #2563eb;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}
.login-card .code-row button:hover { 
    background: #dbeafe; 
    border-color: #2563eb; 
}
.login-card .error { color: #ef4444; font-size: 12px; margin-top: 10px; }

/* --- QR Modal --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.modal-card {
    background: #fff; border-radius: 20px; padding: 32px 24px;
    text-align: center; max-width: 320px; width: 100%;
    position: relative; box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-close {
    position: absolute; top: 12px; right: 16px;
    font-size: 20px; color: #999; cursor: pointer;
}
.modal-close:hover { color: #333; }
.qr-image { width: 200px; height: 200px; object-fit: contain; margin: 0 auto 16px; display: block; border-radius: 8px; }
.qr-title { font-size: 16px; font-weight: 600; color: #1e293b; margin-bottom: 6px; }
.qr-subtitle { font-size: 14px; color: #2563eb; font-weight: 500; margin-bottom: 12px; }
.qr-hint { font-size: 12px; color: #64748b; line-height: 1.6; }

/* --- Mining Type Modal（生信组学 vs 临床数据库 2选1） --- */
.mining-type-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15,23,42,0.55); z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeInOverlay 0.18s ease;
}
@keyframes fadeInOverlay { from { opacity:0; } to { opacity:1; } }
.mining-type-card {
  background: #fff; border-radius: 22px; padding: 28px 22px 24px;
  max-width: 380px; width: 100%; position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  animation: slideUpCard 0.2s ease;
  max-height: 88vh; overflow-y: auto;
}
@keyframes slideUpCard { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }
.mining-type-close {
  position: absolute; top: 14px; right: 18px;
  font-size: 18px; color: #94a3b8; cursor: pointer; line-height: 1;
}
.mining-type-close:hover { color: #334155; }
.mining-type-title {
  font-size: 17px; font-weight: 700; color: #1e293b;
  text-align: center; margin-bottom: 4px;
}
.mining-type-subtitle {
  font-size: 12px; color: #64748b; text-align: center; margin-bottom: 20px;
}
.mining-type-options { display: flex; flex-direction: column; gap: 12px; }
.mining-type-option {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 16px; border: 2px solid #e2e8f0; border-radius: 14px;
  cursor: pointer; transition: all 0.18s ease; background: #f8fafc;
}
.mining-type-option:hover { border-color: #93c5fd; background: #eff6ff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.1); }
.mining-type-option.bioinfo-opt:hover, .mining-type-option.bioinfo-opt:focus { border-color: #2563eb; }
.mining-type-option.clinical-opt:hover, .mining-type-option.clinical-opt:focus { border-color: #0891b2; }
.mining-type-icon { font-size: 28px; line-height: 1; flex-shrink: 0; margin-top: 2px; }
.mining-type-info { flex: 1; }
.mining-type-name { font-size: 15px; font-weight: 700; color: #1e293b; margin-bottom: 3px; }
.mining-type-name-en { font-size: 11px; color: #2563eb; font-weight: 500; margin-bottom: 6px; }
.mining-type-desc { font-size: 12px; color: #64748b; line-height: 1.6; }
.mining-type-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.mining-type-tag {
  font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 500;
  background: #dbeafe; color: #1d4ed8;
}
.mining-type-option.clinical-opt .mining-type-tag { background: #cffafe; color: #0e7490; }
.mining-type-option.combined-opt:hover, .mining-type-option.combined-opt:focus { border-color: #7c3aed; background: #faf5ff; }
.mining-type-option.combined-opt .mining-type-tag { background: #ede9fe; color: #6d28d9; }
.mining-type-option.combined-opt .mining-type-name-en { color: #7c3aed; }
.mining-type-option.combined-opt:hover .mining-type-arr { color: #7c3aed; }
.mining-type-arr { font-size: 18px; color: #cbd5e1; align-self: center; flex-shrink: 0; }
.mining-type-option:hover .mining-type-arr { color: #2563eb; }
/* 数据库推荐小标签行 */
.mining-type-dbs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; align-items: center; }
.mining-type-dbs-label { font-size: 10px; color: #94a3b8; font-weight: 600; margin-right: 2px; flex-shrink: 0; }
.mining-type-db { font-size: 10px; padding: 2px 7px; border-radius: 8px; font-weight: 500;
  background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.mining-type-option.clinical-opt .mining-type-db { background: #ecfeff; color: #0891b2; border-color: #a5f3fc; }
.mining-type-option.combined-opt .mining-type-db { background: #f5f3ff; color: #7c3aed; border-color: #ddd6fe; }

/* --- Tags --- */
.tag-grid { display: flex; flex-wrap: wrap; gap: 10px; min-height: 40px; }
.tag {
    display: inline-block;
    padding: 9px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 24px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    background: #fff;
}
.tag:hover {
    border-color: #93c5fd;
    color: #2563eb;
    background: #eff6ff;
    transform: scale(1.03);
}
.tag.selected {
    border-color: transparent;
    background: #2563eb;
    color: #fff;
    font-weight: 500;
    box-shadow: none;
}
.tag-hint { font-size: 11px; color: #94a3b8; margin-top: 10px; }

/* --- Research Type Cards --- */
.type-cards { display: flex; gap: 12px; margin-bottom: 16px; }
.type-card {
    flex: 1;
    padding: 24px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #fff;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.type-card:hover { 
    border-color: #93c5fd; 
    box-shadow: 0 4px 12px rgba(37,99,235,0.08); 
}
.type-card.selected {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 4px 16px rgba(37,99,235,0.12);
}
.type-card .icon { 
    font-size: 42px; 
    margin-bottom: 10px;
}
.type-card .label { 
    font-size: 14px; 
    color: #64748b; 
    font-weight: 600;
    letter-spacing: 0.2px;
}
.type-card.selected .label { color: #2563eb; font-weight: 700; }
.type-card .info-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #dbeafe;
    color: #2563eb;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s;
}
.type-card .info-icon:hover {
    opacity: 1;
    background: #2563eb;
    color: white;
    transform: scale(1.15);
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

/* --- Steps --- */
.steps-indicator {
    display: flex; align-items: center; justify-content: center;
    gap: 0; margin-bottom: 24px; padding: 16px 0;
}
.steps-indicator .step { text-align: center; display: flex; flex-direction: column; align-items: center; }
.steps-indicator .step-dot {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
    background: #f1f5f9; color: #94a3b8;
    transition: all 0.3s; border: 2px solid transparent;
}
.steps-indicator .step.active .step-dot {
    background: #2563eb;
    color: #fff; box-shadow: 0 4px 14px rgba(37,99,235,0.25);
}
.steps-indicator .step.done .step-dot {
    background: #059669;
    color: #fff;
}
.steps-indicator .step-line { 
    width: 40px; height: 3px; background: #e2e8f0; 
    border-radius: 2px; margin: 0 4px; margin-top: -12px; 
}
.steps-indicator .step-line.done { background: linear-gradient(90deg, #10b981, #059669); }
.steps-indicator .step-label { 
    font-size: 11px; color: #94a3b8; margin-top: 6px; 
    font-weight: 600;
}
.steps-indicator .step.active .step-label { color: #2563eb; }
.steps-indicator .step.done .step-label { color: #059669; }

/* --- Page Header --- */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px; margin-bottom: 10px;
}
.header-left { flex: 1; }
.header-title { 
    font-size: 19px; 
    font-weight: 700; 
    color: #1e293b; 
}
.header-subtitle { 
    font-size: 13px; 
    color: #64748b; 
    margin-top: 4px; 
}
.btn-logout {
    padding: 7px 16px; border-radius: 9px; border: 1.5px solid #e2e8f0;
    background: #fff; color: #64748b; font-size: 12px; cursor: pointer;
    transition: all 0.2s; font-weight: 500;
}
.btn-logout:hover { border-color: #f87171; color: #ef4444; background: #fef2f2; }
.btn-my {
    padding: 7px 16px; border-radius: 9px; border: 1.5px solid #e2e8f0;
    background: #fff; color: #2563eb; font-size: 12px; cursor: pointer;
    font-weight: 600; transition: all 0.2s;
}
.btn-my:hover { border-color: #2563eb; background: #eff6ff; }
.header-right { display: flex; gap: 10px; align-items: center; }
.btn-back {
    width: 38px; height: 38px; border-radius: 10px; border: 1.5px solid #e2e8f0;
    background: #fff; color: #475569; font-size: 17px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    margin-right: 12px; transition: all 0.2s; font-weight: 600;
}
.btn-back:hover { background: #f8fafc; border-color: #cbd5e1; }

/* 我的页面 */
.my-info-card { padding: 20px; }
.my-info-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 0; border-bottom: 1px solid #f1f5f9;
}
.my-info-row:last-child { border-bottom: none; }
.my-label { color: #64748b; font-size: 14px; }
.my-value { color: #1e293b; font-size: 14px; font-weight: 500; }
.my-code { font-family: 'SF Mono', monospace; color: #2563eb; font-weight: 700; letter-spacing: 1px; }
.my-balance { color: #10b981; font-weight: 700; font-size: 16px; }
.my-project-list { display: flex; flex-direction: column; gap: 10px; }
.my-project-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 14px; background: #f8fafc; border-radius: 10px;
    border: 1px solid #e2e8f0; cursor: pointer; transition: all 0.2s;
}
.my-project-item:hover { border-color: #2563eb; background: #eff6ff; }
.my-project-info { flex: 1; }
.my-project-disease { font-size: 14px; font-weight: 600; color: #1e293b; }
.my-project-date { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.my-project-docs { display: flex; gap: 10px; margin-top: 8px; }
.doc-link {
    font-size: 12px; color: #2563eb; cursor: pointer; padding: 3px 8px;
    background: #eff6ff; border-radius: 6px; border: 1px solid #bfdbfe;
    transition: all 0.2s;
}
.doc-link:hover { background: #dbeafe; border-color: #2563eb; }
.doc-link:active { transform: scale(0.95); }
.my-project-status {
    font-size: 11px; padding: 3px 8px; border-radius: 6px;
    font-weight: 500; white-space: nowrap;
}
.status-pico { background: #dbeafe; color: #2563eb; }
.status-sap { background: #dbeafe; color: #2563eb; }
.status-exec { background: #d1fae5; color: #059669; }
.status-done { background: #dcfce7; color: #16a34a; }
.empty-hint { text-align: center; color: #94a3b8; padding: 30px 0; font-size: 14px; }

/* --- Inner Pages Container --- */
.page:not(.login-page) {
    max-width: 640px; margin: 0 auto; padding: 20px 16px 70px;
}

/* --- Buttons --- */
.btn-block { width: 100%; margin-top: 16px; }
.btn-green {
    background: #059669;
    color: #fff; border: none; border-radius: 8px;
    padding: 14px 24px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.btn-green:hover { background: #047857; }
.btn-outline {
    background: #fff; color: #2563eb; border: 1.5px solid #2563eb;
    border-radius: 8px; padding: 12px 20px; font-size: 13px;
    font-weight: 500; cursor: pointer; transition: all 0.2s;
}
.btn-outline:hover { background: #eff6ff; }
.btn-group { display: flex; gap: 10px; margin-top: 16px; }
.btn-group .btn { flex: 1; }
.btn-sm {
    background: #2563eb;
    color: #fff; border: none; border-radius: 20px;
    padding: 8px 16px; font-size: 12px; cursor: pointer;
    font-weight: 500; transition: all 0.2s;
}
.btn-sm:hover { background: #1d4ed8; }

/* --- Badge --- */
.badge {
    display: inline-block; background: #eff6ff; color: #2563eb;
    font-size: 11px; padding: 3px 8px; border-radius: 6px;
    font-weight: 500; margin-left: 6px;
}
.card-note { font-size: 12px; color: #94a3b8; margin-bottom: 12px; }
.card-subtitle-hint { font-size: 12px; color: #64748b; margin-bottom: 12px; font-style: italic; }

/* --- Textarea --- */
.input-field {
    width: 100%; border: 1.5px solid #e2e8f0; border-radius: 12px;
    padding: 14px 16px; font-size: 15px; outline: none;
    transition: all 0.2s; background: #f8fafc; font-family: inherit;
    box-sizing: border-box;
}
.input-field:focus { border-color: #2563eb; background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }
.textarea-field {
    width: 100%; border: 1.5px solid #e2e8f0; border-radius: 12px;
    padding: 13px 16px; font-size: 14px; outline: none;
    transition: all 0.2s; background: #f8fafc; font-family: inherit;
    resize: vertical; min-height: 80px;
}
.textarea-field:focus { border-color: #2563eb; background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,0.08); }

/* --- Download Links --- */
.download-links { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.download-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 16px; background: #f0fdf4; border: 1px solid #bbf7d0;
    border-radius: 10px; color: #059669; font-size: 13px;
    text-decoration: none; font-weight: 500; transition: all 0.2s;
}
.download-link:hover { background: #dcfce7; }

/* --- Exec Card --- */
.exec-card { text-align: center; padding: 40px 20px; }
.exec-title { font-size: 16px; font-weight: 600; color: #1e293b; margin-bottom: 8px; }
.exec-desc { font-size: 13px; color: #64748b; }
.exec-disease { font-size: 14px; color: #2563eb; margin-top: 8px; font-weight: 500; }
.celebration { font-size: 48px; margin-bottom: 16px; }

.steps { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 24px; padding: 20px 0; }
.step-item { text-align: center; }
.step-dot {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600;
    background: #f1f5f9; color: #94a3b8;
    margin: 0 auto;
    transition: all 0.3s;
    border: 2px solid transparent;
}
.step-dot.active {
    background: #2563eb;
    color: #fff;
    /* no pulse */
    border-color: transparent;
}
.step-dot.done {
    background: #059669;
    color: #fff;
    border-color: transparent;
}
.step-line { width: 40px; height: 3px; background: #e2e8f0; margin-top: -14px; border-radius: 2px; }
.step-line.done { background: linear-gradient(90deg, #10b981, #059669); }
.step-label { font-size: 10px; color: #94a3b8; margin-top: 6px; font-weight: 500; }

/* --- Content Box --- */
.content-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    font-size: 14px;
    line-height: 1.8;
    word-break: break-word;
    max-height: 420px;
    overflow-y: auto;
    color: #334155;
}
.content-box::-webkit-scrollbar { width: 4px; }
.content-box::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* SAP preview typography */
.content-box .sap-h1 { font-size: 20px; font-weight: 700; color: #1e293b; margin: 24px 0 12px; padding-bottom: 8px; border-bottom: 2px solid #2563eb; }
.content-box .sap-h2 { font-size: 17px; font-weight: 700; color: #1e40af; margin: 20px 0 10px; padding-left: 10px; border-left: 3px solid #2563eb; }
.content-box .sap-h3 { font-size: 15px; font-weight: 600; color: #334155; margin: 16px 0 8px; }
.content-box .sap-h4 { font-size: 14px; font-weight: 600; color: #475569; margin: 12px 0 6px; }
.content-box .sap-para { margin: 6px 0; }
.content-box .sap-spacer { height: 10px; }
.content-box .sap-list { margin: 8px 0; padding-left: 24px; }
.content-box .sap-list li { margin: 4px 0; }
.content-box .sap-hr { border: none; border-top: 1px solid #e2e8f0; margin: 16px 0; }
.content-box .sap-table-wrap { overflow-x: auto; margin: 12px 0; }
.content-box .sap-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.content-box .sap-table th { background: #eff6ff; color: #1e40af; font-weight: 600; padding: 8px 12px; border-bottom: 2px solid #2563eb; text-align: left; }
.content-box .sap-table td { padding: 7px 12px; border-bottom: 1px solid #e2e8f0; }
.content-box .sap-table tr:hover td { background: #f8fafc; }
.content-box code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 12px; color: #be185d; }
.streaming-cursor::after { content: '▊'; animation: blink 1s infinite; color: #2563eb; }

/* --- Form --- */
.form-group { margin-bottom: 18px; }
.form-group label { 
    display: block; 
    font-size: 14px; 
    color: #64748b; 
    margin-bottom: 8px; 
    font-weight: 600; 
}
.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    background: #f8fafc;
    font-family: inherit;
}
.form-group input[type="text"]:focus,
.form-group textarea:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}
.form-group textarea { resize: vertical; min-height: 80px; }

/* --- Custom Input Row --- */
.custom-input-row { display: flex; gap: 8px; margin-top: 14px; align-items: center; }
.custom-input-sm {
    flex: 1;
    border: 1px dashed #cbd5e1;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 12px;
    outline: none;
    background: #f8fafc;
    color: #64748b;
    transition: all 0.2s;
}
.custom-input-sm:focus { border-color: #2563eb; border-style: solid; background: #fff; box-shadow: 0 0 0 2px rgba(37,99,235,0.08); }
.btn-add-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid #cbd5e1;
    background: #fff;
    color: #64748b;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.btn-add-sm:hover { border-color: #2563eb; color: #2563eb; background: #f0f0ff; }

/* --- Loading --- */
.loading-tags { text-align: center; padding: 24px; color: #94a3b8; font-size: 13px; }
.loading-tags .mini-spinner {
    width: 18px; height: 18px;
    border: 2px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

/* --- Exec / Download --- */
.exec-box { text-align: center; padding: 48px 20px; }
.spinner {
    width: 48px; height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    transition: all 0.2s;
}
.file-item:hover { background: #eff6ff; border-color: rgba(37,99,235,0.15); }

.error-retry { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.error-retry .error { color: #ef4444; font-size: 14px; }
.btn-retry {
  padding: 6px 16px;
  background: #fff;
  border: 1.5px solid #2563eb;
  color: #2563eb;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-retry:hover { background: #2563eb; color: #fff; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 13px; color: #334155; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 11px; color: #94a3b8; margin-top: 0; }
.file-dl-btn {
    flex-shrink: 0;
    padding: 7px 14px;
    background: #2563eb;
    color: #fff;
    border-radius: 8px;
    font-size: 12px;
    text-decoration: none;
    margin-left: 10px;
    font-weight: 500;
    transition: all 0.2s;
}
.file-dl-btn:active { transform: scale(0.96); }
.download-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 18px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    color: #059669;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    margin-top: 14px;
    font-weight: 500;
    transition: all 0.2s;
}
.download-btn:hover { background: #dcfce7; border-color: #86efac; }

/* --- Project List --- */
.project-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.15s;
}
.project-item:last-child { border-bottom: none; }
.project-item:hover { padding-left: 4px; }
.project-item .info .name { font-size: 14px; color: #334155; font-weight: 500; }
.project-item .info .meta { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.status-badge { font-size: 11px; padding: 4px 10px; border-radius: 6px; white-space: nowrap; font-weight: 500; }
.s-pico { background: #fef3c7; color: #d97706; }
.s-sap { background: #eff6ff; color: #2563eb; }
.s-exec { background: #ecfdf5; color: #059669; }
.s-done { background: #f1f5f9; color: #64748b; }

/* --- Selected Summary --- */
.selected-summary {
    background: #eff6ff;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
    font-size: 12px;
    color: #475569;
    line-height: 1.7;
    border: 1px solid rgba(37,99,235,0.08);
}
.selected-summary .dim-label { color: #2563eb; font-weight: 600; }

/* --- Mobile --- */
@media (max-width: 400px) {
    .login-card { width: 92vw; padding: 36px 24px 32px; }
    .container { padding: 16px 14px; }
    .card { padding: 18px 16px; }
    .type-cards { flex-direction: column; }
    .step-line { width: 24px; }
}

/* SAP消耗提示 */
.cost-hint {
  text-align: center; font-size: 12px; color: #64748b;
  margin-top: 12px; padding: 8px; background: #f8fafc; border-radius: 8px;
}
.cost-hint strong { color: #2563eb; }

/* 定价确认弹窗 */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.pricing-modal {
  background: #fff; border-radius: 16px; padding: 28px 24px;
  max-width: 380px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.pricing-header { text-align: center; margin-bottom: 20px; }
.pricing-header .pricing-icon { font-size: 32px; display: block; margin-bottom: 8px; }
.pricing-header h3 { margin: 0; font-size: 18px; color: #1e293b; }
.pricing-tier { text-align: center; margin-bottom: 16px; }
.tier-badge {
  display: inline-block; padding: 4px 16px; border-radius: 20px;
  font-size: 14px; font-weight: 600; margin-bottom: 6px;
}
.tier-badge.tier-low { background: #dbeafe; color: #1d4ed8; }
.tier-badge.tier-mid { background: #fef3c7; color: #d97706; }
.tier-badge.tier-high { background: #fce7f3; color: #be185d; }
.tier-desc { font-size: 13px; color: #64748b; }
.pricing-usage { margin-bottom: 16px; }
.usage-item {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid #f1f5f9; font-size: 13px;
}
.usage-item:last-child { border-bottom: none; }
.usage-label { color: #94a3b8; }
.usage-value { color: #334155; font-weight: 500; }
.pricing-cost {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: #f0fdf4; border-radius: 10px; margin-bottom: 12px;
}
.cost-label { font-size: 14px; color: #334155; }
.cost-value { font-size: 18px; font-weight: 700; color: #16a34a; }
.pricing-balance { text-align: center; font-size: 13px; color: #64748b; margin-bottom: 12px; }
.pricing-balance strong { color: #2563eb; }
.pricing-insufficient {
  text-align: center; font-size: 13px; color: #ef4444;
  padding: 8px; background: #fef2f2; border-radius: 8px; margin-bottom: 12px;
}
.pricing-actions { display: flex; gap: 12px; }
.pricing-actions .btn { flex: 1; }

/* --- Notification Toast --- */
.notification-modal {
  background: #fff; border-radius: 16px; padding: 28px 24px;
  max-width: 360px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  text-align: center; animation: fadeIn 0.3s ease-out;
}
.notification-modal .notif-icon { font-size: 36px; margin-bottom: 12px; }
.notification-modal h3 { font-size: 17px; color: #1e293b; margin-bottom: 10px; font-weight: 600; }
.notification-modal .notif-body {
  font-size: 14px; color: #475569; line-height: 1.6; margin-bottom: 20px;
  padding: 12px 16px; background: #f0f9ff; border-radius: 10px;
  border-left: 3px solid #2563eb;
  text-align: left;
}
.notification-modal .notif-project {
  font-size: 12px; color: #94a3b8; margin-bottom: 16px;
}
.notification-modal .btn-notif {
  display: inline-block; padding: 10px 32px; border-radius: 10px;
  background: #2563eb; color: #fff;
  font-size: 14px; font-weight: 600; border: none; cursor: pointer;
  transition: all 0.2s;
}
.notification-modal .btn-notif:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.3); }

/* --- DB Option --- */
.db-option {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  border: 1.5px solid rgba(0,0,0,0.07);
  background: #fff; cursor: pointer;
  transition: all 0.15s;
}
.db-option:hover { border-color: #93c5fd; background: #f8f7ff; }
.db-option.selected-green { border-color: #22c55e; background: #f0fdf4; }
.db-option.selected-gray  { border-color: #fbbf24; background: #fffbeb; }
.db-option span:first-child { font-size:13px; font-weight:600; color:#1e293b; white-space:nowrap; }

/* --- Home Page (路径选择) --- */
.home-hero {
    text-align: center;
    padding: 36px 20px 20px;
}
.home-hero .logo-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2563eb;
    color: #fff;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: 0.3px;
}
.home-hero h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    letter-spacing: -0.4px;
}
.home-hero p {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
}
.path-card {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    margin: 0 20px 16px;
    border: 1.5px solid rgba(0,0,0,0.06);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
}
.path-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.path-card:active { /* no transform */ }
.path-card .path-icon {
    font-size: 32px;
    margin-bottom: 12px;
    display: block;
}
.path-card .path-title {
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
}
.path-card .path-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 14px;
}
.path-card .path-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.path-tag {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 500;
}
.path-tag-blue { background: #eff6ff; color: #2563eb; }
.path-tag-green { background: #ecfdf5; color: #059669; }
.path-card-primary { border-color: rgba(37,99,235,0.15); }
.path-card-primary .path-title { color: #2563eb; }
.path-card-secondary { border-color: rgba(5,150,105,0.15); }
.path-card-secondary .path-title { color: #059669; }

/* ===== 三条分析路径大卡片（差异化配色） ===== */
.mining-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    border: 1.5px solid transparent;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.mining-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,0.12); }
.mining-card:active { transform: translateY(0); }
.mining-card-bar { position:absolute; left:0; top:0; bottom:0; width:6px; }
.mining-card-body { display:flex; align-items:center; gap:14px; padding:18px 18px 18px 22px; }
.mining-card-icon {
    width:52px; height:52px; border-radius:14px; flex-shrink:0;
    display:flex; align-items:center; justify-content:center; font-size:26px;
}
.mining-card-title { font-weight:700; font-size:16px; color:#1e293b; margin-bottom:5px; display:flex; align-items:center; gap:8px; }
.mining-card-desc { font-size:12px; color:#64748b; line-height:1.6; margin-bottom:7px; }
.mining-card-foot { font-size:11px; font-weight:600; }
.mining-card-arrow { font-size:22px; flex-shrink:0; font-weight:300; }
.mining-card-badge {
    font-size:10px; font-weight:700; padding:2px 8px; border-radius:10px;
    color:#fff; letter-spacing:0.3px;
}
.mining-card-badge-hot { animation: badgePulse 2s ease-in-out infinite; }
@keyframes badgePulse { 0%,100%{opacity:1;} 50%{opacity:0.6;} }

/* 蓝色：数据库挖掘 */
.mining-card-blue { background: linear-gradient(120deg,#f5f9ff 0%,#eef4ff 100%); border-color: rgba(37,99,235,0.18); }
.mining-card-blue .mining-card-bar { background: linear-gradient(#3b82f6,#2563eb); }
.mining-card-blue .mining-card-icon { background:#dbeafe; }
.mining-card-blue .mining-card-foot { color:#2563eb; }
.mining-card-blue .mining-card-arrow { color:#2563eb; }
.mining-card-blue .mining-card-badge { background:#2563eb; }
.mining-card-blue:hover { border-color:#2563eb; }

/* 青绿：自有数据 */
.mining-card-teal { background: linear-gradient(120deg,#f2fdfa 0%,#e7fbf5 100%); border-color: rgba(13,148,136,0.18); }
.mining-card-teal .mining-card-bar { background: linear-gradient(#14b8a6,#0d9488); }
.mining-card-teal .mining-card-icon { background:#ccfbf1; }
.mining-card-teal .mining-card-foot { color:#0d9488; }
.mining-card-teal .mining-card-arrow { color:#0d9488; }
.mining-card-teal .mining-card-badge { background:#0d9488; }
.mining-card-teal:hover { border-color:#0d9488; }

/* 紫色进阶：挖掘+自有数据 */
.mining-card-purple { background: linear-gradient(120deg,#faf5ff 0%,#f3ebff 100%); border-color: rgba(124,58,237,0.22); }
.mining-card-purple .mining-card-bar { background: linear-gradient(#a855f7,#7c3aed); }
.mining-card-purple .mining-card-icon { background:#ede9fe; }
.mining-card-purple .mining-card-foot { color:#7c3aed; }
.mining-card-purple .mining-card-arrow { color:#7c3aed; }
.mining-card-purple .mining-card-badge { background: linear-gradient(90deg,#a855f7,#7c3aed); }
.mining-card-purple:hover { border-color:#7c3aed; }
.path-card .path-arrow {
    float: right;
    font-size: 18px;
    color: #94a3b8;
    margin-top: -2px;
}

/* --- Upload Page --- */
.upload-zone {
    border: 2px dashed #bfdbfe;
    border-radius: 16px;
    padding: 32px 20px;
    text-align: center;
    background: #fafafe;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 14px;
}
.upload-zone:hover, .upload-zone.drag-over {
    border-color: #2563eb;
    background: #eff6ff;
}
.upload-zone .upload-icon { font-size: 36px; margin-bottom: 10px; }
.upload-zone .upload-hint { font-size: 13px; color: #64748b; line-height: 1.6; }
.upload-zone .upload-hint strong { color: #2563eb; }
.file-list { margin-bottom: 14px; }
.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid #e2e8f0;
    font-size: 13px;
    color: #1e293b;
}
.file-item .file-remove {
    margin-left: auto;
    color: #94a3b8;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}
.file-item .file-remove:hover { color: #ef4444; }
.goal-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}
.goal-option {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    text-align: center;
    cursor: pointer;
    font-size: 13px;
    color: #475569;
    font-weight: 500;
    transition: all 0.2s;
    background: #fff;
}
.goal-option:hover { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.goal-option.selected { border-color: #2563eb; color: #2563eb; background: #eff6ff; font-weight: 600; }
.goal-option .goal-icon { font-size: 20px; display: block; margin-bottom: 4px; }

/* 新卡片样式 - 圆形图标风格 */
.doc-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    border: 1.5px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.doc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}
.doc-card.selected {
    border-color: #2563eb;
    background: #f0f9ff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}
.doc-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    transition: all 0.3s;
}
.doc-card:hover .doc-icon {
    transform: scale(1.1);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}
.doc-icon-img {
    display: block;
    margin: 0 auto 12px;
    transition: transform 0.3s;
}
.doc-card:hover .doc-icon-img {
    transform: scale(1.1);
}
.doc-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
    line-height: 1.3;
}
.doc-desc {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
}
.doc-price {
    font-size: 11px;
    color: #2563eb;
    font-weight: 600;
    margin-top: 4px;
    background: #eff6ff;
    border-radius: 10px;
    padding: 2px 8px;
    display: inline-block;
}
.doc-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
}
.doc-card.locked:hover {
    transform: none;
    box-shadow: none;
    border-color: #e2e8f0;
}
.doc-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 16px;
}
.doc-card.locked .doc-price {
    display: none;
}
.upload-textarea {
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    min-height: 100px;
    outline: none;
    font-family: inherit;
    color: #1e293b;
    background: #f8fafc;
    transition: all 0.2s;
}
.upload-textarea:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}
.submit-success {
    text-align: center;
    padding: 40px 20px;
}
.submit-success .success-icon { font-size: 56px; margin-bottom: 16px; }
.submit-success h3 { font-size: 20px; font-weight: 700; color: #1e293b; margin-bottom: 8px; }
.submit-success p { font-size: 14px; color: #64748b; line-height: 1.7; }


/* --- Bottom Navigation Bar --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    max-width: 640px;
    margin: 0 auto;
}
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    padding: 6px 0;
    color: #94a3b8;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item.active {
    color: #2563eb;
}
.bottom-nav-item:hover {
    color: #2563eb;
}
.bottom-nav-item svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.bottom-nav-item .nav-label {
    font-size: 11px;
    font-weight: 500;
}
/* Add padding bottom for pages to not be hidden by nav */
.page:not(.login-page) {
    padding-bottom: 70px !important;
}
