:root {
  color-scheme: light;
  --background: #f6f7f3;
  --surface: #ffffff;
  --ink: #29372f;
  --muted: #687465;
  --accent: #456a56;
  --line: #e4e9e1;
  --focus: #89ab94;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--background); }
body { margin: 0; min-width: 280px; isolation: isolate; background: var(--background); color: var(--ink); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
button:disabled { cursor: wait; opacity: .55; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.ui-icon { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.topbar { position: relative; z-index: 3; width: min(1100px, calc(100% - 80px)); margin: 0 auto; padding-top: 34px; display: flex; align-items: center; justify-content: space-between; gap: 18px; font-size: 13px; color: var(--muted); }
.date-block { display: flex; align-items: center; gap: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.date-dot { width: 6px; height: 6px; background: #9cac98; border-radius: 50%; margin-right: 2px; }
.weekday { color: var(--muted); }
.weather-control { position: relative; min-width: 0; }
.weather-button { display: flex; align-items: center; gap: 8px; min-height: 38px; max-width: 100%; padding: 5px 0 5px 10px; border: 0; background: transparent; color: var(--muted); }
.weather-button:hover { color: var(--accent); }
.weather-button .ui-icon { width: 18px; height: 18px; }
#weather-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.weather-chevron { flex-shrink: 0; padding: 0 2px; color: #9aa499; transition: transform .16s; }
.weather-button[aria-expanded="true"] .weather-chevron { transform: rotate(180deg); }

.homepage { position: relative; z-index: 1; max-width: 880px; margin: 20px auto 0; padding: 0 32px 20px; }
.hero { text-align: center; padding-top: 32px; }
.clock { display: block; font-size: clamp(56px, 7vw, 76px); letter-spacing: -4px; font-weight: 300; line-height: 1.18; font-variant-numeric: tabular-nums; }
.quote-block { margin-top: 26px; }
.quote-eyebrow { font-size: 11px; letter-spacing: 3px; color: var(--muted); margin-bottom: 13px; }
.quote { margin: 0 auto; max-width: 740px; font-size: clamp(22px, 2.6vw, 29px); font-weight: 500; line-height: 1.7; letter-spacing: 1px; overflow-wrap: anywhere; text-wrap: balance; }
.quote > span:first-child, .quote > span:last-child { color: #a4b19e; }
.quote-meta { margin-top: 11px; display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 27px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.quote-meta a { text-decoration: none; }
.quote-meta a:hover { color: var(--accent); text-decoration: underline; }
.icon-button { display: grid; place-items: center; width: 32px; height: 32px; padding: 5px; background: transparent; border: 0; border-radius: 50%; color: var(--muted); }
.icon-button:hover { background: #e8ede5; color: var(--accent); }
.quote-refresh { width: 27px; height: 27px; }
.quote-refresh .ui-icon { width: 14px; height: 14px; }
.quote-refresh.is-loading .ui-icon { animation: spin 1.2s linear infinite; }

.search-section { max-width: 660px; margin: 30px auto 0; }
.engine-picker { display: flex; align-items: center; justify-content: center; gap: 5px; margin-bottom: 14px; }
.engine-button { min-height: 36px; padding: 8px 18px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13px; transition: background .16s, color .16s; }
.engine-button:hover { color: var(--accent); background: #eaf0e6; }
.engine-button.is-active { background: #e6ece2; color: #3b5c49; }
.engine-tag { margin-left: 5px; font-size: 9px; }
.search-form { display: flex; align-items: center; min-height: 64px; padding: 8px 8px 8px 22px; border: 1px solid #dde5d9; background: var(--surface); border-radius: 16px; box-shadow: 0 5px 16px #273d2a04; transition: border-color .18s, box-shadow .18s; }
.search-form:focus-within { border-color: #91ad99; box-shadow: 0 0 0 3px #79958213; }
.search-icon { color: #a6b0a1; margin-right: 14px; }
.search-form input { flex: 1; width: 0; min-width: 0; padding: 10px 0; background: transparent; border: 0; outline: none; color: var(--ink); font-size: 16px; }
.search-form input::placeholder { color: var(--muted); }
.search-form input:focus-visible { outline: none; }
.search-submit { display: flex; align-items: center; justify-content: center; gap: 9px; align-self: stretch; min-width: 94px; padding: 0 18px; border: 0; border-radius: 11px; background: #456a56; color: #fff; font-size: 13px; transition: background .16s; }
.search-submit:hover { background: #365843; }
.search-submit .ui-icon { width: 16px; height: 16px; }

.shortcuts { width: min(660px, 100%); margin: 36px auto 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 18px; }
.shortcut { display: flex; flex-direction: column; align-items: center; gap: 11px; min-height: 100px; padding: 10px 5px 9px; color: #617166; text-decoration: none; font-size: 12px; border: 1px solid transparent; border-radius: 14px; transition: background .18s, transform .18s, border-color .18s; }
@media (hover: hover) and (pointer: fine) {
  .shortcut:hover { background: #ffffffb3; border-color: #e6ebe1; transform: translateY(-3px); }
}
.shortcut-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: #fff; box-shadow: 0 3px 10px #384a3304; }
.shortcut-icon svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.shortcut-icon img { width: 29px; height: 29px; object-fit: contain; }
.shortcut-icon .filled-icon { fill: currentColor; stroke: none; }
.shortcut-icon .color-icon { stroke: none; }
.bilibili { background: #fbeaf0; color: #fb7299; }
.douyin { background: #f1edf2;color: #38323c; }
.deepseek { background: #eaf0ff; color: #607fc9; }
.aliyun { background: #fdf0e4; color: #ff6a00; }
.google-translate { background: #eaf0fb; color: #6a90ce; }
.project-x { background: #e9edf3; color: #000; }
.youtube { background: #fbeaea; color: #d97676; }
.tencent { background: #e7f0fb; color: #6698d0; }
.youdao { background: #f8e9e7; color: #ce7a71; }
.certbot { background: #e8eee3; color: #84a274; }
.vscode { background: #e5eff6; color: #5c98be; }
.openclaw { background: #f8e9e0; color: #ca8a67; }
.shortcut-vscode { grid-column: 2; }
.shortcut-openclaw { grid-column: 4; }

/* Mobile height is pinned in pixels by background.js, independent of browser toolbars. */
.cat-background { position: fixed; top: -2px; left: 0; right: 0; height: calc(var(--cat-wall-height, 100vh) + 4px); height: calc(var(--cat-wall-height, 100lvh) + 4px); z-index: -1; isolation: isolate; overflow: hidden; pointer-events: none; background: var(--background); visibility: hidden; opacity: 0; transition: opacity 1.2s ease; }
.has-cat-background .cat-background { visibility: visible; opacity: 1; }
.cat-columns { position: relative; z-index: 0; display: grid; grid-template-columns: repeat(var(--cat-column-count, 5), minmax(0, 1fr)); gap: 0; height: 100%; padding: 0; }
.cat-column { position: relative; min-width: 0; height: 100%; overflow: hidden; }
/* Tint each photo on its own solid backing, so no separate screen overlay can expose it. */
.cat-tile { position: absolute; top: 0; left: 0; width: 100%; overflow: hidden; background: var(--background); transform: translateY(var(--cat-rest-y, 0px)); animation: cat-waterfall var(--cat-duration, 50s) linear infinite; will-change: transform; }
.cat-tile.is-reversed { animation-direction: reverse; }
.cat-tile img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; opacity: .25; }
.cat-background.is-page-hidden .cat-tile { animation-play-state: paused; }
.cat-background.is-reduced-motion .cat-tile { animation: none !important; will-change: auto; }
.cat-intro { position: fixed; inset: 0; z-index: 5; overflow: hidden; padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); pointer-events: none; color: var(--accent); }
.cat-intro-runner { position: absolute; top: 0; left: 0; width: max-content; opacity: 1; will-change: transform; }
.cat-intro.is-leaving .cat-intro-runner { opacity: 0; transition: opacity var(--cat-intro-exit-duration) ease var(--cat-intro-exit-delay); }
.cat-intro-face { display: block; white-space: nowrap; font-family: "SFMono-Regular", Consolas, monospace; font-size: 14px; line-height: 1.6; text-shadow: 0 1px 3px var(--background); }
.is-cat-loading .cat-intro-face, .cat-intro.is-leaving .cat-intro-face { animation: cat-run .32s ease-in-out infinite; }
.cat-intro.is-page-hidden .cat-intro-face { animation-play-state: paused; }
.cat-intro.is-reduced-motion .cat-intro-runner { transition: none; will-change: auto; }
.cat-intro.is-reduced-motion .cat-intro-face { animation: none; }
.webmeji-container { cursor: grab; touch-action: none; }
.webmeji-container:active { cursor: grabbing; }
#cat-photo-status:not(.visually-hidden) { position: relative; z-index: 1; margin: 16px 20px 0; color: var(--muted); text-align: center; font-size: 12px; }
.page-footer { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 22px 20px 24px; color: var(--muted); font-size: 10px; text-align: center; }
.page-footer > span:first-child { margin-right: 12px; }
.page-footer .footer-registration { flex-basis: 100%; margin: 0; }
.page-footer a { text-decoration: none; }
.page-footer a:hover { text-decoration: underline; color: var(--accent); }

.weather-panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 20; width: min(340px, calc(100vw - 32px)); max-height: calc(100vh - 110px); overflow-y: auto; padding: 18px; border: 1px solid #e1e6dc; border-radius: 16px; background: #fafbf8; color: var(--ink); box-shadow: 0 12px 36px #24332b18; }
.weather-panel[hidden] { display: none; }
.weather-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.weather-panel-heading h2 { font-size: 15px; font-weight: 500; margin: 0; }
.weather-close { width: 28px; height: 28px; margin-right: -5px; }
.weather-close .ui-icon { width: 16px; height: 16px; }
.popular-cities-label { margin: 0 0 9px; color: var(--muted); font-size: 11px; }
.popular-cities { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-bottom: 16px; }
.popular-city { min-height: 34px; padding: 6px 3px; border: 1px solid #e4e9df; border-radius: 8px; background: #fff; color: var(--muted); font-size: 12px; }
.popular-city:hover { background: #edf3e8; border-color: #cad8c3; color: var(--accent); }
.popular-city.is-selected { background: #e6ece2; border-color: #b6c9b4; color: #3b5c49; }
.city-form { display: flex; width: 100%; border: 1px solid #dfe6d9; border-radius: 10px; background: #fff; }
.city-form:focus-within { border-color: #91ad99; box-shadow: 0 0 0 3px #79958213; }
.city-form input { width: 0; flex: 1; min-width: 0; padding: 11px 12px; border: 0; border-radius: 10px 0 0 10px; color: var(--ink); background: transparent; font-size: 16px; }
.city-form input::placeholder { color: var(--muted); }
.city-form input:focus-visible { outline: none; }
.city-form button { display: grid; place-items: center; flex-shrink: 0; width: 40px; border: 0; background: transparent; color: var(--accent); border-radius: 0 10px 10px 0; padding: 0; }
.city-form button:hover { background: #edf3e8; }
.city-form button .ui-icon { width: 17px; height: 17px; }
.city-status { min-height: 20px; color: var(--muted); font-size: 12px; margin: 13px 0; line-height: 1.6; }
.city-results { display: grid; gap: 6px; max-height: 220px; overflow-y: auto; padding: 3px; margin: -3px; }
.city-option { text-align: left; border: 1px solid #e4e9df; border-radius: 10px; background: #fff; color: var(--ink); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.city-option:hover { background: #edf3e8; border-color: #cad8c3; }
.city-option small { color: var(--muted); font-size: 11px; }
.weather-attribution { margin: 17px 0 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.noscript-message { padding: 12px 24px; font-size: 12px; color: #6c7a64; text-align: center; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes cat-waterfall { from { transform: translateY(var(--cat-start-y)); } to { transform: translateY(var(--cat-end-y)); } }
@keyframes cat-run { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-3px) rotate(3deg); } }

@media (max-width: 700px) {
  .topbar { width: calc(100% - 40px); padding-top: 20px; font-size: 12px; }
  .date-block { gap: 7px; }
  .homepage { padding: 0 24px 20px; }
  .hero { padding-top: 33px; }
  .clock { font-size: 62px; }
  .quote-block { margin-top: 23px; }
  .quote { font-size: 23px; line-height: 1.65; }
  .search-section { margin-top: 28px; }
  .shortcuts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; margin-top: 25px; }
  .shortcut-vscode, .shortcut-openclaw { grid-column: auto; }
  .shortcut { min-height: 97px; }
}

@media (max-width: 420px) {
  .topbar { width: calc(100% - 32px); gap: 8px; font-size: 11px; }
  .date-dot { display: none; }
  .date-block { gap: 6px; }
  .weather-control { max-width: 48%; }
  .weather-button { padding-left: 0; gap: 5px; font-size: 11px; }
  .homepage { padding: 0 22px 20px; }
  .hero { padding-top: 34px; }
  .clock { font-size: 58px; letter-spacing: -3px; }
  .quote { font-size: 21px; letter-spacing: .5px; }
  .quote-eyebrow { margin-bottom: 12px; }
  .quote-meta { font-size: 11px; }
  .search-form { min-height: 58px; padding-left: 15px; border-radius: 14px; }
  .search-icon { width: 18px; height: 18px; margin-right: 9px; }
  .search-submit { min-width: 66px; padding: 0 13px; }
  .engine-button { padding: 8px 14px; }
  .shortcuts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
  .shortcut { min-height: 101px; font-size: 12px; }
  .shortcut-icon { width: 50px; height: 50px; }
  .page-footer { flex-wrap: wrap; font-size: 9px; gap: 6px; }
  .page-footer > span:first-child { margin-right: 6px; }
  .weather-panel { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .cat-background, .cat-intro-runner { transition: none; }
  .cat-tile { animation: none; will-change: auto; }
  .cat-intro-face { animation: none !important; }
}
