/* ==========================================================================
   AuraSound Cloud - 手機端外殼與佈局架構 (Mobile Shell & Gestures)
   專為 iPhone (Dynamic Island / Safe Area) 與 Android 旗艦直向操作優化
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-dark-base);
  color: var(--text-primary);
  font-family: var(--font-family-base);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 霓虹環境光暈球 (Ambient Glow Orbs) */
.ambient-glow-wrapper {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  will-change: transform;
}

.orb-1 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.4) 0%, rgba(79, 172, 254, 0.05) 70%);
  top: -80px;
  left: -80px;
  animation: floatOrb1 18s ease-in-out infinite alternate;
}

.orb-2 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(121, 40, 202, 0.35) 0%, rgba(255, 0, 128, 0.05) 70%);
  bottom: 80px;
  right: -100px;
  animation: floatOrb2 22s ease-in-out infinite alternate;
}

.orb-3 {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(245, 175, 25, 0.28) 0%, rgba(230, 92, 0, 0.05) 70%);
  top: 45%;
  left: 20%;
  animation: floatOrb3 15s ease-in-out infinite alternate;
}

@keyframes floatOrb1 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 80px) scale(1.15); }
  100% { transform: translate(-30px, 40px) scale(0.9); }
}

@keyframes floatOrb2 {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-80px, -60px) scale(1.2); }
  100% { transform: translate(40px, -40px) scale(0.95); }
}

@keyframes floatOrb3 {
  0% { transform: translate(0, 0) scale(0.9); }
  100% { transform: translate(50px, -50px) scale(1.25); }
}

/* 手機主應用容器 */
.mobile-app {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  z-index: 1;
  overflow: hidden;
  background: radial-gradient(120% 120% at 50% 10%, rgba(25, 33, 52, 0.3) 0%, rgba(10, 14, 23, 0.95) 100%);
}

/* 頂部狀態列 */
.app-header {
  height: calc(var(--header-height) + var(--safe-top));
  padding-top: var(--safe-top);
  padding-left: 16px;
  padding-right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  background: rgba(15, 20, 32, 0.65);
  border-bottom: 1px solid var(--glass-border-subtle);
  z-index: 10;
  flex-shrink: 0;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 242, 254, 0.3);
  color: #fff;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  background: linear-gradient(135deg, #ffffff 40%, rgba(255, 255, 255, 0.7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 11px;
  color: var(--primary-cyan);
  font-weight: 500;
  letter-spacing: 0.2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 雲端選擇膠囊按鈕 */
.cloud-switch-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-glass-pill);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.cloud-switch-pill:active {
  transform: scale(0.96);
  background: var(--bg-glass-active);
  border-color: var(--glass-border-glow);
}

.cloud-icon-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--status-success);
  box-shadow: 0 0 6px var(--status-success);
}

.header-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-glass-pill);
  border: 1px solid var(--glass-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.header-icon-btn:active {
  transform: scale(0.92);
  color: var(--text-primary);
  border-color: var(--primary-cyan);
}

/* 斷點記憶自動續播橫幅 (Smart Resume Banner) */
.resume-banner {
  position: relative;
  margin: 10px 14px 4px 14px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(245, 175, 25, 0.18) 0%, rgba(230, 92, 0, 0.12) 100%);
  border: 1px solid rgba(245, 175, 25, 0.4);
  backdrop-filter: var(--glass-blur-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  animation: slideDown 0.35s var(--bounce);
  z-index: 5;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.resume-content {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  flex: 1;
}

.resume-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.resume-text {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.resume-text strong {
  color: var(--audiobook-gold);
}

.resume-play-btn {
  background: var(--audiobook-gradient);
  border: none;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(230, 92, 0, 0.4);
}

.resume-play-btn:active {
  transform: scale(0.94);
}

.resume-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  padding: 4px;
  cursor: pointer;
}

/* 內容視圖主容器 (View Stack) */
.views-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.view-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--mini-player-height) + var(--nav-bar-height) + var(--safe-bottom) + 20px);
}

.view-panel.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* 底部常駐導航欄 (Bottom Navigation Bar) */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-bar-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  background: rgba(14, 18, 28, 0.85);
  border-top: 1px solid var(--glass-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 12px;
  transition: var(--transition-fast);
  border-radius: var(--radius-sm);
}

.nav-item svg {
  width: 22px;
  height: 22px;
  transition: var(--transition-fast);
  stroke-width: 2;
}

.nav-item.active {
  color: var(--primary-cyan);
}

.nav-item.active svg {
  stroke: var(--primary-cyan);
  filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.6));
  transform: translateY(-2px);
}

.nav-item:active {
  transform: scale(0.92);
}
