:root {
  --page: #e8eff0;
  --surface: rgba(255, 255, 255, .72);
  --surface-soft: rgba(255, 255, 255, .5);
  --text: #1d2935;
  --muted: #64757f;
  --line: rgba(255, 255, 255, .7);
  --primary: #147d74;
  --primary-hover: #0e675f;
  --primary-soft: rgba(222, 243, 238, .82);
  --warm: #d95f37;
  --glass: rgba(255, 255, 255, .56);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-panel: rgba(250, 253, 253, .9);
  --shadow-sm: 0 6px 20px rgba(18, 42, 52, .09);
  --shadow-md: 0 20px 48px rgba(12, 35, 45, .2);
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; background: transparent; }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background-color: var(--page);
  background-image: var(--nav-background, url('bg-beach.jpg'));
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--nav-background, url('bg-beach.jpg'));
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
body.dark {
  --page: #0c161d;
  --surface: rgba(14, 28, 37, .72);
  --surface-soft: rgba(24, 40, 50, .62);
  --text: #edf4f5;
  --muted: #a9b8c0;
  --line: rgba(172, 203, 214, .2);
  --primary: #5fcdb4;
  --primary-hover: #82ddc8;
  --primary-soft: rgba(30, 73, 67, .72);
  --glass: rgba(11, 27, 36, .56);
  --glass-strong: rgba(14, 30, 40, .78);
  --glass-panel: rgba(12, 27, 36, .92);
  --shadow-sm: 0 7px 22px rgba(0, 0, 0, .2);
  --shadow-md: 0 22px 52px rgba(0, 0, 0, .38);
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.site-shell { position: relative; z-index: 2; min-height: 100vh; }
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 48px));
  height: 92px;
  margin: 0 auto;
}
.weather-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 7px;
  color: rgba(255, 255, 255, .9);
  background: rgba(8, 25, 33, .28);
  backdrop-filter: blur(14px) saturate(125%);
  font-size: 14px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  white-space: nowrap;
}
.weather-line time { font-variant-numeric: tabular-nums; opacity: .85; }
.weather-line strong { font-weight: 600; }
.brand {
  position: absolute;
  top: 17px;
  left: 50%;
  display: grid;
  place-items: center;
  width: 244px;
  height: 60px;
  padding: 7px 13px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 8px;
  background: rgba(255, 255, 255, .74);
  box-shadow: 0 8px 22px rgba(6, 27, 35, .15);
  backdrop-filter: blur(18px) saturate(125%);
  transform: translateX(-50%);
}
.brand img { display: block; width: 220px; height: auto; }
.top-actions { display: flex; align-items: center; gap: 5px; }
.background-control { position: relative; }
.background-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; width: 142px; padding: 5px; border: 1px solid rgba(255,255,255,.68); border-radius: 8px; background: rgba(255,255,255,.94); box-shadow: var(--shadow-md); backdrop-filter: blur(16px); }
.background-menu button { display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 5px; color: #53636b; background: transparent; cursor: pointer; text-align: left; font-size: 12px; }
.background-menu button:hover { color: var(--primary); background: var(--primary-soft); }
.icon-button, .text-button, .compact-button {
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.icon-button { width: 34px; height: 34px; color: #fff; font-size: 17px; }
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  color: rgba(255, 255, 255, .92);
  font-size: 13px;
}
.icon-button:hover, .text-button:hover { background: rgba(255, 255, 255, .2); backdrop-filter: blur(12px); }
.text-button b { color: #75e0ca; font-size: 11px; }
.source-button { display: none; }

.hero {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 38px 0 30px;
  text-align: center;
}
.hero-kicker, .hero h1, .hero-lede, .hero-meta { display: none; }
.search-form {
  position: relative;
  display: flex;
  align-items: center;
  width: min(780px, 100%);
  height: 60px;
  margin: 0 auto;
  padding: 0 13px 0 18px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 8px;
  background: var(--glass-strong);
  box-shadow: 0 14px 30px rgba(10, 32, 41, .18);
  backdrop-filter: blur(22px) saturate(135%);
}
.search-symbol {
  flex: 0 0 auto;
  width: 28px;
  margin-right: 9px;
  color: var(--primary);
  font-family: Georgia, serif;
  font-size: 27px;
  line-height: 1;
}
.search-form input {
  min-width: 0;
  flex: 1;
  height: 100%;
  border: 0;
  outline: 0;
  color: #24343d;
  background: transparent;
  font-size: 16px;
}
.search-form input::placeholder { color: #9ba7ae; }
.search-engine-select {
  height: 34px;
  margin-left: 8px;
  padding: 0 25px 0 12px;
  border: 0;
  border-left: 1px solid #dfe6e9;
  outline: 0;
  color: #465861;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
}
.search-form kbd { display: none; }
.clear-search {
  display: none;
  width: 28px;
  height: 28px;
  margin-left: 5px;
  border: 0;
  border-radius: 6px;
  color: #85939a;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
}
.clear-search.visible { display: inline-grid; place-items: center; }
.clear-search:hover { color: var(--primary); background: var(--primary-soft); }

.hot-search-bar {
  display: flex;
  align-items: center;
  width: min(780px, 100%);
  height: 36px;
  margin: 10px auto 0;
  padding: 0 9px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 7px;
  color: rgba(255, 255, 255, .9);
  background: rgba(7, 28, 35, .3);
  backdrop-filter: blur(16px) saturate(125%);
  font-size: 12px;
}
.hot-search-label { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; padding-right: 9px; color: #ffd1bd; font-weight: 700; }
.hot-search-items { display: flex; align-items: center; min-width: 0; flex: 1; gap: 2px; overflow: hidden; }
.hot-search-items button, .hot-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  height: 27px;
  padding: 0 7px;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hot-search-items button:hover, .hot-more:hover, .hot-more.active { background: rgba(255, 255, 255, .15); }
.hot-search-items b { color: #ffb594; font-size: 10px; }
.hot-more { margin-left: auto; }
.hot-panel {
  position: relative;
  z-index: 30;
  width: min(780px, 100%);
  margin: 7px auto 0;
  padding: 14px 17px 16px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 8px;
  color: #254049;
  background: rgba(255, 255, 255, .86);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px) saturate(125%);
  text-align: left;
}
.hot-panel-head { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 9px; border-bottom: 1px solid #dce5e8; }
.hot-panel-head strong { font-size: 15px; }
.hot-panel-head span { color: #819097; font-size: 11px; }
.hot-panel ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 28px; margin: 8px 0 0; padding: 0; list-style: none; }
.hot-panel li button { display: flex; align-items: center; width: 100%; height: 32px; gap: 9px; padding: 0 5px; border: 0; border-radius: 5px; color: #354b54; background: transparent; cursor: pointer; text-align: left; font-size: 13px; }
.hot-panel li button:hover { color: var(--primary); background: #f1f6f6; }
.hot-panel li b { width: 15px; color: var(--warm); font-size: 11px; }
.hot-panel li span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-panel li i { color: #9aabb1; font-style: normal; }

.directory {
  width: min(1180px, calc(100% - 48px));
  min-height: calc(100vh - 300px);
  margin: 8px auto 0;
  padding: 18px 0 72px;
}
.compact-button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px; border-color: var(--line); color: var(--muted); background: var(--surface); font-size: 12px; }
.compact-button:hover { border-color: var(--primary); color: var(--primary); }

.category-switcher {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  width: 100%;
  margin-bottom: 20px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass-strong);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(20px) saturate(135%);
}
.category-tabs {
  display: flex;
  min-width: 0;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
}
.category-tabs::-webkit-scrollbar { display: none; }
.category-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  height: 36px;
  min-width: 54px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  color: #63727c;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  scroll-snap-align: center;
  transition: color .18s ease, background .18s ease;
}
.category-tab span:first-child, .category-tab .tab-count { display: none; }
.category-tab:hover { color: var(--primary); background: var(--primary-soft); }
.category-tab.active { color: #fff; background: var(--primary); }
.category-arrow {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  margin: 0 auto;
  padding: 0 0 3px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-soft);
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 23px;
  line-height: 1;
}
.category-arrow:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.category-arrow:disabled { opacity: .22; cursor: default; }
.category-switcher.no-overflow .category-arrow { visibility: hidden; }

.site-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px 14px; }
.site-card {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 136px;
  padding: 18px 14px;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 10px;
  background: var(--glass);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(19px) saturate(135%);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.site-card:hover { z-index: 40; border-color: rgba(111, 225, 204, .68); background: rgba(255, 255, 255, .7); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.site-card-link { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-height: 98px; gap: 12px; text-align: center; }
.site-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(25, 51, 60, .12);
}
.site-icon img { width: 42px; height: 42px; object-fit: contain; }
.site-mark-fallback { display: none; color: var(--primary); font-size: 22px; font-weight: 800; }
.site-icon.failed img { display: none; }
.site-icon.failed .site-mark-fallback { display: block; }
.site-name { display: block; width: 100%; overflow: hidden; margin: 0; color: var(--text); font-size: 16px; font-weight: 750; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.favorite-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 0;
  border-radius: 6px;
  color: #a8b8bd;
  background: transparent;
  opacity: 0;
  cursor: pointer;
  font-size: 15px;
}
.site-card:hover .favorite-button, .favorite-button:focus-visible, .favorite-button.active { opacity: 1; }
.favorite-button:hover, .favorite-button.active { color: #e5ae47; background: rgba(255, 247, 230, .82); }
.site-hover-info {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  z-index: 50;
  width: min(310px, calc(100vw - 30px));
  padding: 16px 17px 14px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 12px;
  color: #284249;
  background: var(--glass-panel);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(23px) saturate(145%);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translate(-50%, -8px) scale(.97);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.site-card:hover .site-hover-info, .site-card:focus-within .site-hover-info { opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); }
.site-hover-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.site-hover-top strong { min-width: 0; overflow: hidden; color: #193c3a; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.site-hover-top span { flex: 0 0 auto; padding: 4px 7px; border-radius: 5px; color: var(--primary); background: var(--primary-soft); font-size: 10px; }
.site-hover-info p { margin: 0 0 12px; color: #52676c; font-size: 13px; line-height: 1.65; }
.site-hover-core { display: grid; gap: 3px; padding: 9px 11px; border-left: 3px solid var(--primary); background: rgba(222, 243, 238, .55); }
.site-hover-core span { color: #70858a; font-size: 10px; }
.site-hover-core b { color: var(--primary); font-size: 12px; font-weight: 700; }
.site-hover-domain { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 11px; color: #8b9da0; font-size: 10px; }
.site-hover-domain span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-hover-domain b { color: var(--primary); font-size: 15px; font-weight: 400; }

.empty-state { padding: 80px 20px; text-align: center; }
.empty-mark { color: var(--primary); font-size: 37px; }
.empty-state h3 { margin: 10px 0 6px; font-size: 18px; }
.empty-state p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.footer { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 24px 0 32px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: 11px; line-height: 1.8; }
.footer p { margin: 0; }
.footer p:first-child { display: none; }
.footer a { color: var(--primary); }
.toast { position: fixed; right: 24px; bottom: 22px; z-index: 100; padding: 11px 15px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: var(--surface); box-shadow: var(--shadow-md); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

body.dark .brand { filter: brightness(1.18); }
body.dark .search-form { border-color: rgba(255, 255, 255, .17); background: rgba(23, 35, 45, .96); }
body.dark .search-form input, body.dark .search-engine-select { color: #edf4f5; }
body.dark .search-form input::placeholder { color: #82929d; }
body.dark .search-engine-select { border-left-color: #394954; }
body.dark .hot-panel { border-color: #42525c; color: var(--text); background: rgba(23, 35, 45, .9); }
body.dark .hot-panel-head { border-bottom-color: var(--line); }
body.dark .hot-panel li button { color: var(--text); }
body.dark .hot-panel li button:hover { background: var(--surface-soft); }
body.dark .background-menu { border-color: #42525c; background: rgba(23,35,45,.96); }
body.dark .background-menu button { color: #ced9dd; }
body.dark .category-switcher { border-color: var(--line); background: var(--glass-strong); }
body.dark .category-tab { color: #aab6bd; }
body.dark .category-tab:hover { color: var(--primary); }
body.dark .category-tab.active { color: #10211f; }
body.dark .site-card:hover { background: rgba(21, 43, 53, .76); }
body.dark .site-icon { border-color: rgba(220, 229, 232, .75); }
body.dark .favorite-button:hover, body.dark .favorite-button.active { background: #3a3222; }
body.dark .site-hover-info { color: #dce9e8; background: var(--glass-panel); }
body.dark .site-hover-info strong { color: #f1f8f7; }
body.dark .site-hover-info p { color: #b1c0c4; }
body.dark .site-hover-core { background: rgba(29, 66, 62, .58); }
body.dark .site-hover-core span { color: #9db6b6; }
body.dark .site-hover-domain { color: #8fa5aa; }

@media (max-width: 1180px) {
  .site-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .site-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .brand { width: 218px; }
  .brand img { width: 196px; }
}

@media (max-width: 760px) {
  .topbar { width: calc(100% - 28px); height: 98px; }
  .weather-line { position: absolute; top: 11px; left: 0; max-width: calc(100% - 82px); gap: 5px; overflow: hidden; font-size: 11px; }
  .brand { top: 40px; width: 190px; height: 49px; padding: 5px 9px; }
  .brand img { width: 172px; }
  .top-actions { position: absolute; top: 7px; right: 0; }
  .top-actions .text-button { width: 32px; padding: 0; justify-content: center; font-size: 0; }
  .top-actions .text-button span { font-size: 14px; }
  #favoritesToggle, .source-button { display: none; }
  .hero { width: calc(100% - 28px); padding: 27px 0 26px; }
  .search-form { height: 56px; padding-left: 14px; }
  .search-symbol { width: 24px; margin-right: 6px; font-size: 24px; }
  .search-form input { font-size: 15px; }
  .search-engine-select { max-width: 76px; margin-left: 3px; padding: 0 17px 0 6px; font-size: 12px; }
  .hot-search-bar { font-size: 11px; }
  .hot-search-items button, .hot-more { padding: 0 5px; font-size: 11px; }
  .hot-panel ol { grid-template-columns: 1fr; }
  .background-menu { right: -4px; }
  .directory { width: calc(100% - 28px); margin-top: 0; padding-top: 29px; }
  .category-switcher { grid-template-columns: 29px minmax(0, 1fr) 29px; padding: 6px 5px; }
  .category-tab { min-width: 50px; padding: 0 10px; font-size: 13px; }
  .site-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .site-hover-info { position: fixed; top: auto; right: 14px; bottom: 14px; left: 14px; width: auto; transform: translateY(8px) scale(.97); }
  .site-card:hover .site-hover-info, .site-card:focus-within .site-hover-info { transform: translateY(0) scale(1); }
}

@media (max-width: 560px) {
  .site-card { min-height: 122px; padding: 14px 10px; }
  .site-card-link { min-height: 92px; gap: 9px; }
  .site-icon { width: 54px; height: 54px; flex-basis: 54px; border-radius: 13px; }
  .site-icon img { width: 38px; height: 38px; }
  .site-name { font-size: 15px; }
  .compact-button { height: 32px; }
  .hot-search-items button:nth-child(n+3) { display: none; }
  .footer { width: calc(100% - 28px); }
}

@media (hover: none) {
  .favorite-button { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Latest navigation layout */
.topbar { height: 84px; }
.weather-wrap { position: relative; z-index: 65; }
.weather-line { cursor: default; }
.weather-pin { color: #8bf2d3; font-size: 17px; }
.weather-detail {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 286px;
  padding: 15px 16px 13px;
  border: 1px solid rgba(255,255,255,.68);
  border-radius: 12px;
  color: #25434a;
  background: rgba(250,253,253,.9);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(22px) saturate(140%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-5px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.weather-wrap:hover .weather-detail, .weather-wrap:focus-within .weather-detail { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.weather-detail-head, .weather-detail-main, .weather-detail dl div { display: flex; align-items: center; }
.weather-detail-head { justify-content: space-between; margin-bottom: 13px; }
.weather-detail-head strong { font-size: 14px; }
.weather-detail-head span, .weather-detail small { color: #82949a; font-size: 10px; }
.weather-detail-main { gap: 12px; margin-bottom: 13px; }
.weather-detail-main > span { color: #f1ae4c; font-size: 34px; line-height: 1; }
.weather-detail-main div { display: grid; gap: 2px; }
.weather-detail-main b { color: #1d393f; font-size: 26px; line-height: 1; }
.weather-detail-main div span { color: #667a80; font-size: 12px; }
.weather-detail dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin: 0 0 12px; }
.weather-detail dl div { justify-content: space-between; padding: 7px 8px; border-radius: 7px; background: rgba(224,242,239,.58); }
.weather-detail dt { color: #809196; font-size: 10px; }
.weather-detail dd { margin: 0; color: #2b6563; font-size: 12px; font-weight: 700; }
.weather-detail small { display: block; line-height: 1.45; }
.brand { border: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
.brand img { filter: drop-shadow(0 4px 10px rgba(0,0,0,.28)); }
.top-actions { gap: 7px; }
.top-actions .text-button, .top-actions .icon-button { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.35); }

.hero { min-height: calc(100vh - 84px); display: flex; flex-direction: column; justify-content: center; padding: 36px 0 80px; }
.search-form { height: 66px; padding: 0 10px 0 12px; border-radius: 14px; }
.search-engine-control { position: relative; flex: 0 0 auto; height: 44px; }
.search-engine-button { display: inline-flex; align-items: center; gap: 7px; height: 44px; min-width: 106px; padding: 0 9px; border: 0; border-right: 1px solid rgba(128,151,157,.28); color: #3b5960; background: transparent; cursor: pointer; }
.search-engine-button:hover { color: var(--primary); }
.engine-logo { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: 0 0 26px; border-radius: 8px; color: #fff; font-size: 12px; font-weight: 800; letter-spacing: 0; }
.engine-bing { background: #1685c2; }.engine-baidu { background: #2d6cdf; }.engine-sogou { background: #ff6b35; }.engine-360 { background: #35a853; }.engine-wechat { background: #1aad19; }.engine-weibo { background: #e6162d; }.engine-zhihu { background: #0066ff; }.engine-taobao { background: #ff5000; }.engine-jd { background: #e1251b; }.engine-bilibili { background: #00aeec; }.engine-toutiao { background: #161823; }.engine-douyin { background: #111; box-shadow: 2px 0 #00f2ea, -2px 0 #ff0050; }.engine-google { background: #4285f4; }.engine-cili { background: #16a085; }
.engine-name { font-size: 13px; font-weight: 650; white-space: nowrap; }
.engine-chevron { margin-left: auto; color: #84979d; font-size: 16px; }
.search-engine-menu { position: absolute; top: calc(100% + 9px); left: -4px; z-index: 80; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 250px; padding: 7px; border: 1px solid rgba(255,255,255,.72); border-radius: 12px; background: rgba(249,253,253,.96); box-shadow: var(--shadow-md); backdrop-filter: blur(20px); }
.search-engine-option { display: flex; align-items: center; gap: 8px; height: 37px; padding: 0 7px; border: 0; border-radius: 7px; color: #53666c; background: transparent; cursor: pointer; font-size: 12px; text-align: left; }
.search-engine-option:hover, .search-engine-option.selected { color: var(--primary); background: var(--primary-soft); }
.search-engine-option b { margin-left: auto; color: var(--primary); }
.search-form input { font-size: 18px; }
.search-form kbd { display: none; }
.submit-search { display: grid; place-items: center; width: 45px; height: 45px; margin-left: 6px; border: 0; border-radius: 11px; color: #fff; background: var(--primary); cursor: pointer; font-family: Georgia, serif; font-size: 28px; line-height: 1; transition: background .18s ease, scale .18s ease; }
.submit-search:hover { background: var(--primary-hover); scale: 1.06; }
.clear-search { margin-left: auto; }
.directory { margin-top: 0; }

.page-widgets { position: fixed; left: 22px; bottom: 22px; z-index: 70; display: grid; gap: 10px; width: 188px; }
.glass-widget { border: 1px solid rgba(255,255,255,.68); border-radius: 13px; background: rgba(245,252,251,.68); box-shadow: var(--shadow-md); backdrop-filter: blur(21px) saturate(140%); }
.widget-clock { display: grid; gap: 3px; padding: 12px 14px; color: #21444a; }
.widget-label { color: #668087; font-size: 10px; }
.widget-clock time { color: #164f4d; font-size: 25px; font-weight: 750; letter-spacing: 1px; line-height: 1.1; }
.widget-clock small { color: #73898e; font-size: 10px; }
.widget-note { padding: 11px 12px 12px; }
.widget-note-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; color: #285a58; font-size: 12px; }
.widget-note-head button, .ai-panel-head button { display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 6px; color: #82999b; background: transparent; cursor: pointer; font-size: 19px; }
.widget-note-head button:hover, .ai-panel-head button:hover { color: var(--primary); background: var(--primary-soft); }
.widget-note textarea { display: block; width: 100%; min-height: 76px; resize: vertical; border: 0; outline: 0; color: #2e5054; background: transparent; font-size: 12px; line-height: 1.6; }
.widget-note textarea::placeholder { color: #8ca0a0; }
.note-reopen { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 12px; color: #2b7772; background: rgba(245,252,251,.8); cursor: pointer; font-size: 18px; }
.floating-tools { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: grid; justify-items: end; gap: 10px; }
.ai-wrap { position: relative; }
.tool-launcher { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid rgba(255,255,255,.75); border-radius: 15px; color: #fff; background: rgba(20,125,116,.82); box-shadow: var(--shadow-md); backdrop-filter: blur(16px); cursor: pointer; font-size: 21px; transition: transform .18s ease, background .18s ease; }
.tool-launcher:hover, .tool-launcher.active { background: var(--primary-hover); transform: translateY(-2px); }
.capture-launcher { background: rgba(22,49,58,.78); font-size: 17px; }
.lock-launcher { color: #031716; background: #72f2d0; border-color: rgba(223,255,248,.95); box-shadow: 0 0 0 3px rgba(79,231,194,.18), 0 10px 28px rgba(0,224,180,.35); }
.lock-launcher:hover, .lock-launcher.active { color: #02110f; background: #9affdf; box-shadow: 0 0 0 4px rgba(105,255,218,.22), 0 14px 34px rgba(0,235,187,.48); }
.padlock-icon { position: relative; display: block; width: 17px; height: 14px; margin-top: 5px; border: 2px solid currentColor; border-radius: 3px; }
.padlock-icon::before { content: ''; position: absolute; left: 50%; bottom: 10px; width: 9px; height: 9px; border: 2px solid currentColor; border-bottom: 0; border-radius: 8px 8px 0 0; transform: translateX(-50%); }
.padlock-icon::after { content: ''; position: absolute; top: 4px; left: 50%; width: 3px; height: 5px; border-radius: 2px; background: currentColor; transform: translateX(-50%); }
.ai-panel { position: absolute; right: 0; bottom: 60px; display: grid; grid-template-rows: auto minmax(120px, 1fr) auto; width: min(350px, calc(100vw - 28px)); max-height: min(570px, calc(100vh - 120px)); padding: 13px; color: #25434a; }
.ai-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-panel-head > div { display: grid; gap: 2px; }.ai-panel-head strong { font-size: 14px; }.ai-panel-head span { color: #7c9297; font-size: 10px; }
.ai-settings { display: grid; gap: 6px; margin: 10px 0; }.ai-settings label { display: grid; gap: 3px; color: #6a8186; font-size: 10px; }.ai-settings select, .ai-settings input { width: 100%; height: 30px; padding: 0 8px; border: 1px solid rgba(150,177,177,.35); border-radius: 7px; outline: 0; color: #36595d; background: rgba(255,255,255,.52); font-size: 11px; }.ai-settings input:focus, .ai-settings select:focus { border-color: var(--primary); }
.ai-messages { display: grid; align-content: start; gap: 7px; min-height: 120px; max-height: 245px; overflow: auto; padding: 4px 2px; }.ai-message { max-width: 90%; margin: 0; padding: 8px 10px; border-radius: 9px; color: #33565b; background: rgba(226,242,239,.78); font-size: 12px; line-height: 1.55; }.ai-message.user { justify-self: end; color: #fff; background: var(--primary); }.ai-message.pending { opacity: .65; }
.ai-form { display: flex; gap: 6px; margin-top: 9px; }.ai-form input { min-width: 0; flex: 1; height: 36px; padding: 0 10px; border: 1px solid rgba(150,177,177,.4); border-radius: 8px; outline: 0; color: #31545a; background: rgba(255,255,255,.62); font-size: 12px; }.ai-form button { width: 38px; height: 36px; border: 0; border-radius: 8px; color: #fff; background: var(--primary); cursor: pointer; }

.lock-screen { position: fixed; inset: 0; z-index: 1000; overflow: hidden; color: #fff; background: #000; outline: 0; isolation: isolate; }
.lock-screen:fullscreen { width: 100vw; height: 100vh; }
.lock-screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.lock-vignette { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(circle at 50% 48%, transparent 20%, rgba(0,0,0,.12) 48%, rgba(0,0,0,.78) 100%); }
.lock-status { position: absolute; bottom: clamp(34px, 7vh, 76px); left: 50%; z-index: 2; display: grid; justify-items: center; color: rgba(239,251,255,.94); text-align: center; text-shadow: 0 2px 18px #000; transform: translateX(-50%); }
.lock-symbol { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 12px; border: 1px solid rgba(124,236,255,.65); border-radius: 50%; color: #9df6ff; background: rgba(3,11,19,.54); box-shadow: 0 0 24px rgba(62,221,255,.32); font-size: 9px; }
.lock-status time { font-size: clamp(44px, 6vw, 74px); font-weight: 300; line-height: 1; letter-spacing: 0; }
.lock-status p { margin: 12px 0 4px; font-size: 14px; font-weight: 650; letter-spacing: 0; }
.lock-status small { color: rgba(210,229,237,.62); font-size: 11px; letter-spacing: 0; }
body.locked { overflow: hidden; }

body.dark .brand { filter: none; }
body.dark .weather-detail, body.dark .glass-widget, body.dark .search-engine-menu { color: #e3f0ef; background: rgba(15,32,41,.92); border-color: rgba(165,202,207,.28); }
body.dark .weather-detail-main b, body.dark .widget-clock time, body.dark .widget-note-head, body.dark .ai-panel, body.dark .ai-settings label, body.dark .ai-message { color: #e3f0ef; }
body.dark .weather-detail-main div span, body.dark .weather-detail dt, body.dark .weather-detail-head span, body.dark .weather-detail small, body.dark .widget-label, body.dark .widget-clock small, body.dark .ai-panel-head span { color: #a7bdc2; }
body.dark .weather-detail dl div, body.dark .ai-message { background: rgba(32,68,68,.55); }
body.dark .weather-detail dd { color: #83e0c7; }
body.dark .search-engine-button, body.dark .search-engine-option, body.dark .search-form input, body.dark .widget-note textarea, body.dark .ai-settings select, body.dark .ai-settings input, body.dark .ai-form input { color: #e3f0ef; }
body.dark .search-engine-option:hover, body.dark .search-engine-option.selected { background: rgba(35,83,77,.72); }
body.dark .ai-message.user { color: #08211f; background: #77dcc2; }

@media (max-width: 760px) {
  .topbar { height: 92px; }
  .weather-line { max-width: min(145px, calc(50vw - 22px)); overflow: hidden; text-overflow: ellipsis; }
  .brand { top: 35px; width: 190px; height: 48px; padding: 3px; }
  .brand img { width: 178px; }
  .hero { min-height: calc(100svh - 92px); padding: 25px 0 60px; }
  .search-form { height: 58px; padding-left: 7px; }
  .search-engine-button { min-width: 76px; padding: 0 6px; gap: 4px; }
  .search-engine-button .engine-logo { width: 23px; height: 23px; flex-basis: 23px; border-radius: 7px; font-size: 10px; }
  .search-engine-button .engine-name { max-width: 35px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; }
  .search-engine-menu { left: -5px; width: 226px; }
  .search-form input { font-size: 15px; }
  .submit-search { width: 40px; height: 40px; font-size: 24px; }
  .page-widgets { left: 12px; bottom: 12px; width: 164px; transform: scale(.92); transform-origin: bottom left; }
  .floating-tools { right: 12px; bottom: 12px; }
  .tool-launcher { width: 44px; height: 44px; }
  .ai-panel { bottom: 55px; }
  .toast { right: 70px; bottom: 16px; }
}

@media (max-width: 420px) {
  .weather-line { padding: 0 7px; font-size: 10px; gap: 4px; }
  .weather-line #weatherText, .weather-line #weatherAir { display: none; }
  .weather-detail { width: 260px; }
  .top-actions { gap: 1px; }
  .top-actions .text-button { padding: 0 6px; }
  .search-engine-button { min-width: 67px; }
  .search-engine-button .engine-name { display: none; }
  .page-widgets { transform: scale(.82); }
}

/* Spatial hierarchy: weather/actions at the edge, brand to search to cards */
.topbar {
  width: 100%;
  height: 96px;
  padding: 14px 22px 0;
  align-items: flex-start;
}
.weather-wrap { margin: 0; }
.brand { top: 163px; }
.top-actions { margin-left: auto; }
.hero {
  min-height: 0;
  padding: 168px 0 24px;
  justify-content: flex-start;
}
.search-form { z-index: 40; }
.search-engine-control { z-index: 50; }
.search-engine-menu { z-index: 100; }
.hot-search-bar { position: relative; z-index: 10; }
.directory { margin-top: 0; padding-top: 8px; }
.page-widgets {
  top: 150px;
  right: 22px;
  bottom: auto;
  left: auto;
  width: 188px;
}
.widget-head { display: flex; align-items: center; justify-content: space-between; }
.widget-head button { display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 6px; color: #82999b; background: transparent; cursor: pointer; font-size: 19px; }
.widget-head button:hover { color: var(--primary); background: var(--primary-soft); }
.widget-reopen, .note-reopen { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 12px; color: #2b7772; background: rgba(245,252,251,.8); cursor: pointer; font-size: 18px; }
.widget-reopen, .note-reopen { justify-self: end; margin-right: -22px; border: 1px solid rgba(255,255,255,.72); border-right: 0; border-radius: 12px 0 0 12px; box-shadow: -8px 10px 24px rgba(12,35,45,.2); }
.widget-reopen[hidden], .note-reopen[hidden] { display: none; }
.widget-clock { gap: 3px; }

@media (max-width: 760px) {
  .topbar { width: 100%; height: 104px; padding: 10px 14px 0; }
  .weather-line { position: static; max-width: 145px; }
  .brand { top: 192px; width: 190px; height: 48px; }
  .top-actions { position: static; margin-left: auto; }
  .hero { min-height: 0; padding: 270px 0 18px; }
  .directory { padding-top: 6px; }
  .page-widgets { top: 150px; right: 10px; left: auto; bottom: auto; width: 160px; transform: scale(.88); transform-origin: top right; }
  .widget-reopen, .note-reopen { margin-right: -12px; }
}

@media (max-width: 420px) {
  .topbar { height: 104px; padding-left: 10px; padding-right: 10px; }
  .weather-line { max-width: 140px; }
  .brand { top: 192px; }
  .page-widgets { right: 8px; transform: scale(.78); }
}
