/* ============================================================
   1. 通用遮罩 / 弹窗
   ============================================================ */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(4, 3, 2, 0.32);
  animation: overlay-in 0.18s ease-out;
}

/* ============================================================
   2. 主菜单
   ============================================================ */
.menu-screen {
  position: absolute;
  inset: 0;
  background-color: #1a100a;
  background-image: var(--menu-bg);
  background-position: center;
  background-size: cover;
}

.menu-top {
  position: absolute;
  top: 12px;
  left: 18px;
}

.menu-top__btn {
  width: 124px;
  height: 32px;
  border: 1px solid #5d7f9b;
  background: linear-gradient(#1d3548, #0e1d29 70%);
  box-shadow: inset 0 0 12px rgba(90, 160, 200, 0.28), 0 2px 6px rgba(0, 0, 0, 0.55);
  color: #d8e7ef;
  font-size: 12px;
  letter-spacing: 3px;
}

.menu-top__btn:hover {
  filter: brightness(1.18);
}

.menu-logo {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
}

.menu-logo__img {
  width: 406px;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.55));
}

.menu-nav {
  position: absolute;
  top: 250px;
  left: 452px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 120px;
}

.menu-btn {
  position: relative;
  display: grid;
  place-items: center;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #a6aab5;
  background: linear-gradient(#464553, #33323e 46%, #2a2934);
  box-shadow: inset 0 0 0 1px rgba(18, 16, 24, 0.92), inset 0 0 12px rgba(0, 0, 0, 0.5),
    0 2px 5px rgba(0, 0, 0, 0.55);
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
  color: #c9a24d;
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  transition: filter 0.15s ease;
}

.menu-btn.is-primary {
  color: #d8a94b;
}

.menu-btn.is-disabled {
  color: #8c8c8c;
  border-color: #7f838d;
  background: linear-gradient(#3b3a45, #2d2c36);
  cursor: default;
}

.menu-btn:hover:not(.is-disabled) {
  filter: brightness(1.16);
}

.menu-btn:active:not(.is-disabled) {
  filter: brightness(0.92);
}

.menu-footer {
  position: absolute;
  inset: auto 0 0 0;
  height: 60px;
}

.menu-version {
  position: absolute;
  left: 20px;
  bottom: 17px;
  color: #e9e2d2;
  font-size: 14px;
  letter-spacing: 1px;
  text-shadow: 0 1px 3px #000;
}

.menu-mods {
  position: absolute;
  right: 34px;
  bottom: 13px;
  display: flex;
  gap: 12px;
}

.menu-btn--small {
  width: 106px;
  height: 28px;
  font-size: 12px;
  letter-spacing: 2px;
}

/* ============================================================
   3. 顶部 HUD
   ============================================================ */
.hud {
  position: absolute;
  top: 0;
  left: 0;
  /* 高于左右侧栏，保证资源悬浮说明可覆盖面板 */
  z-index: 14;
  width: 1024px;
  height: 48px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0, rgba(255, 255, 255, 0) 4px, rgba(0, 0, 0, 0.16) 26px, rgba(0, 0, 0, 0.4) 44px, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(180deg, #463b31 0%, #3b3128 22%, #2f261f 60%, #251d16 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

/* 单个资源模块：图标 + 底板 + 数值 + 储量条 */
.res {
  position: absolute;
  top: 0;
  width: 130px;
  height: 48px;
}

.res__icon {
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
}

.res__plate {
  position: absolute;
  top: 3px;
  height: 17px;
}

.res__value {
  position: absolute;
  top: 8px;
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.85);
}

.res__groove {
  position: absolute;
  top: 19px;
  height: 3px;
  border-radius: 2px;
  background: #140f0b;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.9);
}

.res__fill {
  position: absolute;
  top: 19px;
  height: 3px;
  border-radius: 2px;
  box-shadow: 0 0 3px currentColor;
}

/* 资源模块旁的小计数图标 */
.chip {
  position: absolute;
  width: 16px;
  height: 16px;
}

.chip__icon {
  position: absolute;
  left: 0;
  top: 0;
  width: 16px;
  height: 16px;
}

.chip__value {
  position: absolute;
  top: 4px;
  color: #a9a294;
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 600;
  line-height: 1;
}

/* 中央温度表盘：盘面素材 + 叠加数值 */
.gauge {
  position: absolute;
  left: 456px;
  top: 0;
  width: 116px;
  height: 48px;
}

.gauge__img {
  position: absolute;
  left: 0;
  top: 0;
  width: 116px;
  height: 48px;
}

.gauge__value {
  position: absolute;
  color: #f4f3e6;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  transform: translate(-50%, -50%);
}

/* 圆球热区：只覆盖表盘中央的圆球，悬浮时显示区间提示 */
.gauge__hit {
  position: absolute;
  z-index: 11;
  border-radius: 50%;
  cursor: help;
}

.gauge__tip {
  position: absolute;
  left: 50%;
  top: 100%;
  margin-top: 4px;
  transform: translateX(-50%);
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 2px 8px 3px;
  background: rgba(16, 20, 24, 0.94);
  border: 1px solid rgba(196, 166, 104, 0.6);
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  color: #cdbf9e;
  font-family: var(--font-ui);
  font-size: 10px;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.12s ease;
  pointer-events: none;
  z-index: 12;
}

.gauge__tip-band {
  color: #f3e6bf;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.gauge__tip-temp {
  color: #9fb6c4;
}

.gauge__hit:hover .gauge__tip {
  opacity: 1;
}

/* ============================================================
   4. 左侧工具栏
   ============================================================ */
.rail {
  position: absolute;
  top: 0;
  left: 0;
  /* 压过 HUD（14），保持参考版栏体上缘盖住顶栏底边 */
  z-index: 16;
  width: 1024px;
  height: 570px;
  pointer-events: none;
}

.rail__bar {
  position: absolute;
  top: 40px;
  left: 2px;
  width: 46px;
  height: 498px;
  border: 1px solid #4a3b29;
  background: linear-gradient(90deg, #241f1a, #171310 46%, #2a241d);
  box-shadow: inset 0 0 12px #000, 0 3px 8px rgba(0, 0, 0, 0.6);
}

.rail__slot {
  position: absolute;
  display: block;
  width: 42px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  pointer-events: auto;
}

.rail__icon {
  display: block;
  width: 42px;
  height: 40px;
  object-fit: fill;
}

.rail__divider {
  position: absolute;
  display: block;
  pointer-events: none;
}

.rail__tip {
  position: absolute;
  top: 50%;
  left: 46px;
  z-index: 30;
  padding: 3px 9px;
  border: 1px solid #6a5636;
  background: rgba(20, 16, 12, 0.96);
  color: #e2d5b6;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 0.15s ease;
}

.rail__slot:hover .rail__tip {
  opacity: 1;
}

/* ============================================================
   5. 世界视图
   ============================================================ */
.world {
  position: absolute;
  top: 30px;
  left: 52px;
  z-index: 1;
  width: 724px;
  height: 540px;
  overflow: hidden;
  background: #161311;
  box-shadow: inset 0 0 0 2px #1a1512;
}

.world__sky {
  position: absolute;
  top: 20px;
  left: 0;
  width: 100%;
  height: 158px;
  object-fit: cover;
}

.world__pyramid {
  position: absolute;
  height: auto;
  pointer-events: none;
}

.world__soil {
  position: absolute;
  top: 175px;
  right: 0;
  bottom: 0;
  left: 0;
}

.world__dirt-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 28px;
  object-fit: fill;
}

.world__rock {
  position: absolute;
  top: 27px;
  right: 0;
  bottom: 70px;
  left: 0;
  background-color: #2c2826;
  background-repeat: no-repeat;
  background-position: center top;
  background-size: 100% 100%;
}

.world__dirt-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70px;
  object-fit: fill;
}

/* ============================================================
   6. 右侧栏
   ============================================================ */
.sidebar {
  position: absolute;
  top: 48px;
  left: 776px;
  z-index: 7;
  width: 248px;
  height: 522px;
}

.sidebar__tools {
  position: absolute;
  top: 1px;
  left: 24px;
  z-index: 2;
  display: flex;
  gap: 5px;
}

.tool {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid #4a3b28;
  background: linear-gradient(#2a241d, #171310);
  box-shadow: inset 0 0 4px #000;
}

.tool:hover {
  border-color: #8a7448;
}

.tool.is-active {
  border-color: #c8a469;
  background: linear-gradient(#3a3128, #221c16);
  box-shadow: inset 0 0 6px rgba(200, 164, 105, 0.4), 0 0 6px rgba(200, 164, 105, 0.25);
}

.tool__icon {
  width: 21px;
  height: 21px;
  object-fit: cover;
}

.projects {
  position: absolute;
  top: 0;
  left: 24px;
  width: 222px;
  height: 402px;
  padding: 38px 8px 8px;
  border: 2px solid #5a4832;
  background: linear-gradient(#211d1a, #161311);
  box-shadow: var(--shadow-inset), inset 0 0 24px #000;
}

.projects__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-content: start;
}

.build-card {
  border: 1px solid #4c3d2a;
  background: #1b1714;
}

.build-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 13px;
  padding: 0 4px;
  border-bottom: 1px solid #3d3222;
  background: linear-gradient(#2c2535, #1b1720);
}

.build-card__name {
  color: #8f8a7f;
  font-size: 9px;
  letter-spacing: 1px;
}

.build-card__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #ffd07a, #a35a12);
  box-shadow: 0 0 4px #ffae42;
}

.build-card__art {
  width: 100%;
  height: 45px;
  object-fit: cover;
}

.build-card.is-selected {
  border-color: #5fd24b;
  box-shadow: 0 0 0 1px #2f7a22, 0 0 9px rgba(95, 210, 75, 0.45);
}

.build-card.is-selected .build-card__dot {
  background: radial-gradient(circle at 40% 35%, #c8ffb0, #3f8f2c);
  box-shadow: 0 0 5px #5fd24b;
}

.build-card.is-selected .build-card__art {
  height: 46px;
}

/* ============================================================
   7. 底部库存面板
   ============================================================ */
.inventory {
  position: absolute;
  top: 466px;
  left: 800px;
  z-index: 9;
  width: 222px;
  height: 104px;
  border: 2px solid #5a4832;
  background: linear-gradient(#c9b58f, #ae9770);
  box-shadow: inset 0 0 0 1px rgba(255, 246, 222, 0.5), 0 3px 8px rgba(0, 0, 0, 0.55);
}

.inventory__items {
  position: absolute;
  top: 7px;
  left: 8px;
  display: flex;
  gap: 3px;
}

.inv-item {
  width: 43px;
  height: 43px;
  padding: 0;
  border: 1px solid #6b5738;
  background: #1b1714;
  box-shadow: inset 0 0 6px #000;
}

.inv-item:hover {
  border-color: #d9b877;
}

.inv-item__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inventory__side {
  position: absolute;
  top: 7px;
  right: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.inventory__dots {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.7), 0 1px 1px rgba(255, 255, 255, 0.3);
}

.civ-emblem {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.inventory__civ {
  position: absolute;
  top: 55px;
  left: 10px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.civ-name {
  color: #3f7a2c;
  font-size: 11px;
}

.civ-cycle {
  color: #557b36;
  font-size: 10px;
}

.inventory__controls {
  position: absolute;
  right: 8px;
  bottom: 6px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ctrl {
  display: grid;
  place-items: center;
  width: 21px;
  height: 18px;
  border: 1px solid #7d6640;
  background: linear-gradient(#e0cda5, #bfa87c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 1px 2px rgba(0, 0, 0, 0.35);
  color: #8a3c1e;
  font-size: 10px;
  line-height: 1;
}

.ctrl:hover {
  filter: brightness(1.08);
}

.ctrl.is-active {
  background: linear-gradient(#f3e4c2, #d6c094);
  box-shadow: inset 0 0 0 1px #8a6a2e, 0 0 6px rgba(255, 210, 120, 0.6);
}

.ctrl--menu {
  margin-left: auto;
  color: #6b3a18;
}

/* ============================================================
   8. 事件羊皮纸
   ============================================================ */
.event-scroll {
  position: relative;
  width: 242px;
  height: 308px;
  padding: 0;
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.7));
  color: var(--c-parchment-ink);
  animation: panel-in 0.22s ease-out;
}

.event-scroll__title {
  position: absolute;
  top: 9px;
  right: 0;
  left: 0;
  margin: 0;
  color: #33200f;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 3px;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 246, 222, 0.55);
}

.event-scroll__art {
  position: absolute;
  top: 31px;
  left: 26px;
  width: 198px;
  height: 110px;
  object-fit: cover;
  filter: blur(0.5px);
  -webkit-mask-image: radial-gradient(ellipse 84% 90% at 50% 48%, #000 50%, rgba(0, 0, 0, 0) 99%);
  mask-image: radial-gradient(ellipse 84% 90% at 50% 48%, #000 50%, rgba(0, 0, 0, 0) 99%);
}

.event-scroll__body {
  position: absolute;
  top: 152px;
  left: 17px;
  width: 208px;
  height: 118px;
  margin: 0;
  padding: 6px 8px;
  overflow: hidden;
  background: linear-gradient(rgba(48, 26, 16, 0.66), rgba(34, 17, 10, 0.72));
  box-shadow: inset 0 0 0 1px rgba(240, 214, 168, 0.22);
  color: #f2e0bd;
  font-family: var(--font-serif);
  font-size: 9.5px;
  line-height: 1.55;
  text-align: justify;
}

.event-scroll__ok {
  position: absolute;
  top: 272px;
  left: 20px;
  width: 202px;
  height: 17px;
  border: 1px solid #8a5a2a;
  background: linear-gradient(#5c1d11, #3a0d08);
  box-shadow: inset 0 1px 0 rgba(255, 205, 150, 0.28), 0 1px 2px rgba(0, 0, 0, 0.5);
  color: #ecd6a6;
  font-family: var(--font-serif);
  font-size: 11px;
  letter-spacing: 2px;
}

.event-scroll__ok:hover {
  filter: brightness(1.15);
}

/* ============================================================
   9. 新游戏弹窗
   ============================================================ */
.dialog {
  width: 318px;
  border: 2px solid #6e5a3e;
  background: linear-gradient(#2f2b38, #262230);
  box-shadow: inset 0 0 0 1px #191620, 0 20px 44px rgba(0, 0, 0, 0.7);
  animation: panel-in 0.22s ease-out;
}

.dialog__bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  border-bottom: 1px solid #a06a3c;
  background: linear-gradient(#5b2417, #2c0d07);
  box-shadow: inset 0 1px 0 rgba(255, 200, 150, 0.18);
}

.dialog__title {
  color: #e8cf9a;
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 4px;
}

.dialog__close {
  position: absolute;
  top: 4px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid #a8593f;
  background: linear-gradient(#6d2a1c, #3d0f08);
  color: #f1d9c4;
  font-size: 10px;
  line-height: 1;
}

.dialog__close:hover {
  filter: brightness(1.2);
}

.dialog__body {
  padding: 12px 14px 14px;
}

.dialog__subtitle {
  margin: 0;
  color: #d7cdb9;
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 3px;
  text-align: center;
}

.relic-slots {
  display: flex;
  justify-content: center;
  gap: 34px;
  margin: 13px 0 15px;
}

.relic-slot {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #8a7448;
  background: linear-gradient(#211d2a, #191620);
  box-shadow: inset 0 0 9px #000, 0 0 0 1px rgba(255, 220, 160, 0.06);
  color: #b9b2a5;
  font-size: 26px;
  font-weight: 300;
}

.relic-grid {
  display: grid;
  grid-template-columns: repeat(6, 30px);
  gap: 8px;
  justify-content: center;
  height: 176px;
  padding: 10px 6px;
  overflow-y: auto;
  border: 1px solid #4b3f52;
  background: #1e1b25;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.7);
}

.relic {
  position: relative;
  width: 30px;
  height: 30px;
  border: 1px solid #7c6840;
  background: #2b2531;
  cursor: pointer;
}

.relic:hover {
  border-color: #d9b877;
}

.relic__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.relic.is-locked .relic__img {
  filter: brightness(0.55);
}

.dialog__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.check {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #cfc6b5;
  font-family: var(--font-serif);
  font-size: 12px;
  cursor: pointer;
}

.check__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check__box {
  width: 14px;
  height: 14px;
  border: 1px solid #8d95a3;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 40%, #3b3744, #17141c 72%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
}

.check__input:checked + .check__box {
  border-color: #d9b877;
  background: radial-gradient(circle at 45% 40%, #e9c477, #8a5a1c 72%);
  box-shadow: 0 0 6px rgba(233, 196, 119, 0.65);
}

.dialog__start {
  width: 98px;
  height: 30px;
  border: 1px solid #aeb4c1;
  background: linear-gradient(#4a4a58, #2c2b37);
  box-shadow: inset 0 0 0 1px rgba(16, 14, 22, 0.9), 0 2px 4px rgba(0, 0, 0, 0.5);
  color: #e2c27c;
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 2px;
}

.dialog__start:hover {
  filter: brightness(1.16);
}

/* ============================================================
   10. 科技树
   ============================================================ */
.tech-screen {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: #0d0a07;
}

.tech-canvas {
  position: absolute;
  top: 30px;
  left: 52px;
  width: 972px;
  height: 480px;
  overflow: hidden;
  border: 2px solid #5b4426;
  background: radial-gradient(120% 90% at 58% 38%, #d5c29d 0%, #c3ae87 46%, #a8916a 100%);
  box-shadow: inset 0 0 60px rgba(70, 45, 20, 0.55), inset 0 0 0 1px rgba(255, 244, 214, 0.35),
    inset 0 14px 30px rgba(60, 40, 20, 0.4);
}

.tech-canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(90, 65, 35, 0.045) 0 1px, transparent 1px 3px),
    radial-gradient(circle at 30% 20%, rgba(255, 250, 230, 0.35), transparent 55%);
  pointer-events: none;
}

.tech-canvas::after {
  content: "";
  position: absolute;
  top: 22px;
  right: 26px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(96, 68, 36, 0.2) 0deg 1.6deg, transparent 1.6deg 12deg);
  opacity: 0.75;
  pointer-events: none;
  -webkit-mask: radial-gradient(circle, transparent 0 55%, #000 57% 70%, transparent 72%);
  mask: radial-gradient(circle, transparent 0 55%, #000 57% 70%, transparent 72%);
}

.tech-title {
  position: absolute;
  top: 68px;
  right: 86px;
  z-index: 5;
  margin: 0;
  color: #5c4526;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 7px;
  text-shadow: 0 1px 0 rgba(255, 246, 220, 0.6);
}

.tech-close {
  position: absolute;
  top: 52px;
  right: 24px;
  z-index: 9;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid #8a4a3a;
  background: linear-gradient(#7d2c1e, #481109);
  box-shadow: inset 0 1px 0 rgba(255, 190, 160, 0.25), 0 2px 4px rgba(0, 0, 0, 0.45);
  color: #f0d6c0;
  font-size: 12px;
}

.tech-close:hover {
  filter: brightness(1.2);
}

/* 科技节点 */
.tech-node {
  position: absolute;
  z-index: 4;
  width: 83px;
  cursor: pointer;
}

.tech-node.is-wide {
  width: 112px;
}

.tech-node__art {
  position: relative;
  width: 83px;
  height: 65px;
  padding: 5px;
  background: linear-gradient(150deg, #8c8579, #605a50 42%, #3b362f 80%);
  border: 1px solid #2b2721;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 2px 5px rgba(0, 0, 0, 0.45);
}

.tech-node.is-wide .tech-node__art {
  width: 112px;
  height: 67px;
}

.tech-node__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tech-node.is-selected .tech-node__art {
  outline: 2px solid #c0392b;
  outline-offset: 1px;
  box-shadow: 0 0 0 1px #f0a090, 0 2px 6px rgba(0, 0, 0, 0.5);
}

.tech-node.is-selected .tech-node__img {
  filter: none;
}

.tech-node__name {
  margin-top: 4px;
  color: #4a3620;
  font-family: var(--font-serif);
  font-size: 11px;
  letter-spacing: 1px;
  text-align: center;
  white-space: nowrap;
}

.tech-node.is-wide .tech-node__name {
  display: none;
}

.tech-node__meta {
  margin-top: 2px;
  color: #3f7f2a;
  font-size: 11px;
  text-align: center;
}

/* 节点徽章 */
.tech-badge {
  position: absolute;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #5a4a34;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #3a332c, #171310 72%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.tech-badge--plus {
  border-color: #c0563f;
  background: radial-gradient(circle at 40% 35%, #8e2c22, #4a0d07 72%);
  color: #ffb199;
  font-size: 15px;
  line-height: 1;
}

/* 科技点数条 */
.tech-points {
  position: absolute;
  right: 58px;
  bottom: 122px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 38px 8px 24px;
  background: linear-gradient(90deg, rgba(40, 28, 18, 0), rgba(43, 31, 20, 0.9) 14%, rgba(30, 21, 14, 0.92) 86%, rgba(40, 28, 18, 0));
  color: #f0e1be;
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 1px;
}

.tech-points__star {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.tech-points__value {
  color: #6cc04e;
  font-size: 15px;
}

/* 时代标签 */
.eras {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 52px;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  height: 58px;
}

.era {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  border: 1px solid #8a7248;
  background: linear-gradient(#c7b28c, #a8916a);
  box-shadow: inset 0 0 0 1px rgba(255, 245, 215, 0.35), 0 -2px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.era.is-active {
  background: linear-gradient(#ddcaa2, #c2ab7f);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 232, 0.55), 0 -2px 8px rgba(0, 0, 0, 0.45);
}

.era:hover {
  filter: brightness(1.05);
}

.era__emblem {
  width: 62px;
  height: 56px;
  margin-top: -6px;
  object-fit: contain;
}

.era__label {
  color: #3b2a18;
  font-family: var(--font-serif);
  font-size: 16px;
  letter-spacing: 3px;
}

/* ============================================================
   11. 锁定图标
   ============================================================ */
.lock {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.lock__body {
  width: 15px;
  height: 12px;
  border-radius: 2px;
  background: linear-gradient(#fbfdfd, #b9c8ca 55%, #8fa0a3);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.65), inset 0 1px 0 #fff;
}

.lock__shackle {
  width: 10px;
  height: 10px;
  margin-bottom: -1px;
  border: 2px solid #e8f1f1;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
}

.mini-lock {
  position: relative;
  width: 8px;
  height: 6px;
  border-radius: 1px;
  background: #cfdada;
}

.mini-lock::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 1px;
  width: 4px;
  height: 5px;
  border: 1.5px solid #cfdada;
  border-bottom: none;
  border-radius: 3px 3px 0 0;
}

/* ============================================================
   12. 循环结算时的数值跳动（合并自主项目）
   ============================================================ */
@keyframes value-bump {
  from {
    transform: scale(1.28);
    filter: brightness(1.9);
  }
  to {
    transform: scale(1);
    filter: none;
  }
}

.res__value.is-bumped,
.civ-cycle.is-bumped {
  animation: value-bump 0.5s ease-out;
}

/* ============================================================
   13. 建造网格（合并自主项目）
   ============================================================ */
.build-layer {
  position: absolute;
  z-index: 4;
  overflow: hidden;
}

.build-grid,
.build-placed,
.build-ghost {
  position: absolute;
  inset: 0;
}

.build-cell {
  position: absolute;
  pointer-events: none;
  transition: background-color 0.12s ease, box-shadow 0.12s ease;
}

/* 已解锁：极淡的格子线，能看出可建范围 */
.build-cell.is-unlocked {
  background: rgba(226, 204, 160, 0.04);
  box-shadow: inset 0 0 0 1px rgba(206, 186, 148, 0.16);
}

/* 选中建筑后：可放置的格子变绿 */
.build-cell.is-open {
  background: rgba(95, 210, 75, 0.17);
  box-shadow: inset 0 0 0 1px rgba(126, 232, 108, 0.55);
}

/* 已被建筑占用 */
.build-cell.is-blocked {
  background: rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
}

.build-cell.is-new {
  animation: cell-open 0.5s ease-out;
}

@keyframes cell-open {
  from {
    background: rgba(244, 224, 176, 0.4);
    box-shadow: inset 0 0 0 1px rgba(255, 238, 190, 0.8);
  }
}

/* 建筑虚影 */
.build-ghost {
  z-index: 3;
  display: none;
  pointer-events: none;
  border: 2px dashed rgba(134, 236, 114, 0.95);
  background: rgba(95, 210, 75, 0.16);
  box-shadow: 0 0 14px rgba(95, 210, 75, 0.4), inset 0 0 12px rgba(95, 210, 75, 0.22);
}

.build-ghost.is-visible {
  display: block;
}

.build-ghost__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.52;
}

.build-ghost.is-invalid {
  border-color: rgba(214, 84, 60, 0.95);
  background: rgba(190, 60, 40, 0.18);
  box-shadow: 0 0 12px rgba(190, 60, 40, 0.4);
}

.build-ghost.is-invalid .build-ghost__img {
  opacity: 0.26;
  filter: grayscale(1);
}

/* 已建成的建筑 */
.build-placed {
  z-index: 2;
  pointer-events: none;
}

.build-placed__img {
  position: absolute;
  border: 1px solid rgba(160, 140, 100, 0.45);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(0, 0, 0, 0.35);
  object-fit: cover;
  animation: build-in 0.22s ease-out;
}

@keyframes build-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}

/* 建造卡片的可点击反馈（合并自主项目，视觉保持参考样式） */
.build-card {
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.build-card:hover {
  border-color: #8a7448;
}

.build-card:focus-visible {
  outline: 1px solid #d9b877;
  outline-offset: 1px;
}

/* ============================================================
   14. 资源悬浮说明（合并自主项目）
   ============================================================ */
.res-tip {
  position: absolute;
  top: 46px;
  left: 0;
  z-index: 40;
  width: 198px;
  padding: 8px 10px 9px;
  border: 1px solid #6a5636;
  background: linear-gradient(rgba(26, 21, 15, 0.97), rgba(16, 12, 9, 0.97));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.75), inset 0 0 0 1px rgba(255, 220, 150, 0.08);
  color: #c9c0ad;
  font-size: 10px;
  line-height: 1.7;
  pointer-events: none;
  animation: tip-in 0.12s ease-out;
}

.res-tip.is-right {
  right: 0;
  left: auto;
}

.res-tip__title {
  margin-bottom: 2px;
  color: #e2a24f;
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 2px;
}

.res-tip__row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.res-tip__row.is-indent {
  padding-left: 10px;
}

.res-tip__label {
  color: #a2988a;
}

.res-tip__value {
  color: #e6c873;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.res-tip__value.is-up {
  color: #7fc35a;
}

.res-tip__value.is-down {
  color: #d4644a;
}

.res-tip__sep {
  margin: 5px 0;
  border-top: 1px dashed #6a5636;
}

@keyframes tip-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

/* 全体建筑效率：人口不足时低于 100%（合并自主项目） */
.civ-efficiency {
  position: absolute;
  top: 55px;
  right: 9px;
  color: #4e7a34;
  font-size: 10px;
  letter-spacing: 0.4px;
  transition: color 0.2s ease;
}

.civ-efficiency.is-low {
  color: #a8452a;
}

/* 循环进度条：位于「第N号文明 循环X」与速度按钮之间，走满即循环 +1（合并自主项目） */
.civ-progress {
  position: absolute;
  top: 72px;
  right: 9px;
  left: 9px;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(134, 56, 28, 0.62), rgba(134, 56, 28, 0.42));
  box-shadow: inset 0 1px 1px rgba(70, 34, 12, 0.5);
}

.civ-progress__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #8a3c1e, #d4712e 72%, #eaa75c);
  box-shadow: 0 0 5px rgba(212, 113, 46, 0.6);
}
