﻿.guild.hidden {
    display: none;
}

.guild {
    position: absolute;
    inset: 0;
    z-index: 100;
    font-family: Arial, sans-serif;
    color: #fff;
}

.guild-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.0);
}

/* ---- home full screen ---- */
.guild-home.hidden {
    display: none;
}

.guild-home {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
}

.guild-home-topbar {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    padding: 10px 12px;
    padding-right: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 2;
    background: var(--btn_bg_s);
}

.guild-home-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.guild-avatar-wrap {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.08);
    cursor: pointer;
    flex: 0 0 auto;
}

.guild-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.guild-title-text {
    min-width: 0;
}

.guild-name {
    font-size: 18px;
    font-weight: 800;
    max-width: 72vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guild-meta-row {
    display: flex;
    gap: 10px;
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255,255,255,.88);
    flex-wrap: wrap;
}

.guild-close {
    position: absolute;
    right: 5px;
    top: 5px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.14);
    cursor: pointer;
    z-index: 3;
}

    .guild-close::before {
        content: "×";
        display: block;
        font-size: 36px;
        line-height: 36px;
        color: #ee9719;
    }

.guild-home-progress {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 84px;
    z-index: 2;
}

.guild-exp-text {
    font-size: 12px;
    color: rgba(255,255,255,.92);
    margin-bottom: 6px;
}

.guild-exp-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.16);
    overflow: hidden;
}

.guild-exp-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3ddc97, #00b7ff);
}

.guild-actions {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 122px;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.guild-action-btn {
    border: 1px solid var(--btn_border_q);
    border-radius: 6px;
    padding: 6px 10px;
    background: var(--bg_bg_s);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

.guild-mini-btn {
    border: 1px solid var(--btn_border_q);
    border-radius: 10px;
    padding: 4px 15px;
    background: rgba(255,255,255,.12);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

.guild-danger-btn {
    border: 1px solid var(--btn_border_q);
    border-radius: 6px;
    padding: 6px 14px;
    background: var(--bg_bg_s);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

/* 底图拖动容器：撑满屏幕，图片固定 1000x1000 */
.guild-home-mapwrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    touch-action: none;
}

.guild-home-map {
    position: absolute;
    left: 50%;
    top: 55%;
    width: 1000px;
    height: 1000px;
    transform: translate(-50%, -50%);
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto;
}

/* ---- modal ---- */
.guild-modal.hidden {
    display: none;
}

.guild-modal {
    position: absolute;
    inset: 0;
    z-index: 110;
    background: rgba(0,0,0,.55); /* 自己的遮罩 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.guild-modal-box {
    width: min(560px, calc(100% - 10px));
    background: var(--btn_bg_s);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

.guild-modal-header {
    position: relative;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,.40);
    padding-right: 56px;
    background: rgba(0,0,0,0.32);
}

.guild-modal-title {
    font-size: 16px;
    font-weight: 800;
}

.guild-modal-body {
    padding: 12px 14px;
    box-sizing: border-box;
    height: 600px;
    overflow: auto;
}

/* 列表滚动：放在容器自己 */
.guild-list {
    height: 100%;
    overflow-y: auto;
    touch-action: pan-y;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.guild-members-bottom {
    padding: 6px;
}

.guild-search-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.guild-input {
    width: 100px;
    height: 30px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgb(255 255 255 / 40%);
    color: #fff;
    outline: none;
    text-align: center;
    margin-right: 6px;
}

.guild-pager {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.guild-page-text {
    color: rgba(255,255,255,.85);
}

.guild-member-item {
    display: flex;
    gap: 10px;
    padding: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    width: 100%;
    border-radius: 6px;
}

.guild-member-left {
    width: 52px;
    height: 52px;
    position: relative;
}

.guild-member-avatar {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    object-fit: cover;
    background: rgba(255,255,255,.08);
}

.guild-member-iframe {
    position: absolute;
    inset: 0;
    width: 52px;
    height: 52px;
    pointer-events: none;
}

.guild-member-mid {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.guild-member-name {
    display: flex;
    gap: 8px;
    align-items: center;
    font-weight: 800;
    font-size: 12px;
}

    .guild-member-name .vip {
        font-weight: 800;
        color: #ffd36a;
        font-size: 12px;
    }

.guild-member-sub {
    font-size: 12px;
    color: rgba(255,255,255,.80);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.guild-member-right {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
    justify-content: center;
}

    .guild-member-right button {
        border: 0;
        border-radius: 10px;
        padding: 2px 12px;
        background: rgba(255,255,255,.12);
        color: #fff;
        cursor: pointer;
        font-size: 14px;
    }

    .guild-member-right .danger {
        background: rgb(127 100 100 / 85%);
    }

.guild-entry-body,
.guild-create-body {
    display: flex;
    /*flex-direction: column;*/
    gap: 20px;
    justify-content: center;
    align-items: center;
}
#guild-entry-join, #guild-entry-create {
    width: 45%;
    height: 45%;
    font-size:18px;
}
.guild-build-list {
    height: 100%;
    overflow-y: auto;
    touch-action: pan-y;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.guild-build-card {
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 12px;
    padding: 10px;
    background: rgba(255,255,255,.06);
}

.guild-build-title {
    font-weight: 900;
    margin-bottom: 6px;
}

.guild-build-meta {
    font-size: 12px;
    color: rgba(255,255,255,.80);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.guild-build-card button {
    margin-top: 10px;
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(0, 183, 255, .85);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

.guild-detail-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.guild-detail-title-btns {
    display: flex;
    gap: 8px;
}

.guild-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 4px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

    .guild-detail-row span {
        color: rgb(178 164 164 / 80%);
    }

    .guild-detail-row b {
        color: var(--btn_color_q);
    }

.guild-section-title {
    margin-top: 12px;
    font-weight: 900;
    padding: 10px 0 8px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.guild-apply-setting.hidden {
    display: none;
}

.guild-radio-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0 10px;
}

.guild-radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255,255,255,.90);
}

.guild-form-row {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.guild-form-label {
    width: 70px;
    font-size: 14px;
    color: rgb(178 164 164 / 80%);
}

.guild-form-tip {
    margin-top: 10px;
    font-size: 12px;
    color: rgba(255,255,255,.6);
}

/* ---- rename modal ---- */
.guild-rename-body {
    height: auto;
    overflow: hidden;
}

.guild-rename-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

/* ---- detail textarea ---- */
.guild-detail-row-textarea {
    align-items: flex-start;
}

.guild-detail-textarea {
    flex: 1;
    min-height: 72px;
    resize: none;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
    color: #fff;
    padding: 8px 10px;
    outline: none;
    box-sizing: border-box;
    font-size: 12px;
    line-height: 18px;
    /* 防止移动端滚动穿透/体验更稳 */
    touch-action: pan-y;
}

    .guild-detail-textarea[readonly] {
        opacity: .85;
        background: rgba(255,255,255,.04);
    }

/* ---- build icons ---- */
.guild-build-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.guild-build-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.guild-build-row-label {
    font-size: 12px;
    color: rgba(255,255,255,.80);
    min-width: 44px;
}

.guild-build-icons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.guild-build-left {
    font-size: 12px;
    color: rgba(255,255,255,.88);
}

/* 图标容器：带 quality_1 背景（quality_1 的底图你项目已有） */
.guild-iconnum {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.guild-iconnum-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    pointer-events: none;
}

.guild-iconnum-num {
    position: absolute;
    right: 2px;
    bottom: 1px;
    font-size: 11px;
    line-height: 12px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,.75);
    pointer-events: none;
}
/* =========================
   经验条：文字覆盖进度条居中（重叠显示）
   ========================= */
.guild-home-progress {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 84px;
    z-index: 2;
    /* 让绝对定位的 .guild-exp-text 以这里为参照 */
}

.guild-exp-text {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    /* 与进度条重叠 */
    height: 14px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    color: rgba(255,255,255,.95);
    text-shadow: 0 1px 2px rgba(0,0,0,.75);
    pointer-events: none;
    z-index: 2;
}

.guild-exp-bar {
    height: 14px;
    border-radius: 999px;
    background: rgba(0,0,0,.20);
    overflow: hidden;
}

/* =========================
   公会建设：2列 + 图标居中 + 消耗在奖励下 + 无文字标签
   ========================= */

/* build list 容器：交给 loop.js 布局，这里不要用 flex 影响内部 */
.guild-build-list {
    height: 100%;
    overflow-y: auto;
    touch-action: pan-y;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    display: block;
}

    /* ✅ 放开 loop.js 默认的 aspect-ratio/overflow:hidden，否则卡片内容会被裁剪 */
    .guild-build-list .loop-item-inner {
        aspect-ratio: auto;
        height: auto;
        overflow: visible;
        align-items: stretch;
        justify-content: stretch;
    }

        .guild-build-list .loop-item-inner > .guild-build-card {
            width: 100%;
        }

.guild-build-card {
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 12px;
    padding: 10px;
    background: rgba(255,255,255,.06);
}

.guild-build-title {
    font-weight: 900;
    margin-bottom: 6px;
    text-align: center;
}

.guild-build-iconsblock {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.guild-build-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* 次数居中 */
.guild-build-left {
    margin-top: 8px;
    text-align: center;
    font-size: 12px;
    color: rgba(255,255,255,.80);
}

.guild-build-card button {
    margin-top: 10px;
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(0, 183, 255, .85);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

    .guild-build-card button:disabled {
        opacity: .45;
        cursor: not-allowed;
        background: rgba(255,255,255,.18);
    }

/* 建设图标块（若项目其它地方已定义，可保留此处覆盖为更“居中”） */
.guild-iconnum {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.guild-iconnum-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.guild-iconnum-num {
    position: absolute;
    right: 4px;
    bottom: 2px;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,.85);
}
.guild-iconnum-cost {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* =========================
   防止公会动态/公会详情弹框拖拽“带动底部滑动”露黑边（滚动隔离）
   规则：外层不滚动（overflow:hidden），滚动只发生在内部容器，并阻止 overscroll 传递
   ========================= */

/* 1) Modal 容器本身阻止滚动链条传递到页面/外层 */
.guild-modal {
    overscroll-behavior: contain;
}

/* 2) 公会动态：body 不滚动；列表自己滚动；分页固定在底部 */
#guild-logs-modal .guild-modal-body {
    overflow: hidden; /* ✅ 外层不滚动，避免拖拽时带动底部 */
    display: flex;
    flex-direction: column;
    overscroll-behavior: contain; /* ✅ 阻止滚动穿透/回弹传递 */
    touch-action: pan-y;
}

/* 兼容你在 HTML 上写的 style="height:92%"，这里强制交给 flex 来撑开 */
#guild-logs-modal #guild-logs-list {
    flex: 1 1 auto;
    height: auto !important;
    overflow-y: auto;
    overflow-x: hidden;
    touch-action: pan-y;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* 分页固定不参与滚动 */
#guild-logs-modal .guild-pager {
    flex: 0 0 auto;
}

/* 3) 公会详情：仍由 body 滚动，但要阻止 overscroll 回弹把外层“拽动”起来 */
#guild-detail-modal .guild-modal-body {
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}