﻿/* ==========================================================================
   Base — reset + 通用排版 + 通用组件（按钮 / 输入 / 卡片 / 揭示动效）
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

img {
  max-width: 100%;
  display: block;
}

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

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

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

h1,
h2,
h3,
h4,
p,
figure,
blockquote {
  margin: 0;
}

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

::selection {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- 品牌字标（首页 / 编辑器共用） --- */
.brand {
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex: none;
  text-decoration: none;
}

.brand__cn {
  font-family: var(--font-serif);
  font-size: 1.22rem;
  letter-spacing: 0.2em;
  color: var(--ink);
}

.brand__en {
  font-size: 8.5px;
  letter-spacing: 0.26em;
  color: var(--ink-mute);
}

/* --- 布局 --- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(64px, 10vw, var(--sp-9));
}

.hairline {
  height: 1px;
  border: 0;
  background: var(--line);
  margin: 0;
}

/* --- 排版元件 --- */
.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.eyebrow.no-rule::before {
  display: none;
}

.display {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: var(--fs-display);
  line-height: 1.18;
  letter-spacing: 0.01em;
}

.h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: var(--fs-h2);
  line-height: 1.4;
  letter-spacing: 0.015em;
}

.lede {
  color: var(--ink-soft);
  font-size: clamp(14.5px, 1.5vw, 16.5px);
  line-height: 1.95;
  max-width: 46ch;
}

.muted {
  color: var(--ink-mute);
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* --- 按钮 --- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: #fbf8f3;
  --btn-bd: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  min-height: 48px;
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  font-size: 14.5px;
  letter-spacing: 0.06em;
  font-weight: 500;
  text-align: center;
  transition: transform 0.35s var(--ease), background 0.35s var(--ease),
    color 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
  will-change: transform;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-1);
}

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

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-bd: var(--line);
}

.btn--ghost:hover {
  --btn-bd: rgba(22, 19, 15, 0.4);
  background: rgba(255, 253, 249, 0.7);
}

.btn--light {
  --btn-bg: #f7f3ec;
  --btn-fg: var(--ink);
  --btn-bd: #f7f3ec;
}

.btn--accent {
  --btn-bg: var(--accent);
  --btn-bd: var(--accent);
  --btn-fg: #fff9f6;
}

.btn--sm {
  min-height: 38px;
  padding: 8px 16px;
  font-size: 13px;
  letter-spacing: 0.04em;
}

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

.btn .arrow {
  display: inline-block;
  transition: transform 0.35s var(--ease);
}

.btn:hover .arrow {
  transform: translateX(3px);
}

.link-underline {
  position: relative;
  padding-bottom: 2px;
}

.link-underline::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  opacity: 0.35;
  transform-origin: left;
  transition: opacity 0.3s var(--ease);
}

.link-underline:hover::after {
  opacity: 1;
}

/* --- 表单 --- */
.field {
  display: block;
}

.field__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.field__label .hint {
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--ink-mute);
}

.input,
.textarea {
  width: 100%;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 14.5px;
  color: var(--ink);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease),
    background 0.25s var(--ease);
}

.input::placeholder,
.textarea::placeholder {
  color: #b3aa9d;
}

.input:hover,
.textarea:hover {
  border-color: rgba(22, 19, 15, 0.24);
}

.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(142, 75, 65, 0.1);
}

.textarea {
  resize: vertical;
  min-height: 132px;
  line-height: 1.85;
}

input[type="date"].input {
  padding-block: 11px;
  min-height: 44px;
  appearance: none;
  -webkit-appearance: none;
}

input[type="date"].input::-webkit-calendar-picker-indicator {
  opacity: 0.45;
  cursor: pointer;
}

/* --- 揭示动效 --- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

[data-reveal-delay="1"] {
  transition-delay: 0.08s;
}
[data-reveal-delay="2"] {
  transition-delay: 0.16s;
}
[data-reveal-delay="3"] {
  transition-delay: 0.24s;
}
[data-reveal-delay="4"] {
  transition-delay: 0.32s;
}

/* --- 纸纹叠加 --- */
.paper-grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.045'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Toast --- */
.toast-layer {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: min(92vw, 480px);
}

.toast {
  background: var(--ink);
  color: #fbf8f3;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  padding: 11px 20px;
  border-radius: var(--r-pill);
  box-shadow: 0 18px 40px -20px rgba(22, 19, 15, 0.7);
  animation: toast-in 0.45s var(--ease) both;
  text-align: center;
}

.toast--warn {
  background: #7a3a30;
}

.toast.is-out {
  animation: toast-out 0.35s var(--ease) both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

/* --- 无障碍 --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@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;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* --- 品牌符号（有迹） --- */
.brand__mark {
  width: 18px;
  height: 18px;
  flex: none;
  align-self: center;
  color: var(--ink);
  opacity: 0.95;
  transform: translateY(2px);
}

.brand__mark--lg {
  width: 18px;
  height: 18px;
}

