/* ==========================================================================
   faction-page.css —— 势力独立页（类名前缀 fp-）
   还在书里：四周是牛皮纸封皮（bal-kraft-cover），中间一张可以滚动的长纸（fp-paper 平铺），像把卷宗右页放大到满屏。
   ========================================================================== */
.fp-wrap { position: absolute; inset: 0; z-index: 8; }
.fp { position: absolute; inset: 0; display: flex; flex-direction: column; background: #6b4f33 url(../img/bal-kraft-cover.webp) center / cover; font-family: var(--serif); color: #2a2016; }
.fp::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, rgba(0, 0, 0, .1), rgba(0, 0, 0, .55)); pointer-events: none; }

/* 顶栏 */
.fp-bar { position: relative; z-index: 2; display: flex; align-items: center; gap: 18px; padding: 10px clamp(16px, 3vw, 40px); background: rgba(20, 14, 9, .82); border-bottom: 1px solid rgba(232, 208, 155, .25); }
.fp-close { padding: 7px 16px; font-family: inherit; font-size: 13px; letter-spacing: .3em; color: #f2e8d2; background: none; border: 1px solid rgba(232, 208, 155, .45); cursor: pointer; }
.fp-close:hover { border-color: #e8d09b; color: #fff4d8; }
.fp-bar nav { display: flex; gap: 2px; flex-wrap: wrap; }
.fp-bar nav button { padding: 6px 12px; font-family: inherit; font-size: 13.5px; letter-spacing: .2em; color: rgba(236, 230, 214, .75); background: none; border: 0; cursor: pointer; }
.fp-bar nav button:hover { color: #f2dfae; }
.fp-sampleflag { margin-left: auto; padding: 4px 10px; font-size: 12px; letter-spacing: .08em; color: #f3d6cc; border: 1px dashed rgba(220, 120, 100, .6); }

/* 纸 */
.fp-scroll { position: relative; z-index: 1; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 34px 16px 60px; scrollbar-color: rgba(232, 208, 155, .4) transparent; }
.fp-sheet { position: relative; max-width: 1080px; margin: 0 auto; padding: clamp(28px, 4vw, 56px) clamp(22px, 5vw, 70px) 50px; background: #efe5cd url(../img/fp-paper.jpg) repeat; background-size: 520px; box-shadow: 0 30px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(80, 55, 30, .25); font-size: 17px; line-height: 1.9; }
.fp-sheet::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--fp-c, #6a4e30); opacity: .7; }
.fp-sheet.is-crown { --fp-c: #5b2e78; } .fp-sheet.is-army { --fp-c: #8e2a1c; } .fp-sheet.is-house { --fp-c: #2b4a86; } .fp-sheet.is-nation { --fp-c: #8f8a7c; } .fp-sheet.is-shadow { --fp-c: #3a2222; }

/* 开头：场景大图 + 身份 */
.fp-scene { position: relative; margin: 0 0 28px; padding: 10px 10px 34px; background: #f8f2e2; box-shadow: 0 8px 20px rgba(40, 25, 10, .35); transform: rotate(-.6deg); }
.fp-scene img { display: block; width: 100%; aspect-ratio: 3 / 1.45; object-fit: cover; }
.fp-scene figcaption { position: absolute; left: 14px; bottom: 8px; font-size: 13px; letter-spacing: .15em; color: #7a6650; }
.fp-scene.is-map div { aspect-ratio: 3 / 1.2; background: url(../img/bal-sand.jpg) no-repeat; background-size: 260%; background-position: var(--x) var(--y); filter: saturate(.8); }
.fp-id { display: grid; grid-template-columns: 180px 1fr; gap: 32px; align-items: start; }
.fp-crest { position: relative; display: grid; place-items: center; width: 180px; height: 180px; }
.fp-crest img { max-width: 100%; max-height: 100%; filter: drop-shadow(0 8px 10px rgba(40, 25, 10, .45)); }
.fp-crest img.is-flag { height: 140px; opacity: .35; }
.fp-crest span { position: absolute; bottom: 4px; font-size: 12px; font-style: italic; letter-spacing: .3em; color: #9a8a70; }
.fp-stamp { display: inline-block; margin: 0; padding: 2px 10px; font-size: 12.5px; letter-spacing: .25em; color: #8a2a18; border: 2px solid rgba(138, 42, 24, .7); transform: rotate(-1.5deg); }
.fp-id h1 { margin: 12px 0 0; font-weight: 700; font-size: clamp(34px, 4vw, 52px); line-height: 1.15; letter-spacing: .06em; color: #1d150d; }
.fp-en { margin: 4px 0 0; font-family: var(--display-latin); font-size: 20px; color: #6a4e30; }
.fp-lead { margin: 16px 0 0; font-size: 20px; line-height: 1.75; color: #2a2016; }
.fp-id blockquote { margin: 18px 0 0; padding: 10px 18px; border-left: 3px solid var(--fp-c, #6a4e30); font-size: 18px; font-style: italic; color: #3a2a1a; background: rgba(255, 255, 255, .3); }
.fp-id cite { display: block; margin-top: 4px; font-size: 13px; font-style: normal; letter-spacing: .15em; color: #7a6650; }
.fp-intro { margin-top: 30px; columns: 2; column-gap: 40px; }
.fp-intro p { margin: 0 0 14px; break-inside: avoid; text-indent: 2em; }
.fp-intro p:first-child { text-indent: 0; }
.fp-intro p:first-child::first-letter { float: left; margin: 6px 10px 0 0; font-size: 3.2em; line-height: .9; color: var(--fp-c, #6a4e30); font-weight: 700; }

/* 小节 */
.fp-sec { margin-top: 56px; padding-top: 6px; }
.fp-sec h2 { display: flex; align-items: baseline; gap: 14px; margin: 0 0 22px; padding-bottom: 10px; border-bottom: 2px solid rgba(80, 55, 30, .35); font-weight: 600; font-size: 26px; letter-spacing: .2em; color: #1d150d; }
.fp-sec h2 span { font-size: 15px; letter-spacing: .1em; color: #fff; background: var(--fp-c, #6a4e30); padding: 2px 9px; }
.fp-sec h3 { margin: 18px 0 8px; font-weight: 600; font-size: 15px; letter-spacing: .35em; color: #8a2a18; }
.fp-sec ul { list-style: none; margin: 0; padding: 0; }
.fp-sec li { position: relative; padding: 4px 0 4px 20px; }
.fp-sec li::before { content: ''; position: absolute; left: 2px; top: 16px; width: 7px; height: 7px; background: #8a6d4c; transform: rotate(45deg); }
.fp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 44px; }
.fp-moves { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.fp-moves div { position: relative; padding: 16px 18px 16px 52px; background: rgba(142, 42, 28, .07); border: 1px solid rgba(142, 42, 28, .3); border-left: 4px solid #a8341f; }
.fp-moves em { position: absolute; left: 14px; top: 14px; font-style: normal; font-weight: 700; font-size: 22px; color: #a8341f; }
.fp-moves p { margin: 0; line-height: 1.75; }
.fp-todo { margin: 10px 0 0; padding: 6px 12px; font-size: 14px; font-style: italic; color: #8f826c; border: 1px dashed rgba(120, 100, 75, .5); }
.fp-sealed { color: #9a8a70; font-style: italic; }
.fp-tag { display: inline-block; margin-left: 6px; padding: 0 6px; font-size: 11px; font-style: italic; font-weight: 400; letter-spacing: .1em; color: #b0503a; border: 1px dashed rgba(176, 80, 58, .7); vertical-align: middle; }

/* 组织架构 */
.fp-tree { display: flex; flex-direction: column; align-items: center; }
.fp-root .fp-n { width: 300px; }
.fp-kids { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 22px 18px; margin-top: 40px; padding-top: 22px; width: 100%; }
.fp-kids::before { content: ''; position: absolute; left: 50%; top: -40px; height: 40px; border-left: 2px solid rgba(80, 55, 30, .45); }
.fp-kids::after { content: ''; position: absolute; left: 8%; right: 8%; top: 0; border-top: 2px solid rgba(80, 55, 30, .45); }
.fp-branch { position: relative; display: flex; flex-direction: column; align-items: center; width: 230px; }
.fp-branch::before { content: ''; position: absolute; left: 50%; top: -22px; height: 22px; border-left: 2px solid rgba(80, 55, 30, .45); }
.fp-leaves { position: relative; display: flex; flex-direction: column; gap: 10px; margin-top: 14px; padding-left: 16px; border-left: 2px dotted rgba(80, 55, 30, .45); width: 100%; box-sizing: border-box; }
.fp-n { box-sizing: border-box; width: 100%; padding: 12px 14px; text-align: left; }
.fp-n b { display: block; font-weight: 700; font-size: 17px; line-height: 1.35; color: #1d150d; }
.fp-n em { display: block; font-style: normal; font-size: 13px; letter-spacing: .1em; color: #8a2a18; }
.fp-n p { margin: 6px 0 0; font-size: 14px; line-height: 1.7; color: #4a3828; }
.fp-n.is-person { background: #f8f2e2; box-shadow: 0 6px 14px rgba(40, 25, 10, .3); }
.fp-n.is-person:nth-child(odd) { transform: rotate(-.6deg); }
.fp-ph { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; margin-bottom: 10px; background: linear-gradient(160deg, #3a332b, #1d1915); overflow: hidden; }
.fp-ph img { height: 66%; opacity: .25; }
.fp-ph span { position: absolute; bottom: 6px; font-size: 11px; letter-spacing: .35em; color: rgba(236, 226, 205, .55); }
.fp-leaves .fp-n.is-person .fp-ph:not(.has-img) { display: none; }
.fp-ph.has-img { aspect-ratio: 3 / 4; background: #000; }
.fp-ph.has-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; opacity: 1; }
.fp-n.is-sealed { padding: 14px; text-align: center; background: repeating-linear-gradient(135deg, rgba(80, 55, 30, .12) 0 6px, transparent 6px 12px); border: 1px dashed rgba(80, 55, 30, .45); }
.fp-n.is-sealed b { font-size: 15px; letter-spacing: .4em; color: #6a5440; }
.fp-n.is-sealed em { color: #8a7660; letter-spacing: .15em; }
.fp-n.is-org { background: rgba(120, 90, 55, .14); border: 1px solid rgba(80, 55, 30, .35); }
.fp-n.is-org b button { padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: #2b4a86; cursor: pointer; border-bottom: 1px solid rgba(43, 74, 134, .5); }
.fp-n.is-sample { outline: 1px dashed rgba(176, 80, 58, .55); outline-offset: 3px; }

/* 关系 */
.fp-ties li { display: grid; grid-template-columns: 6.2em auto 1fr; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(80, 55, 30, .2); }
.fp-ties li::before { display: none; }
.fp-ties li.fp-sealed { display: block; }
.fp-ties b { text-align: center; padding: 2px 0; font-size: 14px; letter-spacing: .08em; border: 1.5px solid; }
.fp-ties .is-ally b { color: #8a6a1e; } .fp-ties .is-foe b { color: #a3321e; } .fp-ties .is-hold b { color: #3d5d7e; } .fp-ties .is-bet b { color: #6a5a3a; } .fp-ties .is-other b { color: #5a4a6a; }
.fp-ties li > span { font-weight: 700; font-size: 16px; color: #4a3828; padding: 3px 12px; border: 1px dashed rgba(80, 55, 30, .35); }
.fp-ties button { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px 3px 4px; font: inherit; font-weight: 700; font-size: 16px; color: #1d150d; background: rgba(255, 255, 255, .4); border: 1px solid rgba(80, 55, 30, .35); cursor: pointer; }
.fp-ties button img { height: 34px; }
.fp-ties button:hover { border-color: #8a2a18; color: #8a2a18; }
.fp-ties p { margin: 0; font-size: 15.5px; color: #4a3828; }

/* 地盘 */
.fp-turf { position: relative; aspect-ratio: 3 / 1.1; overflow: hidden; box-shadow: inset 0 0 40px rgba(0, 0, 0, .6); border: 6px solid #f8f2e2; outline: 1px solid rgba(80, 55, 30, .3); }
.fp-turf-map { position: absolute; inset: 0; background: url(../img/bal-sand.jpg) no-repeat; background-size: 300%; background-position: var(--x) var(--y); }
.fp-turf-flag { position: absolute; left: 50%; top: 50%; height: 90px; transform: translate(-50%, -100%); filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .7)); }
.fp-turf-cap { margin: 10px 0 0; font-size: 15px; color: #4a3828; }
.fp-turf-cap a { color: #2b4a86; }

/* 卷中 */
.fp-story { list-style: none; margin: 0; padding: 0 0 0 24px; border-left: 2px solid rgba(80, 55, 30, .4); }
.fp-story li { position: relative; padding: 8px 0 8px 16px; }
.fp-story li::before { content: ''; position: absolute; left: -31px; top: 18px; width: 10px; height: 10px; border-radius: 50%; background: var(--fp-c, #6a4e30); border: 2px solid #efe5cd; }
.fp-story em { font-style: normal; font-size: 13px; letter-spacing: .15em; color: #fff; background: #6a4e30; padding: 1px 8px; }
.fp-story p { margin: 6px 0 0; }

.fp-end { margin-top: 60px; padding-top: 20px; border-top: 1px solid rgba(80, 55, 30, .3); text-align: center; }
.fp-end p { margin: 0 0 12px; font-size: 13px; letter-spacing: .5em; color: #8a6d4c; }
.fp-end button { padding: 10px 26px; font-family: inherit; font-size: 14px; letter-spacing: .3em; color: #f4ecdc; background: #2a2016; border: 0; cursor: pointer; }

/* 卷宗左页上的入口 */
.bb-fd-more { align-self: flex-start; margin-top: 1em; padding: .4em 1em; font-family: inherit; font-size: .82em; letter-spacing: .25em; color: #f4ecdc; background: #2a2016; border: 0; cursor: pointer; }
.bb-fd-more:hover { background: #8a2a18; }

@media (max-width: 860px) { .fp-id { grid-template-columns: 1fr; } .fp-intro { columns: 1; } .fp-cols { grid-template-columns: 1fr; } .fp-sampleflag { display: none; } }
/* 手机：按钮不折行、目录横向滑动、图注放到图下、纹章缩小 */
@media (max-width: 640px) {
  .fp-bar { gap: 10px; padding: 8px 12px; }
  .fp-close { flex: none; white-space: nowrap; padding: 6px 10px; letter-spacing: .12em; }
  .fp-bar nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .fp-bar nav button { flex: none; padding: 6px 9px; letter-spacing: .1em; }
  .fp-scene { padding-bottom: 10px; }
  .fp-scene figcaption { position: static; margin-top: 8px; line-height: 1.6; }
  .fp-crest { width: 110px; height: 110px; }
}
