/* ============================================================
   智宿云 ZHISU CLOUD · 基础样式 Base
   依赖：tokens.css
   ============================================================ */

/* ---------- 重置 ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  color: var(--text-1);
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
[hidden] { display: none !important; }

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }

::selection { background: var(--gold-500); color: var(--white); }

/* 细滚动条（桌面端） */
@media (min-width: 64rem) {
  ::-webkit-scrollbar { width: 10px; }
  ::-webkit-scrollbar-track { background: var(--paper-2); }
  ::-webkit-scrollbar-thumb { background: #C9C2B2; border-radius: 5px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--gold-500); }
}

/* ---------- 排版基元 ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: var(--fw-bold);
  line-height: var(--lh-title);
  color: var(--text-1);
  letter-spacing: 0.01em;
}

.h-display { font-size: var(--fs-display); line-height: 1.18; }
.h1 { font-size: var(--fs-h1); }
.h2 { font-size: var(--fs-h2); }
.h3 { font-size: var(--fs-h3); }
.h4 { font-size: var(--fs-h4); }

.lead {
  font-size: var(--fs-lead);
  font-weight: var(--fw-light);
  line-height: 2;
  color: var(--text-2);
}

.text-small { font-size: var(--fs-small); }
.text-tiny  { font-size: var(--fs-tiny); }

/* 金色衬线强调 */
.accent {
  color: var(--gold-500);
  font-style: normal;
}

/* 深色底上的文字 */
.on-dark { color: var(--text-inverse-1); }
.on-dark h1, .on-dark h2, .on-dark h3, .on-dark h4 { color: var(--text-inverse-1); }
.on-dark .lead { color: var(--text-inverse-2); }

/* ---------- 布局基元 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-y); }
.section--paper2 { background: var(--paper-2); }
.section--dark {
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(197, 165, 114, 0.10), transparent 60%),
    linear-gradient(180deg, var(--ink-900) 0%, var(--ink-950) 100%);
  color: var(--text-inverse-1);
}
.section--tight { padding-block: calc(var(--section-y) * 0.66); }

/* 网格工具 */
.grid { display: grid; gap: var(--space-4); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 64rem) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 40rem) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* 两端对齐弹性行 */
.row-between {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ---------- 可见性工具 ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ---------- 滚动显现动效（轻量、克制） ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(1.75rem);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}
[data-reveal="left"]  { transform: translateX(-1.75rem); }
[data-reveal="right"] { transform: translateX(1.75rem); }
[data-reveal="zoom"]  { transform: scale(0.96); }
[data-reveal].is-inview { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
