/* Aligned with Automation Skill Builder UI: flat surfaces, hairline borders, stroke icons (#2c3e50, ~1.65) */
:root {
  --ps-bg: #f5f5f5;
  --ps-surface: #ffffff;
  --ps-text: #333333;
  --ps-text-muted: #5c5c5c;
  --ps-stroke: #2c3e50;
  --ps-border: #dddddd;
  --ps-border-light: #e8e8e8;
  --ps-accent: #4caf50;
  --ps-accent-soft: rgba(76, 175, 80, 0.12);
  --ps-hover: rgba(200, 232, 200, 0.35);
  --ps-radius: 14px;
  --ps-radius-sm: 8px;
  --ps-font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", sans-serif;
  --ps-max-width: 1080px;
  --ps-top-bar-h: 56px;
  --ps-icon-stroke: 1.65;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--ps-font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ps-text);
  background: var(--ps-bg);
  -webkit-font-smoothing: antialiased;
}

html[lang="zh-Hans"] body,
html[lang="zh"] body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", var(--ps-font);
}

html[lang="ja"] body {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", var(--ps-font);
}

html[lang="th"] body {
  font-family: "Sarabun", "Noto Sans Thai", "Leelawadee UI", var(--ps-font);
}

.md-top-app-bar__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.md-lang-select {
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 6px 28px 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--ps-border);
  background: var(--ps-surface);
  color: var(--ps-text-muted);
  cursor: pointer;
  max-width: min(148px, 38vw);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235c5c5c' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.md-lang-select:hover {
  border-color: var(--ps-stroke);
  color: var(--ps-stroke);
}

a {
  color: var(--ps-stroke);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
a:hover {
  border-bottom-color: rgba(44, 62, 80, 0.35);
  text-decoration: none;
}

/* —— Top bar (flat) —— */
.md-top-app-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--ps-top-bar-h);
  padding: 8px 20px;
  background: var(--ps-surface);
  color: var(--ps-stroke);
  border-bottom: 1px solid var(--ps-border);
}

.md-top-app-bar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  font-size: 0.95rem;
  color: inherit;
  text-decoration: none;
  border-bottom: none;
}
.md-top-app-bar__brand:hover {
  opacity: 0.85;
  border-bottom: none;
}

.md-top-app-bar__logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--ps-border);
  background: var(--ps-bg);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.md-top-app-bar__logo svg {
  display: block;
  color: var(--ps-stroke);
}

.md-nav-desktop {
  display: none;
  align-items: center;
  gap: 2px;
}

@media (min-width: 900px) {
  .md-nav-desktop {
    display: flex;
  }
}

.md-nav-desktop a {
  color: var(--ps-text-muted);
  padding: 8px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: none;
  border-radius: 999px;
  letter-spacing: 0.02em;
  transition: background 0.15s ease, color 0.15s ease;
}
.md-nav-desktop a:hover {
  background: var(--ps-hover);
  color: var(--ps-stroke);
  border-bottom: none;
}

.md-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ps-stroke);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease;
}
.md-icon-btn:hover {
  background: var(--ps-hover);
}
@media (min-width: 900px) {
  .md-icon-btn--menu {
    display: none;
  }
}

/* Mobile drawer — flat */
.md-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 199;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.md-drawer-backdrop.is-open {
  display: block;
  opacity: 1;
}

.md-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: min(280px, 86vw);
  height: 100%;
  background: var(--ps-surface);
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  border-right: 1px solid var(--ps-border);
  padding: 12px 0;
}
.md-drawer.is-open {
  transform: translateX(0);
}

.md-drawer a {
  display: block;
  padding: 12px 22px;
  color: var(--ps-text);
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  border-bottom: none;
}
.md-drawer a:hover {
  background: var(--ps-hover);
  border-bottom: none;
}

/* —— Layout —— */
.md-container {
  width: 100%;
  max-width: var(--ps-max-width);
  margin: 0 auto;
  padding: 0 22px;
}

.md-section {
  padding: 52px 0;
}
.md-section--tint {
  background: var(--ps-surface);
  border-top: 1px solid var(--ps-border-light);
  border-bottom: 1px solid var(--ps-border-light);
}
.md-section--primary-tint {
  background: var(--ps-bg);
}

.md-section__title {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ps-stroke);
}

.md-section__lead {
  margin: 0 0 28px;
  max-width: 680px;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ps-text-muted);
  font-weight: 400;
}

/* —— Hero —— */
.md-hero {
  padding: 44px 0 56px;
  text-align: center;
}

.md-hero__eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ps-text-muted);
  margin-bottom: 14px;
}

.md-hero h1 {
  margin: 0 0 18px;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 400;
  line-height: 1.25;
  color: var(--ps-stroke);
  letter-spacing: 0.01em;
}

.md-hero h1 em {
  font-style: normal;
  font-weight: 500;
  color: var(--ps-text);
}

.md-hero__sub {
  margin: 0 auto 28px;
  max-width: 600px;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ps-text-muted);
  font-weight: 400;
}

.md-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

/* —— Buttons —— */
.md-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 18px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  border-bottom: none;
}
.md-btn:hover {
  border-bottom: none;
}

.md-btn--filled {
  background: var(--ps-stroke);
  color: #fff;
  border-color: var(--ps-stroke);
}
.md-btn--filled:hover {
  background: #34495e;
  border-color: #34495e;
  color: #fff;
}

.md-btn--outlined {
  background: var(--ps-surface);
  color: var(--ps-stroke);
  border: 1px solid var(--ps-border);
}
.md-btn--outlined:hover {
  background: var(--ps-bg);
  border-color: #c5c5c5;
  color: var(--ps-stroke);
}

/* —— Cards —— */
.md-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 700px) {
  .md-grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .md-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.md-card {
  background: var(--ps-surface);
  border-radius: var(--ps-radius);
  padding: 22px;
  border: 1px solid var(--ps-border);
}

.md-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ps-stroke);
}

.md-card p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ps-text-muted);
}

/* Stroke icon frame — matches circular toolbar targets */
.md-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--ps-border);
  background: var(--ps-bg);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.md-card__icon svg {
  display: block;
  color: var(--ps-stroke);
}

/* —— Lists —— */
.md-list-numbered {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--ps-text-muted);
  line-height: 1.65;
}
.md-list-numbered li {
  margin: 12px 0;
}
.md-list-numbered strong {
  color: var(--ps-text);
}

.md-callout {
  border-radius: var(--ps-radius-sm);
  padding: 18px 20px;
  background: rgba(216, 240, 216, 0.45);
  border: 1px solid rgba(180, 210, 180, 0.55);
  border-left-width: 3px;
  border-left-color: var(--ps-accent);
  color: var(--ps-text);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.md-callout--muted {
  background: var(--ps-bg);
  border: 1px solid var(--ps-border);
  border-left-width: 3px;
  border-left-color: var(--ps-text-muted);
  color: var(--ps-text-muted);
}

/* Support cards — hairline top accent */
.md-support-card {
  height: 100%;
}

.md-support-card--community {
  border-top: 2px solid var(--ps-border);
}

.md-support-card--pro {
  border-top: 2px solid var(--ps-stroke);
}

/* —— FAQ —— */
.md-faq details {
  background: var(--ps-surface);
  border-radius: var(--ps-radius-sm);
  margin-bottom: 6px;
  border: 1px solid var(--ps-border);
  overflow: hidden;
}

.md-faq summary {
  padding: 14px 18px;
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--ps-stroke);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background 0.12s ease;
}
.md-faq summary:hover {
  background: var(--ps-bg);
}
.md-faq summary::-webkit-details-marker {
  display: none;
}
.md-faq summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--ps-text-muted);
  border-bottom: 1.5px solid var(--ps-text-muted);
  transform: rotate(45deg);
  flex-shrink: 0;
  margin-top: -3px;
  transition: transform 0.2s ease;
}
.md-faq details[open] summary::after {
  transform: rotate(-135deg);
  margin-top: 2px;
}

.md-faq .md-faq__body {
  padding: 0 18px 16px;
  color: var(--ps-text-muted);
  font-size: 0.9375rem;
  line-height: 1.65;
}

/* —— Footer —— */
.md-footer {
  padding: 36px 0 28px;
  background: var(--ps-surface);
  border-top: 1px solid var(--ps-border);
  color: var(--ps-text-muted);
  font-size: 0.8125rem;
}
.md-footer a {
  color: var(--ps-stroke);
  border-bottom: 1px solid rgba(44, 62, 80, 0.2);
}
.md-footer a:hover {
  border-bottom-color: var(--ps-stroke);
}
.md-footer__grid {
  display: grid;
  gap: 22px;
}
@media (min-width: 700px) {
  .md-footer__grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}
.md-footer h4 {
  margin: 0 0 10px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ps-text-muted);
}
.md-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.md-footer li {
  margin: 6px 0;
}

/* —— Steps —— */
.md-steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
}
.md-steps li {
  position: relative;
  padding-left: 44px;
  margin: 18px 0;
  min-height: 32px;
  color: var(--ps-text-muted);
  line-height: 1.6;
}
.md-steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--ps-stroke);
  background: var(--ps-surface);
  color: var(--ps-stroke);
  font-size: 0.8rem;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.md-steps strong {
  color: var(--ps-text);
}

code {
  font-family: ui-monospace, "Cascadia Code", "Consolas", Menlo, monospace;
  font-size: 0.86em;
  background: #eceff1;
  color: var(--ps-text);
  padding: 0.12em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--ps-border-light);
}
