/* 东谷 AI · Design Tokens v1.3
   Shared CSS custom properties + component classes for HIG-approx mockups.
   Light + dark via prefers-color-scheme. Offline-safe (system/CJK fonts only). */

:root {
  /* === 东谷品牌统一令牌（v2 视觉改造）=== */
  --brand-primary: #1766D6;
  --brand-primary-hover: #1055B8;
  --brand-primary-soft: #EAF3FF;
  --brand-orange: #F59A00;
  --brand-orange-soft: #FFF3DF;
  --page-bg: #F5F8FD;
  --text-primary: #1D3153;
  --text-secondary: #65758F;
  --border: #E4ECF7;
  --radius-sm: 8px;
  --radius-md: 12px;
  --shadow-soft: 0 4px 16px rgba(25, 68, 120, 0.06);

  /* Colors — light */
  --accent: #1766D6;  /* 东谷品牌蓝 */
  --accent-soft: #EAF3FF;  /* 浅雾蓝选中底 */
  --bg: #F5F8FD;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #FFFFFF;
  --surface-warm: #FFFCF6;
  --surface-2: #F5F5F7;
  --label: #17365F;
  --secondary: #7186A4;
  --tertiary: #AEAEB2;
  --separator: rgba(0, 0, 0, 0.08);

  /* Status (never primary/decoration) */
  --ok: #28A36A;
  --ok-soft: rgba(52, 199, 89, 0.14);
  --ok-text: #248A3D;
  --warn: #F59A00;
  --warn-soft: rgba(255, 159, 10, 0.16);
  --warn-text: #9A6700;
  --risk: #FF3B30;
  --risk-soft: rgba(255, 59, 48, 0.12);
  --risk-text: #D70015;
  --neutral-soft: rgba(120, 120, 128, 0.12);

  /* Radii */
  --radius-card: 16px;
  --radius-large: 20px;
  --radius-modal: 14px;
  --radius-control: 10px;
  --radius-pill: 999px;

  /* Shadows — light */
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-raised: 0 2px 6px rgba(0, 0, 0, 0.06), 0 16px 40px rgba(0, 0, 0, 0.10);

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Noto Sans CJK SC", "Noto Sans SC", "Helvetica Neue", sans-serif;

  /* Layout */
  --topbar-h: 52px;
  /* Shell布局变量 */
  --shell-pad: 20px;
  --shell-radius: 16px;
  --shell-radius-sm: 10px;
  --shell-topbar-h: 52px;
  --shell-bottombar-h: 60px;
  --shell-gap: 16px;
  --shell-tab-h: 44px;
  --shell-grad: linear-gradient(180deg, #EAF3FF 0%, #F5F8FD 100%);
  --shell-avatar-ring: 3px;

  /* 兼容别名 */
  --warning: var(--warn);
  --text: var(--label);
  --primary: var(--accent);
  --content-max: 1120px;
}

/* 深色模式暂不启用，统一浅色商务主题
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #0A84FF;
    --accent-soft: rgba(10, 132, 255, 0.20);
    --bg: #000000;
    --surface: rgba(28, 28, 30, 0.72);
    --surface-solid: #1C1C1E;
    --label: #F5F5F7;
    --secondary: #98989D;
    --tertiary: #636366;
    --separator: rgba(255, 255, 255, 0.10);

    --ok: #30D158;
    --warn: #FFD60A;
    --risk: #FF453A;

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.02), 0 8px 24px rgba(0, 0, 0, 0.03);
    --shadow-raised: 0 2px 6px rgba(0, 0, 0, 0.03), 0 16px 40px rgba(0, 0, 0, 0.05);
  }
}
*/

/* ========== Reset / base ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 22px;
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; display: block; }
.num { font-variant-numeric: tabular-nums; }

/* ========== Type scale ========== */
.title-large {
  font-size: 34px;
  line-height: 41px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.title-page {
  font-size: 22px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.title-card {
  font-size: 17px;
  line-height: 22px;
  font-weight: 600;
}
.body { font-size: 15px; line-height: 22px; }
.body-dense { font-size: 14px; line-height: 20px; }
.secondary-text { font-size: 13px; line-height: 18px; color: var(--secondary); }
.tag-text { font-size: 12px; line-height: 16px; font-weight: 500; }
.tertiary-text { font-size: 13px; line-height: 18px; color: var(--tertiary); }

/* Keyword highlight — max 1 per title, blue only */
.kw { color: var(--accent); font-style: normal; }

/* ========== Pills ========== */
.pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  white-space: nowrap;
  border: none;
}
.pill-accent { background: var(--accent-soft); color: var(--accent); }
.pill-ok { background: var(--ok-soft); color: var(--ok-text); }
.pill-warn { background: var(--warn-soft); color: var(--warn-text); }
.pill-risk { background: var(--risk-soft); color: var(--risk-text); }
.pill-neutral { background: var(--neutral-soft); color: var(--secondary); }

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-control);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  border: 0.5px solid transparent;
  transition: filter 0.12s, background 0.12s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; font-weight: 600; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn-secondary {
  background: var(--surface-solid);
  border-color: var(--separator);
  color: var(--label);
}
.btn-secondary:hover:not(:disabled) { background: rgba(0, 0, 0, 0.03); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover:not(:disabled) { background: var(--accent-soft); }

/* ========== Inputs ========== */
.input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  border: 0.5px solid var(--separator);
  background: var(--surface-solid);
  color: var(--label);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input::placeholder { color: var(--tertiary); }
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input-lg { height: 44px; padding: 0 14px; font-size: 15px; }
.input-risk {
  border-color: var(--risk) !important;
  box-shadow: 0 0 0 3px var(--risk-soft);
}
.input-error-msg {
  font-size: 12px;
  line-height: 16px;
  color: var(--risk-text);
  margin-top: 8px;
}

/* ========== Cards ========== */
.card {
  background: var(--surface-solid);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border: 0.5px solid transparent;
}
/* @media (prefers-color-scheme: dark) {
  .card { border-color: var(--separator); }
}
*/
.card-glass {
  background: var(--surface);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border: 0.5px solid var(--separator);
}
.card-raised {
  background: var(--surface);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-raised);
  border: 0.5px solid var(--separator);
}

/* ========== Showcase glow background ========== */
.glow-bg {
  position: relative;
  min-height: 100vh;
  background: var(--bg);
  overflow-x: hidden;
}
.glow-bg::before,
.glow-bg::after {
  content: "";
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.glow-bg::before {
  top: 10%;
  left: 20%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(0, 122, 255, 0.16), transparent 60%);
}
.glow-bg::after {
  bottom: 10%;
  right: 20%;
  transform: translate(50%, 50%);
  background: radial-gradient(circle, rgba(90, 200, 250, 0.12), transparent 60%);
}
/* @media (prefers-color-scheme: dark) {
  .glow-bg::before {
    background: radial-gradient(circle, rgba(10, 132, 255, 0.20), transparent 60%);
  }
  .glow-bg::after {
    background: radial-gradient(circle, rgba(90, 200, 250, 0.14), transparent 60%);
  }
}
*/
.glow-bg > * { position: relative; z-index: 1; }

/* ========== Topbar ========== */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  background: var(--surface);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--separator);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-work {
  background: rgba(255, 255, 255, 0.86);
}
/* @media (prefers-color-scheme: dark) {
  .topbar-work { background: rgba(28, 28, 30, 0.86); }
}
*/
.brand {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  white-space: nowrap;
  color: var(--label);
}
.brand a { color: inherit; }
.topbar-spacer { flex: 1; }
.topbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}
.topbar-nav a {
  font-size: 13px;
  font-weight: 500;
  color: var(--secondary);
  padding: 6px 10px;
  border-radius: 8px;
}
.topbar-nav a:hover { background: rgba(0, 0, 0, 0.04); color: var(--label); }
.topbar-nav a.active { color: var(--accent); background: var(--accent-soft); }

/* User menu chip */
.user-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  user-select: none;
}
.user-chip:hover { background: rgba(0, 0, 0, 0.04); }
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 500; color: var(--label); }
.user-chevron { font-size: 10px; color: var(--secondary); margin-left: 2px; }
.user-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: var(--surface-solid);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-raised);
  border: 0.5px solid var(--separator);
  padding: 6px;
  z-index: 200;
}
.user-chip.open .user-menu { display: block; }
.user-menu button,
.user-menu a {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--label);
  background: none;
  border: none;
  cursor: pointer;
}
.user-menu button:hover,
.user-menu a:hover { background: rgba(0, 0, 0, 0.04); }

/* ========== Segmented control ========== */
.segmented {
  display: inline-flex;
  background: rgba(120, 120, 128, 0.12);
  border-radius: var(--radius-control);
  padding: 2px;
}
.segmented button {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--secondary);
  white-space: nowrap;
}
.segmented button.active {
  background: var(--surface-solid);
  color: var(--label);
  box-shadow: 0 0.5px 2px rgba(0, 0, 0, 0.08);
}

/* ========== Step cards (showcase) ========== */
.step-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 960px) {
  .step-grid { grid-template-columns: repeat(2, 1fr); }
}
.step-card {
  background: var(--surface);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border: 0.5px solid var(--separator);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.step-dot-1 { background: #007AFF; }
.step-dot-2 { background: #5AC8FA; }
.step-dot-3 { background: #5856D6; }
.step-dot-4 { background: #AF52DE; }
.step-dot.done { background: var(--ok); }
.step-card .step-title { font-size: 15px; font-weight: 600; line-height: 22px; }
.step-card .step-desc { font-size: 13px; line-height: 18px; color: var(--secondary); }

/* ========== List rows (work pages) ========== */
.list-section { margin-top: 20px; }
.list-section + .list-section { margin-top: 20px; }
.list-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 8px;
  padding: 0 4px;
}
.list-group {
  background: var(--surface-solid);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  border: 0.5px solid transparent;
}
/* @media (prefers-color-scheme: dark) {
  .list-group { border-color: var(--separator); }
}
*/
.list-group.pinned {
  background: rgba(0, 122, 255, 0.04);
}
/* @media (prefers-color-scheme: dark) {
  .list-group.pinned { background: rgba(10, 132, 255, 0.08); }
}
*/
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 14px 20px;
  border-bottom: 0.5px solid var(--separator);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: rgba(0, 0, 0, 0.02); }
.list-row .pin {
  width: 16px;
  color: var(--accent);
  font-size: 14px;
  flex-shrink: 0;
  text-align: center;
}
.list-row .row-main { flex: 1; min-width: 0; }
.list-row .row-name {
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-row .row-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 13px;
  line-height: 18px;
  color: var(--secondary);
  flex-wrap: wrap;
}
.list-row .chevron {
  color: var(--tertiary);
  font-size: 18px;
  flex-shrink: 0;
  font-weight: 300;
}

/* ========== Sample data badge ========== */
.sample-badge {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 50;
  font-size: 11px;
  font-weight: 500;
  color: var(--warn-text);
  background: var(--warn-soft);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  pointer-events: none;
  opacity: 0.85;
}

/* ========== Work page shell ========== */
.work-page { background: var(--bg); min-height: 100vh; }
.work-content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 24px 28px 64px;
}
.page-hd { margin-bottom: 16px; }
.page-hd h1.title-page { margin: 0; }

/* ========== Tabs (project workbench) ========== */
.tabbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 28px;
  background: var(--surface-solid);
  border-bottom: 0.5px solid var(--separator);
  overflow-x: auto;
}
.tab-btn {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--secondary);
  border-radius: 8px 8px 0 0;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--label); background: rgba(0, 0, 0, 0.03); }
.tab-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-bottom-color: var(--accent);
}

/* ========== Utility ========== */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* ===== SZDG-1010W-01 补全令牌（P0-C）===== */
:root {
  /* 间距 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  /* 字号 */
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-base: 14px;
  --fs-md: 16px;
  --fs-lg: 20px;
  --fs-xl: 24px;

  /* z-index 层级 */
  --z-base: 1;
  --z-sticky: 10;
  --z-dropdown: 100;
  --z-modal: 200;
  --z-toast: 300;

  /* 动效 */
  --dur-fast: 0.15s;
  --dur-base: 0.25s;
  --dur-slow: 0.4s;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  /* 侧栏 */
  --sidebar-w: 220px;
  --sidebar-w-collapsed: 60px;
  --bottombar-h: 56px;

  /* 助手头像色 */
  --assist-zizhi: #007AFF;
  --assist-xiaogu: #5856D6;
  --assist-sales: #5AC8FA;
  --assist-hr: #8E8E93;
  --assist-project: #34C759;
  --assist-finance: #FF9500;
}
