@font-face {
  font-family: system-ui;
  src: local("Segoe UI"), local("Inter"), local("Roboto");
}
:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --glass: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --primary: #0ea5e9;
  --accent: #f59e0b;
  --danger: #ef4444;
  --success: #10b981;
}
* { box-sizing: border-box }
.bg { display: none }
#opt-tool .header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 28px 24px 12px;
}
#opt-tool .brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
#opt-tool .subtitle {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 14px;
}
#opt-tool .actions { display: flex; gap: 10px }
#opt-tool .container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 0 40px;
}
#opt-tool .tool-grid {
  display: block;
}
#opt-tool .hidden { display: none }
#opt-tool .welcome {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  margin-bottom: 14px;
}
#opt-tool .welcome-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #dbeafe;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1d4ed8;
}
#opt-tool .welcome-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
#opt-tool .welcome-text p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
#opt-tool .card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
#opt-tool .glass { background: var(--glass) }
#opt-tool .card-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  border-left: 3px solid var(--primary);
  padding-left: 10px;
}
#opt-tool .grid {
  display: grid;
  gap: 12px;
}
#opt-tool .grid.two {
  grid-template-columns: 1fr 1fr;
}
#opt-tool .field { display: grid; gap: 8px }
#opt-tool .field label { font-size: 13px; color: var(--muted) }
#opt-tool .field input[type="text"],
#opt-tool .field input[type="number"],
#opt-tool .field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  outline: none;
}
#opt-tool .field input[type="text"]:focus,
#opt-tool .field input[type="number"]:focus,
#opt-tool .field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(14,165,233,0.15);
}
#opt-tool .inline { display: grid; grid-template-columns: 1fr auto; gap: 8px }
#opt-tool .toggles { display: grid; gap: 10px }
#opt-tool .toggle { display: flex; align-items: center; gap: 10px }
#opt-tool .toggle input[type="checkbox"] {
  appearance: none;
  width: 36px;
  height: 20px;
  border-radius: 20px;
  position: relative;
  background: #e5e7eb;
  border: 1px solid var(--border);
  transition: all .2s ease;
}
#opt-tool .toggle input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 1px; left: 1px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transform: translateX(0);
  transition: transform .2s ease;
}
#opt-tool .toggle input[type="checkbox"]:checked {
  background: #93c5fd;
}
#opt-tool .toggle input[type="checkbox"]:checked::after {
  transform: translateX(16px);
}
#opt-tool .advanced { margin-top: 12px }
#opt-tool .adv-panel {
  display: none;
  margin-top: 12px;
}
#opt-tool .adv-panel.open { display: block }
#opt-tool .range-value { margin-top: 6px; color: var(--muted); font-size: 12px }
#opt-tool .form-actions { display: flex; gap: 10px; margin-top: 14px }
#opt-tool .btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor: pointer;
  transition: box-shadow .15s ease, background .2s ease;
  font-size: 14px;
}
#opt-tool .btn:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08) }
#opt-tool .btn.primary {
  background: linear-gradient(90deg, #0ea5e9, #3b82f6);
  color: #fff;
  border: 1px solid #3b82f6;
}
#opt-tool .btn.outline {
  background: transparent;
  border: 1px solid var(--border);
}
#opt-tool .btn.glow {
  box-shadow: none;
}
#opt-tool .btn.primary:hover { filter: brightness(1.05) }
#opt-tool .btn.primary:active { transform: scale(0.98) }
#opt-tool .btn.cta {
  animation: ctaPulse 2.2s infinite;
}
@keyframes ctaPulse {
  0% { box-shadow: 0 0 0 0 rgba(14,165,233,0.45) }
  50% { box-shadow: 0 0 0 8px rgba(14,165,233,0) }
  100% { box-shadow: 0 0 0 0 rgba(14,165,233,0) }
}
#opt-tool .result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
#opt-tool #resultCard {
  margin-top: 16px;
  position: static;
  top: auto;
}
#opt-tool .result-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255,255,255,0.03);
}
#opt-tool .label { color: var(--muted); font-size: 12px; margin-bottom: 6px }
#opt-tool .fps-display { display: grid; gap: 8px }
#opt-tool .fps-main { font-size: 22px; font-weight: 700 }
#opt-tool .bar {
  height: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
#opt-tool .bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981);
  transition: width .5s ease;
}
#opt-tool .score { font-size: 18px; font-weight: 700 }
#opt-tool .system-tag {
  margin-top: 6px;
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  font-size: 12px;
}
#opt-tool .system-tag.tag-low { background:#fee2e2; border-color:#fecaca; color:#991b1b }
#opt-tool .system-tag.tag-medium { background:#ffedd5; border-color:#fed7aa; color:#9a3412 }
#opt-tool .system-tag.tag-high { background:#dcfce7; border-color:#bbf7d0; color:#14532d }
#opt-tool .system-tag.tag-ultra { background:#dbeafe; border-color:#bfdbfe; color:#1e3a8a }
#opt-tool .badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
}
#opt-tool .badge.badge-ok { background:#dcfce7; border-color:#bbf7d0; color:#14532d }
#opt-tool .badge.badge-warn { background:#ffedd5; border-color:#fed7aa; color:#9a3412 }
#opt-tool .badge.badge-danger { background:#fee2e2; border-color:#fecaca; color:#991b1b }
#opt-tool .split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
#opt-tool .card.inner { padding: 14px }
#opt-tool .rec-card {
  position: relative;
  padding-top: 28px;
}
#opt-tool .rec-ribbon {
  position: absolute;
  top: 0;
  left: 14px;
  background: var(--accent);
  color: #fff;
  padding: 2px 10px;
  border-radius: 0 0 8px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
#opt-tool .card-subtitle {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
}
#opt-tool .recommendations { display: grid; gap: 8px }
#opt-tool .rec {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: #f9fafb;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
}
#opt-tool .rec-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#opt-tool .rec-text { line-height: 1.4 }
#opt-tool .settings-table {
  width: 100%;
  border-collapse: collapse;
}
#opt-tool .settings-table thead {
  background: #f8fafc;
}
#opt-tool .settings-table th {
  font-weight: 600;
  color: #374151;
}
#opt-tool .settings-table th, #opt-tool .settings-table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  font-size: 14px;
}
#opt-tool .settings-table td.highlight {
  background: #f0f9ff;
  border-bottom-color: #bae6fd;
}
#opt-tool .guide { display: none }
#opt-tool .guide-list { display: none }
#opt-tool .pill {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef6ff;
  border: 1px solid #dbeafe;
  color: var(--text);
  font-size: 12px;
}
#opt-tool .footer { display: none }
@media (max-width: 900px) {
  #opt-tool .grid.two { grid-template-columns: 1fr }
  #opt-tool .result-grid { grid-template-columns: 1fr }
  #opt-tool .split { grid-template-columns: 1fr }
  #opt-tool .actions { justify-self: end }
  #opt-tool .tool-grid { display: block }
  #opt-tool #resultCard { position: static; top: auto }
  #opt-tool .form-actions { display: grid; grid-template-columns: 1fr 1fr }
  #opt-tool .form-actions .btn { width: 100% }
}
@media print {
  body { background: #fff; color: #000 }
  #opt-tool .bg, #opt-tool .header, #opt-tool .advanced, #opt-tool .form-actions, #shareBtn, #pdfBtn, #resetBtn { display: none }
  #opt-tool .card, #opt-tool .glass, #opt-tool .result-grid, #opt-tool .split { box-shadow: none; backdrop-filter: none; border: none }
  #opt-tool .container { padding: 0 }
}
