/* =============================================================
   后台布局与视图形态样式
   ============================================================= */

/* ---------------- 布局骨架 ---------------- */
.app { display: flex; height: 100vh; overflow: hidden; }

/* 侧栏 */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: linear-gradient(178deg, #0E1B19 0%, #162A27 38%, #1B403A 100%);
  color: #C9D6D2; display: flex; flex-direction: column;
  position: relative; z-index: 20; transition: width .24s cubic-bezier(.22, .8, .3, 1);
}
.sidebar::after {
  content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(180deg, transparent, rgba(232, 163, 61, .28), transparent);
}
.sidebar-brand {
  height: var(--topbar-h); display: flex; align-items: center; gap: 10px;
  padding: 0 18px; flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.sidebar-brand .logo { width: 34px; height: 34px; flex-shrink: 0; }
.sidebar-brand .bt { min-width: 0; }
.sidebar-brand .bt .n { font-size: 14px; font-weight: 700; color: #fff; letter-spacing: .4px; white-space: nowrap; }
.sidebar-brand .bt .s { font-size: 10.5px; color: rgba(232, 163, 61, .9); letter-spacing: 1.4px; white-space: nowrap; }

.nav-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 10px 24px; }
.nav-scroll::-webkit-scrollbar { width: 4px; }
.nav-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); }

.nav-group { margin-bottom: 3px; }
.nav-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 11px; cursor: pointer; color: #B6C6C1;
  font-size: 13px; font-weight: 500; transition: all .18s; user-select: none;
}
.nav-head:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-head .ni { font-size: 17px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-head .nt { flex: 1; white-space: nowrap; overflow: hidden; }
.nav-head .arrow { font-size: 15px; transition: transform .22s; color: rgba(255, 255, 255, .4); }
.nav-group.open > .nav-head { color: #fff; }
.nav-group.open > .nav-head .arrow { transform: rotate(90deg); }
.nav-group.open > .nav-head .ni { color: var(--amber-2); }
.nav-group.active > .nav-head { background: rgba(255, 255, 255, .07); color: #fff; }

.nav-sub { max-height: 0; overflow: hidden; transition: max-height .3s cubic-bezier(.22, .8, .3, 1); }
.nav-group.open .nav-sub { max-height: 560px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px 8px 40px; border-radius: 9px; margin: 1px 0;
  color: #9FB0AB; font-size: 12.5px; cursor: pointer; position: relative;
  transition: all .16s; white-space: nowrap;
}
.nav-item .dot { position: absolute; left: 26px; width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, .22); transition: all .18s; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item:hover .dot { background: var(--amber); }
.nav-item.active { background: linear-gradient(90deg, rgba(232, 163, 61, .22), rgba(232, 163, 61, .04)); color: #fff; font-weight: 600; }
.nav-item.active .dot { background: var(--amber); box-shadow: 0 0 0 3px rgba(232, 163, 61, .22); }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2.5px;
  border-radius: 3px; background: var(--amber);
}

.sidebar-foot {
  padding: 12px 14px; border-top: 1px solid rgba(255, 255, 255, .07);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.sidebar-foot .avatar { border-color: rgba(255, 255, 255, .2); }
.sidebar-foot .nf { flex: 1; min-width: 0; }
.sidebar-foot .nf .n { font-size: 12.5px; color: #fff; font-weight: 600; }
.sidebar-foot .nf .s { font-size: 10.5px; color: #7E918B; }
.sidebar-foot .out {
  width: 28px; height: 28px; border-radius: 8px; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .08); color: #B6C6C1; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; transition: all .18s;
}
.sidebar-foot .out:hover { background: rgba(192, 57, 43, .85); color: #fff; }

/* 折叠态 */
.app.mini .sidebar { width: var(--sidebar-w-mini); }
.app.mini .sidebar-brand .bt { display: none; }
.app.mini .nav-head .nt, .app.mini .nav-head .arrow { display: none; }
.app.mini .nav-head { justify-content: center; padding: 11px 0; }
.app.mini .nav-sub { display: none; }
.app.mini .sidebar-foot { flex-direction: column; gap: 8px; }
.app.mini .sidebar-foot .nf { display: none; }

/* 主区 */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  height: var(--topbar-h); flex-shrink: 0;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; gap: 14px; padding: 0 18px;
  position: relative; z-index: 15;
}
.topbar .toggle {
  width: 34px; height: 34px; border: none; border-radius: 10px; background: transparent;
  color: var(--text-2); font-size: 19px; cursor: pointer; transition: all .18s;
  display: inline-flex; align-items: center; justify-content: center;
}
.topbar .toggle:hover { background: var(--paper); color: var(--tea); }
.crumb { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); min-width: 0; }
.crumb .sep { color: var(--muted-2); }
.crumb .cur { color: var(--text); font-weight: 600; }

.topbar-search { position: relative; width: 300px; margin-left: auto; }
.topbar-search i.ph { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 15px; }
.topbar-search .input { height: 36px; padding-left: 34px; border-radius: 11px; background: var(--paper); border-color: transparent; }
.topbar-search .input:focus { background: #fff; border-color: var(--tea-2); }
.search-panel {
  position: absolute; top: 44px; left: 0; right: 0; background: #fff;
  border-radius: var(--radius-l); box-shadow: var(--sh-4); border: 1px solid var(--line-2);
  max-height: 420px; overflow-y: auto; z-index: var(--z-dropdown); padding: 8px;
  animation: fadeUp .2s both;
}
.search-panel .sg { font-size: 11.5px; color: var(--muted); padding: 8px 10px 4px; }
.search-panel .sr {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 9px; cursor: pointer;
}
.search-panel .sr:hover { background: var(--tea-soft); }
.search-panel .sr .sn { font-size: 13px; color: var(--text); font-weight: 600; }
.search-panel .sr .ss { font-size: 11.5px; color: var(--muted); }

.topbar-actions { display: flex; align-items: center; gap: 6px; }
.tb-btn {
  position: relative; width: 36px; height: 36px; border: none; border-radius: 10px;
  background: transparent; color: var(--text-2); font-size: 18px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: all .18s;
}
.tb-btn:hover { background: var(--paper); color: var(--tea); }
.tb-btn .dot-badge {
  position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--clay); border: 2px solid #fff;
}
.tb-btn .num-badge {
  position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 9px; background: var(--clay); color: #fff; font-size: 10px; line-height: 16px;
  text-align: center; border: 2px solid #fff; font-weight: 600;
}
.tb-time { font-size: 12px; color: var(--muted); margin-right: 8px; font-family: var(--font-num); }

.popover {
  position: absolute; top: 50px; right: 16px; width: 320px; background: #fff;
  border-radius: var(--radius-l); box-shadow: var(--sh-4); border: 1px solid var(--line-2);
  z-index: var(--z-dropdown); overflow: hidden; animation: fadeUp .2s both;
}
.popover .ph { padding: 12px 15px; border-bottom: 1px solid var(--line-2); font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.popover .pb { max-height: 340px; overflow-y: auto; }
.popover .pi { display: flex; gap: 10px; padding: 11px 15px; border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background .16s; }
.popover .pi:last-child { border-bottom: none; }
.popover .pi:hover { background: var(--paper-2); }
.popover .pi .ic { width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
.popover .pi .tx { flex: 1; min-width: 0; }
.popover .pi .tx .t { font-size: 12.5px; color: var(--text); font-weight: 500; }
.popover .pi .tx .d { font-size: 11.5px; color: var(--muted); }
.popover .pi .amt { font-size: 12.5px; font-weight: 600; color: var(--clay); font-family: var(--font-num); }
.user-menu { width: 230px; }
.user-menu .um-hd { padding: 16px 15px; display: flex; gap: 11px; align-items: center; border-bottom: 1px solid var(--line-2); background: linear-gradient(135deg, #F4F8F6, #fff); }
.user-menu .um-hd .n { font-size: 14px; font-weight: 700; }
.user-menu .um-hd .r { font-size: 11.5px; color: var(--muted); }
.user-menu .um-item { display: flex; align-items: center; gap: 10px; padding: 10px 15px; font-size: 13px; color: var(--text-2); cursor: pointer; transition: all .16s; }
.user-menu .um-item:hover { background: var(--tea-soft); color: var(--tea); }
.user-menu .um-item i { font-size: 16px; }
.user-menu .um-item.is-danger:hover { background: var(--danger-soft); color: var(--danger); }

/* 页面容器 */
.page-container { flex: 1; overflow-y: auto; padding: 18px 20px 26px; position: relative; }
.page-container::before {
  content: ''; position: fixed; top: var(--topbar-h); left: var(--sidebar-w); right: 0; height: 180px;
  background: radial-gradient(900px 200px at 18% -40%, rgba(46, 125, 107, .07), transparent 70%),
              radial-gradient(700px 180px at 84% -30%, rgba(232, 163, 61, .08), transparent 70%);
  pointer-events: none; z-index: 0;
}

.page-head { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .ph-l .pt { font-size: 19px; font-weight: 700; letter-spacing: .3px; display: flex; align-items: center; gap: 9px; }
.page-head .ph-l .pt i { color: var(--tea-2); }
.page-head .ph-l .pd { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.page-head .ph-r { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-body { position: relative; z-index: 1; }

/* ---------------- 工作台 ---------------- */
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1400px) { .kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px) { .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.kpi {
  position: relative; background: #fff; border: 1px solid var(--line-2);
  border-radius: var(--radius-l); padding: 15px 16px 14px; box-shadow: var(--sh-1);
  overflow: hidden; transition: all .22s cubic-bezier(.22, .8, .3, 1);
}
.kpi:hover { transform: translateY(-3px); box-shadow: var(--sh-3); }
.kpi::after {
  content: ''; position: absolute; right: -26px; top: -26px; width: 86px; height: 86px;
  border-radius: 50%; opacity: .09;
}
.kpi[data-tone="tea"]::after { background: var(--tea); }
.kpi[data-tone="amber"]::after { background: var(--amber); }
.kpi[data-tone="clay"]::after { background: var(--clay); }
.kpi[data-tone="blue"]::after { background: var(--blue); }
.kpi[data-tone="violet"]::after { background: var(--violet); }
.kpi[data-tone="green"]::after { background: var(--green); }
.kpi .kp-top { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.kpi .kp-ico {
  width: 32px; height: 32px; border-radius: 10px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0;
}
.kpi[data-tone="tea"] .kp-ico { background: var(--tea-soft); color: var(--tea); }
.kpi[data-tone="amber"] .kp-ico { background: var(--amber-soft); color: #B87A18; }
.kpi[data-tone="clay"] .kp-ico { background: var(--clay-soft); color: var(--clay); }
.kpi[data-tone="blue"] .kp-ico { background: var(--blue-soft); color: var(--blue); }
.kpi[data-tone="violet"] .kp-ico { background: var(--violet-soft); color: var(--violet); }
.kpi[data-tone="green"] .kp-ico { background: var(--green-soft); color: var(--green); }
.kpi .kp-lb { font-size: 12.5px; color: var(--muted); }
.kpi .kp-val { font-size: 25px; font-weight: 700; color: var(--text); font-family: var(--font-num); line-height: 1.15; letter-spacing: .4px; }
.kpi .kp-val small { font-size: 12.5px; color: var(--muted); font-weight: 400; margin-left: 3px; }
.kpi .kp-hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; display: flex; align-items: center; gap: 4px; }

/* 漏斗 */
.funnel { display: grid; gap: 9px; }
.funnel .fn-row { display: flex; align-items: center; gap: 12px; }
.funnel .fn-name { width: 74px; font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.funnel .fn-bar { flex: 1; height: 30px; border-radius: 9px; background: var(--paper); overflow: hidden; position: relative; }
.funnel .fn-fill {
  height: 100%; border-radius: 9px; display: flex; align-items: center; padding-left: 12px;
  color: #fff; font-size: 12.5px; font-weight: 600; font-family: var(--font-num);
  transition: width .8s cubic-bezier(.22, .8, .3, 1); min-width: 54px;
}
.funnel .fn-rate { width: 62px; text-align: right; font-size: 12px; color: var(--muted); font-family: var(--font-num); }

/* 榜单 */
.rank-list { display: grid; gap: 2px; }
.rank-item { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-radius: 9px; transition: background .16s; }
.rank-item:hover { background: var(--paper-2); }
.rank-item .rk {
  width: 21px; height: 21px; border-radius: 7px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700; background: var(--paper); color: var(--muted); font-family: var(--font-num);
}
.rank-item .rk.top1 { background: linear-gradient(135deg, #F3C070, #E8A33D); color: #4A3208; }
.rank-item .rk.top2 { background: linear-gradient(135deg, #C1CFCA, #9AA9A4); color: #fff; }
.rank-item .rk.top3 { background: linear-gradient(135deg, #E0B08E, #C98B62); color: #fff; }
.rank-item .rn { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text); }
.rank-item .rn .sub { font-size: 11px; color: var(--muted); }
.rank-item .rv { font-size: 12.5px; font-weight: 600; font-family: var(--font-num); color: var(--tea); }

/* 待办 */
.todo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.todo-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 13px;
  border-radius: var(--radius); background: var(--paper-2); border: 1px solid var(--line-2);
  cursor: pointer; transition: all .18s;
}
.todo-item:hover { border-color: var(--tea-2); background: #fff; box-shadow: var(--sh-2); transform: translateY(-2px); }
.todo-item .ti { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; background: #fff; color: var(--tea); flex-shrink: 0; }
.todo-item .tn { flex: 1; font-size: 12.5px; color: var(--text-2); }
.todo-item .tv { font-size: 17px; font-weight: 700; font-family: var(--font-num); color: var(--clay); }

/* 罗盘 */
.compass-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.compass { position: relative; width: 190px; height: 190px; flex-shrink: 0; }
.compass .cp-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.compass .cp-center .big { font-size: 27px; font-weight: 800; font-family: var(--font-num); color: var(--tea); line-height: 1.1; }
.compass .cp-center .small { font-size: 11.5px; color: var(--muted); }
.compass-legend { flex: 1; min-width: 190px; display: grid; gap: 9px; }
.compass-legend .cl { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.compass-legend .cl .dot { width: 9px; height: 9px; border-radius: 3px; }
.compass-legend .cl .n { flex: 1; color: var(--text-2); }
.compass-legend .cl .v { font-family: var(--font-num); font-weight: 600; color: var(--text); }

/* ---------------- 卡片视图 ---------------- */
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1600px) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1200px) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .card-grid { grid-template-columns: 1fr; } }

.rcard {
  position: relative; background: #fff; border: 1px solid var(--line-2);
  border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--sh-1);
  transition: all .24s cubic-bezier(.22, .8, .3, 1); display: flex; flex-direction: column;
}
.rcard:hover { transform: translateY(-4px); box-shadow: var(--sh-3); border-color: #DCE4DE; }
.rcard .rc-cover { position: relative; height: 132px; overflow: hidden; background: var(--paper); }
.rcard .rc-cover .cover-img { transition: transform .5s; }
.rcard:hover .rc-cover .cover-img { transform: scale(1.05); }
.rcard .rc-cover .rc-badge { position: absolute; top: 10px; left: 10px; }
.rcard .rc-cover .rc-fav { position: absolute; top: 9px; right: 9px; }
.rcard .rc-body { padding: 13px 15px 15px; flex: 1; display: flex; flex-direction: column; }
.rcard .rc-title { font-size: 14.5px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 7px; }
.rcard .rc-sub { font-size: 12px; color: var(--muted); margin-top: 4px; min-height: 34px; line-height: 1.55; }
.rcard .rc-meta { display: flex; gap: 14px; flex-wrap: wrap; margin: 10px 0 11px; }
.rcard .rc-meta .m { font-size: 11.5px; color: var(--muted); }
.rcard .rc-meta .m b { display: block; font-size: 14px; color: var(--text); font-family: var(--font-num); font-weight: 700; }
.rcard .rc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 11px; border-top: 1px solid var(--line-2); margin-top: auto; }
.rcard .rc-price { font-size: 18px; font-weight: 800; color: var(--clay); font-family: var(--font-num); }
.rcard .rc-price small { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.rcard .rc-acts { display: flex; gap: 3px; }
.rcard .rc-acts button {
  width: 27px; height: 27px; border: none; border-radius: 8px; background: var(--paper);
  color: var(--muted); cursor: pointer; font-size: 14px; display: inline-flex;
  align-items: center; justify-content: center; transition: all .16s;
}
.rcard .rc-acts button:hover { background: var(--tea-soft); color: var(--tea); }
.rcard .rc-acts button.is-danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------------- 画廊视图 ---------------- */
.gallery { column-count: 4; column-gap: 14px; }
@media (max-width: 1500px) { .gallery { column-count: 3; } }
@media (max-width: 1000px) { .gallery { column-count: 2; } }
.gitem {
  break-inside: avoid; margin-bottom: 14px; border-radius: var(--radius-l); overflow: hidden;
  background: #fff; border: 1px solid var(--line-2); box-shadow: var(--sh-1);
  cursor: pointer; transition: all .22s; position: relative;
}
.gitem:hover { box-shadow: var(--sh-3); transform: translateY(-3px); }
.gitem img { width: 100%; display: block; }
.gitem .gi-info { padding: 10px 12px; }
.gitem .gi-info .t { font-size: 12.5px; color: var(--text); font-weight: 600; }
.gitem .gi-info .d { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.gitem .gi-type {
  position: absolute; top: 9px; right: 9px; padding: 2px 8px; border-radius: 7px;
  background: rgba(18, 32, 30, .68); color: #fff; font-size: 10.5px; backdrop-filter: blur(4px);
}

/* ---------------- 看板视图 ---------------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.kb-col { width: 268px; flex-shrink: 0; background: var(--paper); border-radius: var(--radius-l); border: 1px solid var(--line-2); }
.kb-hd { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-2); }
.kb-hd .t { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.kb-hd .t .cdot { width: 8px; height: 8px; border-radius: 3px; }
.kb-hd .c { font-size: 11.5px; color: var(--muted); background: #fff; padding: 1px 7px; border-radius: 8px; font-family: var(--font-num); }
.kb-bd { padding: 10px; display: grid; gap: 9px; min-height: 90px; max-height: 640px; overflow-y: auto; }
.kb-card {
  background: #fff; border-radius: var(--radius); padding: 11px 12px; border: 1px solid var(--line-2);
  box-shadow: var(--sh-1); cursor: pointer; transition: all .18s;
}
.kb-card:hover { border-color: var(--tea-2); box-shadow: var(--sh-2); transform: translateY(-2px); }
.kb-card .kt { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.5; }
.kb-card .km { font-size: 11.5px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------------- 日历视图 ---------------- */
.cal-wrap { background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-l); box-shadow: var(--sh-1); overflow: hidden; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--line-2); }
.cal-head .title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--paper-2); border-bottom: 1px solid var(--line-2); }
.cal-week div { padding: 9px 0; text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell {
  min-height: 116px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
  padding: 8px; position: relative; transition: background .16s; cursor: pointer;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:hover { background: var(--paper-2); }
.cal-cell.is-other { background: #FCFCFB; }
.cal-cell.is-other .cd { color: var(--muted-2); }
.cal-cell.is-today { background: var(--amber-soft); }
.cal-cell.is-today .cd { color: #8E6111; font-weight: 800; }
.cal-cell .cd { font-size: 12.5px; font-family: var(--font-num); color: var(--text-2); font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.cal-cell .cd .wk { font-size: 10.5px; color: var(--muted); font-weight: 400; }
.cal-cell .ce { margin-top: 5px; display: grid; gap: 4px; }
.cal-event {
  font-size: 11px; padding: 3px 6px; border-radius: 6px;
  background: var(--tea-soft); color: var(--tea); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; border-left: 2px solid var(--tea-2);
}
.cal-event.warn { background: var(--amber-soft); color: #8E6111; border-left-color: var(--amber); }
.cal-event.danger { background: var(--danger-soft); color: var(--danger); border-left-color: var(--danger); }
.cal-event.muted { background: #F1F2F0; color: var(--muted); border-left-color: #C8CFCB; }
.cal-cell .cprice { position: absolute; right: 8px; bottom: 7px; font-size: 11px; font-family: var(--font-num); color: var(--muted); }

/* 热力日历 */
.heat-grid { display: grid; gap: 3px; }
.heat-row { display: grid; grid-template-columns: 148px repeat(35, minmax(0, 1fr)); gap: 3px; align-items: center; }
.heat-label { font-size: 11.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 6px; }
.heat-cell {
  height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #fff; cursor: pointer; transition: transform .14s; position: relative;
  font-family: var(--font-num);
}
.heat-cell:hover { transform: scale(1.14); z-index: 3; box-shadow: var(--sh-2); }
.heat-head { display: grid; grid-template-columns: 148px repeat(35, minmax(0, 1fr)); gap: 3px; margin-bottom: 5px; }
.heat-head div { font-size: 10.5px; color: var(--muted); text-align: center; }

/* ---------------- 矩阵视图 ---------------- */
.matrix-wrap { background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-l); box-shadow: var(--sh-1); overflow: auto; }
table.matrix { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
table.matrix th, table.matrix td { padding: 10px 13px; border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); text-align: left; white-space: nowrap; }
table.matrix thead th { background: var(--paper-2); color: var(--text-2); font-weight: 600; position: sticky; top: 0; z-index: 2; }
table.matrix tbody th { background: #FCFDFC; color: var(--text); font-weight: 600; position: sticky; left: 0; z-index: 1; }
table.matrix tbody tr:hover td { background: #FAFBF9; }
table.matrix td .mx-val { font-family: var(--font-num); font-weight: 600; color: var(--text); }
table.matrix td .mx-sub { font-size: 11px; color: var(--muted); }

/* ---------------- 三栏工作台 ---------------- */
.workspace { display: grid; grid-template-columns: 292px 1fr 306px; gap: 14px; height: calc(100vh - var(--topbar-h) - 118px); min-height: 520px; }
@media (max-width: 1400px) { .workspace { grid-template-columns: 258px 1fr 280px; } }
@media (max-width: 1180px) { .workspace { grid-template-columns: 240px 1fr; } .ws-right { display: none; } }
.ws-col { background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-l); box-shadow: var(--sh-1); display: flex; flex-direction: column; overflow: hidden; }
.ws-hd { padding: 12px 14px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; }
.ws-hd .t { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.ws-bd { flex: 1; overflow-y: auto; }
.ws-filter { padding: 10px 12px; border-bottom: 1px solid var(--line-2); display: flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }
.ws-item { padding: 11px 13px; border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background .16s; position: relative; }
.ws-item:hover { background: var(--paper-2); }
.ws-item.active { background: var(--tea-soft); }
.ws-item.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tea-2); }
.ws-item .wi-top { display: flex; align-items: center; gap: 8px; }
.ws-item .wi-name { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; min-width: 0; }
.ws-item .wi-last { font-size: 11.5px; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-item .wi-meta { display: flex; align-items: center; gap: 7px; margin-top: 6px; }
.ws-item .wi-time { font-size: 10.5px; color: var(--muted-2); margin-left: auto; }

.chat-body { flex: 1; overflow-y: auto; padding: 16px; background: linear-gradient(180deg, #FBFAF7, #fff); display: flex; flex-direction: column; gap: 13px; }
.chat-msg { display: flex; gap: 9px; max-width: 76%; }
.chat-msg.is-me { margin-left: auto; flex-direction: row-reverse; }
.chat-msg .bubble { padding: 10px 13px; border-radius: 14px; font-size: 13px; line-height: 1.72; background: #fff; border: 1px solid var(--line-2); color: var(--text-2); box-shadow: var(--sh-1); }
.chat-msg.is-me .bubble { background: linear-gradient(135deg, var(--tea-2), var(--tea)); color: #fff; border-color: transparent; }
.chat-msg.is-agent .bubble { background: var(--amber-soft); border-color: #F2DDB8; color: #7A530F; }
.chat-msg.is-sys { max-width: 100%; margin: 0 auto; }
.chat-msg.is-sys .bubble { background: var(--paper); color: var(--muted); font-size: 11.5px; border-style: dashed; }
.chat-msg .cm-time { font-size: 10.5px; color: var(--muted-2); margin-top: 4px; text-align: right; }
.chat-input { border-top: 1px solid var(--line-2); padding: 11px 13px; flex-shrink: 0; background: #fff; }
.chat-input .ci-tools { display: flex; gap: 5px; margin-bottom: 8px; flex-wrap: wrap; }
.chat-input .quick {
  padding: 4px 10px; border-radius: 20px; font-size: 11.5px; cursor: pointer;
  background: var(--paper); color: var(--text-2); border: 1px solid var(--line-2); transition: all .16s;
}
.chat-input .quick:hover { background: var(--tea-soft); color: var(--tea); border-color: var(--tea-2); }

/* ---------------- 左右分栏 ---------------- */
.split { display: grid; grid-template-columns: 288px 1fr; gap: 14px; align-items: start; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }

/* ---------------- 树形视图 ---------------- */
.tree-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 14px; align-items: start; }
.tree { background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-l); box-shadow: var(--sh-1); padding: 10px; max-height: 660px; overflow-y: auto; }
.tree-node { user-select: none; }
.tree-row {
  display: flex; align-items: center; gap: 7px; padding: 7px 9px; border-radius: 9px;
  cursor: pointer; font-size: 13px; color: var(--text-2); transition: all .16s;
}
.tree-row:hover { background: var(--paper-2); color: var(--tea); }
.tree-row.active { background: var(--tea-soft); color: var(--tea); font-weight: 600; }
.tree-row .tw { width: 15px; font-size: 13px; color: var(--muted); transition: transform .2s; }
.tree-row .tw.open { transform: rotate(90deg); }
.tree-row .tico { font-size: 14px; }
.tree-row .tcount { margin-left: auto; font-size: 11px; color: var(--muted); font-family: var(--font-num); background: var(--paper); padding: 0 6px; border-radius: 7px; }
.tree-row.active .tcount { background: #fff; color: var(--tea); }
.tree-children { margin-left: 15px; overflow: hidden; }

/* ---------------- 时间轴视图 ---------------- */
.tl-layout { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .tl-layout { grid-template-columns: 1fr; } }
.tl-card { position: relative; background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-l); padding: 14px 16px; box-shadow: var(--sh-1); transition: all .2s; }
.tl-card:hover { transform: translateX(4px); box-shadow: var(--sh-2); border-color: #DCE4DE; }
.tl-card .tc-hd { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.tl-card .tc-hd .tt { font-size: 14px; font-weight: 600; }
.tl-card .tc-stats { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.tl-card .tc-stats .s { font-size: 11.5px; color: var(--muted); }
.tl-card .tc-stats .s b { display: block; font-size: 15px; color: var(--text); font-family: var(--font-num); }

/* ---------------- 图表布局 ---------------- */
.chart-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.sp-3 { grid-column: span 3; } .sp-4 { grid-column: span 4; } .sp-5 { grid-column: span 5; }
.sp-6 { grid-column: span 6; } .sp-7 { grid-column: span 7; } .sp-8 { grid-column: span 8; }
.sp-9 { grid-column: span 9; } .sp-12 { grid-column: span 12; }
@media (max-width: 1300px) { .sp-3, .sp-4, .sp-5 { grid-column: span 6; } .sp-7, .sp-8, .sp-9 { grid-column: span 12; } }
@media (max-width: 880px) { .sp-3, .sp-4, .sp-5, .sp-6 { grid-column: span 12; } }

/* ---------------- 折线/柱状图 ---------------- */
.axis-x { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 6px; }

/* ---------------- 一键同步按钮组 ---------------- */
.sync-bar { display: flex; gap: 7px; flex-wrap: wrap; }
.sync-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
  border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--text-2);
  font-size: 12px; cursor: pointer; transition: all .18s;
}
.sync-btn:hover { transform: translateY(-1px); box-shadow: var(--sh-1); }
.sync-btn.fs:hover { border-color: #3370FF; color: #3370FF; background: #F2F6FF; }
.sync-btn.dt:hover { border-color: #1E90FF; color: #1677FF; background: #F1F7FF; }
.sync-btn.wx:hover { border-color: #07C160; color: #07C160; background: #F0FBF5; }
.sync-btn i { font-size: 14px; }

/* ---------------- 登录/注册 ---------------- */
.auth-page { display: flex; min-height: 100vh; background: var(--paper); }
.auth-visual {
  flex: 1; position: relative; overflow: hidden;
  background: linear-gradient(160deg, #0E1B19, #1B403A 55%, #2E7D6B);
  display: flex; flex-direction: column; justify-content: space-between; padding: 40px 46px; color: #fff;
}
.auth-visual .av-bg { position: absolute; inset: 0; opacity: .5; }
.auth-visual .av-bg img { width: 100%; height: 100%; object-fit: cover; }
.auth-visual .av-mask { position: absolute; inset: 0; background: linear-gradient(160deg, rgba(14,27,25,.92), rgba(27,64,58,.72) 55%, rgba(46,125,107,.55)); }
.auth-visual .av-inner { position: relative; z-index: 2; display: flex; flex-direction: column; height: 100%; justify-content: space-between; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand img { width: 44px; height: 44px; }
.auth-brand .n { font-size: 17px; font-weight: 700; letter-spacing: .6px; }
.auth-brand .s { font-size: 11px; color: rgba(255,255,255,.62); letter-spacing: 2px; }
.auth-slogan { margin: auto 0; }
.auth-slogan h1 { font-size: 34px; line-height: 1.34; font-weight: 700; letter-spacing: 1px; }
.auth-slogan h1 em { font-style: normal; color: var(--amber-2); }
.auth-slogan p { margin-top: 14px; font-size: 13.5px; color: rgba(255,255,255,.72); line-height: 1.9; max-width: 460px; }
.auth-feats { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 30px; }
.auth-feats .f { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: rgba(255,255,255,.82); }
.auth-feats .f i { font-size: 18px; color: var(--amber-2); }
.auth-foot { font-size: 11.5px; color: rgba(255,255,255,.45); }

.auth-form-wrap { width: 500px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; padding: 30px; background: var(--paper-2); }
@media (max-width: 1080px) { .auth-visual { display: none; } .auth-form-wrap { width: 100%; } }
.auth-card { width: 100%; max-width: 392px; }
.auth-card .at { font-size: 24px; font-weight: 700; letter-spacing: .5px; }
.auth-card .as { font-size: 12.5px; color: var(--muted); margin: 7px 0 26px; }
.auth-tabs { display: flex; gap: 4px; background: var(--paper); padding: 4px; border-radius: 11px; margin-bottom: 22px; }
.auth-tabs a {
  flex: 1; text-align: center; padding: 8px 0; border-radius: 8px; font-size: 13px;
  color: var(--muted); transition: all .2s; font-weight: 500;
}
.auth-tabs a.on { background: #fff; color: var(--tea); font-weight: 700; box-shadow: var(--sh-1); }
.auth-hint { margin-top: 18px; padding: 11px 13px; border-radius: 11px; background: var(--tea-soft); font-size: 11.5px; color: var(--tea); line-height: 1.8; }
.auth-hint b { font-family: var(--font-num); }
.auth-copy { text-align: center; margin-top: 22px; font-size: 11.5px; color: var(--muted-2); }

/* 响应式收尾 */
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .26s; }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--sh-4); }
  .page-container { padding: 14px; }
  .topbar-search { width: 180px; }
}
