* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #64d5cb;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #2b4f4c;
}

#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* UI 层通用毛玻璃胶囊规范 */
.glass-panel {
  background: rgba(226, 247, 245, 0.76);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 24px rgba(35, 85, 82, 0.10);
  border-radius: 20px;
  pointer-events: auto;
}

#ui-root {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 30px;
}

/* ================= 左上角状态与委托 ================= */
.top-left-hud {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.time-capsule {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  color: #375b58;
  letter-spacing: 0.5px;
}

.time-capsule svg {
  width: 17px;
  height: 17px;
  stroke: #477571;
}

.quest-card {
  width: 190px;
  padding: 14px 18px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quest-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #638c88;
  font-weight: 500;
}

.quest-title {
  font-size: 17px;
  font-weight: 700;
  color: #274b48;
  letter-spacing: 0.5px;
}

.progress-track {
  width: 100%;
  height: 4px;
  background: rgba(85, 145, 140, 0.2);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: #3eb4a8;
  border-radius: 4px;
  transition: width 0.4s ease, background-color 0.3s;
}

/* ================= 右上角资产与设置 ================= */
.top-right-hud {
  position: absolute;
  top: 24px;
  right: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.asset-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 18px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  color: #315855;
}

.asset-badge svg {
  width: 18px;
  height: 18px;
  stroke: #417571;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
}

.icon-btn:hover {
  transform: scale(1.06);
  background: rgba(255, 255, 255, 0.95);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  stroke: #417571;
}

/* ================= 左下角圆形雷达小地图 ================= */
.bottom-left-hud {
  position: absolute;
  bottom: 24px;
  left: 30px;
  display: flex;
  align-items: flex-end;
  gap: 14px;
}

.minimap-wrapper {
  position: relative;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  padding: 4px;
  background: rgba(220, 246, 244, 0.85);
  box-shadow: 0 8px 24px rgba(35, 85, 82, 0.15), inset 0 2px 4px rgba(255, 255, 255, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.95);
  overflow: hidden;
}

#minimap-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
}

.location-tag {
  font-size: 13px;
  font-weight: 600;
  color: #375f5c;
  padding-bottom: 6px;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
}

/* ================= 底部中央操作主卡片 ================= */
.bottom-center-hud {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
}

.action-card {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 12px 34px 12px 28px;
  border-radius: 36px;
  min-width: 580px;
  height: 94px;
}

.action-status-col {
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-title {
  font-size: 19px;
  font-weight: 700;
  color: #244946;
}

.status-desc {
  font-size: 12px;
  color: #5c8784;
}

/* 核心大圆环按纽 */
.action-core-col {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -16px; /* 向上微悬浮出卡片，极具视觉层次 */
}

.charge-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 96px;
  height: 96px;
  transform: rotate(-90deg);
  pointer-events: none;
}

.charge-bg-circle {
  fill: none;
  stroke: rgba(62, 180, 168, 0.25);
  stroke-width: 5.5;
}

.charge-bar-circle {
  fill: none;
  stroke: #26a598;
  stroke-width: 5.5;
  stroke-linecap: round;
  stroke-dasharray: 276.46;
  stroke-dashoffset: 276.46;
  transition: stroke-dashoffset 0.08s linear;
}

.action-button {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e4fbf9 0%, #b8eae4 100%);
  border: 2px solid #ffffff;
  box-shadow: 0 6px 18px rgba(35, 120, 115, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.15s, box-shadow 0.15s;
}

.action-button:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(35, 120, 115, 0.32);
}

.action-button:active {
  transform: scale(0.96);
}

.action-button span {
  font-size: 16px;
  font-weight: 700;
  color: #275653;
}

.action-button.pulse {
  animation: pulseAnim 0.7s infinite alternate ease-in-out;
  border-color: #ffde59;
}

.action-button.reeling {
  animation: reelShake 0.12s infinite;
  background: linear-gradient(135deg, #ffe0b2 0%, #ffb74d 100%);
}

@keyframes pulseAnim {
  0% { transform: scale(1.0); box-shadow: 0 0 10px rgba(46, 175, 163, 0.4); }
  100% { transform: scale(1.08); box-shadow: 0 0 25px rgba(46, 175, 163, 0.85); }
}

@keyframes reelShake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  50% { transform: translate(-1px, -1px) rotate(-1deg); }
  100% { transform: translate(1px, -1px) rotate(1deg); }
}

.action-hints-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #638f8c;
  line-height: 1.5;
}

/* 张力调节条 */
.tension-bar-wrap {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  overflow: hidden;
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.tension-bar-fill {
  width: 50%;
  height: 100%;
  background: #10b981;
  transition: width 0.08s linear, background-color 0.2s;
}

/* ================= 右下角快捷工具栏 ================= */
.bottom-right-hud {
  position: absolute;
  bottom: 24px;
  right: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.quick-slot {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-slot:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.95);
}

.quick-slot.active {
  border: 2px solid #36a498;
  box-shadow: 0 0 14px rgba(54, 164, 152, 0.35);
}

.quick-slot .key-tag {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #699793;
}

.quick-slot .badge-num {
  position: absolute;
  bottom: 4px;
  right: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #4a7572;
}

.quick-slot svg {
  width: 22px;
  height: 22px;
  stroke: #335d5a;
}

/* ================= 弹窗系统 ================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(18, 55, 52, 0.35);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 420px;
  padding: 30px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(246, 254, 253, 0.96) 0%, rgba(224, 248, 246, 0.92) 100%);
  border: 2px solid #ffffff;
  box-shadow: 0 16px 40px rgba(18, 55, 52, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.catch-header-tag {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #278d82;
  margin-bottom: 8px;
}

.catch-fish-name {
  font-size: 26px;
  font-weight: 800;
  color: #1e4542;
  margin-bottom: 6px;
}

.catch-badge-row {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.rarity-pill {
  padding: 3px 12px;
  border-radius: 20px;
  background: #3eb4a8;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
}

.weight-pill {
  padding: 3px 12px;
  border-radius: 20px;
  background: rgba(62, 180, 168, 0.18);
  color: #2b615c;
  font-size: 12px;
  font-weight: 600;
}

.catch-fish-desc {
  font-size: 13px;
  color: #557e7a;
  line-height: 1.6;
  margin-bottom: 22px;
  padding: 0 10px;
}

.catch-reward-box {
  background: rgba(255, 255, 255, 0.7);
  padding: 10px 24px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 700;
  color: #d97706;
  margin-bottom: 22px;
  border: 1px dashed rgba(217, 119, 6, 0.4);
}

.modal-btn-primary {
  padding: 12px 38px;
  border-radius: 30px;
  background: linear-gradient(135deg, #37b7aa 0%, #299b8f 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(41, 155, 143, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}

.modal-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(41, 155, 143, 0.45);
}

/* 图鉴与地图弹窗 */
.compendium-card {
  width: 580px;
  max-height: 80vh;
  text-align: left;
  padding: 26px 30px;
}

.compendium-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 18px;
}

.comp-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: 55vh;
  padding-right: 6px;
}

.compendium-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.65);
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.85);
}

.comp-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1.5px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.comp-info {
  flex: 1;
}

.comp-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.comp-name {
  font-size: 16px;
  font-weight: 700;
  color: #214744;
}

.comp-rarity {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  background: #3db8ab;
  color: #fff;
}

.comp-desc {
  font-size: 12px;
  color: #618784;
  margin-bottom: 4px;
}

.comp-stat {
  font-size: 11px;
  color: #92b1ae;
}

/* Toast 提示 */
#toast {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(26, 68, 65, 0.88);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 10px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ================= 虚拟摇杆 (移动端与触控) ================= */
.joystick-zone {
  position: absolute;
  bottom: 24px;
  left: 24px;
  width: 140px;
  height: 140px;
  display: none; /* 宽屏桌面下默认隐藏，竖屏/触屏下激活 */
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  touch-action: none;
  z-index: 25;
}

.joystick-base {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: rgba(226, 247, 245, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 20px rgba(35, 85, 82, 0.12), inset 0 2px 6px rgba(255, 255, 255, 0.6);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.joystick-thumb {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff 0%, #bdeee8 100%);
  border: 2px solid #ffffff;
  box-shadow: 0 4px 14px rgba(35, 120, 115, 0.3);
  position: absolute;
  transform: translate(0, 0);
  pointer-events: none;
  transition: transform 0.04s ease-out;
}

.joystick-arrows {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.35;
  color: #275653;
  font-size: 11px;
}

.joystick-arrows span {
  position: absolute;
}
.arr-up { top: 6px; left: 50%; transform: translateX(-50%); }
.arr-down { bottom: 6px; left: 50%; transform: translateX(-50%); }
.arr-left { left: 6px; top: 50%; transform: translateY(-50%); }
.arr-right { right: 6px; top: 50%; transform: translateY(-50%); }

.joystick-run-tag {
  position: absolute;
  top: -4px;
  padding: 2px 8px;
  background: rgba(22, 101, 95, 0.82);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  letter-spacing: 0.5px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
  pointer-events: none;
}

.joystick-run-tag.active {
  opacity: 1;
  transform: translateY(0);
}

/* ================= 竖屏 / 移动端深度专属优化 ================= */
@media (max-width: 768px), (orientation: portrait), (pointer: coarse) {
  #ui-root {
    padding: 12px 14px;
  }

  /* 1. 顶部左侧：微型时间与任务卡 */
  .top-left-hud {
    gap: 8px;
  }

  .time-capsule {
    padding: 5px 12px;
    font-size: 12px;
    gap: 6px;
  }
  .time-capsule svg {
    width: 14px;
    height: 14px;
  }

  .quest-card {
    width: 136px;
    padding: 8px 12px;
    border-radius: 14px;
    gap: 4px;
  }
  .quest-header {
    font-size: 11px;
  }
  .quest-title {
    font-size: 14px;
  }

  /* 2. 顶部右侧：紧凑资产与设置 */
  .top-right-hud {
    top: 12px;
    right: 14px;
    gap: 6px;
  }
  .asset-badge {
    padding: 5px 10px;
    font-size: 12px;
    gap: 6px;
  }
  .asset-badge svg {
    width: 15px;
    height: 15px;
  }
  .icon-btn {
    width: 32px;
    height: 32px;
  }
  .icon-btn svg {
    width: 15px;
    height: 15px;
  }

  /* 3. 小地图在竖屏下挪到左上任务卡正下方，避开左手拇指摇杆 */
  .bottom-left-hud {
    position: absolute;
    top: 116px;
    left: 14px;
    bottom: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .minimap-wrapper {
    width: 74px;
    height: 74px;
    border-width: 1.5px;
    box-shadow: 0 4px 14px rgba(35, 85, 82, 0.15);
  }

  .location-tag {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 8px;
    background: rgba(226, 247, 245, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.85);
    padding-bottom: 2px;
  }

  /* 4. 虚拟摇杆在竖屏下常显于左下拇指热区 */
  .joystick-zone {
    display: flex;
    bottom: 22px;
    left: 16px;
    width: 126px;
    height: 126px;
  }

  .joystick-base {
    width: 108px;
    height: 108px;
  }

  .joystick-thumb {
    width: 44px;
    height: 44px;
  }

  /* 5. 核心操作面板转化为右下拇指操作台 */
  .bottom-center-hud {
    position: absolute;
    bottom: 20px;
    right: 16px;
    left: auto;
    transform: none;
  }

  .action-card {
    min-width: auto;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: auto;
  }

  .action-hints-col {
    display: none; /* 移动端隐藏键盘提示 */
  }

  .action-status-col {
    min-width: auto;
    background: rgba(226, 247, 245, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1.5px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 16px rgba(35, 85, 82, 0.12);
    border-radius: 20px;
    padding: 5px 14px;
    align-items: center;
    text-align: center;
    white-space: nowrap;
  }

  .status-title {
    font-size: 13px;
  }

  .status-desc {
    font-size: 10px;
    max-width: 125px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .action-core-col {
    width: 82px;
    height: 82px;
    margin-top: 0;
  }

  .charge-svg {
    width: 82px;
    height: 82px;
  }

  .action-button {
    width: 66px;
    height: 66px;
  }

  .action-button span {
    font-size: 14px;
  }

  .tension-bar-wrap {
    top: -24px;
    width: 100px;
    height: 6px;
  }

  /* 6. 右侧快捷栏坚向排列在核心按钮上方，单手轻点可达 */
  .bottom-right-hud {
    position: absolute;
    bottom: 128px;
    right: 18px;
    flex-direction: column;
    gap: 8px;
  }

  .quick-slot {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .quick-slot svg {
    width: 18px;
    height: 18px;
  }

  .quick-slot .key-tag {
    display: none;
  }

  .quick-slot .badge-num {
    font-size: 9px;
    bottom: 2px;
    right: 4px;
  }

  /* 7. 弹窗在小屏/竖屏居中适配 */
  .modal-card {
    width: 88vw;
    max-width: 360px;
    padding: 22px 16px;
    border-radius: 22px;
  }

  .catch-fish-name {
    font-size: 22px;
  }

  .comp-list {
    max-height: 46vh;
  }
}
