/* ========================================
   Coffee Recipe Site — Mobile First
   ======================================== */

:root {
  /* 主色调 — 咖啡暖色系 */
  --color-bg: #ffffff;
  --color-bg-gradient: linear-gradient(165deg, #fffcf8 0%, #fff5eb 42%, #f8efe6 100%);
  --color-surface: #fffcf8;
  --color-surface-warm: #fff8f0;
  --color-primary: #5c3d2e;
  --color-primary-dark: #3d2518;
  --color-primary-light: #8b5e3c;
  --color-accent: #c67b4e;
  --color-accent-gold: #e8b86d;
  --color-accent-rose: #c9848e;
  --color-accent-sage: #7a9e7e;
  --color-accent-sky: #6b9ebf;
  --color-accent-plum: #9b7bb8;
  --color-text: #2c1810;
  --color-text-muted: #8a6f5c;
  --color-border: #e0cfc0;
  --color-border-light: #edd9c8;
  --color-ad-bg: #f8efe6;
  --color-ad-border: #d9c4b0;

  /* 功能按钮色 */
  --func-open-bg: #fff9ec;
  --func-open-color: #f5a623;
  --func-close-bg: #f6f0fa;
  --func-close-color: #9b59b6;
  --func-task-bg: #fdf0f2;
  --func-task-color: #ef5350;
  --func-prep-bg: #eef8ef;
  --func-prep-color: #43a047;
  --func-more-bg: #edf6fd;
  --func-more-color: #2196f3;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 6px rgba(92, 61, 46, 0.08);
  --shadow-hover: 0 4px 14px rgba(92, 61, 46, 0.12);
  --shadow-colored: 0 2px 10px rgba(198, 123, 78, 0.18);
  --header-height: 46px;
  --header-bg: linear-gradient(
    90deg,
    #fff9ec 0%,
    #f6f0fa 22%,
    #fdf0f2 45%,
    #eef8ef 68%,
    #edf6fd 100%
  );
  --header-border: rgba(224, 207, 192, 0.6);
  --header-text: var(--color-text);
  --notice-slot-height: calc(0.625rem * 1.25 * 2);
  --max-width: 480px;
  --sidebar-width: 260px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body,
a,
button,
input,
textarea,
select,
summary,
nav,
label,
[role="button"],
.func-btn,
.func-bar,
.category-block__item,
.alphabet-index,
.alphabet-index__btn,
.quick-tags__btn,
.header-menu__btn,
.install-trigger,
.menu-trigger,
.search-box__clear,
.menu-dialog__btn,
.changelog-item__head {
  -webkit-tap-highlight-color: transparent !important;
  tap-highlight-color: transparent !important;
}

a,
button,
input,
textarea,
select,
summary,
[role="button"] {
  outline: none;
  -webkit-focus-ring-color: transparent;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
  outline: none;
}

html {
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior-y: none;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #ffffff;
  background-attachment: fixed;
  color: var(--color-text);
  line-height: 1.45;
  min-height: 100vh;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---- Ad Slots ---- */
.ad-slot {
  background: linear-gradient(135deg, var(--color-ad-bg), #f5e8dc);
  border: 1px dashed var(--color-ad-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  overflow: hidden;
}

.ad-slot--banner {
  width: 100%;
  min-height: 44px;
  margin-bottom: 0.625rem;
}

.ad-slot--sidebar {
  width: 100%;
  min-height: 250px;
  position: sticky;
  top: calc(var(--header-height) + 1rem);
}

.ad-slot--bottom {
  width: 100%;
  min-height: 56px;
  margin-top: 1rem;
}

.ad-slot--loaded {
  background: transparent;
  border: none;
  min-height: auto;
  display: block;
}

.ad-slot--loaded .adsbygoogle {
  display: block;
  width: 100%;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  box-shadow: 0 2px 10px rgba(92, 61, 46, 0.08);
  overflow: visible;
}

.site-header__inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  height: var(--header-height);
  text-decoration: none;
  gap: 0.0625rem;
  transform: translateY(5px);
}

.site-logo__title {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--header-text);
}

.site-logo__sub {
  font-size: 0.5rem;
  font-weight: 400;
  line-height: 1.25;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
  align-self: center;
}

/* ---- Menu Trigger ---- */
.site-header__actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.125rem;
}

.install-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--header-text);
  cursor: pointer;
  transition: background 0.2s;
}

.install-trigger:hover {
  background: rgba(255, 255, 255, 0.45);
}

.install-trigger__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
}

.menu-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s;
}

.menu-trigger:hover {
  background: rgba(255, 255, 255, 0.45);
}

.menu-trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.55);
}

.menu-trigger__icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
}

.menu-trigger__icon--dots span {
  display: block;
  width: 4px;
  height: 4px;
  background: var(--header-text);
  border-radius: 50%;
  transition: transform 0.2s, opacity 0.2s;
}

.menu-trigger[aria-expanded="true"] .menu-trigger__icon--dots span:nth-child(1) {
  transform: translateY(7px);
}

.menu-trigger[aria-expanded="true"] .menu-trigger__icon--dots span:nth-child(2) {
  opacity: 0;
}

.menu-trigger[aria-expanded="true"] .menu-trigger__icon--dots span:nth-child(3) {
  transform: translateY(-7px);
}

/* ---- Header Menu Popup ---- */
.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: transparent;
  pointer-events: none;
}

.menu-backdrop.is-visible {
  pointer-events: auto;
}

.header-menu {
  position: absolute;
  top: calc(100% + 0.375rem);
  right: 0;
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.96);
  transform-origin: top right;
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  pointer-events: none;
}

.header-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.header-menu__grid {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 5.75rem;
  padding: 0;
  background: transparent;
}

.header-menu__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.125rem;
  padding: 0.5rem 0.875rem;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  background: #ffffff;
  color: #000000;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: background 0.15s, box-shadow 0.15s;
}

.header-menu__btn:hover {
  background: #fafafa;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.header-menu__btn:active {
  background: #f5f5f5;
}

.header-menu__label {
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}

/* ---- Menu Dialog ---- */
.menu-dialog {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(44, 24, 16, 0.35);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s, visibility 0.25s;
}

.menu-dialog.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.menu-dialog__panel {
  position: relative;
  width: min(360px, 100%);
  max-height: min(80dvh, 560px);
  padding: 1.25rem 1rem 1rem;
  background: #fffcf8;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(92, 61, 46, 0.18);
  overflow-y: auto;
}

.menu-dialog__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.625rem;
  text-align: center;
}

.menu-dialog__body {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.menu-dialog__placeholder {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.menu-dialog__message {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--color-text);
  line-height: 1.55;
  text-align: center;
}

.menu-dialog__actions {
  display: flex;
  gap: 0.5rem;
}

.menu-dialog__btn {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}

.menu-dialog__btn--cancel {
  background: #f0f0f0;
  color: var(--color-text-muted);
}

.menu-dialog__btn--cancel:hover {
  background: #e8e8e8;
}

.menu-dialog__btn--confirm {
  background: #2196f3;
  color: #ffffff;
}

.menu-dialog__btn--confirm:hover {
  opacity: 0.92;
}

/* ---- Changelog ---- */
.menu-dialog__panel:has(.changelog-list) {
  width: min(380px, 100%);
}

.changelog-list {
  max-height: min(52dvh, 420px);
  overflow-y: auto;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}

.changelog-item {
  border-bottom: 1px solid #ececec;
}

.changelog-item:last-child {
  border-bottom: none;
}

.changelog-item__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.changelog-item__meta {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.changelog-item__date {
  flex-shrink: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #333333;
}

.changelog-item__title {
  font-size: 0.8125rem;
  font-weight: 400;
  color: #9e9e9e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.changelog-item__toggle {
  flex-shrink: 0;
  font-size: 0.8125rem;
  color: #bdbdbd;
}

.changelog-item__body {
  display: none;
  padding: 0 0 0.75rem;
}

.changelog-item.is-open .changelog-item__body {
  display: block;
}

.changelog-item__list {
  counter-reset: changelog-item;
  margin: 0;
  padding: 0 0 0 0.125rem;
  list-style: none;
  font-size: 0.8125rem;
  line-height: 1.65;
  color: #9e9e9e;
}

.changelog-item__list li {
  counter-increment: changelog-item;
}

.changelog-item__list li + li {
  margin-top: 0.25rem;
}

.changelog-item__list li::before {
  content: counter(changelog-item) '、';
}

.disclaimer-content {
  max-height: min(52dvh, 420px);
  overflow-y: auto;
}

.disclaimer-text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: #666666;
  text-align: left;
}

.disclaimer-text + .disclaimer-text {
  margin-top: 0.875rem;
}

.about-text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: #666666;
  text-align: left;
}

.about-text + .about-text {
  margin-top: 0.875rem;
}

/* ---- Func checklists (开早 / 打烊) ---- */
.func-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.func-checklist__row {
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--color-text);
}

.func-checklist__row:nth-child(1) { background: var(--func-open-bg); }
.func-checklist__row:nth-child(2) { background: var(--func-close-bg); }
.func-checklist__row:nth-child(3) { background: var(--func-task-bg); }
.func-checklist__row:nth-child(4) { background: var(--func-prep-bg); }
.func-checklist__row:nth-child(5) { background: var(--func-more-bg); }

.func-phases {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.func-phase {
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-sm);
}

.func-phase:nth-child(1) { background: var(--func-open-bg); }
.func-phase:nth-child(2) { background: var(--func-close-bg); }
.func-phase:nth-child(3) { background: var(--func-more-bg); }

.func-phase__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.375rem;
}

.func-phase__item {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-text);
  margin: 0;
}

.func-phase__item + .func-phase__item {
  margin-top: 0.25rem;
}

/* ---- Main Layout ---- */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.625rem 0.75rem;
  overscroll-behavior-y: none;
}

.layout-with-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.layout-with-sidebar__main {
  flex: 1;
  min-width: 0;
}

.layout-with-sidebar__aside {
  display: none;
}

/* ---- Notice Bar ---- */
.notice-bar {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: #e3f2fd;
  border: 1px solid #bbdefb;
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  min-height: 28px;
  margin-bottom: 0.625rem;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(33, 150, 243, 0.1);
}

.notice-bar__badge {
  flex-shrink: 0;
  font-size: 0.625rem;
  font-weight: 600;
  color: #fff;
  background: #2196f3;
  padding: 0.0625rem 0.375rem;
  border-radius: 3px;
  line-height: 1.35;
}

.notice-bar__item {
  height: var(--notice-slot-height);
  margin: 0;
  padding: 0;
  color: #0d47a1;
  overflow: hidden;
  box-sizing: border-box;
}

.notice-bar__item--short {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 0.75rem;
  line-height: 1.25;
  text-align: left;
  white-space: nowrap;
}

.notice-bar__item--compact {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 0.625rem;
  line-height: 1.25;
  text-align: left;
  white-space: nowrap;
}

.notice-bar__item--long {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  -webkit-box-pack: center;
  font-size: 0.625rem;
  line-height: 1.25;
  text-align: left;
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
}

@keyframes notice-scroll {
  0%, 28% { transform: translateY(0); }
  33%, 61% { transform: translateY(calc(-1 * var(--notice-slot-height))); }
  66%, 94% { transform: translateY(calc(-2 * var(--notice-slot-height))); }
  100% { transform: translateY(0); }
}

.notice-bar__viewport {
  flex: 1;
  height: var(--notice-slot-height);
  overflow: hidden;
  position: relative;
}

.notice-bar__track {
  animation: notice-scroll 12s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* ---- Function Bar ---- */
.func-bar-wrap {
  margin-bottom: 0.4375rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius);
  background: linear-gradient(
    135deg,
    #fff9ec 0%,
    #f6f0fa 22%,
    #fdf0f2 45%,
    #eef8ef 68%,
    #edf6fd 100%
  );
  box-shadow: 0 2px 10px rgba(92, 61, 46, 0.08);
}

.func-bar {
  display: flex;
  justify-content: center;
  gap: 0.875rem;
}

.func-btn {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 3.75rem;
  height: 3.75rem;
  padding: 0.375rem;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s, box-shadow 0.15s;
  border: none;
  box-shadow:
    0 2px 8px rgba(92, 61, 46, 0.12),
    0 1px 3px rgba(0, 0, 0, 0.06);
  -webkit-appearance: none;
  appearance: none;
}

.func-btn:nth-child(1) { background: var(--func-open-bg); }
.func-btn:nth-child(2) { background: var(--func-close-bg); }
.func-btn:nth-child(3) { background: var(--func-task-bg); }
.func-btn:nth-child(4) { background: var(--func-prep-bg); }
.func-btn:nth-child(5) { background: var(--func-more-bg); }

.func-btn:hover {
  filter: brightness(0.98);
  box-shadow:
    0 4px 12px rgba(92, 61, 46, 0.16),
    0 2px 4px rgba(0, 0, 0, 0.08);
}

.func-btn:active {
  transform: scale(0.95);
  box-shadow:
    0 1px 4px rgba(92, 61, 46, 0.1),
    0 1px 2px rgba(0, 0, 0, 0.05);
}

.func-btn:nth-child(1) .func-btn__icon,
.func-btn:nth-child(1) .func-btn__label { color: var(--func-open-color); }
.func-btn:nth-child(2) .func-btn__icon,
.func-btn:nth-child(2) .func-btn__label { color: var(--func-close-color); }
.func-btn:nth-child(3) .func-btn__icon,
.func-btn:nth-child(3) .func-btn__label { color: var(--func-task-color); }
.func-btn:nth-child(4) .func-btn__icon,
.func-btn:nth-child(4) .func-btn__label { color: var(--func-prep-color); }
.func-btn:nth-child(5) .func-btn__icon,
.func-btn:nth-child(5) .func-btn__label { color: var(--func-more-color); }

.func-btn__icon {
  width: 1.375rem;
  height: 1.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.func-btn__icon svg {
  width: 100%;
  height: 100%;
}

.func-btn__label {
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
}

/* ---- Search & Filter ---- */
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.4375rem;
  margin-bottom: 0.625rem;
  padding: 0 10px;
}

.search-box {
  position: relative;
}

.search-box__input {
  width: 100%;
  padding: 0.5rem 2rem 0.5rem 2.125rem;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  font-size: 0.8125rem;
  background: #f8fbff;
  color: var(--color-text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.search-box__input::-webkit-search-cancel-button,
.search-box__input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.search-box__input::-ms-clear {
  display: none;
}

.search-box__input:focus {
  border-color: #90caf9;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.12);
}

.search-box__input::placeholder {
  color: #90a4ae;
}

.search-box__icon {
  position: absolute;
  left: 0.6875rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  color: #64b5f6;
  pointer-events: none;
}

.search-box__icon svg {
  width: 100%;
  height: 100%;
}

.search-box__clear {
  position: absolute;
  right: 0.5625rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #ef5350;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.search-box__clear:hover {
  background: rgba(239, 83, 80, 0.08);
  opacity: 1;
}

.search-box__clear[hidden] {
  display: none;
}

.quick-tags {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.3125rem;
}

.quick-tags__btn {
  min-width: 0;
  padding: 0.375rem 0.25rem;
  border: 1px solid #e3f2fd;
  border-radius: 8px;
  background: #f8fbff;
  color: #1976d2;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(33, 150, 243, 0.06);
  -webkit-tap-highlight-color: transparent;
}

.quick-tags__btn:hover {
  background: #e3f2fd;
  border-color: #bbdefb;
  color: #1565c0;
}

.quick-tags__btn.is-active {
  background: #2196f3;
  border-color: #2196f3;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(33, 150, 243, 0.22);
}

.alphabet-index {
  --alphabet-btn-size: 1.0625rem;
  --alphabet-count: 26;
  position: fixed;
  right: 0;
  top: calc(50lvh - (var(--alphabet-count) * var(--alphabet-btn-size) / 2));
  transform: none;
  z-index: 999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 1.125rem;
  height: auto;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  pointer-events: auto;
  touch-action: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.alphabet-index__btn {
  flex: 0 0 var(--alphabet-btn-size);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: var(--alphabet-btn-size);
  min-height: var(--alphabet-btn-size);
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: rgba(102, 102, 102, 0.85);
  font-size: 0.625rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.alphabet-index__btn:hover:not(.is-disabled) {
  color: var(--color-primary);
  transform: scale(1.15);
}

.alphabet-index__btn:active,
.alphabet-index:active {
  background: transparent;
}

.alphabet-index__btn.is-active {
  color: var(--color-primary);
  font-weight: 700;
  transform: scale(1.2);
}

.alphabet-index__btn.is-disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

.category-filter {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.25rem;
}

.category-filter::-webkit-scrollbar {
  display: none;
}

.category-filter__btn {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.category-filter__btn:hover {
  border-color: var(--color-accent);
  color: var(--color-primary);
  background: var(--color-surface-warm);
}

.category-filter__btn.is-active {
  background: linear-gradient(135deg, #8b5e3c, #5c3d2e);
  border-color: #5c3d2e;
  color: #fff;
  box-shadow: 0 2px 8px rgba(92, 61, 46, 0.3);
}

.category-filter__btn:nth-child(2):not(.is-active):hover { border-color: #e57373; color: #c62828; }
.category-filter__btn:nth-child(3):not(.is-active):hover { border-color: #64b5f6; color: #1565c0; }
.category-filter__btn:nth-child(4):not(.is-active):hover { border-color: #ba68c8; color: #7b1fa2; }
.category-filter__btn:nth-child(5):not(.is-active):hover { border-color: #aed581; color: #558b2f; }

/* ---- Recipe Groups (by category) ---- */
.recipe-groups {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.category-block {
  background: var(--cat-bg, var(--color-surface-warm));
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.625rem 0.75rem;
  box-shadow: 0 1px 4px rgba(92, 61, 46, 0.06);
}

.category-block__title {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--cat-accent, var(--color-primary));
  margin-bottom: 0.5rem;
  padding-left: 0.0625rem;
}

.category-block__bar {
  display: inline-block;
  width: 3px;
  height: 0.9375rem;
  background: var(--cat-accent, var(--color-primary));
  border-radius: 2px;
  flex-shrink: 0;
  opacity: 0.85;
}

.category-block__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.3125rem;
}

.category-block__item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.3125rem 0.125rem;
  background: var(--cat-item-bg, #fff);
  border: none;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--color-text);
  text-align: center;
  line-height: 1.25;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s, box-shadow 0.2s;
  word-break: break-all;
  -webkit-appearance: none;
  appearance: none;
}

.category-block__item:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  color: var(--cat-accent, var(--color-primary));
}

.category-block__item:active {
  transform: translateY(0);
  background: var(--cat-item-bg, #fff);
  color: var(--color-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.category-block__badge {
  position: absolute;
  top: -1px;
  right: -1px;
  padding: 0.0625rem 0.3125rem;
  font-size: 0.5625rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #42a5f5, #1e88e5);
  border-radius: 0 var(--radius-sm) 0 6px;
  line-height: 1.3;
  pointer-events: none;
}

/* ---- Recipe List (legacy, unused) ---- */
.recipe-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  list-style: none;
}

.recipe-list__count {
  font-size: 0.8125rem;
  color: var(--color-primary-light);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.recipe-list__item {
  display: block;
  padding: 0.875rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  text-align: center;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 1px 4px rgba(92, 61, 46, 0.06);
}

.recipe-list__item:nth-child(3n + 1) {
  background: linear-gradient(145deg, #fffcf8, #fff5eb);
  border-left: 3px solid var(--color-accent-gold);
}

.recipe-list__item:nth-child(3n + 2) {
  background: linear-gradient(145deg, #fffcf8, #f5f0eb);
  border-left: 3px solid var(--color-accent);
}

.recipe-list__item:nth-child(3n) {
  background: linear-gradient(145deg, #fffcf8, #f0ebe5);
  border-left: 3px solid var(--color-accent-rose);
}

.recipe-list__item:hover {
  border-color: var(--color-accent);
  background: #fff8f0;
  color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-colored);
}

.recipe-list__item:active {
  transform: translateY(0);
  background: var(--color-border-light);
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.empty-state__text {
  font-size: 1rem;
}

/* ---- Recipe Detail ---- */
.recipe-detail {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border-light);
}

.recipe-detail__content {
  padding: 0.875rem;
}

.recipe-detail__header {
  margin-bottom: 1rem;
  padding-bottom: 0.875rem;
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--color-accent-gold), var(--color-accent), var(--color-accent-rose)) 1;
}

.recipe-detail__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.recipe-detail__name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
}

.recipe-detail__tag {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}

.recipe-detail__tag--新 {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.recipe-detail__tag--旧 {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
}

.recipe-detail__tag--下架 {
  background: #fce4ec;
  color: #c62828;
  border: 1px solid #f48fb1;
}

.recipe-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.recipe-detail__meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.recipe-detail__meta-item strong {
  color: var(--color-accent);
  font-weight: 600;
}

.recipe-detail__section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary-light);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-border-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.recipe-detail__section-title::before {
  content: '';
  width: 4px;
  height: 1em;
  background: linear-gradient(180deg, var(--color-accent-gold), var(--color-accent));
  border-radius: 2px;
}

.recipe-detail__section {
  margin-bottom: 0;
}

.recipe-detail__notes {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.recipe-detail__steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.recipe-detail__step {
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  line-height: 1.55;
}

.recipe-detail__step-text {
  margin: 0;
  word-break: break-word;
}

.recipe-detail__step-label {
  font-weight: 700;
}

.recipe-detail__step--empty {
  color: var(--color-text-muted);
  font-style: italic;
  background: var(--color-surface-warm);
}

.recipe-detail__step--cold {
  background: #e3f2fd;
  color: #0d47a1;
}

.recipe-detail__step--cold .recipe-detail__step-label {
  color: #1565c0;
}

.recipe-detail__step--hot {
  background: #ffebee;
  color: #b71c1c;
}

.recipe-detail__step--hot .recipe-detail__step-label {
  color: #c62828;
}

.recipe-detail__step--sparkling {
  background: #f3e5f5;
  color: #6a1b9a;
}

.recipe-detail__step--sparkling .recipe-detail__step-label {
  color: #7b1fa2;
}

.recipe-detail__step--variant-a {
  background: #e8f5e9;
  color: #1b5e20;
}

.recipe-detail__step--variant-a .recipe-detail__step-label {
  color: #2e7d32;
}

.recipe-detail__step--variant-b {
  background: #fff8e1;
  color: #e65100;
}

.recipe-detail__step--variant-b .recipe-detail__step-label {
  color: #ef6c00;
}

.recipe-detail__step--variant-c {
  background: #e0f7fa;
  color: #006064;
}

.recipe-detail__step--variant-c .recipe-detail__step-label {
  color: #00838f;
}

.recipe-detail__version {
  margin-top: 0.875rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border-light);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-align: right;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--color-surface-warm);
  border: 1px solid var(--color-border-light);
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

/* ---- Recipe Page Layout ---- */
.page-recipe {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-gradient);
  background-attachment: fixed;
}

.page-recipe .main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: none;
  width: 100%;
  padding: 0.625rem 0.75rem 0;
}

.page-recipe .layout-with-sidebar__aside {
  display: none;
}

.page-recipe .layout-with-sidebar {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
}

.page-recipe .layout-with-sidebar__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  min-height: 0;
}

.page-recipe #recipe-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 0;
  min-height: 0;
  box-sizing: border-box;
}

.page-recipe .recipe-detail {
  width: 100%;
  box-shadow:
    0 6px 22px rgba(92, 61, 46, 0.14),
    0 2px 8px rgba(92, 61, 46, 0.08);
}

.page-recipe .back-link {
  margin-top: 0.875rem;
  margin-bottom: 0;
}

.page-recipe .ad-slot--banner {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

.page-recipe .ad-slot--bottom {
  flex-shrink: 0;
  margin-top: 0;
  padding-top: 1rem;
}

.back-link:hover {
  color: var(--color-primary);
  background: #fff8f0;
  border-color: var(--color-accent);
}

/* ---- Loading & Error ---- */
.loading,
.error-message {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
}

.error-message {
  color: #c0392b;
}

/* ---- Footer ---- */
.site-footer {
  text-align: center;
  padding: 1rem 0.75rem 1.25rem;
  font-size: 0.6875rem;
  color: var(--color-text-muted);
  background: transparent;
  border-top: none;
  margin-top: 1rem;
}

.site-footer__line {
  line-height: 1.65;
}

.site-footer__line + .site-footer__line {
  margin-top: 0.125rem;
}

.site-footer__update {
  margin-top: 2rem;
  line-height: 1.65;
}

/* ========================================
   Tablet (≥ 600px)
   ======================================== */
@media (min-width: 600px) {
  .category-block {
    padding: 0.75rem 0.75rem 0.875rem;
  }

  .category-block__item {
    font-size: 0.8125rem;
    min-height: 2.25rem;
    padding: 0.4375rem 0.3125rem;
  }

  .toolbar {
    flex-direction: row;
    align-items: center;
  }

  .search-box {
    flex: 1;
  }

  .category-filter {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .ad-slot--banner {
    min-height: 90px;
  }
}

/* ========================================
   Desktop (≥ 900px)
   ======================================== */
@media (min-width: 900px) {
  .main-content {
    padding: 0.75rem;
  }

  .page-recipe .main-content {
    max-width: none;
    width: 100%;
    padding: 0.75rem 0.75rem 0;
  }

  .page-recipe .layout-with-sidebar {
    flex-direction: column;
  }

  .page-recipe .layout-with-sidebar__aside {
    display: none;
  }

  .category-block__grid {
    gap: 0.4375rem;
  }

  .layout-with-sidebar {
    flex-direction: row;
    align-items: flex-start;
  }

  .layout-with-sidebar__aside {
    display: block;
    width: var(--sidebar-width);
    flex-shrink: 0;
  }

  .recipe-detail__name {
    font-size: 1.375rem;
  }

  .recipe-detail__content {
    padding: 1rem;
  }

  .ad-slot--banner {
    min-height: 90px;
  }

  .ad-slot--sidebar {
    min-height: 600px;
  }
}

/* ---- Touch highlight cleanup (keep last for priority) ---- */
html {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
  tap-highlight-color: transparent !important;
  highlight-color: transparent;
}

.func-btn,
.func-btn:focus,
.func-btn:active,
.func-bar,
.func-bar-wrap,
.category-block__item,
.category-block__item:focus,
.category-block__item:active,
.alphabet-index,
.alphabet-index:focus,
.alphabet-index:active,
.alphabet-index__btn,
.alphabet-index__btn:focus,
.alphabet-index__btn:active,
.quick-tags__btn,
.quick-tags__btn:focus,
.quick-tags__btn:active,
.header-menu__btn,
.header-menu__btn:focus,
.header-menu__btn:active,
.install-trigger,
.install-trigger:focus,
.install-trigger:active,
.menu-trigger,
.menu-trigger:focus,
.menu-trigger:active,
.site-logo,
.site-logo:focus,
.site-logo:active,
.back-link,
.back-link:focus,
.back-link:active,
.menu-dialog__btn,
.menu-dialog__btn:focus,
.menu-dialog__btn:active,
.changelog-item__head,
.changelog-item__head:focus,
.changelog-item__head:active {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
  tap-highlight-color: transparent !important;
  highlight-color: transparent;
  outline: none !important;
  -webkit-focus-ring-color: transparent !important;
  -webkit-touch-callout: none;
}

.category-block__item:active,
.category-block__item:focus {
  background: var(--cat-item-bg, #fff);
  color: var(--color-text);
}
