/* ============================================================
   聚云南 · 案场 CRM — 共享设计系统
   素雅 / 低饱和 / 苹果风；木山配色：橄榄绿 · 暖米 · 金
   ============================================================ */

:root {
  /* 主色 */
  --olive: #7a8b6e;
  --olive-600: #6a7b5f;
  --olive-700: #55654c;
  --olive-800: #414f3b;
  --olive-100: #e9ede4;
  --olive-50: #f2f5ee;

  /* 点缀 */
  --gold: #c6a265;
  --gold-600: #b18d52;
  --gold-soft: #f2e9d8;

  /* 中性 */
  --bg: #f5f3ee;
  --bg-deep: #efece4;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --surface-3: #f7f5ef;
  --text: #2e332c;
  --text-2: #6f756b;
  --text-3: #9a9f94;
  --line: #e7e3d9;
  --line-strong: #d9d4c7;

  /* 语义 */
  --success: #6f8f6a;
  --success-soft: #edf2e8;
  --warning: #b9853f;
  --warning-soft: #f8f0e1;
  --danger: #b4695f;
  --danger-soft: #f7ebe8;
  --info: #6b7f8c;
  --info-soft: #edf1f3;

  /* 圆角 */
  --r-xl: 24px;
  --r-lg: 20px;
  --r-md: 16px;
  --r-sm: 12px;
  --r-xs: 8px;

  /* 阴影：柔和双层 */
  --shadow-sm: 0 1px 2px rgba(46, 51, 44, 0.04), 0 6px 16px -10px rgba(46, 51, 44, 0.12);
  --shadow-md: 0 1px 2px rgba(46, 51, 44, 0.04), 0 18px 40px -24px rgba(46, 51, 44, 0.22);
  --shadow-lg: 0 2px 4px rgba(46, 51, 44, 0.04), 0 32px 64px -32px rgba(46, 51, 44, 0.28);
  --shadow-phone: 0 2px 6px rgba(46, 51, 44, 0.06), 0 48px 90px -40px rgba(46, 51, 44, 0.36);

  /* 字体 */
  --font-body: "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-display: "Songti SC", "STSong", "Noto Serif SC", "SimSun", Georgia, serif;
  --font-num: Georgia, "Times New Roman", "Songti SC", serif;

  /* 动效 */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --sidebar-w: 236px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(1100px 560px at 8% -8%, rgba(198, 162, 101, 0.1), transparent 62%),
    radial-gradient(900px 520px at 102% -4%, rgba(122, 139, 110, 0.12), transparent 58%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 14px;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }

::selection { background: rgba(122, 139, 110, 0.24); }

/* 滚动条 */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(122, 139, 110, 0.22); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- 图标 ---------- */
.i {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: none;
  align-items: center;
  justify-content: center;
  color: currentColor;
}
.i svg { width: 100%; height: 100%; }
.i-sm { width: 15px; height: 15px; }
.i-lg { width: 22px; height: 22px; }
.i-xl { width: 28px; height: 28px; }

/* ---------- 排版 ---------- */
.display { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.01em; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.tiny { font-size: 12px; }
.strong { font-weight: 600; }
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 600;
}
.gold-rule {
  width: 36px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), rgba(198, 162, 101, 0.15));
}
.text-gradient {
  background: linear-gradient(100deg, var(--olive-800), var(--olive));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 布局 ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.hide { display: none !important; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
}
.card-pad { padding: 24px; }
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; padding: 22px 24px 0;
}
.card-head h3 { font-size: 16px; font-weight: 600; letter-spacing: 0.01em; }
.card-head p { color: var(--text-2); font-size: 12.5px; margin-top: 4px; }
.card-body { padding: 20px 24px 24px; }
.card-hover { transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease); }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }

.panel-soft { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.panel-olive { background: linear-gradient(150deg, var(--olive-50), #fbfaf6 70%); border: 1px solid #e2e7da; border-radius: var(--r-md); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px; font-weight: 500;
  background: transparent; color: var(--text);
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease),
    transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid rgba(122, 139, 110, 0.45); outline-offset: 2px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.btn-primary {
  background: linear-gradient(180deg, #84947a, var(--olive));
  color: #fff;
  box-shadow: 0 1px 2px rgba(70, 84, 61, 0.2), 0 10px 20px -12px rgba(70, 84, 61, 0.5);
}
.btn-primary:hover { background: linear-gradient(180deg, #7a8b6e, var(--olive-600)); box-shadow: 0 1px 2px rgba(70, 84, 61, 0.22), 0 14px 24px -12px rgba(70, 84, 61, 0.55); }
.btn-gold { background: var(--gold); color: #fff; box-shadow: 0 10px 20px -14px rgba(177, 141, 82, 0.7); }
.btn-gold:hover { background: var(--gold-600); }
.btn-ghost { border-color: var(--line); background: var(--surface); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--line-strong); color: var(--text); background: var(--surface-2); }
.btn-soft { background: var(--olive-100); color: var(--olive-700); }
.btn-soft:hover { background: #e1e7da; }
.btn-quiet { color: var(--text-2); padding: 0 10px; }
.btn-quiet:hover { background: rgba(122, 139, 110, 0.08); color: var(--text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #f2ded9; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-round { border-radius: 999px; }
.btn .i { margin-left: -2px; }

.icon-btn {
  position: relative;
  width: 40px; height: 40px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2);
  transition: all 0.2s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-2); }
.icon-btn .dot {
  position: absolute; top: 9px; right: 10px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 0 2px var(--surface);
}

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.input, .select, .textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.textarea { height: auto; min-height: 104px; padding: 12px 14px; resize: vertical; line-height: 1.65; }
.input::placeholder, .textarea::placeholder { color: #b3b7ad; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--olive);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(122, 139, 110, 0.12);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236f756b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 38px;
}
.input-icon { position: relative; }
.input-icon > .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.input-icon > .input { padding-left: 42px; }

.search-box { position: relative; }
.search-box .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search-box input {
  width: 100%; height: 40px; padding: 0 14px 0 40px;
  border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface-2); font-size: 13.5px; outline: none;
  transition: all 0.2s var(--ease);
}
.search-box input:focus { border-color: var(--olive); background: #fff; box-shadow: 0 0 0 4px rgba(122, 139, 110, 0.1); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .col-2 { grid-column: span 2; }

.switch {
  position: relative; width: 42px; height: 24px; flex: none;
  border-radius: 999px; border: none; background: #ddd8cc;
  transition: background 0.25s var(--ease);
  padding: 0;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(46, 51, 44, 0.22);
  transition: transform 0.25s var(--ease);
}
.switch[aria-checked="true"] { background: var(--olive); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }

.checkline { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.checkline input { width: 16px; height: 16px; accent-color: var(--olive); }

/* ---------- 标签 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 500;
  background: var(--surface-3); color: var(--text-2);
  white-space: nowrap;
}
.badge .i { width: 12px; height: 12px; }
.badge-olive { background: var(--olive-100); color: var(--olive-700); }
.badge-gold { background: var(--gold-soft); color: #96743c; }
.badge-success { background: var(--success-soft); color: #567a50; }
.badge-warning { background: var(--warning-soft); color: #9b6d2e; }
.badge-danger { background: var(--danger-soft); color: #a25a51; }
.badge-info { background: var(--info-soft); color: #5b7280; }
.badge-outline { background: transparent; border: 1px solid var(--line-strong); color: var(--text-2); }
.badge-lg { height: 28px; padding: 0 12px; font-size: 12.5px; }

.intent {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
}
.intent::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.intent-a { color: #5d7a4f; }
.intent-b { color: #a8813e; }
.intent-c { color: #8b8f86; }

/* ---------- 头像 ---------- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: none;
  border-radius: 50%;
  font-size: 13px; font-weight: 600;
  background: linear-gradient(145deg, #e8ede2, #d8e0cf);
  color: var(--olive-700);
  letter-spacing: 0.02em;
  border: 1px solid rgba(122, 139, 110, 0.14);
}
.avatar.gold { background: linear-gradient(145deg, #f4ecdc, #ead9ba); color: #96743c; border-color: rgba(198, 162, 101, 0.2); }
.avatar.blue { background: linear-gradient(145deg, #e9eef0, #d8e1e4); color: #5b7280; border-color: rgba(107, 127, 140, 0.14); }
.avatar.rose { background: linear-gradient(145deg, #f6eae6, #ecd8d2); color: #a25a51; border-color: rgba(180, 105, 95, 0.14); }
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }
.avatar-xl { width: 72px; height: 72px; font-size: 24px; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ---------- 表格 ---------- */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 500; font-size: 11.5px; letter-spacing: 0.06em;
  color: var(--text-3); text-transform: uppercase;
  padding: 0 16px 12px; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f0ede6;
  color: var(--text-2);
  vertical-align: middle;
}
.table tbody tr { transition: background 0.18s var(--ease); }
.table tbody tr:hover { background: #faf9f5; }
.table tbody tr:last-child td { border-bottom: none; }
.table .cell-main { color: var(--text); font-weight: 500; }
.table .cell-sub { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.table .user-cell { display: flex; align-items: center; gap: 11px; }
.table .actions { display: flex; gap: 4px; justify-content: flex-end; }
.table .num { color: var(--text); }

/* ---------- 分段 / 标签页 ---------- */
.seg {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 4px; border-radius: 12px;
  background: var(--bg-deep);
}
.seg button, .seg a {
  height: 32px; padding: 0 14px;
  border: none; border-radius: 9px;
  background: transparent; color: var(--text-2);
  font-size: 13px; font-weight: 500;
  transition: all 0.2s var(--ease);
  display: inline-flex; align-items: center; gap: 6px;
}
.seg button:hover, .seg a:hover { color: var(--text); }
.seg .on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(46, 51, 44, 0.08); }

.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); }
.tabs button {
  position: relative; padding: 0 0 14px;
  border: none; background: none;
  color: var(--text-2); font-size: 14px; font-weight: 500;
}
.tabs button.on { color: var(--text); }
.tabs button.on::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; border-radius: 2px; background: var(--olive);
}

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 32px; padding: 0 13px;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text-2);
  font-size: 12.5px;
  transition: all 0.2s var(--ease);
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.on { background: var(--olive-100); border-color: #d3dbc8; color: var(--olive-700); font-weight: 500; }

/* ---------- 时间轴 ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 1px; background: linear-gradient(180deg, var(--line-strong), var(--line) 80%, transparent);
}
.tl-item { position: relative; padding: 0 0 22px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -26px; top: 4px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
}
.tl-dot::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--text-3); }
.tl-item.olive .tl-dot { border-color: #c3cfb8; }
.tl-item.olive .tl-dot::after { background: var(--olive); }
.tl-item.gold .tl-dot { border-color: #e2d3b8; }
.tl-item.gold .tl-dot::after { background: var(--gold); }
.tl-item.info .tl-dot::after { background: var(--info); }
.tl-time { font-size: 11.5px; color: var(--text-3); letter-spacing: 0.02em; }
.tl-title { font-size: 13.5px; font-weight: 500; color: var(--text); margin-top: 2px; }
.tl-desc { font-size: 12.5px; color: var(--text-2); margin-top: 4px; line-height: 1.7; }
.tl-card {
  margin-top: 10px; padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

/* ---------- 空状态 / 骨架 ---------- */
.empty {
  text-align: center; padding: 40px 20px;
  color: var(--text-3); font-size: 13px;
}
.empty .empty-icon {
  width: 48px; height: 48px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--surface-3); color: var(--text-3);
}
.skeleton {
  background: linear-gradient(90deg, #f0eee7 25%, #f7f5f0 37%, #f0eee7 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- 弹层 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 90;
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(38, 42, 35, 0.34);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.overlay.open { display: flex; animation: fadeIn 0.22s var(--ease) both; }
.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 64px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-lg);
  animation: popIn 0.32s var(--ease-out) both;
  overflow: hidden;
}
.modal.modal-lg { width: min(820px, 100%); }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 22px 24px 16px;
}
.modal-head h3 { font-size: 17px; font-weight: 600; }
.modal-head p { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.modal-body { padding: 4px 24px 8px; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px 22px;
  border-top: 1px solid #f2efe8;
  margin-top: 8px;
}
.modal-close {
  width: 34px; height: 34px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 10px; background: var(--surface-3); color: var(--text-2);
  transition: all 0.2s var(--ease);
}
.modal-close:hover { background: var(--bg-deep); color: var(--text); }

/* ---------- Toast ---------- */
.toast-stack {
  position: fixed; left: 50%; bottom: 36px; z-index: 200;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(46, 51, 44, 0.94);
  color: #f7f6f1;
  font-size: 13px;
  box-shadow: 0 16px 40px -18px rgba(30, 34, 28, 0.6);
  backdrop-filter: blur(10px);
  animation: toastIn 0.3s var(--ease-out) both;
}
.toast .i { color: #b9c8ae; }
.toast.out { animation: toastOut 0.25s var(--ease) both; }

/* ---------- 通用动效 ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.reveal { animation: rise 0.6s var(--ease-out) both; animation-delay: calc(var(--d, 0) * 55ms); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- 项目 LOGO（原图白底，用 multiply 融入暖米色） ---------- */
.brand-logo {
  display: block;
  width: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---------- 响应式基础 ---------- */
@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .col-2 { grid-column: span 1; }
}
