/* ============================================================
   Google 主题（Material Design · 白底 · Google 四色 · Roboto）
   ------------------------------------------------------------
   20261004SIDEBASE：瘦身为纯色板层。
   组件骨架已上移到 theme-base.css（三套共用，只写 var()）。
   本文件只负责：色板 + Google 独有的形状/字族差异。

   激活方式：<html class="theme-google"> + 本文件启用
   ============================================================ */
@import url('https://miaoda.feishu.cn/fonts/css2?family=Roboto:wght@400;500;600;700;900&display=swap');

/* ---------- 色板 ---------- */
:root {
  --bg: #f8f9fa;
  --bg-grad: radial-gradient(900px 500px at 85% -12%, #eaf1fd 0%, transparent 55%), #f8f9fa;
  --card: #ffffff;
  --border: #e0e3e7;
  --border-strong: #d0d4da;
  --text: #202124;
  --text-muted: #5f6368;
  --text-strong: #171717;
  --primary: #1a73e8;
  --primary-dark: #185abc;
  --primary-soft: #e8f0fe;
  --primary-grad: linear-gradient(135deg, #4285f4, #1a73e8);
  --green: #188038;
  --green-soft: #e6f4ea;
  --red: #d93025;
  --red-soft: #fce8e6;
  --amber: #b06000;
  --amber-soft: #fef7e0;
  --th-bg: #f1f3f4;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15);
  --shadow-lg: 0 1px 3px rgba(60, 64, 67, .30), 0 4px 8px 3px rgba(60, 64, 67, .15);
  --c-f1: #4285f4;
  --c-f2: #ea4335;
  --c-f3: #fbbc05;
  --c-f4: #34a853;

  /* ---------- 语义色槽（Google 冷中性灰）---------- */
  --gray-50: #f8f9fa;
  --gray-100: #f1f3f4;
  --gray-200: #e8eaed;
  --gray-400: #bdc1c6;
  --gray-500: #9aa0a6;
  --gray-600: #5f6368;
  --gray-700: #3c4043;
  --gray-800: #202124;
  --gray-900: #171717;
  /* 输入框：Google 白底 */
  --input-fill: #ffffff;
  --input-fill-hover: #f8f9fa;

  /* ---------- 表格（P0：Google 原先漏 td 边框 / KPI 卡背景）---------- */
  --tb-td-border: #f1f3f4;
  --tb-row-hover-bg: #f8f9fa;

  /* ---------- 表单控件（Material 白底 + 灰边）---------- */
  --ctl-border: #d0d4da;
  --ctl-border-hover: #b8bdc4;
  --ctl-radius: 8px;

  /* ---------- 按钮（Material 实心主按钮 + 悬浮阴影）---------- */
  --btn-primary-bg: #1a73e8;
  --btn-primary-bg-hover: #185abc;
  --btn-primary-border: transparent;
  --btn-primary-shadow: 0 1px 2px rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15);
  --btn-primary-shadow-hover: 0 1px 3px rgba(60, 64, 67, .30), 0 4px 8px 3px rgba(60, 64, 67, .15);

  /* ---------- chip ---------- */
  --chip-bar-bg: #f1f3f4;
  --chip-bar-border: #e0e3e7;
  --chip-bar-fg: #3c4043;
  --chip-bar-fg-in: #202124;

  /* ---------- 卡片 / 弹窗（P0：Google 原先漏卡片背景）---------- */
  --card-2-bg: #ffffff;
  --card-2-border: #e0e3e7;
  --modal-bg: #ffffff;
  --modal-border: #e0e3e7;
  /* 旧 theme-google.css:173-177 只改背景/边框/圆角/阴影，未清backdrop-filter，
     故--modal-blur 保持基线毛玻璃 */
  --modal-radius: 18px;
  --modal-head-bg: #f8f9fa;
  --modal-head-border: #e0e3e7;
  --login-card-radius: 18px;

  /* ---------- 侧栏（P0：Google 原先漏侧栏底）---------- */
  --side-bg: #ffffff;
  --side-fg: #202124;
  --side-border: #e0e3e7;
  --side-shadow: 0 1px 2px rgba(60, 64, 67, .10);
  --side-scroll-thumb: #d0d4da;
  --side-scroll-thumb-hover: #b8bdc4;
  --side-item-fg: #3c4043;
  --side-item-bg-hover: #f8f9fa;
  --side-item-fg-hover: #1a73e8;
  --side-item-bg-active: #e8f0fe;
  --side-item-fg-active: #1a73e8;
  --side-item-shadow-active: none;
  --side-item-radius: 24px;
  /* 侧栏文字细腻化（对齐旧版 theme-google.css:313-322 + 361） */
  --side-item-size: 13px;
  --side-item-weight: 400;
  --side-item-ls: .2px;
  --side-item-lh: 1.55;
  --side-item-pad: 10px 16px;
  --side-item-pad-compact: 10px 16px;/* 旧主题以 spec(0,2,0) 压过 index.html:99紧凑态 */
  --side-item-weight-active: 500;

  /* ---------- 顶栏（Material 白卡 + 阴影）---------- */
  --topbar-bg: #ffffff;
  --topbar-border: #e0e3e7;
  --topbar-border-width: 1px;
  --topbar-border-style: solid;     /* 宽度有值但 style 是 none 就不显示，必须显式给 */
  --topbar-radius: var(--radius);
  --topbar-shadow: 0 1px 2px rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15);

  /* ---------- 页签（蓝胶囊）---------- */
  --tab-active-bg: #e8f0fe;
  --tab-active-fg: #1a73e8;
  --ptab-active-bg: #e8f0fe;
  --ptab-active-fg: #1a73e8;
  --tabs-bg: #ffffff;
  --tabs-border: #e0e3e7;
  --tab-fg: #5f6368;
  --tab-ls: .2px;
  --stat-card-radius: var(--radius-md);
  --alert-card-bg: #ffffff;
  --alert-card-border: 1px;
  --alert-card-border-color: #e0e3e7;
  --alert-card-radius: var(--radius);

  /* ---------- 徽标（Google 蓝胶囊）---------- */
  --badge-bg: #e8f0fe;
  --badge-fg: #1a73e8;
  --badge-radius: 20px;
  --badge-pad: 2px 10px;
  /* 原 Google 主题未设徽标字重，保持基线 700（M3 才用 500） */
  --badge-weight: 700;
  /* 原 Google 主题未设徽标字距，--badge-ls 保持基线 normal */

  /* ---------- 卡片与 KPI（Google 原主题用 --radius=14px 圆角）---------- */
  --card-2-radius: var(--radius);
  --kpi-bg: #ffffff;
  --kpi-border: #e0e3e7;
  --kpi-radius: var(--radius);
  /* 强调卡保持基线渐变底 + 白字（--kpi-accent-* 走骨架默认）。
     原主题的 `html.theme-google .kpi{background:#fff}` 高特异性会连 .accent 一起压白，
     造成白字白底内容消失 —— 不复制该副作用。 */
  --kpi-label-fg: #5f6368;
  --kpi-sub-fg: #9aa0a6;

  /* ---------- 按钮 / 弹窗 / 登录卡的中性投影 ---------- */
  --btn-primary-shadow: 0 1px 2px rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15);
  --modal-shadow: 0 24px 60px rgba(32, 33, 36, .22);
  --login-card-border: 1px;
  --login-card-border-color: #e0e3e7;
  --login-card-radius: 18px;
  --login-card-shadow: var(--shadow-lg);

  /* ---------- 表格排印（Material：表头 12/500/0.4，单元格字距 .2）---------- */
  --th-weight: 500;
  --th-ls: .4px;
  --td-ls: .2px;

  /* ---------- 图标描边（Material 2px 圆角）---------- */
  --icon-stroke: 2;
}

/* ---------- Google 独有：字族 ---------- */
html.theme-google {
  font-family: "Roboto", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
}
html.theme-google body { color: var(--text); }
html.theme-google .kpi .k-value,
html.theme-google .kpi-num,
html.theme-google .big-num,
html.theme-google .rpt-kpi-val,
html.theme-google .cm-kpi-val,
html.theme-google .stat-num,
html.theme-google .cm14-kpi .k14-v,
html.theme-google .cm14-kpi .k14-val {
  font-family: "Roboto", "Noto Sans SC", "PingFang SC", sans-serif;
  font-weight: 700;
  letter-spacing: -.3px;
}

/* ---------- Google 独有：白底 logo 融入白侧栏 ---------- */
html.theme-google .side-logo {
  mix-blend-mode: multiply;
  background: transparent;
}

/* ---------- Google 独有：KPI 顶部四色彩条 ---------- */
html.theme-google .kpi {
  position: relative;
  overflow: hidden;
}
html.theme-google .kpi:not(.accent)::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
html.theme-google .kpi-grid .kpi:nth-child(6n+1):not(.accent)::before { background: #4285f4; }
html.theme-google .kpi-grid .kpi:nth-child(6n+2):not(.accent)::before { background: #ea4335; }
html.theme-google .kpi-grid .kpi:nth-child(6n+3):not(.accent)::before { background: #fbbc05; }
html.theme-google .kpi-grid .kpi:nth-child(6n+4):not(.accent)::before { background: #34a853; }
html.theme-google .kpi-grid .kpi:nth-child(6n+5):not(.accent)::before { background: #4285f4; }
html.theme-google .kpi-grid .kpi:nth-child(6n+6):not(.accent)::before { background: #ea4335; }

/* ---------- Google 独有：Material 排印 ---------- */
html.theme-google .topbar-title { font-size: 16px; font-weight: 500; letter-spacing: .15px; }
html.theme-google .filter-bar .chip,
html.theme-google .topbar .chip { font-size: 13px; font-weight: 400; letter-spacing: .25px; }
html.theme-google .process-tab,
html.theme-google .rest-tabs .tab-item,
html.theme-google .rpt-entity-tabs .tab-item,
html.theme-google .alert-tabs .tab-item { font-size: 14px; font-weight: 500; letter-spacing: .2px; }
html.theme-google .table-wrap th,
html.theme-google table th { font-size: 12px; font-weight: 500; letter-spacing: .4px; }
html.theme-google .table-wrap td,
html.theme-google table td { font-size: 13px; font-weight: 400; letter-spacing: .2px; line-height: 1.55; }
html.theme-google .table-wrap .tbl-foot,
html.theme-google .form-tip { font-size: 12px; letter-spacing: .2px; }
/* Google 独有：侧栏行高已收敛为 --side-item-lh 变量槽 */

/* ---------- Google 独有：基础资料图标卡 / 统计卡 / 工具钮 ---------- */
html.theme-google .admin-icon-card { background: #ffffff; border: 1px solid #e2e8f0; }
html.theme-google .admin-icon-card.active {
  background: #e8f0fe;
  border-color: #aecbfa;
  box-shadow: 0 4px 16px rgba(26, 115, 232, .12);
}
html.theme-google .admin-icon-card.active .label { color: #1a73e8; }
html.theme-google .cm-toolbtn {
  background: #ffffff;
  border: 1px solid #d0d4da;
  color: #3c4043;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .25px;
}
html.theme-google .cm-toolbtn:hover {
  background: #e8f0fe;
  border-color: #aecbfa;
  color: #1a73e8;
}
html.theme-google .kpi-group-item { background: #ffffff; border: 1px solid #e0e3e7; }
html.theme-google .kpi-group.production .kpi-group-icon { background: #e8f0fe; }
html.theme-google .kpi-group.efficiency .kpi-group-icon { background: #e6f4ea; }
html.theme-google .kpi-group.quality .kpi-group-icon { background: #fef7e0; }
