/* ==========================================================================
   LIXING · base.css
   设计变量 / 重置 / 通用布局工具类。前台 site.css 与后台 admin.css 复用。
   ========================================================================== */

:root {
  /* 品牌 */
  --brand: #1b6fc4;
  --brand-dark: #145a9f;
  --brand-light: #e8f1fb;
  --brand-2: #7cbe3f;
  --brand-2-dark: #5f9a2b;
  --brand-2-light: #eef8e6;
  --gradient-brand: linear-gradient(120deg, #1b6fc4 0%, #3f95d8 45%, #7cbe3f 100%);
  --gradient-brand-soft: linear-gradient(120deg, #e8f1fb 0%, #eef8e6 100%);
  --gradient-ink: linear-gradient(160deg, #071c33 0%, #0b2a4a 60%, #0e3a5f 100%);

  /* 中性 */
  --ink: #071c33;
  --ink-2: #0b2a4a;
  --ink-3: #12385c;
  --text: #0d1f35;
  --muted: #5a6c82;
  --muted-2: #8494a8;
  --paper: #f5f8fc;
  --paper-2: #eef3f9;
  --surface: #ffffff;
  --line: #dfe7f1;
  --line-dark: rgba(255, 255, 255, 0.1);
  --danger: #d64545;
  --danger-light: #fdeeee;
  --warning: #c47f1b;
  --warning-light: #fdf3e3;
  --success: #2e8b57;
  --success-light: #e9f6ef;

  /* 尺寸 */
  --container: 1240px;
  --container-wide: 1400px;
  --header-h: 76px;
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(7, 28, 51, 0.06);
  --shadow-sm: 0 2px 10px rgba(7, 28, 51, 0.06);
  --shadow: 0 18px 50px rgba(7, 28, 51, 0.12);
  --shadow-lg: 0 32px 80px rgba(7, 28, 51, 0.18);

  /* 字体 */
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --speed: 0.35s;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

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

button {
  cursor: pointer;
  border: 0;
  background: none;
}

input,
textarea,
select {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

table {
  border-collapse: collapse;
  width: 100%;
}

[hidden] {
  display: none !important;
}

/* ---------- 可访问性 ---------- */
:focus-visible {
  outline: 3px solid rgba(27, 111, 196, 0.55);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 9999;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

::selection {
  background: rgba(27, 111, 196, 0.22);
}

/* ---------- 布局 ---------- */
.container {
  width: min(100% - 48px, var(--container));
  margin-inline: auto;
}

.container-wide {
  width: min(100% - 48px, var(--container-wide));
  margin-inline: auto;
}

.section {
  padding-block: clamp(64px, 8vw, 112px);
}

.section--tight {
  padding-block: clamp(44px, 6vw, 76px);
}

.section--paper {
  background: var(--paper);
}

.section--ink {
  background: var(--gradient-ink);
  color: #eaf2fb;
}

.section--ink h2,
.section--ink h3 {
  color: #fff;
}

.stack > * + * {
  margin-top: 18px;
}

.grid {
  display: grid;
  gap: 24px;
}

.flex {
  display: flex;
  gap: 16px;
}

.text-center {
  text-align: center;
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand);
}

.eyebrow::before {
  content: '';
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient-brand);
}

.section-title {
  font-size: clamp(1.75rem, 3.6vw, 2.9rem);
}

.section-lead {
  margin-top: 14px;
  max-width: 64ch;
  color: var(--muted);
  font-size: 1.02rem;
}

.section--ink .section-lead {
  color: #a9bdd4;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 24px;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 10px 26px rgba(27, 111, 196, 0.28);
}

.btn--primary:hover {
  box-shadow: 0 16px 34px rgba(27, 111, 196, 0.36);
}

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

.btn--ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn--light {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
  backdrop-filter: blur(6px);
}

.btn--light:hover {
  background: rgba(255, 255, 255, 0.22);
}

.btn--sm {
  min-height: 38px;
  padding: 0 18px;
  font-size: 0.86rem;
}

.btn--block {
  width: 100%;
}

/* ---------- 表单 ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field > label,
.field-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
}

.field .hint {
  font-size: 0.78rem;
  color: var(--muted-2);
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(27, 111, 196, 0.12);
}

.textarea {
  min-height: 120px;
  resize: vertical;
}

/* ---------- 提示 ---------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.alert--success {
  background: var(--success-light);
  border-color: #bfe4cf;
  color: #1f6a41;
}

.alert--error {
  background: var(--danger-light);
  border-color: #f6c9c9;
  color: #a93232;
}

.alert--info {
  background: var(--brand-light);
  border-color: #c9dff5;
  color: var(--brand-dark);
}

/* ---------- 可见性动画（site.js 控制） ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 打印 ---------- */
@media print {
  .no-print {
    display: none !important;
  }

  body {
    background: #fff;
  }
}
