:root {
  --accent: #ef7d00;      /* 罗德岛琥珀橙 */
  --accent-dark: #c25e00;
  --ink: #23211e;         /* 主文字 近黑 */
  --ink2: #7c736a;        /* 次文字 暖灰 */
  --panel: #fffdf9;       /* 卡片底 暖白 */
  --panel2: #fbf3e6;      /* 浅橙块 */
  --line: #e9dcc6;        /* 暖色描边 */
  --line-strong: #d8c4a3;
  --boss: #e0414b;
  --enemy: #7c5cd6;
  --weapon: #ef7d00;
  --npc: #2f9e62;
  --cut: 14px;            /* 切角尺寸 */
}

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

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1100px 480px at 82% -8%, rgba(239,125,0,.16), transparent),
    radial-gradient(820px 420px at 6% 12%, rgba(239,125,0,.10), transparent),
    linear-gradient(180deg, #fdf2e1 0%, #fbead2 38%, #faf4ea 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  min-height: 100vh;
}

img { image-rendering: pixelated; }
a { color: var(--accent-dark); }

/* ===================== 顶栏 ===================== */
.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 26px;
  background: rgba(255,251,244,.86);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--ink);
  box-shadow: 0 2px 0 var(--accent), 0 6px 18px rgba(120,80,20,.08);
}
.logo {
  width: 48px; height: 48px; flex: 0 0 48px;
  display: grid; place-items: center;
  overflow: hidden;
  background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}
.logo img { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.titles h1 { font-size: 19px; letter-spacing: .5px; font-weight: 800; }
.titles h1 span { color: var(--accent); font-size: 14px; margin: 0 5px; font-weight: 700; }
.titles p { font-size: 11.5px; color: var(--ink2); margin-top: 2px; }

/* 搜索框 */
.search-wrap { position: relative; margin-left: auto; }
.search-wrap::before {
  content: "⌕"; position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--ink2); font-size: 17px; pointer-events: none;
}
#search {
  width: 230px; padding: 8px 30px 8px 30px;
  background: var(--panel); color: var(--ink);
  border: 1.5px solid var(--line-strong);
  font-size: 13px; outline: none;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
  transition: border-color .2s, width .25s;
}
#search:focus { border-color: var(--accent); width: 280px; }
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--ink2); cursor: pointer; font-size: 15px;
  display: none;
}
#search:not(:placeholder-shown) + .search-clear { display: block; }

.filters { display: flex; gap: 0; border: 1.5px solid var(--ink); }
.f-btn {
  background: var(--panel); color: var(--ink2);
  border: none; border-right: 1px solid var(--line);
  padding: 7px 15px; font-size: 12.5px; cursor: pointer; font-weight: 600;
  transition: all .18s;
}
.f-btn:last-child { border-right: none; }
.f-btn:hover { color: var(--ink); background: var(--panel2); }
.f-btn.active { background: var(--accent); color: #fff; }

/* ===================== 时间轴 ===================== */
.timeline { position: relative; padding: 26px 26px 90px; max-width: 1500px; margin: 0 auto; }

.stage { display: flex; gap: 24px; position: relative; scroll-margin-top: 84px; }

/* 左列：原版进度节点 */
.axis { flex: 0 0 196px; display: flex; flex-direction: column; align-items: center; position: relative; }
.axis::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; transform: translateX(-50%);
  background: repeating-linear-gradient(var(--line-strong) 0 8px, transparent 8px 14px);
}
.stage:first-child .axis::before { top: 34px; }
.stage:last-child .axis::before { bottom: auto; height: 34px; }

.node {
  position: sticky; top: 90px; z-index: 5;
  margin-top: 16px; width: 100%;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  cursor: pointer;
}
.node-num {
  font-size: 10px; font-weight: 800; letter-spacing: 2px;
  color: var(--accent-dark); margin-bottom: 4px;
}
.node-icon {
  position: relative;
  width: 66px; height: 66px;
  background: var(--panel);
  border: 2.5px solid var(--ink);
  display: grid; place-items: center; overflow: hidden;
  clip-path: polygon(0 12px, 12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  box-shadow: 0 4px 0 rgba(35,33,30,.12);
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.node:hover .node-icon { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 0 rgba(239,125,0,.25); }
.node-icon img { max-width: 80%; max-height: 80%; object-fit: contain; position: absolute; transition: opacity .6s; }
.node-icon img.fade-out { opacity: 0; }
.node-title { margin-top: 8px; font-size: 14px; font-weight: 800; line-height: 1.25; }
.node-sub { font-size: 10.5px; color: var(--ink2); margin-top: 2px; max-width: 170px; }
.node-hint {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height .4s, opacity .4s, margin .4s;
  font-size: 11px; color: var(--accent-dark); max-width: 178px; font-weight: 600;
}
.node:hover .node-hint { max-height: 90px; opacity: 1; margin-top: 5px; }

/* 右列：阶段内容 */
.stage-content { flex: 1; min-width: 0; padding: 20px 0 36px 26px; position: relative; }
.stage-content::before {           /* 节点 → 内容 横向连线 */
  content: ""; position: absolute; left: -24px; top: 52px;
  width: 50px; height: 2px; background: var(--accent);
}
.stage-content::after {            /* 内容左侧竖向轨 */
  content: ""; position: absolute; left: 0; top: 52px; bottom: 24px;
  width: 2px; background: linear-gradient(var(--accent) 0%, var(--line-strong) 60%, transparent 100%);
}

.group { margin: 0 0 16px 16px; }
.group-title {
  font-size: 12px; letter-spacing: 3px; color: var(--ink); font-weight: 800;
  margin-bottom: 11px; display: flex; align-items: center; gap: 9px; text-transform: uppercase;
}
.group-title::before { content: ""; width: 14px; height: 14px; background: var(--c, var(--accent));
  clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%); }
.group-title .cnt { color: var(--ink2); font-weight: 600; letter-spacing: 1px; font-size: 11px; }

.cards { display: flex; flex-wrap: wrap; gap: 13px; }

/* ===================== 卡片（切角工业风） ===================== */
.card {
  --c: var(--accent);
  width: 246px;
  background: var(--panel);
  border: 1.5px solid var(--line-strong);
  cursor: pointer; position: relative;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
  transition: transform .22s, box-shadow .22s, border-color .22s;
}
.card::after {                     /* 切角处的类别色三角 */
  content: ""; position: absolute; top: 0; right: 0;
  border-style: solid; border-width: var(--cut) var(--cut) 0 0;
  border-color: var(--c) transparent transparent transparent;
  opacity: .85; transition: opacity .22s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--c);
  box-shadow: 6px 8px 0 rgba(35,33,30,.10), 0 0 0 1px var(--c);
  z-index: 6;
}
.card:hover::after { opacity: 1; }
.card.boss { --c: var(--boss); } .card.enemy { --c: var(--enemy); }
.card.weapon { --c: var(--weapon); } .card.npc { --c: var(--npc); }

.card-head { display: flex; align-items: center; gap: 11px; padding: 11px 13px; }
.card-img {
  width: 54px; height: 54px; flex: 0 0 54px;
  display: grid; place-items: center; overflow: hidden;
  background: var(--panel2);
  border: 1px solid var(--line);
  clip-path: polygon(0 7px, 7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%);
  transition: transform .25s;
}
.card:hover .card-img { transform: scale(1.08); }
.card-img img { max-width: 47px; max-height: 47px; object-fit: contain; }
.card-name { font-size: 14px; font-weight: 800; line-height: 1.25; }
.card-tag {
  font-size: 10px; color: #fff; background: var(--c); display: inline-block;
  padding: 1px 7px; margin-top: 3px; letter-spacing: .5px; font-weight: 600;
  clip-path: polygon(0 0, 100% 0, 100% 65%, 90% 100%, 0 100%);
}
.card-stats { display: flex; gap: 9px; margin-top: 5px; font-size: 11px; color: var(--ink2); }
.card-stats b { color: var(--c); font-weight: 800; }

/* 详情：悬浮/展开 */
.card-detail {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height .42s ease, opacity .3s, padding .42s;
  padding: 0 13px; font-size: 12px; color: var(--ink2); line-height: 1.6;
  border-top: 0 solid var(--line);
}
.card:hover .card-detail, .card.pinned .card-detail {
  max-height: 480px; opacity: 1; padding: 11px 13px 13px;
  border-top: 1px dashed var(--line);
}
.card.pinned { border-color: var(--c); box-shadow: 4px 6px 0 rgba(35,33,30,.10); }
.detail-sec { padding-top: 9px; margin-top: 9px; border-top: 1px dashed var(--line); }
.detail-sec:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.detail-label {
  color: var(--ink); font-weight: 800; font-size: 11px; margin-bottom: 6px;
  display: inline-flex; align-items: center; gap: 6px; letter-spacing: 1px;
}
.detail-label::before { content: ""; width: 4px; height: 12px; background: var(--c); }
.tooltip-text { white-space: pre-line; color: #5a5249; }

/* 合成配方 */
.recipe { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 7px; }
.ing {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--panel2); border: 1px solid var(--line);
  padding: 3px 7px; font-size: 11px; color: var(--ink);
  transition: border-color .18s, transform .18s;
}
.ing:hover { border-color: var(--accent); transform: translateY(-1px); }
.ing img { width: 18px; height: 18px; object-fit: contain; }
.ing .cnt { color: var(--accent-dark); font-weight: 700; }
.recipe .arrow { color: var(--accent); font-weight: 800; }
.recipe .result { font-weight: 700; color: var(--ink); }
.station { font-size: 11px; color: var(--enemy); font-weight: 600; }
.no-recipe { font-size: 11px; color: var(--ink2); font-style: italic; }

/* 召唤物 */
.summon-item { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.summon-item img { width: 28px; height: 28px; object-fit: contain; }
.summon-item b { color: var(--ink); font-size: 12px; }

/* 空时期占位 */
.empty-stage {
  display: flex; align-items: center; gap: 14px; margin-left: 16px;
  padding: 16px 18px; max-width: 560px;
  background: linear-gradient(110deg, var(--panel2), var(--panel));
  border: 1.5px dashed var(--line-strong);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}
.empty-stage .es-icon {
  font-size: 26px; opacity: .55; flex: 0 0 auto;
}
.empty-stage .es-title { font-weight: 800; font-size: 13px; color: var(--ink); margin-bottom: 3px; }
.empty-stage .es-text { font-size: 12px; color: var(--ink2); line-height: 1.55; }

.hidden { display: none !important; }

/* 无搜索结果 */
.no-result {
  text-align: center; padding: 60px 20px; color: var(--ink2); font-size: 14px; display: none;
}
.no-result.show { display: block; }
.no-result b { color: var(--accent-dark); }

/* ===================== 时期跳转弹层 ===================== */
.jump-pop {
  position: fixed; z-index: 90;
  background: var(--panel); border: 2px solid var(--ink);
  box-shadow: 6px 8px 0 rgba(35,33,30,.18);
  padding: 7px; min-width: 210px; max-height: 70vh; overflow-y: auto;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  display: none;
}
.jump-pop.show { display: block; animation: pop .15s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; } }
.jump-pop .jp-head {
  font-size: 11px; letter-spacing: 2px; color: var(--ink2); font-weight: 700;
  padding: 4px 8px 7px; border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.jp-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 8px;
  cursor: pointer; font-size: 12.5px; transition: background .15s;
}
.jp-item:hover { background: var(--panel2); }
.jp-item.current { background: var(--accent); color: #fff; }
.jp-item img { width: 24px; height: 24px; object-fit: contain; }
.jp-item .jp-num { font-size: 10px; font-weight: 800; color: var(--accent-dark); width: 16px; }
.jp-item.current .jp-num { color: #fff; }

/* ===================== 回到顶部 ===================== */
#toTop {
  position: fixed; right: 26px; bottom: 26px; z-index: 80;
  width: 50px; height: 50px;
  background: var(--ink); color: #fff; border: none; cursor: pointer;
  font-size: 20px; font-weight: 800;
  clip-path: polygon(0 12px, 12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  box-shadow: 4px 5px 0 rgba(35,33,30,.22);
  opacity: 0; pointer-events: none; transform: translateY(12px);
  transition: opacity .3s, transform .3s, background .2s;
}
#toTop.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
#toTop:hover { background: var(--accent); }

.footer {
  text-align: center; padding: 24px; font-size: 12px; color: var(--ink2);
  border-top: 2px solid var(--ink);
}

@media (max-width: 880px) {
  .axis { flex: 0 0 84px; }
  .node-title { font-size: 11px; }
  .node-sub, .node-hint { display: none; }
  .card { width: 100%; }
  .titles p, .filters { display: none; }
  #search { width: 150px; }
  #search:focus { width: 170px; }
}
