/* === Reset & Base === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #f8f9fa;
  --color-surface: #ffffff;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
  --max-width: 960px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  width: 100%;
}

/* === Header === */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
}

.tagline {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* === Hero === */
.hero {
  text-align: center;
  padding: 48px 0 32px;
}

.hero h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.hero p {
  color: var(--color-text-muted);
}

/* === Tools Grid === */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding-bottom: 48px;
}

.tool-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: var(--color-text);
  transition: box-shadow 0.2s, transform 0.2s;
}

.tool-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.tool-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.tool-card h2 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.tool-card p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* === Tool Page Layout === */
.tool-main {
  flex: 1;
  padding: 32px 0;
}

.tool-title {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.tool-description {
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.tool-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

/* === Form Elements === */
input[type="text"],
input[type="url"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-group {
  margin-bottom: 16px;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-border);
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* === Ad Placeholder === */
.ad-slot {
  background: var(--color-bg);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin: 24px 0;
}

/* === Footer === */
.site-footer {
  margin-top: auto;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 24px 0;
  text-align: center;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
}

.footer-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.85rem;
}

.footer-nav a:hover {
  color: var(--color-primary);
}

.copyright {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* === Responsive === */
@media (max-width: 600px) {
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .hero {
    padding: 32px 0 24px;
  }

  .hero h1 {
    font-size: 1.25rem;
  }

  .tool-panel {
    padding: 16px;
  }
}
