/* ==========================================================================
   惠利得 · 京东经营工作台 —— 统一界面样式
   单一样式层，替代 styles.css / workbench.css / refined.css。
   规则：只有一套设计变量；不使用 !important；按“布局 → 组件 → 页面 → 响应式”排列。
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计变量
   -------------------------------------------------------------------------- */
:root{
  /* 色彩 */
  --bg:#f4f5f6;
  --surface:#ffffff;
  --surface-soft:#fafafb;
  --surface-head:#f6f7f8;
  --line:#e6e7ea;
  --line-soft:#eff0f2;
  --zebra:#fbfbfc;

  --ink:#1f2225;          /* 标题 */
  --ink-body:#4a4f55;     /* 正文 */
  --ink-soft:#6b7178;     /* 次要 */
  --muted:#949aa1;        /* 说明 */

  --brand:#3c6ef0;
  --brand-dark:#2a56c6;
  --brand-soft:#edf3ff;
  --brand-line:#c5d9fb;

  --warn:#8a6414;
  --warn-soft:#fdf6e8;
  --danger:#bf2d22;
  --danger-soft:#fdeceb;
  --ok:#17805c;

  /* 尺寸 */
  --nav-w:210px;
  --header-h:54px;
  --radius:8px;
  --radius-sm:6px;
  --radius-lg:10px;

  /* 阴影 */
  --shadow-card:0 1px 2px rgba(0,0,0,.05);
  --shadow-pop:0 12px 32px rgba(0,0,0,.12);

  /* 字体 */
  --font:"Segoe UI","PingFang SC","Microsoft YaHei","Hiragino Sans GB",system-ui,sans-serif;
  --num:"Segoe UI",system-ui,sans-serif;
}

/* --------------------------------------------------------------------------
   2. 基础
   -------------------------------------------------------------------------- */
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;
  font:14px/1.6 var(--font);
  color:var(--ink-body);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{margin:0;color:var(--ink);font-weight:650;line-height:1.35}
p{margin:0}
a{color:inherit;text-decoration:none}
small{font-size:12px}
em{font-style:normal}
b,strong{font-weight:650}
button,input,select,textarea{font:inherit;color:inherit}
button,a{-webkit-tap-highlight-color:transparent}
svg{fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
::selection{background:var(--brand-soft);color:var(--brand-dark)}

/* 滚动条（表格与长列表） */
*{scrollbar-width:thin;scrollbar-color:#ccd0d5 transparent}
::-webkit-scrollbar{width:9px;height:9px}
::-webkit-scrollbar-thumb{background:#d0d3d8;border-radius:6px;border:2px solid transparent;background-clip:content-box}
::-webkit-scrollbar-thumb:hover{background:#bcc0c6;background-clip:content-box}
::-webkit-scrollbar-track{background:transparent}

/* --------------------------------------------------------------------------
   3. 表单控件
   -------------------------------------------------------------------------- */
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),
select,textarea{
  width:100%;
  height:38px;
  padding:0 11px;
  font-size:13px;
  color:var(--ink);
  background:var(--surface);
  border:1px solid #dcdee2;
  border-radius:var(--radius-sm);
  transition:border-color .15s,box-shadow .15s;
}
textarea{height:auto;padding:10px 11px;line-height:1.7;resize:vertical}
select{
  appearance:none;
  padding-right:30px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%2366788b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 11px center;
  background-size:11px;
  cursor:pointer;
}
input:hover:not(:disabled),select:hover:not(:disabled){border-color:#c3c7cc}
input:focus,select:focus,textarea:focus{
  outline:none;
  border-color:var(--brand);
  box-shadow:0 0 0 3px rgba(60,110,240,.18);
}
input:disabled,select:disabled,textarea:disabled{
  background:var(--surface-soft);
  color:var(--muted);
  cursor:not-allowed;
  border-color:var(--line);
}
input[type=checkbox]{
  width:16px;height:16px;margin:0;
  accent-color:var(--brand);
  cursor:pointer;
  vertical-align:-3px;
}
input[type=date]{min-width:0}
::placeholder{color:#adb2b8}

/* 按钮 */
button,.export-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  height:38px;
  padding:0 16px;
  font-size:13px;
  font-weight:600;
  color:var(--ink-body);
  background:var(--surface);
  border:1px solid #dcdee2;
  border-radius:var(--radius-sm);
  cursor:pointer;
  white-space:nowrap;
  transition:background .15s,border-color .15s,color .15s;
}
button:hover:not(:disabled),.export-link:hover{
  border-color:var(--brand-line);
  background:var(--brand-soft);
  color:var(--brand-dark);
}
button:disabled{opacity:.45;cursor:not-allowed}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{
  outline:2px solid var(--brand);
  outline-offset:2px;
}
.primary,.export-link{
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
}
.primary:hover:not(:disabled),.export-link:hover{
  background:var(--brand-dark);
  border-color:var(--brand-dark);
  color:#fff;
}
button.small,.small{height:30px;padding:0 11px;font-size:12px;font-weight:600;border-radius:6px}
.text-button{height:auto;padding:0;border:0;background:none;color:var(--brand);font-weight:600}
.text-button:hover{background:none;text-decoration:underline}

/* --------------------------------------------------------------------------
   4. 页面骨架：侧栏 / 顶栏 / 内容区
   -------------------------------------------------------------------------- */
body>aside{
  position:fixed;
  inset:0 auto 0 0;
  z-index:30;
  display:flex;
  flex-direction:column;
  width:var(--nav-w);
  padding:20px 12px 14px;
  background:var(--surface);
  border-right:1px solid var(--line);
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  padding:0 8px 18px;
  margin-bottom:4px;
  border-bottom:1px solid var(--line-soft);
  color:var(--ink);
  font-size:16px;
  font-weight:700;
}
.brand>b{
  display:grid;
  place-items:center;
  flex:none;
  width:34px;height:34px;
  background:var(--brand);
  color:#fff;
  border-radius:9px;
  font-size:16px;
}
.brand>span{display:block;line-height:1.25}
.subbrand{display:block;margin-top:3px;font-size:10px;font-weight:500;color:var(--muted);letter-spacing:.2px;white-space:nowrap}
/* JD 角标移到第二行，和副标题同排，不再占「惠利得」那一行 */
.subbrand small{
  display:inline-block;
  margin-right:6px;
  padding:0 5px;
  font-size:9.5px;
  font-weight:700;
  line-height:15px;
  color:var(--brand);
  background:var(--brand-soft);
  border:1px solid var(--brand-line);
  border-radius:3px;
  vertical-align:1px;
}
.nav-caption{
  margin:16px 12px 8px;
  font-size:10px;
  font-weight:600;
  letter-spacing:1.4px;
  color:#99a0a7;
}
body>aside nav{display:grid;gap:2px;overflow:auto}
body>aside nav a{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 11px;
  border-radius:8px;
  font-size:13px;
  font-weight:500;
  color:var(--ink-soft);
  transition:background .12s,color .12s;
}
body>aside nav a:hover{background:var(--surface-soft);color:var(--ink)}
body>aside nav a.active{background:var(--brand-soft);color:var(--brand-dark);font-weight:650}
.nav-symbol{flex:none;display:grid;place-items:center;width:18px;height:18px;opacity:.8}
.nav-symbol svg{width:17px;height:17px;stroke-width:1.7}
body>aside nav a.active .nav-symbol{opacity:1}

.side-foot{
  margin-top:auto;
  padding:14px 10px 0;
  border-top:1px solid var(--line-soft);
  font-size:11px;
  line-height:1.8;
  color:var(--muted);
}
.side-foot>a{display:block;margin-bottom:8px;color:var(--ink-soft);font-weight:500}
.side-foot>a:hover{color:var(--brand)}
.side-foot p{margin:8px 0 6px;color:#99a0a7}
.side-foot>small{font-size:9px;letter-spacing:1.2px;color:#acb2b9}
.edition{
  display:inline-block;
  padding:2px 7px;
  font-size:10px;
  color:var(--brand);
  background:var(--brand-soft);
  border-radius:4px;
}

body>main{
  display:flex;
  flex-direction:column;
  min-height:100vh;
  margin-left:var(--nav-w);
}
body>main>header{
  position:sticky;
  top:0;
  z-index:20;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  height:var(--header-h);
  padding:0 26px;
  background:rgba(255,255,255,.92);
  backdrop-filter:saturate(1.4) blur(8px);
  border-bottom:1px solid var(--line);
  font-size:12px;
  color:var(--muted);
}
body>main>header strong{color:var(--ink);font-weight:600}
body>main>header em{margin:0 8px;color:#d1d5da}
.header-right{display:flex;align-items:center;gap:8px;white-space:nowrap}
.header-right i{width:6px;height:6px;background:var(--ok);border-radius:50%;flex:none}
.avatar{
  display:grid;place-items:center;
  width:28px;height:28px;margin-left:6px;
  background:var(--brand-soft);color:var(--brand-dark);
  border-radius:50%;font-size:12px;font-weight:650;
}
/* 多标签工作区（聚水潭式）：打开过的页面停靠在顶栏下方，可切换、可关闭 */
#page-tabs{
  position:sticky;
  top:var(--header-h);
  z-index:19;
  display:flex;
  align-items:stretch;
  gap:0;
  height:36px;
  padding:0 12px;
  overflow-x:auto;
  overflow-y:hidden;
  background:var(--surface-soft);
  border-bottom:1px solid var(--line);
  scrollbar-width:none;
}
#page-tabs::-webkit-scrollbar{display:none}
#page-tabs:empty{display:none}
#page-tabs .tab{
  position:relative;
  display:inline-flex;
  align-items:center;
  gap:4px;
  flex:none;
  height:100%;
  padding:0 8px 0 13px;
  border-right:1px solid var(--line);
  font-size:13px;
  color:var(--ink-soft);
  white-space:nowrap;
  transition:background .12s,color .12s;
}
#page-tabs .tab:first-child{border-left:1px solid var(--line)}
#page-tabs .tab>a{display:inline-flex;align-items:center;height:100%}
#page-tabs .tab:hover{background:#eff1f3;color:var(--ink)}
#page-tabs .tab.active{
  background:var(--surface);
  color:var(--brand-dark);
  font-weight:650;
}
#page-tabs .tab.active::after{
  content:"";
  position:absolute;
  inset:auto 0 -1px 0;
  height:2px;
  background:var(--brand);
}
#page-tabs .tab-home{
  width:6px;height:6px;
  border-radius:50%;
  background:#c3c7cc;
  margin-left:3px;
}
#page-tabs .tab.active .tab-home{background:var(--brand)}
#page-tabs .tab-close{
  display:grid;
  place-items:center;
  width:18px;height:18px;
  padding:0;
  font-size:14px;
  line-height:1;
  color:#a5abb2;
  background:none;
  border:0;
  border-radius:4px;
}
#page-tabs .tab-close:hover{background:#e3e5e9;color:var(--danger)}
#page-tabs .tab-clear{
  flex:none;
  height:24px;
  align-self:center;
  margin:0 0 0 auto;
  padding:0 10px;
  font-size:11.5px;
  font-weight:500;
  color:var(--muted);
  background:none;
  border:1px solid var(--line);
}
#page-tabs .tab-clear:hover{background:var(--surface);color:var(--ink-soft);border-color:#d7dade}

#content{
  flex:1;
  width:100%;
  max-width:none;
  padding:16px 20px 30px;
}
body>main>footer,#content>footer{
  padding:16px 26px 22px;
  font-size:11px;
  color:#a5abb2;
}
body>main>footer span{margin-left:10px}

/* 页面标题 */
.heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin-bottom:12px;
}
.heading h1{margin:0 0 2px;font-size:19px;font-weight:700;letter-spacing:-.2px}
.heading p{font-size:12.5px;color:var(--muted)}
.eyebrow{display:none}

/* --------------------------------------------------------------------------
   5. 面板 / 卡片
   -------------------------------------------------------------------------- */
.panel{
  margin-bottom:14px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-card);
  overflow:hidden;
}
.panel-head{
  display:flex;
  align-items:center;
  gap:12px;
  padding:11px 18px;
  border-bottom:1px solid var(--line-soft);
  background:var(--surface);
}
.panel-head h2{flex:none;font-size:14px;font-weight:650}
.panel-head>span,.panel-head>small{font-size:12px;color:var(--muted);font-weight:400}
.panel-head>a{margin-left:auto;font-size:12px;font-weight:600;color:var(--brand)}
.panel-head>a:hover{text-decoration:underline}
.panel-head>button,.panel-head>div{margin-left:auto}
.panel-head>div{display:flex;gap:8px}
.panel-head .pill{margin-left:auto}
.panel-head h2 small{margin-left:6px;font-weight:400;color:var(--muted)}

.panel>p,.panel>div:not([class]){padding:0}
.service-note{
  padding:10px 18px;
  font-size:12px;
  line-height:1.8;
  color:var(--muted);
  background:var(--surface-soft);
  border-top:1px solid var(--line-soft);
}
.explain{
  margin:10px 2px 18px;
  font-size:12px;
  line-height:1.8;
  color:var(--muted);
}
.chart-note{
  padding:10px 20px 14px;
  font-size:11.5px;
  line-height:1.8;
  color:#99a0a7;
}

/* 提示条 */
.notice{
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  gap:6px 12px;
  margin-bottom:14px;
  padding:12px 16px;
  font-size:12.5px;
  color:var(--ink-soft);
  background:var(--surface);
  border:1px solid var(--line);
  border-left:3px solid var(--brand);
  border-radius:var(--radius);
}
.notice b{color:var(--ink);font-size:13px}
.notice a{color:var(--brand);font-weight:600}
.notice a:hover{text-decoration:underline}

/* 标签 */
.pill{
  display:inline-flex;
  align-items:center;
  padding:2px 9px;
  font-size:11.5px;
  font-weight:600;
  color:var(--ink-soft);
  background:var(--surface-head);
  border:1px solid var(--line);
  border-radius:20px;
  white-space:nowrap;
}
.pill.green{color:var(--ok);background:#e9f6ef;border-color:#cfe9dc}
.error-text{color:var(--danger)}

/* 空状态 */
.empty{
  display:grid;
  place-items:center;
  gap:6px;
  padding:48px 24px;
  text-align:center;
}
.empty-icon{
  display:grid;place-items:center;
  width:44px;height:44px;margin-bottom:4px;
  font-size:19px;color:#acb2b9;
  background:var(--surface-soft);
  border:1px solid var(--line);
  border-radius:12px;
}
.empty h3{font-size:14.5px;color:var(--ink-soft)}
.empty p{max-width:420px;font-size:12.5px;color:var(--muted)}

/* 加载态 */
.board-loading{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:56px 20px;
  font-size:13px;
  color:var(--muted);
}
.board-loading::before{
  content:"";
  width:15px;height:15px;
  border:2px solid var(--brand-line);
  border-top-color:var(--brand);
  border-radius:50%;
  animation:spin .7s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* --------------------------------------------------------------------------
   6. 筛选区：类目三级联动 / 工具栏 / 表单字段
   -------------------------------------------------------------------------- */
.category-selector-block{
  padding:13px 18px;
  background:var(--surface-soft);
  border-bottom:1px solid var(--line-soft);
}
.category-cascade{
  display:grid;
  grid-template-columns:repeat(3,minmax(170px,260px));
  justify-content:start;
  gap:12px;
  padding:13px 18px;
  background:var(--surface-soft);
  border-bottom:1px solid var(--line-soft);
}
.category-selector-block .category-cascade{padding:0;background:none;border:0}
.category-cascade label{
  display:grid;
  gap:6px;
  min-width:0;
  font-size:12px;
  font-weight:600;
  color:var(--ink-soft);
}
.category-cascade select{height:36px;font-size:13px}

.toolbar{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
  padding:10px 18px;
  background:var(--surface);
  border-bottom:1px solid var(--line-soft);
}
.toolbar:last-child{border-bottom:0}
.toolbar>span{font-size:12px;color:var(--muted)}
.toolbar input,.toolbar select{width:auto;min-width:180px}
.toolbar input[type=checkbox]{min-width:0}
#result-run,#trend-job-picker{flex:0 1 400px;min-width:220px}
#keyword-search,#board-search,#category-search{flex:0 1 250px;min-width:170px}

.task-fields{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  gap:12px;
  padding:13px 18px;
}
.task-fields label{
  display:grid;
  gap:6px;
  flex:1 1 190px;
  min-width:0;
  font-size:12px;
  font-weight:600;
  color:var(--ink-soft);
}
.task-fields label>button{width:100%}
.task-fields>button{flex:none}
.task-fields>div{flex:1 1 100%}

.file-pick{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:9px 14px;
  font-size:13px;
  font-weight:600;
  color:var(--brand-dark);
  background:var(--brand-soft);
  border:1px dashed var(--brand-line);
  border-radius:var(--radius-sm);
  cursor:pointer;
}
.file-pick input{display:none}

/* --------------------------------------------------------------------------
   7. 表格
   -------------------------------------------------------------------------- */
.table-wrap{
  width:100%;
  overflow:auto;
  background:var(--surface);
}
.table-wrap table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  font-variant-numeric:tabular-nums;
}
.table-wrap th{
  position:sticky;
  top:0;
  z-index:2;
  padding:8px 13px;
  font-size:12px;
  font-weight:600;
  color:var(--ink-soft);
  text-align:left;
  white-space:nowrap;
  background:var(--surface-head);
  border-bottom:1px solid var(--line);
}
.table-wrap td{
  padding:7px 13px;
  font-size:13px;
  color:var(--ink-body);
  border-bottom:1px solid var(--line-soft);
  vertical-align:middle;
}
/* 竖向网格线：宽屏下让每列数据不再飘 */
.table-wrap th+th,.table-wrap td+td{border-left:1px solid var(--line-soft)}
.table-wrap tbody tr:nth-child(2n) td{background:var(--zebra)}
.table-wrap tbody tr:last-child td{border-bottom:0}
.table-wrap td b{color:var(--ink);font-weight:600}
.cell-sub{
  display:block;
  margin-top:1px;
  font-size:11.5px;
  color:var(--muted);
  font-weight:400;
}
.table-foot,.detail-pagination{
  display:flex;
  align-items:center;
  gap:10px;
  padding:9px 18px;
  font-size:12px;
  color:var(--muted);
  background:var(--surface);
  border-top:1px solid var(--line-soft);
}
.detail-pagination button{margin-left:auto}
.detail-pagination button+button{margin-left:0}
.table-wrap td button.small{vertical-align:middle}
.table-wrap progress{width:90px;height:5px;margin-left:8px;vertical-align:middle}

/* 排序表头按钮 */
.result-sort{
  height:auto;padding:0;
  font-size:12px;font-weight:600;
  color:var(--ink-soft);
  background:none;border:0;
}
.result-sort:hover{background:none;color:var(--brand)}

/* 关键词按钮 */
.keyword-link,.metric-link,.spark-link{
  height:auto;padding:0;
  background:none;border:0;
  color:var(--brand);
  font-weight:600;
}
.keyword-link:hover,.metric-link:hover{background:none;text-decoration:underline}
.metric-link{color:var(--ink);font-variant-numeric:tabular-nums}
.spark-link{display:block;width:100%}
.spark-link:hover{background:none}

/* 关键词结果表：首列与表头固定 */
#result-table .table-wrap,#board-table .table-wrap{max-height:calc(100vh - 330px);min-height:240px}
#result-table th:first-child,#result-table td:first-child,
.keyword-board th:first-child,.keyword-board td:first-child{
  position:sticky;
  left:0;
  z-index:1;
  min-width:160px;
  background:var(--surface);
  border-right:1px solid var(--line-soft);
}
#result-table th:first-child,.keyword-board th:first-child{z-index:3;background:var(--surface-head)}
#result-table tbody tr:nth-child(2n) td:first-child,
.keyword-board tbody tr:nth-child(2n) td:first-child{background:var(--zebra)}
.table-wrap tbody tr:hover td,
.table-wrap tbody tr:hover td:first-child{background:#f4f8ff}

/* 类目管理表：固定列宽，长表格独立滚动 */
#category-list .table-wrap{max-height:calc(100vh - 340px);min-height:260px}
#category-list th:first-child,#category-list td:first-child{width:80px;text-align:center;color:var(--muted)}
#category-list th:nth-child(2),#category-list td:nth-child(2){width:160px}
#category-list th:nth-child(3),#category-list td:nth-child(3){width:190px}
#category-list th:nth-child(4),#category-list td:nth-child(4){width:210px;color:var(--ink);font-weight:600}
#category-list th:nth-child(5),#category-list td:nth-child(5){width:170px}
#category-list .id-cell{font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
#category-list .path-cell{color:var(--ink-soft);white-space:nowrap}
/* 窄屏：路径列与 ID 列是宽屏补充信息，挤不下就收起，不要撑高行 */
@media(max-width:1320px){#category-list th:nth-child(6),#category-list td:nth-child(6){display:none}}
@media(max-width:1060px){#category-list th:nth-child(5),#category-list td:nth-child(5){display:none}}
#category-list .path-cell i{margin:0 7px;color:#d1d5da;font-style:normal}
#category-list .toolbar{border-top:1px solid var(--line-soft);border-bottom:0;background:var(--surface-soft)}
#category-list .toolbar>span{margin-right:auto}

/* --------------------------------------------------------------------------
   8. 概览页
   -------------------------------------------------------------------------- */
.metrics{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:14px;
  margin-bottom:18px;
}
.metric{
  display:grid;
  gap:3px;
  padding:16px 18px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-card);
}
.metric>span{font-size:12px;color:var(--ink-soft);font-weight:500}
.metric strong{
  font-family:var(--num);
  font-size:27px;
  font-weight:700;
  line-height:1.25;
  color:var(--ink);
  letter-spacing:-.5px;
}
.metric small{font-size:11.5px;color:var(--muted)}

.grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(340px,1fr));
  gap:18px;
  align-items:start;
}
.grid .panel{margin-bottom:0}

.steps{padding:6px 0}
.step{
  display:flex;
  align-items:center;
  gap:14px;
  padding:14px 20px;
  border-bottom:1px solid var(--line-soft);
}
.step:last-child{border-bottom:0}
.step .number{
  display:grid;place-items:center;
  flex:none;width:30px;height:30px;
  font-size:12px;font-weight:700;
  color:var(--brand-dark);
  background:var(--brand-soft);
  border-radius:9px;
}
.step>div{flex:1;min-width:0}
.step b{display:block;font-size:13.5px;color:var(--ink)}
.step p{margin-top:2px;font-size:12px;color:var(--muted)}

.service{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 20px;
  border-bottom:1px solid var(--line-soft);
}
.service>div{flex:1;min-width:0}
.service b{font-size:13.5px;color:var(--ink)}
.service p{margin-top:2px;font-size:12px;color:var(--muted)}

/* --------------------------------------------------------------------------
   9. 账号页
   -------------------------------------------------------------------------- */
.import-area{padding:20px}
.import-area h2{font-size:16px;margin-bottom:4px}
.import-area>p{margin-bottom:8px;font-size:13px;color:var(--ink-soft)}
.import-area .explain{margin:6px 0 14px}
.import-area .toolbar{
  padding:14px 0 4px;
  background:none;
  border:0;
}
.import-area textarea{margin-bottom:4px}
.import-area #batch-results p{
  padding:8px 0;
  font-size:13px;
  border-bottom:1px solid var(--line-soft);
}
details.panel>summary,.collection-settings>summary{
  display:flex;
  align-items:center;
  gap:10px;
  padding:14px 20px;
  font-size:14px;
  font-weight:650;
  color:var(--ink);
  cursor:pointer;
  list-style:none;
}
details.panel>summary::-webkit-details-marker,
.collection-settings>summary::-webkit-details-marker{display:none}
details.panel>summary::before,.collection-settings>summary::before{
  content:"›";
  display:inline-block;
  font-size:17px;
  color:var(--muted);
  transition:transform .18s;
}
details[open]>summary::before{transform:rotate(90deg)}
.collection-settings>summary span{font-size:12px;font-weight:400;color:var(--muted)}
.collection-settings{
  margin-bottom:18px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-card);
  overflow:hidden;
}
.collection-settings[open]>summary{border-bottom:1px solid var(--line-soft)}
.collection-settings .panel{
  margin:0;
  border:0;
  border-bottom:1px solid var(--line-soft);
  border-radius:0;
  box-shadow:none;
}
.collection-settings .panel:last-child{border-bottom:0}

/* --------------------------------------------------------------------------
   10. 关键词看板（趋势页主视图）
   -------------------------------------------------------------------------- */
.research-board{padding:0}
.research-heading{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
  padding:20px 20px 16px;
  border-bottom:1px solid var(--line-soft);
}
.research-kicker{
  display:block;
  margin-bottom:6px;
  font-size:10.5px;
  font-weight:700;
  letter-spacing:1.4px;
  color:var(--brand);
}
.research-heading h2{font-size:20px;font-weight:700}
.research-heading p{margin-top:5px;font-size:12.5px;color:var(--muted)}
.research-heading i{margin:0 6px;color:#d1d5da;font-style:normal}
.research-export{flex:none}

.metric-switches{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding:14px 20px;
  background:var(--surface-soft);
  border-bottom:1px solid var(--line-soft);
}
.metric-switches button{height:34px;font-size:12.5px}
.metric-switches button.selected{
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
}
.board-controls{background:var(--surface)}
.board-controls>span{
  flex:1 1 200px;
  font-size:12px;
  color:var(--muted);
}

.keyword-board{min-width:720px}
.keyword-board th,.keyword-board td{padding:10px 13px;font-size:12.5px}
.keyword-board th.year-group{
  text-align:center;
  color:var(--brand-dark);
  background:var(--brand-soft);
  border-bottom:1px solid var(--brand-line);
}
.keyword-board thead tr:nth-child(2) th{top:37px}
.board-spark{width:110px;height:28px;display:block}
.board-spark line{stroke-linecap:round}

/* 关键词详情弹层 */
#board-detail:not([hidden]){
  position:fixed;
  inset:4vh 4vw;
  z-index:60;
  display:flex;
  flex-direction:column;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-pop);
  overflow:auto;
}
#board-detail>.panel-head{
  position:sticky;
  top:0;
  z-index:5;
  border-bottom:1px solid var(--line);
}
#board-detail>.panel-head button{margin-left:auto}

/* --------------------------------------------------------------------------
   11. 单词趋势分析
   -------------------------------------------------------------------------- */
.trend-layout{
  display:grid;
  grid-template-columns:236px minmax(0,1fr);
  align-items:start;
}
#board-detail .trend-layout{grid-template-columns:minmax(0,1fr)}
.keyword-browser{
  border-right:1px solid var(--line-soft);
  background:var(--surface-soft);
}
.keyword-search{
  display:grid;
  gap:8px;
  padding:14px;
  border-bottom:1px solid var(--line-soft);
}
.keyword-search label{
  display:flex;
  align-items:center;
  gap:7px;
  font-size:12px;
  color:var(--ink-soft);
}
#trend-word-list{max-height:560px;overflow:auto;padding:6px}
.keyword-count{
  padding:6px 8px;
  font-size:11px;
  color:var(--muted);
}
.keyword-row{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:8px;
  width:100%;
  height:auto;
  padding:8px 10px;
  margin-bottom:2px;
  text-align:left;
  background:none;
  border:0;
  border-radius:7px;
  font-weight:500;
}
.keyword-row b{font-size:13px;font-weight:600;color:var(--ink-body)}
.keyword-row small{font-size:11px;color:var(--muted)}
.keyword-row:hover{background:var(--surface)}
.keyword-row.chosen{background:var(--brand-soft)}
.keyword-row.chosen b{color:var(--brand-dark)}

.trend-analysis{min-width:0;padding:0 0 6px}
.analysis-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:16px 20px;
  border-bottom:1px solid var(--line-soft);
}
.analysis-heading h2{font-size:18px}
.analysis-heading p{margin-top:3px;font-size:12px;color:var(--muted)}

.trend-range{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
  padding:13px 20px;
  background:var(--surface-soft);
  border-bottom:1px solid var(--line-soft);
}
.range-shortcuts{display:flex;gap:6px}
.range-shortcuts button{height:32px;padding:0 12px;font-size:12px}
.trend-range label{
  display:flex;
  align-items:center;
  gap:7px;
  font-size:12px;
  color:var(--ink-soft);
}
.trend-range input[type=date]{width:145px;height:34px}
.trend-range select{width:auto;min-width:160px;height:34px}

/* 核心指标卡 */
.core-metrics{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  gap:12px;
  padding:16px 20px;
}
.core-metric{
  display:grid;
  gap:3px;
  height:auto;
  padding:13px 15px;
  text-align:left;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  font-weight:500;
}
.core-metric>span{font-size:12px;color:var(--ink-soft)}
.core-metric strong{
  font-size:22px;
  font-weight:700;
  color:var(--ink);
  font-variant-numeric:tabular-nums;
}
.core-metric small{font-size:11px;color:var(--muted)}
.core-metric:hover{border-color:var(--brand-line);background:var(--brand-soft)}
.core-metric.current{border-color:var(--brand);background:var(--brand-soft)}
.core-metric.current strong{color:var(--brand-dark)}

/* 多指标网格 */
.multi-heading{padding:6px 20px 0}
.multi-heading h3{font-size:15px}
.multi-heading p{margin-top:4px;font-size:11.5px;line-height:1.8;color:var(--muted)}
.metric-checks{
  display:flex;
  flex-wrap:wrap;
  gap:8px 14px;
  padding:12px 20px;
}
.metric-checks label{
  display:flex;
  align-items:center;
  gap:6px;
  font-size:12px;
  color:var(--ink-soft);
  cursor:pointer;
}
.multi-grid{
  display:grid;
  grid-template-columns:repeat(var(--plot-columns,2),minmax(0,1fr));
  gap:14px;
  padding:0 20px 16px;
}
.analysis-plot{
  display:flex;
  flex-direction:column;
  min-width:0;
  height:260px;
  padding:12px 14px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
}
.plot-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:6px;
}
.plot-heading h4{display:flex;align-items:center;gap:7px;font-size:13px}
.plot-heading h4 i{width:9px;height:9px;border-radius:3px;flex:none}
.plot-heading div{display:flex;gap:6px;opacity:0;transition:opacity .15s}
.analysis-plot:hover .plot-heading div,.analysis-plot.expanded .plot-heading div{opacity:1}
.plot-heading button{height:26px;padding:0 9px;font-size:11.5px}
.plot-svg{flex:1;min-height:0;cursor:crosshair}
.plot-svg svg{width:100%;height:100%;display:block}
.plot-value{
  display:flex;
  align-items:baseline;
  gap:8px;
  padding-top:6px;
  font-size:12px;
  color:var(--muted);
  border-top:1px solid var(--line-soft);
}
.plot-value strong{font-size:15px;color:var(--ink)}
.analysis-plot.expanded{
  position:fixed;
  inset:6vh 6vw;
  z-index:70;
  height:auto;
  box-shadow:var(--shadow-pop);
}
.multi-date{padding:0 20px 12px;font-size:12px;color:var(--muted)}

/* 单指标精细查看 */
.single-analysis,.daily-details{
  margin:0 20px 16px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  overflow:hidden;
}
.single-analysis>summary,.daily-details>summary{
  display:flex;
  align-items:center;
  gap:8px;
  padding:12px 16px;
  font-size:13px;
  font-weight:650;
  color:var(--ink);
  cursor:pointer;
  list-style:none;
}
.single-analysis>summary::-webkit-details-marker,
.daily-details>summary::-webkit-details-marker{display:none}
.single-analysis>summary::before,.daily-details>summary::before{
  content:"›";font-size:16px;color:var(--muted);transition:transform .18s;
}
.single-analysis[open]>summary::before,.daily-details[open]>summary::before{transform:rotate(90deg)}
.daily-details>summary span{font-weight:400;color:var(--muted);font-size:12px}
.chart-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:0 16px 10px;
}
.chart-bar h3{font-size:14px}
.chart-bar select{width:auto;min-width:170px;height:34px}
.jd-chart{padding:0 10px}
.jd-chart svg{width:100%;height:auto;display:block;font-size:11px;fill:var(--muted);stroke:none}
.jd-chart svg text{fill:var(--muted)}
.chart-reading{
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  gap:6px 14px;
  padding:8px 16px;
  font-size:12px;
  color:var(--muted);
}
.chart-reading b{color:var(--ink)}
.chart-reading strong{font-size:16px;color:var(--brand-dark)}
.point-slider{
  width:calc(100% - 32px);
  margin:2px 16px 8px;
  accent-color:var(--brand);
}

/* 嵌入式子页面（远程采集）：与内容区同底色，高度由子页面上报 */
.embed-frame{display:block;width:100%;min-height:420px;border:0;background:transparent;overflow:hidden}

/* 需要客户端的功能：网页上给出下载引导，而不是直接藏起来 */
.gate{margin-bottom:18px}
.gate-body{max-width:640px;margin:0 auto;padding:44px 24px 40px;text-align:center}
.gate-mark{display:grid;place-items:center;width:52px;height:52px;margin:0 auto 16px;font-size:22px;color:var(--brand);background:var(--brand-soft);border:1px solid var(--brand-line);border-radius:15px}
.gate-body h2{font-size:19px;margin-bottom:8px}
.gate-lead{font-size:13px;line-height:1.8;color:var(--muted)}
.gate-reasons{display:grid;gap:10px;margin:22px 0;text-align:left}
.gate-reasons>div{padding:13px 16px;background:var(--surface-soft);border:1px solid var(--line);border-radius:var(--radius)}
.gate-reasons b{display:block;margin-bottom:4px;font-size:13px;color:var(--ink)}
.gate-reasons span{font-size:12.5px;line-height:1.8;color:var(--ink-soft)}
.gate-body .export-link{height:42px;padding:0 26px;font-size:14px}
.gate-foot{margin:14px 0 0}
.nav-tag{margin-left:auto;padding:1px 6px;font-size:10px;font-style:normal;font-weight:600;color:var(--muted);background:var(--surface-head);border:1px solid var(--line);border-radius:4px}
body>aside nav a.active .nav-tag{color:var(--brand-dark);background:var(--surface);border-color:var(--brand-line)}

/* 本地上货：整条链的进度指示 */
.pipeline{display:flex;flex-wrap:wrap;gap:8px;margin:0;padding:16px 18px;list-style:none;counter-reset:step}
.pipeline li{flex:1 1 150px;min-width:0;position:relative;padding:11px 13px;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface-soft)}
.pipeline li:before{counter-increment:step;content:counter(step);display:grid;place-items:center;width:20px;height:20px;margin-bottom:7px;font-size:11px;font-weight:700;border-radius:6px;color:var(--muted);background:var(--surface);border:1px solid var(--line)}
.pipeline li b{display:block;font-size:13px;color:var(--ink)}
.pipeline li span{display:block;margin-top:2px;font-size:11.5px;line-height:1.6;color:var(--muted)}
.pipeline li.done{background:var(--brand-soft);border-color:var(--brand-line)}
.pipeline li.done:before{content:"¹3";color:#fff;background:var(--brand);border-color:var(--brand)}
.pipeline li.done b{color:var(--brand-dark)}
.pipeline li.todo{border-style:dashed}
.pipeline li.todo b{color:var(--ink-soft)}
@media(max-width:680px){.pipeline{padding:14px}.pipeline li{flex:1 1 100%}}

/* --------------------------------------------------------------------------
   12. 登录 / 弹窗 / 提示
   -------------------------------------------------------------------------- */
#login-overlay{
  position:fixed;
  inset:0;
  z-index:100;
  display:grid;
  place-items:center;
  padding:20px;
  background:linear-gradient(160deg,#f6f7f8,#edeef1);
}
.login-card{
  width:100%;
  max-width:370px;
  display:grid;
  gap:14px;
  padding:32px 30px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow:0 18px 44px rgba(0,0,0,.1);
}
.login-card .eyebrow{
  display:block;
  font-size:10px;
  font-weight:700;
  letter-spacing:1.6px;
  color:var(--brand);
}
.login-card h1{margin:-6px 0 4px;font-size:22px}
.login-jd{
  display:inline-block;
  padding:1px 7px;
  font-size:12px;
  color:#fff;
  background:var(--brand);
  border-radius:5px;
  vertical-align:3px;
}
.login-card label{display:grid;gap:6px;font-size:12px;font-weight:600;color:var(--ink-soft)}
.login-card input{height:40px}
.login-card button{height:42px;margin-top:4px}
.login-card .error-text{min-height:16px;font-size:12px}

dialog#editor{
  width:min(420px,92vw);
  padding:0;
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-pop);
  color:var(--ink-body);
}
dialog#editor::backdrop{background:rgba(0,0,0,.35)}
#edit-form{display:grid;gap:12px;padding:20px}
.dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.dialog-head h2{font-size:16px}
#close-dialog{width:30px;height:30px;padding:0;font-size:17px;border:0;background:none;color:var(--muted)}
#edit-form label{display:grid;gap:6px;font-size:12px;font-weight:600;color:var(--ink-soft)}
#edit-form>p{font-size:12.5px;color:var(--muted)}
#form-error{color:var(--danger);font-size:12px;min-height:0}
.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:4px}

#toast{
  position:fixed;
  left:50%;
  bottom:26px;
  z-index:200;
  transform:translate(-50%,14px);
  max-width:min(560px,90vw);
  padding:11px 20px;
  font-size:13px;
  color:#fff;
  background:#2b2e33;
  border-radius:10px;
  box-shadow:var(--shadow-pop);
  opacity:0;
  pointer-events:none;
  transition:opacity .2s,transform .2s;
}
#toast.visible{opacity:1;transform:translate(-50%,0)}

/* --------------------------------------------------------------------------
   13. 响应式
   -------------------------------------------------------------------------- */
@media(max-width:1180px){
  .trend-layout{grid-template-columns:200px minmax(0,1fr)}
  .multi-grid{grid-template-columns:repeat(min(var(--plot-columns,2),2),minmax(0,1fr))}
}

@media(max-width:960px){
  :root{--nav-w:180px}
  #content{padding:20px 16px 32px}
  body>main>header{padding:0 16px}
  .heading h1{font-size:21px}
  .category-cascade{grid-template-columns:1fr 1fr}
  .trend-layout{grid-template-columns:minmax(0,1fr)}
  .keyword-browser{border-right:0;border-bottom:1px solid var(--line-soft)}
  #trend-word-list{max-height:240px}
}

@media(max-width:680px){
  body>aside{
    position:sticky;
    inset:auto;
    width:100%;
    height:auto;
    padding:10px 12px;
    border-right:0;
    border-bottom:1px solid var(--line);
  }
  .brand{padding:0 4px 10px;margin-bottom:0}
  .nav-caption,.side-foot{display:none}
  body>aside nav{
    display:flex;
    gap:4px;
    margin-top:10px;
    overflow-x:auto;
    padding-bottom:2px;
  }
  body>aside nav a{flex:none;padding:8px 11px;font-size:12.5px}
  body>main{margin-left:0}
  body>main>header{height:48px;padding:0 14px;font-size:11.5px}
  #page-tabs{height:36px;padding:0 6px;top:48px}
  #page-tabs .tab{padding:0 6px 0 11px;font-size:12.5px}
  #page-tabs .tab-clear{display:none}
  .avatar{display:none}
  #content{padding:16px 12px 28px}

  .heading{flex-direction:column;align-items:flex-start;gap:12px}
  .heading h1{font-size:20px}
  .heading>button,.heading>a{width:100%}

  .category-cascade{grid-template-columns:1fr;gap:10px;padding:14px}
  .toolbar,.task-fields{padding:12px 14px}
  .toolbar input,.toolbar select,.task-fields label{width:100%;flex:1 1 100%;min-width:0}
  #result-run,#trend-job-picker,#keyword-search,#board-search,#category-search{flex:1 1 100%}
  .task-fields>button{width:100%}

  .panel-head{flex-wrap:wrap;padding:13px 14px}
  .panel-head .pill,.panel-head>a,.panel-head>button,.panel-head>div{margin-left:0}
  .service-note,.chart-note{padding:11px 14px}
  .import-area,.research-heading{padding:16px 14px}
  .research-heading{flex-direction:column;align-items:flex-start}
  .research-heading h2{font-size:18px}

  .metrics{grid-template-columns:repeat(2,1fr);gap:10px}
  .metric{padding:13px 14px}
  .metric strong{font-size:22px}
  .grid{grid-template-columns:1fr}

  .table-wrap td,.table-wrap th{padding:10px 12px}
  #result-table .table-wrap,#board-table .table-wrap{max-height:64vh}
  #result-table th:first-child,#result-table td:first-child,
  .keyword-board th:first-child,.keyword-board td:first-child{min-width:126px}

  .multi-grid{grid-template-columns:1fr;padding:0 14px 14px}
  .analysis-plot{height:230px}
  .analysis-plot.expanded{inset:4vh 4vw}
  .core-metrics{grid-template-columns:repeat(2,1fr);padding:14px}
  .trend-range{padding:12px 14px}
  .trend-range label{flex:1 1 100%}
  .trend-range input[type=date]{flex:1;width:auto}
  .single-analysis,.daily-details{margin:0 14px 14px}
  #board-detail:not([hidden]){inset:0;border-radius:0;border:0}
}

@media(prefers-reduced-motion:reduce){
  *{animation-duration:.01ms!important;transition-duration:.01ms!important}
}

.duoduo-shell{border:1px solid #e2e7ef;background:#f5f7fb;border-radius:12px;overflow:hidden}.duoduo-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 20px;background:white;border-bottom:1px solid #e5e9f1;color:#758197;font-size:13px}.duoduo-bar>span:first-child{font-weight:600;color:#35435b}.duoduo-dot{display:inline-block;width:7px;height:7px;background:#3e6aee;border-radius:50%;margin-right:7px}#dd-frame{display:block;width:100%;height:calc(100vh - 260px);min-height:620px;border:0}#dd-error{padding:24px;color:#ad3c3c;background:#fff6f5}.selection-badge{display:inline-block;padding:4px 10px;border-radius:6px;background:#f0f3f8;color:#687587;white-space:nowrap}.selection-badge.selected{background:#eef3ff;color:#3865d7;font-weight:600}@media(max-width:760px){.duoduo-bar{flex-wrap:wrap;padding:12px}#dd-frame{min-height:700px}}
