:root {
  color: #22252a;
  background: #f5f7fb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  background:
    radial-gradient(circle at 50% -10%, rgb(34 105 246 / 10%), transparent 30rem),
    #f5f7fb;
}

button,
input,
textarea,
select {
  font: inherit;
}

.page-shell {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 18px max(40px, env(safe-area-inset-bottom));
}

.article-card {
  position: relative;
  min-height: min(78vh, 760px);
  overflow: hidden;
  border: 1px solid rgb(28 56 108 / 8%);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 16px 50px rgb(33 62 113 / 9%);
}

.article-header {
  padding: 42px 52px 24px;
  border-bottom: 1px solid #edf0f5;
}

.article-type {
  min-height: 20px;
  margin: 0 0 10px;
  color: #2269f6;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.article-header h1 {
  margin: 0;
  color: #1e2024;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  line-height: 1.3;
}

.article-meta {
  min-height: 20px;
  margin: 14px 0 0;
  color: #8a9099;
  font-size: 14px;
  line-height: 1.5;
}

.article-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(70%, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding: 28px 52px 0;
  scroll-snap-type: x mandatory;
}

.article-carousel[hidden] {
  display: none;
}

.article-carousel img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  border-radius: 16px;
  background: #f0f2f6;
  scroll-snap-align: start;
}

.article-content {
  min-height: 360px;
  padding: 34px 52px 56px;
  color: #33363b;
  font-size: 17px;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.article-content > :first-child {
  margin-top: 0;
}

.article-content > :last-child {
  margin-bottom: 0;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
  margin: 1.8em 0 0.7em;
  color: #22252a;
  line-height: 1.45;
}

.article-content h1 {
  font-size: 1.65em;
}

.article-content h2 {
  font-size: 1.4em;
}

.article-content h3 {
  font-size: 1.2em;
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote,
.article-content pre,
.article-content table {
  margin: 0 0 1.15em;
}

.help-list {
  display: grid;
  gap: 14px;
}

.help-card {
  position: relative;
  display: block;
  padding: 22px 54px 22px 22px;
  border: 1px solid #e8ebf1;
  border-radius: 16px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.help-card:hover,
.help-card:focus-visible {
  border-color: rgb(34 105 246 / 32%);
  box-shadow: 0 10px 28px rgb(37 68 124 / 9%);
  transform: translateY(-1px);
  outline: none;
}

.help-card-category {
  margin: 0 0 7px;
  color: #2269f6;
  font-size: 13px;
  font-weight: 600;
}

.help-card h2 {
  margin: 0;
  color: #24272c;
  font-size: 18px;
  line-height: 1.5;
}

.help-card-summary {
  display: -webkit-box;
  overflow: hidden;
  margin: 8px 0 0;
  color: #777e88;
  font-size: 14px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.help-card-arrow {
  position: absolute;
  top: 50%;
  right: 22px;
  color: #a6abb3;
  font-size: 30px;
  line-height: 1;
  transform: translateY(-50%);
}

.article-content img,
.article-content video {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 24px auto;
  border-radius: 12px;
}

.article-content a {
  color: #2269f6;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.article-content blockquote {
  padding: 12px 18px;
  border-left: 4px solid #80a9ff;
  border-radius: 0 8px 8px 0;
  background: #f5f8ff;
  color: #5d6470;
}

.article-content pre,
.article-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.article-content code {
  padding: 0.12em 0.35em;
  border-radius: 5px;
  background: #f1f3f7;
  font-size: 0.9em;
}

.article-content pre {
  overflow-x: auto;
  padding: 18px;
  border-radius: 12px;
  background: #20242c;
  color: #f7f8fa;
}

.article-content pre code {
  padding: 0;
  background: transparent;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
}

.article-content th,
.article-content td {
  padding: 10px 12px;
  border: 1px solid #dfe3ea;
  text-align: left;
  vertical-align: top;
}

.restricted-overlay {
  position: absolute;
  inset: 112px 0 0;
  z-index: 10;
  display: grid;
  place-items: start center;
  padding: 150px 24px 48px;
  background: rgb(255 255 255 / 82%);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.restricted-overlay[hidden] {
  display: none;
}

.restricted-panel {
  width: min(100%, 440px);
  padding: 34px 28px;
  border: 1px solid rgb(34 105 246 / 14%);
  border-radius: 22px;
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 18px 56px rgb(37 68 124 / 14%);
  text-align: center;
}

.restricted-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 20px;
  place-items: center;
  border-radius: 19px;
  background: linear-gradient(145deg, #4e8cff, #0c5df6);
  color: #fff;
  font-size: 27px;
  font-weight: 700;
  box-shadow: 0 10px 22px rgb(34 105 246 / 27%);
}

.restricted-panel h2 {
  margin: 0 0 12px;
  color: #202328;
  font-size: 22px;
}

.restricted-panel p {
  margin: 0;
  color: #707680;
  font-size: 15px;
  line-height: 1.7;
}

.loading-state,
.error-state {
  display: grid;
  min-height: 300px;
  place-items: center;
  align-content: center;
  gap: 16px;
  color: #8a9099;
  text-align: center;
}

.loading-indicator {
  width: 34px;
  height: 34px;
  border: 3px solid #e3e9f5;
  border-top-color: #2269f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.error-state h2,
.error-state p {
  margin: 0;
}

.error-state h2 {
  color: #2d3035;
  font-size: 21px;
}

.error-message {
  max-width: 480px;
  line-height: 1.65;
}

.retry-button {
  min-width: 124px;
  padding: 11px 22px;
  border: 0;
  border-radius: 999px;
  background: #2269f6;
  color: #fff;
  cursor: pointer;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 0;
  }

  .article-card {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .article-header {
    padding: max(30px, env(safe-area-inset-top)) 22px 22px;
  }

  .article-carousel {
    grid-auto-columns: 88%;
    padding: 22px 22px 0;
  }

  .article-content {
    padding: 28px 22px max(42px, env(safe-area-inset-bottom));
    font-size: 16px;
  }

  .restricted-overlay {
    inset: 104px 0 0;
    padding-top: 118px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-indicator {
    animation: none;
  }
}
