 :root {
  color-scheme: light;
  --ink: #172a35;
  --paper: #f6f3eb;
  --blue: #416b78;
  --blue-soft: #e5eeeb;
  --coral: #e47f5d;
  --pencil: #d9ded9;
  --muted: #718087;
  --white: #fffefa;
  --font: 'Nunito', 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; }
.page-shell { width: min(1056px, calc(100% - 48px)); margin: 0 auto; }
.masthead { height: 72px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--pencil); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 16px; font-weight: 800; letter-spacing: .02em; }
.brand-mark { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; color: var(--paper); background: var(--blue); font-size: 20px; line-height: 1; }
.masthead-note { color: var(--muted); font-size: 12px; }
.intro { min-height: 220px; display: flex; align-items: center; position: relative; overflow: hidden; border-bottom: 1px solid var(--pencil); }
.intro-copy { padding: 26px 0 30px; position: relative; z-index: 1; }
.eyebrow, .section-kicker { color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .045em; }
.eyebrow { margin: 0 0 8px; }
h1 { margin: 0; font-size: clamp(34px, 4vw, 46px); line-height: 1.2; letter-spacing: -.045em; font-weight: 800; }
.intro-text { margin: 11px 0 0; color: var(--muted); font-size: 13px; }
.island-doodle { width: 320px; height: 176px; position: absolute; right: 25px; bottom: 0; color: var(--blue); }
.sun { position: absolute; top: 0; right: 58px; color: var(--coral); font-size: 58px; line-height: 1; }
.wave { position: absolute; right: -5px; bottom: 5px; font-family: Georgia, serif; letter-spacing: -12px; font-size: 82px; font-weight: 400; opacity: .58; transform: scaleX(1.25); }
.wave-two { right: 34px; bottom: 26px; font-size: 66px; opacity: .34; }
.tiny-face { position: absolute; right: 74px; top: 82px; z-index: 1; padding: 10px 13px; border: 1px solid #c7d5d2; border-radius: 50%; background: var(--paper); font-size: 18px; transform: rotate(-7deg); white-space: nowrap; }
.search-panel { padding: 22px 0 20px; }
.search-label { display: block; margin-bottom: 8px; font-weight: 800; font-size: 14px; }
.search-field { min-height: 56px; display: flex; align-items: center; gap: 13px; padding: 0 16px; border: 1px solid #bfcac6; border-radius: 11px; background: var(--white); transition: border-color .16s ease, box-shadow .16s ease; }
.search-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px #416b781c; }
.search-field svg { width: 21px; flex: 0 0 21px; fill: none; stroke: var(--blue); stroke-width: 1.8; }
.search-field input { width: 100%; padding: 14px 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 15px; }
.search-field input::placeholder { color: #9aa5a3; }
.clear-search { border: 0; background: transparent; color: var(--blue); cursor: pointer; font-size: 12px; font-weight: 800; }
.search-hints { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 11px; }
.search-hints button { padding: 4px 10px; border: 1px solid var(--pencil); border-radius: 99px; color: var(--blue); background: transparent; font-size: 11px; cursor: pointer; }
.search-hints button:hover { border-color: var(--blue); background: var(--blue-soft); }
.recent-section { padding: 18px 0 20px; border-bottom: 1px solid var(--pencil); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.section-kicker { display: block; margin-bottom: 3px; font-size: 11px; }
h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.025em; }
.text-button { padding: 5px 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(55px, 1fr)); gap: 5px; }
.recent-grid { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); margin-top: 11px; }
.emoji-tile { min-width: 0; min-height: 48px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 8px; background: transparent; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; font-size: 26px; line-height: 1.1; cursor: pointer; user-select: none; transition: border-color .14s ease, background-color .14s ease, transform .14s ease; }
.emoji-tile:hover { border-color: var(--pencil); background: var(--white); transform: translateY(-1px); }
.emoji-tile:active { border-color: var(--coral); background: #fbebe4; transform: translateY(0); }
.emoji-tile:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
.recent-empty { margin: 11px 0 0; color: var(--muted); font-size: 12px; }
.library-section { padding: 23px 0 56px; }
.library-heading { margin-bottom: 14px; }
.result-count { padding-bottom: 3px; color: var(--muted); font-size: 12px; }
.category-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 1px 1px 11px; border-bottom: 1px solid var(--pencil); scrollbar-width: thin; }
.category-tab { flex: 0 0 auto; min-height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.category-tab span:first-child { font-size: 17px; }
.category-tab:hover { color: var(--ink); background: var(--blue-soft); }
.category-tab[aria-pressed="true"] { border-color: #c8d6d2; color: var(--ink); background: var(--white); }
.group-section { margin: 19px 0 22px; }
.group-title { display: flex; align-items: center; gap: 9px; margin: 0 0 7px; font-size: 13px; font-weight: 800; }
.group-title small { color: var(--muted); font-size: 11px; font-weight: 500; }
.library-grid { grid-template-columns: repeat(auto-fill, minmax(55px, 1fr)); }
.load-more { display: block; margin: 7px auto 10px; padding: 7px 13px; border: 1px solid var(--pencil); border-radius: 7px; color: var(--blue); background: transparent; font-size: 12px; cursor: pointer; }
.load-more:hover { border-color: var(--blue); background: var(--blue-soft); }
.empty-state { display: flex; flex-direction: column; align-items: center; padding: 40px 12px 50px; color: var(--muted); text-align: center; }
.empty-face { margin-bottom: 10px; font-size: 28px; }
.empty-state p { margin: 0 0 5px; color: var(--ink); font-size: 15px; font-weight: 800; }
.empty-state span:last-child { font-size: 12px; }
.page-footer { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--pencil); color: var(--muted); font-size: 11px; }
.page-footer a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.toast { position: fixed; z-index: 5; left: 50%; bottom: 24px; padding: 10px 16px; border-radius: 99px; color: var(--white); background: var(--ink); font-size: 13px; opacity: 0; pointer-events: none; transform: translate(-50%, 8px); transition: opacity .18s ease, transform .18s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
[hidden] { display: none !important; }
@media (max-width: 640px) {
  .page-shell { width: min(100% - 32px, 520px); }
  .masthead { height: 62px; }
  .masthead-note { font-size: 10px; }
  .intro { min-height: 205px; }
  .intro-copy { padding: 23px 0 25px; }
  h1 { font-size: 35px; }
  .intro-text { max-width: 240px; font-size: 12px; line-height: 1.65; }
  .island-doodle { right: -124px; bottom: -4px; opacity: .4; transform: scale(.72); transform-origin: bottom left; }
  .search-panel { padding-top: 18px; }
  .search-field { min-height: 52px; }
  .search-field input { font-size: 14px; }
  .category-tab { padding: 0 9px; }
  .emoji-grid, .library-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
  .recent-grid { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .emoji-tile { min-height: 44px; font-size: 25px; }
  .page-footer { align-items: flex-start; flex-direction: column; justify-content: center; padding: 13px 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
