/* ZenAxon Screen Specific Styling */

/* Flow steps in left panel */
.flow-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin: 16px 0 8px 0;
  font-weight: 600;
}
.flow-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}
.flow-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--bg-input);
  border: 1px solid transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
}
.panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.panel-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text-main);
}
.panel-header p {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.panel-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 10px var(--primary-glow);
}

.flow-step .step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-day-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--text-muted);
  transition: all 0.3s;
}
.flow-step .step-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}
.flow-step .check-icon {
  margin-left: auto;
  color: var(--success);
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.3s;
}
.flow-step.active {
  background: var(--primary-glow);
  border-color: var(--primary-glow);
  box-shadow: 0 4px 20px var(--primary-glow);
}
.flow-step.active .step-num {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 10px var(--primary-glow);
}
.flow-step.active .step-text {
  color: var(--primary);
  font-weight: 600;
}
.flow-step.completed {
  background: rgba(52, 211, 153, 0.05);
}
.flow-step.completed .step-num {
  background: var(--success);
  color: #fff;
}
.flow-step.completed .step-text {
  color: var(--text-muted);
  text-decoration: line-through;
  opacity: 0.7;
}
.flow-step.completed .check-icon {
  opacity: 1;
  transform: scale(1);
}

/* OOBE 1: Login Screen */
.logo-container {
  text-align: center;
  margin: 40px 0 20px 0;
}
.logo-img {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  margin-bottom: 12px;
  box-shadow: 0 8px 25px var(--primary-glow);
}
.app-title-display {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}
.app-subtitle-display {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.social-login-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-day-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s;
}
.social-login-btn:hover {
  background: var(--bg-input-focus);
  border-color: var(--primary);
}
.social-login-btn.wechat {
  color: #07c160;
}
.social-login-btn.apple {
  color: var(--text-main);
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  text-align: left;
}
.form-group label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}
.input-control {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.3s;
  width: 100%;
}
.input-control:focus {
  border-color: var(--primary);
  background: var(--bg-input-focus);
}
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: var(--calendar-filter, invert(1));
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}
.login-footer-links {
  margin-top: auto;
  margin-bottom: 20px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.login-footer-links a {
  color: var(--primary);
  text-decoration: none;
}

/* OOBE 2: Device Scan Screen */
.scan-container {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  height: 100%;
  position: relative;
  overflow-y: auto;
  scrollbar-width: none;
}
.scan-container::-webkit-scrollbar {
  display: none;
}
.scan-radar-bg {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1px dashed var(--primary-glow);
  pointer-events: none;
  opacity: 0.25;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.radar-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--primary);
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  animation: ripple 2.5s linear infinite;
  opacity: 0;
}
.radar-ring:nth-child(2) {
  animation-delay: 0.8s;
}
.radar-ring:nth-child(3) {
  animation-delay: 1.6s;
}

.scan-center-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-glow);
  border: 1px solid var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary);
  font-size: 1.1rem;
  animation: pulse 2s infinite;
}
@keyframes ripple {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  50% {
    opacity: 0.6;
  }
  100% {
    transform: scale(1.1);
    opacity: 0;
  }
}

.device-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  z-index: 2;
  margin-top: 10px;
  margin-bottom: 24px;
}
.device-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(20px);
  animation: cardAppear 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.device-card:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px var(--primary-glow);
}
.device-card-icon {
  width: 68px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}
.device-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}
.device-card-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
}
.device-card-rssi {
  font-size: 0.65rem;
  color: var(--success);
  font-weight: 500;
}
.device-card-action {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  margin-top: 6px;
}
@keyframes cardAppear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* OOBE 3: Questionnaire Screen */
.question-container {
  text-align: left;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition:
    opacity 0.25s ease,
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.question-container.slide-out {
  opacity: 0;
  transform: translateX(-20px);
}
.question-container.slide-in {
  animation: qSlideIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes qSlideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.quest-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  margin-top: 10px;
  margin-bottom: 24px;
  overflow: hidden;
}
.quest-progress-inner {
  height: 100%;
  background: var(--primary);
  width: 25%;
  transition: width 0.3s;
}
.question-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.4;
}
.question-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 30px;
}
.q-option {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}
.q-option::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--text-dim);
  display: inline-block;
  flex-shrink: 0;
  transition: all 0.2s;
}
.q-option.selected {
  border-color: var(--primary);
  background: var(--primary-glow);
}
.q-option.selected::before {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: inset 0 0 0 3px var(--bg-card-solid);
}

/* OOBE 4: Algorithm Screen */
.algo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  padding-top: 40px;
  overflow-y: auto;
  scrollbar-width: none;
}
.algo-container::-webkit-scrollbar {
  display: none;
}
.brain-loader {
  width: 120px;
  height: 120px;
  position: relative;
  margin: 30px 0;
}
.brain-loader svg {
  width: 100%;
  height: 100%;
  animation: pulse 2s infinite ease-in-out;
}
.brain-loader .pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--primary);
  animation: brainRipple 2.5s infinite ease-out;
}
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 10px var(--primary-glow));
  }
  50% {
    transform: scale(1.05);
    filter: drop-shadow(0 0 25px var(--primary-glow));
  }
}
@keyframes brainRipple {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}
.loader-progress-text {
  font-size: 1.4rem;
  font-weight: bold;
  font-family: var(--font-display);
  margin-bottom: 8px;
  color: var(--text-main);
}
.loader-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Screen Modals & Overlays */
.screen-modal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(9, 13, 25, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1100;
}
.modal-box {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  width: 100%;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}
.modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 0 auto 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.modal-icon.error {
  background: rgba(248, 113, 113, 0.15);
  color: var(--danger);
}
.modal-icon.success {
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
}
.modal-box h4 {
  margin-bottom: 8px;
  font-size: 1.1rem;
  color: var(--text-main);
}
.modal-box p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* TAB 1: Home Tab */
.home-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-top: 10px;
}
.home-header .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar-tiny {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-header h4 {
  font-size: 0.9rem;
  font-weight: 700;
}
.home-header .dev-status-badge {
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
  font-size: 0.65rem;
  padding: 4px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.dashboard-card {
  background: var(--bg-dashboard-card);
  border: 1px solid var(--primary-glow);
  border-radius: 20px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}
.dashboard-card::before {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, var(--primary-glow), transparent 70%);
  top: -50px;
  right: -50px;
}
.dashboard-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--secondary);
  font-weight: 700;
  margin-bottom: 12px;
}
.dashboard-score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.dashboard-score {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-main);
}
.dashboard-score span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
}
.dashboard-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.section-header-row h3 {
  font-size: 0.95rem;
  font-family: var(--font-display);
  font-weight: 700;
}
.section-header-row a {
  font-size: 0.7rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.course-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.course-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
  transition: all 0.2s;
}
.course-item:hover {
  background: var(--bg-day-circle);
  border-color: var(--secondary);
}
.course-img {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  background: var(--bg-card-solid);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}
.course-info {
  text-align: left;
}
.course-title {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text-main);
}
.course-duration {
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* BLE Overlay screen */
.ble-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-gradient);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.4s;
}
.ble-overlay h3 {
  color: var(--text-main) !important;
}
.ble-overlay p {
  color: var(--text-muted) !important;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.ble-spinner-container {
  width: 150px;
  height: 150px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
}
.ble-radar-wave {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--secondary);
  animation: pulse 1.5s infinite;
}
.ble-icon-center {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  box-shadow: 0 0 25px var(--primary-glow);
  z-index: 5;
}

/* TAB 2: Report Tab */
.report-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.tab-select-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: var(--bg-day-circle);
  padding: 2px;
  border-radius: 10px;
  margin-bottom: 16px;
}
.tab-select-btn {
  background: none;
  border: none;
  padding: 6px 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  font-weight: 500;
}
.tab-select-btn.active {
  background: var(--bg-card-solid);
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 2px 8px var(--shadow-color);
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}
.chart-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}
.chart-header h4 {
  font-size: 0.8rem;
  font-weight: 600;
}
.chart-header span {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 700;
}
.trend-chart-placeholder {
  height: 120px;
  position: relative;
  margin-top: 10px;
}
.trend-chart-placeholder svg {
  width: 100%;
  height: 100%;
}

.report-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.summary-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
}
.summary-box .label {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.summary-box .val {
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.history-section h4 {
  font-size: 0.85rem;
  margin-bottom: 10px;
  color: var(--text-main);
  text-align: left;
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
}
.history-item:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
}
.history-meta {
  text-align: left;
}
.history-date {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
}
.history-dur {
  font-size: 0.65rem;
  color: var(--text-dim);
}
.history-score {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--secondary);
}

/* TAB 3: Music Tab */
.music-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.search-bar-row {
  background: transparent;
  padding-bottom: 8px;
}
.category-chips {
  background: transparent;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  padding-top: 4px;
  margin-top: 8px;
  margin-bottom: 16px;

  /* 隐藏滚动条 */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}
.category-chips::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}
.cat-chip {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  white-space: nowrap;
  cursor: pointer;
  font-weight: 500;
}
.cat-chip.active {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.music-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 80px; /* 留出底部悬浮播放器空间 */
  width: 100%;
  box-sizing: border-box;
}
.music-album-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 8px;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 0; /* 防止子元素溢出导致卡片变宽 */
  display: flex;
  flex-direction: column;
}
.music-album-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}
.album-header-layout {
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}
.music-album-card.expanded {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--bg-card), var(--bg-input));
  box-shadow: 0 4px 15px var(--shadow-color);
}
.music-album-card.expanded .album-header-layout {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}
.album-art {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.8rem;
  box-shadow: 0 4px 10px var(--shadow-color);
  transition: all 0.3s ease;
  overflow: hidden; /* 保证子图片不溢出 */
}
.music-album-card.expanded .album-art {
  width: 50px;
  height: 50px;
  margin-bottom: 0;
}
.album-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.album-title {
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-main);
  transition: all 0.3s ease;
  width: 100%;
}
.music-album-card.expanded .album-title {
  white-space: normal;
  font-size: 0.85rem;
}
.album-track-count {
  font-size: 0.6rem;
  color: var(--text-muted);
}

.player-overlay {
  position: absolute;
  top: calc(100% - 124px); /* 100% - bottom: 64px - height: 60px = calc(100% - 124px) */
  bottom: 64px;
  left: 0;
  right: 0;
  height: 60px;
  max-height: 60px;
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  z-index: 1001;
  box-shadow: 0 -4px 15px var(--shadow-color);
  overflow: hidden;
  transition: top 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
              bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
              height 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
              max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
              padding 0.35s cubic-bezier(0.4, 0, 0.2, 1), 
              background 0.35s ease;
}
/* 当没有底部 Tabs 导航栏时，播放条自动贴到最底部 (留出 12px 呼吸空间避开 Home 指示线) */
.player-overlay.no-tabs {
  bottom: 12px;
  top: calc(100% - 72px); /* 100% - bottom: 12px - height: 60px = calc(100% - 72px) */
}
.player-overlay.expanded {
  top: 0;
  bottom: 0;
  height: 100%;
  max-height: 100%;
  padding: 56px 20px 24px 20px;
  border-radius: 0;
  box-shadow: none;
  background: var(--bg-dark);
}
@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.player-art {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}
.player-info {
  flex-grow: 1;
  text-align: left;
}
.player-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-main);
}
.player-sub {
  font-size: 0.6rem;
  color: var(--text-muted);
}
.player-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}
.player-play-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
}

/* TAB 4: Profile Tab */
.profile-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}
.profile-scroll-area {
  --extra-height: 25px;
  flex: 1 1 0%;
  overflow-y: auto;
  scrollbar-width: none;
  margin-top: calc(var(--extra-height) * -1);
  margin-bottom: calc(var(--extra-height) * -1);
  padding-top: var(--extra-height);
  padding-bottom: var(--extra-height);
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 var(--extra-height),
    #000 calc(100% - var(--extra-height)),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 var(--extra-height),
    #000 calc(100% - var(--extra-height)),
    transparent 100%
  );
  position: relative;
  z-index: 1;
}
.profile-scroll-area::-webkit-scrollbar {
  display: none;
}
.profile-header-card {
  text-align: center;
  margin-bottom: 16px;
  padding-top: 10px;
  position: relative;
  z-index: 2;
}
.avatar-large {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  margin: 0 auto 12px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}
.profile-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-main);
}
.profile-id {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.dev-embed-card {
  background: linear-gradient(135deg, var(--primary-glow), var(--bg-card));
  border: 1px solid var(--primary-glow);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}
.dev-embed-info {
  text-align: left;
}
.dev-embed-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}
.dev-embed-status {
  font-size: 0.65rem;
  color: var(--success);
  font-weight: 500;
}
.btn-unbind {
  background: rgba(248, 113, 113, 0.15);
  color: var(--danger);
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-unbind:hover {
  background: var(--danger);
  color: white;
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.menu-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}
.menu-item:hover {
  background: var(--primary-glow);
}
.menu-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}
.menu-left i {
  color: var(--secondary);
  width: 16px;
}
.menu-item .fa-chevron-right {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* Subscreen Navigation & Layout Styles */
.subscreen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 16px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
  flex-shrink: 0;
}
.subscreen-content {
  flex: 1 1 0%;
  overflow-y: auto;
  scrollbar-width: none;
  padding-bottom: 20px;
}
.subscreen-content::-webkit-scrollbar {
  display: none;
}
.subscreen-header h3 {
  font-size: 1rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-main);
}
.back-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s;
}
.back-btn:hover {
  background: var(--primary-glow);
}
.menu-item.no-hover {
  cursor: default;
}
.menu-item.no-hover:hover {
  background: var(--bg-card);
}
.faq-arrow {
  transition: transform 0.3s;
}
.faq-arrow.open {
  transform: rotate(180deg);
}

/* Back-end simulator controls styling */
.simulation-controls {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}
.simulation-controls h3 {
  font-size: 0.8rem;
  color: var(--text-main);
  margin-bottom: 8px;
}
.control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  text-align: left;
}
.control-group label {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 10px;
}
.toggle-switch input[type="checkbox"] {
  display: none;
}
.toggle-switch label {
  width: 38px;
  height: 18px;
  background: var(--bg-input);
  border-radius: 9px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
}
.toggle-switch label::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-card-solid);
  top: 2px;
  left: 2px;
  transition: left 0.3s;
}
.toggle-switch input[type="checkbox"]:checked + label {
  background: var(--danger);
}
.toggle-switch input[type="checkbox"]:checked + label::after {
  left: 22px;
}
.toggle-label {
  font-size: 0.7rem;
  font-weight: 600;
}

/* Calendar Widget Styles */
.calendar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.calendar-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.calendar-header-row h4 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.calendar-header-row .btn-more {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
}
.calendar-scroll-container {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  display: flex;
  gap: 10px;
  padding-bottom: 6px;
  scrollbar-width: none; /* Hide scrollbar Firefox */
}
.calendar-scroll-container::-webkit-scrollbar {
  display: none; /* Hide scrollbar Chrome/Safari */
}
.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  width: 100%;
  flex-shrink: 0;
  scroll-snap-align: start;
}
.day-btn-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.day-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-day-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.day-circle.today {
  background: var(--primary);
  color: white;
  font-weight: bold;
  box-shadow: 0 0 10px var(--primary-glow);
}
.day-circle.completed::after {
  content: "";
  position: absolute;
  bottom: -2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--success);
}
.day-btn-wrapper.active .day-circle {
  background: var(--primary-glow);
  border: 1px solid var(--primary);
  color: var(--primary);
}
.day-num {
  font-size: 0.7rem;
  color: var(--text-dim);
}
.day-btn-wrapper.active .day-num {
  color: var(--primary);
  font-weight: bold;
}

/* Calendar navigation buttons: semi-transparent, no background/border, continuous bouncing */
.calendar-nav-btn {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text-muted) !important;
  opacity: 0.5;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.calendar-nav-btn:hover {
  opacity: 0.95 !important;
  color: var(--primary) !important;
  transform: scale(1.3);
}
.calendar-nav-btn:active {
  transform: scale(0.9);
}
.calendar-nav-btn.prev-btn i {
  animation: bounceLeft 0.8s infinite alternate cubic-bezier(0.25, 0.8, 0.25, 1);
}
.calendar-nav-btn.next-btn i {
  animation: bounceRight 0.8s infinite alternate
    cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes bounceLeft {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-4px);
  }
}
@keyframes bounceRight {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(4px);
  }
}

/* Avatar Select Buttons */
.avatar-select-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-day-circle);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.avatar-select-btn:hover,
.avatar-select-btn.active {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

/* --- Expandable Dashboard Card --- */
.dashboard-card {
  cursor: pointer;
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}
.dashboard-card:hover {
  border-color: var(--primary-glow);
  background: var(--bg-dashboard-card-hover);
  box-shadow: 0 12px 24px var(--primary-glow);
}
.dashboard-expand-wrapper {
  height: 0;
  overflow: hidden;
  transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.dashboard-expand-content {
  overflow: hidden;
}
.dashboard-desc {
  padding-top: 12px;
  border-top: 1px dashed var(--primary-glow);
}
/* Bouncing Arrow Indicator */
.dashboard-arrow-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 12px;
  height: 16px;
  color: var(--secondary);
  opacity: 0.8;
  transition:
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.2s;
}
.dashboard-card:hover .dashboard-arrow-container {
  opacity: 1;
}
.dashboard-card.expanded .dashboard-arrow-container {
  transform: rotate(180deg);
}
.dashboard-arrow-container i {
  font-size: 0.85rem;
  animation: arrow-bounce 1.6s infinite ease-in-out;
}
.dashboard-card.expanded .dashboard-arrow-container i {
  animation: none;
}
@keyframes arrow-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(5px);
  }
}

/* --- Smooth 3D Scroll Time Picker --- */
.time-picker-group {
  margin: 20px 0;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}
.time-picker-label-row {
  display: flex;
  justify-content: space-around;
  width: 100%;
  padding: 0 4px;
}
.time-picker-scroll-container {
  display: flex;
  justify-content: space-around;
  gap: 12px;
  position: relative;
  height: 140px;
  overflow: hidden;
  width: 100%;
}
.time-picker-scroll-container::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  height: 38px;
  background: var(--primary-glow);
  border-top: 1px solid var(--primary);
  border-bottom: 1px solid var(--primary);
  border-radius: 8px;
  pointer-events: none;
  z-index: 2;
}
.time-picker-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}
.time-picker-label {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text-main);
  font-weight: 700;
  text-shadow: none;
  text-align: center;
}
.time-picker-scroll {
  width: 100%;
  height: 140px;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: relative;
}
.time-picker-scroll::-webkit-scrollbar {
  display: none;
}
.time-picker-list {
  padding: 51px 0;
  display: flex;
  flex-direction: column;
}
.time-picker-item {
  height: 38px;
  line-height: 38px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  opacity: 0.55;
  scroll-snap-align: center;
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
  user-select: none;
  transform-origin: center center;
  transform: scale(0.9) rotateX(0deg);
}
.time-picker-item.selected {
  color: var(--primary);
  opacity: 1;
  font-weight: 700;
  font-size: 1.05rem;
  transform: scale(1.1) rotateX(0deg);
  text-shadow: none;
}

/* --- Multi-Select Double Panel with FLIP Animation --- */
.multi-panel-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}
.multi-selected-panel {
  background: var(--primary-glow);
  border: 1px dashed var(--primary-glow);
  border-radius: 14px;
  padding: 12px;
  min-height: 48px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  position: relative;
  transition:
    background-color 0.2s,
    border-color 0.2s;
}
.multi-selected-panel.has-items {
  background: var(--primary-glow);
  border-color: var(--primary-glow);
}
.multi-selected-placeholder {
  font-size: 0.75rem;
  color: var(--text-dim);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.multi-item {
  font-size: 0.75rem;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}
.multi-item:hover {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: var(--primary);
}
.multi-selected-tag {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}
.multi-selected-tag:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--danger);
  color: var(--danger);
}
.multi-selected-tag::after {
  content: "×";
  margin-left: 4px;
  font-weight: bold;
  font-size: 0.85rem;
}
.multi-separator {
  color: var(--text-muted);
  opacity: 0.4;
  font-size: 0.7rem;
  margin: 0 2px;
  user-select: none;
  pointer-events: none;
  display: inline-block;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  animation: separator-fade-in 0.3s forwards;
}
@keyframes separator-fade-in {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.multi-options-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px;
}
.multi-item.hidden-item {
  display: none !important;
}
