/* 全局样式 */
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, sans-serif; background:#1a1a1a; color:#fff; overflow-x:hidden; }

/* 欢迎页 */
#welcome { position:fixed; inset:0; z-index:9999; background:#B8E5D9; display:flex; flex-direction:column; align-items:center; justify-content:center; }

/* 平板/PC 响应式：居中容器 */
@media (min-width: 768px) {
  body { background: #d0d0d0; }
  #welcome {
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 768px;
    box-shadow: 0 0 40px rgba(0,0,0,0.15);
  }
}

@media (min-width: 1024px) {
  #welcome {
    max-width: 430px;
    border-radius: 12px;
    overflow: hidden;
    top: 16px;
    bottom: 16px;
    height: calc(100vh - 32px);
  }
}
#welcome.hidden { display:none; }
.bird-wrap { width:140px; height:120px; animation:floaty 2.2s ease-in-out infinite; margin-top: -10px; }
.bird-wrap img { width: 100%; height: 100%; object-fit: contain; }
@keyframes floaty { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-14px)} }
.tap-guide {
  position: relative;
  margin-top: clamp(32px, 8vh, 48px);
  width: min(92vw, 340px);
  padding: 0 4px 72px;
  box-sizing: border-box;
}
.tap-hint {
  padding: 0 12px;
  font-size: 0.95rem;
  color: #888;
  animation: tapBlink 1.5s ease-in-out infinite;
  text-align: center;
}
.tap-hint-line1 { font-size: 0.95rem; line-height: 1.4; }
.tap-hint-line2 { font-size: 0.85rem; margin-top: 6px; opacity: 0.8; line-height: 1.4; }
.hand-wrap {
  position: absolute;
  right: clamp(24px, 12vw, 56px);
  top: calc(100% - 74px);
  width: clamp(64px, 19vw, 80px);
  height: clamp(64px, 19vw, 80px);
  margin: 0;
  pointer-events: none;
  animation: tapBlink 1.5s ease-in-out infinite;
}
.hand-wrap img { width: 100%; height: 100%; object-fit: contain; }
@keyframes tapBlink { 0%,100%{opacity:1} 50%{opacity:0.3} }
.brand { position:absolute; bottom:48px; }
.brand img { width: 140px; height: auto; object-fit: contain; }

/* 语言下拉 */
.header { padding:16px; display:flex; justify-content:space-between; align-items:center; }
.lang-wrap { position:relative; display:flex; align-items:center; gap:4px; padding:6px 12px; background:transparent; border:1px solid #3CBAA8; border-radius:20px; cursor:pointer; color:#3CBAA8; font-size:0.85rem; }
.lang-selector { position:relative; display:flex; align-items:center; gap:4px; padding:6px 12px; background:transparent; border:1px solid #3CBAA8; border-radius:20px; cursor:pointer; color:#3CBAA8; font-size:0.85rem; }
.lang-btn { padding:8px 16px; border:1px solid #444; border-radius:20px; background:transparent; color:#3CBAA8; font-size:0.85rem; cursor:pointer; }
.lang-menu { position:absolute; right:0; top:100%; margin-top:6px; min-width:140px; background:#222; border:1px solid #333; border-radius:10px; display:none; z-index:100; }
.lang-menu.show { display:block; }
.lang-item { padding:12px 16px; font-size:0.85rem; color:#ccc; cursor:pointer; }
.lang-item:hover { background:#333; }
.lang-item:first-child { border-radius:10px 10px 0 0; }
.lang-item:last-child { border-radius:0 0 10px 10px; }

/* 页面 */
.page { display:none; padding:0 16px 20px; }
.page.active { display:block; }
#districtSelect { background:#fff; min-height:100vh; }

/* 城市选择 */
#citySelect { background:#B8E5D9; min-height:100vh; color:#333; }
.city-title { text-align:center; margin:20px 0; }
.city-title h2 { font-size:1.6rem; }
.city-title p { margin-top:6px; color:#999; font-size:0.9rem; }
.city-card { position:relative; width:100%; aspect-ratio:16/9; border-radius:16px; overflow:hidden; margin-bottom:12px; cursor:pointer; }
.city-card img { width:100%; height:100%; object-fit:cover; display:block; }
.city-card::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 55%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.4) 45%, transparent 100%);
  pointer-events: none;
}
.city-name {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1;
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.city-name .city-distance {
  font-size: 12px;
  font-weight: 600;
  color: #3CBAA8;
  margin-left: 8px;
  text-shadow: none;
}
.current-loc { display:flex; align-items:center; gap:8px; color:#3CBAA8; font-size:0.85rem; margin-bottom:12px; }
.nearest-city-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  padding: 8px 16px 16px;
  font-size: 13px;
  color: #3CBAA8;
  margin-top: -8px;
  line-height: 1.4;
}
.nearest-city-hint .loc-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  color: #3CBAA8;
}
.nearest-city-hint .loc-icon svg { display: block; }

/* 片区选择 - 新设计风格（白色主题） */
.back-btn { padding:8px 0; color:#666; cursor:pointer; font-size:0.9rem; }

/* Wheatie 提示泡 */
.wheatie-bubble {
  background: #ffe4e1;
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: #333;
  line-height: 1.4;
}
.wheatie-avatar {
  flex-shrink: 0;
}
.wheatie-avatar img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
}

/* 搜索框 */
.search-box { margin-bottom: 24px; }
.search-input-wrap {
  position: relative;
  width: 100%;
}
.search-input-wrap input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  background: #f5f5f5;
  color: #333;
  font-size: 0.9rem;
  outline: none;
}
.search-input-wrap input::placeholder { color: #999; }
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-size: 0.9rem;
}

/* 片区卡片 */
.district-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid #f0f0f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.district-card .card-image-wrap {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}
.district-card .card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.district-card .desc {
  padding: 16px 20px 20px;
  text-align: center;
}
.district-card .title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 4px;
}
.district-card .subtitle {
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 16px;
}
.district-card .district-desc {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 16px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.explore-btn {
  width: 100%;
  padding: 14px;
  border-radius: 24px;
  border: none;
  background: #5CB8B2;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.5px;
}
.explore-btn:hover { background: #4AA89F; }

/* Learn More 链接 */
.view-more-btn {
  display: block;
  width: 100%;
  text-align: right;
  margin-top: 4px;
  margin-bottom: 14px;
  padding: 0;
  border: none;
  background: transparent;
  color: #5CB8B2;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.view-more-btn:hover {
  color: #4AA89F;
}


/* 片区详情弹窗 */
.district-detail-content {
  width: 90%;
  max-width: 360px;
  max-height: 80vh;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.district-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 0;
}
.district-detail-header h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}
.district-detail-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f5f5f5;
  color: #666;
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.2s;
}
.district-detail-close:hover {
  background: #e0e0e0;
  color: #333;
}
.district-detail-body {
  padding: 16px 20px 24px;
}
.district-detail-media {
  width: 100%;
  height: 180px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
  background: #000;
}
.district-detail-media img,
.district-detail-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.district-detail-video {
  object-fit: contain;
  background: #000;
}
.district-detail-text {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.7;
  text-align: left;
}

/* Featured 标签 */
.featured-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #5CB8B2;
  color: #fff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* 位置提示 */
.location-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #5CB8B2;
  font-size: 0.85rem;
  margin: -8px 0 16px 4px;
}
.loc-icon { font-size: 1rem; }

/* 底部文字 */
.district-footer {
  text-align: center;
  color: #999;
  font-size: 0.8rem;
  margin-top: 8px;
  padding-bottom: 20px;
}

/* 登录/注册弹窗 - 白色主题 */
.modal { position:fixed; inset:0; z-index:9998; background:rgba(0,0,0,0.5); display:none; align-items:center; justify-content:center; padding:20px; }
.modal.show { display:flex; }
.modal-content { width:80%; max-width:420px; background:#fff; border-radius:20px; overflow:hidden; box-shadow:0 8px 32px rgba(0,0,0,0.15); }
.modal-header { padding:28px 24px 0; text-align:center; position:relative; }
.modal-header h3 { font-size:1.4rem; font-weight:700; color:#1a1a1a; margin-bottom:6px; }
.modal-subtitle { font-size:0.9rem; color:#888; }
.modal-close { position:absolute; top:12px; right:16px; width:32px; height:32px; border:none; background:transparent; color:#999; font-size:24px; line-height:32px; cursor:pointer; border-radius:50%; transition:all 0.2s; display:flex; align-items:center; justify-content:center; }
.modal-close:hover { background:#f0f0f0; color:#666; }
.modal-body { padding:24px; }
.form-group { margin-bottom:18px; }
.form-group label { display:block; font-size:0.85rem; color:#666; margin-bottom:8px; font-weight:500; }
.form-group input, .form-group select { width:100%; padding:14px 16px; border-radius:12px; border:1px solid #e0e0e0; background:#f8f8f8; color:#333; font-size:0.95rem; outline:none; transition:border-color 0.2s; }
.form-group input:focus, .form-group select:focus { border-color:#5CB8B2; background:#fff; }
.form-group input::placeholder { color:#aaa; }
.modal .btn-primary { width:100%; padding:15px; background:#5CB8B2; border:none; border-radius:25px; color:#fff; font-size:1rem; font-weight:600; cursor:pointer; margin-top:8px; transition:background 0.2s; }
.modal .btn-primary:hover { background:#4AA89F; }
.modal .btn-row { display:flex; justify-content:center; gap:16px; margin-top:20px; }
.modal .btn-link { background:none; border:none; color:#5CB8B2; font-size:0.9rem; cursor:pointer; padding:8px 16px; }
.modal .btn-cancel { padding:12px 24px; background:transparent; border:1px solid #ddd; border-radius:20px; color:#888; font-size:0.9rem; cursor:pointer; min-width:100px; text-align:center; }
.modal .btn-save { padding:12px 24px; background:#5CB8B2; border:none; border-radius:20px; color:#fff; font-size:0.9rem; font-weight:600; cursor:pointer; }

/* 注册弹窗 - 可滚动 */
.modal-scroll-wrap { width:100%; max-width:400px; max-height:90vh; background:#fff; border-radius:20px; overflow:hidden; box-shadow:0 8px 32px rgba(0,0,0,0.15); display:flex; flex-direction:column; }
.reg-content { padding:24px 24px 16px; overflow-y:auto; text-align:center; }
.reg-content::-webkit-scrollbar { width:4px; }
.reg-content::-webkit-scrollbar-thumb { background:#ddd; border-radius:2px; }
.reg-logo { margin-bottom:8px; }
.reg-title { font-size:1.3rem; font-weight:700; color:#1a1a1a; margin-bottom:4px; }
.reg-subtitle { font-size:0.85rem; color:#888; margin-bottom:8px; }
.reg-login-link { font-size:0.8rem; color:#3CBAA8; margin-bottom:20px; cursor:pointer; text-decoration:underline; }

.reg-form { text-align:left; }
.reg-field { margin-bottom:16px; }
.reg-field label { display:block; font-size:0.8rem; color:#555; margin-bottom:6px; font-weight:500; }
.reg-field input, .reg-field select { width:100%; padding:12px 14px; border-radius:10px; border:1px solid #e8e8e8; background:#fafafa; color:#333; font-size:0.9rem; outline:none; }
.reg-field input:focus, .reg-field select:focus { border-color:#5CB8B2; background:#fff; }
.reg-field input::placeholder { color:#bbb; }
.char-hint { font-size:0.7rem; color:#aaa; text-align:right; margin-top:2px; }

/* 头像选择 */
.avatar-list { display:flex; gap:10px; align-items:center; }
.avatar-add { width:48px; height:48px; border:2px dashed #ddd; border-radius:12px; display:flex; align-items:center; justify-content:center; cursor:pointer; color:#aaa; font-size:1.4rem; transition:border-color 0.2s; }
.avatar-add:hover { border-color:#5CB8B2; color:#5CB8B2; }
.avatar-item { width:52px; height:52px; border-radius:12px; overflow:hidden; cursor:pointer; border:2px solid transparent; transition:border-color 0.2s; display:flex; align-items:center; justify-content:center; background:#f5f5f5; }
.avatar-item:hover { border-color:#ddd; }
.avatar-item.active { border-color:#5CB8B2; }

/* 语言标签 */
.lang-tags { display:flex; gap:8px; flex-wrap:wrap; }
.lang-tag { padding:8px 16px; border-radius:20px; border:1px solid #e0e0e0; background:#fff; color:#666; font-size:0.8rem; cursor:pointer; transition:all 0.2s; }
.lang-tag:hover { border-color:#5CB8B2; color:#5CB8B2; }
.lang-tag.active { background:#5CB8B2; border-color:#5CB8B2; color:#fff; }

/* 性别标签 */
.gender-select { display:flex; gap:8px; flex-wrap:wrap; }
.gender-tag { padding:8px 16px; border-radius:20px; border:1px solid #e0e0e0; background:#fff; color:#666; font-size:0.8rem; cursor:pointer; transition:all 0.2s; }
.gender-tag:hover { border-color:#5CB8B2; color:#5CB8B2; }
.gender-tag.active { background:#5CB8B2; border-color:#5CB8B2; color:#fff; }

/* 注册提交按钮 */
.reg-submit { width:100%; padding:14px; border-radius:25px; border:none; background:#5CB8B2; color:#fff; font-size:1rem; font-weight:600; cursor:pointer; margin-top:8px; transition:background 0.2s; }
.reg-submit:hover { background:#4AA89F; }
.reg-skip { text-align:center; padding:12px; color:#aaa; font-size:0.85rem; cursor:pointer; margin-top:4px; }
.reg-terms { text-align:center; font-size:0.7rem; color:#aaa; margin-top:8px; }
.reg-terms a { color:#5CB8B2; text-decoration:none; }

/* Toast 提示模态框 */
.toast-modal { position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,0.5); display:none; align-items:center; justify-content:center; z-index:100000; }
.toast-modal.show { display:flex; }
.toast-content { background:#fff; border-radius:16px; padding:24px 32px; max-width:280px; width:80%; text-align:center; box-shadow:0 4px 20px rgba(0,0,0,0.15); }
.toast-icon { font-size:40px; margin-bottom:12px; }
.toast-message { font-size:15px; color:#333; line-height:1.5; }

/* 主界面 */
#mainApp { display:none; height:100vh; background:#F7F3EE; color:#333; }
.tab-bar { position:fixed; bottom:0; left:0; right:0; height:56px; background:#fff; display:flex; justify-content:space-around; align-items:center; border-top:1px solid #eee; }
.tab-bar a { color:#666; font-size:0.75rem; text-decoration:none; }
.tab-bar a.active { color:#C45C26; }
.map-area { height:calc(100vh - 56px); background:#e5e5e5; display:flex; align-items:center; justify-content:center; color:#999; }

/* ==========================================
   响应式适配 - 平板/PC
   ========================================== */

/* 欢迎页响应式 */
@media (min-width: 768px) {
  .bird-wrap { width: 140px; height: 120px; margin-top: 0; }
  .hand-wrap { width: 80px; height: 80px; right: 32px; top: calc(100% - 78px); }
  .brand h1 { font-size: 2.6rem; }
  .tap-hint { font-size: 0.95rem; }
}

@media (min-width: 1024px) {
  .bird-wrap { width: 140px; height: 120px; margin-top: 0; }
  .hand-wrap { width: 80px; height: 80px; right: 32px; top: calc(100% - 78px); }
  .brand h1 { font-size: 2.6rem; }
  .tap-hint { font-size: 0.95rem; }
}

/* 矮屏：压缩上部间距，保证文字与手指不重叠 */
@media (max-height: 640px) {
  .bird-wrap { width: 110px; height: 95px; margin-top: 0; }
  .tap-guide { margin-top: 24px; padding-bottom: 60px; }
  .hand-wrap { width: 58px; height: 58px; right: 18px; top: calc(100% - 50px); }
  .brand { bottom: 32px; }
  .brand img { width: 120px; }
}

/* 城市选择页响应式 */
@media (min-width: 768px) {
  #citySelect {
    max-width: 768px;
    margin-left: auto;
    margin-right: auto;
  }
  .city-card {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }
  .current-loc,
  .nearest-city-hint {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 1024px) {
  #citySelect {
    max-width: 500px;
  }
  .city-card {
    max-width: 500px;
  }
  .current-loc,
  .nearest-city-hint {
    max-width: 500px;
  }
}

/* 片区选择页响应式 */
@media (min-width: 768px) {
  #districtSelect > * {
    max-width: 768px;
    margin-left: auto;
    margin-right: auto;
  }
  #districtSelect {
    padding-left: 0;
    padding-right: 0;
  }
  #districtSelect .page {
    padding-left: 16px;
    padding-right: 16px;
  }
  .district-card {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }
  .location-hint {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 1024px) {
  body {
    background: #d0d0d0;
  }
  #districtSelect > * {
    max-width: 500px;
  }
  #districtSelect {
    max-width: 100%;
  }
  .city-card {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }
  .district-card {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }
  .modal {
    align-items: center;
  }
  .modal .modal-content {
    max-width: 500px;
  }
}
