:root {
  --bg: #f8f9fa;
  --bg-card: #ffffff;
  --bg-input: #f8f9fa;
  --card: #ffffff;
  --text: #212529;
  --muted: #6c757d;
  --border: #dee2e6;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --accent: #2563eb;
  --accent-bright: #1d4ed8;
  --text-dim: #6c757d;
  --text-faint: #94a3b8;
  --success: #16a34a;
  --danger: #dc2626;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

header .container { max-width: 1200px; width: 100%; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 1.25rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.logo span { color: var(--text); }

main { max-width: 1200px; width: 100%; margin: 0 auto; padding: 1.5rem; min-height: calc(100vh - 180px); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; text-decoration: none; color: var(--text); transition: box-shadow 0.15s, transform 0.15s; }
.card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); transform: translateY(-2px); }
.card h3 { margin: 0 0 0.4rem; font-size: 1.1rem; color: var(--primary); }
.card p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.tool-page h1 { font-size: 1.75rem; margin: 0 0 0.5rem; }
.tool-page .desc { color: var(--muted); margin-bottom: 1.5rem; }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
label { display: block; font-weight: 500; margin-bottom: 0.4rem; font-size: 0.9rem; }
input[type="text"], input[type="number"], input[type="color"], textarea, select {
  width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.95rem; font-family: inherit;
}
textarea { resize: vertical; min-height: 120px; }
button { background: var(--primary); color: white; border: none; padding: 0.6rem 1.25rem; border-radius: var(--radius); cursor: pointer; font-size: 0.95rem; font-weight: 500; transition: background 0.15s; }
button:hover { background: var(--primary-hover); }
button.secondary { background: var(--muted); }
button.secondary:hover { background: #495057; }
button.danger { background: var(--danger); }
button.danger:hover { background: #b91c1c; }

.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
.result { background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem; min-height: 100px; word-break: break-all; font-family: monospace; white-space: pre-wrap; }

.ad-slot { background: #fffbeb; border: 1px dashed #f59e0b; border-radius: var(--radius); padding: 1rem; text-align: center; color: #92400e; font-size: 0.875rem; margin: 1rem 0; }


/* Placeholder visibility assurance */
input::placeholder,
textarea::placeholder {
    color: var(--muted);
    opacity: 1;
}
footer { background: var(--card); border-top: 1px solid var(--border); padding: 1.5rem; text-align: center; color: var(--muted); font-size: 0.9rem; }

.breadcrumb { margin-bottom: 1rem; font-size: 0.9rem; }
.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    display: inline-block;
    padding: 8px 4px;
    min-height: 44px;
    min-width: 44px;
    line-height: 28px;
}

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } main { padding: 1rem; } }

.info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; padding: 0.75rem; border-radius: var(--radius); font-size: 0.9rem; margin-bottom: 1rem; }

/* ── News Content Block ─────────────────── */
.news-block { padding: 4px 20px; }
.news-block p { margin: 0; color: var(--text-dim); line-height: 1.6; font-size: 13px; }
.news-block a { text-decoration: none; }
/* Tool intro (SEO content) */
.tool-intro {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
}
.tool-intro h2 {
    font-size: 1.1rem;
    margin: 0 0 8px 0;
}
.tool-intro p {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.65;
    margin: 0 0 8px 0;
}
.tool-intro p:last-child { margin-bottom: 0; }

/* Related tools navigation */
.related-tools {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.related-tools h3 {
    font-size: 1rem;
    margin: 0 0 16px 0;
}
.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}
.related-tool-card {
    display: block;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.875rem;
    transition: border-color .2s, background .2s;
}
.related-tool-card:hover {
    border-color: var(--accent);
    background: var(--card);
}

