/* ============================================
   全景数据质量洞察平台 - 蓝色科技风主题
   ============================================ */

:root {
  --bg-deepest: #030a14;
  --bg-dark: #050d1a;
  --bg-medium: #0a1628;
  --bg-light: #0f2240;
  --bg-card: rgba(8, 24, 52, 0.85);
  --bg-card-hover: rgba(12, 32, 68, 0.9);
  --border-base: rgba(0, 160, 255, 0.12);
  --border-glow: rgba(0, 212, 255, 0.35);
  --border-bright: rgba(0, 212, 255, 0.6);
  --primary: #00d4ff;
  --primary-dim: #0088cc;
  --accent: #1890ff;
  --accent-light: #40a9ff;
  --text-primary: #e8f0f8;
  --text-secondary: #7a9bbd;
  --text-muted: #4a6a8a;
  --success: #00e676;
  --danger: #ff4466;
  --warning: #ffab00;
  --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.15), 0 0 40px rgba(0, 212, 255, 0.05);
  --font-main: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  --radius: 6px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-main);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-deepest);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
::-webkit-scrollbar-thumb { background: rgba(0, 212, 255, 0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 212, 255, 0.4); }

a { color: var(--accent-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary); }

/* ---- Canvas & Overlays ---- */
#particles-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

.grid-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.02) 1px, transparent 1px);
  background-size: 50px 50px;
}

/* ---- Scene Management ---- */
.scene {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 10;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
  display: flex;
  flex-direction: column;
}

.scene.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* ---- Top Bar ---- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 24px;
  background: linear-gradient(135deg, rgba(8, 20, 48, 0.95), rgba(12, 28, 56, 0.9));
  border-bottom: 1px solid var(--border-base);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
  z-index: 20;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.5));
}

.logo-text {
  font-size: 18px;
  font-weight: 600;
  background: linear-gradient(135deg, #00d4ff, #1890ff, #00d4ff);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.nav-breadcrumb {
  font-size: 13px;
  color: var(--text-secondary);
  padding-left: 16px;
  border-left: 1px solid var(--border-base);
}

.user-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.role-switch {
  padding: 3px 12px;
  font-size: 12px;
  color: var(--primary);
  background: transparent;
  border: 1px solid var(--primary);
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.role-switch:hover {
  background: rgba(0, 212, 255, 0.1);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.avatar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
  font-size: 13px;
}

.avatar-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

/* ---- Sidebar ---- */
.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar {
  width: 200px;
  background: linear-gradient(180deg, rgba(8, 18, 42, 0.95), rgba(5, 14, 32, 0.98));
  border-right: 1px solid var(--border-base);
  flex-shrink: 0;
  padding-top: 8px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  color: var(--text-secondary);
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: all var(--transition);
  cursor: pointer;
}
.nav-item:hover {
  color: var(--text-primary);
  background: rgba(0, 212, 255, 0.04);
}
.nav-item.active {
  color: var(--primary);
  border-left-color: var(--primary);
  background: rgba(0, 212, 255, 0.06);
}

.nav-svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  opacity: 0.7;
}
.nav-item.active .nav-svg { opacity: 1; }

/* ---- Content Area ---- */
.content-area {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--bg-dark), var(--bg-medium));
}

/* ---- Panel with HUD corners ---- */
.panel {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.panel:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

.panel-corner {
  position: absolute;
  width: 16px; height: 16px;
  pointer-events: none;
}
.panel-corner::before, .panel-corner::after {
  content: '';
  position: absolute;
  background: var(--primary);
}
.panel-corner.tl { top: -1px; left: -1px; }
.panel-corner.tl::before { top: 0; left: 0; width: 16px; height: 2px; }
.panel-corner.tl::after { top: 0; left: 0; width: 2px; height: 16px; }
.panel-corner.tr { top: -1px; right: -1px; }
.panel-corner.tr::before { top: 0; right: 0; width: 16px; height: 2px; }
.panel-corner.tr::after { top: 0; right: 0; width: 2px; height: 16px; }
.panel-corner.bl { bottom: -1px; left: -1px; }
.panel-corner.bl::before { bottom: 0; left: 0; width: 16px; height: 2px; }
.panel-corner.bl::after { bottom: 0; left: 0; width: 2px; height: 16px; }
.panel-corner.br { bottom: -1px; right: -1px; }
.panel-corner.br::before { bottom: 0; right: 0; width: 16px; height: 2px; }
.panel-corner.br::after { bottom: 0; right: 0; width: 2px; height: 16px; }

/* scan line sweep animation on panels */
.panel::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.4), transparent);
  opacity: 0;
  animation: scanline 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes scanline {
  0% { top: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ---- Buttons ---- */
.btn-primary {
  padding: 10px 28px;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--primary-dim));
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.15), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}
.btn-primary:hover::before { opacity: 1; }
.btn-primary:hover {
  box-shadow: 0 0 20px rgba(24, 144, 255, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-default {
  padding: 10px 28px;
  font-size: 14px;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-default:hover {
  border-color: var(--primary);
  background: rgba(0, 212, 255, 0.06);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
}

.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  font-size: 14px;
  color: var(--primary);
  background: transparent;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.btn-add:hover {
  background: rgba(0, 212, 255, 0.08);
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.25);
  transform: translateY(-1px);
}
.btn-add svg { stroke: currentColor; }

.btn-compute {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, #1890ff, #0050b3);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.btn-compute:hover {
  box-shadow: 0 0 20px rgba(24, 144, 255, 0.4);
  transform: translateY(-1px);
}

/* ---- Data Table ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 500;
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(0, 160, 255, 0.06);
  border-bottom: 1px solid var(--border-base);
  white-space: nowrap;
}
.data-table td {
  padding: 14px 16px;
  font-size: 13px;
  border-bottom: 1px solid rgba(0, 160, 255, 0.06);
  color: var(--text-primary);
}
.data-table tbody tr {
  transition: background var(--transition);
}
.data-table tbody tr:hover {
  background: rgba(0, 212, 255, 0.04);
}

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
}
.status-badge.saved {
  color: var(--success);
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.action-cell { white-space: nowrap; }
.action-link {
  font-size: 13px;
  margin-right: 12px;
  color: var(--accent-light);
}
.action-link.danger { color: var(--danger); }
.action-link:hover { text-decoration: underline; }

/* ---- Steps Container ---- */
.steps-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-dark), var(--bg-medium));
  padding: 0 32px;
  position: relative;
}

/* ---- Step Bar ---- */
.step-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 0 24px;
  flex-shrink: 0;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}

.step-circle {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  border: 2px solid var(--text-muted);
  color: var(--text-muted);
  background: var(--bg-dark);
  transition: all 0.5s ease;
  position: relative;
}
.step-check { display: none; }

.step-item.active .step-circle {
  border-color: var(--primary);
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--primary-dim));
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4), 0 0 40px rgba(0, 212, 255, 0.15);
}

.step-item.completed .step-circle {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(0, 212, 255, 0.1);
}
.step-item.completed .step-num { display: none; }
.step-item.completed .step-check {
  display: block;
  font-size: 18px;
  color: var(--primary);
}

.step-label {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.5s ease;
  white-space: nowrap;
}
.step-item.active .step-label { color: var(--primary); font-weight: 500; }
.step-item.completed .step-label { color: var(--text-secondary); }

.step-line {
  width: 100px;
  height: 2px;
  background: rgba(0, 160, 255, 0.15);
  margin: 0 16px;
  margin-bottom: 28px;
  position: relative;
  border-radius: 1px;
  overflow: hidden;
}
.step-line-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.6s ease;
  border-radius: 1px;
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}
.step-line.filled .step-line-fill { width: 100%; }

.step-panels-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.step-panel {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  padding-bottom: 20px;
}
.step-panel.active {
  opacity: 1;
  pointer-events: all;
  z-index: 2;
}

/* ---- Form (Step 1) ---- */
.form-panel { max-width: 900px; margin: 0 auto; }

.section-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-left: 12px;
  border-left: 3px solid var(--primary);
}

.conn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
}
.conn-row.sub { margin-top: -8px; margin-bottom: 24px; }
.conn-label { color: var(--text-secondary); }

.conn-status {
  padding: 2px 12px;
  border-radius: 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.conn-status.disconnected {
  color: var(--danger);
  background: rgba(255, 68, 102, 0.1);
  border: 1px solid rgba(255, 68, 102, 0.3);
}
.conn-status.connected {
  color: var(--success);
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.3);
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.2);
}

.download-link {
  font-size: 12px;
  color: var(--accent-light);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.form-item { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 13px;
  color: var(--text-secondary);
}
.req { color: var(--danger); font-style: normal; margin-right: 4px; }

.form-input, .form-select {
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-primary);
  background: rgba(0, 20, 50, 0.6);
  border: 1px solid var(--border-base);
  border-radius: var(--radius);
  outline: none;
  transition: all var(--transition);
  font-family: var(--font-main);
}
.form-input:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.2);
}
.form-input.clickable { cursor: pointer; }
.form-input.clickable:hover { border-color: var(--accent); }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a9bbd' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.form-select option { background: var(--bg-medium); color: var(--text-primary); }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-base);
  margin-top: 8px;
}

/* ---- Progress & Stats (Step 2) ---- */
.analysis-panel { max-width: 1000px; margin: 0 auto; }

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

.progress-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}
.progress-label { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }

.progress-bar {
  flex: 1;
  height: 10px;
  background: rgba(0, 20, 50, 0.6);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-base);
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #0050b3, var(--accent), var(--primary));
  border-radius: 5px;
  transition: width 0.1s linear;
  position: relative;
}
.progress-glow {
  position: absolute;
  top: 0; left: 0;
  width: 0%;
  height: 100%;
  border-radius: 5px;
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.5);
  transition: width 0.1s linear;
}

.progress-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  min-width: 40px;
  text-align: right;
  font-family: var(--font-mono);
}

.compute-status {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.compute-status.done { color: var(--success); }
.compute-status.computing { color: var(--warning); }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: rgba(0, 20, 50, 0.5);
  border: 1px solid var(--border-base);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  transition: all 0.5s ease;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0;
  transition: opacity 0.5s;
}
.stat-card.lit {
  border-color: var(--border-glow);
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.12);
}
.stat-card.lit::before { opacity: 1; }

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.stat-number {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
  line-height: 1.2;
  transition: color 0.5s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-card.lit .stat-number { color: var(--primary); }
.stat-unit {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Feature Hash */
.feature-section {
  margin-bottom: 16px;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.feature-section.visible { opacity: 1; }

.feature-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}
.feature-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--primary);
  background: rgba(0, 20, 50, 0.5);
  border: 1px solid var(--border-base);
  border-radius: var(--radius);
  padding: 12px 16px;
  word-break: break-all;
  line-height: 1.6;
  min-height: 40px;
}

/* ---- Alarm Scene (Step 3) - Digital Dashboard Style ---- */
.alarm-scene {
  width: 100%; height: 100%;
  position: relative; overflow: hidden;
}
.alarm-screen {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 1.2s ease;
}
.alarm-screen.visible { opacity: 1; }
.alarm-vignette {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(160, 0, 0, 0.12) 100%);
  animation: vignetteFlash 2.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes vignetteFlash { 0%,100%{opacity:0.4}50%{opacity:1} }
.alarm-hline {
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent 10%, rgba(255,60,60,0.5) 50%, transparent 90%);
  animation: alarmScanH 4s linear infinite; pointer-events: none;
}
@keyframes alarmScanH { 0%{top:0}100%{top:100%} }
.alarm-center { position: relative; z-index: 2; text-align: center; }
.alarm-rings-wrap {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); pointer-events: none;
}
.alarm-ring {
  position: absolute; border-radius: 50%;
  border: 1px solid rgba(255, 60, 60, 0.08);
  top: 50%; left: 50%; transform: translate(-50%,-50%);
}
.alarm-ring.ar1 { width: 240px; height: 240px; animation: aRingPulse 3s ease infinite; }
.alarm-ring.ar2 { width: 360px; height: 360px; animation: aRingPulse 3s 0.6s ease infinite; }
.alarm-ring.ar3 { width: 500px; height: 500px; animation: aRingPulse 3s 1.2s ease infinite; }
@keyframes aRingPulse {
  0%,100%{ border-color: rgba(255,60,60,0.05); }
  50%{ border-color: rgba(255,60,60,0.2); }
}
.alarm-icon-wrap {
  margin-bottom: 20px;
  filter: drop-shadow(0 0 25px rgba(255,68,68,0.5));
  animation: aIconPulse 1.8s ease-in-out infinite;
}
@keyframes aIconPulse {
  0%,100%{ transform:scale(1); filter: drop-shadow(0 0 25px rgba(255,68,68,0.5)); }
  50%{ transform:scale(1.06); filter: drop-shadow(0 0 50px rgba(255,68,68,0.8)); }
}
.alarm-main-title {
  font-size: 30px; font-weight: 700; color: #ff4444;
  text-shadow: 0 0 40px rgba(255,68,68,0.5);
  margin-bottom: 8px; letter-spacing: 6px;
  animation: titleFlicker 3s ease-in-out infinite;
}
@keyframes titleFlicker { 0%,100%{opacity:1}50%{opacity:0.85} }
.alarm-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 28px; }
.alarm-cnt { color: #ff4444; font-weight: 700; font-size: 18px; }
.alarm-metrics { display: flex; gap: 20px; justify-content: center; }
.alarm-metric-card {
  background: rgba(0,0,0,0.35); border-radius: 10px; padding: 16px 20px;
  min-width: 160px; text-align: center;
  border: 1px solid rgba(255,255,255,0.04);
  backdrop-filter: blur(8px);
}
.alarm-metric-card.adanger { border-top: 2px solid #ff4444; }
.alarm-metric-card.awarning { border-top: 2px solid #ffab00; }
.metric-head { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.metric-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.metric-dot.red { background: #ff4444; box-shadow: 0 0 8px #ff4444; }
.metric-dot.orange { background: #ffab00; box-shadow: 0 0 8px #ffab00; }
.metric-score { font-size: 32px; font-weight: 700; font-family: var(--font-mono); margin-bottom: 8px; }
.adanger .metric-score { color: #ff4444; }
.awarning .metric-score { color: #ffab00; }
.metric-bar { width: 100%; height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; margin-bottom: 8px; }
.metric-fill { height: 100%; border-radius: 2px; transition: width 2s ease; width: 0; }
.adanger .metric-fill { background: #ff4444; }
.awarning .metric-fill { background: #ffab00; }
.metric-grade { font-size: 11px; color: var(--text-muted); letter-spacing: 2px; }

/* Alarm Dialog */
.alarm-dialog {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(3, 10, 20, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  backdrop-filter: blur(4px);
}
.alarm-dialog.visible {
  opacity: 1;
  pointer-events: all;
}

.dialog-box {
  background: linear-gradient(135deg, rgba(15, 25, 50, 0.98), rgba(10, 20, 42, 0.98));
  border: 1px solid rgba(255, 68, 102, 0.3);
  border-radius: 12px;
  padding: 40px 48px;
  text-align: center;
  box-shadow: 0 0 40px rgba(255, 0, 0, 0.15), 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.5s ease;
  max-width: 400px;
}
.alarm-dialog.visible .dialog-box { transform: scale(1); }

.dialog-icon {
  margin-bottom: 20px;
  animation: iconBounce 1s ease-in-out infinite;
}
@keyframes iconBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.dialog-text {
  font-size: 18px;
  font-weight: 500;
  color: var(--danger);
  line-height: 1.6;
  margin-bottom: 28px;
  text-shadow: 0 0 20px rgba(255, 68, 102, 0.3);
}

.dialog-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}
.dialog-actions .btn-primary {
  background: linear-gradient(135deg, #ff4466, #cc0033);
  min-width: 80px;
}
.dialog-actions .btn-primary:hover {
  box-shadow: 0 0 20px rgba(255, 68, 102, 0.4);
}

/* ---- Report Section (Step 4) ---- */
.report-section {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0 0 16px;
}
.report-section .section-title {
  margin-bottom: 12px;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  padding: 0 4px;
  flex-shrink: 0;
}

.report-viewer {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-base);
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  min-height: 0;
}

.pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  padding: 0 8px;
  background: #323639;
  flex-shrink: 0;
}
.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.toolbar-btn {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #ccc;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}
.toolbar-btn:hover { background: rgba(255,255,255,0.1); }
.toolbar-btn svg { stroke: #ccc; }
.page-indicator {
  font-size: 13px;
  color: #ccc;
  margin: 0 8px;
}

.report-scroll {
  flex: 1;
  overflow-y: auto;
  background: #525659;
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 0;
}

.report-document {
  width: 100%;
  max-width: 700px;
  background: #fff;
  color: #222;
  padding: 48px 56px;
  border-radius: 2px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  font-size: 13px;
  line-height: 1.7;
  flex-shrink: 0;
}

.report-title {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  color: #111;
  margin-bottom: 24px;
  letter-spacing: 2px;
}

.report-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #555;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid #ddd;
}

.report-block { margin-bottom: 24px; }
.report-block-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a6fc4;
  margin-bottom: 10px;
  padding-left: 8px;
  border-left: 3px solid #1a6fc4;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.report-table th, .report-table td {
  border: 1px solid #d0d0d0;
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}
.report-table th {
  background: #f0f5fa;
  font-weight: 500;
  color: #333;
}
.report-table .rk {
  background: #f8fafc;
  font-weight: 500;
  color: #444;
  white-space: nowrap;
  width: 110px;
}
.hash-cell {
  font-family: var(--font-mono);
  font-size: 11px;
  word-break: break-all;
  color: #555;
  line-height: 1.5;
}

.report-section .form-actions {
  padding-top: 16px;
  border-top: none;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  flex-shrink: 0;
}

/* ---- Upload Success Effect ---- */
.upload-success {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  background: rgba(3, 10, 20, 0.8);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}
.upload-success.visible { opacity: 1; pointer-events: all; }
.upload-success-box {
  text-align: center;
  color: var(--success);
}
.upload-success-box svg {
  width: 80px; height: 80px;
  stroke: var(--success);
  filter: drop-shadow(0 0 20px rgba(0, 230, 118, 0.5));
}
.upload-success-box p {
  font-size: 20px;
  margin-top: 16px;
  font-weight: 500;
}
.upload-success-box .upload-sub {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ---- Toast Notifications ---- */
.toast-container {
  position: fixed;
  top: 70px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  color: #fff;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  pointer-events: all;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  max-width: 380px;
  border-left: 3px solid;
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast.info { background: rgba(10, 30, 60, 0.92); border-left-color: var(--primary); }
.toast.success { background: rgba(10, 30, 60, 0.92); border-left-color: var(--success); }
.toast.error { background: rgba(30, 10, 15, 0.92); border-left-color: var(--danger); }
.toast.warning { background: rgba(30, 25, 10, 0.92); border-left-color: var(--warning); }
.toast-icon { flex-shrink: 0; width: 20px; height: 20px; }

/* ---- Loading Overlay ---- */
.loading-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(3, 10, 20, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(4px);
}
.loading-overlay.visible { opacity: 1; pointer-events: all; }
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(0, 212, 255, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: var(--text-secondary); font-size: 14px; margin-top: 14px; }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(3, 10, 20, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 8000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(4px);
}
.modal-overlay.visible { opacity: 1; pointer-events: all; }
.modal-box {
  background: linear-gradient(135deg, rgba(12, 24, 48, 0.98), rgba(8, 18, 38, 0.98));
  border: 1px solid var(--border-glow);
  border-radius: 10px;
  padding: 28px 32px;
  min-width: 380px;
  max-width: 500px;
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.1), 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s;
}
.modal-overlay.visible .modal-box { transform: scale(1); }
.modal-wide { min-width: 520px; max-width: 650px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-title { font-size: 16px; font-weight: 500; color: var(--text-primary); margin-bottom: 12px; }
.modal-header .modal-title { margin-bottom: 0; }
.modal-body { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; }
.modal-close {
  background: none; border: none; color: var(--text-muted); font-size: 24px; cursor: pointer; padding: 0 4px;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--text-primary); }
.modal-content { font-size: 13px; color: var(--text-secondary); line-height: 1.8; }
.modal-content .detail-row { display: flex; padding: 8px 0; border-bottom: 1px solid var(--border-base); }
.modal-content .detail-key { width: 100px; color: var(--text-muted); flex-shrink: 0; }
.modal-content .detail-val { color: var(--text-primary); }

/* ---- Notification Dropdown ---- */
.notification-wrap { position: relative; }
.notification-btn {
  position: relative;
  background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 4px;
  transition: color 0.2s;
}
.notification-btn:hover { color: var(--primary); }
.notif-badge {
  position: absolute; top: -4px; right: -6px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 600;
  min-width: 16px; height: 16px; line-height: 16px;
  border-radius: 8px; text-align: center; padding: 0 4px;
}
.notif-dropdown {
  position: absolute; top: calc(100% + 8px); right: -12px;
  width: 300px;
  background: linear-gradient(135deg, rgba(12, 24, 48, 0.98), rgba(8, 18, 38, 0.98));
  border: 1px solid var(--border-glow);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none; transform: translateY(-8px);
  transition: all 0.25s ease;
  z-index: 100;
}
.notif-dropdown.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.notif-header {
  padding: 12px 16px; font-size: 13px; font-weight: 500; color: var(--text-primary);
  border-bottom: 1px solid var(--border-base); display: flex; justify-content: space-between; align-items: center;
}
.notif-mark-read { font-size: 11px; color: var(--accent-light); cursor: pointer; }
.notif-item {
  display: flex; gap: 10px; padding: 12px 16px; cursor: pointer;
  transition: background 0.2s; align-items: flex-start;
}
.notif-item:hover { background: rgba(0, 212, 255, 0.04); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 5px; flex-shrink: 0; }
.notif-dot.read { background: var(--text-muted); opacity: 0.3; }
.notif-item.unread .notif-title { color: var(--text-primary); }
.notif-title { font-size: 13px; color: var(--text-muted); margin-bottom: 2px; }
.notif-time { font-size: 11px; color: var(--text-muted); }

/* ---- Role Dropdown ---- */
.role-switch-wrap { position: relative; }
.role-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: linear-gradient(135deg, rgba(12, 24, 48, 0.98), rgba(8, 18, 38, 0.98));
  border: 1px solid var(--border-glow); border-radius: 6px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none; transform: translateY(-6px);
  transition: all 0.2s ease; z-index: 100; min-width: 150px;
}
.role-dropdown.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.role-option {
  display: block; padding: 10px 16px; font-size: 13px; color: var(--text-secondary);
  transition: all 0.2s; white-space: nowrap;
}
.role-option:hover { background: rgba(0, 212, 255, 0.06); color: var(--text-primary); }
.role-option.active { color: var(--primary); }

/* ---- Search Bar ---- */
.content-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.content-header-left { flex-shrink: 0; }
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0, 20, 50, 0.5); border: 1px solid var(--border-base);
  border-radius: var(--radius); padding: 0 12px; height: 38px;
  transition: border-color 0.3s;
}
.search-bar:focus-within { border-color: var(--primary); }
.search-icon { stroke: var(--text-muted); flex-shrink: 0; }
.search-input {
  background: none; border: none; outline: none; color: var(--text-primary);
  font-size: 13px; font-family: var(--font-main); width: 180px;
}
.search-input::placeholder { color: var(--text-muted); }
.search-filter {
  appearance: none; background: none; border: none; border-left: 1px solid var(--border-base);
  color: var(--text-secondary); font-size: 12px; padding: 0 8px; height: 100%;
  outline: none; cursor: pointer; font-family: var(--font-main);
}
.search-filter option { background: var(--bg-medium); }

/* ---- Pagination ---- */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0 0; font-size: 13px; color: var(--text-secondary);
}
.page-info b { color: var(--primary); }
.page-btns { display: flex; gap: 4px; }
.page-btn {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 20, 50, 0.5); border: 1px solid var(--border-base);
  border-radius: 4px; color: var(--text-secondary); font-size: 13px;
  cursor: pointer; transition: all 0.2s;
}
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.page-size-wrap { display: flex; align-items: center; gap: 4px; }
.page-size-select {
  background: rgba(0, 20, 50, 0.5); border: 1px solid var(--border-base);
  border-radius: 4px; color: var(--text-primary); padding: 4px 6px; font-size: 12px;
  outline: none; font-family: var(--font-main);
}
.page-size-select option { background: var(--bg-medium); }

/* ---- Status Bar (Footer) ---- */
.status-bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 32px; padding: 0 20px;
  background: rgba(5, 12, 28, 0.95); border-top: 1px solid var(--border-base);
  font-size: 11px; color: var(--text-muted); flex-shrink: 0;
}
.status-left, .status-right { display: flex; align-items: center; gap: 8px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; }
.status-dot.online { background: var(--success); box-shadow: 0 0 6px rgba(0, 230, 118, 0.5); }
.status-sep { color: rgba(0, 160, 255, 0.15); }
.text-success { color: var(--success); }

/* ---- Sidebar Footer ---- */
.sidebar { display: flex; flex-direction: column; }
.sidebar-nav { flex: 1; }
.sidebar-footer { padding: 12px 20px; border-top: 1px solid var(--border-base); }
.sidebar-collapse-hint { font-size: 11px; color: var(--text-muted); }

/* ---- Header extras ---- */
.header-clock { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }
.header-sep { color: rgba(0, 160, 255, 0.15); font-size: 14px; }
.toolbar-sep { color: rgba(255,255,255,0.15); font-size: 14px; margin: 0 4px; }

/* ---- Status Badge Variants ---- */
.status-badge.submitted { color: var(--accent-light); background: rgba(24, 144, 255, 0.1); border: 1px solid rgba(24, 144, 255, 0.3); }
.status-badge.computing { color: var(--warning); background: rgba(255, 171, 0, 0.1); border: 1px solid rgba(255, 171, 0, 0.3); }

/* ---- Connection Spinner ---- */
.conn-spinner {
  display: none; width: 12px; height: 12px;
  border: 2px solid rgba(255, 171, 0, 0.2); border-top-color: var(--warning);
  border-radius: 50%; animation: spin 0.6s linear infinite;
  margin-right: 4px;
}
.conn-status.connecting .conn-spinner { display: inline-block; }
.conn-status.connecting { color: var(--warning); background: rgba(255, 171, 0, 0.1); border: 1px solid rgba(255, 171, 0, 0.3); }

/* ---- Form Hint ---- */
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ---- Log Console ---- */
.log-console {
  margin-bottom: 16px;
  border: 1px solid var(--border-base);
  border-radius: var(--radius);
  overflow: hidden;
}
.log-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: rgba(0, 20, 50, 0.6);
  font-size: 12px; color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.log-header svg { stroke: var(--text-muted); flex-shrink: 0; }
.log-toggle {
  margin-left: auto; background: none; border: none;
  color: var(--accent-light); font-size: 11px; cursor: pointer;
}
.log-body {
  max-height: 0; overflow-y: auto;
  background: rgba(0, 8, 20, 0.8);
  font-family: var(--font-mono); font-size: 11px; line-height: 1.8;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 14px;
}
.log-body.open { max-height: 200px; padding: 10px 14px; }
.log-line { white-space: nowrap; }
.log-line .log-time { color: var(--text-muted); }
.log-line .log-level-info { color: var(--primary); }
.log-line .log-level-warn { color: var(--warning); }
.log-line .log-level-error { color: var(--danger); }
.log-line .log-msg { color: var(--text-secondary); }

/* ---- Phase Indicator ---- */
.phase-indicator {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; margin-bottom: 16px;
  background: rgba(0, 20, 50, 0.4); border: 1px solid var(--border-base);
  border-radius: var(--radius); font-size: 12px;
}
.phase-icon { font-size: 14px; animation: spin 2s linear infinite; display: inline-block; }
.phase-current { color: var(--primary); font-weight: 500; }
.phase-sep { color: var(--text-muted); }
.phase-elapsed { color: var(--text-muted); font-family: var(--font-mono); }

/* ---- Checksum Section ---- */
.checksum-section {
  margin-bottom: 16px; opacity: 0; transition: opacity 0.8s ease;
}
.checksum-section.visible { opacity: 1; }

/* ---- Report Grade Badges ---- */
.rpt-grade { display: inline-block; padding: 1px 8px; border-radius: 3px; font-size: 11px; font-weight: 500; }
.rpt-grade.excellent { background: #e6f7e9; color: #389e0d; }
.rpt-grade.good { background: #e6f0ff; color: #1a6fc4; }
.rpt-grade.warn { background: #fff7e6; color: #d46b08; }
.rpt-grade.bad { background: #fff1f0; color: #cf1322; }
.rpt-score { font-family: var(--font-mono); font-weight: 600; text-align: center; }
.rpt-score.rpt-warn { color: #d46b08; }
.report-table-sm th, .report-table-sm td { padding: 8px 10px; font-size: 12px; }
.report-table-sm th { font-size: 11px; }

/* ---- Report Footer Stamp ---- */
.report-footer-area {
  margin-top: 32px; padding-top: 20px; border-top: 1px dashed #ccc; text-align: center;
}
.report-stamp { font-size: 11px; color: #999; line-height: 1.8; }

/* ---- Extra Decorative Effects ---- */
@keyframes borderFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.table-panel::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px; right: -1px; bottom: -1px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.15), transparent, rgba(0, 212, 255, 0.15), transparent);
  background-size: 200% 100%;
  z-index: -1;
  animation: borderFlow 6s linear infinite;
  opacity: 0.5;
}

.stat-card {
  backdrop-filter: blur(4px);
}

.btn-primary, .btn-compute {
  letter-spacing: 0.5px;
}

.form-panel, .analysis-panel {
  backdrop-filter: blur(8px);
}

/* Glow text for important labels */
.logo-text {
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

/* Animated gradient border on step circles */
.step-item.active .step-circle::after {
  content: '';
  position: absolute;
  top: -4px; left: -4px; right: -4px; bottom: -4px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: conic-gradient(from 0deg, transparent, var(--primary), transparent, var(--primary), transparent) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  animation: spinGlow 3s linear infinite;
}

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

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .step-line { width: 50px; }
}
