:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --card: #ffffff;
  --accent: #3f51ff;
  --accent-2: #ff6b6b;
  --text: #1c1d2a;
  --muted: #6c6f85;
  --border: #e3e6f0;
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --header-height: 60px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  height: 100%;
  overflow: hidden; /* 防止双滚动条 */
}

body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

/* Navigation */
.main-nav {
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
  position: relative;
  flex-shrink: 0;
}

.nav-brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 8px;
  background: #f0f2f5;
  padding: 4px;
  border-radius: 8px;
}

.nav-item {
  border: none;
  background: transparent;
  padding: 6px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.nav-item.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ghost-sm {
  border: 1px solid var(--border);
  background: transparent;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}

/* Views */
.view-section {
  position: absolute;
  top: var(--header-height);
  left: 0;
  width: 100%;
  height: calc(100% - var(--header-height));
  display: none; /* 默认隐藏 */
}

body.show-map #view-map { display: block; }
body.show-list #view-list { display: block; }

/* Map View */
#view-map {
  background: #eee;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.map-overlay-notice {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 999;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 16px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  font-size: 13px;
  border: 1px solid var(--accent);
  color: var(--accent);
  display: none; /* 有内容才显示 */
  pointer-events: none;
}

.map-overlay-notice:not(:empty) {
  display: block;
}

/* List View */
#view-list {
  background: var(--bg);
  overflow-y: auto;
  padding: 24px;
}

@media (max-width: 600px) {
  #view-list {
    padding: 12px;
  }
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

.list-header {
  display: block;
  margin-bottom: 24px;
}

.filter-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.filter-toggle-row h3 {
    margin: 0;
    font-size: 18px;
}
#toggleFilterBtn {
    background: transparent;
    border: 1px solid #ccc;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
}

.filter-container {
    display: flex;
    flex-wrap: wrap; 
    gap: 16px; 
    align-items: center;
    background: #f9f9f9;
    padding: 12px;
    border-radius: 8px;
}
.filter-container.hidden {
    display: none;
}
.filter-container {
  background: #fff;
  padding: 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%; /* 防止父容器溢出 */
}

.filter-group select {
  max-width: 160px; /* 限制下拉框最大宽度 */
  text-overflow: ellipsis;
}

@media (max-width: 480px) {
  .filter-group select {
      max-width: 120px; /* 移动端更窄 */
  }
}

.filter-group label {
  font-size: 14px;
  color: var(--muted);
  flex-shrink: 0; /* 防止标签被压缩 */
}

.filter-group select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 14px;
  background: #fff;
}

.filter-group select {
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  min-width: 120px;
}

.filter-date-input {
  display: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 14px;
  background: #fff;
}

.filter-date-input.visible {
  display: inline-flex;
}

@media (max-width: 600px) {
  .filter-container {
      flex-direction: column;
      align-items: stretch;
      gap: 10px;
  }
  .filter-group {
      display: flex; /* Ensure flex layout */
  }
  .filter-group label {
      width: 50px; /* Fixed width for labels */
  }
  .filter-group select {
      flex: 1; /* Select takes remaining space */
  }
}

.schedule-grid {
  display: grid;
  gap: 16px;
}

.schedule-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid transparent;
}

.schedule-card.is-today {
  border-color: var(--accent-2);
  border-width: 2px; /* Increase width for better visibility */
  background: #fff; /* Remove gradient to rely on border */
}

.schedule-card.is-activity {
  border-color: transparent; /* Remove border */
  background: linear-gradient(to right, #fff, #e1f5fe); /* Sky blue tint */
}

.movie-info {
  flex: 1;
  min-width: 0; /* Crucial for text truncation in flex container */
  margin-right: 8px;
}

.movie-info h3 {
  font-size: 18px;
  margin-bottom: 4px;
  word-wrap: break-word;
}

.movie-info p {
  color: var(--muted);
  font-size: 13px;
}

.schedule-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.badge-cinema {
  background: #f0f2f5;
  color: var(--text);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 4px;
}

.badge-special {
  display: inline-block;
  background: #e1f5fe; /* Sky blue background */
  color: #0288d1; /* Darker blue text */
  border: 1px solid #b3e5fc;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  margin-bottom: 6px;
}

.badge-special.badge-activity {
  background: #ff9800; /* Orange background */
  color: #ffff00; /* Yellow text */
  border-color: #f57c00;
}

.movie-note {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.time-highlight {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

.date-tag {
  font-size: 12px;
  color: var(--muted);
}

/* Popup Btn */
.popup-btn {
  margin-top: 8px;
  background: var(--accent);
  color: white;
  border: none;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
}

.popup-btn-outline {
  margin-top: 8px;
  background: white;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
}

.popup-btn-outline:hover {
  background: #f0f2ff;
}

/* Amap Custom */
.amap-info-content {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 12px 16px;
  border: none !important;
}

.amap-info-close {
  right: 6px !important;
  top: 6px !important;
  font-size: 16px;
  color: #999;
}

/* Remove default border/background from AMap label */
.amap-marker-label {
    border: none !important;
    background-color: transparent !important;
}

/* Ensure filtering row looks good */
.filter-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap; /* Allow wrapping */
    margin-bottom: 24px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  animation: fadeIn 0.2s forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.modal {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 320px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transform: translateY(20px);
  animation: slideUp 0.3s forwards;
}

@keyframes slideUp {
  to { transform: translateY(0); }
}

.modal-header {
  padding: 16px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 16px;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  padding: 0 8px;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-option-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-option-amap {
  background: #f0f7ff;
  color: #3f51ff;
  border: 1px solid #3f51ff;
}

.nav-option-baidu {
  background: #fcf0f0;
  color: #d13a3a;
  border: 1px solid #d13a3a;
}

.nav-option-tencent {
  background: #f2f8ff;
  color: #3b87f8;
  border: 1px solid #3b87f8;
}

.nav-option-apple {
  background: #f5f5f7;
  color: #1d1d1f;
  border: 1px solid #d2d2d7;
}@media (max-width: 600px) {
  .schedule-card {
    padding: 12px;
    gap: 8px;
  }

  .movie-info {
    min-width: 0; /* Allow flex child to shrink */
    flex: 1;
    margin-right: 8px;
  }

  .schedule-meta {
    flex-shrink: 0; /* Do not shrink time area */
  }

  .badge-cinema {
    font-size: 11px;
    white-space: normal; /* Allow wrap */
    display: block;
    max-width: 100%;
    line-height: 1.4;
  }

  .time-highlight {
    font-size: 16px;
    white-space: normal; /* Allow wrap */
    text-align: right;
  }

  .movie-info h3 {
    font-size: 16px;
    white-space: normal; /* Allow wrap */
    overflow: visible;
    text-overflow: clip;
  }
}
