:root {
  --primary: #00bfa5;
  --primary-dark: #009e88;
  --bg: #f0f4f8;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --ok: #10b981;
  --error: #ef4444;
  --warn: #f59e0b;
  
  /* Sidebar/Header colors */
  --header-bg: #2d3e4f;
  --header-text: #f8fafc;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body{font-family:"Segoe UI","Microsoft YaHei",sans-serif;background:var(--bg);color:var(--text);min-height:100vh;display:flex;flex-direction:column}
.app-shell{min-height:100vh;display:flex;flex-direction:column}
.auth-gate{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:32px;background:linear-gradient(135deg,#eef4ff 0%,#f7f9fd 55%,#eaf6f2 100%)}
.auth-card{width:420px;max-width:100%;padding:36px;background:#fff;border:1px solid var(--border);border-radius:20px;box-shadow:0 18px 60px rgba(20,99,255,.12)}
.auth-card-brand{display:flex;align-items:center;gap:12px;margin-bottom:28px}
.auth-title{font-size:28px;font-weight:800;margin-bottom:8px}
.auth-subtitle{font-size:14px;line-height:1.7;color:var(--muted);margin-bottom:20px}
.auth-form{display:flex;flex-direction:column;gap:14px}
.auth-input{width:100%;border:1.5px solid var(--border);border-radius:12px;padding:14px 16px;font-size:15px;outline:none;transition:border-color .2s,box-shadow .2s}
.auth-input:focus{border-color:var(--primary);box-shadow:0 0 0 4px rgba(20,99,255,.08)}
.auth-error{min-height:20px;font-size:13px;color:var(--error)}
.auth-submit{width:100%;padding:13px 16px}
/* NAVBAR */
.navbar { display: flex; align-items: center; justify-content: space-between; padding: 0 32px; height: 68px; background: var(--header-bg); color: var(--header-text); position: sticky; top: 0; z-index: 100; }
.navbar-light { background: #fff; border-bottom: 1px solid var(--border); color: var(--text); }
.navbar-brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { display: flex; align-items: center; justify-content: center; }
.brand-name { font-size: 18px; font-weight: 600; display: block; }
.brand-sub { font-size: 12px; color: #94a3b8; display: block; }
.navbar-right { display: flex; align-items: center; gap: 16px; }
.icon-btn { background: none; border: none; font-size: 20px; color: #cbd5e1; cursor: pointer; padding: 6px; border-radius: 8px; transition: background 0.2s, color 0.2s; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.user-menu-wrap { position: relative; }
.user-menu-trigger { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255,255,255,0.1); cursor: pointer; padding: 4px 12px 4px 6px; border-radius: 20px; transition: background 0.2s; color: var(--header-text); }
.user-menu-trigger:hover { background: rgba(255, 255, 255, 0.15); }
.user-menu-trigger-light { background: #f1f5f9; border: 1px solid var(--border); color: var(--text); }
.user-menu-trigger-light:hover { background: #e2e8f0; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.username { font-size: 14px; font-weight: 500; }
.user-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 160px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); padding: 4px; z-index: 300; }
.user-menu-item { width: 100%; text-align: left; background: none; border: none; border-radius: 6px; padding: 8px 12px; font-size: 14px; color: var(--text); cursor: pointer; transition: background 0.2s; }
.user-menu-item:hover { background: #f1f5f9; }
.user-menu-item.danger { color: var(--error); }
/* PAGE */
.page{display:none;flex:1;padding:28px 40px 40px}
.page.active{display:block}
/* HOME */
.page-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px}
.page-title-row{display:flex;align-items:center;gap:12px}
.page-title { font-size: 24px; font-weight: 600; color: #0f172a; }
.badge-count { background: #e0f2fe; color: #0284c7; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.btn-primary { background: var(--primary); color: #fff; border: none; border-radius: 6px; padding: 8px 16px; font-size: 14px; font-weight: 500; cursor: pointer; transition: background 0.2s, box-shadow 0.2s; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--error); color: #fff; border: none; border-radius: 6px; padding: 8px 16px; font-size: 14px; font-weight: 500; cursor: pointer; transition: background 0.2s; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.btn-danger:hover { background: #dc2626; }
/* SEARCH */
.search-bar-wrap { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 24px; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.search-bar { display: flex; align-items: center; gap: 8px; }
.search-icon { font-size: 16px; color: #94a3b8; }
.search-bar input { border: none; outline: none; width: 100%; font-size: 14px; color: var(--text); background: transparent; }
/* TABLE */
.project-table-wrap { background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }
.project-table { width: 100%; border-collapse: collapse; }
.project-table th { text-align: left; padding: 12px 16px; font-size: 13px; color: #64748b; font-weight: 500; border-bottom: 1px solid var(--border); background: #f8fafc; }
.project-table td { padding: 16px; font-size: 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; color: #334155; }
.project-table tr:last-child td { border-bottom: none; }
.project-table tr:hover td { background: #f8fafc; }
.proj-icon { width: 36px; height: 36px; background: #ccfbf1; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--primary); margin-right: 12px; flex-shrink: 0; }
.proj-name-cell { display: flex; align-items: center; }
.proj-name { font-weight: 500; font-size: 14px; color: #0f172a; }
.proj-type { font-size: 12px; color: #64748b; }
.status-badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.status-badge.active { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.action-btn { background: none; border: 1px solid transparent; cursor: pointer; font-size: 13px; padding: 6px 10px; border-radius: 6px; font-weight: 500; transition: all 0.2s; }
.action-btn.view { color: var(--primary); }
.action-btn.del { color: var(--error); }
.action-btn:hover { background: #f1f5f9; border-color: #e2e8f0; }
.empty-state { text-align: center; padding: 64px 20px; color: #64748b; }
.empty-icon { font-size: 40px; margin-bottom: 16px; color: #cbd5e1; }
/* DETAIL */
.detail-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.back-btn { background: #fff; border: 1px solid var(--border); cursor: pointer; font-size: 14px; color: #334155; font-weight: 500; padding: 6px 12px; border-radius: 6px; display: flex; align-items: center; gap: 6px; transition: all 0.2s; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.back-btn:hover { background: #f8fafc; color: #0f172a; }
.detail-project-name { font-size: 20px; font-weight: 600; color: #0f172a; }
/* STEPS BAR */
.steps-bar { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 40px; }
.step-item { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.step-circle { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--border); background: #fff; display: flex; align-items: center; justify-content: center; color: #cbd5e1; transition: all 0.3s; z-index: 2; }
.step-circle svg { stroke: currentColor; }
.step-circle.active { background: #f0fdfa; border-color: var(--primary); color: var(--primary); }
.step-circle.done { background: var(--primary); border-color: var(--primary); color: #fff; }
.step-label { font-size: 13px; color: #64748b; font-weight: 500; }
.step-label.active { color: var(--primary); font-weight: 600; }
.step-label.done { color: #0f172a; font-weight: 600; }
.step-line { width: 100px; height: 2px; background: var(--border); margin-bottom: 24px; transition: background 0.3s; }
.step-line.done { background: var(--primary); }
/* STEP CARDS */
.steps-cards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.step-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 24px; transition: border-color 0.3s, box-shadow 0.3s; box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }
.step-card.active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.step-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.step-card-title { font-size: 16px; font-weight: 600; color: #0f172a; }
.step-done-badge { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 500; }
.report-count-badge { background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 500; }
.step-card-desc { font-size: 13px; color: #64748b; margin-bottom: 20px; line-height: 1.5; }
/* UPLOAD ZONE */
.upload-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.upload-block { display: flex; flex-direction: column; gap: 12px; }
.upload-block-header { display: flex; flex-direction: column; gap: 4px; }
.upload-block-title { font-size: 14px; font-weight: 600; color: #0f172a; margin: 0; }
.upload-block-hint { font-size: 13px; color: #64748b; margin: 0; }
.upload-zone { border: 2px dashed #cbd5e1; border-radius: 8px; padding: 32px 16px; text-align: center; cursor: pointer; transition: border-color 0.2s, background 0.2s; background: #fafafa; }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: #f0fdfa; }
.upload-zone.disabled { cursor: not-allowed; opacity: 0.6; }
.upload-zone.disabled:hover { border-color: #cbd5e1; background: #fafafa; }
.medical-upload-zone { background: #f8fafc; }
.upload-icon { display: flex; align-items: center; justify-content: center; color: #94a3b8; margin: 0 auto 12px; }
.upload-text { font-size: 14px; font-weight: 500; color: #0f172a; margin-bottom: 4px; }
.upload-hint { font-size: 12px; color: #64748b; }
.upload-count { text-align: center; color: var(--primary); font-size: 13px; font-weight: 500; margin-top: 12px; }
.upload-count-secondary { color: #0284c7; }
/* RUN BUTTON */
.btn-run { width: 100%; padding: 12px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 500; cursor: pointer; transition: background 0.2s, transform 0.1s; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }
.btn-run:hover:not(:disabled) { background: var(--primary-dark); }
.btn-run:active:not(:disabled) { transform: scale(0.98); }
.btn-run:disabled { background: #cbd5e1; cursor: not-allowed; box-shadow: none; color: #f8fafc; }
.review-prompt-wrap { margin-bottom: 16px; }
.review-prompt-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: #334155; }
.review-prompt-input { width: 100%; min-height: 108px; resize: vertical; border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.6; color: var(--text); background: #fff; outline: none; transition: border-color .2s, box-shadow .2s; }
.review-prompt-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(20,99,255,.08); }
.run-hint { text-align: center; font-size: 13px; color: #64748b; margin-top: 12px; }
.run-done-info { margin-top: 12px; }
.done-check { color: var(--ok); font-weight: 500; font-size: 14px; margin-bottom: 8px; }
.log-toggle { font-size: 13px; color: var(--primary); cursor: pointer; text-decoration: none; font-weight: 500; }
/* REPORT */
.report-empty { text-align: center; padding: 32px 20px; color: #64748b; }
.report-empty-icon { font-size: 32px; margin-bottom: 12px; color: #cbd5e1; }
.report-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 8px; background: #fff; transition: box-shadow 0.2s; }
.report-item:hover { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }
.report-file-icon { font-size: 20px; color: var(--primary); }
.report-name { flex: 1; font-size: 14px; font-weight: 500; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-action-btn { background: none; border: none; cursor: pointer; font-size: 18px; color: #64748b; padding: 6px; border-radius: 6px; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.report-action-btn:hover { color: var(--primary); background: #f0fdfa; }
/* UPLOADED LIST */
.uploaded-list-wrap { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 24px; margin-bottom: 24px; box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }
.pending-list-wrap { margin-top: 20px; margin-bottom: 0; background: #f8fafc; border: 1px dashed #cbd5e1; box-shadow: none; padding: 20px; }
.uploaded-list-title { font-size: 16px; font-weight: 600; color: #0f172a; margin-bottom: 16px; text-align: center; }
.uploaded-list-section + .uploaded-list-section { margin-top: 24px; }
.uploaded-list-subtitle { font-size: 14px; font-weight: 600; color: #64748b; margin: 0 0 12px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.uploaded-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 6px; background: #f8fafc; border: 1px solid #f1f5f9; margin-bottom: 8px; }
.uploaded-item-icon { font-size: 20px; color: #ef4444; }
.uploaded-item-name { font-size: 13px; font-weight: 500; color: #334155; }
.uploaded-item-type { font-size: 12px; color: #94a3b8; }
/* TERMINAL */
.log-terminal { background: #1e293b; border-radius: 8px; margin-bottom: 24px; overflow: hidden; border: 1px solid #334155; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); }
.log-terminal-header { display: flex; align-items: center; padding: 12px 16px; background: #0f172a; gap: 12px; border-bottom: 1px solid #334155; }
.terminal-dots { display: flex; gap: 6px; }
.terminal-dots span { width: 10px; height: 10px; border-radius: 50%; opacity: 0.8; }
.terminal-dots span:nth-child(1) { background: #ef4444; }
.terminal-dots span:nth-child(2) { background: #f59e0b; }
.terminal-dots span:nth-child(3) { background: #10b981; }
.log-terminal-title { flex: 1; text-align: center; font-size: 13px; color: #94a3b8; font-weight: 500; font-family: monospace; }
.log-close-btn { background: none; border: none; color: #64748b; cursor: pointer; font-size: 16px; padding: 2px 6px; border-radius: 4px; transition: color 0.2s; }
.log-close-btn:hover { color: #f1f5f9; }
.log-body { padding: 16px; max-height: 320px; overflow-y: auto; font-family: "JetBrains Mono", "Consolas", "Courier New", monospace; font-size: 13px; line-height: 1.6; color: #cbd5e1; }
.log-body .log-info { color: #cbd5e1; }
.log-body .log-ok { color: #34d399; }
.log-body .log-error { color: #f87171; }
.log-body .log-warn { color: #fbbf24; }
.log-body .log-stage { color: #38bdf8; font-weight: 600; }
.log-footer { padding: 12px 16px; border-top: 1px solid #334155; font-size: 13px; color: #34d399; font-family: monospace; font-weight: 600; background: #0f172a; }
/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(4px); }
.modal { background: #fff; border-radius: 12px; padding: 32px; width: 480px; max-width: 90vw; text-align: center; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); }
.modal-icon { width: 56px; height: 56px; background: #f0fdfa; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--primary); margin: 0 auto 20px; }
.modal-title { font-size: 20px; font-weight: 600; color: #0f172a; margin-bottom: 24px; }
.modal-input { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 10px 14px; font-size: 14px; outline: none; transition: border-color 0.2s, box-shadow 0.2s; margin-bottom: 16px; color: #0f172a; }
.modal-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0, 191, 165, 0.2); }
.password-form .modal-input:last-of-type { margin-bottom: 12px; }
.modal-actions { display: flex; gap: 12px; margin-top: 8px; }
.btn-cancel { flex: 1; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 10px; font-size: 14px; cursor: pointer; font-weight: 500; transition: background 0.2s; color: #334155; }
.btn-cancel:hover { background: #f8fafc; color: #0f172a; }
.btn-create { flex: 1; background: var(--primary); color: #fff; border: none; border-radius: 6px; padding: 10px; font-size: 14px; font-weight: 500; cursor: pointer; transition: background 0.2s; box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.btn-create:hover { background: var(--primary-dark); }
/* FOOTER */
.footer { padding: 20px 40px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #64748b; border-top: 1px solid var(--border); background: #fff; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { color: #64748b; text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--primary); }
@media (max-width:900px){
  .page{padding:22px 18px 32px}
  .navbar{padding:0 16px}
  .steps-cards{grid-template-columns:1fr}
  .upload-sections{grid-template-columns:1fr}
  .footer{padding:16px 18px;flex-direction:column;gap:10px}
}
@media (max-width:640px){
  .auth-gate{padding:18px}
  .auth-card{padding:28px 20px}
  .brand-sub{display:none}
  .username{display:none}
  .detail-header,.page-header{flex-direction:column;align-items:flex-start;gap:12px}
}
