/* ==========================================================================
   Jokerchen 个人导航 · Glance custom.css
   配色：Grok 暖纸色 + 墨绿（主色在 glance.yml 的 theme 里，这里做细节）
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Newsreader:opsz,wght@6..72,500;6..72,600&family=Noto+Sans+SC:wght@400;500;600;700&display=swap");

:root {
  --jh-surface: #fffcf8;
  --jh-line: #e4dcd0;
  --jh-chip: #efeae2;
  --jh-accent: #0e6b66;
  --jh-accent-soft: #e4f2f0;
  --jh-accent-ink: #084743;
  --jh-ink: #1c1915;
  --jh-muted: #5e574e;
  --jh-faint: #6f675e;
  --jh-shadow: 0 1px 2px rgb(28 25 21 / 0.05);
  --jh-shadow-lift: 0 10px 24px rgb(28 25 21 / 0.08);
  --jh-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
  --jh-display: "Newsreader", "Noto Serif SC", "Songti SC", serif;
  /* 书签图标：外框 64px，图标本体 48px（想让图标本体也是 64px，把 --jh-icon-img 改成 64px） */
  --jh-icon-box: 64px;
  --jh-icon-img: 48px;
}

[data-scheme="dark"] {
  --jh-surface: #1e1b16;
  --jh-line: #2f2a23;
  --jh-chip: #29251f;
  --jh-accent: #4fb3a9;
  --jh-accent-soft: #15302d;
  --jh-accent-ink: #9ad8d0;
  --jh-ink: #efe9df;
  --jh-muted: #b3aa9c;
  --jh-faint: #9a9184;
}

/* 字号整体放大两档：Glance 根字号是 10px，各级字号每档差 0.1rem，这里每级 +0.2rem
   想再大/小，改这 7 个值即可（原值 h1 1.7 / h2 1.6 / h3 1.5 / h4 1.4 / base 1.3 / h5 1.2 / h6 1.1） */
:root {
  --font-size-h1: 1.9rem;
  --font-size-h2: 1.8rem;
  --font-size-h3: 1.7rem;
  --font-size-h4: 1.6rem;
  --font-size-base: 1.5rem;
  --font-size-h5: 1.4rem;
  --font-size-h6: 1.3rem;
}

body {
  font-size: var(--font-size-base);
}

body {
  font-family: var(--jh-sans);
}

/* 卡片外框（Glance 的 widget 框） */
.widget-content:not(.widget-content-frameless),
.widget-content-frame {
  background: var(--jh-surface);
  border: 1px solid var(--jh-line);
  border-radius: 14px;
  box-shadow: var(--jh-shadow);
}

.widget-header h2 {
  font-family: var(--jh-display);
  text-transform: none;
  letter-spacing: 0;
  font-size: 2.23rem;
  font-weight: 600;
  color: var(--jh-ink);
}

/* 顶部导航 */
.header .logo {
  font-family: var(--jh-display);
  font-weight: 600;
  color: var(--jh-accent);
}

.nav-item-text {
  font-weight: 600;
}

.nav-item-current {
  color: var(--jh-accent) !important;
}

/* ---------- 搜索框：居中、加高 ---------- */
.widget.jh-search {
  max-width: 760px;
  width: 100%;
  margin-inline: auto;
}

.jh-search .search {
  min-height: 3rem;
  border-radius: 12px;
}

.jh-search .search:focus-within {
  border-color: var(--jh-accent);
  box-shadow: 0 0 0 4px var(--jh-accent-soft);
}

.jh-search .search-input {
  font-size: 1.65rem;
}

.jh-search .search-bang {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--jh-accent-soft);
  color: var(--jh-accent-ink);
}

/* ---------- 时钟 ---------- */
.jh-clock .clock-time,
.jh-clock [data-date] {
  font-family: var(--jh-display);
  font-weight: 600;
}

.jh-clock [data-local-time] .clock-time {
  font-size: 3.63rem;
  color: var(--jh-ink);
}

/* ---------- 书签：分组标题 + 卡片网格 ---------- */
.jh-bookmarks .widget-content {
  padding: 1.25rem 1.4rem 1.4rem;
}

/* Glance 默认把分组排成多列；这里改成每组占满一行，组内卡片网格 */
.jh-bookmarks .dynamic-columns {
  display: flex !important;
  flex-direction: column;
  gap: 1.6rem;
  column-count: initial !important;
  grid-template-columns: none !important;
}

.jh-bookmarks .dynamic-columns > * {
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.jh-bookmarks .dynamic-columns > *::before,
.jh-bookmarks .dynamic-columns > *::after {
  display: none !important;
}

.jh-bookmarks .bookmarks-group-title {
  margin-bottom: 0.75rem !important;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--jh-line);
  font-family: var(--jh-display);
  font-size: 2.39rem;
  font-weight: 600;
  color: var(--jh-ink);
}

.jh-bookmarks .bookmarks-group > ul.list {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr));
  gap: 0.9rem !important;
}

.jh-bookmarks .bookmarks-group > ul.list > li {
  position: relative;
  display: grid;
  grid-template-columns: var(--jh-icon-box) minmax(0, 1fr);
  column-gap: 0.95rem;
  align-items: center;
  min-height: calc(var(--jh-icon-box) + 1.8rem);
  margin: 0 !important;
  padding: 0.9rem 1rem;
  border: 1px solid var(--jh-line);
  border-radius: 14px;
  background: var(--jh-surface);
  box-shadow: var(--jh-shadow);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.jh-bookmarks .bookmarks-group > ul.list > li:hover {
  transform: translateY(-1px);
  border-color: var(--jh-accent);
  box-shadow: var(--jh-shadow-lift);
}

/* 标题行（图标 + 链接）拆开放进网格 */
.jh-bookmarks .bookmarks-group > ul.list > li > .flex {
  display: contents !important;
}

.jh-bookmarks .bookmarks-icon-container {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--jh-icon-box);
  height: var(--jh-icon-box);
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 16px;
  background: var(--jh-chip);
  opacity: 1 !important;
}

.jh-bookmarks .bookmarks-icon {
  width: var(--jh-icon-img) !important;
  height: var(--jh-icon-img) !important;
  border-radius: 10px;
  object-fit: contain;
  opacity: 1 !important;
  filter: none !important;
}

.jh-bookmarks .bookmarks-link {
  grid-column: 2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  align-self: end;
  font-size: 1.85rem !important;
  font-weight: 600;
  line-height: 1.4;
  color: var(--jh-ink) !important;
}

/* 整张卡片可点击 */
.jh-bookmarks .bookmarks-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
}

.jh-bookmarks .bookmarks-group > ul.list > li > div:not(.flex) {
  grid-column: 2;
  align-self: start;
  margin: 0.25rem 0 0 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 1.48rem;
  line-height: 1.55;
  color: var(--jh-muted);
}

/* ---------- 手机 / 平板 ---------- */
@media (max-width: 1000px) {
  .jh-bookmarks .bookmarks-group > ul.list {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  }
}

@media (max-width: 560px) {
  .jh-bookmarks .widget-content {
    padding: 1rem;
  }

  .jh-bookmarks .bookmarks-group > ul.list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem !important;
  }

  :root {
    --jh-icon-box: 48px;
    --jh-icon-img: 36px;
  }

  .jh-bookmarks .bookmarks-group > ul.list > li {
    column-gap: 0.6rem;
    padding: 0.7rem;
  }

  .jh-bookmarks .bookmarks-link {
    font-size: 1.65rem !important;
  }

  .jh-bookmarks .bookmarks-icon-container {
    border-radius: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jh-bookmarks .bookmarks-group > ul.list > li {
    transition: none;
  }
}


/* ==========================================================================
   单页导航 · 分类标签条（点击在同页跳转，滚动时高亮当前分类）
   ========================================================================== */
:root {
  --jh-holiday: #b4442c;
  --jh-holiday-soft: #f8e6df;
}

[data-scheme="dark"] {
  --jh-holiday: #e8866f;
  --jh-holiday-soft: #3a231d;
}

.widget.jh-catnav-widget {
  position: sticky;
  top: 0.75rem;
  z-index: 30;
}

.jh-catnav-widget .widget-content {
  padding: 0.8rem !important;
  box-shadow: var(--jh-shadow-lift) !important;
}

.jh-catnav-widget .widget-content {
  container-type: inline-size;      /* 按标签条实际宽度决定每行几个 */
}

/* 分类标签：等宽平均分布，宽屏一行 10 个，窄一些两行各 5 个 */
.jh-catnav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.6rem;
}

@container (min-width: 760px) {
  .jh-catnav { grid-template-columns: repeat(10, minmax(0, 1fr)); }
}

.jh-catnav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.6rem;
  padding: 0.8rem 0.4rem;
  border: 1px solid var(--jh-line);
  border-radius: 12px;
  background: var(--jh-chip);
  color: var(--jh-ink);
  font-size: 1.81rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-align: center;
  white-space: nowrap;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.jh-catnav a:hover {
  border-color: var(--jh-accent);
  color: var(--jh-accent);
  transform: translateY(-1px);
}

.jh-catnav a.active {
  border-color: var(--jh-accent);
  background: var(--jh-accent);
  color: var(--jh-surface);
}

@container (max-width: 420px) {
  .jh-catnav { gap: 0.4rem; }
  .jh-catnav a { min-height: 4rem; padding: 0.6rem 0.2rem; font-size: 1.62rem; letter-spacing: 0; }
}

/* 跳转后分类标题不被标签条挡住 */
.widget[class*="jh-sec-"] {
  scroll-margin-top: 9.5rem;
}

@media (max-width: 1190px) {
  .widget[class*="jh-sec-"] { scroll-margin-top: 14rem; }
}

/* ==========================================================================
   节假日日历（休 / 班 / 农历 / 节日 / 下一个假期）
   ========================================================================== */
.jh-holiday-cal {
  font-size: 1.4rem;
  user-select: none;
}

.jh-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.jh-cal-head button {
  padding: 0.15rem 0.55rem;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--jh-ink);
  font: inherit;
  cursor: pointer;
}

.jh-cal-head button:hover { background: var(--jh-chip); }

.jh-cal-head [data-cal="prev"],
.jh-cal-head [data-cal="next"] {
  font-size: 2.23rem;
  line-height: 1;
}

.jh-cal-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--jh-display) !important;
  font-size: 1.73rem !important;
  font-weight: 600;
  line-height: 1.25;
}

.jh-cal-title small {
  font-family: var(--jh-sans);
  font-size: 1.12rem;
  font-weight: 500;
  color: var(--jh-accent);
}

.jh-cal-week,
.jh-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  text-align: center;
}

.jh-cal-week span {
  padding-bottom: 0.3rem;
  font-size: 1.19rem;
  color: var(--jh-faint);
}

.jh-cal-week .jh-we { color: var(--jh-holiday); }

.jh-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 4.4rem;
  padding: 0.4rem 0 0.3rem;
  border-radius: 8px;
}

.jh-day .jh-n {
  font-size: 1.52rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--jh-ink);
}

.jh-day .jh-l {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.99rem;
  line-height: 1.25;
  color: var(--jh-faint);
}

.jh-day.jh-we .jh-n { color: var(--jh-muted); }
.jh-day.jh-fest .jh-l { color: var(--jh-accent); font-weight: 600; }
.jh-day.jh-off { background: var(--jh-holiday-soft); }
.jh-day.jh-off .jh-n { color: var(--jh-holiday); }
.jh-day.jh-work { background: var(--jh-chip); }

.jh-badge {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 0.91rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  color: var(--jh-holiday);
}

.jh-work .jh-badge { color: var(--jh-muted); }
.jh-day.jh-other { opacity: 0.38; }
.jh-day.jh-today { box-shadow: inset 0 0 0 1.5px var(--jh-accent); }
.jh-day.jh-today .jh-n { color: var(--jh-accent); }

.jh-cal-up {
  margin-top: 0.9rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--jh-line);
}

.jh-cal-up-title {
  margin-bottom: 0.3rem;
  font-size: 1.19rem;
  letter-spacing: 0.05em;
  color: var(--jh-faint);
}

.jh-up-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "name left" "date date";
  padding: 0.35rem 0;
}

.jh-up-name { grid-area: name; font-weight: 600; color: var(--jh-ink); }
.jh-up-left { grid-area: left; text-align: right; font-size: 1.29rem; color: var(--jh-muted); }
.jh-up-left b { font-size: 1.57rem; color: var(--jh-holiday); }
.jh-up-date { grid-area: date; font-size: 1.19rem; color: var(--jh-faint); }
.jh-up-work { margin-top: 0.35rem; font-size: 1.19rem; color: var(--jh-muted); }
.jh-cal-empty { font-size: 1.24rem; color: var(--jh-faint); }
.jh-cal-src { margin-top: 0.6rem; font-size: 1.09rem; color: var(--jh-faint); opacity: 0.8; }
.jh-hol-data { display: none !important; }


/* ==========================================================================
   聚合搜索下拉框（书签 + 网页）
   ========================================================================== */
.widget.jh-search {
  position: relative;
  z-index: 40;              /* 盖住吸顶的分类标签条 */
}

.jh-sr {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  max-height: min(70vh, 34rem);
  overflow-y: auto;
  padding: 0.4rem;
  border: 1px solid var(--jh-line);
  border-radius: 12px;
  background: var(--jh-surface);
  box-shadow: 0 16px 40px rgb(28 25 21 / 0.16);
}

.jh-sr[hidden] { display: none; }

.jh-sr-label {
  padding: 0.55rem 0.7rem 0.25rem;
  font-size: 1.19rem;
  letter-spacing: 0.05em;
  color: var(--jh-faint);
}

.jh-sr-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.5rem 0.7rem;
  border-radius: 9px;
  cursor: pointer;
}

.jh-sr-row:hover { background: var(--jh-chip); }
.jh-sr-row.sel { background: var(--jh-accent-soft); }

.jh-sr-ico {
  flex-shrink: 0;
  width: 3.2rem;
  height: 3.2rem;
  padding: 0.5rem;
  border-radius: 8px;
  background: var(--jh-chip);
  object-fit: contain;
}

.jh-sr-ico-web {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.81rem;
  color: var(--jh-accent);
}

.jh-sr-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.jh-sr-t {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 1.57rem;
  font-weight: 600;
  color: var(--jh-ink);
}

.jh-sr-m,
.jh-sr-d {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 1.25rem;
  color: var(--jh-faint);
}

.jh-sr-d { color: var(--jh-muted); }

.jh-sr mark {
  padding: 0 1px;
  border-radius: 3px;
  background: var(--jh-accent-soft);
  color: var(--jh-accent-ink);
}

.jh-sr-row.sel mark { background: transparent; text-decoration: underline; }

.jh-sr-foot {
  margin-top: 0.3rem;
  padding: 0.5rem 0.7rem 0.2rem;
  border-top: 1px solid var(--jh-line);
  font-size: 1.15rem;
  color: var(--jh-faint);
}

@media (max-width: 560px) {
  .jh-sr-d { display: none; }
}

/* 社区组件：天文图图片别撑出卡片 */
.widget-type-custom-api img { max-width: 100%; }

/* 动态链接组件只提供数据，不显示 */
.widget.jh-dynlink-widget,
.jh-dynlink {
  display: none !important;
}
