:root {
  --red: #e60023;
  --red-dark: #ad001a;
  --ink: #1a1a1a;
  --muted: #5f5f5f;
  --line: #e6e6e6;
  --bg: #f7f7f9;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand { font-size: 1.3rem; font-weight: 800; color: var(--ink); }
.brand span { color: var(--red); }
.site-nav { display: flex; gap: 16px; font-size: 0.95rem; flex-wrap: wrap; }
.site-nav a { color: var(--ink); font-weight: 500; }
.site-nav a:hover { color: var(--red); text-decoration: none; }

/* Hero */
.hero {
  text-align: center;
  padding: 48px 16px 20px;
}
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 10px; letter-spacing: -0.02em; }
.hero p { color: var(--muted); margin: 0 auto 8px; max-width: 640px; }

/* Tool card */
.tool-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin: 24px 0 12px;
}
.tool-form { display: flex; gap: 10px; flex-wrap: wrap; }
.tool-input {
  flex: 1 1 260px;
  padding: 13px 16px;
  font-size: 1rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  outline: none;
  background: var(--bg);
}
.tool-input:focus { border-color: var(--red); background: var(--card); }
.tool-btn {
  padding: 13px 26px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--red);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.tool-btn:hover { background: var(--red-dark); }
.tool-btn:disabled { opacity: 0.6; cursor: wait; }
.form-hint { font-size: 0.85rem; color: var(--muted); margin-top: 10px; }

/* Progress */
.progress {
  margin-top: 16px;
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  display: none;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: var(--red);
  transition: width 0.25s ease;
}
.tool-progress-label { font-size: 0.85rem; color: var(--muted); margin-top: 8px; display: none; }

/* Result */
.result {
  margin-top: 20px;
  display: none;
}
.result-loaded { display: block; }

.dl-status {
  margin: 14px 0 6px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}
.result-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.result-thumb {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--line);
  flex-shrink: 0;
}
.result-info { min-width: 0; }
.result-title { margin: 0 0 6px; font-size: 1rem; font-weight: 700; }
.result-type { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.items-list { margin-top: 14px; display: grid; gap: 8px; }
.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.item-label { font-size: 0.92rem; font-weight: 600; }
.item-note { font-size: 0.8rem; color: var(--muted); }
.btn-download {
  padding: 9px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  background: var(--red);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-download:hover { background: var(--red-dark); }
.save-tip { font-size: 0.78rem; color: var(--muted); margin-top: 10px; }

/* Errors */
.error {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #fdecec;
  border: 1px solid #f6c1c1;
  color: #8f1a1a;
  font-size: 0.95rem;
  display: none;
}
.error-visible { display: block; }

/* Ad slot */
.ad-slot {
  margin: 20px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Content sections */
.content { padding-bottom: 40px; }
.section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 20px 0; }
.section h2 { margin-top: 0; font-size: 1.25rem; }
.section ol, .section ul { padding-left: 20px; }
.article-body h2 { font-size: 1.2rem; margin-top: 28px; }
.article-body img { width: 100%; height: auto; border-radius: 8px; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-q { font-weight: 700; margin-bottom: 4px; }
.faq-a { color: var(--muted); }

/* Footer */
.site-footer {
  background: var(--card);
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 24px 16px;
  font-size: 0.85rem;
  color: var(--muted);
}
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.footer-links a { color: var(--muted); font-weight: 500; }
.footer-links a:hover { color: var(--red); text-decoration: none; }
.copyright { margin: 0; }

@media (max-width: 560px) {
  .tool-card { padding: 18px; }
  .result-card { flex-direction: column; }
  .result-thumb { width: 100%; height: auto; aspect-ratio: 1; }
  .item-row { flex-direction: column; align-items: stretch; text-align: center; }
}