/* ============================================================
   珞咖业务平台 · 界面美化层 (ui-polish.css)
   ------------------------------------------------------------
   - 仅作用于应用界面，不触碰单据打印版式（.df-* 在 modal 内）
   - 只增强视觉属性（配色/阴影/圆角/字重/微动效），不改布局尺寸
   - 加载顺序：必须在 styles.css 之后
   版本：20261127l（主色对齐 logo 蓝 #0379b6；手机端 Hero 头部 + 扁平卡片层级）
   ============================================================ */

:root {
  /* 细腻阴影层级 */
  --sh-xs: 0 1px 2px rgba(16, 24, 40, .04);
  --sh-sm: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .03);
  --sh-md: 0 6px 16px rgba(16, 24, 40, .08), 0 2px 5px rgba(16, 24, 40, .04);
  --ring: rgba(3, 121, 182, .18);
  --radius: 12px;
}

/* ---------- 全局：字体与背景质感 ---------- */
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(180deg, #f7f9fc 0%, #f4f6f9 240px, #f4f6f9 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, b, strong { letter-spacing: .01em; }
.num, .value, .card .value, td.num, th.num { font-variant-numeric: tabular-nums; }

/* ---------- 按钮：过渡 + 悬浮微抬升 ---------- */
.btn {
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .12s ease;
  box-shadow: var(--sh-xs);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--sh-sm); }
.btn:active { transform: translateY(0); }
.btn.primary { box-shadow: 0 2px 6px rgba(3, 121, 182, .28); }
.btn.primary:hover { box-shadow: 0 4px 12px rgba(3, 121, 182, .34); }
.btn.danger:hover { background: var(--danger-soft); }

/* ---------- 侧边栏：品牌区与导航 ---------- */
.sidebar { box-shadow: inset -1px 0 0 rgba(16, 24, 40, .02); }
.brand { position: relative; padding-left: 36px; }
.brand::before {
  content: "";
  position: absolute; left: 6px; top: 2px;
  width: 24px; height: 24px;
  background: url("assets/logo-mark.png?v=20261127l") center / contain no-repeat;
}
.brand b { font-size: 16px; letter-spacing: .02em; }
.nav-item { transition: background .15s ease, color .15s ease; }
.nav-item:hover { background: #f1f5fa; }
.nav-item.active { box-shadow: inset 3px 0 0 var(--primary); }
.nav-dot { box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(163, 45, 45, .18); }
.nav-group { font-weight: 600; letter-spacing: .08em; }

/* 顶栏微阴影 */
.topbar { box-shadow: var(--sh-xs); }
.topbar h2 { letter-spacing: .02em; }
/* 顶部问候行：仅手机端 Hero 头部显示 */
.hero-greet { display: none; }
.hero-logo { width: 26px; height: 26px; flex: 0 0 auto; display: block; }

/* ---------- 数据卡片：层次 + 顶部主题条 ---------- */
.cards .card {
  position: relative;
  overflow: hidden;
  box-shadow: var(--sh-sm);
  transition: box-shadow .2s ease, transform .2s ease;
}
.cards .card::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, #1e93d1, #0379b6);
  opacity: .9;
}
.cards .card:nth-child(1)::before { background: linear-gradient(90deg, #1e93d1, #0379b6); }
.cards .card:nth-child(2)::before { background: linear-gradient(90deg, #d15555, #a32d2d); }
.cards .card:nth-child(3)::before { background: linear-gradient(90deg, #1f9c79, #0f6e56); }
.cards .card:nth-child(4)::before { background: linear-gradient(90deg, #c98a34, #9a6212); }
.cards .card:nth-child(5)::before { background: linear-gradient(90deg, #7a8798, #4b5563); }
.cards .card:nth-child(6)::before { background: linear-gradient(90deg, #1e93d1, #0379b6); }
.cards .card.accent, .cards .card.alert, .cards .card.good, .cards .card { border-left: 0; }
.cards .card:hover { transform: translateY(-3px); box-shadow: var(--sh-md); }
.cards .card .label { font-weight: 500; letter-spacing: .04em; }
.cards .card .value { font-size: 28px; font-weight: 650; letter-spacing: -.02em; line-height: 1.25; }
.cards .card.accent .value { color: #03689e; }
.cards .card.alert .value { color: #a32d2d; }
.cards .card.good .value { color: #0f6e56; }
.cards .card .hint { color: #8a93a1; }

/* ---------- 面板：阴影与标题质感 ---------- */
.panel { box-shadow: var(--sh-sm); border-color: #e8ebf0; }
.panel-head {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  letter-spacing: .01em;
}

/* ---------- 表格：表头 / 斑马纹 / 悬浮 ---------- */
.content table thead th {
  background: linear-gradient(180deg, #f7f9fc 0%, #f3f6fa 100%);
  color: #697386;
  font-weight: 600;
  letter-spacing: .03em;
}
.content tbody tr { transition: background .14s ease; }
.content tbody tr:nth-child(even) { background: rgba(248, 250, 252, .55); }
.content tbody tr:hover { background: #eef5fc; }
.content tbody tr:hover td { color: #16233a; }

/* 业务编号链接更醒目 */
.content table a { font-weight: 600; }
.content .order-cell a[b] { color: #03689e; }

/* ---------- 状态标签：精致胶囊 ---------- */
.tag {
  font-weight: 600;
  letter-spacing: .02em;
  border: 1px solid transparent;
}
.tag.blue { border-color: #cfe3f7; }
.tag.green { border-color: #c4ebdd; }
.tag.amber { border-color: #f0dcbb; }
.tag.red { border-color: #f2cccc; }
.lc-badge, .lc-pill { font-weight: 600; }
.lc-pill-inline { font-weight: 600; box-shadow: inset 0 0 0 1px #d7e4fb; }

/* ---------- 登录页：品牌 logo 主视觉 ---------- */
.login-logo { display: block; width: 210px; margin: 0 auto 12px; }

/* ---------- 待办强提醒更聚焦 ---------- */
.todo-table tr:hover { box-shadow: inset 3px 0 0 var(--primary); }

/* ---------- 移动端底部标签栏：毛玻璃 + 悬浮态 ---------- */
@media (max-width: 760px) {
  .brand { padding-left: 36px; }
  /* 强制独立合成层：规避 X5/微信内核 fixed 底栏首次渲染不出现的问题 */
  .tabbar { box-shadow: 0 -4px 18px rgba(16, 24, 40, .10); transform: translateZ(0); -webkit-transform: translateZ(0); }
  .tab-item { transition: color .15s ease; }
  .tab-item:active { opacity: .7; }
  .tab-item.active svg { filter: drop-shadow(0 2px 3px rgba(3, 121, 182, .3)); }

  /* ---------- 头部：品牌渐变 Hero（问候语 + 大标题，借鉴金驼掌柜式层级） ---------- */
  /* relative 让装饰光斑以头部自身为包含块，被 overflow:hidden 正确裁剪（static 会让
     光斑相对视口定位，在页底制造幻影滚动区，干扰 fixed 底栏的首次渲染） */
  .topbar {
    position: relative; top: 0; height: auto; display: block;
    padding: 16px 16px 18px;
    background: linear-gradient(140deg, #0e8ecb 0%, #0379b6 52%, #036a9e 100%);
    border-bottom: 0; box-shadow: none; overflow: hidden;
  }
  /* 右上/右下装饰光斑 */
  .topbar::before {
    content: ""; position: absolute; right: -46px; top: -58px;
    width: 150px; height: 150px; border-radius: 50%;
    background: rgba(255, 255, 255, .10);
  }
  .topbar::after {
    content: ""; position: absolute; right: 70px; bottom: -72px;
    width: 110px; height: 110px; border-radius: 50%;
    background: rgba(255, 255, 255, .07);
  }
  .topbar > * { position: relative; z-index: 1; }
  .topbar .hero-greet { display: flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, .92); font-size: 13px; }
  .topbar .hero-logo {
    width: 30px; height: 30px; padding: 3px; box-sizing: border-box;
    background: #fff; border-radius: 7px; box-shadow: 0 1px 4px rgba(3, 54, 84, .25);
  }
  /* 面板头最后一个 span 若是计数标签，保持内联，不参与竖排规则 */
  .panel-head > span.tag:last-child { display: inline-block; width: auto; margin-top: 0; margin-left: 6px; }
  .topbar h2 { color: #fff; font-size: 23px; font-weight: 700; margin-top: 8px; letter-spacing: .01em; }
  .topbar-actions { margin-top: 12px; gap: 8px; }
  .topbar-actions .btn { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .4); color: #fff; }
  .topbar-actions .btn.primary {
    background: #fff; border-color: #fff; color: var(--primary);
    box-shadow: 0 2px 8px rgba(3, 54, 84, .18); font-weight: 600;
  }

  /* ---------- 工作台卡片：扁平白卡 + 首卡突出（资金余额式层级） ---------- */
  .cards .card::before { display: none; }
  .cards .card { border-color: #eef1f6; }
  .cards:not(.order-head) > .card:first-child { grid-column: 1 / -1; padding: 18px 18px 20px; }
  .cards:not(.order-head) > .card:first-child .value { font-size: 34px; font-weight: 700; margin-top: 8px; }
  .cards:not(.order-head) > .card:first-child .label { font-size: 13px; color: #667085; }
  .cards .card .value { font-size: 21px; }

  /* ---------- 面板标题更醒目（今日待办式节标题） ---------- */
  .panel-head { padding: 13px 14px; font-size: 15px; font-weight: 700; }

  .cards .card { box-shadow: var(--sh-sm); }
  .toast { box-shadow: var(--sh-md); }
  .rec-card { transition: background .14s ease; }
  .rec-card:active { background: #f6f9fd; }
  .rec-name { color: #1d2b40; }
  .rec-amt { color: #03689e; }
  .panel-head.compact { letter-spacing: .01em; }
}

@media (max-width: 420px) {
  .cards .card .value { font-size: 19px; }
}

/* ---------- 微动效偏好：尊重系统减少动画设置 ---------- */
@media (prefers-reduced-motion: reduce) {
  .btn, .card, .nav-item, .tab-item, .content tbody tr { transition: none; }
  .cards .card:hover, .btn:hover { transform: none; }
}

/* ---------- 工作台改造（借鉴金驼掌柜式层级：大卡+四宫格+待办条+今日动态+快捷宫格+趋势图） ---------- */
.dash-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-radius: 10px; margin-bottom: 8px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: filter .12s ease, transform .12s ease;
}
.dash-strip:hover { filter: brightness(.97); transform: translateX(2px); }
.dash-strip:last-child { margin-bottom: 0; }
.dash-strip .chev { opacity: .55; font-weight: 400; }

.today-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.today-card {
  background: #fff; border: 1px solid #e7eaf0; border-radius: 12px;
  padding: 12px 14px; box-shadow: var(--sh-xs);
}
.today-card .t-label { font-size: 12px; color: #6b7280; }
.today-card .t-amount { font-size: 20px; font-weight: 700; color: #0379b6; margin: 4px 0 2px; }
.today-card .t-amount small { font-size: 12px; font-weight: 500; color: #6b7280; }
.today-card .t-sub { font-size: 11px; color: #9ca3af; }

.dash-quick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.q-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: #fff; border: 1px solid #e7eaf0; border-radius: 12px;
  padding: 10px 2px; font-size: 12px; color: #374151;
  cursor: pointer; text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
.q-item:hover { transform: translateY(-2px); box-shadow: var(--sh-sm); color: #0379b6; }
.q-ic { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.q-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.dash-chart { background: #fff; border: 1px solid #e7eaf0; border-radius: 12px; padding: 14px 16px; box-shadow: var(--sh-xs); }
.dash-legend { display: flex; gap: 16px; font-size: 12px; color: #6b7280; margin-bottom: 10px; }
.dash-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.dash-chart-body { display: flex; align-items: flex-end; gap: 6px; height: 112px; }
.dash-chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.dash-bars { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 84px; width: 100%; }
.dash-bars i { display: block; width: 9px; border-radius: 3px 3px 0 0; }
.dash-chart-x { font-size: 10px; color: #9ca3af; white-space: nowrap; }

/* 订单表状态列的迷你进度条 */
.mini-prog { height: 4px; background: #eef1f5; border-radius: 2px; margin-top: 6px; width: 110px; max-width: 100%; overflow: hidden; }
.mini-prog i { display: block; height: 100%; background: #0379b6; border-radius: 2px; }

@media (max-width: 760px) {
  .dash-quick { grid-template-columns: repeat(4, 1fr); }
  .today-row { gap: 8px; }
  .today-card { padding: 10px 12px; }
  .today-card .t-amount { font-size: 17px; }
  .dash-strip { padding: 9px 12px; }
}

/* ---------- 工作台：桌面端蓝色区 + 左右分区（借鉴金驼掌柜） ---------- */
.side-foot { margin-top: 18px; padding: 10px; color: #9ca3af; font-size: 11px; border-top: 1px solid #eef1f5; }
.sheet-foot { padding: 14px 18px 22px; text-align: center; color: #9ca3af; font-size: 11px; }
.dash-hero {
  position: relative; overflow: hidden; margin-bottom: 16px; border-radius: 14px;
  background: linear-gradient(112deg, #1e93d1 0%, #0379b6 58%, #0a5f95 100%);
  color: #fff; padding: 18px 24px 20px; min-height: 112px;
  box-shadow: 0 4px 14px rgba(3, 121, 182, .18);
}
.dash-hero::before, .dash-hero::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .09);
}
.dash-hero::before { width: 190px; height: 190px; right: -30px; top: -95px; }
.dash-hero::after { width: 120px; height: 120px; right: 96px; bottom: -78px; }
.dash-hero-greet { position: relative; z-index: 1; font-size: 12px; color: rgba(255, 255, 255, .86); letter-spacing: .02em; }
.dash-hero-title { position: relative; z-index: 1; font-size: 22px; font-weight: 700; margin-top: 8px; letter-spacing: .04em; }
.dash-ver {
  position: absolute; z-index: 1; right: 20px; top: 16px; font-size: 11px; font-weight: 500;
  padding: 3px 10px; border-radius: 999px; color: rgba(255, 255, 255, .92);
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .26);
}
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.dash-main > .panel, .dash-side > .panel, #dash-more-grid > .panel { margin-bottom: 16px; }
.dash-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.dash-cards .card:first-child { grid-column: 1 / -1; }
.dash-cards .card { min-height: 104px; display: flex; flex-direction: column; justify-content: center; }
.dash-cards .card:first-child { min-height: 112px; }
.dash-cards .card .value { font-size: 22px; }
.dash-side .dash-quick { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dash-side .q-item { padding: 14px 4px; font-size: 12.5px; gap: 9px; border-radius: 14px; }
.dash-side .q-ic { width: 42px; height: 42px; border-radius: 12px; }
.dash-side .q-ic svg { width: 22px; height: 22px; }
/* 蓝色区域横向铺满主内容区（贴住顶栏与两侧边缘），纵向保持留白 */
@media (min-width: 761px) {
  .dash-hero { margin: -22px -26px 16px; padding: 20px 28px 22px; border-radius: 0; min-height: 124px; }
  .dash-ver { right: 28px; top: 18px; }
}
/* 左右分区按金驼截图比例：左 60% / 右 40%，右侧功能卡片随之放大 */
@media (min-width: 1280px) {
  .dash-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}
@media (max-width: 760px) {
  .dash-hero { display: none; } /* 手机端顶栏已有蓝色 Hero，避免重复 */
  .dash-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dash-cards .card { padding: 12px; min-height: 0; }
  .dash-cards .card:first-child { min-height: 0; }
  .dash-cards .card .value { font-size: 18px; }
  .dash-side .dash-quick { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .dash-side .q-item { padding: 10px 2px; font-size: 11.5px; }
  .dash-side .q-ic { width: 34px; height: 34px; }
  .dash-side .q-ic svg { width: 18px; height: 18px; }
}

/* ---------- 使用手册页 ---------- */
.help-wrap { max-width: 860px; }
.help-intro { background: #f0f7fc; border: 1px solid #d6e9f5; border-radius: 10px; padding: 12px 16px; font-size: 13px; line-height: 1.7; margin-bottom: 6px; }
.help-sec { border-bottom: 1px solid #eef1f5; }
.help-sec:last-child { border-bottom: none; }
.help-sec summary { cursor: pointer; font-weight: 600; font-size: 14.5px; padding: 12px 2px; list-style: none; display: flex; align-items: center; gap: 10px; color: #1c2733; }
.help-sec summary::-webkit-details-marker { display: none; }
.help-sec summary::after { content: "+"; margin-left: auto; color: #0379b6; font-weight: 700; }
.help-sec[open] summary::after { content: "–"; }
.help-no { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; background: #e6f2fa; color: #0379b6; font-size: 12px; font-weight: 700; font-style: normal; flex: none; }
.help-body { padding: 2px 2px 16px 34px; font-size: 13px; line-height: 1.85; color: #33404e; }
.help-body h4 { margin: 12px 0 4px; font-size: 13.5px; color: #0379b6; }
.help-body h4:first-child { margin-top: 0; }
.help-body p, .help-body ol, .help-body ul { margin: 4px 0 8px; }
.help-body ol, .help-body ul { padding-left: 20px; }
.help-body li { margin: 3px 0; }
.help-body b { color: #1c2733; }
.help-stages { background: #f8fafc; border-left: 3px solid #0379b6; padding: 8px 12px; border-radius: 0 8px 8px 0; font-size: 12.5px; line-height: 2; word-break: break-all; }
@media (max-width: 760px) { .help-body { padding-left: 6px; } .help-sec summary { font-size: 14px; } }

/* 报价互动跟进 */
.flw-contact { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border: 1px solid #dde6f0; border-radius: 6px; font-size: 12.5px; cursor: pointer; background: #fff; }
.flw-contact:has(input:checked) { border-color: #0379b6; background: #eaf5fd; color: #026a9e; }
.flw-contact input { margin: 0; }
.flw-note { width: 100%; box-sizing: border-box; border: 1px solid #dde6f0; border-radius: 6px; padding: 8px; font-size: 13px; resize: vertical; }
.flw-item { padding: 7px 9px; margin-bottom: 6px; border-radius: 7px; font-size: 12.5px; }
.flw-item.out { background: #eaf5fd; border-left: 3px solid #0379b6; }
.flw-item.in { background: #f2fbf6; border-left: 3px solid #18a058; }
.flw-meta { color: #667; font-size: 11.5px; margin-bottom: 3px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.flw-text { line-height: 1.6; word-break: break-word; }
