:root {
  color-scheme: light dark;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #f7f8fb;
  color: #13131a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  line-height: 1.6;
  background: radial-gradient(circle at top, #eef5ff 0%, #f7f8fb 35%, #f2f4f9 100%);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header,
.site-footer {
  padding: 1rem 0;
}

.header-inner,
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

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

.nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: #3b4cca;
  font-weight: 600;
}

.main-content {
  padding: 2rem 0 3rem;
}

.hero {
  text-align: center;
  margin-bottom: 2rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.5rem, 4vw, 4rem);
}

.hero p {
  margin: 1rem auto 0;
  max-width: 42rem;
  color: #475569;
}

.tools-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 2.5rem;
}

.tool-card {
  padding: 1.5rem;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(246,249,255,0.95));
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.07);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.tool-card:hover,
.tool-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(59, 76, 202, 0.3);
  box-shadow: 0 24px 55px rgba(15, 23, 42, 0.12);
}

.tool-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
}

.tool-card p {
  margin: 0;
  color: #64748b;
}

.ad-banner {
  margin: 0 auto;
  max-width: 728px;
  min-height: 90px;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.site-footer p {
  margin: 0;
  color: #64748b;
}

.tool-page {
  padding: 2rem 0 3rem;
}

.page-header {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
}

.page-header a {
  color: #3b4cca;
  font-weight: 600;
}

.card,
.tool-card-large {
  background: #fff;
  padding: 1.5rem;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.05);
}

.form-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.input-group {
  display: grid;
  gap: 0.5rem;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.95rem 1rem;
  background: #f8fafc;
  color: #0f172a;
  font: inherit;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(59, 76, 202, 0.22);
  outline-offset: 2px;
}

button {
  border: none;
  border-radius: 14px;
  background: #3b4cca;
  color: #fff;
  padding: 0.95rem 1.25rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

button:hover,
button:focus-visible {
  transform: translateY(-1px);
  background: #2339dc;
}

.result-box {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 18px;
  background: #eef2ff;
  color: #111827;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}

.result-header + .result-box {
  margin-top: 0.5rem;
}

.result-title {
  margin: 0;
  font-size: 1rem;
  color: #475569;
}

.copy-btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  background: #eef2ff;
  color: #3b4cca;
  border: 1px solid rgba(59, 76, 202, 0.25);
}

.copy-btn:hover:not(:disabled),
.copy-btn:focus-visible:not(:disabled) {
  background: #e0e7ff;
  color: #2339dc;
}

.copy-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 640px) {
  .header-inner,
  .footer-inner,
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .ad-banner {
    width: 100%;
  }
}
