/* ==========================================================================
   PandaCloud · 基础层（令牌 / 重置 / 排版 / 按钮 / 表单）
   ========================================================================== */

:root {
  color-scheme: light;

  /* 品牌与中性色（十六进制为兜底，支持 oklch 的浏览器用下方覆盖） */
  --ink: #0a1020;
  --ink-2: #2b3550;
  --ink-3: #5f6a82;
  --ink-4: #8b94a8;
  --bg: #f6f8fc;
  --surface: #ffffff;
  --line: #e4e9f3;
  --line-2: #d2dbea;
  --brand: #0b7cf6;
  --brand-strong: #0a63cf;
  --brand-press: #0853ad;
  --brand-soft: #ebf3ff;
  --brand-ink: #072252;
  --ok: #0f7a4d;
  --ok-soft: #e9f7f0;
  --danger: #b3261e;
  --danger-soft: #fdeceb;
  --warn: #8a5a00;
  --warn-soft: #fdf5e4;
  --footer: #080d18;
  --footer-ink: #b9c2d6;
  --footer-dim: #8a93a8;
  --promo-a: #0a3f8f;
  --promo-b: #0b64d8;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-1: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-2: 0 18px 40px -24px rgba(10, 22, 46, .35);
  --shadow-lift: 0 24px 60px -32px rgba(10, 34, 74, .45);

  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-soft: cubic-bezier(.33, 1, .68, 1);
  --dur: .45s;

  --head-h: 68px;
  --wrap: 1160px;
  --gutter: clamp(20px, 5vw, 40px);

  --font: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Hiragino Sans GB",
          "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", system-ui,
          -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --z-sticky: 40;
  --z-dropdown: 50;
  --z-backdrop: 60;
  --z-modal: 70;
  --z-toast: 80;
}

@supports (color: oklch(0 0 0)) {
  :root {
    --ink: oklch(0.176 0.0346 267.3);
    --ink-2: oklch(0.333 0.0499 268.1);
    --ink-3: oklch(0.524 0.0403 265.7);
    --ink-4: oklch(0.666 0.0314 266.2);
    --bg: oklch(0.979 0.0057 264.5);
    --line: oklch(0.933 0.0145 264.5);
    --line-2: oklch(0.889 0.0228 260.7);
    --brand: oklch(0.601 0.2035 256.4);
    --brand-strong: oklch(0.519 0.1836 257.7);
    --brand-press: oklch(0.457 0.1587 257.4);
    --brand-soft: oklch(0.962 0.0183 258.4);
    --brand-ink: oklch(0.266 0.0939 260.8);
    --ok: oklch(0.512 0.1148 158.3);
    --danger: oklch(0.501 0.1783 28.7);
    --footer: oklch(0.160 0.0249 264.6);
    --footer-ink: oklch(0.813 0.0298 266.3);
  }
}

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

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

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

img {
  height: auto;
}

h1, h2, h3, h4, p, figure, dl, dd, ul, ol {
  margin: 0;
}

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

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

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

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

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

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

/* ---------------------------------------------------------------- 排版 */
h1, h2, h3 {
  text-wrap: balance;
  letter-spacing: -.02em;
  line-height: 1.18;
}

p {
  text-wrap: pretty;
}

.lede,
.prose {
  color: var(--ink-3);
  line-height: 1.8;
}

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

.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;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 50%;
  translate: -50% -200%;
  z-index: var(--z-toast);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  transition: translate .2s var(--ease);
}

.skip-link:focus-visible {
  translate: -50% 0;
}

/* ---------------------------------------------------------------- 图标 */
.ico {
  width: 20px;
  height: 20px;
  flex: none;
}

.ico-xs {
  width: 14px;
  height: 14px;
}

.ico-btn {
  width: 18px;
  height: 18px;
}

/* ---------------------------------------------------------------- 按钮 */
.btn {
  --btn-h: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--btn-h);
  padding: 0 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  transition: background-color .22s var(--ease), border-color .22s var(--ease),
              color .22s var(--ease), transform .22s var(--ease), box-shadow .22s var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand-strong);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}

.btn-primary:hover {
  background: var(--brand-press);
}

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

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

.btn-quiet {
  background: transparent;
  color: var(--ink-2);
  padding-inline: 14px;
}

.btn-quiet:hover {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

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

.btn-white:hover {
  background: #eaf2ff;
}

.btn-disabled {
  background: var(--line);
  color: var(--ink-3);
  cursor: not-allowed;
}

.btn-sm {
  --btn-h: 38px;
  font-size: 14px;
  padding-inline: 16px;
}

.btn-xs {
  --btn-h: 32px;
  font-size: 13px;
  padding-inline: 12px;
  border-radius: 8px;
}

.btn-lg {
  --btn-h: 52px;
  font-size: 16px;
  border-radius: 12px;
}

.btn-block {
  width: 100%;
}

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

.btn-danger-ghost:hover {
  background: var(--danger-soft);
  border-color: #f3c9c6;
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* ---------------------------------------------------------------- 标签片 */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: border-color .2s var(--ease), background-color .2s var(--ease),
              color .2s var(--ease), transform .2s var(--ease);
}

.chip i {
  font-style: normal;
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.chip:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.chip.is-active {
  background: var(--brand-strong);
  border-color: var(--brand-strong);
  color: #fff;
}

.chip.is-active i {
  color: rgba(255, 255, 255, .78);
}

.chip-tag {
  height: 34px;
  padding-inline: 13px;
  font-size: 13.5px;
}

.chip-tag.is-active {
  background: var(--brand-soft);
  border-color: #b9d5fb;
  color: var(--brand-strong);
}

/* ---------------------------------------------------------------- 表单 */
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
}

.field > label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.field .req,
.field .opt,
.field .unit {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 2px 7px;
  border-radius: 999px;
}

.field .req {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.field .opt {
  background: #f0f3fa;
  color: var(--ink-3);
}

.field .unit {
  background: #f0f3fa;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}

.field textarea {
  min-height: 104px;
  resize: vertical;
  line-height: 1.65;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #8a93a8;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #bfc9dd;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand-strong);
  box-shadow: 0 0 0 4px rgba(11, 124, 246, .14);
}

.field .help {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-3);
}

.field.has-error input,
.field.has-error textarea,
.field.has-error select {
  border-color: var(--danger);
  background: #fffafa;
}

.field.has-error .help {
  color: var(--danger);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0 18px;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------------------------------------------------------------- 提示条 */
.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 18px;
}

.alert-error {
  border-color: #f1c7c3;
  background: var(--danger-soft);
  color: #8a1f18;
}

.alert-ok {
  border-color: #bfe4d2;
  background: var(--ok-soft);
  color: #0a5c3b;
}

.alert a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------------------------------------------------------- 动效基础 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
