* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  color: #222;
  background: #fff;
  line-height: 1.8;
}

a { color: #1769aa; text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: min(920px, 92%); margin: 0 auto; }

header { border-bottom: 1px solid #eee; background: #fff; }

.header-inner {
  width: min(1100px, 92%);
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo,
.site-name {
  font-size: 21px;
  font-weight: 700;
  color: #111;
  text-decoration: none;
  flex: 0 0 auto;
}

/* ===== 顶部导航 ===== */

nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

nav details {
  position: relative;
  margin: 0;
}

nav summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 10px;
  color: #555;
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
  border-radius: 6px;
  user-select: none;
}

nav summary::-webkit-details-marker {
  display: none;
}

nav summary::after {
  content: "⌄";
  display: inline-block;
  margin-left: 5px;
  font-size: 12px;
  transform: translateY(-1px);
  transition: transform .15s ease;
}

nav details[open] summary::after {
  transform: translateY(-1px) rotate(180deg);
}

nav details[open] summary,
nav summary:hover {
  color: #111;
  background: #f6f6f6;
}

/*
 * 二级菜单只由 <details open> 控制。
 * 不使用 :hover 打开，避免鼠标移走后菜单又被 CSS 打开。
 */
nav details > div {
  display: none;
  position: absolute;
  z-index: 1000;
  top: 100%;
  right: 0;
  width: 250px;
  padding: 8px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, .10);
}

nav details[open] > div {
  display: block;
}

nav details > div a {
  display: block;
  margin: 0;
  padding: 9px 11px;
  color: #444;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 6px;
}

nav details > div a:hover {
  color: #111;
  background: #f6f6f6;
  text-decoration: none;
}

/* ===== 页面 ===== */

.page-layout {
  width: min(1200px, 92%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 36px;
  align-items: start;
}

.page-main { min-width: 0; }

.page-sidebar {
  min-width: 0;
  position: sticky;
  top: 24px;
}

article { padding: 56px 0 80px; }

.breadcrumb { margin-bottom: 28px; color: #777; font-size: 14px; }

h1 {
  margin: 0 0 24px;
  font-size: 42px;
  line-height: 1.3;
  letter-spacing: -.5px;
}

.lead {
  margin: 0 0 42px;
  padding: 24px 26px;
  border-left: 4px solid #222;
  background: #f7f7f7;
  color: #444;
  font-size: 18px;
}

h2 { margin: 58px 0 20px; font-size: 29px; line-height: 1.35; }
h3 { margin: 34px 0 12px; font-size: 21px; line-height: 1.45; }
p { margin: 0 0 18px; }

ul, ol { margin: 12px 0 24px; padding-left: 28px; }
li { margin-bottom: 9px; }

.highlight {
  padding: 22px 24px;
  margin: 28px 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fafafa;
}

.highlight strong { color: #111; }

.mistake {
  padding: 22px 24px;
  margin: 24px 0;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
}

.mistake h3 { margin-top: 0; }

.table-wrap { overflow-x: auto; margin: 24px 0 30px; }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 650px;
  font-size: 15px;
}

th, td {
  border: 1px solid #ddd;
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
}

th { background: #f6f6f6; }

.steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 42px;
  margin-bottom: 22px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #222;
  color: #fff;
  text-align: center;
  line-height: 28px;
  font-size: 14px;
}

/* ===== Sidebar ===== */

.sidebar-card {
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 22px;
  margin-bottom: 20px;
  background: #fff;
}

.sidebar-card h2 {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.4;
}

.sidebar-card p { color: #666; font-size: 14px; line-height: 1.7; }

.sidebar-benefits { padding-left: 20px; margin: 14px 0 18px; }

.sidebar-benefits li { margin-bottom: 6px; font-size: 14px; }

.contact-card-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.sidebar-note {
  margin: 12px 0 0;
  text-align: center;
  font-size: 13px !important;
  color: #999 !important;
}

.related-card a {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

.related-card a:last-child { border-bottom: none; }

.related {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid #eee;
}

.related a { display: block; margin-bottom: 10px; }

footer {
  padding: 32px 0;
  border-top: 1px solid #eee;
  color: #777;
  font-size: 13px;
}

@media (max-width: 900px) {
  .header-inner { height: 58px; }
  nav { display: none; }
  .page-layout { grid-template-columns: 1fr; }
  .page-sidebar { position: static; }
  article { padding-top: 38px; }
  h1 { font-size: 32px; }
  h2 { font-size: 25px; }
  .lead { font-size: 16px; }
}
