:root {
  --bg: #022c22;
  --bg-soft: #064e3b;
  --bg-card: #021b17;
  --accent: #22c55e;
  --accent-soft: rgba(34, 197, 94, 0.18);
  --text: #ecfdf3;
  --text-soft: #a7f3d0;
  --border-subtle: rgba(52, 211, 153, 0.25);
  --radius-lg: 18px;
  --shadow-soft: 0 18px 45px rgba(6, 78, 59, 0.7);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #022c22;
  color: var(--text);
  display: flex;
  flex-direction: column;
}

/* 手機專用 APP 殼架構 */
.mobile-app-body {
  background: #022c22;
}

.mobile-app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.mobile-app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: linear-gradient(to bottom, rgba(6, 78, 59, 0.98), rgba(6, 78, 59, 0.9));
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-app-header-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-app-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.mobile-app-logo-mark {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid var(--accent);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.8);
  background-image: url("/static/Mingtea_LOGO.jpg");
  background-size: contain;
  background-position: center;
}

.mobile-app-logo-text {
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 20px;
  background: linear-gradient(135deg, #bbf7d0, #22c55e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mobile-app-main {
  flex: 1 1 auto;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
  padding: 12px 12px 64px;
}

.mobile-app-tabbar {
  position: sticky;
  bottom: 0;
  z-index: 25;
  background: rgba(15, 23, 42, 0.96);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  max-width: 640px;
  margin: 0 auto;
}

.mobile-app-tab {
  flex: 1 1 0;
  padding: 8px 6px 10px;
  text-align: center;
  text-decoration: none;
  color: var(--text-soft);
  font-size: 12px;
}

.mobile-app-tab.is-active {
  color: #bbf7d0;
  background: rgba(6, 78, 59, 0.9);
}

.mobile-app-tab-label {
  display: block;
}

.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: linear-gradient(to bottom, rgba(6, 78, 59, 0.98), rgba(6, 78, 59, 0.7));
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid var(--accent);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.8);
  background-image: url("/static/Mingtea_LOGO.jpg");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  animation: logoGlow 3s ease-in-out infinite alternate;
}

.logo-text {
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: none;
  font-size: 30px;
  background: linear-gradient(135deg, #bbf7d0, #22c55e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 14px rgba(34, 197, 94, 0.75);
}

.nav a {
  margin-left: 18px;
  text-decoration: none;
  color: var(--text-soft);
  font-size: 14px;
}

.nav a:hover {
  color: #e5e7eb;
}

.site-main {
  padding: 32px 0 40px;
  flex: 1 0 auto;
}

.layout-main {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.layout-content {
  flex: 1 1 auto;
  min-width: 0;
}

.layout-sidebar {
  width: 260px;
  position: sticky;
  top: 96px;
  align-self: flex-start;
}

.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 16px 0 24px;
  color: var(--text-soft);
  font-size: 12px;
  flex-shrink: 0;
}

.page-title {
  font-size: 28px;
  margin: 4px 0 4px;
}

.page-subtitle {
  margin: 0 0 24px;
  color: var(--text-soft);
}

.home-hero {
  position: relative;
  margin-bottom: 28px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: radial-gradient(circle at top, #022c22, #021b17 55%, #021b17);
}

.home-hero-track {
  position: relative;
  width: 100%;
  padding-bottom: 32%; /* 約 3:1 比例，可依實際圖調整 */
}

.home-hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.35s ease-out;
  pointer-events: none;
}

.home-hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.home-hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-hero-caption {
  position: absolute;
  left: 32px;
  bottom: 26px;
  padding: 10px 14px 11px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.2));
  backdrop-filter: blur(10px);
}

.home-hero-caption-title {
  font-size: 18px;
  font-weight: 700;
}

.home-hero-caption-subtitle {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-soft);
}

.home-hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: rgba(15, 23, 42, 0.75);
  color: #e5e7eb;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.home-hero-arrow--prev {
  left: 16px;
}

.home-hero-arrow--next {
  right: 16px;
}

.home-hero-arrow::before {
  content: "";
  border-style: solid;
  border-width: 5px 6px 5px 0;
  border-color: transparent #e5e7eb transparent transparent;
  display: inline-block;
}

.home-hero-arrow--next::before {
  transform: scaleX(-1);
}

.home-hero-dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: inline-flex;
  gap: 6px;
}

.home-hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  background: rgba(148, 163, 184, 0.8);
  cursor: pointer;
  padding: 0;
}

.home-hero-dot.is-active {
  width: 16px;
  background: #22c55e;
}

.product-page {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.product-filters {
  width: 220px;
  background: radial-gradient(circle at top, #022c22, #021b17 55%, #021b17);
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  padding: 14px 14px 16px;
  box-shadow: var(--shadow-soft);
  font-size: 13px;
}

.filters-title {
  margin: 0 0 10px;
  font-size: 16px;
}

.filters-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filters-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filters-label {
  font-size: 12px;
  color: var(--text-soft);
}

.filters-select {
  width: 100%;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
}

.filters-input {
  width: 100%;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
}

.filters-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.filters-checkboxes label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.filters-actions {
  margin-top: 6px;
}

.filters-latest {
  margin-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding-top: 10px;
}

.filters-latest h3 {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text-soft);
}

.filters-latest ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.filters-latest li {
  padding: 2px 0;
}

.filters-latest a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 12px;
}

.filters-latest a span {
  margin-left: 6px;
  font-size: 11px;
  opacity: 0.85;
}

.product-list {
  flex: 1 1 auto;
  min-width: 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.product-card {
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top, #022c22, #021b17 55%, #021b17);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease-out, box-shadow 0.18s ease-out, border-color 0.18s;
  animation: cardFloatIn 0.5s ease-out both;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 60px rgba(6, 78, 59, 0.9);
  border-color: rgba(34, 197, 94, 0.45);
}

.product-card-image {
  position: relative;
  padding-top: 75%;
  background: radial-gradient(circle at top, rgba(34, 197, 94, 0.22), transparent 55%);
}

.product-card-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  font-size: 13px;
}

.product-card-body {
  padding: 14px 14px 16px;
}

.product-card-body h2 {
  font-size: 16px;
  margin: 0 0 6px;
}

.product-card-body p {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-soft);
}

.product-price,
.product-price-large {
  font-weight: 600;
  color: var(--accent);
}

.product-price-large {
  font-size: 22px;
  margin: 4px 0 14px;
}

.product-price-block {
  margin: 4px 0 18px;
}

.product-price-line {
  font-size: 18px;
  line-height: 1.6;
}
.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: flex-start;
}

.product-info {
  max-width: 540px;
  max-height: 720px;
  overflow-y: auto;
  padding-right: 4px;
}

.product-gallery-main {
  background: radial-gradient(circle at top, #022c22, #021b17 55%, #021b17);
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.product-gallery-main img {
  width: 100%;
  height: auto;
  display: block;
}

.product-gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.thumb {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.thumb img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  display: block;
}

.product-gallery-placeholder {
  border-radius: 18px;
  border: 1px dashed var(--border-subtle);
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
}

.product-info h1 {
  margin: 0 0 8px;
}

.product-short {
  margin: 0 0 10px;
  color: var(--text-soft);
}

.product-description {
  margin: 8px 0 16px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* 內容保護遮罩：未登入時模糊處理並顯示登入提示 */
.protected-content {
  position: relative;
}

.protected-content-inner {
  transition: filter 0.2s ease-out;
}

.protected-content--locked .protected-content-inner {
  filter: blur(10px);
  pointer-events: none;
}

.protected-content-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  background: rgba(2, 44, 34, 0.88);
  backdrop-filter: blur(8px);
  border-radius: inherit;
  z-index: 10;
}

.protected-content-overlay-inner {
  max-width: 360px;
}

.protected-content-overlay-title {
  font-size: 18px;
  margin-bottom: 8px;
}

.protected-content-overlay-text {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 14px;
}

/* 回報文：圖片模式卡片 */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.report-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  background: radial-gradient(circle at top, #022c22, #021b17 55%, #021b17);
  box-shadow: var(--shadow-soft);
  transition: transform 0.16s ease-out, box-shadow 0.16s ease-out, border-color 0.16s;
}

.report-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 48px rgba(6, 78, 59, 0.9);
  border-color: rgba(34, 197, 94, 0.45);
}

.report-card-image {
  position: relative;
  padding-top: 70%;
  background: radial-gradient(circle at top, rgba(34, 197, 94, 0.22), transparent 55%);
}

.report-card-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.report-card-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  text-align: center;
  color: var(--text-soft);
  font-size: 13px;
}

.report-card-body {
  padding: 10px 10px 12px;
}

.report-card-title {
  font-size: 14px;
  margin-bottom: 4px;
}

.report-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-soft);
}

.report-card-girl {
  color: #a5b4fc;
}

.report-card-date {
  opacity: 0.85;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, #38bdf8, #a855f7);
  color: #0b1120;
  font-weight: 600;
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text);
}

.member-card {
  max-width: 640px;
  margin: 0 auto;
  background: radial-gradient(circle at top, #022c22, #021b17 55%, #021b17);
  border-radius: 22px;
  border: 1px solid var(--border-subtle);
  padding: 22px 20px 20px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, border-color 0.2s;
}

.member-card--wide {
  max-width: 960px;
}

.member-card--sidebar {
  max-width: none;
  margin: 0;
  padding: 16px 16px 14px;
}

.member-card--sidebar:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 50px rgba(6, 78, 59, 0.9);
  border-color: rgba(34, 197, 94, 0.6);
}

.member-main {
  display: flex;
  gap: 18px;
  align-items: center;
}

.member-main--sidebar {
  align-items: flex-start;
}

.member-avatar {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(34, 197, 94, 0.7);
  background: radial-gradient(circle at top, #22c55e, #022c22);
  display: flex;
  align-items: center;
  justify-content: center;
}

.member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-avatar-placeholder {
  color: #e5e7eb;
  font-weight: 600;
}

.member-info h2 {
  margin: 0 0 4px;
}

.member-id,
.member-status,
.member-email {
  margin: 0 0 4px;
  color: var(--text-soft);
  font-size: 13px;
}

.member-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-soft);
}

.member-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.member-sidebar-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--text-soft);
}

.member-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.member-badge--active {
  border-color: rgba(34, 197, 94, 0.8);
  color: #bbf7d0;
}

.member-badge--guest {
  border-color: rgba(248, 250, 252, 0.2);
  color: rgba(248, 250, 252, 0.8);
}

.member-sidebar-meta {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(15, 118, 110, 0.7);
}

.member-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin: 4px 0;
}

.member-meta-label {
  color: var(--text-soft);
}

.member-meta-value {
  font-weight: 500;
}

#daily-draw-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
  z-index: 40;
}

#daily-draw-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

.daily-draw-dialog {
  background: radial-gradient(circle at top, #022c22, #021b17 55%, #021b17);
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  padding: 20px 22px 18px;
  min-width: 260px;
  max-width: 320px;
  box-shadow: 0 24px 70px rgba(6, 78, 59, 0.95);
  text-align: center;
  animation: cardFloatIn 0.25s ease-out both;
}

.daily-draw-title {
  font-size: 16px;
  margin-bottom: 8px;
}

.daily-draw-status {
  font-size: 14px;
  color: var(--text-soft);
  animation: shimmer 1.2s ease-in-out infinite;
}

.btn-daily-draw {
  margin-left: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  border: none;
  font-size: 11px;
  cursor: pointer;
  background: linear-gradient(135deg, #38bdf8, #a855f7);
  color: #0b1120;
}

@keyframes shimmer {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

@keyframes logoGlow {
  from {
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
    transform: scale(1);
  }
  to {
    box-shadow: 0 0 16px rgba(74, 222, 128, 1);
    transform: scale(1.04);
  }
}

@keyframes cardFloatIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.flash-list {
  margin-top: 12px;
}

.flash {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(248, 250, 252, 0.04);
  margin-bottom: 6px;
}

.flash-danger {
  border-color: rgba(248, 113, 113, 0.8);
  color: #fecaca;
}

.flash-info {
  border-color: rgba(59, 130, 246, 0.8);
}

.member-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}

/* 手機會員中心 APP 風格 */
.mobile-member-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mobile-member-hero {
  display: flex;
  gap: 12px;
  padding: 16px 14px;
  border-radius: 18px;
  background: radial-gradient(circle at top, #022c22, #021b17 55%, #021b17);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.mobile-member-avatar {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(34, 197, 94, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #22c55e, #022c22);
}

.mobile-member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mobile-member-avatar-placeholder {
  color: #e5e7eb;
  font-weight: 600;
}

.mobile-member-hero-text {
  flex: 1 1 auto;
}

.mobile-member-name {
  margin: 0 0 4px;
  font-size: 20px;
}

.mobile-member-id {
  margin: 0 0 2px;
  font-size: 13px;
  color: var(--text-soft);
}

.mobile-member-level {
  margin: 0;
  font-size: 13px;
  color: #bbf7d0;
}

.mobile-member-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-member-card {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: rgba(6, 78, 59, 0.85);
}

.mobile-member-card-label {
  font-size: 12px;
  color: var(--text-soft);
}

.mobile-member-card-value {
  font-size: 18px;
  margin-top: 4px;
}

.mobile-member-card-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-soft);
}

.mobile-member-info {
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(15, 118, 110, 0.8);
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.mobile-member-info-row {
  display: flex;
  justify-content: space-between;
}

.mobile-member-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-member-action-main {
  width: 100%;
}

.mobile-member-action-secondary {
  width: 100%;
  text-align: center;
}

.mobile-member-login {
  padding: 32px 16px;
  text-align: center;
}

.mobile-member-login-title {
  margin: 0 0 8px;
  font-size: 22px;
}

.mobile-member-login-sub {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--text-soft);
}

.mobile-member-login-btn {
  width: 100%;
  justify-content: center;
}

/* 前台右下角一對一客服視窗 */
.support-chat-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 35;
}

.support-chat-toggle {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-soft);
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(6, 78, 59, 0.8);
}

.support-chat-panel {
  position: absolute;
  right: 0;
  bottom: 52px;
  width: 320px;
  max-height: 420px;
  display: none;
  flex-direction: column;
  background: radial-gradient(circle at top, #022c22, #021b17 55%, #021b17);
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.support-chat-panel.is-open {
  display: flex;
}

.support-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(15, 118, 110, 0.7);
}

.support-chat-title {
  font-size: 14px;
}

.support-chat-close {
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-size: 18px;
  cursor: pointer;
}

.support-chat-body {
  display: flex;
  flex-direction: column;
  padding: 8px 10px 10px;
  gap: 8px;
}

.support-chat-system {
  font-size: 13px;
  color: var(--text-soft);
}

.support-chat-login-action {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.support-chat-messages {
  flex: 1 1 auto;
  min-height: 120px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.support-chat-message {
  display: flex;
}

.support-chat-message--member {
  justify-content: flex-end;
}

.support-chat-message--admin {
  justify-content: flex-start;
}

.support-chat-bubble {
  max-width: 80%;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
}

.support-chat-message--member .support-chat-bubble {
  background: linear-gradient(135deg, #38bdf8, #a855f7);
  color: #0b1120;
  border-bottom-right-radius: 2px;
}

.support-chat-message--admin .support-chat-bubble {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: 2px;
}

.support-chat-form {
  margin-top: 6px;
  display: flex;
  gap: 6px;
}

.support-chat-form textarea {
  flex: 1 1 auto;
  resize: none;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  font-size: 13px;
  padding: 8px 10px;
}

.support-chat-send {
  padding-inline: 14px;
  font-size: 13px;
}

.support-chat-read {
  margin-top: 2px;
  font-size: 11px;
  color: rgba(226, 232, 240, 0.85);
}

/* 後台客服一對一版面 */
.admin-support-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  margin-top: 18px;
  min-height: calc(100vh - 220px);
}

.admin-support-sidebar {
  border-right: 1px solid rgba(15, 118, 110, 0.7);
  padding-right: 10px;
}

.admin-support-sidebar-title {
  font-size: 15px;
  margin-bottom: 8px;
}

.admin-support-thread-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.admin-support-thread-item a {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-soft);
  font-size: 14px;
}

.admin-support-thread-item.is-active a {
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

.admin-support-thread-name {
  font-weight: 600;
}

.admin-support-thread-last {
  font-size: 12px;
  opacity: 0.8;
}

.admin-support-thread-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.admin-support-thread-link {
  flex: 1 1 auto;
}

.admin-support-thread-meta {
  display: flex;
  gap: 6px;
  font-size: 11px;
  opacity: 0.85;
}

.admin-support-thread-no {
  color: var(--text-soft);
}

.admin-support-pin-form {
  margin: 0;
}

.admin-support-pin-btn {
  border: none;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 16px;
}

.admin-support-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: calc(100vh - 240px);
}

.admin-support-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-support-title {
  font-size: 18px;
}

.admin-support-subtitle {
  font-size: 13px;
  color: var(--text-soft);
}

.admin-support-messages {
  min-height: 220px;
  max-height: 65vh; /* 最多佔視窗高度約 65% ，避免太長 */
  height: auto;
  overflow-y: auto;
  padding: 8px 4px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-support-message {
  display: flex;
}

.admin-support-message--member {
  justify-content: flex-end;
}

.admin-support-message--admin {
  justify-content: flex-start;
}

.admin-support-bubble {
  max-width: 75%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 14px;
}

.admin-support-read {
  margin-left: 6px;
  font-size: 11px;
  color: rgba(148, 163, 184, 0.9);
  align-self: flex-end;
}

.admin-support-message--member .admin-support-bubble {
  background: linear-gradient(135deg, #38bdf8, #a855f7);
  color: #0b1120;
  border-bottom-right-radius: 2px;
}

.admin-support-message--admin .admin-support-bubble {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: 2px;
}

.admin-support-form {
  margin-top: 6px;
  display: flex;
  gap: 8px;
}

.admin-support-form textarea {
  flex: 1 1 auto;
  resize: none;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  font-size: 14px;
  padding: 8px 10px;
}

.admin-support-input-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.admin-support-plus {
  width: 32px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 18px;
}

.admin-support-reserve {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(15, 118, 110, 0.7);
  background: rgba(15, 23, 42, 0.9);
  display: none;
  font-size: 13px;
}

.admin-support-reserve.is-open {
  display: block;
}

.admin-support-reserve-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.admin-support-reserve-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.admin-support-reserve-row label {
  width: 52px;
  font-size: 12px;
  color: var(--text-soft);
}

.admin-support-reserve-row select,
.admin-support-reserve-row input {
  flex: 1 1 auto;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  padding: 4px 8px;
  font-size: 13px;
}

.admin-support-reserve-apply {
  margin-top: 4px;
  font-size: 13px;
}

.admin-support-profile {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(15, 118, 110, 0.7);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.admin-support-profile-field {
  flex: 1 1 40%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-support-profile-field label {
  font-size: 12px;
  color: var(--text-soft);
}

.admin-support-profile-field input,
.admin-support-profile-field textarea {
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  padding: 4px 8px;
  font-size: 13px;
}

.admin-support-profile-save {
  font-size: 13px;
}

.liff-wrapper {
  max-width: 520px;
  margin: 0 auto;
  background: rgba(6, 78, 59, 0.9);
  border-radius: 20px;
  padding: 20px 18px 18px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.liff-status {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
}

.liff-debug {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #020617;
  border: 1px dashed var(--border-subtle);
  font-size: 11px;
  max-height: 260px;
  overflow: auto;
}

@media (max-width: 768px) {
  .layout-main {
    flex-direction: column;
  }

  .layout-sidebar {
    width: 100%;
    position: static;
    margin-top: 16px;
  }

  .product-page {
    flex-direction: column;
  }

  .product-filters {
    width: 100%;
  }

  .product-detail {
    grid-template-columns: minmax(0, 1fr);
  }

  .header-inner {
    padding-inline: 4px;
  }

  .member-main {
    flex-direction: row;
    align-items: flex-start;
  }

  .support-chat-root {
    right: 12px;
    bottom: 12px;
  }

  .support-chat-panel {
    position: fixed;
    right: 0;
    left: 0;
    bottom: 72px;
    margin: 0 auto;
    width: calc(100vw - 40px);
  }

  .admin-support-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-support-sidebar {
    border-right: none;
    border-bottom: 1px solid rgba(15, 118, 110, 0.7);
    padding-bottom: 8px;
    margin-bottom: 8px;
  }
}

/* 針對手機（約 iPhone 17 Pro Max 寬度）優化版型 */
@media (max-width: 480px) {
  .container {
    padding: 0 10px;
  }

  .header-inner {
    padding: 10px 0;
    gap: 8px;
  }

  .logo-text {
    font-size: 22px;
    letter-spacing: 0.12em;
  }

  .nav a {
    margin-left: 10px;
    font-size: 12px;
  }

  .home-hero {
    margin: 8px -10px 16px;
    border-radius: 0;
  }

  .home-hero-track {
    padding-bottom: 52%;
  }

  .page-title {
    font-size: 22px;
  }

  .page-subtitle {
    font-size: 13px;
  }

  .product-page {
    flex-direction: column;
    gap: 14px;
  }

  .product-filters {
    padding: 12px;
    box-shadow: none;
  }

  .product-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .product-card-body h2 {
    font-size: 15px;
  }

  .product-detail {
    gap: 18px;
  }

  .product-info {
    max-height: none;
  }

  .member-card,
  .member-card--wide {
    max-width: 100%;
    padding-inline: 14px;
  }

  .member-info h2 {
    font-size: 18px;
  }

  .member-id,
  .member-status,
  .member-email {
    font-size: 13px;
  }

  .support-chat-toggle {
    font-size: 15px;
  }

  .support-chat-bubble {
    font-size: 14px;
  }

  .admin-support-title {
    font-size: 17px;
  }

  .admin-support-bubble {
    font-size: 15px;
  }

  .reports-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}
