/* ============================================================================
 * 三國天命 v7.0 — v7.css（覆寫 v4 / v5 / v6）
 * 簡易攻擊集成盤｜技能移至下方快捷欄 (兩頁)｜地圖轉場 / 州讀取畫面｜變身特效框｜連線狀態
 * ========================================================================== */
:root { --qs: 46px; --ac7: 1; }

/* ---------------- 金色線條圖示 ---------------- */
body .fs-item img { filter: drop-shadow(0 1px 2px #000) !important; }
body .mm-ic img { filter: drop-shadow(0 2px 3px #000) !important; }
body .mm-item.lock .mm-ic img { filter: grayscale(1) brightness(.55) !important; }
body .mm-item:hover .mm-ic img { filter: brightness(1.25) drop-shadow(0 0 6px rgba(217, 180, 106, .6)) !important; }
img.ac-gold { width: 24px; height: 24px; filter: drop-shadow(0 1px 2px #000); }

/* ---------------- 下方快捷欄：Ⅰ 技能 + 藥水｜Ⅱ 卷軸 / 變身 / 藥水 ---------------- */
body #quick-bar { display: flex !important; align-items: center; gap: 3px !important; padding: 4px 4px 4px 4px !important; left: 50% !important; right: auto !important; transform: translateX(-50%) !important;
  bottom: calc(var(--safe-b) + 10px) !important; border-radius: 4px !important; background: rgba(6, 5, 4, 0.62) !important; z-index: 25; }
body #quick-bar .qb-slot, body #quick-bar .hk-slot { position: relative !important; inset: auto !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important;
  width: var(--qs) !important; height: var(--qs) !important; min-width: 0 !important; margin: 0 !important; padding: 0 !important; border-radius: 4px !important; flex-shrink: 0;
  border: 1px solid rgba(120, 100, 70, 0.45) !important; background: radial-gradient(circle at 50% 40%, #1c1814, #070605) !important; box-shadow: inset 0 0 6px #000 !important; cursor: pointer; display: block !important; overflow: visible; }
body #quick-bar .hk-slot img.dark-ico, body #quick-bar .qb-slot img { width: 100% !important; height: 100% !important; border-radius: 3px !important; display: block; }
body #quick-bar .hk-slot .key { position: absolute !important; left: 2px !important; top: 0 !important; bottom: auto !important; right: auto !important; transform: none !important; font-size: 8.5px !important; padding: 0 2px !important;
  background: rgba(0, 0, 0, 0.6) !important; color: #f7d98a !important; border: none !important; border-radius: 2px !important; font-family: Arial, sans-serif !important; line-height: 11px; }
body #quick-bar .hk-slot .s-name { display: none !important; }
body #quick-bar .hk-slot .hk-auto-tag { position: absolute !important; top: auto !important; bottom: 1px !important; right: 1px !important; left: auto !important; width: 13px; height: 13px; padding: 0 !important; border-radius: 2px !important;
  font-size: 8.5px !important; line-height: 13px; text-align: center; background: #d9b46a !important; color: #1a1206 !important; border: none !important; font-weight: 900; }
body #quick-bar .hk-slot.auto-on { border-color: #b8944e !important; box-shadow: inset 0 0 6px #000, 0 0 6px rgba(217, 180, 106, .45) !important; }
body #quick-bar .hk-slot .hk-cd-mask { position: absolute !important; inset: 0 !important; border-radius: 3px !important; background: rgba(0, 0, 0, 0.68) !important; color: #fff; font-size: 12px; font-weight: 900; display: none; align-items: center; justify-content: center; font-family: Arial, sans-serif; }
#quick-bar .qs-empty { cursor: default !important; opacity: .45; }
#quick-bar.qb-page-1 .qs-p2, #quick-bar.qb-page-2 .qs-sk, #quick-bar.qb-page-2 .qs-p1 { display: none !important; }
.qb-page { width: 30px; height: var(--qs); flex-shrink: 0; margin-left: 2px; border-radius: 4px; border: 1px solid #6d5d43; cursor: pointer; padding: 0;
  background: linear-gradient(180deg, #3a3226, #15120e); color: var(--c-gold2, #f3dca0); font-family: Georgia, serif; font-size: 15px; }
.qb-page b { font-weight: 900; }
body #quick-bar .qb-slot[hidden] { display: none !important; }

/* ---------------- 右下：簡易攻擊集成盤 ---------------- */
body #action-cluster.ac-simple { width: 200px !important; height: 200px !important; bottom: calc(var(--safe-b) + 12px) !important; right: max(8px, env(safe-area-inset-right, 0px)) !important;
  transform: scale(var(--ac7)) !important; transform-origin: right bottom !important; }
body #action-cluster.ac-simple #btn-attack { left: 100px !important; top: 100px !important; width: 92px !important; height: 92px !important;
  background: radial-gradient(circle at 50% 40%, #2c251c, #0a0807 72%) !important; border: 2px solid #9a7a44 !important; }
body #action-cluster.ac-simple #btn-attack img { width: 62% !important; height: 62% !important; margin: 19% !important; filter: drop-shadow(0 2px 3px #000) !important; }
body #action-cluster.ac-simple .ac-u, body #action-cluster.ac-simple #nav-hunt { position: absolute !important; width: 46px !important; height: 46px !important; }
body #action-cluster.ac-simple .ac-pos-1 { left: 30px !important; top: 123px !important; }
body #action-cluster.ac-simple .ac-pos-2 { left: 42px !important; top: 72px !important; }
body #action-cluster.ac-simple .ac-pos-3 { left: 78px !important; top: 36px !important; }
body #action-cluster.ac-simple .ac-pos-4 { left: 127px !important; top: 24px !important; }
body #action-cluster.ac-simple .ac-u img.ac-gold { width: 26px; height: 26px; }
body #action-cluster.ac-simple #nav-hunt img { opacity: .35 !important; }

/* ---------------- 版面：聊天 / 搖桿 (避開快捷欄) ---------------- */
body #chat-panel { bottom: calc(var(--safe-b) + 66px) !important; }
body #joystick-zone { bottom: calc(var(--safe-b) + 160px) !important; }

/* ---------------- 轉場 / 讀取畫面 / 連線 ---------------- */
#v7-fade { position: fixed; inset: 0; z-index: 85; background: #000; opacity: 0; pointer-events: none; transition: opacity .16s; }
#v7-fade.on { opacity: .55; }
#v7-loading { position: fixed; inset: 0; z-index: 86; background: #000 center / cover no-repeat; opacity: 0; pointer-events: none; transition: opacity .45s; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 12vh; }
#v7-loading::before { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 0, 0, .85), rgba(0, 0, 0, 0) 55%); }
#v7-loading.on { opacity: 1; }
.v7l-name { position: relative; font-size: clamp(30px, 6vw, 54px); letter-spacing: 14px; padding-left: 14px; color: #f3e3bb; text-shadow: 0 2px 10px #000; font-family: var(--font); }
.v7l-sub { position: relative; max-width: 80vw; margin-top: 8px; font-size: 14px; color: #d8cbb0; text-align: center; text-shadow: 0 1px 4px #000; font-family: var(--font); }
#v7-net { position: fixed; z-index: 30; left: max(6px, env(safe-area-inset-left, 0px)); bottom: calc(var(--safe-b) + 138px); display: flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 10px;
  border: 1px solid rgba(120, 100, 70, .4); background: rgba(0, 0, 0, .55); color: #d8cbb0; font-size: 10.5px; font-family: var(--font); cursor: pointer; }
#v7-net i { width: 7px; height: 7px; border-radius: 50%; background: #7c6f5a; }
#v7-net.on i { background: #4ade80; box-shadow: 0 0 6px #4ade80; } #v7-net.wait i { background: #fbbf24; }
body.title-open #v7-net { display: none; }

/* ---------------- 變身特效框 ---------------- */
#v7-morph-card { position: fixed; inset: 0; z-index: 88; pointer-events: none; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
#v7-morph-card.show, #v7-morph-card.out { display: flex; }
#v7-morph-card .mc-flash { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 50%, color-mix(in srgb, var(--tc) 35%, transparent), transparent 60%); animation: mcFlash 1.2s ease-out forwards; }
#v7-morph-card .mc-card { position: relative; width: 168px; height: 236px; animation: mcIn .5s cubic-bezier(.2, 1.4, .4, 1) both; }
#v7-morph-card .mc-arch { position: absolute; inset: 0; background: center / 100% 100% no-repeat; filter: drop-shadow(0 0 10px var(--tc)) drop-shadow(0 0 22px color-mix(in srgb, var(--tc) 60%, transparent)); }
#v7-morph-card .mc-img { position: absolute; left: 12%; right: 12%; bottom: 10%; width: 76%; height: 76%; object-fit: contain; filter: drop-shadow(0 4px 8px #000); }
#v7-morph-card .mc-tier { position: absolute; top: 9%; left: 50%; transform: translateX(-50%); padding: 0 10px; font-size: 12px; font-weight: 900; color: #1a1206; background: var(--tc); border-radius: 8px; font-family: var(--font); }
#v7-morph-card .mc-name { font-size: 20px; letter-spacing: 3px; color: var(--tc); text-shadow: 0 0 10px #000, 0 2px 4px #000; font-family: var(--font); animation: mcIn .6s .1s both; }
#v7-morph-card .mc-sub { font-size: 12.5px; color: #efe3c4; text-shadow: 0 1px 3px #000; font-family: var(--font); animation: mcIn .6s .15s both; }
#v7-morph-card.tier-hi .mc-card::after { content: ''; position: absolute; inset: -30px; border-radius: 50%; background: conic-gradient(from 0deg, transparent, color-mix(in srgb, var(--tc) 55%, transparent), transparent 30%, transparent 50%, color-mix(in srgb, var(--tc) 55%, transparent), transparent 80%); mix-blend-mode: screen; animation: mcSpin 1.6s linear infinite; z-index: -1; }
#v7-morph-card.out { animation: mcOut .5s forwards; }
@keyframes mcIn { from { opacity: 0; transform: scale(.6) translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes mcOut { to { opacity: 0; transform: scale(1.08); } }
@keyframes mcFlash { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }
@keyframes mcSpin { to { transform: rotate(360deg); } }

/* ---------------- 面板：道具紀錄 / 成就 / 公會 / 聯盟 / 連線 / 知識標籤 ---------------- */
.p6-row .p6-cell { width: 48px; height: 48px; flex-shrink: 0; cursor: default; }
.r-main small { font-family: Arial, var(--font); }
.ach-pt { width: 46px; height: 46px; flex-shrink: 0; border-radius: 50%; border: 2px solid #6d5d43; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(circle, #2b251c, #0a0908); }
.ach-pt b { font-size: 16px; color: #f0a948; line-height: 1; } .ach-pt small { font-size: 9px; color: var(--c-dim); }
.ach-rw { display: flex; gap: 4px; flex-shrink: 0; }
.ach-rw .p6-cell { width: 40px; height: 40px; }
.gc-create { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.gc-create input, .net-row input { padding: 8px 10px; font-family: var(--font); font-size: 13px; color: var(--c-txt); background: rgba(0, 0, 0, .55); border: 1px solid var(--c-line); outline: none; user-select: text; -webkit-user-select: text; min-width: 0; }
.gc-create input:focus, .net-row input:focus { border-color: var(--c-gold); }
.gd-hero { display: flex; gap: 14px; align-items: center; padding: 12px; margin-bottom: 10px; border: 1px solid var(--c-line2); background: radial-gradient(ellipse at 10% 50%, rgba(217, 180, 106, .12), transparent 60%), rgba(0, 0, 0, .35); }
.gd-hero img { width: 84px; height: 84px; flex-shrink: 0; }
.gd-hero > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.gd-hero b { font-size: 20px; letter-spacing: 3px; color: var(--c-gold2); } .gd-hero span, .gd-hero small { font-size: 12.5px; color: #c9bc9f; }
.gd-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.gd-p { font-size: 12.5px; color: #d7cbb3; line-height: 1.7; margin: 0; min-height: 44px; } .gd-p b { color: #f0a948; }
.gm-head { margin-top: 4px; }
.ally-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ally-grid .p6-card.on { border-color: #a8864a; box-shadow: inset 0 0 18px rgba(217, 180, 106, .15); }
.ally-mem { display: flex; flex-wrap: wrap; gap: 6px; min-height: 60px; }
.ally-mem span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; font-size: 12px; background: rgba(0, 0, 0, .4); border: 1px solid var(--c-line2); }
.ally-mem span.me { border-color: #a8864a; color: #fde7a6; }
.ally-mem img { width: 18px; height: 18px; } .ally-mem small { color: var(--c-dim); }
.net-wrap { max-width: 640px; width: 100%; margin: 0 auto; }
.net-st { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px; margin-bottom: 10px; background: rgba(0, 0, 0, .35); border: 1px solid var(--c-line2); }
.net-st i { width: 10px; height: 10px; border-radius: 50%; background: #7c6f5a; } .net-st.on i { background: #4ade80; box-shadow: 0 0 8px #4ade80; } .net-st.wait i { background: #fbbf24; }
.net-st b { font-size: 15px; color: var(--c-gold2); } .net-st span { font-size: 12px; color: var(--c-dim); }
.net-l { font-size: 12px; color: var(--c-dim); }
.net-row { display: flex; gap: 6px; margin: 4px 0 10px; } .net-row input { flex: 1; }
.net-help { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: #d7cbb3; line-height: 1.6; }
.net-help code { font-family: Consolas, monospace; font-size: 12px; color: #fde7a6; background: rgba(0, 0, 0, .45); padding: 1px 5px; word-break: break-all; }
.aggro-tag { display: inline-block; width: max-content; font-style: normal; font-size: 11px; padding: 0 6px; margin: 2px 0; border-radius: 2px; }
.aggro-tag.agg { color: #fecaca; background: #5a1610; border: 1px solid #a0402f; } .aggro-tag.pas { color: #d9f7c8; background: #1f3a16; border: 1px solid #4f6e3c; }

/* ============================================================ 響應式 */
@media (max-aspect-ratio: 1/1) {
  :root { --qs: 37px; --ac7: .84; }
  body #quick-bar { left: 50% !important; padding: 3px !important; gap: 2px !important; bottom: calc(var(--safe-b) + 8px) !important; }
  .qb-page { width: 26px; }
  body #action-cluster.ac-simple { bottom: calc(var(--safe-b) + 58px) !important; }
  body #chat-panel { bottom: calc(var(--safe-b) + 58px) !important; width: calc(100vw - 190px) !important; min-width: 150px; }
  body #chat-panel.open { width: auto !important; }
  body #joystick-zone { bottom: calc(var(--safe-b) + 150px) !important; }
  #v7-net { bottom: calc(var(--safe-b) + 132px); }
  .gd-grid, .ally-grid { grid-template-columns: 1fr; }
  .ach-rw { display: none; }
}
@media (max-width: 370px) and (max-aspect-ratio: 1/1) { :root { --qs: 35px; } }
@media (max-height: 520px) and (min-aspect-ratio: 1/1) {
  :root { --qs: 36px; --ac7: .7; }
  body #quick-bar { left: auto !important; right: calc(200px * var(--ac7) + 16px) !important; transform: none !important; bottom: calc(var(--safe-b) + 6px) !important; }
  body #chat-panel { left: 118px !important; width: 22vw !important; bottom: calc(var(--safe-b) + 6px) !important; }
  body #chat-panel.open { width: 40vw !important; }
  body #joystick-zone { bottom: calc(var(--safe-b) + 12px) !important; }
  #v7-net { bottom: auto; top: 96px; left: auto; right: 150px; }
}
