/* 光学工具箱样式：响应式 + 深色模式适配，配色与 Fluid 主题协调 */
.tf-tool {
  margin: 22px 0;
  padding: 18px 20px 20px;
  border: 1px solid var(--tf-border, #dde3ea);
  border-left: 5px solid #2f9e7a;
  border-radius: 8px;
  background: var(--tf-board, #fff);
  box-shadow: 0 1px 4px rgba(47, 65, 84, 0.08);
}

.tf-tool h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  color: var(--tf-text, #2f4154);
}

.tf-tool-formula {
  margin: 0 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  color: #2f9e7a;
  font-weight: 600;
}

.tf-tool-desc {
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: var(--tf-sec, #718096);
}

.tf-tool-note {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: var(--tf-sec, #718096);
  border-top: 1px dashed var(--tf-border, #dde3ea);
  padding-top: 10px;
}

.tf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.tf-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.85rem;
  color: var(--tf-sec, #718096);
}

.tf-grid input[type="number"],
.tf-grid select {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--tf-border, #d0d8e2);
  border-radius: 6px;
  background: var(--tf-input, #fafbfc);
  color: var(--tf-text, #2f4154);
  font-size: 0.95rem;
  box-sizing: border-box;
}

.tf-grid input:focus,
.tf-grid select:focus {
  outline: none;
  border-color: #2f9e7a;
  box-shadow: 0 0 0 2px rgba(47, 158, 122, 0.15);
}

.tf-grid input[disabled] {
  opacity: 0.55;
}

.tf-grid-sliders label {
  font-size: 0.85rem;
}

.tf-grid-sliders input[type="range"] {
  width: 100%;
  accent-color: #2f9e7a;
}

.tf-grid-sliders span {
  font-size: 0.82rem;
  color: var(--tf-text, #2f4154);
  font-variant-numeric: tabular-nums;
}

.tf-result {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 6px;
  background: #eef7f1;
  color: #1f6e43;
  font-size: 0.95rem;
  line-height: 1.8;
  white-space: pre-line;
}

.tf-result strong {
  color: #17603a;
}

#gauss-canvas {
  width: 100%;
  height: auto;
  margin-top: 10px;
  border: 1px solid var(--tf-border, #dde3ea);
  border-radius: 8px;
  background: #fff;
}

@media (prefers-color-scheme: dark) {
  .tf-tool {
    --tf-border: #3a4658;
    --tf-board: #252d38;
    --tf-input: #2c3542;
    --tf-text: #d8dde4;
    --tf-sec: #a7aeb9;
    border-color: var(--tf-border);
    background: var(--tf-board);
  }
  .tf-tool-formula {
    color: #55c29b;
  }
  .tf-result {
    background: #1d2a24;
    color: #8fe3bd;
  }
  .tf-result strong {
    color: #b3f0d4;
  }
  #gauss-canvas {
    background: #1c232e;
    border-color: var(--tf-border);
  }
}

@media (max-width: 640px) {
  .tf-tool {
    padding: 14px 14px 16px;
  }
  .tf-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .tf-result {
    font-size: 0.88rem;
  }
}
