/* 房客源管家 Design System v1 · 2026-09-17
 * Import explicitly. Variables alone do not replace existing component styles.
 * CSS pixels in the spec assume the user's default root size (normally 16px).
 */
@font-face {
  font-family: "CRM Song";
  src: url("assets/fonts/noto-serif-sc-ui-500-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* Semantic colors: do not alias grade to price/status even when equal. */
  --crm-canvas: #ede5d7;
  --crm-surface: #fbf7ee;
  --crm-surface-subtle: #e9dfcf;
  --crm-sidebar: #e5dac7;
  --crm-field: #fffaf1;
  --crm-avatar-bg: #e6dac6;
  --crm-text: #342f29;
  --crm-text-muted: #6f665a;
  --crm-on-dark: #ffffff;
  --crm-brand: #874538;
  --crm-brand-hover: #74392e;
  --crm-brand-pressed: #612f26;
  --crm-brand-soft: #eeddd2;
  --crm-grade-a: #9e522c;
  --crm-grade-a-soft: #f8e9da;
  --crm-grade-b: #3f6482;
  --crm-grade-b-soft: #e8eef4;
  --crm-grade-c: #52694f;
  --crm-grade-c-soft: #edf0e4;
  --crm-customer-fill-a: #e5b386;
  --crm-customer-fill-b: #a6bfd3;
  --crm-customer-fill-c: #b6c59f;
  --crm-grade-none: #6f665a;
  --crm-grade-none-soft: #e9dfcf;
  --crm-price: #aa4d32;
  --crm-danger: #a93a37;
  --crm-danger-soft: #fae7e0;
  --crm-success: #4f694e;
  --crm-success-soft: #edf0e4;
  --crm-warning: #80602f;
  --crm-warning-soft: #f8edcf;
  --crm-info: #435f7c;
  --crm-info-soft: #e8eef4;
  --crm-border: #d4c6b2;
  --crm-border-control: #97846e;
  --crm-disabled-bg: #e6ded0;
  --crm-disabled-fg: #756d60;
  --crm-overlay: rgb(47 39 30 / 40%);
  --crm-ink-blue: #566c7d;
  --crm-gold: #8b7141;

  /* Typography: role-specific values, no external font request required. */
  --crm-font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --crm-font-display: "CRM Song", "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", "PingFang SC", serif;
  --crm-weight-regular: 400;
  --crm-weight-medium: 500;
  --crm-weight-semibold: 600;
  --crm-weight-bold: 700;
  --crm-text-caption: 0.75rem;
  --crm-leading-caption: 1rem;
  --crm-text-data: 0.875rem;
  --crm-leading-data: 1.25rem;
  --crm-text-body: 1rem;
  --crm-leading-body: 1.5rem;
  --crm-text-record: 1rem;
  --crm-leading-record: 1.5rem;
  --crm-text-control: 1rem;
  --crm-leading-control: 1.5rem;
  --crm-text-section: 1.125rem;
  --crm-leading-section: 1.625rem;
  --crm-text-grade: 1.125rem;
  --crm-leading-grade: 1.5rem;
  --crm-text-price-list: 1.125rem;
  --crm-leading-price-list: 1.5rem;
  --crm-text-title: 1.5rem;
  --crm-leading-title: 2rem;
  --crm-text-price: 1.75rem;
  --crm-leading-price: 2.25rem;

  /* 4px rhythm. */
  --crm-space-0: 0;
  --crm-space-1: 0.25rem;
  --crm-space-2: 0.5rem;
  --crm-space-3: 0.75rem;
  --crm-space-4: 1rem;
  --crm-space-6: 1.5rem;
  --crm-space-8: 2rem;
  --crm-page-padding: var(--crm-space-3);
  --crm-card-padding: var(--crm-space-3);
  --crm-grid-gap: var(--crm-space-3);
  --crm-section-gap: var(--crm-space-4);
  --crm-sidebar-width: 13rem;
  --crm-content-max: 90rem;
  --crm-customer-card-min: 19.375rem;
  --crm-property-card-min: 14rem;

  /* Geometry. */
  --crm-radius-xs: 0.25rem;
  --crm-radius-sm: 0.375rem;
  --crm-radius-md: 0.5rem;
  --crm-radius-lg: 0.75rem;
  --crm-radius-pill: 999px;
  --crm-border-width: 1px;
  --crm-focus-width: 2px;
  --crm-focus-offset: 2px;
  --crm-control-height: 2.75rem;
  --crm-search-height: 2.75rem;
  --crm-touch-target: 2.75rem;
  --crm-grade-width: 2.75rem;
  --crm-filter-all-width: 3.5rem;
  --crm-task-min-height: 4rem;
  --crm-avatar-list: 4rem;
  --crm-avatar-detail: 4.5rem;
  --crm-icon-control: 1.125rem;
  --crm-icon-navigation: 1.375rem;
  --crm-badge-size: 1.25rem;
  --crm-attachment-size: 4.5rem;
  --crm-nav-height: 3.5rem;
  --crm-property-image-ratio: 5 / 3;

  /* Elevation: cards stay flat. */
  --crm-shadow-none: none;
  --crm-shadow-popover: 0 4px 16px rgb(63 43 28 / 12%);
  --crm-shadow-dialog: 0 12px 40px rgb(63 43 28 / 18%);
  --crm-grade-sheen: linear-gradient(180deg, rgb(255 255 255 / 2%), rgb(0 0 0 / 4%));
  --crm-grade-highlight: inset 0 1px 0 rgb(255 255 255 / 12%);
  --crm-focus-ring: 0 0 0 2px var(--crm-surface), 0 0 0 4px var(--crm-brand);

  /* Motion and stacking. */
  --crm-duration-press: 80ms;
  --crm-duration-feedback: 120ms;
  --crm-duration-panel: 180ms;
  --crm-ease: cubic-bezier(0.2, 0, 0, 1);
  --crm-z-sticky: 20;
  --crm-z-menu: 30;
  --crm-z-overlay: 40;
  --crm-z-dialog: 50;
  --crm-z-toast: 60;
}

/* Breakpoints are literal media conditions; CSS vars cannot define them. */
@media (min-width: 768px) {
  :root {
    --crm-page-padding: 1.25rem;
    --crm-grid-gap: 1rem;
    --crm-control-height: 2.5rem;
    --crm-search-height: 2.25rem;
  }
}

@media (min-width: 1200px) {
  :root { --crm-page-padding: 1.5rem; }
}

/* Large touch-screen devices retain touch targets. */
@media (pointer: coarse) {
  :root {
    --crm-control-height: 2.75rem;
    --crm-search-height: 2.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --crm-duration-press: 0ms;
    --crm-duration-feedback: 0ms;
    --crm-duration-panel: 0ms;
  }
}
