:root { color-scheme: light; --bg:#F3F6FA; --surface:#FAFCFE; --hover:#EAF0F8; --line:#DEE5EF; --strong-line:#A7BDDA; --text:#333333; --muted:#6B6B6B; --accent:#4A4A4A; --selected:#E9E9E9; --icon-bg:#EDF2F8; --focus:#707070; }
:root.dark { color-scheme:dark; --bg:#141516; --surface:#202224; --hover:#292C30; --line:#34383E; --strong-line:#69737F; --text:#D8D8D8; --muted:#A3A3A3; --accent:#C8C8C8; --selected:#383838; --icon-bg:#2B2F34; --focus:#B8B8B8; }
* { box-sizing:border-box; }
body { margin:0; min-height:100svh; display:flex; flex-direction:column; background:var(--bg); color:var(--text); font-family:Inter,"Noto Sans SC",sans-serif; -webkit-font-smoothing:antialiased; }
body::before { content:""; position:fixed; inset:60px 0 0; pointer-events:none; z-index:-1; background-image:linear-gradient(var(--line) 1px,transparent 1px),linear-gradient(90deg,var(--line) 1px,transparent 1px); background-size:40px 40px; opacity:.17; }
button,input { font:inherit; color:inherit; }
button { cursor:pointer; }
button,a,input { -webkit-tap-highlight-color:transparent; }
a { color:inherit; text-decoration:none; }
button { border:1px solid transparent; background:transparent; }
button,a,.search-box,.site-card { transition:background-color 140ms,border-color 140ms,color 140ms,scale 140ms; }
.icon-button:active,.favorite-button:active,#categoryFilters button:active,.topbar-trigger:active { scale:.96; }
:focus-visible { outline:2px solid var(--focus); outline-offset:3px; }
[hidden] { display:none !important; }
h1,h2,p { margin:0; }
.site-header { height:60px; flex-shrink:0; background:var(--surface); border-bottom:0; }
.header-inner { max-width:1440px; height:100%; margin:auto; padding:0 24px; display:flex; align-items:center; justify-content:space-between; }
.brand-group { display:flex; align-items:center; gap:18px; flex-shrink:0; }
#aboutTools { display:flex; align-items:center; }
.brand { display:flex; align-items:center; gap:12px; color:#333333; }
.dark .brand { color:#D8D8D8; }
.brand-logo { width:24px; height:24px; flex-shrink:0; background:currentColor; mask:url('./assets/hooper.svg') center/contain no-repeat; -webkit-mask:url('./assets/hooper.svg') center/contain no-repeat; }
h1 { font-size:18px; font-weight:600; letter-spacing:-.4px; }
.brand h1 { line-height:0; }
.brand-wordmark { display:block; width:5.597778em; height:1.218em; background:currentColor; mask:url('./assets/hooper-navi-wordmark.svg') center/contain no-repeat; -webkit-mask:url('./assets/hooper-navi-wordmark.svg') center/contain no-repeat; }
.header-actions { display:flex; align-items:center; gap:12px; }
.icon-button { width:32px; height:32px; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; border-radius:8px; color:var(--muted); }
.icon-button:hover { color:var(--text); background:var(--hover); }
main { width:100%; max-width:1440px; margin:0 auto; padding:12px 24px 0; }
.poetry { max-width:760px; min-height:72px; margin:0 auto 12px; padding:8px 44px; position:relative; display:flex; align-items:center; justify-content:center; text-align:center; border-radius:14px; background:var(--surface); border:1px solid var(--line); }
#poetrySentence { font:600 18px/1.5 "Noto Serif SC",Songti SC,SimSun,serif; letter-spacing:.3px; }
#poetryMeta { font-size:12px; line-height:18px; color:var(--muted); margin-top:2px; }
#poetryRefresh { position:absolute; top:50%; right:8px; transform:translateY(-50%); opacity:.6; }
.poetry:hover #poetryRefresh,#poetryRefresh:focus-visible { opacity:1; }
button:disabled { cursor:wait; opacity:.45; }
.search-area { max-width:760px; margin:auto; }
.search-box { height:52px; display:flex; align-items:center; gap:14px; padding:0 16px; background:var(--surface); border:1px solid var(--line); border-radius:12px; color:var(--muted); }
.search-box:focus-within { border-color:var(--focus); outline:2px solid var(--selected); outline-offset:2px; }
.search-mode-switch { position:relative; flex-shrink:0; width:46px; height:32px; display:flex; align-items:center; gap:8px; padding:0 6px; border-radius:6px; }
.search-mode-switch:hover { background:var(--hover); }
.search-mode-switch:focus-within { outline:1px solid var(--focus); outline-offset:2px; }
.search-mode-switch::after { content:""; width:5px; height:5px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:translateY(-2px) rotate(45deg); pointer-events:none; }
.search-mode-icon { width:20px; height:20px; flex-shrink:0; background:url('./assets/google-search.svg') center/contain no-repeat; pointer-events:none; }
.search-mode-icon[data-mode="site"] { background:var(--text); mask:url('./assets/hooper.svg') center/contain no-repeat; -webkit-mask:url('./assets/hooper.svg') center/contain no-repeat; }
#searchMode { position:absolute; inset:0; width:100%; height:100%; border:0; opacity:0; cursor:pointer; }
#searchInput { min-width:0; width:100%; border:0; outline:0; padding:0; background:transparent; font-size:15px; height:100%; }
#searchInput::placeholder { color:var(--muted); opacity:1; }
#searchInput::-webkit-search-cancel-button { -webkit-appearance:none; }
#categoryFilters { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:4px; margin:14px 0 22px; }
#categoryFilters button { min-height:32px; padding:5px 15px; font-size:13px; line-height:20px; border-radius:8px; color:var(--muted); }
#categoryFilters button:hover { background:var(--hover); color:var(--text); }
#categoryFilters button[aria-pressed="true"] { background:var(--selected); color:var(--accent); font-weight:600; }
#linksGrid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.site-card { position:relative; min-height:80px; border:1px solid var(--line); border-radius:13px; background:var(--surface); transition:transform 200ms cubic-bezier(.2,.8,.2,1),box-shadow 200ms,border-color 160ms,background-color 160ms; }
.site-card:hover,.site-card:focus-within { background:var(--hover); border-color:var(--strong-line); transform:translateY(-3px); box-shadow:0 9px 22px #25334A13,0 2px 5px #25334A08; z-index:1; }
.dark .site-card:hover,.dark .site-card:focus-within { box-shadow:0 9px 24px #080B1059,0 2px 6px #080B1033; }
.site-card:active { transform:translateY(-1px); transition-duration:80ms; }
.site-link { display:flex; align-items:center; gap:14px; height:100%; min-height:78px; padding:14px 38px 14px 14px; border-radius:12px; }
.site-link:focus-visible { outline-offset:0; }
.site-icon { width:36px; height:36px; flex-shrink:0; display:grid; place-items:center; transition:transform 200ms cubic-bezier(.2,.8,.2,1); }
.site-card:hover .site-icon,.site-card:focus-within .site-icon { transform:scale(1.055); }
.site-icon img { width:36px; height:36px; object-fit:contain; border-radius:4px; }
.site-icon .fallback { width:36px; height:36px; border-radius:4px; display:grid; place-items:center; background:var(--tile,#637A99); color:#F3F6FA; font-size:17px; }
.site-icon.github-icon img { background:#EDF2F8; padding:2px; }
.site-copy { min-width:0; flex:1; }
.site-title { display:flex; align-items:center; gap:7px; }
.site-copy h2 { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:16px; line-height:24px; font-weight:600; letter-spacing:-.35px; }
.site-copy h2 { transition:color 160ms; }
.site-card:hover h2,.site-card:focus-within h2 { color:var(--accent); }
.site-copy p { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; line-height:20px; color:var(--muted); margin-top:2px; }
.category-more { position:relative; font-size:13px; color:var(--muted); }
.category-more summary { cursor:pointer; list-style:none; border-radius:8px; padding:7px 12px; max-width:140px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.category-more summary::-webkit-details-marker { display:none; }
.category-more summary:hover,.category-more summary.selected { color:var(--accent); background:var(--selected); }
.category-menu { position:absolute; right:0; top:40px; z-index:5; min-width:160px; max-height:320px; overflow:auto; padding:6px; background:var(--surface); border:1px solid var(--line); border-radius:10px; box-shadow:0 8px 24px #25334A1A; }
#categoryFilters>button { max-width:140px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#categoryFilters .category-menu button { display:block; width:100%; text-align:left; }
.favorite-button { position:absolute; right:5px; top:26px; width:30px; height:30px; border-radius:7px; color:var(--muted); opacity:.85; font-size:13px; }
.favorite-button:hover,.favorite-button:focus-visible { background:var(--selected); opacity:1; }
.favorite-button[aria-pressed="true"] { color:#FF9000; opacity:1; }
.dark .favorite-button[aria-pressed="true"] { color:#F5A34A; }
#emptyState { min-height:300px; text-align:center; padding:64px 20px; color:var(--muted); }
#emptyState>i { font-size:24px; margin-bottom:16px; }
#emptyState h2 { color:var(--text); font-size:17px; font-weight:600; }
#emptyState p { margin:10px 0 20px; font-size:14px; }
#emptyState button,dialog button { padding:9px 16px; border:1px solid var(--line); border-radius:8px; background:var(--surface); font-size:13px; margin:0 4px; }
#emptyState button:hover,dialog button:hover { background:var(--selected); border-color:var(--strong-line); }
footer { width:100%; max-width:1440px; min-height:48px; padding:12px 24px; margin:auto auto 0; display:flex; align-items:center; justify-content:center; gap:16px; color:var(--muted); font-size:11px; }
footer a:hover { color:var(--accent); }
.result-count { display:inline-flex; align-items:center; justify-content:center; min-width:25px; height:22px; padding:0 6px; margin-left:8px; border-left:1px solid var(--line); font-size:11px; font-variant-numeric:tabular-nums; color:var(--muted); }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
dialog { color:var(--text); background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:28px; max-width:calc(100vw - 32px); }
dialog::backdrop { background:#14151680; }
dialog h2 { font-size:18px; } dialog p { margin:16px 0 24px; font-size:14px; }
@media (min-width:1500px) and (min-height:1000px) { main { padding-top:28px; } .poetry { margin-bottom:24px; } #categoryFilters { margin-top:12px; } }
@media (max-width:1350px) { main { padding-top:8px; } .site-copy h2 { overflow-wrap:anywhere; } .site-link { gap:10px; padding-top:10px; padding-bottom:10px; } }
@media (max-width:1100px) { #linksGrid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:760px) { #linksGrid { grid-template-columns:repeat(2,minmax(0,1fr)); } .header-inner,main { padding-left:16px; padding-right:16px; } }
@media (min-width:1101px) and (max-height:820px) {
  main { padding-top:8px; }
  .poetry { min-height:56px; margin-bottom:8px; padding-top:6px; padding-bottom:6px; }
  #poetrySentence { font-size:16px; }
  .search-box { height:44px; }
  #categoryFilters { margin:8px 0 12px; }
  #linksGrid { gap:8px; }
  .site-card { min-height:56px; }
  .site-link { min-height:54px; padding:6px 38px 6px 12px; }
  .site-copy h2 { font-size:15px; line-height:22px; }
  .site-copy p { font-size:13px; line-height:18px; }
  .favorite-button { top:calc(50% - 15px); }
  footer { min-height:34px; padding-top:8px; padding-bottom:8px; }
}
@media (max-width:520px) {
  .brand-group { gap:6px; }
  h1 { font-size:13px; } .brand { gap:8px; } .header-actions { gap:2px; }
  .poetry { padding-left:16px; padding-right:40px; } #poetrySentence { font-size:17px; }
  #categoryFilters { display:none; }
  #linksGrid { grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px 8px; margin-top:24px; }
  .site-card { min-height:0; border:0; border-radius:14px; background:transparent; }
  .site-card:hover,.site-card:focus-within,.dark .site-card:hover,.dark .site-card:focus-within { background:transparent; border-color:transparent; transform:none; box-shadow:none; }
  .site-link { min-height:76px; flex-direction:column; gap:6px; padding:0; text-align:center; }
  .site-link:active .site-icon { transform:scale(.94); }
  .site-copy { width:100%; flex:none; }
  .site-title { justify-content:center; gap:3px; }
  .site-copy h2 { font-size:12px; line-height:18px; font-weight:500; letter-spacing:0; }
  .site-copy p { display:none; }
  .favorite-button { display:none; }
  body #desktopDock { min-height:76px; }
  footer { flex-wrap:wrap; justify-content:center; padding:12px 16px; }
}
@media (max-width:360px) { .brand h1 { display:none; } }
@media (hover:none) { .site-card:hover { transform:none; box-shadow:none; } .site-card:hover .site-icon { transform:none; } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none !important; animation:none !important; } }
