/* 探索首頁（冒險島外殼） */

body.theme-quest {
  --hq-bg: #07111f;
  --hq-panel: rgba(12, 24, 42, 0.78);
  --hq-border: rgba(148, 163, 184, 0.22);
  --hq-text: #e8eef8;
  --hq-muted: #93a4bd;
  --hq-accent: #34d399;
  --hq-accent-2: #60a5fa;
  color: var(--hq-text);
}

body.theme-quest .app-bg {
  display: none;
}

.hq-app {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  background: #07111f;
}

.hq-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  container-type: inline-size;
  container-name: hqmain;
}

.hq-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.1rem 0.9rem;
  background: linear-gradient(180deg, rgba(6, 14, 28, 0.92), rgba(6, 14, 28, 0.78));
  border-right: 1px solid var(--hq-border);
  backdrop-filter: blur(10px);
  /* 左側固定：不隨右側內容捲動 */
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.hq-sidebar-backdrop {
  display: none;
}

.hq-sidebar-close {
  display: none;
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
}

.hq-menu-toggle {
  display: none;
}

/* 固定底欄預設隱藏（須蓋過後面 .hq-dock 的 display:grid） */
nav.hq-dock.hq-mobile-dock {
  display: none;
}

.hq-sidebar-account {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--hq-border);
}

.hq-sidebar-user-wrap {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.hq-sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.45rem 0.45rem;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.hq-sidebar-user:hover,
.hq-sidebar-user[aria-expanded='true'] {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 163, 184, 0.28);
}

.hq-sidebar-user-avatar {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: linear-gradient(145deg, #22d3ee, #6366f1);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
}

.hq-sidebar-user-avatar.has-image {
  background: #0f172a;
  padding: 0;
}

.hq-sidebar-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hq-sidebar-user-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.hq-sidebar-user-label {
  font-size: 0.68rem;
  color: #93a4bd;
}

.hq-sidebar-user-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hq-sidebar-user-caret {
  color: #94a3b8;
  font-size: 0.7rem;
  transition: transform 0.15s ease;
}

.hq-sidebar-user[aria-expanded='true'] .hq-sidebar-user-caret {
  transform: rotate(180deg);
}

/* 管理者：與使用者名稱同一列、靠右 */
.hq-sidebar-admin-btn {
  flex-shrink: 0;
  margin-left: auto;
  padding: 0.28rem 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(96, 165, 250, 0.45);
  background: rgba(37, 99, 235, 0.22);
  color: #bfdbfe;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.2;
}

.hq-sidebar-admin-btn:hover {
  background: rgba(37, 99, 235, 0.38);
  color: #fff;
}

.hq-user-menu-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 0.35rem);
  padding: 0.35rem;
  border-radius: 0.75rem;
  background: #0f172a;
  border: 1px solid var(--hq-border);
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.35);
  z-index: 45;
}

.hq-user-menu-panel.hidden {
  display: none;
}

.hq-user-menu-panel button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #e2e8f0;
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-radius: 0.55rem;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.hq-user-menu-panel button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.hq-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.hq-modal.hidden,
.hq-modal[hidden] {
  display: none;
}

.hq-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
}

.hq-modal-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  border-radius: 1rem;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  padding: 1rem 1rem 1.1rem;
}

.hq-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.hq-modal-header h2 {
  margin: 0;
  font-size: 1.15rem;
  color: #f8fafc;
}

.hq-modal-close {
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
}

.hq-profile-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.hq-profile-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: #cbd5e1;
  font-size: 0.85rem;
}

.hq-profile-field input,
.hq-profile-field select {
  border-radius: 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  font: inherit;
  padding: 0.65rem 0.75rem;
}

.hq-profile-avatars {
  margin: 0;
  padding: 0;
  border: 0;
}

.hq-profile-avatars legend {
  padding: 0;
  margin-bottom: 0.45rem;
  color: #cbd5e1;
  font-size: 0.85rem;
}

.hq-avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.hq-avatar-option {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 0.85rem;
  background: rgba(15, 23, 42, 0.85);
  min-height: 4.6rem;
  padding: 0.3rem;
  font-size: 1.45rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.hq-avatar-option.is-image {
  background: #020617;
}

.hq-avatar-option img {
  width: 3.6rem;
  height: 3.6rem;
  object-fit: cover;
  border-radius: 999px;
  display: block;
}

.hq-avatar-option.is-selected {
  border-color: #22d3ee;
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.25);
}

.hq-profile-email-box {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-top: 0.25rem;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.hq-profile-security {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.hq-profile-security h3 {
  margin: 0;
  font-size: 0.95rem;
  color: #e2e8f0;
  font-weight: 650;
}

.hq-profile-hint {
  margin: 0;
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.45;
}

.hq-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.25rem;
}


.hq-sidebar-admin-btn.hidden {
  display: none;
}

.hq-sidebar-account-link {
  display: block;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  padding: 0.55rem 0.75rem;
  background: transparent;
  color: #cbd5e1;
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.hq-sidebar-account-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.hq-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.55rem 2.2rem 0.95rem;
  border-bottom: 1px solid var(--hq-border);
  position: relative;
}

.hq-brand-logo {
  display: block;
  width: auto;
  height: 4.7rem;
  max-width: 12rem;
  object-fit: contain;
  object-position: center center;
  margin: 0 auto;
}

.hq-brand-mark {
  display: none;
}

.hq-brand-title,
.hq-brand-sub {
  display: none;
}

.hq-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.hq-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  border: 0;
  border-radius: 0.85rem;
  padding: 0.7rem 0.8rem;
  background: transparent;
  color: var(--hq-muted);
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.hq-nav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.hq-nav-btn.active {
  background: rgba(52, 211, 153, 0.16);
  color: #a7f3d0;
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.35);
}

.hq-nav-icon {
  width: 1.35rem;
  text-align: center;
  font-size: 1rem;
}

.hq-punch {
  margin-top: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 1rem 0.85rem 0.95rem;
  border-radius: 1.15rem;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(56, 189, 248, 0.12), transparent 55%),
    linear-gradient(180deg, #121c2e 0%, #0b1424 100%);
  border: 1px solid rgba(100, 140, 190, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 22px rgba(0, 0, 0, 0.28);
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

.hq-punch:hover {
  border-color: rgba(56, 189, 248, 0.55);
  transform: translateY(-1px);
}

.hq-punch-icon {
  width: 3.6rem;
  height: 3.6rem;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
}

.hq-punch-title {
  margin: 0.15rem 0 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.hq-punch-desc {
  margin: 0;
  font-size: 0.8rem;
  color: #9aa8bc;
  line-height: 1.35;
}

.hq-punch-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  min-width: 5.5rem;
  padding: 0.28rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}

.hq-punch-badge-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  line-height: 1;
  background: rgba(52, 211, 153, 0.25);
  color: #a7f3d0;
}

.hq-punch-badge.is-pending {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fcd34d;
}

.hq-punch-badge.is-pending .hq-punch-badge-icon {
  background: rgba(251, 191, 36, 0.2);
  color: #fde68a;
}

.hq-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  background: rgba(7, 17, 31, 0.45);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  backdrop-filter: blur(8px);
}

.hq-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--hq-border);
  font-size: 0.78rem;
  color: #dbe7f7;
  white-space: nowrap;
}

.hq-stat-chip .hq-chip-icon {
  font-size: 0.9rem;
}

.hq-user-menu {
  position: relative;
}

.hq-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--hq-border);
  border-radius: 999px;
  padding: 0.3rem 0.7rem 0.3rem 0.35rem;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.hq-user-avatar {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #22d3ee, #6366f1);
  font-size: 0.75rem;
  font-weight: 700;
}

.hq-user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 10rem;
  padding: 0.35rem;
  border-radius: 0.75rem;
  background: #0f172a;
  border: 1px solid var(--hq-border);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  z-index: 40;
}

.hq-user-dropdown.hidden {
  display: none;
}

.hq-user-dropdown a,
.hq-user-dropdown button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: #e2e8f0;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-radius: 0.55rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
}

.hq-user-dropdown a:hover,
.hq-user-dropdown button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.hq-content {
  flex: 1;
  min-height: 0;
  width: 100%;
  /* 右側獨立捲動 */
  overflow: auto;
  overscroll-behavior: contain;
  padding: 1rem 1.4rem 1.2rem;
  background-color: #07111f;
  background-image: url('/images/home/bg-home.jpg');
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: local;
}

/* 僅放在首頁（探索）內容底部，隨頁面捲動，不固定螢幕底端 */
.hq-dock {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding: 0.85rem 0 0.25rem;
  background: transparent;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

/* 再次確保：電腦版絕不顯示固定底欄 */
nav.hq-dock.hq-mobile-dock {
  display: none;
}

@container hqmain (max-width: 860px) {
  .hq-dock {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.hq-dock-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  min-height: 4.1rem;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 1.05rem;
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0.55rem 0.7rem 0.55rem 0.65rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 22px rgba(0, 0, 0, 0.28);
  transition:
    transform 0.18s ease,
    filter 0.18s ease,
    box-shadow 0.18s ease;
}

.hq-dock-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.hq-dock-btn:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.hq-dock-icon {
  width: 2.85rem;
  height: 2.85rem;
  flex: 0 0 auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

.hq-dock-text {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
  flex: 1 1 auto;
}

.hq-dock-label {
  line-height: 1.2;
  font-weight: 700;
  font-size: clamp(0.88rem, 1.05vw, 1.02rem);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hq-dock-desc {
  line-height: 1.25;
  font-size: clamp(0.7rem, 0.85vw, 0.8rem);
  font-weight: 500;
  color: rgba(226, 232, 240, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hq-dock-chevron {
  flex: 0 0 auto;
  font-size: 1.35rem;
  font-weight: 300;
  line-height: 1;
  color: rgba(203, 213, 225, 0.72);
  margin-left: auto;
  padding-left: 0.15rem;
}

/* 單字學習：深綠底＋青绿外框光暈 */
.hq-dock-learn {
  background:
    radial-gradient(120% 140% at 12% 20%, rgba(45, 212, 191, 0.16), transparent 55%),
    linear-gradient(160deg, #0d2f28 0%, #061a16 100%);
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(110, 231, 183, 0.18),
    0 0 0 1px rgba(16, 185, 129, 0.12),
    0 0 18px rgba(16, 185, 129, 0.22),
    0 10px 22px rgba(0, 0, 0, 0.28);
}

/* 單字測驗：深炭黑底＋青銅橘外框 */
.hq-dock-quiz {
  background:
    radial-gradient(120% 140% at 12% 20%, rgba(251, 146, 60, 0.14), transparent 55%),
    linear-gradient(160deg, #1c1713 0%, #0f0c0a 100%);
  border-color: rgba(180, 120, 70, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(253, 186, 116, 0.12),
    0 0 0 1px rgba(180, 120, 70, 0.18),
    0 0 16px rgba(180, 83, 9, 0.18),
    0 10px 22px rgba(0, 0, 0, 0.28);
}

/* 拼字挑戰：深紫海軍藍＋淡紫外框 */
.hq-dock-spelling {
  background:
    radial-gradient(120% 140% at 12% 20%, rgba(167, 139, 250, 0.16), transparent 55%),
    linear-gradient(160deg, #1a1630 0%, #0f0e1a 100%);
  border-color: rgba(139, 120, 200, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(196, 181, 253, 0.14),
    0 0 0 1px rgba(124, 58, 237, 0.12),
    0 0 18px rgba(109, 40, 217, 0.2),
    0 10px 22px rgba(0, 0, 0, 0.28);
}

/* 隨機複習：深藍底＋亮藍外框 */
.hq-dock-review {
  background:
    radial-gradient(120% 140% at 12% 20%, rgba(56, 189, 248, 0.14), transparent 55%),
    linear-gradient(160deg, #0b1d33 0%, #061018 100%);
  border-color: rgba(56, 160, 255, 0.75);
  box-shadow:
    inset 0 1px 0 rgba(125, 211, 252, 0.14),
    0 0 0 1px rgba(14, 165, 233, 0.16),
    0 0 18px rgba(14, 165, 233, 0.28),
    0 10px 22px rgba(0, 0, 0, 0.28);
}

/* 探索地圖與儀表板 */
#panel-explore {
  color: var(--hq-text);
  width: 100%;
}

.hq-explore-board {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.hq-explore-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  grid-template-areas:
    'hero tasks'
    'islands tasks';
  gap: 1.1rem 1.25rem;
  align-items: start;
  width: 100%;
}

.hq-explore-main {
  min-width: 0;
  width: 100%;
}

.hq-explore-hero-row {
  grid-area: hero;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin: 0.2rem 0 0;
}

.hq-explore-hero {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.hq-explore-hero h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.hq-explore-hero-desc,
.hq-explore-hero p {
  margin: 0.35rem 0 0;
  color: #c7d5ea;
  font-size: 0.92rem;
}

/* 右上狀態環：外環＝等級／100 */
.hq-status-ring {
  position: relative;
  flex-shrink: 0;
  width: 7.5rem;
  height: 7.5rem;
}

.hq-status-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.hq-status-ring-track,
.hq-status-ring-progress {
  fill: none;
  stroke-width: 8;
}

.hq-status-ring-track {
  stroke: rgba(148, 163, 184, 0.28);
}

.hq-status-ring-progress {
  stroke: #34d399;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 0.45s ease;
  filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.45));
}

.hq-status-ring-body {
  position: absolute;
  inset: 0.7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 999px;
  background: radial-gradient(
    circle at 40% 30%,
    rgba(30, 58, 95, 0.95),
    rgba(8, 18, 34, 0.96)
  );
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 0.2rem;
}

.hq-ring-label {
  margin: 0;
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  color: #93a4bd;
}

.hq-ring-streak {
  margin: 0.12rem 0 0;
  font-size: 0.68rem;
  font-weight: 600;
  color: #fde68a;
  line-height: 1.2;
}

.hq-ring-xp {
  margin: 0.08rem 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1.2;
}

.hq-ring-level {
  margin: 0.08rem 0 0;
  font-size: 0.78rem;
  font-weight: 800;
  color: #6ee7b7;
  line-height: 1.15;
}

.hq-island-map {
  grid-area: islands;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem 1.2rem;
  width: 100%;
  margin: 0;
}

.hq-island-card {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: center;
  padding: 0.2rem;
  width: 100%;
  transition: transform 0.18s ease;
}

.hq-island-card:hover,
.hq-island-card:focus-visible {
  transform: translateY(-4px) scale(1.02);
  outline: none;
}

.hq-island-art {
  width: 100%;
  max-width: 280px;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.45));
}

.hq-island-meta {
  margin-top: 0.45rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.85rem;
  background: rgba(8, 18, 34, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(6px);
}

.hq-island-name {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}

.hq-island-progress {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: #9fb3d0;
}

.hq-island-bar {
  margin-top: 0.4rem;
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.hq-island-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #34d399, #22d3ee);
}

.hq-dash-row {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1.1fr;
  gap: 1rem;
  width: 100%;
}

.hq-dash-card {
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: rgba(10, 20, 36, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  min-height: 11rem;
}

.hq-dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.hq-dash-card-head h3 {
  margin: 0;
  font-size: 0.98rem;
  color: #fff;
}

.hq-dash-tag {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.18);
  color: #bfdbfe;
}

.hq-dash-today-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 0.6rem;
  align-items: start;
}

.hq-dash-today-body-solo {
  grid-template-columns: minmax(0, 1fr);
}

.hq-dash-word {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
}

.hq-dash-word-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.hq-dash-word-head .hq-dash-word {
  min-width: 0;
  overflow-wrap: anywhere;
}

.hq-dash-speak {
  flex-shrink: 0;
}

.hq-dash-phonetic {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: #5eead4;
}

.hq-dash-meaning {
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
  color: #dbe7f7;
  line-height: 1.4;
}

.hq-dash-example {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: #93a4bd;
  font-style: italic;
  line-height: 1.4;
}

.hq-dash-example-tr {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: #a8b9cf;
  line-height: 1.4;
}

.hq-dash-example:empty,
.hq-dash-example-tr:empty {
  display: none;
}

.hq-dash-art-slot {
  width: 88px;
  height: 110px;
  border-radius: 0.85rem;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.04);
}

.hq-dash-mastery {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.45rem;
  align-items: center;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: #93a4bd;
}

.hq-dash-bar {
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.hq-dash-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #34d399, #60a5fa);
}

.hq-review-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.hq-review-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 0.6rem;
  align-items: center;
}

.hq-review-word {
  margin: 0;
  font-size: 0.9rem;
  color: #fff;
  font-weight: 600;
}

.hq-review-pct {
  margin: 0;
  font-size: 0.75rem;
  color: #93a4bd;
}

.hq-review-empty {
  color: #93a4bd;
  font-size: 0.85rem;
}

.hq-trail-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
  align-items: end;
  min-height: 8rem;
  padding: 0.35rem 0.2rem 0.2rem;
}

.hq-trail-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  height: 100%;
  min-height: 7.2rem;
  justify-content: flex-end;
}

.hq-trail-col.is-today .hq-trail-day {
  color: #6ee7b7;
  font-weight: 700;
}

.hq-trail-count {
  font-size: 0.68rem;
  color: #cbd5e1;
  line-height: 1;
  min-height: 0.85rem;
}

.hq-trail-bar {
  width: 100%;
  max-width: 1.4rem;
  border-radius: 0.45rem 0.45rem 0.2rem 0.2rem;
  background: linear-gradient(180deg, #67e8f9, #2563eb);
  min-height: 0.4rem;
  transition: height 0.25s ease;
}

.hq-trail-day {
  font-size: 0.68rem;
  color: #93a4bd;
}

.hq-trail-desc {
  margin: 0.55rem 0 0;
  font-size: 0.8rem;
  color: #9fb3d0;
}

.hq-trail-empty {
  grid-column: 1 / -1;
  margin: 0;
  color: #93a4bd;
  font-size: 0.85rem;
  text-align: center;
}

/* 每日打卡月曆 */
.hq-checkin-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.hq-checkin-modal.hidden {
  display: none !important;
}

.hq-checkin-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 20, 0.72);
  backdrop-filter: blur(4px);
}

.hq-checkin-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  padding: 1rem 1.05rem 1.15rem;
  border-radius: 1.15rem;
  background: linear-gradient(180deg, #122033, #0b1422);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  color: #e8eef8;
}

.hq-checkin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.hq-checkin-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.hq-checkin-sub {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  color: #93a4bd;
}

.hq-checkin-close {
  border: 0;
  background: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.hq-checkin-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.hq-checkin-month {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
}

.hq-checkin-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.25rem;
  margin-bottom: 0.35rem;
  text-align: center;
  font-size: 0.72rem;
  color: #93a4bd;
}

.hq-checkin-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.3rem;
  min-height: 12rem;
}

.hq-checkin-loading {
  grid-column: 1 / -1;
  margin: 1rem 0;
  text-align: center;
  color: #93a4bd;
  font-size: 0.85rem;
}

.hq-checkin-cell {
  aspect-ratio: 1;
  min-height: 2.2rem;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  background: rgba(15, 23, 42, 0.55);
  color: #e2e8f0;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  padding: 0.2rem;
}

.hq-checkin-cell.is-empty {
  visibility: hidden;
  pointer-events: none;
}

.hq-checkin-cell.is-checked {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(16, 185, 129, 0.14);
}

.hq-checkin-cell.is-today {
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.7);
}

.hq-checkin-cell.is-selected {
  border-color: #60a5fa;
  background: rgba(37, 99, 235, 0.28);
}

.hq-checkin-daynum {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
}

.hq-checkin-dot {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: transparent;
}

.hq-checkin-cell.is-checked .hq-checkin-dot {
  background: #34d399;
}

.hq-checkin-detail {
  margin-top: 0.9rem;
  padding: 0.8rem 0.85rem;
  border-radius: 0.9rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.hq-checkin-detail-title {
  margin: 0 0 0.55rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.hq-checkin-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.hq-checkin-stats li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.84rem;
  color: #b7c6db;
}

.hq-checkin-stats strong {
  color: #fff;
  font-variant-numeric: tabular-nums;
}

body.hq-checkin-open {
  overflow: hidden;
}

body.theme-quest .btn-star {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(148, 163, 184, 0.4);
  color: #94a3b8;
}

body.theme-quest .btn-star:hover {
  background: rgba(250, 204, 21, 0.16);
  border-color: rgba(250, 204, 21, 0.55);
  color: #facc15;
}

body.theme-quest .btn-star.is-starred {
  background: rgba(250, 204, 21, 0.95);
  border-color: #f59e0b;
  color: #78350f;
}

body.theme-quest .btn-star.is-starred:hover {
  background: #fde047;
  color: #713f12;
}

.hq-tasks {
  grid-area: tasks;
  position: sticky;
  top: 0.4rem;
}

.hq-tasks-card {
  min-height: 16rem;
}

.hq-task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.hq-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.hq-task-item:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.hq-task-title {
  margin: 0;
  font-size: 0.88rem;
  color: #fff;
  font-weight: 600;
}

.hq-task-meta {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: #93a4bd;
}

.hq-task-status {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.18);
  color: #6ee7b7;
}

.hq-task-status.is-pending {
  background: rgba(251, 191, 36, 0.16);
  color: #fcd34d;
}

.hq-tasks-link {
  margin-top: 0.9rem;
  width: 100%;
  border: 0;
  background: transparent;
  color: #93c5fd;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
  padding: 0;
}

.hq-tasks-link:hover {
  color: #bfdbfe;
}

/* 舊頂部／分頁列隱藏，改由側邊＋底部操作 */
body.theme-quest .app-header,
body.theme-quest .tab-nav {
  display: none !important;
}

body.theme-quest .app-shell {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0;
  background: transparent;
  overflow-x: visible;
}

body.theme-quest .main-content {
  padding: 0;
  background: transparent;
  width: 100%;
  max-width: none;
}

body.theme-quest .panel {
  background: transparent;
  width: 100%;
  max-width: none;
}

body.theme-quest .boot-error {
  margin: 0.75rem 1rem;
}

body.theme-quest .stat-card,
body.theme-quest .card-glass,
body.theme-quest .word-card,
body.theme-quest .settings-card,
body.theme-quest .quiz-hero,
body.theme-quest .quiz-card,
body.theme-quest .spelling-hero,
body.theme-quest .spelling-card,
body.theme-quest .spelling-status,
body.theme-quest .spelling-summary,
body.theme-quest .empty-state {
  background: rgba(12, 24, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: var(--hq-text);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

body.theme-quest .panel-title,
body.theme-quest .word-text,
body.theme-quest .stat-value {
  color: #fff;
}

body.theme-quest .panel-desc,
body.theme-quest .stat-label,
body.theme-quest .word-meaning,
body.theme-quest .word-pos,
body.theme-quest .field-label {
  color: #b7c6db;
}

/* 學習設定：說明／標籤文字略加深，較易閱讀 */
body.theme-quest #panel-settings .panel-desc,
body.theme-quest #panel-settings .field-label,
body.theme-quest #panel-settings .field-hint {
  color: #d5e0f0;
}

/* 登入帳號區塊為淺底，文字改深色 */
body.theme-quest #panel-settings .account-banner {
  color: #1e293b;
  background: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.45);
}

body.theme-quest #panel-settings .account-banner .mini-label {
  color: #475569;
}

body.theme-quest #panel-settings .account-banner strong {
  color: #0f172a;
}

body.theme-quest #panel-settings .account-banner .account-email {
  color: #334155;
}

/* 選項文字（在深色卡片上）略加亮 */
body.theme-quest #panel-settings .word-order-option {
  color: #e2e8f0;
}

/* 學習設定內淺色區塊上的字加深（白底／淺底） */
body.theme-quest #panel-settings .level-option-row,
body.theme-quest #panel-settings .settings-stats,
body.theme-quest #panel-settings .auto-goal-box,
body.theme-quest #panel-settings .setup-hint {
  color: #1e293b;
}

body.theme-quest #panel-settings .level-option,
body.theme-quest #panel-settings .level-option-row .field-label,
body.theme-quest #panel-settings .settings-stats .mini-label,
body.theme-quest #panel-settings .settings-stats strong,
body.theme-quest #panel-settings .auto-goal-box .field-label,
body.theme-quest #panel-settings .auto-goal-box .field-hint,
body.theme-quest #panel-settings .auto-goal-detail,
body.theme-quest #panel-settings .setup-hint .panel-desc,
body.theme-quest #panel-settings .setup-hint .setup-steps,
body.theme-quest #panel-settings .setup-steps {
  color: #334155;
}

body.theme-quest #panel-settings .setup-title {
  color: #0f172a;
}

body.theme-quest #panel-settings #custom-daily-goal-field.is-disabled {
  opacity: 0.55;
}

body.theme-quest .word-example,
body.theme-quest .word-example-translation {
  color: #9fb0c8;
}

body.theme-quest input,
body.theme-quest textarea,
body.theme-quest select {
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.28);
}

/* 僅手機顯示「返回探索地圖」；桌面瀏覽器隱藏 */
.hq-panel-back,
.hq-learn-back {
  display: none;
  margin-bottom: 0.75rem;
}

@media (max-width: 980px) {
  .hq-app {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
  }

  .hq-main {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  /* 側欄改抽屜，預設隱藏 */
  .hq-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(2, 8, 20, 0.55);
    border: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.hq-sidebar-open .hq-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .hq-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 90;
    width: min(86vw, 300px);
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 1rem;
    border-right: 1px solid var(--hq-border);
    border-bottom: 0;
    /* 避開手機狀態列（時間／電量）；無 safe-area 時仍保留最小上邊距 */
    padding: max(1.85rem, calc(env(safe-area-inset-top, 0px) + 0.85rem)) 0.9rem 1rem;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.35);
  }

  body.hq-sidebar-open .hq-sidebar {
    transform: translateX(0);
  }

  .hq-sidebar-close {
    display: grid;
    place-items: center;
    margin-left: auto;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--hq-border);
    border-radius: 0.55rem;
    background: rgba(15, 23, 42, 0.75);
    color: #e2e8f0;
    font-size: 0.95rem;
    cursor: pointer;
  }

  .hq-brand {
    width: 100%;
    border-bottom: 1px solid var(--hq-border);
    padding-bottom: 0.75rem;
  }

  .hq-nav {
    flex-direction: column;
    flex-wrap: nowrap;
    width: 100%;
  }

  .hq-nav-btn {
    flex: 0 0 auto;
    justify-content: flex-start;
    padding: 0.65rem 0.75rem;
    font-size: 0.9rem;
  }

  .hq-punch {
    width: 100%;
  }

  /* 頂欄精簡：狀態已在圓環，隱藏 chip */
  .hq-topbar {
    display: none;
  }

  .hq-content {
    flex: 1;
    min-height: 0;
    overflow: auto;
    /* 避開手機狀態列；無 safe-area 時仍保留最小上邊距 */
    padding: max(1.55rem, calc(env(safe-area-inset-top, 0px) + 0.65rem)) 0.85rem 1rem;
  }

  .hq-menu-toggle {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 2.55rem;
    height: 2.55rem;
    margin-top: 0.15rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 0.75rem;
    background: rgba(8, 18, 34, 0.82);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  }

  .hq-menu-toggle-bars,
  .hq-menu-toggle-bars::before,
  .hq-menu-toggle-bars::after {
    display: block;
    width: 1.15rem;
    height: 2px;
    border-radius: 999px;
    background: #e2e8f0;
  }

  .hq-menu-toggle-bars {
    position: relative;
  }

  .hq-menu-toggle-bars::before,
  .hq-menu-toggle-bars::after {
    content: '';
    position: absolute;
    left: 0;
  }

  .hq-menu-toggle-bars::before {
    top: -6px;
  }

  .hq-menu-toggle-bars::after {
    top: 6px;
  }

  /*
   * 手機探索頂區：
   * [☰] [問候] [狀態環]
   * [ ] [任務] [狀態環]  ← 問候+任務高度落在狀態環範圍內，頂端切齊
   */
  .hq-explore-top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      'menu hero ring'
      '. tasks ring'
      'islands islands islands';
    column-gap: 0.5rem;
    row-gap: 0.35rem;
    align-items: start;
  }

  .hq-explore-hero-row {
    display: contents;
  }

  .hq-menu-toggle {
    grid-area: menu;
    align-self: start;
    margin-top: 0;
  }

  .hq-explore-hero {
    grid-area: hero;
    align-self: start;
  }

  .hq-explore-hero h2 {
    font-size: 0.98rem;
    line-height: 1.3;
  }

  .hq-explore-hero-desc {
    display: none;
  }

  .hq-status-ring {
    grid-area: ring;
    width: 6.1rem;
    height: 6.1rem;
    margin-top: 0;
    align-self: start;
  }

  .hq-ring-label {
    font-size: 0.52rem;
  }

  .hq-ring-streak {
    font-size: 0.62rem;
  }

  .hq-ring-xp {
    font-size: 0.66rem;
  }

  .hq-ring-level {
    font-size: 0.72rem;
  }

  .hq-tasks {
    grid-area: tasks;
    position: static;
    width: 100%;
    max-height: 3.55rem;
    overflow: hidden;
  }

  .hq-tasks-card {
    min-height: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
  }

  .hq-tasks .hq-dash-card-head,
  .hq-tasks-link {
    display: none;
  }

  .hq-task-list {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.3rem;
  }

  .hq-task-item {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    padding: 0.28rem 0.35rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.55rem;
    background: rgba(8, 18, 34, 0.72);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  }

  .hq-task-item:last-of-type {
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding-bottom: 0.28rem;
  }

  .hq-task-title {
    font-size: 0.62rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .hq-task-meta {
    margin: 0;
    font-size: 0.6rem;
  }

  .hq-task-status {
    align-self: flex-end;
    font-size: 0.58rem;
    padding: 0.08rem 0.3rem;
  }

  .hq-island-map {
    grid-area: islands;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hq-dash-row {
    grid-template-columns: 1fr;
  }

  /* 返回探索地圖：僅手機顯示，縮小並避開狀態列 */
  .hq-panel-back,
  .hq-learn-back {
    display: block;
    margin: 0 0 0.55rem;
    padding-top: 0.15rem;
  }

  .hq-panel-back .btn,
  .hq-learn-back .btn {
    font-size: 0.72rem;
    padding: 0.28rem 0.55rem;
    min-height: 0;
    line-height: 1.2;
    border-radius: 0.55rem;
  }

  /* 探索頁內的桌面快捷列隱藏；改用底部固定導航 */
  .hq-dock-desktop {
    display: none;
  }

  nav.hq-dock.hq-mobile-dock {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    flex-shrink: 0;
    gap: 0.35rem;
    z-index: 50;
    margin: 0;
    padding: 0.45rem 0.45rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
    background: rgba(6, 14, 28, 0.94);
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    backdrop-filter: blur(12px);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
  }

  /* 舊版頂部 tab 列隱藏，改由漢堡選單進入 */
  .tab-nav,
  .app-header {
    display: none !important;
  }

  .hq-mobile-dock .hq-dock-btn {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.2rem;
    min-height: 3.55rem;
    padding: 0.35rem 0.2rem;
    border-radius: 0.85rem;
    text-align: center;
  }

  .hq-mobile-dock .hq-dock-icon {
    width: 1.85rem;
    height: 1.85rem;
  }

  .hq-mobile-dock .hq-dock-text {
    width: 100%;
  }

  .hq-mobile-dock .hq-dock-label {
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
  }

  .hq-mobile-dock .hq-dock-desc,
  .hq-mobile-dock .hq-dock-chevron {
    display: none;
  }

  .hq-mobile-dock .hq-dock-btn.is-active {
    filter: brightness(1.12);
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.28),
      0 0 0 2px rgba(52, 211, 153, 0.35);
  }

  body.hq-sidebar-open {
    overflow: hidden;
  }
}

@media (max-width: 560px) {
  .hq-island-map {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }

  .hq-island-art {
    width: min(100%, 160px);
  }

  .hq-stat-chip {
    font-size: 0.72rem;
  }

  .hq-dock {
    gap: 0.5rem;
    padding: 0.65rem 0.75rem 0.85rem;
  }

  .hq-dock-btn {
    min-height: 3.7rem;
    padding: 0.45rem 0.55rem 0.45rem 0.5rem;
    gap: 0.5rem;
    border-radius: 0.95rem;
  }

  .hq-dock-icon {
    width: 2.4rem;
    height: 2.4rem;
  }

  .hq-dock-label {
    font-size: 0.86rem;
  }

  .hq-dock-desc {
    font-size: 0.68rem;
  }

  .hq-dock-chevron {
    font-size: 1.15rem;
  }

  .hq-dash-today-body {
    grid-template-columns: 1fr;
  }
}
