:root {
  --bg: #f5f5f4;
  --bg-2: #eeece8;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-strong: #ffffff;
  --ink: #161616;
  --muted: #6d6d6d;
  --line: rgba(22, 22, 22, 0.08);
  --line-strong: rgba(22, 22, 22, 0.14);
  --accent: #202734;
  --accent-2: #3a4557;
  --accent-3: #5a667a;
  --shadow: 0 10px 24px rgba(20, 20, 20, 0.04);
  --shadow-soft: 0 2px 8px rgba(20, 20, 20, 0.03);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #f6f4f1;
  color: var(--ink);
  font-family: "Noto Sans TC", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  font-size: 13px;
}

button {
  border: 0;
  cursor: pointer;
  transition:
    transform 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    opacity 140ms ease;
}

.app-shell {
  width: min(100%, 430px);
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 12px calc(20px + env(safe-area-inset-bottom, 0px));
}

.topbar__row,
.bottom-nav {
  display: flex;
  align-items: center;
}

.topbar__row,
.bottom-nav {
  justify-content: space-between;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 -12px 10px;
  padding: 6px 12px;
  background: rgba(246, 244, 241, 0.9);
  border-bottom: 1px solid rgba(22, 22, 22, 0.05);
  backdrop-filter: blur(16px);
}

.topbar__row {
  min-height: 40px;
}

.brand__badge {
  display: inline-block;
  color: #111111;
  letter-spacing: 0;
  font: 800 16px/1.1 "Noto Sans TC", sans-serif;
}

.login-card__label {
  margin: 0 0 8px;
  color: var(--muted);
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 700;
}

.auth-card h2 {
  margin: 0;
  font-family: "Barlow", sans-serif;
  line-height: 1.04;
}

.ghost-btn {
  min-width: 64px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
}

.page-menu-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  box-shadow: var(--shadow-soft);
}

.page-menu-btn__icon {
  display: block;
  width: 1em;
  height: 1em;
  line-height: 0.88;
  text-align: center;
}

.page-menu-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  justify-content: center;
  padding: 54px 12px 16px;
  background: rgba(22, 22, 22, 0.24);
}

.page-menu-mask.is-open {
  display: flex;
}

.page-menu-sheet {
  width: min(100%, 406px);
  max-height: min(76vh, 540px);
  overflow-y: auto;
  align-self: flex-start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(20, 20, 20, 0.16);
}

.page-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.page-menu-link {
  display: grid;
  align-content: center;
  min-height: 54px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fafafa;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.page-menu-link small {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
}

.auth-card {
  padding: 16px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.auth-card:empty {
  display: none;
}

.auth-card h2 {
  font-size: 26px;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.auth-error {
  display: none;
  margin: 10px 4px 0;
  color: #b43318;
  font-size: 14px;
}

.login-form {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.login-form label {
  display: grid;
  gap: 8px;
}

.login-form span {
  font-size: 13px;
  color: var(--muted);
}

.login-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  font-size: 13px;
}

.login-form input::placeholder {
  color: #9d938b;
  font-size: 13px;
}

.login-form .save-account-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: max-content;
  min-height: 20px;
  gap: 7px;
  margin-top: -4px;
  padding: 1px 3px;
  cursor: pointer;
}

.login-form .save-account-option input {
  appearance: none;
  position: relative;
  order: 1;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin: 0;
  padding: 0;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: none;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.login-form .save-account-option input::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 11px;
  line-height: 1;
  opacity: 0;
}

.login-form .save-account-option input:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.login-form .save-account-option input:checked::after {
  opacity: 1;
}

.login-form .save-account-option span {
  order: 2;
  color: #69645f;
  font-size: 12px;
  line-height: 1;
}

.primary-btn {
  margin-top: 4px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-weight: 800;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: 0 8px 18px rgba(32, 39, 52, 0.16);
}

.primary-btn[disabled] {
  opacity: 0.7;
}

.content {
  margin-top: 8px;
}

.menu-grid {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.menu-card-wrap {
  position: relative;
}

.menu-card {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  min-height: 58px;
  padding: 8px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 249, 0.94));
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.menu-card small {
  font-size: 13px;
  font-weight: 700;
}

.menu-card__newtab {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(246, 247, 249, 0.96);
  border: 1px solid rgba(17, 17, 17, 0.08);
  color: #475569;
  font-size: 11px;
  line-height: 1;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
}

button:active {
  transform: scale(0.985);
}

button:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(71, 85, 105, 0.18);
}

input {
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

input::placeholder,
textarea::placeholder {
  font-size: 13px;
}

input:focus {
  border-color: rgba(58, 69, 87, 0.24);
  background: #ffffff;
}

img,
video {
  display: block;
  max-width: 100%;
}

.menu-card:hover,
.ghost-btn:hover,
.primary-btn:hover {
  opacity: 0.98;
}

.pagination__status {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.pagination__summary,
.pagination__page {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.pagination__summary {
  font-weight: 700;
}

.pagination__page {
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
