:root {
  --bg: #eef3f8;
  --bg-soft: #f7fafc;
  --surface: #ffffff;
  --surface-alt: #f8fbff;
  --text: #12233f;
  --muted: #5f728c;
  --line: #c9d3df;
  --accent: #0b7a75;
  --accent-soft: #d9f3f1;
  --shadow-sm: 0 6px 18px rgba(9, 30, 66, 0.08);
  --shadow-md: 0 14px 32px rgba(9, 30, 66, 0.12);
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Hiragino Sans", "Yu Gothic UI", "BIZ UDPGothic", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% -10%, #e8fbf8 0%, transparent 42%),
    radial-gradient(circle at 85% 0%, #eaf0ff 0%, transparent 38%),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 60%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  padding: 22px 20px 20px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0.55) 100%);
  border-bottom: 1px solid rgba(201, 211, 223, 0.65);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(3px);
}

/* Tool pages use a compact, left-aligned header bar layout. */
.tool-page .site-header {
  text-align: left;
  padding: 16px 20px 14px;
}

.tool-page .site-header-bar {
  justify-content: flex-start;
  margin-bottom: 10px;
}

.tool-page .site-header h1,
.tool-page .site-header .tagline {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.tool-page .site-header h1 {
  margin-bottom: 6px;
}

.top-page .site-header {
  text-align: center;
  padding: 22px 20px 20px;
}

.top-page .site-header-bar {
  justify-content: center;
  margin-bottom: 12px;
}

.top-page .site-header h1,
.top-page .site-header .tagline {
  text-align: center;
}

.site-header-bar {
  max-width: 1280px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.site-header-back {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f1f5fa 100%);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.site-header-back:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.site-header-back svg {
  width: 18px;
  height: 18px;
}

.site-header-back path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-header-brand {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.03em;
  font-size: 1.05rem;
}

.site-header-brand:hover {
  color: var(--accent);
}

.site-header h1 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 3.1vw, 2.4rem);
  letter-spacing: 0.01em;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 20px 44px;
}

.top-main-content {
  width: min(960px, 100%);
}

.top-main-content .mobile-center-ad {
  margin-top: 0;
  margin-bottom: 22px;
}

.tools-section h2,
.ad-section h2 {
  font-size: 1.25rem;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tool-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform 150ms ease, box-shadow 180ms ease, border-color 150ms ease;
}

.tool-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.tool-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
}

.ad-section {
  margin-top: 28px;
}

.ad-placeholder {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  text-align: center;
  color: inherit;
  box-shadow: none;
}

button,
input,
textarea,
a {
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease, transform 150ms ease;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.site-footer {
  border-top: 1px solid rgba(201, 211, 223, 0.75);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(245, 249, 253, 0.82) 100%);
  margin-top: 28px;
  margin-top: auto;
}

.site-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer-inner a {
  color: var(--text);
  text-decoration: none;
}

.site-footer-inner a:hover {
  color: var(--accent);
}

@media (max-width: 760px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }
}
