/* ==========================================
   哈希橘猫 v2.0 GPU - Hash Orange Cat
   终端风格 · 绿色主题 · GPU 字典破解管理平台
   ========================================== */

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

:root {
  /* 暗黑绿色系 - 终端风格 */
  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-300: #86efac;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  --green-900: #14532d;

  /* 深色仪表盘背景 */
  --bg-root: #0a0f0a;
  --bg-surface: #0f140f;
  --bg-card: #131a13;
  --bg-card-hover: #1a241a;
  --bg-input: #0e120e;
  --bg-panel: #0c100c;
  --bg-toolbar: #10150f;

  /* 边框 */
  --border: #1e2d1e;
  --border-light: #2a3d2a;
  --border-accent: rgba(34, 197, 94, 0.3);

  /* 文字 */
  --text-primary: #d4e8d4;
  --text-secondary: #8ab88a;
  --text-muted: #4a6a4a;
  --text-accent: #4ade80;

  /* 功能色 */
  --accent: #22c55e;
  --accent-glow: rgba(34, 197, 94, 0.25);
  --success: #4ade80;
  --warning: #facc15;
  --error: #f87171;
  --info: #60a5fa;
  --gpu-green: #22c55e;
  --gpu-cyan: #4ade80;
  --gpu-purple: #a855f7;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.6);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.7);
  --shadow-glow: 0 0 24px var(--accent-glow);
  --shadow-gpu: 0 0 20px rgba(34, 197, 94, 0.3);

  /* 圆角 */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* 字体 - 跨平台中英文非衬线，优先无衬线黑体 */
  --font-cjk: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', 'Source Han Sans SC', 'Noto Sans SC', 'Noto Sans CJK SC', 'WenQuanYi Micro Hei', 'Heiti SC', sans-serif;
  --font-display: 'Fredoka', var(--font-cjk);
  --font-body: var(--font-cjk);
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Consolas', 'Menlo', 'Microsoft YaHei', '微软雅黑', monospace;

  /* 过渡 */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 120ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* 布局 */
  --topbar-h: 52px;
  --panel-min-w: 280px;
}

/* ==========================================
   Reset & Base
   ========================================== */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

html { font-size: 14px; }

body {
  font-family: var(--font-body);
  background: var(--bg-root);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 背景噪声 */
.bg-noise {
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 0;
}

/* 网格背景 */
.bg-grid {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(34,197,94,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34,197,94,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none; z-index: 0;
}

/* ==========================================
   Topbar
   ========================================== */
.topbar {
  position: relative; z-index: 100;
  height: var(--topbar-h);
  background: var(--bg-toolbar);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.topbar-inner {
  height: 100%;
  max-width: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  filter: drop-shadow(0 0 8px var(--accent-glow));
  animation: catPulse 3s infinite ease-in-out;
}

@keyframes catPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.brand-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  background: linear-gradient(135deg, #4ade80, #22c55e, #16a34a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-ver {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 右上角字典上传按钮 */
.btn-dict-top {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(34,197,94,0.18), rgba(22,163,74,0.08));
  border: 1px solid var(--border-accent);
  border-radius: 20px;
  color: var(--text-accent);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.btn-dict-top:hover {
  background: linear-gradient(135deg, rgba(34,197,94,0.28), rgba(22,163,74,0.15));
  box-shadow: 0 0 16px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-dict-top input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.btn-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  background: rgba(34,197,94,0.25);
  color: var(--text-accent);
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.gpu-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: default;
}

.gpu-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background var(--duration-normal);
}

.gpu-dot.active { background: var(--gpu-green); box-shadow: 0 0 8px var(--gpu-green); }
.gpu-dot.busy { background: var(--warning); animation: dotBusy 0.6s infinite; }
.gpu-dot.error { background: var(--error); }

@keyframes dotBusy {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.gpu-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ==========================================
   App Layout (三栏)
   ========================================== */
.app-layout {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 260px 1fr 340px;
  height: calc(100vh - var(--topbar-h));
  gap: 0;
  overflow: hidden;
}

/* ==========================================
   Panel 通用
   ========================================== */
.panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.panel-right {
  border-right: none;
  border-left: 1px solid var(--border);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.panel-header-sm {
  padding: 14px 18px;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-icon {
  color: var(--accent);
  opacity: 0.8;
}

.panel-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* panel-header 内的右侧操作区 */
.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-list-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.btn-floating-start-all {
  position: absolute;
  top: 10px;
  right: 16px;
  z-index: 10;
  padding: 6px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: #1a1612;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--duration-fast);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

/* 任务列表顶部留空，避免被浮动的"开始全部"按钮遮挡 */
.task-list-wrapper .task-list {
  padding-top: 40px;
}

.btn-floating-start-all:hover {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.5);
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.panel-body-sm {
  padding: 12px;
}

.panel-body-log {
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* 右侧面板分区 */
.panel-section {
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-section-grow {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ==========================================
   Upload Zone
   ========================================== */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  background: var(--bg-card);
  margin-bottom: 14px;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(34, 197, 94, 0.04);
  box-shadow: var(--shadow-glow);
}

.upload-zone-cap:hover,
.upload-zone-cap.drag-over {
  border-color: var(--gpu-cyan);
  background: rgba(6, 182, 212, 0.04);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.15);
}

.upload-icon {
  color: var(--text-muted);
  margin-bottom: 10px;
  transition: color var(--duration-normal);
}

.upload-zone:hover .upload-icon { color: var(--accent); }
.upload-zone-cap:hover .upload-icon { color: var(--gpu-cyan); }

.upload-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.upload-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, rgba(34,197,94,0.2), rgba(22,163,74,0.1));
  border-color: var(--border-accent);
  color: var(--text-accent);
}
.btn-primary:hover {
  background: linear-gradient(135deg, rgba(34,197,94,0.3), rgba(22,163,74,0.2));
  box-shadow: var(--shadow-glow);
}

.btn-accent {
  background: linear-gradient(135deg, rgba(6,182,212,0.2), rgba(6,182,212,0.08));
  border-color: rgba(6,182,212,0.3);
  color: var(--gpu-cyan);
}
.btn-accent:hover {
  background: linear-gradient(135deg, rgba(6,182,212,0.3), rgba(6,182,212,0.15));
  box-shadow: 0 0 16px rgba(6,182,212,0.2);
}

.btn-sm {
  font-size: 0.72rem;
  padding: 5px 12px;
  background: var(--bg-card);
  border-color: var(--border-light);
  color: var(--text-secondary);
}
.btn-sm:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast);
}
.btn-icon:hover {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--error);
}

.btn-upload {
  font-size: 0.78rem;
  padding: 7px 16px;
}

/* ==========================================
   Hero Upload Zone (中央 CAP 握手包专区)
   ========================================== */
.panel-body-center {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
}

.upload-zone-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px 40px;
  margin: 0;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 60% 80% at 50% 40%, rgba(34, 197, 94, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 80% 60% at 50% 60%, rgba(74, 222, 128, 0.03) 0%, transparent 60%);
  cursor: pointer;
  transition: all var(--duration-slow) var(--ease-out);
  overflow: hidden;
}

.upload-zone-hero:hover,
.upload-zone-hero.drag-over {
  background:
    radial-gradient(ellipse 60% 80% at 50% 40%, rgba(34, 197, 94, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 80% 60% at 50% 60%, rgba(74, 222, 128, 0.06) 0%, transparent 60%);
}

/* 装饰圆环 */
.hero-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid;
  pointer-events: none;
  opacity: 0;
  transition: all 0.6s var(--ease-out);
}

.hero-ring-1 {
  width: 200px; height: 200px;
  border-color: rgba(34, 197, 94, 0.15);
  animation: ringPulse 3s infinite ease-in-out;
}

.hero-ring-2 {
  width: 280px; height: 280px;
  border-color: rgba(34, 197, 94, 0.08);
  animation: ringPulse 3s infinite ease-in-out 0.5s;
}

.hero-ring-3 {
  width: 360px; height: 360px;
  border-color: rgba(74, 222, 128, 0.06);
  animation: ringPulse 3s infinite ease-in-out 1s;
}

@keyframes ringPulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

.upload-zone-hero:hover .hero-ring-1 { opacity: 0.8; }
.upload-zone-hero:hover .hero-ring-2 { opacity: 0.6; }
.upload-zone-hero:hover .hero-ring-3 { opacity: 0.4; }
.upload-zone-hero.drag-over .hero-ring { opacity: 1; animation-duration: 1s; }

/* 中心图标 */
.hero-icon-wrap {
  position: relative;
  margin-bottom: 20px;
  z-index: 1;
}

.hero-icon {
  color: var(--accent);
  opacity: 0.7;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  z-index: 2;
}

.upload-zone-hero:hover .hero-icon,
.upload-zone-hero.drag-over .hero-icon {
  opacity: 1;
  transform: scale(1.05);
  filter: drop-shadow(0 0 16px rgba(34, 197, 94, 0.4));
}

.hero-icon-pulse {
  position: absolute;
  top: 50%; left: 50%;
  width: 60px; height: 60px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.1);
  z-index: 1;
  animation: iconPulseGlow 2s infinite ease-in-out;
}

@keyframes iconPulseGlow {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; }
}

.hero-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  z-index: 1;
  letter-spacing: 0.02em;
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  z-index: 1;
}

.hero-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  z-index: 1;
}

.hero-actions {
  z-index: 1;
  margin-bottom: 24px;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: linear-gradient(135deg, rgba(34,197,94,0.3), rgba(34,197,94,0.15));
  border: 1px solid rgba(34,197,94,0.4);
  border-radius: 14px;
  color: #4ade80;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  letter-spacing: 0.03em;
  text-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.15);
}

.btn-hero:hover {
  background: linear-gradient(135deg, rgba(34,197,94,0.35), rgba(34,197,94,0.18));
  border-color: rgba(34,197,94,0.5);
  box-shadow: 0 0 24px rgba(34,197,94,0.25);
  transform: translateY(-2px);
}

.btn-hero:active {
  transform: translateY(0);
}

/* 支持的格式标签 */
.hero-formats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  z-index: 1;
}

.fmt-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 10px;
  transition: all var(--duration-fast);
}

.upload-zone-hero:hover .fmt-tag {
  border-color: var(--border-light);
  color: var(--text-secondary);
}

/* ==========================================
   Dict List
   ========================================== */
.dict-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dict-empty, .task-empty {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-muted);
}

.dict-empty .cat-icon, .task-empty .cat-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 6px;
}

.dict-empty p, .task-empty p {
  font-size: 0.8rem;
}

.dict-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--bg-card), rgba(15, 20, 15, 0.8));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast);
  cursor: default;
  backdrop-filter: blur(8px);
}

.dict-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

.dict-item-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.dict-item-info {
  flex: 1;
  min-width: 0;
}

.dict-item-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.shared-tag {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  flex-shrink: 0;
  font-weight: 600;
  text-shadow: 0 0 6px rgba(74, 222, 128, 0.5);
}

.local-tag {
  background: rgba(34, 197, 94, 0.12);
  color: var(--text-accent);
}

.dict-shared {
  border-left: 2px solid rgba(34, 197, 94, 0.3);
}

.dict-item-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
}

.dict-item-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.dict-item-actions button {
  width: 26px; height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--duration-fast);
}

.dict-item-actions button:hover {
  background: var(--bg-input);
  border-color: var(--border);
  color: var(--error);
}

/* ==========================================
   Task List
   ========================================== */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-card {
  background: linear-gradient(135deg, var(--bg-card), rgba(15, 20, 15, 0.8));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 0 8px 12px 8px;
  transition: all var(--duration-fast);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.task-list > .task-card:first-child {
  margin-top: 12px;
}

.task-list > .task-card:last-child {
  margin-bottom: 12px;
}

/* "开始全部" 按钮栏 */
.task-start-all-bar {
  margin-bottom: 12px;
  text-align: center;
}

.task-start-all-bar .btn {
  padding: 10px 28px;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: #1a1612;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.task-start-all-bar .btn:hover {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.task-card:hover {
  border-color: var(--border-light);
}

.task-card.running {
  border-color: var(--gpu-cyan);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.1);
}

.task-card.cracked {
  border-color: var(--success);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.15);
}

.task-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.task-card-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.task-card-status {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
  flex-shrink: 0;
}

.status-pending { background: rgba(107,93,74,0.2); color: var(--text-muted); }
.status-running { background: rgba(34,197,94,0.15); color: var(--accent); }
.status-cracked { background: rgba(52,211,153,0.15); color: var(--success); }
.status-exhausted { background: rgba(248,113,113,0.15); color: var(--error); }

.task-progress {
  margin-bottom: 8px;
}

.task-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.task-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #86efac);
  border-radius: 2px;
  transition: width 0.3s var(--ease-out);
}

.task-progress-fill.cracked {
  background: linear-gradient(90deg, var(--success), #10B981);
}

.task-progress-text {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.task-dict-name {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-speed {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gpu-cyan);
}

.task-result {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(52,211,153,0.08);
  border: 1px solid rgba(52,211,153,0.2);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--success);
  word-break: break-all;
}

/* 运行中指示器 - 脉冲动画 */
.running-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  padding: 4px 10px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 20px;
  animation: runningPulse 1.5s infinite ease-in-out;
}

@keyframes runningPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.3); }
  50% { opacity: 0.85; box-shadow: 0 0 12px 2px rgba(34, 197, 94, 0.2); }
}

/* 运行中任务卡片边框发光 */
.task-card.running {
  border-color: rgba(34, 197, 94, 0.2);
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.08);
}

/* ==========================================
   GPU Panel
   ========================================== */
.gpu-visual {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 10px;
}

#gpuCanvas {
  display: block;
  width: 100%;
  height: auto;
}

.gpu-info-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
}

.gpu-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
}

.gpu-info-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gpu-info-value {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-primary);
  font-weight: 500;
}

.gpu-util {
  color: var(--gpu-green) !important;
}

/* GPU 性能条 */
.gpu-perf-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.perf-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.perf-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  width: 52px;
  flex-shrink: 0;
  text-align: right;
}

.perf-bar-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.perf-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #86efac);
  border-radius: 3px;
  transition: width 0.5s var(--ease-out);
}

.perf-bar-mem {
  background: linear-gradient(90deg, #22c55e, #86efac);
}

.perf-bar-hash {
  background: linear-gradient(90deg, var(--gpu-purple), #22c55e);
}

.perf-val {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-secondary);
  width: 56px;
  flex-shrink: 0;
}

.perf-val-hash {
  color: var(--gpu-cyan);
}

/* GPU Fallback */
.gpu-fallback {
  text-align: center;
  padding: 20px 12px;
}

.fallback-icon { font-size: 2rem; margin-bottom: 8px; }

.fallback-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.fallback-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ==========================================
   Log
   ========================================== */
.log-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.6;
}

.log-entry {
  display: flex;
  gap: 8px;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
}

.log-time {
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0.6;
}

.log-msg { color: var(--text-secondary); word-break: break-all; white-space: pre-wrap; }
.log-info .log-msg { color: var(--text-secondary); word-break: break-all; white-space: pre-wrap; }
.log-success .log-msg { color: var(--success); }
.log-warn .log-msg { color: var(--warning); }
.log-error .log-msg { color: var(--error); }
.log-gpu .log-msg { color: var(--gpu-cyan); }
.log-cracked .log-msg { color: var(--success); font-weight: 600; }

/* ==========================================
   Toast
   ========================================== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 50px;
  padding: 10px 24px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-primary);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: all 0.4s var(--ease-spring);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--error); }
.toast.warn { border-color: var(--warning); }

/* ==========================================
   Scrollbar
   ========================================== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-700); }

::selection { background: rgba(34, 197, 94, 0.25); color: var(--text-primary); }


/* ==========================================
   Mobile Tab Bar
   ========================================== */
.mobile-tab-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  background: var(--bg-toolbar);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
  padding: 4px 8px;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
}

.mobile-tab-bar button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.6rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast);
}

.mobile-tab-bar button svg { width: 20px; height: 20px; }

.mobile-tab-bar button.active {
  color: var(--accent);
  background: rgba(34, 197, 94, 0.08);
}

.mobile-panel-hidden { display: none !important; }

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 1100px) {
  .app-layout {
    grid-template-columns: 220px 1fr 280px;
  }
}

@media (max-width: 860px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }
  .panel-left, .panel-right { max-height: 300px; }
  .panel { border-right: none; border-bottom: 1px solid var(--border); }
  .panel-right { border-left: none; }
}

/* ==========================================
   Mobile (< 768px)
   ========================================== */
@media (max-width: 768px) {
  :root {
    --topbar-h: 44px;
  }

  html { font-size: 13px; }

  body {
    overflow: hidden;
    padding-bottom: 60px; /* tab bar 高度 */
  }

  /* Topbar */
  .topbar-inner {
    padding: 0 12px;
    gap: 8px;
  }

  .brand-logo { width: 30px; height: 30px; }
  .brand-text { font-size: 1rem; }
  .brand-ver { display: none; }

  .topbar-actions {
    gap: 6px;
  }

  .btn-dict-top { padding: 5px 10px; font-size: 0.7rem; }
  .btn-dict-top svg { display: none; }
  .gpu-indicator { padding: 4px 10px; }
  .gpu-label { font-size: 0.7rem; }



  /* Layout: 单栏 + 底部 tab 切换 */
  .app-layout {
    display: block;
    height: calc(100vh - var(--topbar-h) - 60px);
    overflow-y: auto;
    overflow-x: hidden;
  }

  .panel {
    border-right: none;
    border-left: none;
    border-bottom: 1px solid var(--border);
    max-height: none;
    flex-shrink: 0;
    min-height: 100%;
  }

  .panel-body {
    max-height: 50vh;
    overflow-y: auto;
  }

  .panel-center {
    border-bottom: none;
  }

  /* 移动端右侧面板：让 GPU 面板和日志占满可见空间 */
  .panel-right {
    min-height: calc(100vh - var(--topbar-h) - 60px);
  }
  .panel-right .panel-section-grow {
    flex: 1 1 auto;
    min-height: 240px;
  }
  .panel-right .panel-section {
    flex-shrink: 0;
  }
  .panel-right .panel-body-log {
    min-height: 200px;
  }

  /* 移动端面板切换状态：默认全部隐藏，由 JS 添加 mobile-panel-hidden 控制显示 */
  .panel-left, .panel-right, .panel-center { display: none; }
  .panel-left:not(.mobile-panel-hidden),
  .panel-right:not(.mobile-panel-hidden),
  .panel-center:not(.mobile-panel-hidden) { display: flex; }

  .mobile-tab-bar {
    display: flex;
  }

  /* Hero 上传区缩小 */
  .upload-zone-hero {
    padding: 32px 16px 28px;
  }

  .hero-ring-1 { width: 140px; height: 140px; }
  .hero-ring-2 { width: 200px; height: 200px; }
  .hero-ring-3 { width: 260px; height: 260px; }

  .hero-icon svg { width: 60px; height: 60px; }
  .hero-title { font-size: 1.2rem; }
  .hero-desc { font-size: 0.85rem; }
  .hero-hint { font-size: 0.7rem; }

  .btn-hero {
    padding: 10px 22px;
    font-size: 0.8rem;
  }

  .fmt-tag { font-size: 0.62rem; padding: 2px 8px; }

  /* 任务卡片 */
  .task-card {
    margin: 0 4px 8px 4px;
    padding: 10px 12px;
  }

  .task-card-name {
    max-width: 140px;
    font-size: 0.8rem;
  }

  .task-card-status {
    font-size: 0.6rem;
    padding: 2px 8px;
  }

  /* 浮动按钮 */
  .btn-floating-start-all {
    top: 6px;
    right: 8px;
    padding: 5px 12px;
    font-size: 0.7rem;
  }

  /* 字典列表 */
  .dict-item {
    padding: 8px 10px;
    gap: 8px;
  }

  .dict-item-name { font-size: 0.76rem; }
  .dict-item-meta { font-size: 0.62rem; }

  /* GPU 面板 */
  .gpu-info-cards {
    grid-template-columns: 1fr 1fr;
    gap: 4px;
  }

  .gpu-info-card { padding: 6px 8px; }
  .gpu-info-label { font-size: 0.6rem; }
  .gpu-info-value { font-size: 0.7rem; }

  .perf-label { width: 42px; font-size: 0.6rem; }
  .perf-val { width: 48px; font-size: 0.6rem; }

  .gpu-visual canvas {
    width: 100% !important;
    height: auto !important;
  }

  /* 日志 */
  .log-container {
    font-size: 0.65rem;
    padding: 6px 8px;
  }

  /* Panel header */
  .panel-header {
    padding: 10px 14px;
  }

  .panel-title { font-size: 0.82rem; }
  .panel-badge { font-size: 0.65rem; padding: 2px 8px; }

  /* Toast */
  .toast {
    bottom: 80px;
    font-size: 0.75rem;
    padding: 8px 20px;
  }

  /* Scrollbar 更细 */
  ::-webkit-scrollbar { width: 3px; }
}

/* ==========================================
   Small Mobile (< 400px)
   ========================================== */
@media (max-width: 400px) {
  html { font-size: 12px; }

  .topbar-inner { padding: 0 8px; }

  .brand-text { font-size: 0.9rem; }
  .brand-logo { width: 26px; height: 26px; }

  .upload-zone-hero { padding: 24px 12px 20px; }

  .hero-ring-1 { width: 110px; height: 110px; }
  .hero-ring-2 { width: 160px; height: 160px; }
  .hero-ring-3 { width: 210px; height: 210px; }

  .hero-icon svg { width: 48px; height: 48px; }
  .hero-title { font-size: 1.05rem; }
  .hero-desc { font-size: 0.78rem; }

  .task-card-name { max-width: 110px; }
}

