:root {
  --bg: #f6f7f9; --card: #fff; --ink: #1c2733; --muted: #64748b;
  --brand: #2c6e63; --brand-ink: #1d4d45; --line: #e2e8f0; --hot: #d97706;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.6 system-ui, "Segoe UI", "Microsoft YaHei", sans-serif;
}
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar { background: var(--brand); color: #fff; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; }
.brand { color: #fff; font-weight: 700; font-size: 17px; }
.tab {
  background: none; border: 0; color: rgba(255,255,255,.75); font: inherit;
  padding: 6px 12px; cursor: pointer; border-radius: 6px;
}
.tab.active { background: rgba(255,255,255,.18); color: #fff; }

main { padding-top: 18px; padding-bottom: 40px; }

.loadstatus[hidden] { display: none; }
.loadstatus {
  display: flex; gap: 12px; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 26px; margin-bottom: 14px; color: var(--muted);
}
.loadstatus.error { justify-content: flex-start; color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.loadstatus.error #load-text { font-size: 13.5px; }

/* Windows 经典（XP 启动画面风格）加载块 */
.xp-loader {
  position: relative; width: 180px; height: 16px;
  border-radius: 8px; background: #e3eaf0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .22);
  overflow: hidden;
}
.xp-loader::before {
  content: ""; position: absolute; top: 3px; left: 0;
  width: 52px; height: 10px; border-radius: 5px;
  background: repeating-linear-gradient(90deg, #5b9bd5 0 12px, transparent 12px 19px);
  animation: xp-slide 1.5s linear infinite;
}
@keyframes xp-slide {
  from { transform: translateX(-56px); }
  to   { transform: translateX(190px); }
}

.searchbox { display: flex; gap: 8px; margin-bottom: 10px; }
.searchbox input {
  flex: 1; padding: 11px 14px; font: inherit; font-size: 16px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
}
.searchbox input:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.searchbox button {
  padding: 0 22px; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--brand); color: #fff; border: 0; border-radius: 8px;
}
.searchbox button:hover { background: var(--brand-ink); }

.filters {
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center;
  margin-bottom: 14px; font-size: 13px; color: var(--muted);
}
.filters label { display: inline-flex; align-items: center; gap: 6px; }
.filters select, .filters input[type=date] {
  font: inherit; padding: 4px 8px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--card); color: var(--ink);
}
.filters .ghost, .dailybar .ghost {
  font: inherit; padding: 4px 10px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--muted);
}
.resultline {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  min-height: 24px; margin-bottom: 10px;
}
.resultline .resultcount { font-size: 13px; color: var(--muted); margin-left: auto; }
.trend-toggle {
  font: inherit; font-size: 12.5px; padding: 3px 10px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--muted);
}
.trend-toggle:hover { color: var(--ink); border-color: var(--brand); }
.trend-toggle[aria-expanded="true"] { border-color: var(--brand); color: var(--brand-ink); background: #eef4f3; }

.lucky-slot[hidden], .trend-panel[hidden], .trend-toggle[hidden] { display: none; }
.lucky-slot {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px;
  padding: 10px 12px 12px; margin-bottom: 14px;
}
.lucky-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-bottom: 8px; font-size: 13px; color: #92400e; font-weight: 600;
}
.lucky-left { flex: 1; min-width: 0; }
.lucky-actions { display: flex; gap: 6px; align-items: center; }
.lucky-actions button {
  font: inherit; font-size: 12px; font-weight: 500; padding: 3px 9px; cursor: pointer;
  border: 1px solid #fcd34d; border-radius: 6px; background: #fff; color: #92400e;
}
.lucky-actions button:hover { background: #fef3c7; }
.lucky-title { color: var(--ink); font-size: 14px; font-weight: 600; word-break: break-word; }
.lucky-title:hover { color: var(--brand-ink); }

.today-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px;
}
.today-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.today-head h3 { margin: 0; font-size: 15px; color: var(--ink); }
.today-sub { font-size: 12.5px; color: var(--muted); }
.today-list { display: grid; gap: 10px; }
.today-item { display: flex; gap: 12px; align-items: flex-start; }
.today-year {
  flex: none; font-size: 12.5px; font-weight: 700; padding: 2px 9px; border-radius: 6px;
  background: #fef3c7; color: #b45309; border: 1px solid #fde68a; margin-top: 2px;
}
.today-year:hover { background: #fde68a; text-decoration: none; }
.today-main { min-width: 0; flex: 1; }
.today-title { font-weight: 600; color: var(--ink); display: inline-block; margin-bottom: 2px; }
.today-title:visited { color: #555; }

.trend-panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 12px;
}
.trend-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted); margin-bottom: 10px;
}
.trend-bars {
  display: flex; align-items: flex-end; gap: 8px; overflow-x: auto; padding-top: 4px;
}
.trend-col {
  flex: 1; min-width: 48px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: 1px solid transparent; border-radius: 8px; padding: 6px 4px; cursor: pointer;
  font: inherit; color: inherit;
}
.trend-col:hover { background: #f8fafc; border-color: var(--line); }
.trend-col.active { background: #eef4f3; border-color: var(--brand); }
.trend-col.empty { opacity: .45; }
.trend-num { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.trend-col.active .trend-num { color: var(--brand-ink); font-weight: 700; }
.trend-track {
  width: 24px; height: 64px; display: flex; align-items: flex-end; justify-content: center;
  background: #f1f5f9; border-radius: 4px; overflow: hidden;
}
.trend-bar {
  width: 100%; background: var(--brand); border-radius: 4px 4px 0 0;
  transition: height .2s ease;
}
.trend-col.active .trend-bar { background: var(--hot); }
.trend-yr { font-size: 12px; color: var(--ink); font-variant-numeric: tabular-nums; }
.trend-gap {
  flex: none; align-self: stretch; display: flex; align-items: center; justify-content: center;
  padding: 0 6px; font-size: 11px; color: var(--muted);
  border-left: 1px dashed var(--line); border-right: 1px dashed var(--line);
  writing-mode: horizontal-tb; white-space: nowrap;
}

@media (max-width: 600px) {
  .searchbox { flex-wrap: wrap; }
  .searchbox input { min-width: 100%; }
  .trend-col { min-width: 38px; }
  .trend-track { width: 18px; height: 52px; }
}
.filters.collapsed { display: none; }
.searchbox .ghost {
  padding: 0 14px; font: inherit; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--muted);
}
.searchbox .ghost:hover { color: var(--ink); }
.searchbox .ghost[aria-expanded="true"] { border-color: var(--brand); color: var(--brand-ink); background: #eef4f3; }
#f-toggle::after { content: " ▾"; }
#f-toggle[aria-expanded="true"]::after { content: " ▴"; }

.results { display: grid; gap: 10px; }
.row {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px;
}
.row h3 { margin: 0 0 4px; font-size: 16px; line-height: 1.45; }
.row h3 a { color: var(--ink); }
.row h3 a:visited { color: #555; }
.rowmeta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.rowmeta .node {
  background: #eef4f3; color: var(--brand-ink); padding: 1px 8px; border-radius: 999px;
}
.rowmeta .hotinfo { color: var(--hot); }
.rowmeta .hotdate { color: #b45309; text-decoration: underline dotted; text-underline-offset: 2px; }
.rowmeta .hotdate:hover { color: #92400e; text-decoration-style: solid; }
.snippet { margin: 6px 0 0; font-size: 13.5px; color: #475569; white-space: pre-wrap; word-break: break-word; }
mark { background: #fde68a; padding: 0 1px; border-radius: 2px; }
.rank-no { font-weight: 700; color: var(--hot); margin-right: 8px; }
.rank-1 { color: #dc2626; } .rank-2 { color: #ea580c; } .rank-3 { color: #d97706; }

.pager { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 16px; }
.pager button {
  font: inherit; padding: 6px 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
}
.pager button:disabled { opacity: .4; cursor: default; }

.dailybar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.dailybar input[type=date] { font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; }
.dailybar button { font: inherit; padding: 6px 12px; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }

.aboutbox {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 22px; font-size: 14px;
}
.aboutbox table { border-collapse: collapse; margin: 10px 0; }
.aboutbox td, .aboutbox th { border: 1px solid var(--line); padding: 5px 12px; font-size: 13px; text-align: left; }
.aboutbox h3 { margin: 18px 0 6px; }

.foot { color: var(--muted); font-size: 12.5px; padding-bottom: 30px; }
.foot .heart { color: #e11d48; }
.foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.foot a:hover { color: var(--ink); }
.empty { color: var(--muted); text-align: center; padding: 30px 0; }
