/* ===== iframe 滚动条隐藏 ===== */
iframe {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}
iframe::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* ===== Toggle Switch ===== */
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 12px;
  transition: background 0.2s;
  cursor: pointer;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}
[data-theme="dark"] .toggle-slider {
  background: #4b5563;
}
[data-theme="dark"] .toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

/* ===== Status Dot ===== */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  margin-left: 8px;
  vertical-align: middle;
}

.status-dot.running {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== Import Zone ===== */
.import-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.import-zone:hover {
  border-color: var(--accent);
  background: var(--bg-subtle);
}

.import-zone-icon {
  color: var(--text-muted);
  margin-bottom: 10px;
  transition: color 0.2s;
}

.import-zone:hover .import-zone-icon {
  color: var(--accent);
}

.import-zone-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.import-zone-hint {
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== Badge ===== */
.badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: 20px;
}

/* ===== Shared Components ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 28px 32px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  transition: all 0.15s;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dashboard-grid { 
  display: grid; 
  grid-template-columns: 1.5fr 1fr; 
  gap: 20px;
  align-items: stretch;
}

.dashboard-grid > div > .card {
  height: 100%;
  margin-bottom: 0;
}

.stats-row { 
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.stat-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.stat-box .label { 
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted); 
  text-transform: uppercase; 
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-box .value { 
  font-size: 24px; 
  font-weight: 800; 
  font-family: var(--font-mono); 
  letter-spacing: -0.5px; 
}

.form-input, .form-select {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  width: 100%;
  outline: none;
  transition: all 0.15s;
}

.form-input:focus, .form-select:focus { 
  border-color: var(--accent); 
  box-shadow: 0 0 0 3px rgba(0,0,0,0.05); 
  background: var(--bg-card);
}

.form-input:read-only {
  background: var(--bg-subtle);
  cursor: default;
}

.form-group { 
  margin-bottom: 14px; 
}

.form-group label {
  display: block; 
  font-size: 12px; 
  font-weight: 600; 
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input-grid-3 { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 14px; 
}

.btn {
  display: inline-flex; 
  align-items: center; 
  gap: 6px;
  padding: 9px 16px; 
  border-radius: 10px; 
  font-size: 13px;
  font-weight: 600; 
  font-family: inherit; 
  cursor: pointer;
  transition: all 0.15s; 
  border: none;
  text-transform: none;
  letter-spacing: 0;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--text-secondary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary:disabled {
  background: var(--bg-hover);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

.btn-dark {
  background: #111827;
  color: #fff;
  border: none;
}

.btn-dark:hover:not(:disabled) {
  background: #1f2937;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.btn-dark:disabled {
  background: var(--bg-hover);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

[data-theme="dark"] .btn-dark {
  background: #e5e7eb;
  color: #111827;
}

[data-theme="dark"] .btn-dark:hover:not(:disabled) {
  background: #f3f4f6;
}

.author-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s;
}
.author-row:hover {
  background: var(--bg-hover);
}
.author-row img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Changelog renderer */
#info-changelog { padding: 20px; min-height: 120px; }
.cl-h2 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 16px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.cl-h2:first-child { margin-top: 0; }
.cl-h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 12px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cl-list {
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}
.cl-list li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  padding: 2px 0 2px 16px;
  position: relative;
}
.cl-list li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary, #6366f1);
}
.cl-p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 4px 0;
}

.btn-secondary { 
  background: var(--bg-subtle); 
  color: var(--text); 
  border: 1px solid var(--border); 
}

.btn-secondary:hover:not(:disabled) { 
  background: var(--bg-hover); 
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(220,38,38,0.2);
}

.btn-danger:hover {
  background: rgba(220,38,38,0.04);
}

.btn-row { 
  display: flex; 
  gap: 10px; 
  flex-wrap: wrap;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.progress-bg { 
  background: #f3f3f3; 
  height: 4px; 
  border-radius: 2px;
  margin-top: 10px; 
  overflow: hidden;
}

.progress-bar { 
  background: var(--accent); 
  height: 100%; 
  width: 0%; 
  transition: width 0.4s ease; 
}

.log-box {
  background: #0f1115;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  height: 280px;
  overflow-y: auto;
  padding: 18px 22px;
  font-family: 'JetBrains Mono', 'Cascadia Code', 'SF Mono', 'Consolas', ui-monospace, monospace;
  font-size: 12.5px;
  font-weight: 450;
  color: rgba(226, 232, 240, 0.82);
  line-height: 1.62;
  letter-spacing: 0.01em;
  font-feature-settings: "liga" 1, "calt" 1, "zero" 1, "tnum" 1, "cv02" 1, "cv11" 1;
  font-variant-ligatures: contextual;
  font-variant-numeric: tabular-nums slashed-zero;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  white-space: pre-wrap;
  word-break: break-word;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.log-box::-webkit-scrollbar { width: 8px; }
.log-box::-webkit-scrollbar-track { background: transparent; }
.log-box::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}
.log-box::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* 每一行的结构化着色 */
.log-line {
  display: block;
  padding: 1px 6px;
  margin: 0 -6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s;
}
.log-line:hover { background: rgba(255,255,255,0.05); }
.log-line:active { background: rgba(125, 211, 252, 0.15); }
.log-line.log-copied {
  background: rgba(134, 239, 172, 0.12);
  transition: background 0.6s;
}

.log-time {
  color: rgba(148, 163, 184, 0.7);
  margin-right: 8px;
  user-select: none;
}
.log-tag {
  color: #7dd3fc;
  font-weight: 500;
  margin-right: 4px;
}
.log-step {
  color: #c4b5fd;
  margin-right: 4px;
}
.log-line-success { color: #86efac; }
.log-line-error   { color: #fca5a5; }
.log-line-warn    { color: #fcd34d; }
.log-line-debug   { color: rgba(148, 163, 184, 0.55); font-style: italic; }

.log-box-full {
  height: calc(100vh - 200px);
}



/* ===== Settings Page Layout ===== */
.settings-group {
  margin-bottom: 0;
}
.settings-group-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.settings-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.settings-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.settings-item-main {
  margin-bottom: 12px;
}
.settings-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.settings-item-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.settings-item-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
