/* ====================================
   演唱会行程生成器 - 移动端适配样式
   ==================================== */

/* ====== 导航栏响应式适配 ====== */
/* PC端显示 */
@media (min-width: 769px) {
  .navbar-mobile {
    display: none !important;
  }
  .mobile-menu,
  .mobile-menu-overlay {
    display: none !important;
  }
}

/* 移动端显示 */
@media (max-width: 768px) {
  /* 隐藏PC端导航栏 */
  .navbar-desktop {
    display: none !important;
  }

  /* 显示移动端导航栏 */
  .navbar-mobile {
    display: flex !important;
  }

  /* 移动端菜单项样式 */
  .mobile-menu-item {
    display: block;
    padding: 14px 16px;
    margin-bottom: 4px;
    border-radius: 10px;
    font-size: 15px;
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.2s;
    background: transparent;
  }

  .mobile-menu-item:hover,
  .mobile-menu-item:active {
    background: var(--theme-tint, #f5f3ff);
  }

  /* 移动端用户信息区域 */
  .mobile-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    margin: -20px -20px 20px;
    background: linear-gradient(135deg, rgba(124,58,237,0.08), rgba(236,72,153,0.08));
    border-bottom: 1px solid var(--border);
  }

  /* 汉堡按钮动画 */
  .hamburger-btn {
    transition: transform 0.2s;
  }

  .hamburger-btn:active {
    transform: scale(0.9);
  }

  /* 菜单滑入动画 */
  .mobile-menu {
    transition: right 0.3s ease;
  }

  /* 遮罩渐变动画 */
  .mobile-menu-overlay {
    transition: opacity 0.3s ease;
    animation: fadeInOverlay 0.3s ease;
  }

  @keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  /* 防止菜单打开时页面滚动 */
  body.mobile-menu-open {
    overflow: hidden;
  }
}

/* ====== Phase 1: CSS 变量移动端适配 ====== */
@media (max-width: 768px) {
  :root {
    /* 间距系统 */
    --spacing-xs: 6px;
    --spacing-sm: 10px;
    --spacing-md: 14px;
    --spacing-lg: 18px;
    --spacing-xl: 24px;

    /* 字体系统 */
    --font-xs: 10px;
    --font-sm: 12px;
    --font-md: 14px;
    --font-lg: 16px;
    --font-xl: 20px;
    --font-xxl: 26px;

    /* 圆角 */
    --radius: 12px;
    --radius-sm: 6px;
    --radius-lg: 16px;

    /* 触摸目标最小尺寸 */
    --touch-target: 44px;
  }
}

/* ====== Phase 2: 顶部标题区域 ====== */
@media (max-width: 768px) {
  .header {
    padding: 20px 16px 16px;
  }

  .header h1 {
    font-size: 22px;
    line-height: 1.3;
  }

  .header .subtitle {
    font-size: 13px;
    margin-top: 6px;
  }
}

/* ====== Phase 2: 内联定位按钮优化 ====== */
@media (max-width: 768px) {
  .inline-locate-btn {
    font-size: 18px;
    padding: 6px;
    margin-left: 6px;
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .location-status {
    font-size: 11px;
    padding: 6px 10px;
    margin-top: 6px;
  }
}

/* ====== Phase 2: 表单区域优化 ====== */
@media (max-width: 768px) {
  .form-section {
    padding: 18px 16px;
    margin-bottom: 16px;
  }

  .form-section h2 {
    font-size: 18px;
    margin-bottom: 16px;
  }

  .form-group {
    margin-bottom: 14px;
  }

  .form-group label {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .form-group input,
  .form-group select {
    padding: 12px 14px;
    font-size: 15px;
    border-radius: 10px;
  }

  .input-hint {
    font-size: 11px;
    margin-top: 4px;
  }
}

/* ====== Phase 2: 自定义应援设置优化 ====== */
@media (max-width: 768px) {
  .custom-theme-toggle {
    padding: 10px 14px;
    font-size: 13px;
  }

  .custom-theme-inner {
    padding: 4px 14px 14px;
  }

  .custom-theme-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
  }

  .custom-theme-row label {
    min-width: auto;
    font-size: 12px;
  }

  .custom-color-picker {
    width: 100%;
    height: 50px;
  }

  .custom-color-hex,
  .custom-text-input {
    font-size: 13px;
    padding: 9px 12px;
  }

  .custom-reset-btn {
    font-size: 12px;
    padding: 9px;
  }
}

/* ====== Phase 2: 生成按钮固定在底部 ====== */
@media (max-width: 768px) {
  .btn-generate {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-radius: 0;
    padding: 16px;
    font-size: 16px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    margin: 0;
  }

  /* 给左侧面板添加底部内边距，避免内容被按钮遮挡 */
  .left-panel {
    padding-bottom: 70px;
  }
}

/* ====== Phase 3: Tab 切换优化 ====== */
@media (max-width: 768px) {
  .tabs {
    gap: 6px;
    padding: 4px;
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
    min-width: fit-content;
    flex-shrink: 0;
  }
}

/* ====== Phase 3: 机票卡片优化 ====== */
@media (max-width: 768px) {
  .result-card {
    padding: 14px;
    margin-bottom: 10px;
  }

  .transport-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
  }

  .transport-route {
    font-size: 14px;
  }

  .transport-route .arrow {
    font-size: 16px;
  }

  .transport-price {
    font-size: 18px;
    align-self: flex-end;
    width: 100%;
    text-align: right;
  }

  .transport-detail {
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
  }

  .transport-badge {
    font-size: 10px;
    padding: 2px 6px;
  }

  .result-card .select-row {
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
  }

  .select-btn,
  .buy-btn {
    width: 100%;
    padding: 10px 16px;
    font-size: 13px;
    min-height: 44px;
    justify-content: center;
    display: flex;
    align-items: center;
  }
}

/* ====== Phase 3: 酒店卡片优化 ====== */
@media (max-width: 768px) {
  .hotel-card {
    flex-direction: column;
    gap: 12px;
  }

  .hotel-img,
  .hotel-img-placeholder {
    width: 100%;
    height: 180px;
    border-radius: 10px;
  }

  .hotel-name {
    font-size: 16px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .hotel-meta {
    font-size: 11px;
    margin-bottom: 8px;
  }

  .hotel-star {
    font-size: 10px;
  }

  .hotel-score {
    font-size: 12px;
  }

  .hotel-features {
    gap: 4px;
    margin-bottom: 8px;
  }

  .hotel-feature {
    font-size: 10px;
    padding: 2px 5px;
  }

  .hotel-price-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .hotel-price {
    font-size: 20px;
  }

  .hotel-price .unit {
    font-size: 10px;
  }

  .hotel-distance {
    font-size: 11px;
  }
}

/* ====== Phase 3: 酒店筛选工具栏优化 ====== */
@media (max-width: 768px) {
  .hotel-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
    font-size: 11px;
  }

  .hotel-filter-bar .label {
    width: 100%;
    margin-bottom: 4px;
  }

  .hotel-filter-bar input[type="number"] {
    width: 100%;
    font-size: 13px;
    padding: 6px 8px;
  }

  .hotel-filter-bar select {
    width: 100%;
    font-size: 13px;
    padding: 6px 8px;
  }

  .hotel-filter-bar .filter-btn,
  .hotel-filter-bar .reset-btn {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    margin-top: 4px;
  }

  .hotel-filter-info {
    margin-left: 0;
    margin-top: 4px;
    text-align: center;
  }
}

/* ====== Phase 3: 行程总结卡片优化 ====== */
@media (max-width: 768px) {
  .summary-card {
    padding: 16px;
  }

  .summary-row {
    padding: 10px 0;
    flex-wrap: wrap;
    gap: 8px;
  }

  .summary-row .icon {
    font-size: 16px;
    flex-shrink: 0;
  }

  .summary-row .label {
    min-width: 60px;
    font-size: 13px;
    flex-shrink: 0;
  }

  .summary-row .value {
    font-size: 13px;
    flex: 1;
    text-align: right;
    word-break: break-word;
  }
}

/* ====== Phase 3: 分享按钮栏优化 ====== */
@media (max-width: 768px) {
  .share-bar {
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
  }

  .share-btn {
    width: 100%;
    padding: 12px;
    font-size: 13px;
    min-height: 44px;
  }
}

/* ====== Phase 4: 演唱会资讯滚动栏优化 ====== */
@media (max-width: 768px) {
  .concert-ticker {
    margin-bottom: 16px;
  }

  .concert-ticker-header {
    padding: 12px 14px 8px;
    font-size: 13px;
  }

  .concert-ticker-header .ticker-icon {
    font-size: 16px;
    color: #a78bfa;
    filter: brightness(1.2);
  }

  /* ====== 鲸鱼巴士二维码弹窗移动端适配 ====== */
  .qrcode-container {
    margin: 0 20px;
    max-width: 90vw;
  }

  .qrcode-container img {
    width: min(280px, 80vw);
    height: min(280px, 80vw);
  }

  .concert-ticker-header .ticker-title {
    font-size: 13px;
    font-weight: 700;
  }

  .concert-ticker-header .ticker-hint {
    font-size: 11px;
    opacity: 0.8;
  }

  .concert-ticker-body {
    padding: 0 14px 10px;
    min-height: 48px;
  }

  .concert-ticker-item {
    padding: 10px 12px;
    flex-wrap: nowrap;
    gap: 6px;
    border-radius: 10px;
  }

  .concert-ticker-item .ci-tag {
    font-size: 10px;
    padding: 3px 6px;
    flex-shrink: 0;
  }

  .concert-ticker-item .ci-artist {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .concert-ticker-item .ci-tour {
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .concert-ticker-item .ci-venue {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
  }

  .concert-ticker-item .ci-date {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
  }

  .concert-ticker-item .ci-city {
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .concert-ticker-item .ci-fav {
    font-size: 18px;
    flex-shrink: 0;
  }
}

/* ====== Phase 4: 精选演出海报轮播优化 ====== */
@media (max-width: 768px) {
  .featured-concerts {
    margin-bottom: 16px;
  }

  .featured-header {
    padding: 10px 14px;
    font-size: 13px;
  }

  .featured-icon {
    font-size: 16px;
  }

  .poster-slide {
    aspect-ratio: 3/4;
  }

  .carousel-btn {
    width: 36px;
    height: 36px;
    font-size: 18px;
    opacity: 0.85;
  }

  .carousel-prev {
    left: 8px;
  }

  .carousel-next {
    right: 8px;
  }

  .poster-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.3) 50%, transparent 70%);
    padding: 16px;
  }

  .poster-artist {
    font-size: 18px;
  }

  .poster-title {
    font-size: 14px;
  }

  .poster-venue,
  .poster-date {
    font-size: 12px;
  }

  .carousel-dot {
    width: 6px;
    height: 6px;
  }

  .carousel-dot.active {
    width: 18px;
  }
}

/* ====== Phase 4: 留言板优化 ====== */
@media (max-width: 768px) {
  .msg-board {
    margin-bottom: 0;
  }

  .msg-board-header {
    padding: 12px 14px;
    font-size: 13px;
  }

  .msg-board-body {
    max-height: 400px;
    padding: 10px;
  }

  .msg-item {
    margin-bottom: 12px;
    padding-bottom: 12px;
  }

  .msg-avatar {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }

  .msg-author {
    font-size: 12px;
  }

  .msg-time {
    font-size: 10px;
  }

  .msg-content {
    font-size: 12px;
    line-height: 1.5;
  }

  .msg-sticker {
    font-size: 20px;
  }

  .msg-actions {
    gap: 12px;
    font-size: 10px;
  }

  .msg-replies {
    padding-left: 32px;
  }

  .msg-reply {
    font-size: 11px;
    padding: 5px 8px;
  }

  .msg-board-footer {
    padding: 8px 10px;
    position: sticky;
    bottom: 0;
    background: #fafafa;
    z-index: 10;
  }

  .msg-post-tags {
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
  }

  .msg-post-tag-label {
    font-size: 10px;
    width: 100%;
  }

  .msg-post-tag {
    font-size: 10px;
  }

  .msg-input-area textarea {
    font-size: 14px;
    min-height: 42px;
    padding: 10px 12px;
  }

  .msg-tool-btn {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }

  .msg-send-btn {
    padding: 0 12px;
    height: 38px;
    font-size: 12px;
  }

  .msg-tags-filter {
    padding: 8px 10px;
    gap: 5px;
  }

  .msg-tag {
    padding: 3px 8px;
    font-size: 10px;
  }

  .msg-pagination {
    padding: 8px 10px;
    gap: 10px;
  }

  .msg-page-btn {
    padding: 4px 10px;
    font-size: 11px;
  }

  .msg-page-info {
    font-size: 11px;
  }
}

/* ====== Phase 4: 应援地图优化 ====== */
@media (max-width: 768px) {
  .map-section {
    padding: 12px;
  }

  .map-title {
    font-size: 14px;
    margin-bottom: 6px;
  }

  #leafletMap {
    height: 220px;
    border-radius: 10px;
  }

  .map-legend {
    font-size: 11px;
    margin-top: 6px;
  }
}

/* ====== Phase 5: 分享弹窗优化 ====== */
@media (max-width: 768px) {
  .share-modal-content {
    width: 95%;
    max-width: 350px;
    padding: 16px;
    max-height: 90vh;
  }

  .share-modal-header {
    font-size: 14px;
    margin-bottom: 12px;
  }

  .share-modal-close {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  .share-download-btn {
    padding: 12px;
    font-size: 14px;
    margin-top: 12px;
  }
}

/* ====== Phase 5: 加载遮罩优化 ====== */
@media (max-width: 768px) {
  .loading-box {
    padding: 24px 30px;
    max-width: 280px;
  }

  .loading-spinner {
    width: 40px;
    height: 40px;
    border-width: 3px;
    margin-bottom: 14px;
  }

  .loading-text {
    font-size: 14px;
  }

  .loading-subtext {
    font-size: 12px;
    margin-top: 4px;
  }
}

/* ====== Phase 5: 二维码弹窗优化 ====== */
@media (max-width: 768px) {
  .qr-modal-content {
    width: 85%;
    max-width: 320px;
    padding: 30px 20px;
  }

  .qr-code-image {
    width: 220px;
    height: 220px;
  }

  .qr-modal-close {
    width: 30px;
    height: 30px;
    font-size: 20px;
  }
}

/* ====== Phase 5: 鲸鱼巴士推广区优化 ====== */
@media (max-width: 768px) {
  .whale-bus-promo {
    gap: 12px;
    margin-bottom: 16px;
  }

  .whale-bus-promo .promo-link {
    border-radius: 12px;
  }
}

/* ====== Phase 6: 触摸交互优化 ====== */
@media (max-width: 768px) {
  /* 确保所有可点击元素至少 44x44px */
  button,
  .tab-btn,
  .select-btn,
  .buy-btn,
  .msg-tool-btn,
  .location-refresh {
    min-height: 44px;
    min-width: 44px;
  }

  /* 禁用双击缩放，加快点击响应 */
  .btn-generate,
  .select-btn,
  .buy-btn,
  .share-btn,
  .msg-send-btn {
    touch-action: manipulation;
  }

  /* 平滑滚动 */
  html {
    scroll-behavior: smooth;
  }

  /* 横向滚动容器优化 */
  .tabs,
  .hotel-filter-bar {
    -webkit-overflow-scrolling: touch;
  }
}

/* ====== Phase 6: 打车卡片优化 ====== */
@media (max-width: 768px) {
  .taxi-card {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    gap: 12px;
  }

  .taxi-icon {
    width: 48px;
    height: 48px;
    font-size: 24px;
    align-self: flex-start;
  }

  .taxi-type-name {
    font-size: 15px;
  }

  .taxi-meta {
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
  }

  .taxi-price-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .taxi-price {
    font-size: 20px;
  }

  .taxi-estimate {
    font-size: 11px;
  }

  .taxi-supplier {
    font-size: 10px;
  }
}

/* ====== Phase 6: 打车面板优化 ====== */
@media (max-width: 768px) {
  .taxi-panel {
    padding: 16px;
  }

  .taxi-panel-title {
    font-size: 16px;
    margin-bottom: 14px;
  }

  .taxi-input-group {
    margin-bottom: 12px;
  }

  .taxi-input-label {
    font-size: 12px;
    margin-bottom: 6px;
  }

  .taxi-input-row input {
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 8px;
  }

  .taxi-locate-btn,
  .taxi-swap-btn {
    font-size: 16px;
    padding: 8px 12px;
  }

  .taxi-search-btn {
    padding: 12px;
    font-size: 15px;
  }

  .taxi-time-picker {
    gap: 6px;
  }

  .taxi-time-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .taxi-mini-map {
    height: 180px;
    margin-bottom: 12px;
  }
}

/* ====== Phase 6: 订单弹窗优化 ====== */
@media (max-width: 768px) {
  .order-modal-content {
    width: 95%;
    max-width: 380px;
  }

  .order-modal-header {
    padding: 16px 18px 10px;
  }

  .order-modal-title {
    font-size: 15px;
  }

  .order-modal-subtitle {
    font-size: 11px;
  }

  .order-modal-close {
    width: 26px;
    height: 26px;
    font-size: 16px;
  }

  .order-modal-body {
    padding: 14px 18px;
  }

  .order-form-group {
    margin-bottom: 12px;
  }

  .order-form-label {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .order-form-input {
    padding: 9px 10px;
    font-size: 13px;
  }

  .order-modal-footer {
    padding: 10px 18px 16px;
    gap: 8px;
  }

  .order-btn-secondary,
  .order-btn-primary {
    padding: 9px;
    font-size: 13px;
  }
}

/* ====== Phase 7: 错误提示优化 ====== */
@media (max-width: 768px) {
  .error-banner {
    padding: 12px 14px;
    margin-bottom: 12px;
    font-size: 12px;
  }

  .error-banner .icon {
    font-size: 18px;
  }

  .error-banner .content {
    font-size: 12px;
  }

  .error-banner .retry {
    padding: 6px 12px;
    font-size: 11px;
    margin-top: 6px;
  }
}

/* ====== Phase 7: 空状态优化 ====== */
@media (max-width: 768px) {
  .empty-state {
    padding: 30px 16px;
  }

  .empty-state .emoji {
    font-size: 40px;
    margin-bottom: 10px;
  }

  .empty-state .text {
    font-size: 14px;
  }
}

/* ====== Phase 7: 回到顶部按钮优化 ====== */
@media (max-width: 768px) {
  .scroll-top-btn {
    width: 44px;
    height: 44px;
    bottom: 80px; /* 避免与底部固定按钮重叠 */
    right: 16px;
    font-size: 18px;
  }
}

/* ====== Phase 7: 底部提示优化 ====== */
@media (max-width: 768px) {
  .footer-tip {
    font-size: 11px;
    padding: 16px 12px;
    padding-bottom: 70px; /* 为固定按钮留出空间 */
  }
}

/* ====== Phase 7: 主题横幅优化 ====== */
@media (max-width: 768px) {
  .theme-banner {
    padding: 16px 18px;
    margin-bottom: 12px;
  }

  .theme-banner .slogan {
    font-size: 20px;
    letter-spacing: 1.5px;
  }

  .theme-banner .fan-name {
    font-size: 12px;
    margin-top: 6px;
  }
}

/* ====== Phase 7: 性能优化 - 减少动画 ====== */
@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ====== 超小屏幕适配（< 375px）====== */
@media (max-width: 374px) {
  .container {
    padding: 0 10px;
  }

  .header h1 {
    font-size: 20px;
  }

  .form-section,
  .card {
    padding: 14px;
  }

  .btn-generate {
    padding: 14px;
    font-size: 15px;
  }
}
