:root {
  --bg: #0a0c10;
  --card: #101319;
  --card-hover: #12161d;
  --border: #1b2029;
  --border-soft: #161b23;
  --text: #e7eaf0;
  --muted: #79849a;
  --muted-2: #59637a;
  --accent: #6ea8fe;
  --accent-2: #a78bfa;
  --green: #4ade80;
  --amber: #fbbf24;
  --radius: 12px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px -20px rgba(0,0,0,.9);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: 48px;
  overflow-x: hidden;
}

.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .5;
  pointer-events: none;
  z-index: 0;
}
.glow-a { width: 620px; height: 380px; top: -220px; left: -120px; background: #12305c; }
.glow-b { width: 560px; height: 340px; top: -200px; right: -140px; background: #2a1a52; }

/* ---------- top bar ---------- */

.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 22px 28px 18px;
  max-width: 1560px;
  margin: 0 auto;
}

.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark {
  width: 13px; height: 13px; border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 16px rgba(110,168,254,.55);
}
.brand-text {
  font-size: 13px; font-weight: 700; letter-spacing: .22em;
  color: #cfd6e4;
}

.page-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
  padding-left: 22px;
  border-left: 1px solid var(--border);
}
.page-title .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.topbar-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 12px;
}
.updated { font-size: 11.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }

.icon-btn {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, border-color .15s, transform .2s;
}
.icon-btn:hover { color: var(--text); border-color: #2a3342; }
.icon-btn.spin svg { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- layout ---------- */

.grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr) 348px;
  gap: 14px;
  align-items: start;
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 28px;
}
.col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

@media (max-width: 1180px) {
  .grid { grid-template-columns: 260px minmax(0, 1fr); }
  .col-right { grid-column: 1 / -1; display: block; }
}
@media (max-width: 820px) {
  .grid { grid-template-columns: 1fr; padding: 0 16px; }
  .col-right { grid-template-columns: 1fr; }
  .bookmarks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { padding: 18px 16px 14px; }
  .updated { display: none; }
}
@media (max-width: 520px) {
  .bookmarks { grid-template-columns: 1fr; }
}

/* ---------- cards ---------- */

.card {
  background: linear-gradient(180deg, rgba(255,255,255,.018), transparent 60%), var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px 16px;
  transition: border-color .2s, background .2s;
}
.card:hover { border-color: #232a36; background: var(--card-hover); }

.w-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.w-head h2 {
  margin: 0;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.w-sub { font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }
.w-link {
  font-size: 10.5px; color: var(--muted-2); text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%;
}
.w-link:hover { color: var(--accent); }

/* ---------- clock ---------- */

.clock-time {
  font-size: 46px;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff, #b9c4d8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.clock-date { margin-top: 6px; font-size: 12.5px; color: var(--muted); }

/* ---------- weather ---------- */

.weather-body { min-height: 132px; }

.weather-now { display: flex; align-items: center; gap: 12px; }
.weather-icon { width: 46px; height: 46px; flex: none; color: #dbe4f5; }
.weather-icon svg { width: 100%; height: 100%; }
.weather-temp {
  font-size: 34px; font-weight: 600; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.weather-temp sup { font-size: 15px; font-weight: 500; color: var(--muted); vertical-align: super; }
.weather-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.weather-desc { font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.weather-feels { font-size: 11px; color: var(--muted-2); }

.weather-bars {
  display: flex; align-items: flex-end; gap: 3px;
  height: 54px;
  margin-top: 14px;
  padding-top: 4px;
}
.wbar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.wbar i {
  display: block; width: 100%; min-height: 3px;
  border-radius: 3px 3px 2px 2px;
  background: linear-gradient(180deg, rgba(110,168,254,.95), rgba(110,168,254,.22));
  transition: filter .15s;
}
.wbar:hover i { filter: brightness(1.35); }
.wbar span { font-size: 8.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.weather-note { margin-top: 10px; font-size: 10.5px; color: var(--muted-2); display: flex; justify-content: space-between; }

/* ---------- calendar ---------- */

.calendar { display: flex; flex-direction: column; gap: 4px; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-head span {
  text-align: center; font-size: 9.5px; color: var(--muted-2);
  padding-bottom: 2px; letter-spacing: .02em;
}
.cal-day {
  height: 26px;
  display: grid; place-items: center;
  font-size: 11px;
  color: #c3cbd9;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.cal-day.dim { color: #3f4757; }
.cal-day.today {
  background: rgba(110,168,254,.16);
  color: #cfe0ff;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(110,168,254,.35) inset;
}
.cal-day.weekend { color: #8f9bb0; }
.cal-day.dim.weekend { color: #3a4150; }

/* ---------- world clock ---------- */

.world-clock { display: flex; flex-direction: column; }
.wc-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border-soft);
}
.wc-row:first-child { border-top: 0; padding-top: 2px; }
.wc-city { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: #dbe1ec; }
.wc-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px rgba(251,191,36,.5); }
.wc-dot.night { background: #7c8cf8; box-shadow: 0 0 8px rgba(124,140,248,.45); }
.wc-day { font-size: 10px; color: var(--muted-2); margin-left: 2px; }
.wc-time { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text); }

/* ---------- search ---------- */

.search-card { padding: 10px 12px; }
.search { display: flex; align-items: center; gap: 10px; }
.search-icon { color: var(--muted-2); flex: none; }
.search input {
  flex: 1; min-width: 0;
  background: none; border: 0; outline: 0;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  padding: 6px 0;
}
.search input::placeholder { color: var(--muted-2); }
.search kbd {
  font: 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 3px 6px;
  background: #0c0f14;
}

/* ---------- bookmarks ---------- */

.bookmarks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 18px; align-items: start; }
.bm-group { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bm-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 10.5px; font-weight: 600; color: var(--muted);
  margin-bottom: 3px;
}
.bm-title .swatch { width: 6px; height: 6px; border-radius: 2px; flex: none; }
.bm-link {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px;
  margin: 0 -6px;
  border-radius: 7px;
  color: var(--text);
  text-decoration: none;
  transition: background .15s;
  min-width: 0;
}
.bm-link:hover { background: rgba(255,255,255,.045); }
.bm-icon {
  width: 22px; height: 22px; flex: none;
  border-radius: 6px;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700;
  border: 1px solid rgba(255,255,255,.07);
  overflow: hidden;
  position: relative;
}
.bm-icon img { width: 14px; height: 14px; position: relative; z-index: 1; }
.bm-icon .fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.bm-name { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-host { display: none; }

/* ---------- feeds ---------- */

.feed-list { display: flex; flex-direction: column; }
.feed-item {
  display: block;
  padding: 9px 0;
  border-top: 1px solid var(--border-soft);
  text-decoration: none;
  color: var(--text);
}
.feed-item:first-child { border-top: 0; padding-top: 0; }
.feed-item:last-child { padding-bottom: 0; }
.feed-title {
  font-size: 12.8px;
  line-height: 1.4;
  color: #dbe1ec;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .15s;
}
.feed-item:hover .feed-title { color: var(--accent); }
.feed-meta {
  display: flex; align-items: center; gap: 6px;
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--muted-2);
  min-width: 0;
}
.feed-meta .src { color: var(--muted); white-space: nowrap; }
.feed-meta .sep { opacity: .5; }
.feed-meta .host { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank {
  display: inline-block;
  min-width: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--muted-2);
}

/* ---------- states ---------- */

.skeleton {
  background: linear-gradient(90deg, #141922 25%, #1a2029 37%, #141922 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px;
}
.sk-weather { height: 118px; }
.sk-lines { height: 150px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.empty { font-size: 12px; color: var(--muted-2); padding: 8px 0; }
.error { font-size: 12px; color: #f08a8a; padding: 8px 0; }

/* ---------- footer ---------- */

.footer {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 8px;
  max-width: 1560px;
  margin: 22px auto 0;
  padding: 0 28px;
  font-size: 11px;
  color: var(--muted-2);
}
.footer a { color: var(--muted-2); text-decoration: none; }
.footer a:hover { color: var(--muted); }
.sep { opacity: .45; }
