:root {
  --bg: #f0f4f8;
  --surface: #ffffff;
  --border: #e2e8f0;
  --primary: #1e40af;
  --primary-hover: #1a3794;
  --primary-muted: #eff6ff;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --green: #166534;
  --green-bg: #f0fdf4;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: var(--bg);
  font: 16px/1.65 Inter, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-hover);
}

img {
  max-width: 100%;
  height: auto;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}

.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 20;
  padding: 8px 12px;
  background: #fff;
  border-radius: 8px;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.topbar-inner,
.wrap,
.footer-inner {
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.brand em {
  display: block;
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  color: var(--text-muted);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 14px;
}

.nav a {
  color: var(--text-secondary);
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--primary);
}

.lang-switch {
  display: flex;
  gap: 10px;
  font-size: 13px;
  white-space: nowrap;
}

.lang-switch a {
  color: var(--text-muted);
  text-decoration: none;
}

.lang-switch a[aria-current="true"],
.lang-switch a:hover {
  color: var(--primary);
}

main {
  flex: 1;
  padding: 40px 0 72px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 36px);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0 0 24px;
  max-width: 42em;
  color: var(--text-secondary);
  font-size: 17px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
}

.btn-primary {
  color: #fff;
  background: var(--primary);
}

.btn-primary:hover {
  color: #fff;
  background: var(--primary-hover);
}

.btn-ghost {
  color: var(--primary);
  background: #fff;
  border: 1px solid var(--border);
}

article h2 {
  margin: 36px 0 12px;
  font-size: 22px;
}

article h3 {
  margin: 24px 0 8px;
  font-size: 18px;
}

article p,
article li {
  color: var(--text-secondary);
}

article ul,
article ol {
  padding-left: 1.2em;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.card {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card h2,
.card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.card p {
  margin: 0;
  font-size: 14px;
}

.table-wrap {
  overflow-x: auto;
  margin: 16px 0 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--primary-muted);
  color: var(--text);
}

.note {
  padding: 12px 14px;
  background: var(--green-bg);
  border-radius: 10px;
  color: var(--green);
  font-size: 14px;
}

.dir {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.dir li {
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.dir a {
  display: block;
  padding: 12px 0;
  text-decoration: none;
  color: inherit;
}

.dir a strong {
  display: block;
  color: var(--primary);
}

.dir a span {
  color: var(--text-muted);
  font-size: 14px;
}

.crumbs {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.crumbs a {
  color: var(--text-muted);
}

footer {
  padding: 24px 0 32px;
  border-top: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-inner p {
  margin: 0 0 8px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--text-secondary);
}

.lang-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.lang-grid a {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
}

.lang-grid a[aria-current="true"],
.lang-grid a:hover {
  background: var(--primary-muted);
  color: var(--primary);
}

html[dir="rtl"] article ul,
html[dir="rtl"] article ol {
  padding-left: 0;
  padding-right: 1.2em;
}

html[dir="rtl"] .lang-grid,
html[dir="rtl"] .cards,
html[dir="rtl"] .actions,
html[dir="rtl"] .footer-links {
  direction: rtl;
}

@media (max-width: 640px) {
  .topbar-inner {
    align-items: flex-start;
    padding: 12px 0;
    flex-direction: column;
  }

  main {
    padding-top: 24px;
  }
}
