/* /history 和 /me 共用的样式（在 style.css 之后加载） */


button, input, select {
  font: 13px var(--mono), var(--cjk);
  color: var(--paper);
}
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.35; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* 边框颜色和背景见 style.css 的霓虹卡片 */
.panel {
  margin-top: 28px;
  padding: 20px 20px 22px;
  border-width: 1px;
  border-style: solid;
  position: relative;
  border-radius: 16px;
}
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.panel h2 { margin: 0; font-family: var(--vt); font-weight: 400; font-size: 24px; letter-spacing: 0.08em; }
.panel h3 { margin: 22px 0 8px; font-family: var(--cjk); font-weight: 500; font-size: 14px; color: var(--dim); }
.panel-head > span { color: var(--dim); font-size: 13px; }
/* 历史页顶部去 /me 的入口 */
.detail-link { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 14px 20px; color: var(--hue); text-decoration: none; font: 500 15px var(--cjk); }
.detail-link small { color: var(--dim); font: 12px var(--cjk); }
.detail-link b { margin-left: auto; font-weight: 400; transition: transform 0.2s; }
.detail-link:hover b { transform: translateX(4px); }
.hint { margin: 6px 0 14px; color: var(--dim); font-size: 12px; }
.empty { color: var(--dim); font-size: 13px; list-style: none; }
.notice[hidden] { display: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.two .panel { min-width: 0; }
@media (max-width: 640px) { .two { grid-template-columns: 1fr; } }

/* 小按钮、日期选择、分段切换、类别标签 */
.day-nav { display: inline-flex; align-items: center; gap: 6px; }
.day-nav button, .seg button, .chips button, .btn {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(236, 234, 245, 0.04);
  text-decoration: none;
}
.day-nav button { padding: 2px 10px; font-size: 16px; }
input[type="date"], select {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(236, 234, 245, 0.04);
  color-scheme: dark;
}
.seg { display: inline-flex; gap: 4px; }
.seg button[aria-pressed="true"], .chips button[aria-pressed="true"] {
  border-color: var(--hue, var(--amber));
  background: color-mix(in srgb, var(--hue, var(--amber)) 18%, transparent);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.chips button { display: inline-flex; align-items: center; gap: 6px; }
/* 色点是类别颜色（--dot），选中时的边框用面板颜色 */
.chips button::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--dot); }
.btn:hover, .day-nav button:not(:disabled):hover, .seg button:hover, .chips button:hover { border-color: var(--faint); }

/* 悬停提示 */
.tip {
  position: fixed;
  z-index: 10;
  max-width: min(320px, calc(100vw - 16px));
  padding: 6px 10px;
  border: 1px solid var(--faint);
  border-radius: 8px;
  background: #13131D;
  color: var(--paper);
  font: 12px/1.45 var(--mono), var(--cjk);
  pointer-events: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}
.tip[hidden] { display: none; }

/* 正事热力图：每列一周，每行一天（周一在上） */
.heat-scroll { overflow-x: auto; padding: 3px 3px 4px; }
.heat {
  display: grid;
  grid-template-rows: repeat(7, 13px);
  grid-auto-flow: column;
  grid-auto-columns: 13px;
  gap: 3px;
  width: max-content;
  margin-left: auto;
}
.heat .wd { grid-column: 1; color: var(--dim); font-size: 10px; line-height: 13px; padding-right: 4px; }
.cell {
  display: block;
  width: 13px;
  height: 13px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: rgba(236, 234, 245, 0.06);
}
.cell.blank { background: none; }
/* 单一色相（面板的 --hue），越多越深越亮 */
.cell[data-level="1"] { background: color-mix(in srgb, var(--hue) 22%, #0C0C14); }
.cell[data-level="2"] { background: color-mix(in srgb, var(--hue) 42%, #0C0C14); }
.cell[data-level="3"] { background: color-mix(in srgb, var(--hue) 64%, #0C0C14); }
.cell[data-level="4"] { background: color-mix(in srgb, var(--hue) 84%, #0C0C14); }
.cell[data-level="5"] { background: var(--hue); }
button.cell:hover { box-shadow: 0 0 0 1px var(--paper); }
.cell[aria-current] { box-shadow: 0 0 0 2px var(--paper); }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 3px; margin-top: 10px; color: var(--dim); font-size: 11px; }
.heat-legend span { margin: 0 4px; }

/* 历史页的“这一天”：沿用首页的 .bar / .ticks / .totals */
.panel .bar { margin-top: 14px; }
.totals .empty::before { display: none; }

/* 趋势柱状图：一个类别一组柱子 */
.cols {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 160px;
  margin-top: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.cols .col { position: relative; flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; }
.cols .col i { display: block; width: 100%; min-height: 1px; border-radius: 4px 4px 0 0; background: var(--hue); }
.cols .col:hover i { filter: brightness(1.15); }
.cols .col span {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 4px;
  color: var(--dim);
  font-size: 10px;
  white-space: nowrap;
}
/* 柱子多的时候只隔几个写一个日期 */
.cols:has(.col:nth-child(14)) .col:not(:nth-child(4n + 1)) span { visibility: hidden; }

/* 排行 */
.rank { list-style: none; margin: 14px 0 0; padding: 0; }
.rank li:not(.empty) {
  position: relative;
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 10px;
  align-items: baseline;
  padding: 7px 0 9px;
  font-size: 13px;
}
.rank .n { color: var(--dim); font-family: var(--vt); font-size: 17px; }
.rank .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--cjk); }
.rank .name b { font-weight: 500; }
.rank .name small { margin-left: 8px; color: var(--dim); font-size: 12px; }
.rank .v { color: var(--dim); font-variant-numeric: tabular-nums; }
.rank .fill { position: absolute; left: 30px; bottom: 2px; height: 3px; max-width: calc(100% - 30px); border-radius: 2px; background: var(--hue); opacity: 0.8; }

/* /me：完整时间线，每条线一行 */
.lanes { margin-top: 14px; }
.lane { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; margin-top: 4px; }
.lane > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 12px var(--cjk); color: var(--dim); text-align: right; }
.lane .bar { height: 16px; margin: 0; border-radius: 4px; }
.lane.main .bar { height: 24px; }
.lane .blk.slack { background: repeating-linear-gradient(135deg, var(--hue) 0 3px, transparent 3px 6px); opacity: 0.75; }
.lanes + .ticks { margin-left: 74px; }
.legend-note { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0; color: var(--dim); font-size: 12px; }
.legend-note i { display: inline-block; width: 18px; height: 10px; margin-right: 6px; vertical-align: -1px; border-radius: 2px; }
.legend-note .slack { background: repeating-linear-gradient(135deg, var(--c-dev) 0 3px, transparent 3px 6px); }

/* /me：明细列表 */
.log { list-style: none; margin: 8px 0 0; padding: 0; max-height: 340px; overflow-y: auto; }
.log li { display: grid; grid-template-columns: 92px 1fr auto; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.log li.empty { display: block; border: 0; }
.log time { color: var(--dim); font-variant-numeric: tabular-nums; font-size: 12px; }
.log .what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--cjk); }
.log .what small { margin-left: 8px; color: var(--dim); }
.log .what a { text-decoration: none; }
.log .what a:hover { text-decoration: underline; text-underline-offset: 3px; }
.log .d { color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.tag { margin-right: 6px; padding: 0 5px; border-radius: 4px; background: color-mix(in srgb, var(--hue) 22%, transparent); color: var(--paper); font-size: 11px; }

/* /me：区间、专注度 */
.range { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 16px; }
.stat { position: relative; padding: 10px 12px; border-width: 1px; border-style: solid; border-radius: 10px; }
.stat small { display: block; color: var(--dim); font-size: 12px; }
.stat b { display: block; margin-top: 2px; font-family: var(--vt); font-weight: 400; font-size: 26px; line-height: 1.1; }
.stat span { color: var(--dim); font-size: 12px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 14px; color: var(--dim); font-size: 13px; }

/* /me：登录、导出 */
.gate { margin-top: 40px; text-align: center; }
.gate p { color: var(--dim); }
.gate .btn { display: inline-block; margin-top: 8px; padding: 8px 18px; font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
