/* SQL 纠错器 */

/* 登录弹窗 */
.login-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.login-modal.visible {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}

.login-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 74, 110, 0.4);
  backdrop-filter: blur(4px);
}

.login-modal-box {
  position: relative;
  max-width: 380px;
  width: 100%;
  margin: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.login-modal-box h2 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.login-hint {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-form input {
  padding: 0.75rem 1rem;
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
}

.login-form input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.login-form .btn-primary {
  margin-top: 0.25rem;
}

.app-screen {
  display: block;
}

.app-screen.hidden {
  display: none;
}

.btn-logout {
  margin-top: 1rem;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
}

.sql-section {
  max-width: 1100px;
}

.sql-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .sql-layout {
    grid-template-columns: 1fr;
  }
}

.sql-input-card h3,
.sql-output-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--accent-deep);
}

#sql-input {
  width: 100%;
  min-height: 200px;
  padding: 1rem;
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-radius: 8px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9rem;
  resize: vertical;
  background: #fff;
}

#sql-input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.sql-actions, .output-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
}

.btn-secondary {
  padding: 0.75rem 1.25rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(14, 165, 233, 0.15);
}

.sql-output {
  min-height: 200px;
  padding: 1rem;
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 8px;
  background: #f8fcff;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-all;
}

.sql-output.empty::before {
  content: '纠错结果将显示在这里';
  color: var(--text-secondary);
  opacity: 0.7;
}

.sql-output .error {
  color: #b91c1c;
}

.sql-output .fix {
  color: var(--accent-deep);
}

.sql-output .warn {
  color: #b45309;
}

.btn-copy {
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
}
