/* ============================================================
   Cuiyh Tools – main stylesheet (dark theme)
   ============================================================ */

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

:root {
  --bg:          #1a1a2e;
  --bg-card:     #16213e;
  --bg-input:    #0f3460;
  --accent:      #4ecca3;
  --accent-glow: rgba(78, 204, 163, 0.35);
  --text:        #e0e0e0;
  --text-muted:  #7a7a9a;
  --border:      #2a2a4a;
  --danger:      #e94560;
  --radius:      12px;
  --transition:  0.2s ease;
}

html, body {
  height: 100%;
}
html {
  /* 预留滚动条，避免内容高度变化时页面宽度抖动导致顶部布局跳动 */
  overflow-y: scroll;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ---------- Navigation ---------- */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 60px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-decoration: none;
}
.navbar-brand:hover {
  text-decoration: none;
  opacity: 0.85;
}

.navbar-nav {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.navbar-nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color var(--transition);
}
.navbar-nav a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* ---------- Main content wrapper ---------- */
.main-content {
  flex: 1;
  padding: 2.5rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* ---------- Page heading ---------- */
.page-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.page-subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

/* ---------- Tool grid (index page) ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.25rem;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  text-decoration: none;
  color: var(--text);
}

.tool-card:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 8px 32px var(--accent-glow);
  border-color: var(--accent);
  text-decoration: none;
  color: var(--text);
}

.tool-card.disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.tool-card-icon {
  font-size: 2.8rem;
  margin-bottom: 0.7rem;
  line-height: 1;
}

.tool-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.tool-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ---------- Tool page layout ---------- */
.tool-page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
  text-decoration: none;
}
.btn-back:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.tool-title {
  font-size: 1.5rem;
  font-weight: 700;
}

/* ---------- Form card ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ---------- Form controls ---------- */
.form-group {
  margin-bottom: 1.2rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-control::placeholder {
  color: var(--text-muted);
}

/* 全局移除数字输入的原生上下箭头，统一为左右步进器 */
input[type="number"] {
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Number stepper group */
.num-stepper {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.num-stepper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.num-stepper-btn {
  width: 36px;
  flex-shrink: 0;
  background: var(--bg-input);
  border: none;
  color: var(--text);
  font-size: 1.05rem;
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.num-stepper-btn:hover { background: var(--accent); color: #1a1a2e; }
.num-stepper-btn:active { opacity: .75; }
.num-stepper-input {
  flex: 1;
  min-width: 0;
  background: var(--bg-input);
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  color: var(--text);
  text-align: center;
  font-size: 0.9rem;
  padding: 0.6rem 0.4rem;
  outline: none;
  -moz-appearance: textfield;
}
.num-stepper-input::-webkit-inner-spin-button,
.num-stepper-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* File input styling */
input[type="file"].form-control {
  padding: 0.45rem 0.9rem;
  cursor: pointer;
}
input[type="file"].form-control::-webkit-file-upload-button {
  background: var(--accent);
  color: #1a1a2e;
  border: none;
  border-radius: 5px;
  padding: 0.3rem 0.8rem;
  font-weight: 600;
  cursor: pointer;
  margin-right: 0.8rem;
  font-size: 0.85rem;
  transition: opacity var(--transition);
}
input[type="file"].form-control::-webkit-file-upload-button:hover {
  opacity: 0.85;
}

/* Radio group */
.radio-group {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
}
.radio-group input[type="radio"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

/* Inline group */
.form-inline {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}
.form-inline .form-group {
  flex: 1;
  min-width: 140px;
  margin-bottom: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.6rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn:not(:disabled):hover {
  opacity: 0.88;
  transform: translateY(-1px);
}
.btn:not(:disabled):active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent);
  color: #1a1a2e;
}
.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}

/* ---------- Result / status section ---------- */
.result-section {
  display: none;
}
.result-section.visible {
  display: block;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.info-item {
  background: var(--bg-input);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}
.info-item-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}
.info-item-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

/* ---------- Status / alert ---------- */
.status-box {
  border-radius: 8px;
  padding: 0.8rem 1.1rem;
  font-size: 0.9rem;
  margin-top: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.status-box.success {
  background: rgba(78, 204, 163, 0.12);
  border: 1px solid rgba(78, 204, 163, 0.4);
  color: var(--accent);
}
.status-box.error {
  background: rgba(233, 69, 96, 0.12);
  border: 1px solid rgba(233, 69, 96, 0.4);
  color: var(--danger);
}
.status-box.info {
  background: rgba(78, 204, 163, 0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

/* ---------- Progress bar ---------- */
.progress-wrap,
.progress-track {
  background: var(--bg-input);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.25s ease;
  min-width: 0;
}

/* ---------- Clip timeline (dual-handle range picker) ---------- */
.clip-timeline {
  user-select: none;
}
.clip-track {
  position: relative;
  height: 6px;
  background: var(--bg-input);
  border-radius: 99px;
  margin: 20px 0 6px;
}
.clip-range {
  position: absolute;
  top: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  pointer-events: none;
}
.clip-handle {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border: 3px solid var(--bg-card);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: ew-resize;
  transition: box-shadow var(--transition);
  z-index: 2;
}
.clip-handle:hover,
.clip-handle:active {
  box-shadow: 0 0 0 6px var(--accent-glow);
}
.clip-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------- Clip Preview Video ---------- */
.clip-preview-wrap {
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.8rem;
  position: relative;
  line-height: 0;
}
.clip-preview-wrap video {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  cursor: pointer;
}
.clip-ctrl-bar {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 4;
}
.clip-ctrl-btn {
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.7);
  color: #fff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), border-color var(--transition);
  line-height: 1;
  padding: 0;
}
.clip-ctrl-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}
.clip-loop-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
  background: rgba(0, 0, 0, 0.55);
  padding: 0 12px;
  border-radius: 22px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  height: 44px;
  white-space: nowrap;
}
.clip-loop-label input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}
.clip-time-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.clip-playhead {
  position: absolute;
  top: -8px;
  width: 3px;
  height: calc(100% + 16px);
  background: #fff;
  border-radius: 2px;
  pointer-events: none;
  z-index: 3;
  transform: translateX(-50%);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6), 0 0 2px rgba(255, 255, 255, 0.5);
}

/* ---------- Spinner ---------- */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(26, 26, 46, 0.4);
  border-top-color: #1a1a2e;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ---------- Input + button inline ---------- */
.input-with-btn {
  display: flex;
  gap: 0.5rem;
}
.input-with-btn .form-control {
  flex: 1;
}
.input-with-btn .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ---------- Preview player ---------- */
.player-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.2rem;
}
.player-btn-group {
  display: flex;
  gap: 0.3rem;
}
.player-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 0.95rem;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  line-height: 1;
  min-width: 36px;
}
.player-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.player-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1a2e;
}
.player-btn-play {
  background: #2d7a4f;
  border-color: #2d7a4f;
  color: #fff;
}
.player-btn-play:hover {
  background: #38a063;
  border-color: #38a063;
  color: #fff;
}
.player-btn-play.active {
  background: #38a063;
  border-color: #38a063;
  color: #fff;
}
.player-speed {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.player-speed-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.player-counter {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}
.preview-stage {
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  max-height: 540px;
  border: 1px solid rgba(255,255,255,0.13);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
}
.preview-stage img {
  max-width: 100%;
  max-height: 540px;
  object-fit: contain;
  display: block;
}

/* 左右双栏布局 */
.preview-stage-wrap {
  display: flex;
  gap: 8px;
}
.preview-stage-wrap .preview-stage {
  flex: 1;
  min-width: 0;
  position: relative;
  flex-direction: column;
}
.preview-stage-right {
  background: repeating-conic-gradient(#333 0% 25%, #444 0% 50%) 0 0 / 16px 16px;
}
.preview-stage-label {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.45);
  padding: 1px 6px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 3;
}
/* 去背景面板全屏按钮 */
.preview-zoom-btn {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s, opacity 0.15s;
  opacity: 0;
}
.preview-stage-right:hover .preview-zoom-btn,
.preview-stage-left:hover .preview-zoom-btn {
  opacity: 1;
}
.preview-zoom-btn:hover {
  background: rgba(78, 204, 163, 0.88);
  color: #1a1a2e;
}
/* Lightbox 全屏遗 */
#lightboxOverlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  backdrop-filter: blur(6px);
  animation: lb-fade-in 0.15s ease;
}
@keyframes lb-fade-in {
  from { opacity: 0; } to { opacity: 1; }
}
.lightbox-wrap {
  position: relative;
  max-width: 92vw;
  max-height: 92vh;
  cursor: default;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
#lightboxImg {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.7);
  display: block;
  background: repeating-conic-gradient(#333 0% 25%,#444 0% 50%) 0 0/16px 16px;
}
.lightbox-label {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
  text-align: center;
}
.lightbox-close {
  position: fixed;
  top: 16px;
  right: 20px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 9001;
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); }
.preview-bg-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
  width: 100%;
  height: 100%;
  min-height: 200px;
  z-index: 5;
}
.preview-bg-placeholder small {
  font-size: 0.72rem;
  opacity: 0.6;
}
.preview-bg-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.82rem;
  width: 100%;
  height: 100%;
  min-height: 200px;
  z-index: 9;
  background: rgba(16, 16, 36, 0.38);
}
.preview-bg-batch-mask {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(16, 16, 36, 0.82);
  z-index: 10;
  gap: 4px;
}
.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
}


/* ---------- Sequence frame grid ---------- */
.fgrid-stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.fgrid-stats strong {
  color: var(--accent);
}
.fgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 6px;
}
.fgrid-cell {
  position: relative;
  border: 2px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg);
  transition: border-color var(--transition);
}
.fgrid-cell:hover {
  border-color: var(--accent);
}
.fgrid-cell:hover .fgrid-overlay {
  opacity: 1;
}
.fgrid-cell-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
/* 多选模式下被选中的帧 */
.fgrid-cell-checked {
  border-color: #f4d03f !important;
  box-shadow: 0 0 0 2px rgba(244, 208, 63, 0.4) !important;
}
.fgrid-cell-checked::after {
  content: '✓';
  position: absolute;
  top: 5px;
  left: 5px;
  width: 20px;
  height: 20px;
  background: #f4d03f;
  color: #1a1a2e;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  line-height: 20px;
  text-align: center;
}
.fgrid-cell-disabled .fgrid-img {
  opacity: 0.28;
}
.fgrid-cell-disabled .fgrid-label {
  opacity: 0.4;
}
.fgrid-overlay {
  position: absolute;
  inset: 0;
  bottom: 22px;   /* 不覆盖 label */
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 2;
  pointer-events: none;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  padding: 4px;
  align-items: start;
  justify-items: stretch;
}
.fgrid-cell:hover .fgrid-overlay {
  opacity: 1;
  pointer-events: all;
}
/* 多选模式：隐藏所有单元格的操作按钮 */
.fgrid--multi .fgrid-overlay {
  display: none !important;
}
.fgrid-btn {
  position: static;
  border: none;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 4px;
  cursor: pointer;
  line-height: 1.6;
  backdrop-filter: blur(2px);
  text-align: center;
}
.fgrid-btn-del  { background: rgba(233,69,96,0.88); color:#fff; }
.fgrid-btn-del:hover { background: var(--danger); }
.fgrid-btn-tog  { background: rgba(30,30,60,0.82); color:#ccc; border:1px solid rgba(255,255,255,0.15); }
.fgrid-btn-tog:hover { color: var(--accent); }
.fgrid-btn-dup  { background: rgba(78,204,163,0.82); color:#1a1a2e; }
.fgrid-btn-dup:hover { background: var(--accent); }
.fgrid-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.fgrid-label {
  background: rgba(0, 0, 0, 0.72);
  color: #e0e0e0;
  font-size: 0.68rem;
  text-align: center;
  padding: 3px 0;
  letter-spacing: 0.03em;
}/* 相似帧计算遇罩 */
.fgrid-loading-mask {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: rgba(22, 33, 62, 0.82);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}
.fgrid-loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 48px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.fgrid-loading-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(78, 204, 163, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.fgrid-loading-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.fgrid-loading-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}
/* card 需要 position:relative 才能容纳绝对定位的遇罩 */
.card { position: relative; }
/* 相似度搜索结果徽标 */
.fgrid-sim-badge {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  background: rgba(78, 204, 163, 0.92);
  color: #1a1a2e;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.fgrid-sim-badge.rank-1   { background: #f4d03f; color: #1a1a2e; }
.fgrid-sim-badge.rank-2   { background: #bdc3c7; color: #1a1a2e; }
.fgrid-sim-badge.rank-3   { background: #ca6f1e; color: #fff;    }
/* rank 4-10 */
.fgrid-sim-badge.rank-top { background: rgba(78, 204, 163, 0.88); color: #1a1a2e; }
/* rank > 10：仅显示百分比，样式更小更淡 */
.fgrid-sim-badge.rank-tail {
  background: rgba(120, 120, 160, 0.65);
  color: #ddd;
  font-size: 0.56rem;
  padding: 1px 5px;
}
/* 参考帧徽标 */
.fgrid-sim-badge.rank-ref { background: #e74c3c; color: #fff; }
/* 参考帧高亮 */
.fgrid-cell-ref {
  border-color: #e74c3c !important;
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.4);
}
/* 相似帧高亮 */
.fgrid-cell-similar {
  border-color: rgba(78, 204, 163, 0.8);
  box-shadow: 0 0 0 2px rgba(78, 204, 163, 0.25);
}
/* 相似搜索按钮（左下角） */
.fgrid-btn-sim  { background: rgba(78,204,163,0.82); color:#1a1a2e; }
.fgrid-btn-sim:hover { background: var(--accent); }
.fgrid-btn-zoom { background: rgba(0,0,0,0.62); color:#fff; font-size:0.95rem; border:1px solid rgba(255,255,255,0.25); }
.fgrid-btn-zoom:hover { background: rgba(78,204,163,0.9); color:#1a1a2e; }

/* ── 事件标记按钮 ── */
.fgrid-btn-ev { background: rgba(167,139,250,0.85); color:#fff; }
.fgrid-btn-ev:hover { background: #a78bfa; }

/* ── 事件圆点徽章（嵌入底部标签栏，不遮挡按钮） ── */
.fgrid-ev-dots { display: inline-flex; gap: 3px; vertical-align: middle; margin-left: 4px; pointer-events: none; }
.fgrid-ev-dot  { width: 8px; height: 8px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.3); }

/* ── 事件标记弹窗 ── */
.ev-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 9000; display: flex; align-items: center; justify-content: center; }
.ev-modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; width: 380px; max-width: 95vw; display: flex; flex-direction: column; }
.ev-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); font-weight: 600; }
.ev-modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; }
.ev-modal-body { padding: 1rem; overflow-y: auto; max-height: 60vh; }
.ev-modal-footer { display: flex; gap: 8px; justify-content: flex-end; padding: 0.8rem 1rem; border-top: 1px solid var(--border); }
.ev-section-label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.4rem; }
.ev-color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ev-color-btn { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform 0.1s; }
.ev-color-btn:hover { transform: scale(1.15); }
.ev-color-selected { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.ev-existing-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px; background: var(--bg-secondary); border-radius: 6px; margin-bottom: 4px; }
.ev-existing-dot  { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.ev-existing-name { flex: 1; font-size: 0.88rem; }
.ev-del-btn { background: none; border: 1px solid var(--danger); color: var(--danger); border-radius: 4px; padding: 1px 7px; font-size: 0.78rem; cursor: pointer; }
.ev-del-btn:hover { background: var(--danger); color: #fff; }

/* ---------- Export section ---------- */
.export-options {
  margin-bottom: 1.2rem;
}
.export-btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 360px;
}
.export-btn {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.9rem 1.4rem;
  cursor: pointer;
  text-align: center;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}
.export-btn:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(78, 204, 163, 0.07);
  color: var(--accent);
}
.export-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.export-btn-sub {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}
/* 小尺寸导出按钮变体 */
.export-btn-sm {
  padding: 0.52rem 0.75rem;
  font-size: 0.85rem;
  gap: 0.1rem;
}
/* 单行导出按钮（不换行，主文字+帧数在同行） */
.export-btn-inline {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  white-space: nowrap;
}
.export-btn-count {
  color: var(--accent);
  font-weight: 700;
}
/* 预览高度按钮选中状态 */
.clip-prev-h-active {
  background: #b8930a !important;
  border-color: #f4d03f !important;
  color: #1a1a2e !important;
  box-shadow: none !important;
}
.atlas-prev-h-active {
  background: #b8930a !important;
  border-color: #f4d03f !important;
  color: #1a1a2e !important;
  box-shadow: none !important;
}
/* 包裹互斥导出按钮（如 NoBg / ChromaKey）的单格容器 */
.export-btn-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.export-btn-cell .export-btn {
  width: 100%;
}
.export-btn-raw {
  border-color: #4a8f6a;
  color: #7dd4aa;
}
.export-btn-raw:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(78, 204, 163, 0.07);
}

/* ============================================================
   ChromaKey tool styles
   ============================================================ */

/* === CK Card wrapper === */
.ck-card {
  border-left: 3px solid rgba(160, 80, 220, 0.6);
}
.ck-card-title {
  color: #c77dff;
}

/* 视频帧提取中的紧凑版 ChromaKey 面板（仅作用于带该类的卡片） */
.ck-card-compact {
  padding: 1.35rem 1.45rem;
}
.ck-card-compact .card-title {
  margin-bottom: 0.9rem;
}
.ck-card-compact .ck-section {
  padding: 0.72rem 0.82rem;
  margin-bottom: 0.62rem;
}
.ck-card-compact .ck-section-header {
  margin-bottom: 0.56rem;
  font-size: 0.88rem;
}
.ck-card-compact .ck-params-grid {
  gap: 0.85rem;
  margin-bottom: 0.62rem;
}
.ck-card-compact .form-label {
  margin-bottom: 0.28rem;
}
.ck-card-compact .ck-slider {
  height: 15px;
}
.ck-card-compact .ck-slider-labels {
  margin-top: 2px;
}
.ck-card-compact .ck-check-label {
  font-size: 0.85rem;
}
.ck-card-compact .ck-param-desc {
  margin-top: 0.18rem;
  line-height: 1.28;
}

/* === CK Sections === */
.ck-section {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 0.9rem;
}
.ck-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.85rem;
}

/* === 选择颜色 button (purple gradient) === */
.ck-pick-btn {
  background: linear-gradient(135deg, #9b41c8, #e91e8c);
  border: none;
  color: #fff !important;
  padding: 0.3rem 1rem;
  font-size: 0.82rem;
  border-radius: 20px;
  cursor: pointer;
  margin-left: auto;
  white-space: nowrap;
  transition: filter 0.15s;
}
.ck-pick-btn:hover:not(:disabled) { filter: brightness(1.18); }
.ck-pick-btn.ck-pick-active {
  background: linear-gradient(135deg, #c0392b, #e74c3c);
}

/* === 颜色提示框 (yellow-style) === */
.ck-color-hint {
  background: rgba(255, 215, 60, 0.1);
  border: 1px solid rgba(255, 215, 60, 0.3);
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  color: rgba(255, 215, 60, 0.85);
  font-size: 0.83rem;
}

/* === 更新预览 button === */
.ck-update-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.3rem 1.1rem;
  font-size: 0.82rem;
  border-radius: 6px;
  cursor: not-allowed;
  transition: all 0.15s;
}
.ck-update-btn:not(:disabled) {
  border-color: #c77dff;
  color: #c77dff;
  cursor: pointer;
}
.ck-update-btn:not(:disabled):hover {
  background: rgba(199, 125, 255, 0.12);
}

/* === 全选/全不选 小按钮 === */
.ck-corner-all-btn {
  background: rgba(78, 204, 163, 0.08);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.18rem 0.6rem;
  font-size: 0.78rem;
  border-radius: 5px;
  cursor: pointer;
}
.ck-corner-all-btn:hover { background: rgba(78, 204, 163, 0.2); }

/* === 开始抠图 button (large green) === */
.ck-start-btn {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #219a52, #2ecc71);
  border: none;
  color: #fff;
  padding: 0.8rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: filter 0.15s, box-shadow 0.15s;
  box-shadow: 0 3px 12px rgba(46, 204, 113, 0.3);
}
.ck-start-btn:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: 0 4px 18px rgba(46, 204, 113, 0.45);
}
.ck-start-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* === Result loading spinner overlay === */
.ck-result-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16,16,36,0.6);
  z-index: 5;
}

/* Preview row: side-by-side original + result */
.ck-preview-row {
  display: flex;
  gap: 1rem;
}
.ck-preview-col {
  flex: 1;
  min-width: 0;
}
.ck-preview-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.ck-preview-stage {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  position: relative;
}
.ck-preview-stage canvas,
.ck-preview-stage img {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  display: block;
}

/* Checkerboard transparency background */
.ck-checker-bg {
  background-image:
    linear-gradient(45deg, #333 25%, transparent 25%),
    linear-gradient(-45deg, #333 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #333 75%),
    linear-gradient(-45deg, transparent 75%, #333 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

/* Color info bar */
.ck-color-info {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.9rem;
  flex-wrap: wrap;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
}
.ck-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

/* Parameters grid */
.ck-params-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.ck-param-item {
  display: flex;
  flex-direction: column;
}
.ck-param-header {
  margin-bottom: 0.3rem;
}
.ck-param-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  line-height: 1.4;
}

/* Range slider */
.ck-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  background: transparent;
  outline: none;
  cursor: pointer;
  padding: 0;
}
.ck-slider::-webkit-slider-runnable-track {
  height: 6px;
  background: var(--bg-input);
  border-radius: 99px;
}
.ck-slider::-moz-range-track {
  height: 6px;
  background: var(--bg-input);
  border-radius: 99px;
}
.ck-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: #9b6fcc;
  border: 3px solid var(--bg-card);
  border-radius: 50%;
  cursor: pointer;
  transition: box-shadow var(--transition);
  margin-top: -6px;
}
.ck-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 6px rgba(155, 111, 204, 0.3);
}
.ck-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #9b6fcc;
  border: 3px solid var(--bg-card);
  border-radius: 50%;
  cursor: pointer;
}
.ck-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.ck-slider-labels-center {
  text-align: center;
}

/* Checkbox row */
.ck-check-row {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.ck-check-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.ck-check-label input[type="checkbox"] {
  accent-color: #9b6fcc;
  width: 16px;
  height: 16px;
}

/* Corner grid */
.ck-corner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.ck-corner-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: border-color var(--transition);
}
.ck-corner-item:hover {
  border-color: #9b6fcc;
}
.ck-corner-item input[type="checkbox"] {
  accent-color: #9b6fcc;
  width: 16px;
  height: 16px;
}
.ck-corner-icon {
  font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .ck-preview-row { flex-direction: column; }
  .ck-params-grid { grid-template-columns: 1fr; }
  .ck-corner-grid { grid-template-columns: 1fr; }
}
.export-btn-gif {
  border-color: #5b7fff;
  color: #a0b4ff;
}
.export-btn-gif:hover:not(:disabled) {
  border-color: #7b9fff;
  box-shadow: 0 0 0 3px rgba(91,127,255,0.25);
  background: rgba(91,127,255,0.07);
  color: #c0cfff;
}

/* ═══════════════════ 序列帧图集卡片 styles ═══════════════════ */
.atlas-main {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.atlas-left, .atlas-right { flex: 1 1 360px; min-width: 320px; }
.atlas-sub-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.65rem;
}
.atlas-size-grid {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  max-width: 420px;
}
.atlas-size-col {
  flex: 0 0 180px;
  min-width: 0;
}
.atlas-size-col .atlas-stepper {
  width: 180px;
  max-width: 100%;
}
.atlas-right .atlas-stepper {
  max-width: 150px;
}
.atlas-lock-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 0.28rem 0.55rem;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-body);
  margin-bottom: 1px;
  transition: background var(--transition), border-color var(--transition);
}
.atlas-lock-btn:hover { background: var(--bg-hover); border-color: var(--accent); }
/* Compact stepper variant for atlas size inputs */
.atlas-stepper .num-stepper-btn {
  width: 26px;
  font-size: 0.9rem;
}
.atlas-stepper .num-stepper-input {
  font-size: 0.85rem;
  padding: 0.45rem 0.2rem;
}
.atlas-orig-info { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.3rem; }
.atlas-quality-list { display: flex; flex-direction: column; gap: 0.45rem; }
.atlas-quality-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0.8rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.atlas-quality-item:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.atlas-quality-item input[type="radio"] {
  accent-color: var(--accent);
  width: 15px; height: 15px;
  flex-shrink: 0;
  margin-top: 3px;
}
.atlas-quality-body { display: flex; flex-direction: column; gap: 0.12rem; }
.atlas-quality-name { font-size: 0.87rem; font-weight: 600; }
.atlas-quality-desc { font-size: 0.76rem; color: var(--text-muted); }
.atlas-presets {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
}
.atlas-preset-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 0;
  min-height: 2.2rem;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: opacity var(--transition);
}
.atlas-preset-btn:hover { opacity: 0.82; }
.atlas-preset-orig {
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 2.8rem;
}
.atlas-preset-orig:hover { background: var(--accent); color: #1a1a2e; opacity: 1; }
.atlas-preset-sub {
  font-size: 0.68rem;
  font-weight: 400;
  opacity: 0.72;
}
.atlas-auto-rows-btn {
  font-size: 0.8rem;
  padding: 0.38rem 0.7rem;
  height: fit-content;
  white-space: nowrap;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.atlas-auto-rows-btn:hover { background: var(--accent); color: #fff; }
.atlas-force-square-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 0.65rem;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  font-size: 0.83rem;
  color: var(--text-body);
  cursor: pointer;
  user-select: none;
  width: fit-content;
}
.atlas-force-square-label:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}
.atlas-force-square-check {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
  flex-shrink: 0;
}
.atlas-layout-item { flex: 0 0 auto; }
.atlas-thumb-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.8rem;
}
.atlas-thumb {
  position: relative;
  width: 44px; height: 44px;
  border-radius: 4px;
  overflow: hidden;
  background: repeating-conic-gradient(#333 0% 25%, #444 0% 50%) 0 0 / 8px 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.atlas-thumb img { width: 100%; height: 100%; object-fit: contain; }
.atlas-thumb span {
  position: absolute; bottom: 0; right: 0;
  background: rgba(0,0,0,0.62);
  color: #fff; font-size: 0.58rem;
  padding: 1px 3px;
  border-radius: 2px 0 0 0;
}
.atlas-thumb-more {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.2rem 0.3rem;
}
.atlas-action-row {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.atlas-action-btn {
  flex: 1;
  min-width: 180px;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
@media (max-width: 768px) { .atlas-main { flex-direction: column; } }
@media (max-width: 1100px) {
  .atlas-main { gap: 1rem; }
  .atlas-left, .atlas-right { flex: 1 1 100%; min-width: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .tool-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 900px) {
  .tool-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .main-content {
    padding: 1.5rem 1.2rem;
  }
}
@media (max-width: 600px) {
  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .navbar {
    padding: 0 1rem;
  }
  .main-content {
    padding: 1.2rem 0.8rem;
  }
  .card {
    padding: 1.2rem;
  }
}
@media (max-width: 380px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }
}
