/* ============================================================
   world.css — 六角格大世界 Demo
   风格与主游戏完全一致：纸质规则书拟物风
   palette 锁定：羊皮纸米黄 / 墨黑 / 单一强调「骰子红」
   ============================================================ */
:root {
  /* 基底：羊皮纸与墨（与 styles.css 一致） */
  --paper:        #F2EBDC;
  --paper-deep:   #E8DFC9;
  --paper-edge:   #D9CCB0;
  --ink:          #241F1A;
  --ink-soft:     #4A4038;
  --ink-faint:    #8A7B68;
  --rule:         #C9B99B;

  /* 单一强调色：骰子红 */
  --accent:       #A83232;
  --accent-deep:  #7E2424;
  --accent-soft:  #C25A4A;

  /* 功能色（克制使用） */
  --hp:           #7A3B3B;
  --gold:         #8A6A2F;

  /* 圆角尺度：全页统一 4px（纸质印刷感） */
  --r: 4px;

  --shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 2px 8px rgba(60,45,25,.14);
  --shadow-lift: 0 1px 0 rgba(255,255,255,.7) inset, 0 6px 20px rgba(60,45,25,.22);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ★ 单页合并（用户 2026-10-02）：原来的 html,body 全局样式会污染主游戏，
   收进 .wh-page（大世界屏幕的根容器）里。 */
.wh-page {
  height: 100%;
  min-height: 100vh;
  background: var(--paper-deep);
  color: var(--ink);
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; overflow: hidden;
  position: relative;
}

/* 纸张纹理与暗角（与主游戏同款）—— 收进 .wh-page::before */
.wh-page::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255,255,255,.5), transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(120,90,50,.09), transparent 60%),
    repeating-linear-gradient(0deg, rgba(140,115,75,.028) 0 1px, transparent 1px 3px);
}

/* ── 顶栏（纸页抬头） ── */
.wh-header {
  position: relative; z-index: 1;
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 20px; padding: 14px 22px 12px;
  background: linear-gradient(180deg, #F7F1E4, var(--paper));
  border-bottom: 2px double var(--rule);
  flex-wrap: wrap;
}
.wh-header h1 {
  font-size: 21px; font-weight: 700; letter-spacing: .04em;
  color: var(--ink);
}
.wh-mark { color: var(--accent); margin-right: 4px; }
.wh-sub {
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 10.5px; font-weight: 600; letter-spacing: .22em;
  color: var(--ink-faint); text-transform: uppercase;
  border: 1px solid var(--rule); padding: 1px 7px;
  vertical-align: middle; margin-left: 6px;
}

.wh-hud {
  display: flex; gap: 20px; flex-wrap: wrap;
  font-size: 13.5px; color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.wh-hud .wh-item b { color: var(--ink); font-weight: 700; }

/* ── 主区 ── */
.wh-main {
  position: relative; z-index: 1;
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: 1fr 330px;
}

/* 地图画布：羊皮纸底 */
.hex-svg {
  width: 100%; height: 100%;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(ellipse at 75% 78%, rgba(120,90,50,.10), transparent 58%),
    repeating-linear-gradient(0deg, rgba(140,115,75,.03) 0 1px, transparent 1px 3px),
    var(--paper);
}

/* 六边形 —— 纸质印刷线条 */
.hex { transition: opacity .15s; }
.hex-walkable { cursor: pointer; }
.hex-walkable:hover { opacity: 1 !important; }
.hex-walkable:hover + .hex-halo { opacity: .5; }

.hex-terr {
  font-size: 11px; fill: var(--ink-soft); font-weight: 600;
  font-family: "Noto Serif SC", "Songti SC", serif;
  pointer-events: none; user-select: none;
  paint-order: stroke; stroke: rgba(242,235,220,.75); stroke-width: 2.6;
}
.hex-loc-icon { font-size: 19px; pointer-events: none; user-select: none; }
.hex-loc-name {
  font-size: 11px; font-weight: 700; fill: var(--ink);
  font-family: "Noto Serif SC", "Songti SC", serif;
  paint-order: stroke; stroke: rgba(242,235,220,.92); stroke-width: 3;
  pointer-events: none; user-select: none;
}
.hex-here { font-size: 14px; fill: var(--accent); pointer-events: none; }

/* ── 侧栏（纸页） ── */
.wh-side {
  border-left: 2px double var(--rule);
  background: var(--paper-deep);
  padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
  overflow-y: auto;
}

/* 卡片：与主游戏 .card 同款 */
.wh-card {
  background: linear-gradient(180deg, #F7F1E4, var(--paper));
  border: 1px solid var(--rule);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 14px;
}
.wh-card-title {
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600;
  padding-bottom: 8px; margin-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}
.wh-line {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 13.5px; padding: 3px 0;
  border-bottom: 1px dotted rgba(201,185,155,.6);
}
.wh-line:last-child { border-bottom: none; }
.wh-k { color: var(--ink-faint); min-width: 38px; font-size: 12.5px; }
.wh-dim { color: var(--ink-faint); font-size: 12px; font-style: italic; }

/* ── 地牢标记（打听后发现，地图上标出） ── */
.hex-dungeon-icon { font-size: 15px; pointer-events: none; user-select: none; }
.hex-dungeon-name {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 9.5px; fill: #6B4A1F; font-weight: 700;
  pointer-events: none; user-select: none;
}

/* ★ 高亮：打听地牢后发现的那一格（用户 2026-10-01 定案）
   —— 闪 3 下引起注意，然后保留一个静态红框（方便之后还能看到位置）。 */
.hex-highlight {
  stroke: #A83232; stroke-width: 3.4;
  pointer-events: none;
  animation: hexPulse 0.5s ease-in-out 3;
}
@keyframes hexPulse {
  0%   { opacity: .25; stroke-width: 2.5; }
  50%  { opacity: 1;   stroke-width: 6.5; }
  100% { opacity: .9;  stroke-width: 3.4; }   /* ← 收在一个明显但不刺眼的状态 */
}

/* 可前往按钮 —— 同 .btn 质感 */
.wh-moves { display: flex; flex-direction: column; gap: 7px; }
.wh-move-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; font: inherit; font-size: 13px;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--r);
  cursor: pointer; text-align: left;
  transition: transform .08s, box-shadow .16s, background .16s;
}
.wh-move-btn:hover {
  box-shadow: var(--shadow-lift);
  border-color: var(--accent);
  background: linear-gradient(180deg, #FBF6EC, #F3EBDC);
}
.wh-move-btn:active { transform: translateY(1px) scale(.995); }
.wm-dir { font-weight: 700; min-width: 30px; color: var(--accent); }
.wm-terr {
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 11px; padding: 1px 7px; border-radius: 2px;
  font-weight: 600; color: var(--ink-soft);
  border: 1px solid rgba(201,185,155,.9);
}
.wm-days { font-size: 11.5px; color: var(--ink-faint); margin-left: auto; font-variant-numeric: tabular-nums; }
.wm-loc { font-size: 12px; font-weight: 700; color: var(--ink); }

/* 日志 */
.wh-log {
  list-style: none; max-height: 260px; overflow-y: auto;
}
.wh-log-line {
  font-size: 12.5px; line-height: 1.6; padding: 5px 0 5px 9px;
  border-left: 2px solid transparent; color: var(--ink-soft);
}
.wh-log-line + .wh-log-line { border-top: 1px dotted rgba(201,185,155,.7); }
.wh-bad    { color: var(--accent); border-left-color: var(--accent); }
.wh-good   { color: #5A6E3A; border-left-color: #8A9B62; }
.wh-loc    { color: var(--ink); font-weight: 700; border-left-color: var(--gold); background: rgba(138,106,47,.07); }
.wh-reveal { color: #6A5A86; border-left-color: #9B8AB8; }
.wh-start  { color: var(--ink); font-weight: 700; border-left-color: var(--ink-soft); }

/* 顶栏操作（进入城市 / 返回） */
.wh-top-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.wh-top-btn {
  font: inherit; font-size: 13px; padding: 9px 12px;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--r);
  cursor: pointer; text-align: left;
  transition: transform .08s, box-shadow .16s, background .16s;
}
.wh-top-btn:hover { box-shadow: var(--shadow-lift); }
.wh-top-btn:active { transform: translateY(1px) scale(.995); }
.wh-top-primary {
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  border-color: var(--accent-deep); color: #FBF6EC;
  font-weight: 600; letter-spacing: .04em;
}
.wh-top-primary:hover { background: linear-gradient(180deg, #CE6656, #B23A3A); }

.wh-tips p { font-size: 12.5px; line-height: 1.75; color: var(--ink-soft); }
.wh-tips b { color: var(--accent); font-weight: 700; }

/* ── 窄屏 ── */
@media (max-width: 820px) {
  .wh-main { grid-template-columns: 1fr; grid-template-rows: 58vh auto; }
  .wh-side { border-left: none; border-top: 2px double var(--rule); }
  .wh-hud { gap: 12px; font-size: 12.5px; }
}
