/* ============================================================================
   Cloudlinx 前端样式表 — 依据 xincailiao-design-system (skills/xincailiao-design-spec)
   规范要点：
   - 所有颜色 / 字号 / 间距 / 圆角 / 阴影一律走下方 :root 中的设计令牌，正文不出现裸值
   - 官网门户使用 brand 红作为品牌色，后台使用 product 蓝作为点缀色
   - 边框承载结构，阴影只用于浮层与可点击卡片的 hover
   ========================================================================= */

/* ---------------------------------------------------------------- 令牌 ---- */

/* 品牌色：官网 CTA、品牌标识、危险操作复用色阶 */
:root {
  --brand-50: #FFF2F3;
  --brand-100: #FFE4E7;
  --brand-200: #FFCCD2;
  --brand-300: #FF9AA6;
  --brand-400: #FF6677;
  --brand-500: #FF3D52;
  --brand-600: #FF112D;
  --brand-700: #D90E26;
  --brand-800: #B30C1F;
  --brand-900: #8C0918;
}

/* 产品蓝：后台产品能力色（链接、选中态、图表），只做点缀不铺底 */
:root {
  --product-blue-50: #EDF5FF;
  --product-blue-100: #D9EBFF;
  --product-blue-200: #B8D8FF;
  --product-blue-300: #8BBEFF;
  --product-blue-400: #5A9FFF;
  --product-blue-500: #006DEA;
  --product-blue-600: #0058C2;
  --product-blue-700: #00449A;
}

/* 中性色与文本语义 */
:root {
  --white: #FFFFFF;
  --neutral-50: #F7F8FA;
  --neutral-100: #F1F3F5;
  --neutral-200: #E6E9EE;
  --neutral-300: #D5DAE1;
  --neutral-400: #B8C0CC;
  --neutral-500: #97A0AD;
  --neutral-600: #6F7785;
  --neutral-700: #4B5563;
  --neutral-800: #2B313A;
  --neutral-900: #1A1A1A;

  --text-primary: var(--neutral-900);
  --text-body: var(--neutral-800);
  --text-secondary: var(--neutral-700);
  --text-tertiary: var(--neutral-600);
  --text-disabled: var(--neutral-500);

  /* 行动语义：黑色推进任务，蓝色调用产品能力，红色仅用于品牌与危险操作 */
  --color-action-task-default: var(--neutral-900);
  --color-action-task-hover: var(--neutral-800);
  --color-action-task-active: var(--neutral-700);
  --color-action-product-default: var(--product-blue-500);
  --color-action-product-hover: var(--product-blue-600);
  --color-action-brand-default: var(--brand-600);
  --color-action-brand-hover: var(--brand-700);
}

/* 语义状态色（成功 / 警告 / 危险 / 提示） */
:root {
  --success-text: #009B3A;
  --success-hover: #009A29;
  --success-bg: #E8FFEA;
  --success-border: #AFF0B5;
  --success-dot: #00B42A;

  --warning-text: #D96800;
  --warning-hover: #D25F00;
  --warning-bg: #FFF7E8;
  --warning-border: #FFE4BA;
  --warning-dot: #FF7D00;

  --error-text: #E84040;
  --error-hover: #F53F3F;
  --error-active: #AF2126;
  --error-bg: #FFECE8;
  --error-border: #FDCDC5;
  --error-dot: #F53F3F;

  --info-text: #1677D9;
  --info-bg: #E8F7FF;
  --info-border: #C3E7FE;
  --info-dot: #3491FA;
}

/* 字体：字号 / 行高 / 字重 */
:root {
  --type-display-l-size: 56px;
  --type-display-l-line-height: 64px;
  --type-heading-h1-size: 40px;
  --type-heading-h1-line-height: 48px;
  --type-heading-h2-size: 32px;
  --type-heading-h2-line-height: 40px;
  --type-heading-h3-size: 24px;
  --type-heading-h3-line-height: 32px;
  --type-heading-h4-size: 20px;
  --type-heading-h4-line-height: 28px;
  --type-heading-h5-size: 18px;
  --type-heading-h5-line-height: 26px;
  --type-heading-h6-size: 16px;
  --type-heading-h6-line-height: 24px;
  --type-body-l-size: 16px;
  --type-body-l-line-height: 24px;
  --type-body-m-size: 14px;
  --type-body-m-line-height: 22px;
  --type-body-s-size: 13px;
  --type-body-s-line-height: 20px;
  --type-caption-size: 12px;
  --type-caption-line-height: 18px;
  --type-weight-regular: 400;
  --type-weight-medium: 500;
  --type-weight-semibold: 600;
  --type-weight-bold: 700;
}

/* 间距（4px 基准） */
:root {
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-12: 12px;
  --spacing-md: 16px;
  --spacing-20: 20px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --spacing-3xl: 64px;
  --spacing-4xl: 96px;
}

/* 控件与组件尺寸 */
:root {
  --control-height-sm: 28px;
  --control-height-md: 32px;
  --control-height-lg: 36px;
  --control-height-xl: 48px;
  --touch-target-min: 44px;
  --icon-size-sm: 16px;
  --icon-size-md: 20px;

  --button-padding-x-sm: 12px;
  --button-padding-x-md: 16px;
  --button-padding-x-lg: 20px;

  --field-padding-x-md: 12px;
  --field-border-default: var(--neutral-300);
  --field-border-hover: var(--neutral-900);
  --field-border-focus: var(--neutral-900);
  --field-border-error: var(--error-dot);
  --field-bg-readonly: var(--neutral-50);
  --textarea-min-height: 96px;

  --form-field-gap: 16px;
  --form-section-gap: 32px;
  --form-actions-gap: 12px;

  --table-row-height: 44px;
  --table-cell-padding-x: 16px;

  --drawer-width: 300px;
  --pagination-gap: 4px;
}

/* 交互、圆角、阴影、层级、布局骨架 */
:root {
  --focus-ring-color: var(--neutral-900);
  --focus-ring-width: 2px;
  --focus-ring-offset: 2px;

  --motion-duration-fast: 120ms;
  --motion-duration-normal: 180ms;
  --motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);

  --overlay-bg: rgb(0 0 0 / 36%);
  --overlay-light: rgb(255 255 255 / 18%);

  --radius-none: 0px;
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
  --shadow-md: 0 2px 5px 0 rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 10px 0 rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 8px 20px 0 rgba(0, 0, 0, 0.1);

  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-tooltip: 600;

  --layout-website-content: 1400px;
  --layout-website-nav-height: 64px;
  --layout-website-hero-md: 620px;
  --layout-backend-topbar-height: 64px;
  --layout-backend-sidebar-expanded: 240px;
  --layout-backend-sidebar-collapsed: 56px;
  --content-reading-width: 720px;
}

/* 字体族与官网 Hero 渐变（渐变只作为背景令牌，不在组件内写裸值） */
:root {
  --font-sans: "PingFang SC", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --gradient-hero:
    radial-gradient(circle at 4% 0%, var(--brand-wash), transparent 38%),
    radial-gradient(circle at 94% 12%, var(--product-wash), transparent 42%),
    linear-gradient(180deg, var(--white) 0%, var(--neutral-50) 100%);

  --brand-wash: rgb(255 17 45 / 10%);
  --product-wash: rgb(0 109 234 / 8%);
}

/* ------------------------------------------------------------------ 重置 --- */

*,
*::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);
  color: var(--text-body);
  background: var(--white);
  font-size: var(--type-body-m-size);
  line-height: var(--type-body-m-line-height);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { color: var(--text-primary); line-height: 1.35; font-weight: var(--type-weight-semibold); }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
input, select, textarea { font-family: inherit; }

/* 键盘焦点：全站统一 2px 实线描边 + 2px 偏移 */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: var(--focus-ring-offset);
  border-radius: var(--radius-sm);
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible { outline: none; }

.cl-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--neutral-900);
  color: var(--white);
  padding: var(--spacing-sm) var(--spacing-md);
  z-index: var(--z-toast);
  border-radius: var(--radius-sm);
}
.cl-skip:focus { left: var(--spacing-md); top: var(--spacing-md); }

/* ---------------------------------------------------------------- 布局 ---- */

/* 官网内容区：最大 1400px，窄屏保留 24px 边距 */
.cl-wrap { width: min(var(--layout-website-content), calc(100% - var(--spacing-2xl))); margin: 0 auto; }
.cl-wrap-narrow { width: min(var(--content-reading-width), calc(100% - var(--spacing-2xl))); margin: 0 auto; }

/* ----------------------------------------------------- 官网顶部导航 (64px) --- */
.cl-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--white);
  border-bottom: 1px solid var(--neutral-200);
}
.cl-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-lg);
  height: var(--layout-website-nav-height);
}
.cl-brand { display: flex; align-items: center; gap: var(--spacing-12); font-size: var(--type-heading-h6-size); font-weight: var(--type-weight-semibold); color: var(--text-primary); }
.cl-brand-mark { width: 36px; height: 36px; flex: 0 0 36px; display: block; }
.cl-brand-mark svg { width: 100%; height: 100%; }
.cl-brand-text small {
  display: block;
  font-weight: var(--type-weight-regular);
  font-size: var(--type-caption-size);
  line-height: 1.4;
  color: var(--text-tertiary);
}

.cl-nav-list { display: flex; gap: var(--spacing-lg); list-style: none; font-size: var(--type-body-m-size); }
.cl-nav-list a {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 6px 0;
  color: var(--text-secondary);
  font-weight: var(--type-weight-medium);
  border-bottom: 2px solid transparent;
  transition: color var(--motion-duration-fast) var(--motion-easing-standard),
    border-color var(--motion-duration-fast) var(--motion-easing-standard);
}
.cl-nav-list a:hover { color: var(--text-primary); }
.cl-nav-list a[aria-current="page"] { color: var(--text-primary); font-weight: var(--type-weight-semibold); border-bottom-color: var(--text-primary); }

.cl-header-side { display: flex; align-items: center; gap: var(--spacing-12); }

/* 语言切换：分段控件，选中项黑色实底 */
.cl-lang { display: flex; flex: 0 0 auto; border: 1px solid var(--neutral-300); border-radius: var(--radius-sm); overflow: hidden; }
.cl-lang a {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: var(--type-caption-size);
  line-height: 1;
  font-weight: var(--type-weight-medium);
  color: var(--text-secondary);
  padding: 0 var(--spacing-sm);
  min-width: 40px;
  height: var(--control-height-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--motion-duration-fast) var(--motion-easing-standard), color var(--motion-duration-fast) var(--motion-easing-standard);
}
.cl-lang a:hover { background: var(--neutral-50); color: var(--text-primary); }
.cl-lang a.is-active { background: var(--neutral-900); color: var(--white); }

.cl-menu-toggle {
  display: none;
  width: var(--touch-target-min);
  height: var(--touch-target-min);
  align-items: center;
  justify-content: center;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
}
.cl-menu-toggle:hover { border-color: var(--neutral-900); }
.cl-menu-toggle-box { display: grid; gap: 4px; }
.cl-menu-toggle-box i { display: block; width: 18px; height: 2px; background: var(--neutral-900); border-radius: 1px; }

/* ---------------------------------------------------------------- 按钮 ---- */
/* 高度：sm 28 / md 32 / lg 36；圆角 2px；字号 14（sm 为 13） */

.cl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  height: var(--control-height-md);
  padding: 0 var(--button-padding-x-md);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: var(--type-body-m-size);
  font-weight: var(--type-weight-medium);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  text-align: center;
  transition: background var(--motion-duration-fast) var(--motion-easing-standard),
    border-color var(--motion-duration-fast) var(--motion-easing-standard),
    color var(--motion-duration-fast) var(--motion-easing-standard);
}
.cl-btn-sm { height: var(--control-height-sm); padding: 0 var(--button-padding-x-sm); font-size: var(--type-body-s-size); }
.cl-btn-md { height: var(--control-height-md); }
.cl-btn-lg { height: var(--control-height-lg); padding: 0 var(--button-padding-x-lg); }
.cl-btn-block { display: flex; width: 100%; }

/* 任务推进（默认主按钮）：黑色实底 */
.cl-btn-primary { background: var(--color-action-task-default); color: var(--white); }
.cl-btn-primary:hover { background: var(--color-action-task-hover); }
.cl-btn-primary:active { background: var(--color-action-task-active); }

/* 官网品牌 CTA：品牌红实底 */
.cl-btn-brand { background: var(--color-action-brand-default); color: var(--white); }
.cl-btn-brand:hover { background: var(--color-action-brand-hover); }

/* 产品能力按钮：产品蓝实底 */
.cl-btn-product { background: var(--color-action-product-default); color: var(--white); }
.cl-btn-product:hover { background: var(--color-action-product-hover); }

/* 支付宝支付按钮：使用支付宝品牌蓝，与站内主色区分 */
.cl-btn-pay { background: #1677ff; border-color: #1677ff; color: var(--white); }
.cl-btn-pay:hover { background: #0e5fd8; border-color: #0e5fd8; color: var(--white); }

/* 次要按钮：白底 + 中性描边 */
.cl-btn-outline { background: var(--white); border-color: var(--neutral-300); color: var(--text-body); }
.cl-btn-outline:hover { border-color: var(--neutral-900); color: var(--text-primary); }

/* 三级按钮：纯文字 */
.cl-btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.cl-btn-ghost:hover { background: var(--neutral-100); color: var(--text-primary); }

/* 危险操作：复用品牌红，弱化为描边避免误触视觉过重 */
.cl-btn-danger { background: var(--white); border-color: var(--brand-300); color: var(--brand-700); }
.cl-btn-danger:hover { background: var(--brand-50); border-color: var(--brand-600); color: var(--brand-700); }

.cl-btn[disabled],
.cl-btn[aria-busy="true"] { opacity: 0.48; cursor: not-allowed; }

/* ---------------------------------------------------------------- Hero ---- */
.cl-hero {
  padding: var(--spacing-4xl) 0 0;
  min-height: var(--layout-website-hero-md);
  background: var(--gradient-hero);
  border-bottom: 1px solid var(--neutral-200);
}
.cl-hero-inner { max-width: var(--content-reading-width); }
.cl-eyebrow {
  display: inline-block;
  font-size: var(--type-caption-size);
  font-weight: var(--type-weight-semibold);
  letter-spacing: 1.6px;
  color: var(--brand-700);
  text-transform: uppercase;
  margin-bottom: var(--spacing-md);
}
.cl-hero h1 {
  font-size: clamp(32px, 5vw, var(--type-display-l-size));
  line-height: clamp(40px, 6vw, var(--type-display-l-line-height));
  font-weight: var(--type-weight-bold);
  letter-spacing: -0.4px;
}
.cl-hero .cl-lead { margin-top: var(--spacing-lg); font-size: var(--type-body-l-size); line-height: 1.6; color: var(--text-tertiary); max-width: 640px; }
.cl-hero-actions { display: flex; gap: var(--spacing-12); flex-wrap: wrap; margin-top: var(--spacing-xl); }

/* 数据条：白底卡片压在 Hero 下沿 */
.cl-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: var(--spacing-3xl);
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.cl-stat { padding: var(--spacing-xl) var(--spacing-lg); border-right: 1px solid var(--neutral-200); }
.cl-stat:last-child { border-right: 0; }
.cl-stat b { display: block; font-size: var(--type-heading-h3-size); line-height: 1.3; font-weight: var(--type-weight-semibold); color: var(--text-primary); }
.cl-stat span { font-size: var(--type-body-s-size); color: var(--text-tertiary); }

/* -------------------------------------------------------------- 内容区块 --- */

.cl-section { padding: var(--spacing-4xl) 0; }
.cl-section-soft { background: var(--neutral-50); }
.cl-section-head { max-width: var(--content-reading-width); margin-bottom: var(--spacing-xl); }
.cl-section-head h2 { font-size: var(--type-heading-h2-size); line-height: var(--type-heading-h2-line-height); font-weight: var(--type-weight-semibold); }
.cl-section-head p { margin-top: var(--spacing-12); font-size: var(--type-body-m-size); color: var(--text-secondary); }
.cl-section-head-center { margin-left: auto; margin-right: auto; text-align: center; }
.cl-section-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--spacing-lg); flex-wrap: wrap; max-width: none; }
.cl-section-head-row > div:first-child { max-width: var(--content-reading-width); }

/* ------------------------------------------------------------ 方案卡片 ---- */

.cl-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--spacing-lg); }
.cl-plan {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl) var(--spacing-lg);
  transition: border-color var(--motion-duration-normal) var(--motion-easing-standard),
    box-shadow var(--motion-duration-normal) var(--motion-easing-standard);
}
.cl-plan:hover { border-color: var(--neutral-300); box-shadow: var(--shadow-md); }
.cl-plan-tag {
  align-self: flex-start;
  font-size: var(--type-caption-size);
  font-weight: var(--type-weight-medium);
  color: var(--brand-700);
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-radius: var(--radius-sm);
  padding: 2px var(--spacing-sm);
  margin-bottom: var(--spacing-12);
}
.cl-plan h3 { font-size: var(--type-heading-h5-size); line-height: var(--type-heading-h5-line-height); margin-bottom: var(--spacing-xs); }
.cl-plan-desc { font-size: var(--type-body-m-size); color: var(--text-secondary); margin-bottom: var(--spacing-md); }
.cl-plan-features { list-style: none; display: grid; gap: var(--spacing-sm); margin-bottom: var(--spacing-lg); }
.cl-plan-features li { position: relative; padding-left: var(--spacing-md); font-size: var(--type-body-s-size); color: var(--text-secondary); }
/* 清单项用对勾标记，不依赖颜色表达已完成状态 */
.cl-plan-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 10px;
  height: 6px;
  border-left: 1.5px solid var(--brand-600);
  border-bottom: 1.5px solid var(--brand-600);
  transform: rotate(-45deg);
}
.cl-plan-foot {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--spacing-12);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--neutral-200);
  flex-wrap: nowrap;
}
.cl-price { font-size: var(--type-heading-h4-size); line-height: 1.4; font-weight: var(--type-weight-semibold); color: var(--text-primary); }
.cl-price small { font-size: var(--type-body-s-size); font-weight: var(--type-weight-regular); color: var(--text-tertiary); margin-left: 2px; }
.cl-price-was { display: block; margin-top: 2px; font-size: var(--type-caption-size); color: var(--text-tertiary); font-weight: var(--type-weight-regular); }
.cl-save-chip {
  font-size: var(--type-caption-size);
  font-weight: var(--type-weight-medium);
  font-style: normal;
  color: var(--brand-700);
  background: var(--brand-50);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  margin-left: var(--spacing-sm);
}
.cl-save-chip:empty { display: none; }

/* 计费周期：单选按钮组（原生 radio 承载状态，外观为分段控件） */
.cl-billing-toggle { display: inline-flex; align-items: center; border: 1px solid var(--neutral-300); border-radius: var(--radius-sm); overflow: hidden; }
.cl-billing-option { position: relative; display: inline-flex; }
/* 原生 radio 视觉隐藏但保留可聚焦、可键盘切换 */
.cl-billing-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.cl-billing-option span {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  height: var(--control-height-md);
  padding: 0 var(--spacing-md);
  font-size: var(--type-body-s-size);
  font-weight: var(--type-weight-medium);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--motion-duration-fast) var(--motion-easing-standard), color var(--motion-duration-fast) var(--motion-easing-standard);
}
.cl-billing-option:hover span { background: var(--neutral-50); }
/* 选中态：黑色实底白字 */
.cl-billing-option input:checked + span { background: var(--neutral-900); color: var(--white); }
.cl-billing-option input:checked + span .cl-save-chip { background: var(--overlay-light); color: var(--white); }
/* 键盘焦点画在内层标签上，避免被 overflow 裁切 */
.cl-billing-option input:focus-visible + span {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: calc(-1 * var(--focus-ring-width));
}

.cl-notice {
  margin-top: var(--spacing-xl);
  padding: var(--spacing-12) var(--spacing-md);
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  border-left: 3px solid var(--brand-600);
  border-radius: var(--radius-sm);
  font-size: var(--type-body-s-size);
  color: var(--text-secondary);
}

/* ---------------------------------------------------------------- 网格 ---- */

.cl-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--spacing-lg); }
.cl-feature {
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg) var(--spacing-20);
  background: var(--white);
}
.cl-feature .cl-ic { width: 32px; height: 32px; color: var(--brand-600); margin-bottom: var(--spacing-md); }
.cl-feature h3 { font-size: var(--type-heading-h6-size); line-height: var(--type-heading-h6-line-height); margin-bottom: var(--spacing-xs); }
.cl-feature p { font-size: var(--type-body-s-size); color: var(--text-secondary); }

.cl-process { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--spacing-lg); }
.cl-step { border-top: 2px solid var(--neutral-200); padding-top: var(--spacing-md); }
.cl-step-num { display: block; font-size: var(--type-caption-size); font-weight: var(--type-weight-semibold); letter-spacing: 1.4px; color: var(--brand-700); margin-bottom: var(--spacing-xs); }
.cl-step h3 { font-size: var(--type-body-l-size); margin-bottom: var(--spacing-xs); }
.cl-step p { font-size: var(--type-body-s-size); color: var(--text-secondary); }

.cl-chips { display: flex; flex-wrap: wrap; gap: var(--spacing-12); list-style: none; }
.cl-chips li {
  font-size: var(--type-body-s-size);
  color: var(--text-secondary);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--white);
}

/* ---------------------------------------------------------------- 关于 ---- */

.cl-about { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: var(--spacing-3xl); align-items: start; }
.cl-about h2 { font-size: var(--type-heading-h2-size); line-height: var(--type-heading-h2-line-height); margin-bottom: var(--spacing-md); }
.cl-about p { color: var(--text-secondary); margin-bottom: var(--spacing-12); }

/* 事实表：标签 + 值 */
.cl-facts { border: 1px solid var(--neutral-200); border-radius: var(--radius-md); background: var(--white); }
.cl-fact-row {
  display: flex;
  justify-content: space-between;
  gap: var(--spacing-md);
  padding: var(--spacing-12) var(--spacing-md);
  border-bottom: 1px solid var(--neutral-200);
  font-size: var(--type-body-s-size);
}
.cl-fact-row:last-child { border-bottom: 0; }
.cl-fact-row dt,
.cl-fact-row span:first-child { color: var(--text-tertiary); }
.cl-fact-row dd,
.cl-fact-row span:last-child { font-weight: var(--type-weight-medium); color: var(--text-body); text-align: right; }

/* ---------------------------------------------------------------- FAQ ----- */

.cl-faq { max-width: var(--content-reading-width); margin: 0 auto; border-top: 1px solid var(--neutral-200); }
.cl-faq details { border-bottom: 1px solid var(--neutral-200); }
.cl-faq summary {
  list-style: none;
  cursor: pointer;
  padding: var(--spacing-md) 0;
  min-height: var(--touch-target-min);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  font-size: var(--type-body-l-size);
  font-weight: var(--type-weight-medium);
  color: var(--text-primary);
}
.cl-faq summary::-webkit-details-marker { display: none; }
.cl-faq summary::after {
  content: "";
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  margin-right: var(--spacing-xs);
  border-right: 1.5px solid var(--neutral-600);
  border-bottom: 1.5px solid var(--neutral-600);
  transform: rotate(45deg);
  transition: transform var(--motion-duration-fast) var(--motion-easing-standard);
}
.cl-faq details[open] summary::after { transform: rotate(-135deg); }
.cl-faq p { padding: 0 0 var(--spacing-md); font-size: var(--type-body-m-size); color: var(--text-secondary); max-width: var(--content-reading-width); }

/* ---------------------------------------------------------------- CTA ----- */

.cl-cta {
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  padding: var(--spacing-2xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-xl);
  flex-wrap: wrap;
}
.cl-cta h2 { font-size: var(--type-heading-h3-size); line-height: var(--type-heading-h3-line-height); }
.cl-cta p { margin-top: var(--spacing-sm); font-size: var(--type-body-m-size); color: var(--text-secondary); }
.cl-cta-actions { display: flex; gap: var(--spacing-12); flex-wrap: wrap; }

/* -------------------------------------------------------------- 页脚 ----- */

.cl-footer { border-top: 1px solid var(--neutral-200); background: var(--white); padding: var(--spacing-2xl) 0 var(--spacing-lg); font-size: var(--type-body-m-size); color: var(--text-secondary); }
.cl-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--spacing-xl); padding-bottom: var(--spacing-xl); border-bottom: 1px solid var(--neutral-200); }
.cl-footer-grid h4 { font-size: var(--type-body-s-size); font-weight: var(--type-weight-medium); color: var(--text-primary); margin-bottom: var(--spacing-12); }
.cl-footer-grid ul { list-style: none; display: grid; gap: var(--spacing-sm); font-size: var(--type-body-s-size); }
.cl-footer-grid a:hover { color: var(--text-primary); text-decoration: underline; }
.cl-footer-grid .cl-brand { gap: var(--spacing-sm); font-size: var(--type-heading-h6-size); }
.cl-footer-grid .cl-brand-mark { width: 28px; height: 28px; flex: 0 0 28px; }
.cl-footer-brandline { margin-top: var(--spacing-12); font-size: var(--type-body-s-size); max-width: 300px; }
.cl-footer-bottom { display: flex; justify-content: space-between; gap: var(--spacing-md); flex-wrap: wrap; padding-top: var(--spacing-md); font-size: var(--type-caption-size); color: var(--text-tertiary); }
.cl-footer-compact { padding: var(--spacing-lg) 0; }
.cl-footer-row { display: flex; justify-content: space-between; align-items: center; gap: var(--spacing-md); flex-wrap: wrap; font-size: var(--type-caption-size); color: var(--text-tertiary); }
.cl-footer-links { display: flex; gap: var(--spacing-lg); }
.cl-footer-links a:hover { color: var(--text-primary); }

/* ==================================================================== */
/* 后台 / 账户骨架：顶栏 64px + 侧栏 240px，整页 neutral-50              */
/* ==================================================================== */

body.layout-admin,
body.layout-account {
  display: grid;
  grid-template-columns: var(--layout-backend-sidebar-expanded) 1fr;
  grid-template-rows: var(--layout-backend-topbar-height) 1fr;
  grid-template-areas:
    "topbar topbar"
    "sidebar main";
  background: var(--neutral-50);
  min-height: 100vh;
}

/* 侧栏折叠：只保留 56px 图标列 */
body.is-sidebar-collapsed { grid-template-columns: var(--layout-backend-sidebar-collapsed) 1fr; }
body.is-sidebar-collapsed .cl-sidebar .cl-menu-label,
body.is-sidebar-collapsed .cl-sidebar .cl-sidebar-title,
body.is-sidebar-collapsed .cl-sidebar .cl-sidebar-foot { display: none; }
body.is-sidebar-collapsed .cl-sidebar .cl-nav-list a { justify-content: center; padding: 0 var(--spacing-sm); }
body.is-sidebar-collapsed .cl-sidebar .cl-nav-list a::after { display: none; }

.cl-topbar {
  grid-area: topbar;
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-lg);
  height: var(--layout-backend-topbar-height);
  padding: 0 var(--spacing-lg);
  background: var(--white);
  border-bottom: 1px solid var(--neutral-200);
}
.cl-topbar-left { display: flex; align-items: center; gap: var(--spacing-md); }
.cl-topbar-right { display: flex; align-items: center; gap: var(--spacing-12); }

/* 侧栏折叠按钮（桌面端） */
.cl-side-toggle {
  width: var(--control-height-md);
  height: var(--control-height-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
}
.cl-side-toggle:hover { border-color: var(--neutral-900); }
.cl-side-toggle span { display: grid; gap: 3px; }
.cl-side-toggle span i { display: block; width: 14px; height: 1.5px; background: var(--neutral-700); }

.cl-sidebar {
  grid-area: sidebar;
  position: sticky;
  top: var(--layout-backend-topbar-height);
  align-self: start;
  height: calc(100vh - var(--layout-backend-topbar-height));
  overflow-y: auto;
  background: var(--white);
  border-right: 1px solid var(--neutral-200);
  padding: var(--spacing-12) 0;
  display: flex;
  flex-direction: column;
}
.cl-sidebar-title {
  padding: 0 var(--spacing-md) var(--spacing-sm);
  font-size: var(--type-caption-size);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.cl-sidebar .cl-nav-list { display: block; padding: 0 var(--spacing-sm); }
.cl-sidebar .cl-nav-list li { list-style: none; }
.cl-sidebar .cl-nav-list a {
  display: flex;
  align-items: center;
  gap: var(--spacing-12);
  height: 36px;
  padding: 0 var(--spacing-12);
  margin-bottom: 2px;
  border-radius: var(--radius-md);
  border-bottom: 0;
  font-size: var(--type-body-m-size);
  color: var(--text-secondary);
}
.cl-sidebar .cl-nav-list a:hover { background: var(--neutral-50); color: var(--text-primary); }
/* 当前菜单项：产品蓝浅底 + 蓝字 */
.cl-sidebar .cl-nav-list a[aria-current="page"] { background: var(--product-blue-50); color: var(--product-blue-500); font-weight: var(--type-weight-medium); }
.cl-sidebar .cl-nav-list a[aria-current="page"] .cl-menu-icon { color: var(--product-blue-500); }
.cl-menu-icon { width: var(--icon-size-sm); height: var(--icon-size-sm); flex: 0 0 var(--icon-size-sm); color: var(--neutral-500); }
.cl-menu-icon svg { width: 100%; height: 100%; }
.cl-menu-label { font-size: var(--type-body-m-size); }
.cl-sidebar-foot { margin-top: auto; padding: var(--spacing-12) var(--spacing-md) 0; border-top: 1px solid var(--neutral-200); }
.cl-sidebar-foot a { font-size: var(--type-body-s-size); color: var(--text-tertiary); }
.cl-sidebar-foot a:hover { color: var(--text-primary); }

/* 内容区：24px 内边距，背景 neutral-50，卡片承载内容 */
body.layout-admin .cl-page,
body.layout-account .cl-page { grid-area: main; min-width: 0; padding: var(--spacing-lg); }
body.layout-admin .cl-page .cl-wrap,
body.layout-account .cl-page .cl-wrap { width: 100%; max-width: none; margin: 0; }

/* 面包屑 */
.cl-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: var(--spacing-xs); font-size: var(--type-body-s-size); color: var(--text-tertiary); margin-bottom: var(--spacing-12); }
.cl-breadcrumb a:hover { color: var(--text-primary); }
.cl-breadcrumb span + span::before { content: "/"; margin: 0 var(--spacing-sm); color: var(--neutral-400); }

/* 页面标题区：标题 20px，主操作右对齐 */
.cl-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
}
.cl-page-head h1 { font-size: var(--type-heading-h4-size); line-height: var(--type-heading-h4-line-height); font-weight: var(--type-weight-semibold); }
.cl-page-head p { margin-top: var(--spacing-xs); font-size: var(--type-body-s-size); color: var(--text-tertiary); max-width: 68ch; }

/* --------------------------------------------------------------- 提示条 --- */

.cl-flash {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  padding: var(--spacing-12) var(--spacing-md);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  font-size: var(--type-body-s-size);
  margin-bottom: var(--spacing-lg);
}
.cl-flash-success { background: var(--success-bg); border-color: var(--success-border); color: var(--success-text); }
.cl-flash-error { background: var(--error-bg); border-color: var(--error-border); color: var(--error-text); }
.cl-flash-info { background: var(--info-bg); border-color: var(--info-border); color: var(--info-text); }
.cl-flash-warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-text); }
.cl-flash-text { flex: 1; }
/* 提示条默认用 flex 布局，hidden 属性需要显式覆盖才能生效 */
.cl-flash[hidden] { display: none; }

/* --------------------------------------------------------------- 状态标 --- */

.cl-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px var(--spacing-sm);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: var(--type-caption-size);
  line-height: 18px;
  font-weight: var(--type-weight-medium);
  white-space: nowrap;
}
.cl-pill::before { content: ""; width: 6px; height: 6px; border-radius: var(--radius-full); background: currentColor; flex: 0 0 6px; }
.cl-pill-success { background: var(--success-bg); border-color: var(--success-border); color: var(--success-text); }
.cl-pill-warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-text); }
.cl-pill-info { background: var(--info-bg); border-color: var(--info-border); color: var(--info-text); }
.cl-pill-neutral { background: var(--neutral-100); border-color: var(--neutral-200); color: var(--text-tertiary); }
.cl-pill-danger { background: var(--error-bg); border-color: var(--error-border); color: var(--error-text); }

/* --------------------------------------------------------------- 表格 ---- */

.cl-table-wrap { border: 1px solid var(--neutral-200); border-radius: var(--radius-md); overflow-x: auto; background: var(--white); }
.cl-table { width: 100%; border-collapse: collapse; font-size: var(--type-body-s-size); }
.cl-table thead th {
  height: 40px;
  padding: 0 var(--table-cell-padding-x);
  background: var(--neutral-50);
  border-bottom: 1px solid var(--neutral-200);
  font-size: var(--type-body-s-size);
  font-weight: var(--type-weight-semibold);
  color: var(--text-secondary);
  text-align: left;
  white-space: nowrap;
}
.cl-table tbody td {
  height: var(--table-row-height);
  padding: var(--spacing-12) var(--table-cell-padding-x);
  border-bottom: 1px solid var(--neutral-200);
  color: var(--text-body);
  vertical-align: middle;
}
.cl-table tbody tr:last-child td { border-bottom: 0; }
.cl-table tbody tr:hover { background: var(--neutral-50); }
.cl-table a { color: var(--product-blue-500); }
.cl-table a:hover { text-decoration: underline; }
/* 金额列：右对齐 + 等宽字体，表头承载币种 */
.cl-num { text-align: right; font-family: var(--font-mono); font-size: var(--type-body-s-size); font-variant-numeric: tabular-nums; }
.cl-mono { font-family: var(--font-mono); font-size: var(--type-body-s-size); }
.cl-cell-strong { display: block; font-weight: var(--type-weight-medium); color: var(--text-primary); }
.cl-cell-sub { display: block; margin-top: 2px; font-size: var(--type-caption-size); color: var(--text-tertiary); }

/* ------------------------------------------------------------- 表单 ------ */
/* label → 控件 → 帮助/错误，依次排列 */

.cl-form { display: grid; gap: var(--form-field-gap); }
.cl-fields { display: grid; gap: var(--form-field-gap); }
.cl-field { display: grid; gap: var(--spacing-sm); }
.cl-field label { font-size: var(--type-body-m-size); font-weight: var(--type-weight-regular); color: var(--text-secondary); }
.cl-field .cl-req { color: var(--brand-600); margin-left: 2px; }
.cl-field .cl-opt { color: var(--text-tertiary); margin-left: var(--spacing-xs); font-size: var(--type-caption-size); }

.cl-input,
.cl-select,
.cl-textarea {
  width: 100%;
  height: var(--control-height-md);
  padding: 0 var(--field-padding-x-md);
  border: 1px solid var(--field-border-default);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: var(--type-body-m-size);
  color: var(--text-primary);
  transition: border-color var(--motion-duration-fast) var(--motion-easing-standard);
}
.cl-textarea { height: auto; min-height: var(--textarea-min-height); padding: var(--spacing-sm) var(--field-padding-x-md); line-height: 1.6; resize: vertical; }
.cl-select { appearance: none; padding-right: var(--spacing-xl); cursor: pointer; }
.cl-input::placeholder,
.cl-textarea::placeholder { color: var(--neutral-400); }
.cl-input:hover,
.cl-select:hover,
.cl-textarea:hover { border-color: var(--field-border-hover); }
/* 输入类控件用描边变化表达焦点，不叠加外描边 */
.cl-input:focus,
.cl-select:focus,
.cl-textarea:focus { border-color: var(--field-border-focus); }
.cl-input[readonly] { background: var(--field-bg-readonly); color: var(--text-secondary); cursor: default; }

.cl-field.has-error .cl-input,
.cl-field.has-error .cl-select,
.cl-field.has-error .cl-textarea { border-color: var(--field-border-error); }
.cl-help { font-size: var(--type-caption-size); line-height: 1.6; color: var(--text-tertiary); }
.cl-error-text { font-size: var(--type-caption-size); line-height: 1.6; color: var(--error-text); }
.cl-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--spacing-md); }

/* 表单底部操作：右对齐 */
.cl-form-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--form-actions-gap); flex-wrap: wrap; }

/* --------------------------------------------------------------- 登录 ----- */

.layout-auth { background: var(--neutral-50); }
.cl-auth {
  /* --auth-col 统一品牌区与卡片宽度，保证两者左右边缘对齐 */
  --auth-col: min(420px, 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-2xl) var(--spacing-md) var(--spacing-3xl);
}
/* 品牌区作为卡片上方的列头：与卡片同宽、左对齐，不再单独居中悬浮 */
.cl-auth-brand {
  width: var(--auth-col);
  margin-bottom: var(--spacing-lg);
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.cl-auth-brand .cl-brand { font-size: var(--type-heading-h4-size); }
.cl-auth-brand .cl-brand-mark { width: 32px; height: 32px; flex: 0 0 32px; }
/* 登录页只保留品牌简称，法律全称留给页脚，避免品牌行撑长 */
.cl-auth-brand .cl-brand-text small { display: none; }
.cl-auth-panel {
  width: var(--auth-col);
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl) var(--spacing-lg);
}
.cl-auth-head { margin-bottom: var(--spacing-lg); }
.cl-auth-head-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--spacing-md); }
.cl-auth-panel h1 { font-size: var(--type-heading-h3-size); line-height: var(--type-heading-h3-line-height); margin-bottom: var(--spacing-sm); }
.cl-auth-panel .cl-auth-lead { font-size: var(--type-body-s-size); color: var(--text-tertiary); }
.cl-auth-foot { margin-top: var(--spacing-lg); padding-top: var(--spacing-md); border-top: 1px solid var(--neutral-200); font-size: var(--type-body-s-size); color: var(--text-tertiary); display: flex; gap: var(--spacing-xs); flex-wrap: wrap; }
.cl-auth-foot a { color: var(--product-blue-500); }
.cl-auth-foot a:hover { text-decoration: underline; }
.cl-auth-links { display: flex; justify-content: space-between; gap: var(--spacing-12); margin-top: var(--spacing-md); font-size: var(--type-body-s-size); }
.cl-auth-links a { color: var(--text-secondary); }
.cl-auth-links a:hover { color: var(--text-primary); }
.cl-auth-back { width: var(--auth-col); margin-top: var(--spacing-md); font-size: var(--type-body-s-size); color: var(--text-tertiary); }
.cl-auth-back a:hover { color: var(--text-primary); }

/* --------------------------------------------------------------- 卡片 ----- */

.cl-panel {
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
}
.cl-panel + .cl-panel { margin-top: var(--spacing-lg); }
.cl-panel h2 { font-size: var(--type-heading-h6-size); line-height: var(--type-heading-h6-line-height); font-weight: var(--type-weight-semibold); margin-bottom: var(--spacing-md); }

/* 工单对话：客户留言白底，支持团队留言浅灰底以便区分 */
.cl-thread { display: grid; gap: var(--spacing-md); }
.cl-thread-item { border: 1px solid var(--neutral-200); border-radius: var(--radius-md); padding: var(--spacing-md); background: var(--white); }
.cl-thread-item.is-staff { background: var(--neutral-50); border-color: var(--neutral-300); }
.cl-thread-meta { display: flex; justify-content: space-between; gap: var(--spacing-sm); font-size: var(--type-caption-size); color: var(--text-tertiary); margin-bottom: var(--spacing-xs); }
.cl-thread-body { white-space: pre-wrap; font-size: var(--type-body-s-size); line-height: 1.7; color: var(--text-primary); overflow-wrap: anywhere; }

/* 结算页：左摘要 + 右表单 */
.cl-checkout { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: var(--spacing-lg); align-items: start; }
.cl-checkout .cl-panel { padding: var(--spacing-lg); }

/* 金额摘要行 */
.cl-summary-row { display: flex; justify-content: space-between; gap: var(--spacing-md); padding: var(--spacing-sm) 0; font-size: var(--type-body-s-size); }
.cl-summary-row span:first-child { color: var(--text-tertiary); }
.cl-summary-row span:last-child { font-weight: var(--type-weight-medium); color: var(--text-body); text-align: right; }
.cl-summary-total {
  display: flex;
  justify-content: space-between;
  gap: var(--spacing-md);
  margin-top: var(--spacing-sm);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--neutral-300);
  font-size: var(--type-heading-h5-size);
  font-weight: var(--type-weight-semibold);
  color: var(--text-primary);
}
.cl-checkout-note { display: flex; gap: var(--spacing-sm); margin-top: var(--spacing-md); font-size: var(--type-caption-size); color: var(--text-tertiary); }
.cl-checkout-note svg { width: var(--icon-size-sm); height: var(--icon-size-sm); flex: 0 0 var(--icon-size-sm); margin-top: 2px; color: var(--neutral-500); }

/* -------------------------------------------------------------- 时间线 ---- */

.cl-timeline { list-style: none; }
.cl-timeline li { position: relative; padding: 0 0 var(--spacing-lg) var(--spacing-lg); border-left: 1px solid var(--neutral-200); }
.cl-timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.cl-timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--neutral-300);
  border: 1px solid var(--white);
}
.cl-timeline li.is-done::before { background: var(--product-blue-500); }
.cl-timeline li.is-current::before { background: var(--neutral-900); }
.cl-timeline-label { display: block; font-size: var(--type-body-s-size); font-weight: var(--type-weight-medium); color: var(--text-primary); }
.cl-timeline-meta { display: block; font-size: var(--type-caption-size); color: var(--text-tertiary); }
.cl-timeline-note { margin-top: 2px; font-size: var(--type-caption-size); color: var(--text-secondary); }

/* --------------------------------------------------------------- 空态 ---- */

.cl-empty { background: var(--white); border: 1px solid var(--neutral-200); border-radius: var(--radius-md); padding: var(--spacing-3xl) var(--spacing-lg); text-align: center; }
.cl-empty-ic { width: 32px; height: 32px; color: var(--neutral-400); margin: 0 auto var(--spacing-md); }
.cl-empty h2 { font-size: var(--type-heading-h6-size); font-weight: var(--type-weight-semibold); margin-bottom: var(--spacing-xs); }
.cl-empty p { max-width: 44ch; margin: 0 auto var(--spacing-lg); font-size: var(--type-body-s-size); color: var(--text-tertiary); }
.cl-empty .cl-btn { margin: 0 auto; }

/* ------------------------------------------------------------- 筛选栏 ---- */

.cl-filter {
  display: flex;
  align-items: flex-end;
  gap: var(--spacing-12);
  flex-wrap: wrap;
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
}
.cl-filter .cl-field { gap: var(--spacing-xs); min-width: 0; }
.cl-filter .cl-field label { font-size: var(--type-caption-size); color: var(--text-tertiary); }
.cl-filter .cl-input,
.cl-filter .cl-select { height: var(--control-height-md); font-size: var(--type-body-s-size); }
.cl-filter-grow { flex: 1 1 220px; }
.cl-filter-actions { display: flex; gap: var(--spacing-sm); }
.cl-result-line { display: flex; gap: var(--spacing-12); flex-wrap: wrap; margin-bottom: var(--spacing-12); font-size: var(--type-body-s-size); color: var(--text-tertiary); }

/* --------------------------------------------------------------- 分页 ---- */

.cl-pagination { display: flex; align-items: center; justify-content: flex-end; gap: var(--pagination-gap); margin-top: var(--spacing-md); font-size: var(--type-body-s-size); }
.cl-page-status { order: -1; margin-right: var(--spacing-sm); color: var(--text-tertiary); }
.cl-page-link {
  display: inline-flex;
  align-items: center;
  height: var(--control-height-sm);
  padding: 0 var(--spacing-12);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: var(--white);
}
.cl-page-link:hover { border-color: var(--neutral-900); color: var(--text-primary); }
.cl-page-link.is-disabled { color: var(--neutral-400); pointer-events: none; background: var(--neutral-50); }

/* ---------------------------------------------------------------- KPI ----- */

.cl-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--spacing-md); margin-bottom: var(--spacing-lg); }
.cl-kpi { background: var(--white); border: 1px solid var(--neutral-200); border-radius: var(--radius-md); padding: var(--spacing-md) var(--spacing-lg) var(--spacing-lg); }
.cl-kpi-label { font-size: var(--type-body-s-size); color: var(--text-tertiary); margin-bottom: var(--spacing-sm); }
.cl-kpi-value { font-size: var(--type-heading-h2-size); line-height: 1.25; font-weight: var(--type-weight-semibold); color: var(--text-primary); font-variant-numeric: tabular-nums; }
.cl-kpi-note { margin-top: var(--spacing-xs); font-size: var(--type-caption-size); color: var(--text-tertiary); }

/* 后台双栏：主内容 + 侧栏卡片 */
.cl-admin-grid { display: grid; grid-template-columns: 1.35fr 0.65fr; gap: var(--spacing-lg); align-items: start; }
.cl-bar-row { padding: var(--spacing-sm) 0; }
.cl-bar-head { display: flex; justify-content: space-between; gap: var(--spacing-12); font-size: var(--type-body-s-size); }
.cl-bar-head span:last-child { color: var(--text-tertiary); font-family: var(--font-mono); font-size: var(--type-caption-size); }
.cl-bar-track { height: 6px; margin-top: var(--spacing-xs); background: var(--neutral-100); border-radius: var(--radius-sm); overflow: hidden; }
.cl-bar-fill { height: 100%; background: var(--product-blue-500); border-radius: var(--radius-sm); }

/* -------------------------------------------------------------- 抽屉 ----- */

.cl-drawer-backdrop { position: fixed; inset: 0; background: var(--overlay-bg); z-index: var(--z-overlay); }
.cl-drawer {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  width: min(var(--drawer-width), 84vw);
  display: flex;
  flex-direction: column;
  background: var(--white);
  z-index: var(--z-modal);
  box-shadow: var(--shadow-xl);
  transform: translateX(-100%);
  transition: transform var(--motion-duration-normal) var(--motion-easing-standard);
}
.cl-drawer.is-open { transform: translateX(0); }
.cl-drawer[hidden],
.cl-drawer-backdrop[hidden] { display: none; }
.cl-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--spacing-12); padding: var(--spacing-md); border-bottom: 1px solid var(--neutral-200); }
.cl-drawer-head .cl-brand { font-size: var(--type-body-l-size); }
.cl-drawer-head .cl-brand-mark { width: 28px; height: 28px; flex: 0 0 28px; }
.cl-drawer-close {
  width: var(--touch-target-min);
  height: var(--touch-target-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: var(--type-heading-h4-size);
  line-height: 1;
  cursor: pointer;
}
.cl-drawer-close:hover { border-color: var(--neutral-900); }
.cl-drawer-nav { flex: 1; overflow-y: auto; padding: var(--spacing-sm) 0; }
.cl-drawer-nav .cl-nav-list { display: block; }
.cl-drawer-nav .cl-nav-list li { border-bottom: 1px solid var(--neutral-200); }
.cl-drawer-nav .cl-nav-list a { display: flex; align-items: center; gap: var(--spacing-12); min-height: 48px; padding: 0 var(--spacing-lg); font-size: var(--type-body-l-size); border-bottom: 0; }
.cl-drawer-nav .cl-nav-list a[aria-current="page"] { color: var(--product-blue-500); }
.cl-drawer-foot { display: grid; gap: var(--spacing-sm); padding: var(--spacing-md); border-top: 1px solid var(--neutral-200); }
.cl-drawer-foot form { display: grid; }

/* --------------------------------------------------------------- 用户 ----- */

.cl-user { position: relative; }
/* hover 连续性：在触发器与下拉菜单之间铺一条透明热区，
   鼠标穿过 6px 空隙时仍停留在 .cl-user 上，菜单不会收起 */
.cl-user::after {
  content: "";
  position: absolute;
  top: 100%;
  inset-inline: 0;
  height: 6px;
}
.cl-user-trigger { display: flex; align-items: center; gap: var(--spacing-sm); min-height: var(--control-height-md); font-size: var(--type-body-s-size); font-weight: var(--type-weight-medium); color: var(--text-secondary); }
.cl-user-trigger:hover { color: var(--text-primary); }
.cl-user-avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--neutral-900);
  color: var(--white);
  font-size: var(--type-caption-size);
  font-weight: var(--type-weight-medium);
}
.cl-user-menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  min-width: 180px;
  padding: var(--spacing-xs) 0;
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: var(--z-dropdown);
}
.cl-user:hover .cl-user-menu,
.cl-user:focus-within .cl-user-menu { display: block; }
.cl-user-menu a,
.cl-user-logout {
  display: block;
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--type-body-s-size);
  color: var(--text-secondary);
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}
.cl-user-menu a:hover,
.cl-user-logout:hover { background: var(--neutral-50); color: var(--text-primary); }
.cl-user-menu form { display: block; margin-top: var(--spacing-xs); padding-top: var(--spacing-xs); border-top: 1px solid var(--neutral-200); }

/* -------------------------------------------------------------- 分栏 ----- */

.cl-split { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: var(--spacing-lg); align-items: start; }
.cl-meta-list { display: grid; gap: var(--spacing-sm); font-size: var(--type-body-s-size); }
.cl-meta-list dt { font-size: var(--type-caption-size); color: var(--text-tertiary); }
.cl-meta-list dd { font-weight: var(--type-weight-medium); }

/* ------------------------------------------------------------ 行内操作 ---- */

.cl-actions { display: flex; align-items: center; gap: var(--spacing-12); flex-wrap: wrap; }
.cl-inline-form { display: inline; }
.cl-btn-row { display: flex; gap: var(--spacing-sm); flex-wrap: wrap; }
.cl-note { margin-top: var(--spacing-sm); font-size: var(--type-caption-size); color: var(--text-tertiary); }
.cl-hint-list { list-style: none; display: grid; gap: var(--spacing-sm); font-size: var(--type-body-s-size); color: var(--text-secondary); }
.cl-hint-list li { position: relative; padding-left: var(--spacing-md); }
.cl-hint-list li::before { content: ""; position: absolute; left: 0; top: 8px; width: 4px; height: 4px; border-radius: var(--radius-full); background: var(--neutral-500); }

/* -------------------------------------------------------------- 错误页 ---- */

.cl-error-page { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--spacing-4xl) var(--spacing-md); text-align: center; }
.cl-error-code { font-family: var(--font-mono); font-size: var(--type-heading-h3-size); font-weight: var(--type-weight-semibold); color: var(--brand-600); letter-spacing: 1px; }
.cl-error-page h1 { margin: var(--spacing-12) 0 var(--spacing-sm); font-size: var(--type-heading-h3-size); line-height: var(--type-heading-h3-line-height); }
.cl-error-page p { max-width: 52ch; margin-bottom: var(--spacing-lg); color: var(--text-tertiary); }

/* -------------------------------------------------------------- 工具类 ---- */

.cl-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;
}
.cl-mt-4 { margin-top: var(--spacing-md); }
.cl-mt-5 { margin-top: var(--spacing-20); }

/* ------------------------------------------------------------- 响应式 ---- */

/* 1440 以下：内容区收窄到 1200，KPI 保持 4 列 */
@media (max-width: 1440px) {
  .cl-wrap { width: min(1200px, calc(100% - var(--spacing-2xl))); }
}

/* 1024 以下：内容区 960，卡片两列，后台侧栏收起改用抽屉导航 */
@media (max-width: 1024px) {
  .cl-wrap { width: min(960px, calc(100% - var(--spacing-2xl))); }
  .cl-plans,
  .cl-grid-4,
  .cl-process { grid-template-columns: 1fr 1fr; }
  .cl-stats { grid-template-columns: 1fr 1fr; }
  .cl-stat:nth-child(2) { border-right: 0; }
  .cl-stat:nth-child(1),
  .cl-stat:nth-child(2) { border-bottom: 1px solid var(--neutral-200); }
  .cl-about { grid-template-columns: 1fr; gap: var(--spacing-xl); }
  .cl-footer-grid { grid-template-columns: 1fr 1fr; }
  .cl-split { grid-template-columns: 1fr; }

  body.layout-admin,
  body.layout-account,
  body.is-sidebar-collapsed { grid-template-columns: 1fr; grid-template-areas: "topbar" "main"; }
  .cl-sidebar { display: none; }
  .cl-side-toggle { display: none; }
  .cl-menu-toggle { display: inline-flex; }
  .cl-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .cl-admin-grid { grid-template-columns: 1fr; }
  .cl-checkout { grid-template-columns: 1fr; }
}

/* 768 以下：导航折叠为抽屉，全部内容单列，表格降级为卡片 */
@media (max-width: 768px) {
  .cl-header .cl-nav-list { display: none; }
  .cl-header .cl-menu-toggle { display: inline-flex; }
  /* 窄屏下登录/注册按钮收进抽屉，避免导航栏横向溢出 */
  .cl-header-side > .cl-btn { display: none; }
  .cl-brand-text small { display: none; }
  .cl-user-name { display: none; }

  .cl-wrap,
  .cl-wrap-narrow { width: calc(100% - var(--spacing-xl)); }

  .cl-plans,
  .cl-grid-4,
  .cl-process,
  .cl-stats,
  .cl-footer-grid,
  .cl-kpi-grid { grid-template-columns: 1fr; }
  .cl-stat { border-right: 0; border-bottom: 1px solid var(--neutral-200); }
  .cl-stat:last-child { border-bottom: 0; }

  .cl-section { padding: var(--spacing-2xl) 0; }
  .cl-hero { padding: var(--spacing-2xl) 0 0; min-height: 0; }
  .cl-cta { padding: var(--spacing-lg); }
  .cl-page-head { flex-direction: column; }
  .cl-plan-foot { flex-wrap: wrap; }
  .cl-filter { flex-direction: column; align-items: stretch; }
  .cl-filter-actions { justify-content: flex-end; }
  .cl-auth-panel { padding: var(--spacing-lg) var(--spacing-md); }
  .cl-fact-row { flex-direction: column; gap: 2px; }
  .cl-fact-row dd,
  .cl-fact-row span:last-child { text-align: left; }
  .cl-field-row { grid-template-columns: 1fr; }

  /* 移动端输入保持 16px，避免 iOS 聚焦缩放 */
  .cl-input,
  .cl-select,
  .cl-textarea { font-size: var(--type-body-l-size); }

  .cl-table thead { display: none; }
  .cl-table,
  .cl-table tbody,
  .cl-table tr,
  .cl-table td { display: block; width: 100%; }
  .cl-table tbody tr { padding: var(--spacing-md); border-bottom: 1px solid var(--neutral-200); }
  .cl-table tbody tr:last-child { border-bottom: 0; }
  .cl-table tbody td {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-md);
    height: auto;
    padding: 3px 0;
    border-bottom: 0;
    text-align: left;
  }
  .cl-table tbody td::before { content: attr(data-label); flex: 0 0 40%; font-size: var(--type-caption-size); color: var(--text-tertiary); }
  .cl-table tbody td.cl-cell-full { display: block; padding-top: var(--spacing-sm); }
  .cl-table tbody td.cl-cell-full::before { display: none; }
  .cl-num { text-align: right; }
  .cl-pagination { justify-content: center; }
  .cl-page-status { order: 0; margin-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
