/**
 * ============================================================================
 * Risk-Spark - 視覺樣式表 (Fintech Premium Glassmorphism Theme)
 * 香港打擊洗錢 (AML) 政策文件檢測專用深色科技美學設計
 * ============================================================================
 */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600;700&display=swap');

:root {
  --bg-main: #0b0f19;
  --bg-gradient: radial-gradient(circle at 15% 15%, #131b2e 0%, #0b0f19 50%, #060911 100%);
  --surface-card: rgba(18, 24, 38, 0.75);
  --surface-card-hover: rgba(24, 32, 51, 0.85);
  --surface-glass: rgba(255, 255, 255, 0.03);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(56, 189, 248, 0.5);

  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.25);
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-indigo: #6366f1;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 40px -8px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.2);

  --font-tc: 'Noto Sans TC', sans-serif;
  --font-en: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-tc);
  background: var(--bg-main);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 頂部導航列 */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-badge {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.25), rgba(245, 158, 11, 0.2));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  overflow: hidden;
  flex-shrink: 0;
}

.logo-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

.logo-badge img,
.logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(245, 158, 11, 0.4));
}

.brand-text h1 {
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-text span {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-tag {
  font-size: 12px;
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-weight: 600;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  text-decoration: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-glass);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}

/* 主容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* 橫幅 (Hero Section) */
.hero-section {
  text-align: center;
  margin-bottom: 48px;
  position: relative;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-full);
  color: #7dd3fc;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero-pill .dot {
  width: 8px;
  height: 8px;
  background: #38bdf8;
  border-radius: 50%;
  box-shadow: 0 0 10px #38bdf8;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.hero-title {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.hero-title .highlight {
  background: linear-gradient(135deg, #38bdf8 0%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  max-width: 780px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.7;
}

/* 網格卡片佈局 */
.workflow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}

@media (max-width: 900px) {
  .workflow-grid {
    grid-template-columns: 1fr;
  }
}

.glass-card {
  background: var(--surface-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 0 12px var(--primary-glow);
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

/* 行業選擇按鈕網格 */
.industry-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.industry-radio {
  display: none;
}

.industry-label {
  display: flex;
  flex-direction: column;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.industry-label:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(56, 189, 248, 0.3);
}

.industry-radio:checked + .industry-label {
  background: rgba(56, 189, 248, 0.08);
  border-color: var(--primary);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.2);
}

.ind-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.ind-code {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  color: #38bdf8;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.1);
}

.ind-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.ind-reg {
  font-size: 11px;
  color: var(--text-muted);
}

/* 表單控件 */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-label span.req {
  color: var(--accent-rose);
}

.form-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
  background: rgba(15, 23, 42, 0.9);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* 上傳區域 (Drag & Drop Dropzone) */
.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(255, 255, 255, 0.01);
  position: relative;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: rgba(56, 189, 248, 0.04);
}

.dropzone-icon {
  font-size: 40px;
  color: #38bdf8;
  margin-bottom: 12px;
}

.dropzone-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.dropzone-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.file-preview {
  display: none;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 14px;
  align-items: center;
  justify-content: space-between;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.file-name {
  font-size: 13px;
  font-weight: 600;
  color: #7dd3fc;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.btn-remove-file {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
}

.btn-remove-file:hover {
  color: var(--accent-rose);
}

/* 主要操作按鈕 */
.btn-submit {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 50%, #10b981 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(56, 189, 248, 0.45);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 即時分析進行中進度指示器 */
.analysis-progress-panel {
  display: none;
  background: var(--surface-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 40px;
  box-shadow: var(--shadow-lg);
}

.progress-header {
  text-align: center;
  margin-bottom: 28px;
}

.progress-header h3 {
  font-size: 20px;
  color: #38bdf8;
  margin-bottom: 6px;
}

.progress-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 600px;
  margin: 0 auto;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  transition: var(--transition);
}

.step-item.active {
  background: rgba(56, 189, 248, 0.08);
  border-color: var(--primary);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.15);
}

.step-item.completed {
  background: rgba(16, 185, 129, 0.08);
  border-color: var(--accent-emerald);
}

.step-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.05);
}

.step-item.active .step-icon {
  background: #38bdf8;
  color: #0b0f19;
  animation: spin 1.5s linear infinite;
}

.step-item.completed .step-icon {
  background: #10b981;
  color: #ffffff;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.step-desc {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.step-item.active .step-desc {
  color: #ffffff;
  font-weight: 600;
}

/* 檢測結果儀表板 (Audit Result Dashboard) */
.results-dashboard {
  display: none;
  animation: fadeIn 0.5s ease-out;
}

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

.report-hero-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.85));
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-lg);
  padding: 36px;
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

@media (max-width: 800px) {
  .report-hero-card {
    flex-direction: column;
    text-align: center;
  }
}

.score-display-box {
  display: flex;
  align-items: center;
  gap: 24px;
}

.score-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(11, 15, 25, 0.85);
  border: 4px solid var(--accent-emerald);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.35);
}

.score-val {
  font-family: var(--font-en);
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
}

.score-denom {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.risk-tag-badge {
  display: inline-block;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 700;
  margin-top: 10px;
}

.risk-LOW {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.risk-MEDIUM {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.risk-HIGH {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.risk-CRITICAL {
  background: rgba(225, 29, 72, 0.25);
  color: #fda4af;
  border: 1px solid #e11d48;
}

.report-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-action {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-primary-action {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
}

.btn-primary-action:hover {
  background: #0369a1;
  color: #ffffff;
}

/* 10大板塊網格 (10 Pillars Grid) */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.pillar-card {
  background: var(--surface-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: var(--transition);
}

.pillar-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-2px);
}

.pillar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.pillar-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.pillar-score-badge {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.score-good { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.score-warn { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.score-bad { background: rgba(244, 63, 94, 0.15); color: #fb7185; }

.pillar-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}

.pillar-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease-in-out;
}

.pillar-comment {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* 缺漏卡片 (Deficiency Cards) */
.deficiency-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
}

.deficiency-card {
  background: rgba(244, 63, 94, 0.03);
  border-left: 4px solid var(--accent-rose);
  border-top: 1px solid var(--border-glass);
  border-right: 1px solid var(--border-glass);
  border-bottom: 1px solid var(--border-glass);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 20px;
}

.def-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.def-title {
  font-size: 15px;
  font-weight: 700;
  color: #fca5a5;
}

.def-severity {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.sev-HIGH { background: rgba(244, 63, 94, 0.2); color: #fda4af; }
.sev-MEDIUM { background: rgba(245, 158, 11, 0.2); color: #fde68a; }

.def-statute {
  font-size: 12px;
  font-family: var(--font-mono);
  color: #94a3b8;
  margin-bottom: 10px;
}

.def-desc {
  font-size: 13px;
  color: var(--text-main);
  margin-bottom: 12px;
  line-height: 1.6;
}

.def-advice {
  font-size: 13px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px dashed rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: #7dd3fc;
}

/* 彈窗 (Modals) */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: #111827;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

/* 頁腳 */
.footer {
  border-top: 1px solid var(--border-glass);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

/* 旋轉加載動畫 */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(56, 189, 248, 0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
}

/* ============================================================================
 * 分步表單 (Progressive Steps)
 * ============================================================================ */
#amlUploadForm {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 40px;
}

.flow-step.is-locked {
  display: none;
}

.flow-step {
  scroll-margin-top: 96px;
}

.flow-step.is-revealed {
  animation: stepReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.flow-step .industry-selector {
  margin-bottom: 0;
}

.step-chip {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50%;
}

.step-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.step-hint.is-done {
  color: #34d399;
}

.upload-tip {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: 14px;
  line-height: 1.7;
  color: #fde68a;
}

.upload-tip strong {
  color: #fbbf24;
  margin-right: 4px;
}

.upload-tip-icon {
  font-size: 22px;
  line-height: 1.4;
}

.upload-tip-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.submit-wrap {
  display: none;
  margin-top: 24px;
}

.submit-wrap.is-visible {
  display: block;
  animation: stepReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 700px) {
  .industry-selector,
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
  .glass-card {
    padding: 22px 18px;
  }
  .card-header {
    flex-wrap: wrap;
  }
  .step-chip {
    margin-left: 0;
    max-width: 100%;
  }
}

/* ============================================================================
 * 遊戲式載入畫面 (Game-style Loading Screen with AML Tips)
 * ============================================================================ */
.loading-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background:
    radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.12), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.10), transparent 45%),
    rgba(6, 9, 17, 0.96);
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}

.loading-screen.is-active {
  display: flex;
  animation: fadeIn 0.4s ease-out;
}

body.is-loading {
  overflow: hidden;
}

.loading-inner {
  width: 100%;
  max-width: 680px;
}

.loading-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.loading-orb {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(56, 189, 248, 0.15);
  border-top-color: #38bdf8;
  border-right-color: #10b981;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
}

.loading-status {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
}

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

#loadingElapsed {
  font-family: var(--font-mono);
  color: #7dd3fc;
}

.loading-bar {
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-bottom: 28px;
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0284c7, #38bdf8, #10b981);
  background-size: 200% 100%;
  animation: barShimmer 2s linear infinite;
  transition: width 0.8s ease-out;
}

@keyframes barShimmer {
  from { background-position: 200% 0; }
  to { background-position: 0 0; }
}

.tip-card {
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-lg);
  padding: 24px 26px 18px;
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.08), var(--shadow-lg);
  position: relative;
}

.tip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.tip-badge {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fbbf24;
}

#tipCounter {
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-left: 6px;
}

.tip-category {
  font-size: 12px;
  font-weight: 600;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.1);
  border-radius: var(--radius-full);
  padding: 3px 12px;
}

.tip-body {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  min-height: 140px;
}

.tip-body.tip-swap {
  animation: tipSwap 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tipSwap {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

.tip-icon {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.tip-title {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
}

.tip-content {
  font-size: 15px;
  line-height: 1.8;
  color: #cbd5e1;
}

.tip-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}

.tip-timer {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

.tip-timer-fill {
  height: 100%;
  width: 0%;
  background: #fbbf24;
}

.tip-timer-fill.is-running {
  animation: tipTimer var(--tip-duration, 9s) linear forwards;
}

.tip-card:hover .tip-timer-fill.is-running {
  animation-play-state: paused;
}

@keyframes tipTimer {
  from { width: 0%; }
  to { width: 100%; }
}

.tip-next {
  background: none;
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  border-radius: var(--radius-full);
  padding: 6px 16px;
  cursor: pointer;
  transition: var(--transition);
}

.tip-next:hover {
  background: rgba(245, 158, 11, 0.12);
}

.tip-disclaimer {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 14px;
}

@media (max-width: 600px) {
  .tip-body {
    flex-direction: column;
    gap: 12px;
  }
  .tip-icon {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }
  .tip-title {
    font-size: 17px;
  }
  .tip-content {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tip-body.tip-swap,
  .flow-step.is-revealed,
  .loading-bar-fill {
    animation: none;
  }
}

/* ============================================================================
 * 結果畫面：10 大板塊 (簡化) 及問題詳細報告
 * ============================================================================ */
.result-heading {
  font-size: 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-meta {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-glass);
  font-size: 12px;
  color: var(--text-muted);
}

.result-meta strong {
  color: #7dd3fc;
  font-weight: 600;
}

.result-section-head {
  margin-bottom: 16px;
}

.result-section-head h3 {
  font-size: 18px;
  font-weight: 700;
}

.result-section-head p {
  font-size: 13px;
  color: var(--text-muted);
}

.results-dashboard .pillars-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 760px) {
  .results-dashboard .pillars-grid {
    grid-template-columns: 1fr;
  }
}

.pillar-row {
  background: var(--surface-card);
  border: 1px solid var(--border-glass);
  border-left: 4px solid var(--pillar-color, #38bdf8);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.pillar-row-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.pillar-no {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.pillar-section {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
}

.pillar-point {
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 800;
  color: var(--pillar-color, #38bdf8);
  white-space: nowrap;
}

.pillar-point small {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
}

.pillar-pips {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  margin-bottom: 10px;
}

.pillar-pips span {
  height: 5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.07);
}

.pillar-pips span.on {
  background: var(--pillar-color, #38bdf8);
}

.pillar-line {
  display: flex;
  gap: 6px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #cbd5e1;
}

.pillar-line + .pillar-line {
  margin-top: 4px;
}

.pillar-line b {
  flex-shrink: 0;
  font-weight: 700;
}

.pillar-line.good b { color: #34d399; }
.pillar-line.improve b { color: #fbbf24; }

.finding-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.finding-card {
  border: 1px solid var(--border-glass);
  border-left: 4px solid var(--sev-color, #f59e0b);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: rgba(255, 255, 255, 0.02);
  padding: 18px 20px;
}

.finding-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.finding-top .def-severity {
  flex-shrink: 0;
  white-space: nowrap;
}

.finding-issue {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.finding-section {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.finding-grid {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px 14px;
  font-size: 13px;
  line-height: 1.7;
}

.finding-grid dt {
  font-weight: 700;
  color: var(--text-muted);
}

.finding-grid dd {
  color: #e2e8f0;
}

.finding-grid dd.f-improve { color: #7dd3fc; }
.finding-grid dd.f-consequence { color: #fda4af; }
.finding-grid dd.f-reference {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #94a3b8;
}

@media (max-width: 600px) {
  .finding-grid {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .finding-grid dd {
    margin-bottom: 8px;
  }
}

/* 申報機構及聯絡資料 */
.submission-details {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 8px 14px;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

.submission-details dt {
  color: var(--text-muted);
}

.submission-details dd {
  margin: 0;
  color: #e2e8f0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

@media (max-width: 600px) {
  .submission-details {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .submission-details dd {
    margin-bottom: 8px;
  }
}

.sev-LOW { background: rgba(56, 189, 248, 0.15); color: #7dd3fc; }

@media print {
  .loading-screen,
  .navbar,
  .footer,
  .report-actions,
  #amlUploadForm,
  .hero-section {
    display: none !important;
  }
}

.form-input[readonly] {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: not-allowed;
}

.form-input[readonly]:focus {
  border-color: var(--border-glass);
  box-shadow: none;
}

/* 簡易算術驗證 (CAPTCHA) */
.captcha-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.captcha-question {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  white-space: nowrap;
  letter-spacing: 1px;
}

.captcha-input {
  max-width: 120px;
}

.result-sources {
  color: #7dd3fc;
  font-weight: 600;
  line-height: 1.8;
  margin-top: 2px;
}

/* 行業選擇卡：圖示 + 文字 */
.industry-label.industry-label-icon {
  flex-direction: row;
  align-items: center;
  gap: 14px;
}

.ind-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  transition: var(--transition);
}

.industry-radio:checked + .industry-label .ind-icon {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--primary);
  transform: scale(1.06);
}

.ind-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ind-text .ind-top {
  display: flex;
}

.ind-text .ind-name,
.ind-text .ind-reg {
  display: block;
}

/* 驗證問題即時檢查結果 */
.captcha-status {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.captcha-status.is-ok { color: #34d399; }
.captcha-status.is-bad { color: #f87171; }
.captcha-status.is-checking { color: var(--text-muted); }

.captcha-input.is-ok {
  border-color: rgba(16, 185, 129, 0.6);
}

.captcha-input.is-bad {
  border-color: rgba(244, 63, 94, 0.6);
}

/* 行業 SVG 圖示 */
.ind-svg {
  width: 30px;
  height: 30px;
  display: block;
}

/* 聯絡電郵用途提示 */
.label-hint {
  font-weight: 500;
  color: var(--text-dim);
  font-size: 12px;
}

/* 結果畫面：自動寄出報告電郵之狀態 */
.report-email-status {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.report-email-status:empty {
  display: none;
}

.report-email-status.is-sent { color: #34d399; }
.report-email-status.is-failed { color: #fbbf24; }

/* 驗證題目：手動更換按鈕 */
.captcha-refresh {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.04);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
}

.captcha-refresh:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
}

.captcha-refresh:disabled {
  cursor: wait;
  opacity: 0.7;
}

.captcha-refresh.is-spinning {
  animation: spin 0.8s linear infinite;
}

@media (max-width: 480px) {
  .captcha-row {
    flex-wrap: wrap;
  }
}
