* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background: #f8fafc;
}

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

/* Header */
header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2563eb;
  text-decoration: none;
}

.logo span {
  color: #0f172a;
}

nav a {
  margin-left: 24px;
  text-decoration: none;
  color: #475569;
  font-weight: 500;
  font-size: 0.95rem;
}

nav a:hover {
  color: #2563eb;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  padding: 60px 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.4rem;
  margin-bottom: 12px;
  font-weight: 700;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* Tools Grid */
.tools-section {
  padding: 50px 0;
}

.section-title {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 30px;
  color: #0f172a;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.tool-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.08);
  border-color: #2563eb;
}

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

.tool-card h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
  color: #0f172a;
}

.tool-card p {
  font-size: 0.9rem;
  color: #64748b;
}

/* Ad slots: empty ones stay hidden */
.ad-slot {
  margin: 30px 0;
  text-align: center;
}

.ad-slot:empty {
  display: none;
}

/* Home page info section */
.info-section {
  padding: 10px 0 20px;
}

.info-section .container {
  max-width: 840px;
}

.info-section h3 {
  margin: 28px 0 12px;
  color: #0f172a;
}

.info-section h4 {
  margin: 18px 0 4px;
  color: #0f172a;
}

.info-section p, .info-section li {
  color: #475569;
}

.info-section ul {
  padding-left: 20px;
}

.info-section li {
  margin-bottom: 8px;
}

/* Tool Page */
.tool-page {
  padding-top: 40px;
  padding-bottom: 60px;
}

.tool-box {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
}

.tool-box h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
  color: #0f172a;
}

.tool-box .desc {
  color: #64748b;
  margin-bottom: 24px;
}

textarea, input[type="text"], input[type="number"], input[type="date"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 16px;
  font-family: inherit;
}

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

button {
  background: #2563eb;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: #64748b;
  margin-left: 10px;
}

.btn-secondary:hover {
  background: #475569;
}

.result-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
  font-size: 1.05rem;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

.stat-item {
  background: #eff6ff;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  color: #1e40af;
}

/* Content Section */
.content-section {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 30px;
  margin-top: 20px;
}

.content-section h2 {
  font-size: 1.4rem;
  margin-bottom: 12px;
  color: #0f172a;
}

.content-section p, .content-section li {
  color: #475569;
  margin-bottom: 10px;
}

.content-section ul {
  padding-left: 20px;
  margin-bottom: 16px;
}

.content-section h2:not(:first-child) {
  margin-top: 24px;
}

.content-section h3 {
  font-size: 1.05rem;
  margin: 16px 0 4px;
  color: #0f172a;
}

#qrcode canvas, #qrcode img {
  width: 220px;
  max-width: 100%;
  height: auto;
}

/* Footer */
footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 40px 0 20px;
  margin-top: 60px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 30px;
}

.footer-col h4 {
  color: white;
  margin-bottom: 12px;
  font-size: 1rem;
}

.footer-col a {
  display: block;
  color: #94a3b8;
  text-decoration: none;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: #60a5fa;
}

.copyright {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #1e293b;
  font-size: 0.85rem;
}

.copyright a {
  color: #94a3b8;
  margin: 0 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 1.8rem;
  }
  
  nav a {
    margin-left: 12px;
    font-size: 0.85rem;
  }
  
  .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  
  .header-inner {
    flex-direction: column;
    gap: 12px;
  }
}
/* Merged tool site additions */
[hidden] { display: none !important; }
.hero input[type="search"] { display: block; width: 100%; max-width: 520px; margin: 22px auto 0; padding: 13px 16px; font: inherit; border: 0; border-radius: 10px; color: #0f172a; }
nav a[aria-current] { color: #2563eb; }
.group { margin-bottom: 44px; scroll-margin-top: 130px; }
#none { text-align: center; }
.tool-page { max-width: 900px; overflow-wrap: break-word; }
.crumbs { font-size: .88rem; color: #64748b; margin-bottom: 14px; }
a { color: #2563eb; }
.content-section h1 { font-size: 1.8rem; margin-bottom: 12px; color: #0f172a; }
.content-section ol { padding-left: 22px; margin-bottom: 16px; }
.related { margin-top: 20px; }
.small { font-size: .85rem; }
.table { overflow-x: auto; margin-bottom: 16px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { border: 1px solid #e2e8f0; padding: 8px 10px; text-align: left; vertical-align: top; color: #334155; }
code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; overflow-wrap: anywhere; }
footer p { font-size: .9rem; max-width: 240px; }
label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 4px; }
.tool-box label + br { display: none; }
input, select, textarea { font: inherit; max-width: 100%; }
.tool-box input:not([type="checkbox"]):not([type="color"]):not([type="range"]), .tool-box select, .tool-box textarea { width: 100%; padding: 11px 13px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; margin: 4px 0 14px; }
.tool-box input[type="range"] { width: 100%; margin: 8px 0 14px; }
.tool-box input[type="color"] { display: block; width: 70px; height: 42px; margin: 4px 0 14px; }
.tool-box input[type="checkbox"] { width: auto; margin-right: 8px; }
.tool-box textarea { min-height: 160px; resize: vertical; }
#code { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; word-break: break-all; }
.fields, .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.fields > label { align-self: end; }
.options { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: flex-end; margin: 12px 0; }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.buttons .btn-secondary { margin-left: 0; }
.center { justify-content: center; }
.button { display: inline-block; background: #2563eb; color: #fff; padding: 12px 24px; border-radius: 8px; font-weight: 600; text-decoration: none; }
button.alt { background: #64748b; }
button:disabled { opacity: .5; cursor: default; }
form.panel + form.panel { border-top: 1px solid #e2e8f0; margin-top: 24px; padding-top: 20px; }
form.panel h2 { font-size: 1.15rem; margin-bottom: 12px; }
.out, .status { margin-top: 16px; padding: 14px 16px; background: #eff6ff; border-radius: 8px; color: #1e3a8a; }
.out:empty, .status:empty { display: none; }
.result-box { white-space: pre-wrap; overflow-wrap: anywhere; }
#result:empty { display: none; }
.drop { display: block; border: 3px dashed #93c5fd; border-radius: 14px; background: #f8fbff; padding: 28px 14px; text-align: center; cursor: pointer; }
.drop.over { border-color: #2563eb; background: #eff6ff; }
.drop input { margin-top: 12px; }
.check { font-weight: 400; }
.results, .files { list-style: none; margin-top: 12px; }
.results li, .files li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #e2e8f0; }
.results span, .files span { flex: 1; min-width: 160px; overflow-wrap: anywhere; }
.files button { padding: 4px 12px; }
.preview { display: block; max-width: 100%; max-height: 320px; margin-top: 14px; border-radius: 8px; border: 1px solid #e2e8f0; }
.diff { margin-top: 14px; font-family: ui-monospace, Consolas, monospace; font-size: .88rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.diff div { padding: 2px 8px; }
.diff .add { background: #dcfce7; color: #14532d; }
.diff .del { background: #fee2e2; color: #7f1d1d; }
.timer, .big { font-size: 3rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; margin: 8px 0; }
.timer { font-size: 4rem; }
.sample { border-radius: 8px; padding: 20px; margin: 8px 0; border: 1px solid #cbd5e1; }
.course { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 8px; }
.course input { min-width: 0; }
.course button { align-self: start; margin-top: 4px; padding: 11px 14px; }
#qrcode canvas { width: 280px; max-width: 100%; height: auto; }
@media (max-width: 768px) { header { position: static; } nav a { margin: 0 7px; } .group { scroll-margin-top: 10px; } }
@media (max-width: 520px) { .course { grid-template-columns: 1fr 1fr auto; } .course input:first-child { grid-column: 1 / -1; } .tool-box, .content-section { padding: 18px; } .big { font-size: 2.3rem; } .timer { font-size: 3.2rem; } }
.tool-box button { margin-bottom: 4px; }
@media (max-width: 520px) { .tool-box > .btn-secondary, .tool-box div > button + .btn-secondary { margin-left: 0; margin-top: 6px; } .tool-box > button + .btn-secondary { margin-right: 6px; } }
