/* ============================================================
   探索页样式 v3
   ============================================================ */

/* 探索页比全站宽一点，把空间让给地图 */
.wrap-wide {
  max-width: 1216px;
}

.explore-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 252px;
  gap: 28px;
  align-items: start;
  padding: clamp(24px, 3.5vw, 40px) 0 clamp(48px, 6vw, 72px);
}

/* ---------- 第一行：搜索 + 两个下拉 ---------- */

.search-row {
  display: flex;
  gap: 9px;
  align-items: stretch;
  margin-bottom: 14px;
}

.search-bar {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.search-input {
  flex: 1;
  min-width: 0;
  padding: 13px 18px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.search-input::placeholder { color: var(--ink-faint); }
.search-input:focus {
  outline: none;
  border-color: var(--moss);
  box-shadow: 0 0 0 3px rgba(107,127,94,.12);
}

.search-clear {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 50%;
  color: var(--ink-soft);
  font-size: 16px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: border-color .2s, color .2s;
}
.search-clear:hover { border-color: var(--clay-soft); color: var(--clay); }

/* ---------- 通用下拉 ---------- */

.dropdown { position: relative; flex: 0 0 auto; }

.dd-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 15px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .2s, color .2s;
}
.dd-trigger:hover { border-color: var(--clay-soft); color: var(--ink); }
.dd-trigger[aria-expanded="true"] {
  border-color: var(--moss);
  color: var(--ink);
}
.dd-trigger.is-active { color: var(--ink); }

.dd-label {
  color: var(--ink-faint);
  font-size: 13px;
}

.dd-current {
  font-weight: 600;
  color: var(--moss);
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dd-cur-icon {
  display: inline-flex;
  align-items: center;
}

.dd-caret {
  width: 10px; height: 6px;
  flex: 0 0 auto;
  opacity: .5;
  transition: transform .2s ease;
}
.dd-trigger[aria-expanded="true"] .dd-caret { transform: rotate(180deg); }

.dd-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: 300px;
  max-height: 420px;
  overflow-y: auto;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(80,64,48,.14);
}

.dd-panel-sm { width: 150px; padding: 7px; }

.dd-list { display: flex; flex-direction: column; gap: 1px; }

.dd-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background .16s, color .16s;
}
.dd-item:hover { background: var(--bg-warm); color: var(--ink); }
.dd-item.is-active {
  background: var(--moss);
  color: #fff;
}

.panel-hint {
  margin: 2px 6px 10px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-faint);
}

.panel-list { display: flex; flex-direction: column; gap: 2px; }

.panel-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--ink);
  transition: background .16s ease;
}
.panel-item:hover { background: var(--bg-warm); }

.panel-dot {
  flex: 0 0 9px; width: 9px; height: 9px;
  border-radius: 50%;
}

.panel-text { min-width: 0; display: flex; flex-direction: column; }
.panel-name { font-size: 14px; font-weight: 600; line-height: 1.35; }
.panel-desc { font-size: 11.5px; color: var(--ink-faint); line-height: 1.4; margin-top: 1px; }

/* ---------- 条件行 ---------- */

.conditions-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  min-height: 26px;
  margin-bottom: 14px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-soft);
}

.bc-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--moss);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--clay-soft);
}
.bc-link:hover { color: var(--moss-deep); }

.bc-current { color: var(--ink); font-weight: 600; }
.bc-sep { color: var(--ink-faint); }
.bc-muted { color: var(--ink-faint); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 7px 3px 10px;
  background: var(--bg-warm);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-soft);
}
.chip b { font-weight: 600; color: var(--ink); }

.chip button {
  width: 15px; height: 15px;
  border: 0; padding: 0;
  border-radius: 50%;
  background: rgba(46,42,38,.10);
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
}
.chip button:hover { background: var(--clay); color: #fff; }

/* ---------- 地图 ---------- */

.map-panel {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  overflow: hidden;
}

/* 海洋底色：缓慢呼吸的暖调渐变，让静态地图有一点生气 */
.map-panel::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: calc(var(--radius) - 6px);
  background:
    radial-gradient(120% 90% at 50% 0%, #f8f4ed 0%, #f0ebe1 100%);
  animation: ocean-breathe 18s ease-in-out infinite;
  pointer-events: none;
}

@keyframes ocean-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: .72; }
}

@media (prefers-reduced-motion: reduce) {
  .map-panel::before { animation: none; }
}

.map-back {
  position: absolute;
  left: 22px;
  top: 20px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink-soft);
  background: rgba(255,255,255,.94);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.map-back[hidden] { display: none; }
.map-back:hover { color: var(--moss); border-color: var(--clay-soft); }

/* 鼠标跟随的地名标签 */
.map-hover {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink);
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(80, 64, 48, .12);
  pointer-events: none;
  white-space: nowrap;
  transition: transform .06s linear;
}
.map-hover[hidden] { display: none; }

/* 触摸设备不需要跟随标签 */
@media (hover: none) {
  .map-hover { display: none !important; }
}

.map-tip {
  position: absolute;
  right: 22px;
  bottom: 14px;
  margin: 0;
  font-size: 11.5px;
  color: var(--ink-faint);
  pointer-events: none;
}

/* 比例尺文字随 SVG 缩放，这里只约束字体度量 */
.map-svg .scale-text {
  font-family: var(--font-sans);
  fill: var(--ink-soft);
  pointer-events: none;
  user-select: none;
}

/* 缩放控件：右上角竖排（左下留给比例尺） */
.map-zoom {
  position: absolute;
  right: 22px;
  top: 20px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.zoom-btn {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  padding: 0;
  font-family: inherit;
  font-size: 15px;
  line-height: 1;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: color .18s, border-color .18s, opacity .2s, transform .18s;
}
.zoom-btn:hover:not(:disabled) {
  color: var(--moss);
  border-color: var(--clay-soft);
}
.zoom-btn:active:not(:disabled) { transform: scale(.94); }
.zoom-btn:disabled { opacity: .32; cursor: default; }

.zoom-reset { font-size: 13px; }

.map-svg {
  display: block;
  width: 100%;
  /* 固定高度：否则接近正方形的国家（巴西/印度/澳大利亚）会把地图
     拉到 800px 以上，页面剧烈跳动、返回按钮被顶出视口。
     配合 SVG 默认的 xMidYMid meet，内容自动居中，不同国家只是留白不同。 */
  height: clamp(300px, 34vw, 404px);
  position: relative;
  touch-action: pan-y; /* 未放大时，手指上下滑动交还给页面滚动 */
}

/* 放大之后才接管手势，允许任意方向拖动 */
.map-panel.is-zoomed .map-svg { touch-action: none; }

/* 拖动中：光标变成抓手，并且不再触发悬停高亮 */
.map-svg.is-dragging { cursor: grabbing; }
.map-svg.is-dragging .country,
.map-svg.is-dragging .subunit { cursor: grabbing; }

/* 陆地：比海洋深一档，带轻微描边提升轮廓 */
.map-svg .country {
  fill: #e2dbcd;
  stroke: #f5f1e9;
  stroke-width: 0.45;
  stroke-linejoin: round;
  cursor: pointer;
  transition: fill .18s ease, filter .18s ease;
  /* 入场淡入：backwards 让延迟期保持透明，动画结束正常显示。
     若动画不生效（老浏览器），opacity:1 保证地图依然可见。 */
  opacity: 1;
  animation: land-rise .55s cubic-bezier(.22, .61, .36, 1) backwards;
}
.map-svg .country:hover {
  fill: #eed6bf;
  filter: drop-shadow(0 1px 3px rgba(150, 110, 70, .28));
}
.map-svg .country.is-selected {
  fill: var(--moss);
  filter: drop-shadow(0 1px 4px rgba(107, 127, 94, .35));
}

@keyframes land-rise {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .map-svg .country { animation: none; }
}

.map-svg .subunit {
  fill: #e2dbcd;
  stroke: #f5f1e9;
  stroke-width: 1.1;
  stroke-linejoin: round;
  cursor: pointer;
  transition: fill .18s ease, filter .18s ease;
  opacity: 1;
  animation: land-rise .45s ease backwards;
}
.map-svg .subunit:hover {
  fill: #eed6bf;
  filter: drop-shadow(0 1px 4px rgba(150, 110, 70, .3));
}
.map-svg .subunit.is-selected {
  fill: var(--moss);
  filter: drop-shadow(0 1px 5px rgba(107, 127, 94, .35));
}

@media (prefers-reduced-motion: reduce) {
  .map-svg .subunit { animation: none; }
}

.map-svg .marker-leader {
  stroke: var(--clay);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: .5;
  pointer-events: none;
  /* 线宽按屏幕像素固定，放大后引线不会变成粗管子 */
  vector-effect: non-scaling-stroke;
}

.map-svg .marker-dot {
  fill: var(--clay);
  stroke: #fff;
  stroke-width: 2.5;
  transition: fill .16s ease;
}
.map-svg .sub-marker:hover .marker-dot { fill: var(--clay-soft); }
.map-svg .marker-dot.is-selected { fill: var(--moss); }

.map-svg .marker-label {
  font-family: var(--font-sans);
  font-size: 13px;
  fill: var(--ink-soft);
  pointer-events: none;
  user-select: none;
}
.map-svg .sub-marker:hover .marker-label { fill: var(--ink); }

.map-svg .city-dot {
  fill: var(--clay);
  stroke: #fff;
  stroke-width: .8;
  pointer-events: none;
}

/* ---------- 地图下方的门户条 ---------- */

.portal-strip {
  margin-top: 14px;
  padding: 11px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.portal-strip-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.world-mood {
  margin: 9px 2px 0;
  font-family: var(--font-serif);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-soft);
  letter-spacing: .02em;
  min-height: 1.75em;
}

.note-label {
  display: inline-block;
  margin-right: 7px;
  padding: 1px 6px;
  font-family: var(--font-sans);
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--clay);
  background: var(--bg-warm);
  border-radius: 5px;
  vertical-align: 1px;
  white-space: nowrap;
}

.note-text { color: var(--ink-soft); }

.note-from {
  margin-left: 6px;
  color: var(--ink-faint);
  font-size: 11.5px;
  white-space: nowrap;
}

.random-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px 7px 12px;
  font-family: inherit;
  font-size: 13px;
  color: var(--clay);
  background: var(--bg-warm);
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.random-btn:hover {
  background: var(--card);
  border-color: var(--clay-soft);
  transform: translateY(-1px);
}
.random-btn:active { transform: translateY(0) scale(.98); }

.random-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  transition: transform .5s cubic-bezier(.34, 1.56, .64, 1);
}
.random-btn:hover .random-icon { transform: rotate(90deg); }

.world-clock {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-soft);
}

.clock-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.clock-sun {
  font-size: 11px;
  line-height: 1;
  opacity: .85;
}
.clock-sun.is-day { color: var(--clay); }
.clock-sun.is-night { color: var(--moss); opacity: .6; }

.clock-city { color: var(--ink-faint); }

.clock-time {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: .02em;
}

/* ---------- 响应式 ---------- */

.side-panel {
  position: sticky;
  top: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 15px;
}

/* 平台切换：一行紧凑胶囊，选中时用平台品牌色 */
.board-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  padding: 3px;
  background: var(--bg-warm);
  border-radius: 999px;
}

.board-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 6px 4px;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.4;
  text-align: center;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.board-tab:hover { color: var(--ink); }
.board-tab.is-active {
  color: #fff;
  background: var(--tab-accent, var(--moss));
  box-shadow: 0 2px 8px rgba(80, 64, 48, .16);
}

/* 分页条 */
.hot-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.hot-pager:empty { display: none; }

.pager-btn {
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  font-family: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  transition: background .16s, color .16s, border-color .16s;
}
.pager-btn:hover:not(:disabled) {
  background: var(--bg-warm);
  border-color: var(--line);
  color: var(--ink);
}
.pager-btn.is-active {
  color: var(--moss-deep);
  background: var(--card);
  border-color: var(--moss);
  font-weight: 600;
}
.pager-btn:disabled { opacity: .3; cursor: default; }

.hot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

/* 更新时间 + 刷新按钮 */
.hot-tools {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}

.hot-refresh {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease;
}

.hot-refresh svg {
  width: 13px;
  height: 13px;
  display: block;
}

.hot-refresh:hover {
  color: var(--moss);
  border-color: var(--moss);
}

.hot-refresh:active { transform: scale(.92); }

.hot-refresh.is-loading {
  pointer-events: none;
  color: var(--moss);
  border-color: var(--moss);
}

.hot-refresh.is-loading svg {
  animation: hotspin .75s linear infinite;
}

@keyframes hotspin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hot-refresh.is-loading svg { animation: none; }
}

.side-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink);
  margin: 0;
  transition: color .2s ease;
}

/* 选中地区后，标题变成「XX 热搜」 */
.side-title.is-region { color: var(--moss); }

/* 热度值（微博/百度有，知乎/B站部分有） */
.hot-value {
  flex: 0 0 auto;
  margin-left: auto;
  padding-left: 8px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
  white-space: nowrap;
}

.hot-note {
  margin: 0 0 8px;
  padding: 7px 10px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-faint);
  background: var(--bg-warm);
  border-radius: 7px;
}

.hot-updated {
  font-size: 11px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.hot-list { display: flex; flex-direction: column; }

.hot-item {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 8px 0;
  text-decoration: none;
  color: var(--ink-soft);
  border-bottom: 1px solid rgba(227,220,209,.5);
  transition: color .16s ease;
}
.hot-item:last-child { border-bottom: 0; }
.hot-item:hover { color: var(--moss); }

.hot-rank {
  flex: 0 0 17px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
  text-align: center;
}
.hot-rank.is-top { color: var(--clay); font-weight: 600; }

.hot-word {
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hot-loading {
  font-size: 12.5px;
  color: var(--ink-faint);
  padding: 16px 0;
  margin: 0;
  text-align: center;
}

.hot-foot {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-faint);
  line-height: 1.6;
}

/* ---------- 响应式 ---------- */

@media (max-width: 960px) {
  .explore-shell { grid-template-columns: 1fr; gap: 24px; }
  .side-panel { position: static; }
}

@media (max-width: 640px) {
  .search-row { flex-wrap: wrap; }
  .search-bar { flex: 1 1 100%; }
  .dropdown { flex: 1 1 auto; }
  .dd-trigger { width: 100%; justify-content: center; }
  .dd-panel { width: 260px; right: 0; }
  .map-tip { display: none; }
  .quick-icons { gap: 5px; }
  .portal-mini { padding: 5px 9px; font-size: 12px; }
}
