:root {
  color-scheme: light;
  --bg: #f7f9fb;
  --panel: #ffffff;
  --ink: #182033;
  --muted: #647086;
  --line: #e3e8ef;
  --brand: #1677ff;
  --brand-dark: #0b57d0;
  --ok: #0f9f6e;
  --warn: #b45309;
  --shadow: 0 16px 40px rgba(22, 31, 50, .08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 5vw, 72px);
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.nav a:hover,
.site-footer a:hover {
  color: var(--brand);
}

.hero {
  display: grid;
  align-items: center;
  min-height: 420px;
  padding: 64px clamp(18px, 6vw, 88px) 48px;
  background:
    linear-gradient(135deg, rgba(22, 119, 255, .10), rgba(15, 159, 110, .08)),
    radial-gradient(circle at 82% 28%, rgba(22, 119, 255, .16), transparent 34%),
    #fff;
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  max-width: 760px;
  margin: 12px 0 16px;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.08;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0;
  color: var(--brand-dark);
  font-weight: 700;
}

.hero-copy {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button,
button,
.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.button.primary,
button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.button.ghost {
  background: transparent;
}

button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.section,
.page,
.tool-page {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.section {
  padding: 56px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-head h2,
.page h1,
.tool-intro h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  letter-spacing: 0;
}

.section-head p,
.page p,
.tool-intro p {
  margin: 8px 0 0;
  color: var(--muted);
}

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

.tool-card {
  display: block;
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(22, 31, 50, .04);
}

.tool-card:hover {
  border-color: rgba(22, 119, 255, .38);
  transform: translateY(-2px);
}

.tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 34px;
  padding: 0 8px;
  border-radius: 7px;
  background: #eef5ff;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

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

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

.two-col {
  display: grid;
  grid-template-columns: 1.4fr .8fr;
  gap: 20px;
}

.note,
.panel,
.faq,
.ad-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.note {
  padding: 20px;
}

.note p {
  margin-bottom: 0;
  color: var(--muted);
}

.page,
.tool-page {
  padding: 46px 0 70px;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  margin-top: 24px;
  align-items: start;
}

.panel {
  padding: 22px;
  box-shadow: var(--shadow);
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 22px;
  border: 2px dashed #c9d5e5;
  border-radius: 8px;
  background: #f8fbff;
  color: var(--muted);
  text-align: center;
}

.drop-zone strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

input[type="file"] {
  width: 100%;
  margin-top: 14px;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
}

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

.status {
  min-height: 28px;
  margin: 14px 0 0;
  color: var(--muted);
}

.status.ok {
  color: var(--ok);
}

.status.warn {
  color: var(--warn);
}

.results {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.result-item span {
  color: var(--muted);
  font-size: 14px;
}

.preview {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.ad-box {
  display: grid;
  place-items: center;
  min-height: 250px;
  color: #94a0b4;
  background: repeating-linear-gradient(45deg, #fff, #fff 12px, #f7f9fb 12px, #f7f9fb 24px);
}

.faq {
  margin-top: 18px;
  padding: 18px;
}

.faq h2 {
  margin-top: 0;
}

.faq h3 {
  margin-bottom: 4px;
  font-size: 17px;
}

.faq p {
  margin-top: 0;
  color: var(--muted);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 22px;
  padding: 28px 18px 40px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.login-panel {
  width: min(460px, 100%);
  margin: 8vh auto 0;
}

.login-panel form {
  display: grid;
  gap: 16px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
}

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

.dashboard .panel h2 {
  margin-top: 0;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.row:last-child {
  border-bottom: 0;
}

.row span {
  overflow-wrap: anywhere;
}

.trend {
  display: flex;
  align-items: end;
  gap: 5px;
  min-height: 140px;
  padding-top: 14px;
}

.bar {
  flex: 1;
  min-width: 5px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--brand), var(--ok));
}

.seo-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.related-list {
  display: grid;
  gap: 10px;
  padding: 0;
  list-style: none;
}

.related-list a {
  color: var(--brand-dark);
}

@media (max-width: 980px) {
  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-layout,
  .two-col,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .tool-grid,
  .controls,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 360px;
  }
}
