:root {
    --kio-panel: #2c3e50;
    --kio-panel-dark: #243447;
    --kio-panel-darker: #1a252f;
    --kio-primary: #34ace0;
    --kio-primary-hover: #2980b9;
    --kio-secondary: #4a6784;
    --kio-secondary-hover: #3a5169;
    --kio-danger: #c0392b;
    --kio-danger-hover: #962d22;
    --kio-text: #ffffff;
    --kio-text-dim: #bdc3c7;
    --kio-border: #4a6784;
    --kio-radius: 0;
    --kio-transition: 0.1s filter ease, 0.1s background-color ease;
    --kio-safe-top: env(safe-area-inset-top, 0px);
}

/* ---------- 通用对话框 ---------- */
#dialog_frame {
    background: var(--kio-panel) !important;
    border-radius: var(--kio-radius) !important;
    box-shadow: none !important;
    color: var(--kio-text) !important;
    overflow: hidden !important;
}

#dialog_titlebar {
    align-items: center !important;
    background: var(--kio-panel-dark) !important;
    border-bottom: 1px solid var(--kio-border) !important;
    box-sizing: border-box !important;
    display: flex !important;
    min-height: 3rem !important;
    padding: 0 0.75rem 0 1rem !important;
}

#dialog_title {
    color: var(--kio-text) !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    padding: 0 !important;
}

button#x {
    align-items: center !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: var(--kio-radius) !important;
    color: var(--kio-text-dim) !important;
    cursor: pointer !important;
    display: inline-flex !important;
    height: 2rem !important;
    justify-content: center !important;
    margin-left: auto !important;
    transition: background-color var(--kio-transition), color var(--kio-transition) !important;
    width: 2rem !important;
}

button#x:hover {
    background: rgba(192, 57, 43, 0.2) !important;
    color: var(--kio-text) !important;
}

#dialog_content {
    background: transparent !important;
    box-sizing: border-box !important;
    color: var(--kio-text) !important;
    font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif !important;
    line-height: 1.5 !important;
}

#dialog_content h3 {
    color: var(--kio-text) !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    margin: 1rem 0 0.75rem !important;
    padding: 0 !important;
}

#dialog_content h3:first-child { margin-top: 0 !important; }

#dialog_content p {
    color: var(--kio-text-dim) !important;
    font-size: 0.9rem !important;
    margin: 0.5rem 0 !important;
}

#dialog_content a {
    color: var(--kio-primary) !important;
    text-decoration: none !important;
}

#dialog_content a:hover {
    text-decoration: underline !important;
}

#dialog_footer,
#action_panel {
    background: var(--kio-panel-dark) !important;
    border-top: 1px solid var(--kio-border) !important;
}

#dialog_footer a {
    background: transparent !important;
    color: var(--kio-text-dim) !important;
    filter: none !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    transition: color var(--kio-transition), border-color var(--kio-transition) !important;
}

#dialog_footer a:hover {
    background: transparent !important;
    color: var(--kio-text) !important;
    filter: none !important;
}

/* ---------- 按钮 ---------- */
#dialog_frame button {
    appearance: none;
    border: none;
    border-radius: var(--kio-radius);
    color: var(--kio-text);
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.55rem 1rem;
    transition: filter var(--kio-transition), background-color var(--kio-transition);
}

#dialog_frame button:hover:not(:disabled) {
    filter: brightness(0.85);
}

#dialog_frame button:active:not(:disabled) {
    filter: brightness(0.7);
}

#dialog_frame button:disabled {
    cursor: not-allowed;
    filter: grayscale(0.4) brightness(0.7);
}

/* 账号登录/注册：等待验证码时不要整页鼠标转圈 */
#dialog_frame:has(.account_dialog) {
    cursor: default !important;
}
#dialog_frame:has(.account_dialog) button:disabled {
    cursor: not-allowed !important;
}

.account_submit,
.user_center_submit,
.user_center_login_btn {
    background: var(--kio-primary) !important;
}

.account_mode button.selected {
    background: var(--kio-primary) !important;
}

.account_mode button:not(.selected) {
    background: var(--kio-secondary) !important;
}

.account_logout {
    background: var(--kio-danger) !important;
    font-size: 0.78rem !important;
    padding: 0.4rem 0.6rem !important;
}

#guest_entry button {
    background: var(--kio-secondary) !important;
}

#guest_entry .account_entry {
    background: var(--kio-primary) !important;
}

/* ---------- 输入框 ---------- */
.account_form input,
.user_center_form input {
    appearance: none;
    background: var(--kio-panel-darker) !important;
    border: 1px solid transparent !important;
    border-radius: var(--kio-radius);
    box-sizing: border-box;
    color: var(--kio-text) !important;
    font: inherit;
    font-size: 0.9rem;
    min-height: 2.6rem;
    outline: 0;
    padding: 0.6rem 0.8rem;
    transition: border-color var(--kio-transition);
    width: 100%;
}

.account_form input::placeholder,
.user_center_form input::placeholder {
    color: var(--kio-text-dim);
}

.account_form input:hover,
.user_center_form input:hover,
.account_form input:focus,
.user_center_form input:focus {
    border-color: var(--kio-border) !important;
}

/* ---------- 邮箱验证码行（注册 / 找回密码 / 修改密码共用） ---------- */
.account_code_row,
.user_center_code_row,
.ucp_code_row {
    display: flex;
    gap: 0.5rem;
}

.account_code_row input,
.user_center_code_row input,
.ucp_code_row input {
    flex: 1;
    min-width: 0;
}

.account_code_btn,
.user_center_code_btn,
.ucp_code_btn {
    background: var(--kio-secondary) !important;
    border-radius: var(--kio-radius);
    flex-shrink: 0;
    font-size: 0.8rem !important;
    padding: 0.4rem 0.7rem !important;
    white-space: nowrap;
}

.account_forgot_link {
    background: transparent !important;
    border: none !important;
    color: var(--kio-text-dim) !important;
    cursor: pointer;
    font-size: 0.8rem !important;
    padding: 0.2rem 0 !important;
    text-decoration: underline;
}

.account_forgot_link:hover {
    color: var(--kio-text) !important;
}

/* ---------- 框选升级 ---------- */
.box_select_rect {
    position: fixed;
    background: rgba(64, 160, 255, 0.15);
    border: 1px dashed rgba(64, 160, 255, 0.9);
    pointer-events: none;
    z-index: 30;
}

.box_select_entry_game.armed {
    background: #152a22;
    border-left-color: #4ade80;
    color: #b7f7d0;
    outline: none;
    filter: none;
}

/* 框选升级：与指挥官档案/组织中心同一套左下角条形按钮 */
.box_select_entry_game {
    align-items: center;
    appearance: none;
    background: #1e2a38;
    border: 0;
    border-left: 3px solid #4ade80;
    border-radius: 0;
    color: #b7dcc8;
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    gap: 0.5rem;
    letter-spacing: 0.03em;
    min-width: 7.5rem;
    padding: 0.5rem 0.9rem;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.box_select_entry_game:hover {
    background: #1f3328;
    color: #e8fff0;
}

.box_select_entry_game:active {
    background: #16241c;
}

.select_glyph {
    box-sizing: border-box;
    display: block;
    height: 1.1rem;
    position: relative;
    width: 1.1rem;
}

.select_glyph::before,
.select_glyph::after {
    border: 1.5px solid currentColor;
    box-sizing: border-box;
    content: "";
    height: 0.42rem;
    position: absolute;
    width: 0.42rem;
}

.select_glyph::before {
    border-bottom: 0;
    border-right: 0;
    left: 0;
    top: 0;
}

.select_glyph::after {
    border-left: 0;
    border-top: 0;
    bottom: 0;
    right: 0;
}

.box_upgrade_panel {
    position: fixed;
    left: 50%;
    bottom: 4rem;
    transform: translateX(-50%);
    max-width: min(40rem, 92vw);
    max-height: 45vh;
    overflow-y: auto;
    background: var(--kio-panel-darker, rgba(20, 26, 34, 0.95));
    border: 1px solid var(--kio-border, #33415588);
    border-radius: var(--kio-radius, 6px);
    color: var(--kio-text, #ececec);
    padding: 0.6rem 0.8rem;
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.box_upgrade_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: bold;
}

.box_upgrade_close {
    background: transparent !important;
    border: none;
    color: var(--kio-text-dim, #9aa5b1) !important;
    cursor: pointer;
    font-size: 0.9rem !important;
    padding: 0 0.3rem !important;
}

.box_upgrade_groups {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.box_upgrade_row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.box_upgrade_src {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 8rem;
    font-size: 0.85rem;
}

.box_upgrade_none {
    color: var(--kio-text-dim, #9aa5b1);
    font-size: 0.8rem;
}

.box_upgrade_targets {
    display: inline-flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.box_upgrade_target {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem !important;
    padding: 0.3rem 0.55rem !important;
    background: var(--kio-primary, #2563eb) !important;
    border-radius: var(--kio-radius, 6px);
}

.box_upgrade_target:disabled {
    cursor: not-allowed;
    filter: grayscale(0.5) brightness(0.65);
}

/* ---------- 首页入口 ---------- */
#guest_entry {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    left: 50%;
    position: absolute;
    top: 47%;
    transform: translate(-50%, -50%);
    user-select: none;
    width: min(24rem, calc(100vw - 2rem));
    z-index: 2;
}

.guest_brand {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.guest_brand img {
    filter: drop-shadow(0 0.5rem 1rem rgba(0, 0, 0, 0.45));
    height: auto;
    max-width: 20rem;
    pointer-events: none;
    width: 86%;
}

.guest_brand span {
    color: var(--kio-text-dim);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
}

.guest_actions {
    display: grid;
    gap: 0.6rem;
    width: min(20rem, 100%);
}

#guest_entry button {
    align-items: center;
    border-radius: var(--kio-radius);
    box-sizing: border-box;
    color: var(--kio-text);
    cursor: pointer;
    display: grid;
    font-family: inherit;
    gap: 0.75rem;
    grid-template-columns: 2rem 1fr auto;
    min-height: 3.6rem;
    padding: 0.65rem 0.9rem;
    text-align: left;
    transition: filter var(--kio-transition), transform var(--kio-transition);
    width: 100%;
}

#guest_entry button:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

#guest_entry button:active {
    filter: brightness(0.75);
    transform: translateY(0);
}

.entry_marker {
    align-items: center;
    border: 2px solid currentColor;
    border-radius: 50%;
    box-sizing: border-box;
    color: var(--kio-text);
    display: flex;
    height: 2rem;
    justify-content: center;
    position: relative;
    width: 2rem;
}

.entry_marker::before {
    background: currentColor;
    border-radius: 50%;
    content: "";
    height: 0.5rem;
    width: 0.5rem;
}

.entry_copy {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.entry_copy strong {
    font-size: 0.95rem;
    font-weight: 700;
}

.entry_copy small {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.72rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entry_arrow {
    font-family: Arial, sans-serif;
    font-size: 1.4rem;
    line-height: 1;
    opacity: 0.9;
}

/* ---------- 左下角浮动入口（用户中心 + 组织中心）---------- */
.corner_entries {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: flex-start;
    z-index: 10;
}

.corner_entries.in_game {
    bottom: calc(2.75rem + 0.75rem);
}

.user_center_entry_game,
.org_center_entry_game {
    align-items: center;
    appearance: none;
    background: #1e2a38;
    border: 0;
    border-left: 3px solid #34ace0;
    border-radius: 0;
    color: #c8d8ea;
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    gap: 0.5rem;
    letter-spacing: 0.03em;
    min-width: 7.5rem;
    padding: 0.5rem 0.9rem;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.user_center_entry_game:hover,
.org_center_entry_game:hover {
    background: #263445;
    color: #e8f3ff;
}

.user_center_entry_game:active,
.org_center_entry_game:active {
    background: #182230;
}

/* 组织中心：琥珀金左边框 */
.org_center_entry_game {
    border-left-color: #f0b429;
    color: #e0cc9a;
}

.org_center_entry_game:hover {
    background: #2a2215;
    color: #ffe9bf;
}

.org_glyph {
    align-items: center;
    border: 1.5px solid currentColor;
    border-radius: 0;
    box-sizing: border-box;
    display: flex;
    height: 1.1rem;
    justify-content: center;
    position: relative;
    width: 1.1rem;
}

.org_glyph::before {
    content: "";
    position: absolute;
    width: 0.5rem;
    height: 0.5rem;
    border: 1.5px solid currentColor;
    border-bottom: none;
    border-right: none;
    transform: rotate(45deg);
    top: 0.28rem;
}

.profile_glyph {
    align-items: center;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    box-sizing: border-box;
    display: flex;
    height: 1.1rem;
    justify-content: center;
    position: relative;
    width: 1.1rem;
}

.profile_glyph::before {
    background: currentColor;
    border-radius: 50%;
    content: "";
    height: 0.28rem;
    position: absolute;
    top: 0.18rem;
    width: 0.28rem;
}

.profile_glyph::after {
    background: currentColor;
    border-radius: 0;
    bottom: 0.16rem;
    content: "";
    height: 0.28rem;
    position: absolute;
    width: 0.55rem;
}

body:has(#dialog_frame) #guest_entry,
body:has(#dialog_frame) .corner_entries {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

/* ---------- 账号弹窗（默认暗色现代化风格） ---------- */
#dialog_frame:has(.account_dialog) {
    background: #1a1a2e !important;
    border-radius: 0 !important;
    max-width: calc(100vw - 2rem);
    width: 28rem !important;
}

#dialog_frame:has(.account_dialog) > #dialog_titlebar {
    background: transparent !important;
    border-bottom: none !important;
    min-height: 2.5rem !important;
    padding: 0.6rem 0.75rem 0 0.75rem !important;
}

#dialog_frame:has(.account_dialog) #dialog_title {
    display: none !important;
}

#dialog_frame:has(.account_dialog) #dialog_close {
    color: rgba(255, 255, 255, 0.55) !important;
    font-size: 1.35rem !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    opacity: 1 !important;
    padding: 0.25rem !important;
    transform: none !important;
    transition: color 0.15s ease !important;
}

#dialog_frame:has(.account_dialog) #dialog_close:hover {
    color: #ff6b6b !important;
    filter: none !important;
}

#dialog_frame:has(.account_dialog) > #dialog_content {
    max-height: calc(100vh - 5rem);
    padding: 0 2rem 2rem !important;
}

.account_dialog {
    color: #f5f5f7;
    width: 100%;
}

/* 顶部登录/注册标签 */
.account_mode {
    display: flex;
    margin-bottom: 1.75rem;
    position: relative;
}

#dialog_frame .account_mode button {
    background: transparent !important;
    border: 0 !important;
    border-bottom: 2px solid #2f2f42 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: #8b8b9e !important;
    cursor: pointer;
    flex: 1;
    font-family: inherit;
    font-size: 1rem !important;
    font-weight: 600 !important;
    min-height: 2.6rem;
    overflow: hidden;
    padding: 0.5rem !important;
    position: relative;
    transform: none !important;
    transition: color 0.3s ease !important;
}

#dialog_frame .account_mode button::after {
    background: #60a5fa;
    bottom: 0;
    content: "";
    height: 2px;
    left: 50%;
    position: absolute;
    transform: translateX(-50%) scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
    width: 100%;
}

#dialog_frame .account_mode button:hover:not(:disabled) {
    color: #c7c7d0 !important;
    filter: none !important;
}

#dialog_frame .account_mode button.selected {
    border-bottom-color: #60a5fa !important;
    color: #ffffff !important;
}

#dialog_frame .account_mode button.selected::after {
    transform: translateX(-50%) scaleX(1);
}

/* 当前已登录提示 */
.account_logged_in {
    display: grid;
    gap: 1rem;
    justify-items: center;
    padding: 1rem 0 0.5rem;
    text-align: center;
}

.account_logged_in_title {
    color: #8b8b9e;
    font-size: 0.85rem;
    font-weight: 500;
}

.account_logged_in_username {
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 700;
    word-break: break-all;
}

.account_current {
    align-items: center;
    background: #252536;
    border: 1px solid #34344a;
    border-radius: 0;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0.65rem 0.9rem;
}

.account_current span {
    color: #c7c7d0;
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#dialog_frame .account_logout {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #8b8b9e !important;
    cursor: pointer;
    font-size: 0.78rem !important;
    font-weight: 500 !important;
    min-height: 0 !important;
    padding: 0.2rem 0 !important;
    transform: none !important;
    transition: color 0.15s ease !important;
}

#dialog_frame .account_logout:hover:not(:disabled) {
    color: #ff6b6b !important;
    filter: none !important;
    text-decoration: underline !important;
}

/* 表单 */
.account_form {
    display: grid;
    gap: 1.1rem;
}

.account_form label {
    display: grid !important;
    gap: 0.45rem;
}

.account_form label > span {
    color: #b0b0c0;
    font-size: 0.82rem;
    font-weight: 500;
}

.account_form input {
    appearance: none;
    background: #252536 !important;
    border: 1px solid #3a3a4d !important;
    border-radius: 0;
    box-sizing: border-box;
    color: #f5f5f7 !important;
    font: inherit;
    font-size: 0.95rem !important;
    min-height: 2.9rem;
    outline: 0;
    padding: 0.7rem 0.95rem !important;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    width: 100%;
}

.account_form input::placeholder {
    color: #6b6b7a;
}

.account_form input:hover {
    background: #2e2e42 !important;
    border-color: #4b4b5e !important;
}

.account_form input:focus {
    background: #2e2e42 !important;
    border-color: #60a5fa !important;
}

#dialog_frame .account_submit {
    background: #60a5fa !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: #ffffff !important;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.12em;
    margin-top: 0.5rem;
    min-height: 3rem;
    padding: 0.8rem !important;
    transform: none !important;
    transition: background-color 0.15s ease !important;
    width: 100%;
}

#dialog_frame .account_submit:hover:not(:disabled) {
    background: #3b82f6 !important;
    box-shadow: none !important;
    filter: none !important;
}

#dialog_frame .account_submit:active:not(:disabled) {
    background: #2563eb !important;
    box-shadow: none !important;
    transform: none !important;
}

#dialog_frame .account_submit:disabled {
    background: #3b5998 !important;
    box-shadow: none !important;
    /* 登录/注册等待验证码时不要整页鼠标转圈（wait），用 not-allowed 即可 */
    cursor: not-allowed;
}

.captcha_row {
    align-items: stretch;
    display: grid;
    gap: 0.5rem;
    grid-template-columns: 1fr 6.5rem 3.5rem;
}

.captcha_row input {
    min-width: 0;
}

.captcha_svg {
    align-items: center;
    background: #ffffff;
    border: 1px solid #3a3a4d;
    border-radius: 0;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    min-height: 2.9rem;
    overflow: hidden;
    padding: 0.25rem;
}

.captcha_svg svg {
    height: 100%;
    max-width: 100%;
    width: auto;
}

#dialog_frame .captcha_refresh {
    background: #3a3a4d !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: #f5f5f7 !important;
    cursor: pointer;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    min-height: 2.9rem;
    padding: 0 !important;
    transform: none !important;
    transition: background-color 0.15s ease !important;
    width: 100%;
}

#dialog_frame .captcha_refresh:hover:not(:disabled) {
    background: #4b4b5e !important;
    filter: none !important;
}

#dialog_frame .captcha_refresh:active:not(:disabled) {
    background: #5c5c70 !important;
    transform: none !important;
}

.account_message {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 0;
    color: #ff6b6b !important;
    font-size: 0.82rem !important;
    line-height: 1.45 !important;
    margin: 1rem 0 0 !important;
    padding: 0.65rem 0.9rem;
    text-align: center;
}

.account_message.success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
    color: #4ade80 !important;
}

/* ---------- 个人中心 ---------- */
#dialog_frame:has(.user_center) {
    max-height: calc(100vh - 2rem);
    max-width: calc(100vw - 2rem);
    width: 34rem !important;
}

#dialog_frame:has(.user_center) > #dialog_content {
    max-height: calc(100vh - 5.5rem);
    padding: 1.25rem !important;
}

.user_center {
    color: var(--kio-text);
    width: 100%;
}

.user_center_intro {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 2.5rem 1fr;
    margin-bottom: 1rem;
}

.command_mark {
    align-items: center;
    background: var(--kio-panel-darker);
    border: 1px solid var(--kio-border);
    border-radius: 50%;
    display: flex;
    height: 2.5rem;
    justify-content: center;
    position: relative;
    width: 2.5rem;
}

.command_mark::before {
    background: var(--kio-primary);
    border-radius: 50%;
    box-shadow: none;
    content: "";
    height: 0.75rem;
    width: 0.75rem;
}

.user_center_kicker {
    color: var(--kio-primary);
    display: block;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
}

#dialog_frame .user_center_intro h3 {
    color: var(--kio-text) !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
}

#dialog_frame .user_center_intro p {
    color: var(--kio-text-dim) !important;
    font-size: 0.82rem !important;
    margin: 0.2rem 0 0 !important;
}

.user_center_current {
    background: var(--kio-panel-dark);
    border: 1px solid var(--kio-border);
    border-radius: var(--kio-radius);
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
}

.profile_status {
    align-items: center;
    color: var(--kio-text-dim);
    display: flex;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.6rem;
    font-weight: 700;
    gap: 0.35rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.profile_status i {
    background: var(--kio-primary);
    border-radius: 50%;
    box-shadow: none;
    display: inline-block;
    height: 0.35rem;
    width: 0.35rem;
}

.user_center_form {
    display: grid;
    gap: 0.75rem;
}

.user_center_form label {
    display: grid !important;
    gap: 0.35rem;
}

.user_center_form label > span {
    color: var(--kio-text-dim);
    font-size: 0.75rem;
    font-weight: 600;
}

.user_center_message {
    background: rgba(192, 57, 43, 0.15);
    border: 1px solid rgba(192, 57, 43, 0.4);
    border-radius: var(--kio-radius);
    color: #ffcccc !important;
    font-size: 0.8rem !important;
    margin: 0.75rem 0 0 !important;
    padding: 0.6rem 0.8rem;
}

.user_center_message.success {
    background: rgba(39, 174, 96, 0.12);
    border-color: rgba(39, 174, 96, 0.35);
    color: #b8f5d0 !important;
}

.user_center_identity {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: 1fr 1fr;
}

.user_center_field {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.user_center_field span {
    color: var(--kio-text-dim);
    font-size: 0.62rem;
}

.user_center_field strong {
    color: var(--kio-text);
    font-size: 0.9rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user_center_section {
    border-top: 1px solid var(--kio-border);
    padding: 1rem 0 0;
}

.user_center_section + .user_center_section {
    margin-top: 1rem;
}

.user_center_section_title {
    align-items: start;
    display: grid;
    gap: 0.6rem;
    grid-template-columns: 1.4rem 1fr;
    margin-bottom: 0.75rem;
}

.user_center_section_title > span {
    align-items: center;
    background: var(--kio-panel-darker);
    border: 1px solid var(--kio-border);
    border-radius: 50%;
    color: var(--kio-primary);
    display: flex;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.55rem;
    font-weight: 700;
    height: 1.35rem;
    justify-content: center;
    padding-top: 0.05rem;
    width: 1.35rem;
}

#dialog_frame .user_center_section_title h4 {
    color: var(--kio-text) !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
}

#dialog_frame .user_center_section_title p {
    color: var(--kio-text-dim) !important;
    font-size: 0.74rem !important;
    margin: 0.1rem 0 0 !important;
}

.user_center_login_hint {
    align-items: center;
    display: flex;
    flex-direction: column;
    padding: 1rem 0 0.25rem;
    text-align: center;
}

.login_hint_mark {
    align-items: center;
    background: var(--kio-panel-darker);
    border: 1px solid var(--kio-border);
    border-radius: 50%;
    display: flex;
    height: 3.2rem;
    justify-content: center;
    margin-bottom: 0.7rem;
    position: relative;
    width: 3.2rem;
}

.login_hint_mark::before {
    background: var(--kio-primary);
    border-radius: 50%;
    box-shadow: none;
    content: "";
    height: 0.65rem;
    width: 0.65rem;
}

.user_center_login_hint strong {
    color: var(--kio-text);
    font-size: 1rem;
    font-weight: 700;
}

#dialog_frame .user_center_login_hint p {
    color: var(--kio-text-dim) !important;
    font-size: 0.78rem !important;
    margin: 0.35rem 0 0.9rem !important;
}

#dialog_frame .user_center_login_btn {
    width: 100%;
}

/* ---------- 设置页 ---------- */
#dialog_frame:has(> #dialog_content > select):has(> #dialog_content > h3) {
    bottom: auto !important;
    display: flex !important;
    flex-direction: column;
    height: auto !important;
    left: 50% !important;
    max-height: calc(100vh - 2rem);
    max-width: calc(100vw - 2rem);
    right: auto !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 46rem !important;
}

#dialog_frame:has(> #dialog_content > select):has(> #dialog_content > h3) > #dialog_titlebar {
    flex: 0 0 auto;
    position: static !important;
}

#dialog_frame:has(> #dialog_content > select):has(> #dialog_content > h3) > #dialog_content {
    bottom: auto !important;
    display: grid !important;
    flex: 1 1 auto;
    gap: 0.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: auto !important;
    left: auto !important;
    max-height: calc(100vh - 6rem);
    padding: 1rem !important;
    position: static !important;
    right: auto !important;
    top: auto !important;
}

#dialog_frame:has(> #dialog_content > select):has(> #dialog_content > h3) #dialog_content > p:first-child {
    background: var(--kio-panel-dark);
    border: 1px solid var(--kio-border);
    border-left: 2px solid var(--kio-primary);
    border-radius: var(--kio-radius);
    color: var(--kio-text-dim) !important;
    font-size: 0.78rem !important;
    grid-column: 1 / -1;
    line-height: 1.5 !important;
    margin: 0 0 0.25rem !important;
    padding: 0.7rem 0.9rem;
}

#dialog_frame:has(> #dialog_content > select):has(> #dialog_content > h3) #dialog_content > h3 {
    align-items: center;
    border-bottom: 1px solid var(--kio-border) !important;
    color: var(--kio-text) !important;
    display: flex;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    gap: 0.5rem;
    grid-column: 1 / -1;
    margin: 0.6rem 0 0.2rem !important;
    padding: 0 0 0.4rem !important;
}

#dialog_frame:has(> #dialog_content > select):has(> #dialog_content > h3) #dialog_content > select,
#dialog_frame:has(> #dialog_content > select):has(> #dialog_content > h3) #dialog_content > label {
    align-items: center;
    background: var(--kio-panel-dark) !important;
    border: 1px solid var(--kio-border) !important;
    border-radius: var(--kio-radius) !important;
    box-sizing: border-box;
    color: var(--kio-text) !important;
    display: flex !important;
    font-family: inherit;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    justify-content: space-between;
    margin: 0 !important;
    min-height: 2.9rem;
    padding: 0.55rem 0.8rem !important;
    transition: background-color var(--kio-transition), border-color var(--kio-transition);
    width: 100% !important;
}

#dialog_frame:has(> #dialog_content > select):has(> #dialog_content > h3) #dialog_content > select {
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2334ace0' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
    background-position: right 0.8rem center !important;
    background-repeat: no-repeat !important;
    cursor: pointer;
    padding-right: 2.2rem !important;
}

#dialog_frame:has(> #dialog_content > select):has(> #dialog_content > h3) #dialog_content > select:hover,
#dialog_frame:has(> #dialog_content > select):has(> #dialog_content > h3) #dialog_content > label:hover {
    background: var(--kio-panel-darker) !important;
}

#dialog_frame:has(> #dialog_content > select):has(> #dialog_content > h3) #dialog_content select option {
    background: var(--kio-panel-dark) !important;
    color: var(--kio-text) !important;
}

#dialog_frame:has(> #dialog_content > select):has(> #dialog_content > h3) #dialog_content input[type="checkbox"] {
    appearance: none !important;
    background: var(--kio-panel-darker) !important;
    border: 1px solid var(--kio-border) !important;
    border-radius: 0 !important;
    cursor: pointer;
    flex: 0 0 auto;
    height: 1.1rem !important;
    margin: 0 0 0 auto !important;
    order: 2;
    padding: 0 !important;
    position: relative;
    width: 1.1rem !important;
}

#dialog_frame:has(> #dialog_content > select):has(> #dialog_content > h3) #dialog_content input[type="checkbox"]:checked {
    background: var(--kio-primary) !important;
    border-color: var(--kio-primary) !important;
}

#dialog_frame:has(> #dialog_content > select):has(> #dialog_content > h3) #dialog_content input[type="checkbox"]:checked::after {
    border: solid #fff;
    border-width: 0 2px 2px 0;
    content: "" !important;
    height: 0.45rem !important;
    left: 0.32rem !important;
    position: absolute;
    top: 0.18rem !important;
    transform: rotate(45deg) !important;
    width: 0.2rem !important;
}

#dialog_frame:has(> #dialog_content > select):has(> #dialog_content > h3) #dialog_content input[type="range"] {
    appearance: none !important;
    background: var(--kio-panel-darker) !important;
    border-radius: 0 !important;
    cursor: pointer;
    height: 0.25rem !important;
    margin: 0 0.6rem 0 0 !important;
    outline: 0;
    width: min(10rem, 50%) !important;
}

#dialog_frame:has(> #dialog_content > select):has(> #dialog_content > h3) #dialog_content input[type="range"]::-webkit-slider-thumb {
    appearance: none !important;
    background: var(--kio-primary) !important;
    border-radius: 50% !important;
    height: 0.9rem !important;
    transition: transform var(--kio-transition);
    width: 0.9rem !important;
}

#dialog_frame:has(> #dialog_content > select):has(> #dialog_content > h3) #dialog_content input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
    html, body {
        height: 100%;
        overflow: hidden;
        overscroll-behavior: none;
        -webkit-text-size-adjust: 100%;
        /* 不要给 body 加 safe-area padding：theme 色 #273644 会在刘海区画出一条「深蓝框」。
           画布铺满；需要避开刘海的 HUD 单独加 inset。 */
        padding: 0;
        box-sizing: border-box;
    }

    #guest_entry {
        gap: 1rem;
        top: 46%;
        width: min(20rem, calc(100vw - 1.5rem));
    }

    .guest_brand img {
        width: 84%;
    }

    #guest_entry button {
        gap: 0.65rem;
        grid-template-columns: 1.75rem 1fr auto;
        min-height: 3.2rem;
        padding: 0.55rem 0.75rem;
    }

    .entry_marker {
        height: 1.75rem;
        width: 1.75rem;
    }

    .entry_copy strong {
        font-size: 0.9rem;
    }

    .user_center_entry_game > span:last-child,
    .org_center_entry_game > span:last-child,
    .box_select_entry_game > span:last-child {
        /* 手机端保留文字：原先 display:none 只剩图标，玩家看不清是什么按钮 */
        display: inline;
        color: #f2f7ff;
        font-size: 0.82rem;
        font-weight: 700;
        letter-spacing: 0.02em;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
    }

    .user_center_entry_game,
    .org_center_entry_game,
    .box_select_entry_game {
        background: rgba(18, 28, 40, 0.92);
        color: #f2f7ff;
        font-size: 0.82rem;
        font-weight: 700;
        gap: 0.4rem;
        min-width: 0;
        padding: 0.55rem 0.7rem;
    }

    .org_center_entry_game {
        color: #ffe7b0;
    }

    .box_select_entry_game {
        color: #d6ffe8;
    }

    #dialog_frame:has(.account_dialog),
    #dialog_frame:has(.user_center),
    #dialog_frame:has(> #dialog_content > select):has(> #dialog_content > h3) {
        border-radius: var(--kio-radius) !important;
        left: 50% !important;
        max-height: calc(100vh - 1rem);
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: calc(100vw - 1rem) !important;
    }

    #dialog_frame:has(.account_dialog) > #dialog_content,
    #dialog_frame:has(.user_center) > #dialog_content,
    #dialog_frame:has(> #dialog_content > select):has(> #dialog_content > h3) > #dialog_content {
        max-height: calc(100vh - 5rem);
        padding: 1rem !important;
    }

    #dialog_frame:has(> #dialog_content > select):has(> #dialog_content > h3) > #dialog_content {
        grid-template-columns: 1fr;
    }

    .user_center_identity {
        gap: 0.5rem;
        grid-template-columns: 1fr;
    }
}

@media (max-height: 720px) and (min-width: 761px) {
    #guest_entry {
        gap: 0.9rem;
        top: 44%;
    }

    .guest_brand img {
        max-width: 17rem;
    }

    #guest_entry button {
        min-height: 3.2rem;
    }
}

/* ---------- 个人中心独立页面 ---------- */
.user_center_page {
    background-color: #1a1a2e;
    background-image:
        linear-gradient(#252536 1px, transparent 1px),
        linear-gradient(90deg, #252536 1px, transparent 1px);
    background-size: 5rem 5rem;
    box-sizing: border-box;
    color: #f5f5f7;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    padding: 0;
    position: fixed;
    inset: 0;
    z-index: 99999;
}

/* 进入个人中心页面时隐藏游戏内 HUD、弹窗、入口按钮等 overlay */
body:has(.user_center_page) #ui-layer > *:not(.user_center_page),
body:has(.user_center_page) #dialog_frame,
body:has(.user_center_page) #guest_entry,
body:has(.user_center_page) .corner_entries,
body:has(.user_center_page) #settings_button,
body:has(.user_center_page) #settings {
    display: none !important;
}

.user_center_page_header {
    align-items: center;
    backdrop-filter: none;
    background: #1a1a2e;
    border-bottom: 1px solid #2f2f42;
    box-sizing: border-box;
    display: flex;
    gap: 1rem;
    max-width: 50rem;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.user_center_page_header h1 {
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
}

.user_center_page_back {
    align-items: center;
    background: transparent;
    border: 0;
    color: #8b8b9e;
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.25rem 0;
    transition: color 0.15s ease;
}

.user_center_page_back:hover {
    color: #60a5fa;
}

.user_center_page_main {
    box-sizing: border-box;
    display: grid;
    gap: 1.5rem;
    margin: 0 auto;
    max-width: 50rem;
    padding: 2rem;
}

.ucp_card {
    background: #222233;
    border: 1px solid #2f2f42;
    border-radius: 0;
    box-shadow: none;
    box-sizing: border-box;
    padding: 1.75rem 2rem;
}

.ucp_toggle_row input[type="color"] {
    width: 42px;
    height: 28px;
    padding: 0;
    border: 1px solid #3a3a50;
    background: transparent;
    cursor: pointer;
}

.ucp_hint {
    color: #9ca3af;
    font-size: 0.85rem;
    margin: 0 0 1.25rem;
}

.ucp_profile_grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.ucp_field {
    display: grid;
    gap: 0.2rem;
}

.ucp_field span {
    color: #8b8b9e;
    font-size: 0.78rem;
}

.ucp_field strong {
    color: #f5f5f7;
    font-size: 1.1rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ucp_form {
    display: grid;
    gap: 1rem;
}

.ucp_form label {
    display: grid;
    gap: 0.4rem;
}

.ucp_form label > span {
    color: #b0b0c0;
    font-size: 0.82rem;
    font-weight: 500;
}

.ucp_form input {
    appearance: none;
    background: #252536;
    border: 1px solid #3a3a4d;
    border-radius: 0;
    box-sizing: border-box;
    color: #f5f5f7;
    font: inherit;
    font-size: 0.95rem;
    min-height: 2.9rem;
    outline: 0;
    padding: 0.7rem 0.95rem;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    width: 100%;
}

.ucp_form input::placeholder {
    color: #6b6b7a;
}

.ucp_form input:hover {
    background: #2e2e42;
    border-color: #4b4b5e;
}

.ucp_form input:focus {
    background: #2e2e42;
    border-color: #60a5fa;
}

.ucp_submit {
    appearance: none;
    background: #60a5fa;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    box-sizing: border-box;
    color: #ffffff;
    cursor: pointer;
    display: inline-block;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-top: 0.25rem;
    min-height: 3rem;
    padding: 0.8rem 1.5rem;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.15s ease;
    width: fit-content;
}

.ucp_submit:hover:not(:disabled) {
    background: #3b82f6;
}

.ucp_submit:active:not(:disabled) {
    background: #2563eb;
}

.ucp_submit:disabled {
    background: #3b5998;
    cursor: wait;
}

/* 放弃保留进度：危险操作，用暗红区分于普通提交按钮。 */
.ucp_abandon_btn {
    appearance: none;
    background: #b03a3a;
    border: 0;
    border-radius: 0;
    box-sizing: border-box;
    color: #ffffff;
    cursor: pointer;
    display: inline-block;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin-top: 0.6rem;
    min-height: 2.6rem;
    padding: 0.6rem 1.2rem;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.15s ease;
    width: fit-content;
}

.ucp_abandon_btn:hover:not(:disabled) {
    background: #8f2e2e;
}

.ucp_abandon_btn:disabled {
    background: #6b4444;
    cursor: wait;
}

/* ============ 个性主页：背景图 + 头衔 ============ */
.ucp_bg_preview_wrap { display: flex; flex-direction: column; gap: 0.5rem; }
.ucp_bg_preview { border: 1px solid rgba(52,172,224,0.35); display: block; max-width: 100%; object-fit: cover; width: 100%; }
.ucp_bg_upload_label { align-items: center; border: 1px dashed rgba(52,172,224,0.5); cursor: pointer; display: flex; flex-direction: column; gap: 0.4rem; padding: 1.2rem 0.8rem; text-align: center; transition: border-color 0.15s ease; }
.ucp_bg_upload_label:hover { border-color: var(--kio-primary); }
.ucp_bg_file_input { color: var(--kio-text-dim); font-size: 0.8rem; }

/* 裁剪弹窗 */
.ucp_crop_overlay { align-items: center; background: rgba(0,0,0,0.75); display: flex; inset: 0; justify-content: center; position: fixed; z-index: 3000; }
.ucp_crop_modal { background: #0e141e; border: 1px solid rgba(52,172,224,0.35); box-sizing: border-box; display: flex; flex-direction: column; gap: 0.6rem; max-height: 90vh; max-width: 90vw; overflow: auto; padding: 1rem; width: 32rem; }
.ucp_crop_title { color: var(--kio-primary); font-size: 1rem; font-weight: 700; }
/* overflow:hidden 裁掉选区的巨大 box-shadow（9999px 暗化遮罩），
   否则遮罩会溢出容器盖住下面的「确认裁剪/取消」按钮。 */
.ucp_crop_container { overflow: hidden; position: relative; user-select: none; }
.ucp_crop_source_img { display: block; max-width: 100%; width: 100%; }
.ucp_crop_selector { border: 2px solid var(--kio-primary); box-shadow: 0 0 0 9999px rgba(0,0,0,0.5); box-sizing: border-box; cursor: move; position: absolute; }
.ucp_crop_actions { display: flex; gap: 0.5rem; }
.ucp_crop_actions .ucp_submit, .ucp_crop_actions .ucp_abandon_btn { flex: 1; margin: 0; }

/* 头衔选择网格 */
.ucp_titles_grid { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); }
.ucp_title_option { appearance: none; background: var(--kio-panel-dark); border: 2px solid transparent; color: var(--kio-text); cursor: pointer; display: flex; flex-direction: column; font-family: inherit; font-size: 0.75rem; gap: 0.25rem; overflow: hidden; padding: 0.4rem; transition: border-color 0.15s ease; }
.ucp_title_option:hover { border-color: rgba(52,172,224,0.5); }
.ucp_title_option.active { border-color: var(--kio-primary); }
.ucp_title_thumb { aspect-ratio: 900 / 383; background: #202a38; display: block; object-fit: cover; width: 100%; }
.ucp_title_lazy { content-visibility: auto; }
.ucp_title_name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.territory_resume_backdrop {
    align-items: center;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    inset: 0;
    justify-content: center;
    pointer-events: auto;
    position: fixed;
    z-index: 40;
}

.announcement_backdrop {
    align-items: center;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    inset: 0;
    justify-content: center;
    pointer-events: auto;
    position: fixed;
    z-index: 45;
}

.announcement_dialog {
    background: var(--kio-panel);
    border: 1px solid var(--kio-border);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 4rem);
    max-width: 32rem;
    width: calc(100vw - 2rem);
}

.announcement_header {
    align-items: center;
    border-bottom: 1px solid var(--kio-border);
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.25rem;
}

.announcement_title {
    color: var(--kio-text);
    font-size: 1.1rem;
    font-weight: 700;
}

.announcement_close {
    appearance: none;
    background: none;
    border: 0;
    color: var(--kio-text-dim);
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    padding: 0;
}

.announcement_close:hover {
    color: var(--kio-text);
}

.announcement_body {
    color: var(--kio-text);
    font-size: 0.92rem;
    line-height: 1.6;
    overflow-y: auto;
    padding: 1.1rem 1.25rem;
    word-break: break-word;
}

.announcement_body img {
    max-width: 100%;
    height: auto;
}

.announcement_body p {
    margin: 0.5em 0;
}

.announcement_body h1,
.announcement_body h2,
.announcement_body h3,
.announcement_body h4,
.announcement_body h5,
.announcement_body h6 {
    margin: 0.75em 0 0.35em;
    font-weight: bold;
    line-height: 1.3;
}

.announcement_body h1 { font-size: 1.5em; }
.announcement_body h2 { font-size: 1.3em; }
.announcement_body h3 { font-size: 1.15em; }

.announcement_body ul,
.announcement_body ol {
    margin: 0.5em 0;
    padding-left: 1.6em;
}

.announcement_body ul { list-style: disc; }
.announcement_body ol { list-style: decimal; }

.announcement_body li {
    margin: 0.25em 0;
}

.announcement_body strong { font-weight: bold; }
.announcement_body em { font-style: italic; }

.announcement_body a {
    color: var(--kio-link, #7eb8f7);
    text-decoration: underline;
}

.announcement_body blockquote {
    border-left: 3px solid var(--kio-border, #555);
    margin: 0.5em 0;
    padding: 0.25em 0.75em;
    opacity: 0.85;
}

.announcement_body pre,
.announcement_body code {
    font-family: monospace;
    font-size: 0.88em;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 3px;
    padding: 0.1em 0.35em;
}

.announcement_body pre {
    padding: 0.6em 0.9em;
    overflow-x: auto;
    white-space: pre-wrap;
}

.announcement_footer {
    border-top: 1px solid var(--kio-border);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 0.9rem 1.25rem;
}

.announcement_dismiss,
.announcement_ok {
    appearance: none;
    border: 0;
    box-shadow: none;
    color: var(--kio-text);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 0.55rem 1.1rem;
    transition: var(--kio-transition);
}

.announcement_dismiss {
    background: var(--kio-border);
}

.announcement_dismiss:hover {
    background: var(--kio-danger-hover, var(--kio-border));
}

.announcement_ok {
    background: var(--kio-primary);
}

.announcement_ok:hover {
    background: var(--kio-primary-hover);
}

.territory_resume_dialog {
    background: var(--kio-panel);
    border: 1px solid var(--kio-border);
    box-shadow: none;
    box-sizing: border-box;
    max-width: 26rem;
    padding: 1.5rem;
    width: calc(100vw - 2rem);
}

.territory_resume_title {
    color: var(--kio-text);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.territory_resume_hint {
    color: var(--kio-text-dim);
    font-size: 0.88rem;
    line-height: 1.5;
    margin: 0 0 1.2rem;
}
.territory_resume_error { color: #ff8f8f; font-size: 0.78rem; margin: 0 0 0.7rem; }
.territory_resume_actions button:disabled { cursor: wait; opacity: 0.55; }

.territory_resume_actions {
    display: flex;
    gap: 0.75rem;
}

.territory_resume_continue,
.territory_resume_abandon {
    appearance: none;
    border: 0;
    box-shadow: none;
    color: var(--kio-text);
    cursor: pointer;
    flex: 1;
    font: inherit;
    font-weight: 700;
    padding: 0.75rem 1rem;
    transition: var(--kio-transition);
}

.territory_resume_continue {
    background: var(--kio-primary);
}

.territory_resume_continue:hover {
    background: var(--kio-primary-hover);
}

.territory_resume_abandon {
    background: var(--kio-danger);
}

.territory_resume_abandon:hover {
    background: var(--kio-danger-hover);
}

.ucp_toggle_row {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 0.6rem;
    margin-top: 0.25rem;
}

.ucp_toggle_row input[type="checkbox"] {
    accent-color: #60a5fa;
    cursor: pointer;
    height: 1.2rem;
    width: 1.2rem;
}

.ucp_toggle_row span {
    color: #c8d8ea;
    font-size: 0.9rem;
    font-weight: 600;
}

.ucp_message {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 0;
    color: #ff6b6b;
    font-size: 0.82rem;
    line-height: 1.45;
    margin: 0;
    padding: 0.65rem 0.9rem;
}

.ucp_message.success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
    color: #4ade80;
}

.ucp_empty {
    text-align: center;
}

.ucp_empty .ucp_submit {
    display: inline-block;
    margin-top: 1rem;
}

@media (max-width: 640px) {
    .user_center_page_header,
    .user_center_page_main {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .ucp_card {
        padding: 1.25rem;
    }

    .ucp_submit {
        width: 100%;
    }
}

/* ── 静音管理列表 ── */
.ucp_mute_list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.5rem;
}
.ucp_mute_item {
    align-items: center;
    background: #252536;
    border: 1px solid #2f2f42;
    border-radius: 0;
    display: flex;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    transition: border-color 0.15s ease;
}
.ucp_mute_item:hover {
    border-color: #4b4b5e;
}
.ucp_mute_name {
    color: #f5f5f7;
    font-size: 0.92rem;
    font-weight: 600;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ucp_mute_time {
    color: #6b6b7a;
    font-size: 0.75rem;
    flex-shrink: 0;
}
.ucp_mute_remove {
    appearance: none;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 0;
    color: #ff6b6b;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    flex-shrink: 0;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.ucp_mute_remove:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ff9999;
}

/* ============ 组织中心弹窗 ============ */
/* 继承指挥官档案的暗色玻璃风格（kio 令牌）*/
#dialog_frame:has(.org_center) {
    max-height: calc(100vh - 2rem);
}
.org_center {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    width: 32rem;
    max-width: calc(100vw - 2rem);
    padding: 0.25rem;
}

@keyframes org_fade_in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes org_card_in {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes org_spin { to { transform: rotate(360deg); } }

.org_view { animation: org_fade_in 0.28s ease both; display: flex; flex-direction: column; gap: 0.9rem; }

.org_nav {
    border-bottom: 1px solid var(--kio-border); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
}
.org_nav_btn {
    appearance: none; background: transparent; border: 0; border-bottom: 2px solid transparent;
    color: var(--kio-text-dim); cursor: pointer; font-family: inherit; font-size: 0.84rem;
    font-weight: 700; min-height: 2.4rem; padding: 0.55rem 0.75rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.org_nav_btn:hover { background: rgba(52,172,224,0.08); color: var(--kio-text); }
.org_nav_btn.active { border-bottom-color: var(--kio-primary); color: var(--kio-primary); }

/* 加载态 */
.org_loading {
    align-items: center; color: var(--kio-text-dim); display: flex;
    gap: 0.6rem; justify-content: center; padding: 2.5rem 1rem; font-size: 0.85rem;
}
.org_spinner {
    width: 1.1rem; height: 1.1rem; border-radius: 50%;
    border: 2px solid rgba(52,172,224,0.25); border-top-color: var(--kio-primary);
    animation: org_spin 0.7s linear infinite;
}

/* 头部：标题 + 右上角创建 / 返回 */
.org_head { align-items: center; display: flex; gap: 0.75rem; justify-content: space-between; }
.org_head h3 { color: var(--kio-text); font-size: 1.1rem; font-weight: 700; margin: 0; }
.org_head_text h3 { color: var(--kio-text); font-size: 1.2rem; margin: 0 0 0.2rem; }
.org_head_text p { color: var(--kio-text-dim); font-size: 0.8rem; margin: 0; }
.org_create_btn {
    align-items: center; appearance: none; background: var(--kio-primary); border: 0;
    border-radius: 0; color: #fff; cursor: pointer; display: inline-flex; flex-shrink: 0;
    font-family: inherit; font-size: 0.82rem; font-weight: 700; gap: 0.35rem;
    letter-spacing: 0.03em; padding: 0.5rem 0.85rem;
    transition: background-color 0.15s ease, transform 0.15s ease;
}
.org_create_btn:hover { background: var(--kio-primary-hover); transform: translateY(-1px); }
.org_create_btn:active { transform: translateY(0); }
.org_plus { font-size: 1.05rem; line-height: 1; }
.org_back_btn {
    appearance: none; background: transparent; border: 1px solid var(--kio-border);
    border-radius: 0; color: var(--kio-text-dim); cursor: pointer; font-family: inherit;
    font-size: 0.78rem; padding: 0.4rem 0.7rem; transition: color 0.15s ease, border-color 0.15s ease;
}
.org_back_btn:hover { color: var(--kio-text); border-color: var(--kio-primary); }

.org_note {
    animation: org_fade_in 0.3s ease both;
    background: rgba(52,172,224,0.1); border: 1px solid rgba(52,172,224,0.3);
    border-radius: var(--kio-radius); color: #a9dcf0; font-size: 0.8rem; padding: 0.55rem 0.75rem;
}

/* 推荐组织卡片网格 */
.org_cards { display: flex; flex-direction: column; gap: 0.55rem; }
.org_card {
    animation: org_card_in 0.32s ease both;
    background: var(--kio-panel-dark); border: 1px solid var(--kio-border); border-radius: 0;
    cursor: pointer; display: flex; align-items: center; gap: 0.85rem; padding: 0.8rem 0.9rem;
    transition: border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
.org_card:hover {
    border-color: var(--kio-primary); transform: translateX(2px);
    box-shadow: none;
}
.org_card_badge {
    align-items: center; background: var(--kio-panel-darker); border: 1px solid var(--kio-border);
    border-radius: 0; color: var(--kio-primary); display: flex; flex-shrink: 0;
    font-size: 1.1rem; font-style: italic; font-weight: 800; height: 2.6rem; justify-content: center;
    width: 2.6rem;
}
.org_card.gold .org_card_badge {
    background: rgba(94,74,32,0.5); border-color: rgba(255,196,87,0.5); color: #ffd873;
}
.org_card_badge img, .org_banner_avatar img { height: 100%; object-fit: cover; width: 100%; }
.org_card_body { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; flex: 1; }
.org_card_top { align-items: center; display: flex; gap: 0.4rem; }
.org_card_name {
    color: var(--kio-text); font-size: 0.98rem; font-style: italic; font-weight: 800;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.org_card_name.gold { color: #ffd873; text-shadow: 0 0 8px rgba(255,196,87,0.45); }
.org_gold_dot {
    width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #ffcf6b;
    box-shadow: none; flex-shrink: 0;
}
.org_card_desc {
    color: var(--kio-text-dim); font-size: 0.76rem; margin: 0; line-height: 1.4;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.org_card_stars { color: #ffcf6b; font-size: 0.68rem; letter-spacing: 1px; }
.org_card_foot { align-items: flex-end; display: flex; flex-direction: column; gap: 0.4rem; flex-shrink: 0; }
.org_card_meta { color: #8fa0b3; font-size: 0.68rem; white-space: nowrap; }

/* 组织广场搜索 + 排序工具栏 */
.org_toolbar {
    display: flex; flex-direction: column; gap: 0.55rem; margin-bottom: 0.6rem;
}
.org_search {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15); border-radius: 0;
    color: #e0e8f0; font-family: inherit; font-size: 0.82rem; padding: 0.45rem 0.6rem;
}
.org_search::placeholder { color: #5d6e80; }
.org_search:focus { border-color: var(--kio-primary); outline: none; }
.org_sort_row { align-items: center; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.org_sort_label { color: #8fa0b3; font-size: 0.72rem; }
.org_sort_btn {
    appearance: none; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 0; color: #a8bfcf; cursor: pointer; font-family: inherit; font-size: 0.72rem;
    padding: 0.2rem 0.55rem; transition: background-color 0.15s ease, color 0.15s ease;
}
.org_sort_btn:hover { background: rgba(52,172,224,0.12); color: #d6e2f0; }
.org_sort_btn.active { background: var(--kio-primary); border-color: var(--kio-primary); color: #fff; }
.org_pagination { align-items: center; color: var(--kio-text-dim); display: flex; font-size: 0.72rem; gap: 0.7rem; justify-content: center; margin-top: 0.75rem; }
.org_pagination .org_mini_btn:disabled { cursor: default; opacity: 0.4; }
.org_apply_btn {
    appearance: none; background: var(--kio-secondary); border: 0; border-radius: 0;
    color: #fff; cursor: pointer; font-family: inherit; font-size: 0.72rem; font-weight: 600;
    padding: 0.34rem 0.7rem; transition: background-color 0.15s ease; flex-shrink: 0;
}
.org_apply_btn:hover { background: var(--kio-secondary-hover); }
.org_view_link { color: var(--kio-primary); font-size: 0.72rem; font-weight: 600; }

/* 空状态 */
.org_empty_state {
    align-items: center; display: flex; flex-direction: column; gap: 0.5rem;
    padding: 2rem 1rem; text-align: center;
}
.org_empty_mark {
    width: 2.6rem; height: 2.6rem; border-radius: 0; transform: rotate(45deg);
    border: 2px solid var(--kio-primary); box-shadow: none;
    margin-bottom: 0.4rem;
}
.org_empty_state strong { color: var(--kio-text); font-size: 1rem; }
.org_empty_state p { color: var(--kio-text-dim); font-size: 0.8rem; margin: 0; }

/* 未登录提示 */
.org_login_hint {
    align-items: center; animation: org_fade_in 0.3s ease both; display: flex;
    flex-direction: column; gap: 0.6rem; padding: 1.8rem 1rem; text-align: center;
}
.org_hint_mark {
    width: 3rem; height: 3rem; border-radius: 50%; background: var(--kio-panel-darker);
    border: 1px solid var(--kio-border); position: relative;
}
.org_hint_mark::before {
    content: ""; position: absolute; inset: 0; margin: auto; width: 0.7rem; height: 0.7rem;
    border-radius: 50%; background: var(--kio-primary); box-shadow: none;
}
.org_login_hint strong { color: var(--kio-text); font-size: 1.05rem; }
.org_login_hint p { color: var(--kio-text-dim); font-size: 0.82rem; margin: 0; max-width: 22rem; }
.org_login_btn {
    appearance: none; background: var(--kio-primary); border: 0; border-radius: 0;
    color: #fff; cursor: pointer; font-family: inherit; font-size: 0.9rem; font-weight: 700;
    letter-spacing: 0.06em; margin-top: 0.4rem; padding: 0.7rem 1.6rem;
    transition: background-color 0.15s ease, transform 0.15s ease;
}
.org_login_btn:hover { background: var(--kio-primary-hover); transform: translateY(-1px); }

/* 表单 */
.org_form { display: flex; flex-direction: column; gap: 0.85rem; }
.org_form label { display: flex; flex-direction: column; gap: 0.35rem; }
.org_form label > span { color: var(--kio-text-dim); font-size: 0.78rem; }
.org_form input, .org_form textarea, .org_invite_form input {
    appearance: none; background: var(--kio-panel-darker); border: 1px solid transparent;
    border-radius: 0; box-sizing: border-box; color: var(--kio-text); font-family: inherit;
    font-size: 0.9rem; outline: 0; padding: 0.65rem 0.8rem; resize: vertical; width: 100%;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.org_form input::placeholder, .org_form textarea::placeholder { color: #6b7787; }
.org_form input:focus, .org_form textarea:focus, .org_invite_form input:focus {
    border-color: var(--kio-primary);
}

/* 主要提交按钮 */
.org_submit {
    appearance: none; background: var(--kio-primary); border: 0; border-radius: 0;
    color: #fff; cursor: pointer; font-family: inherit; font-size: 0.92rem; font-weight: 700;
    letter-spacing: 0.08em; min-height: 2.9rem; padding: 0.75rem; width: 100%;
    transition: background-color 0.15s ease, transform 0.15s ease;
}
.org_submit:hover { background: var(--kio-primary-hover); transform: translateY(-1px); }
.org_submit:active { transform: translateY(0); }
.org_submit.disabled, .org_submit:disabled { background: var(--kio-secondary); cursor: default; transform: none; }

/* 组织横幅 */
.org_banner {
    animation: org_fade_in 0.3s ease both;
    background: linear-gradient(135deg, var(--kio-panel-dark), var(--kio-panel-darker));
    border: 1px solid var(--kio-border); border-radius: 0; padding: 0.95rem 1rem;
}
.org_banner.gold {
    background: linear-gradient(135deg, rgba(94,74,32,0.55), var(--kio-panel-darker));
    border-color: rgba(255,196,87,0.5); box-shadow: none;
}
.org_banner_head { align-items: center; display: flex; gap: 0.6rem; }
.org_banner_avatar {
    align-items: center; background: var(--kio-panel-darker); border: 1px solid var(--kio-border);
    color: var(--kio-primary); display: flex; flex: 0 0 2.8rem; font-size: 1.15rem;
    font-weight: 800; height: 2.8rem; justify-content: center; overflow: hidden;
}
.org_name { color: var(--kio-text); font-size: 1.3rem; font-style: italic; font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org_banner.gold .org_name { color: #ffd873; text-shadow: 0 0 10px rgba(255,196,87,0.5); }
.org_gold_badge {
    background: #ffcf6b; border-radius: 0; color: #3a2a08; font-size: 0.62rem;
    font-weight: 700; padding: 0.15rem 0.45rem;
}
.org_desc { color: #c2cfdd; font-size: 0.84rem; margin: 0.55rem 0; word-break: break-word; line-height: 1.5; }
.org_meta { color: #8fa0b3; display: flex; flex-wrap: wrap; font-size: 0.72rem; gap: 0.85rem; }
.org_avatar_editor { align-items: center; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.org_avatar_preset {
    align-items: center; background: var(--kio-panel-darker); border: 1px solid var(--kio-border);
    color: var(--kio-text); cursor: pointer; display: flex; font-size: 1rem; height: 2.25rem;
    justify-content: center; width: 2.25rem;
}
.org_avatar_preset:hover { border-color: var(--kio-primary); }
.org_avatar_upload { cursor: pointer; }
.org_avatar_upload input { display: none; }

/* 分区 */
.org_section {
    border-top: 1px solid var(--kio-border); display: flex; flex-direction: column;
    gap: 0.5rem; padding-top: 0.8rem;
}
.org_section h4 { color: #d6e2f0; font-size: 0.88rem; margin: 0; }
.org_muted { color: #8fa0b3; font-size: 0.78rem; margin: 0; }
.org_list { display: flex; flex-direction: column; gap: 0.35rem; }
.org_row {
    align-items: center; animation: org_fade_in 0.25s ease both; background: var(--kio-panel-darker);
    border-radius: 0; display: flex; gap: 0.5rem; padding: 0.45rem 0.65rem;
}
.org_row_name { align-items: center; color: #e6eef8; display: flex; flex: 1; font-size: 0.85rem; gap: 0.4rem; }
.org_row_meta { color: #8fa0b3; font-size: 0.72rem; }
.org_row_actions { display: flex; gap: 0.3rem; }
.org_role_tag, .org_self_tag { border-radius: 0; font-size: 0.6rem; padding: 0.1rem 0.35rem; }
.org_role_tag { background: rgba(255,196,87,0.22); color: #f0d59c; }
.org_self_tag { background: rgba(52,172,224,0.25); color: #b8dbff; }
.org_rank { color: var(--kio-text-dim); font-size: 0.78rem; }
.org_rank.top { color: #ffd873; font-weight: 700; }

/* 小按钮 */
.org_mini_btn {
    appearance: none; background: var(--kio-secondary); border: 0; border-radius: 0;
    color: #fff; cursor: pointer; font-family: inherit; font-size: 0.72rem; font-weight: 600;
    padding: 0.3rem 0.65rem; transition: background-color 0.15s ease, filter 0.15s ease;
}
.org_mini_btn:hover { background: var(--kio-secondary-hover); }
.org_mini_btn.ok { background: #2e9e5b; }
.org_mini_btn.ok:hover { background: #268a4f; }
.org_mini_btn.danger { background: var(--kio-danger); }
.org_mini_btn.danger:hover { background: var(--kio-danger-hover); }
.org_invite_form { display: flex; gap: 0.4rem; }
.org_invite_form input { flex: 1; }
.org_danger_zone { flex-direction: row; flex-wrap: wrap; gap: 0.5rem; }

/* 组织等级星级 */
.org_level_row { align-items: center; display: flex; gap: 0.5rem; margin: 0.2rem 0 0.5rem; }
.org_level_stars { color: #f5c542; font-size: 1.1rem; letter-spacing: 0.1rem; }
.org_level_label { color: #a8bfcf; font-size: 0.75rem; }

/* 组织公告板 */
.org_notice_editor { display: flex; flex-direction: column; gap: 0.5rem; }
.org_notice_editor textarea {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); border-radius: 0;
    color: #e0e8f0; font-family: inherit; font-size: 0.82rem; padding: 0.5rem 0.6rem; resize: vertical;
}
.org_notice_text {
    background: rgba(255,196,87,0.08); border-left: 3px solid #f5c542;
    color: #e8d89a; font-size: 0.85rem; margin: 0; padding: 0.5rem 0.75rem; white-space: pre-wrap;
}

/* 自定义头衔输入框 */
.org_title_input {
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15); border-radius: 0;
    color: #e0e8f0; font-family: inherit; font-size: 0.72rem; padding: 0.2rem 0.4rem; width: 7rem;
}

/* 消息 */
.org_message {
    animation: org_fade_in 0.25s ease both; background: rgba(192,57,43,0.15);
    border: 1px solid rgba(192,57,43,0.4); border-radius: var(--kio-radius); color: #ffcccc;
    font-size: 0.8rem; margin: 0; padding: 0.55rem 0.75rem;
}
.org_message.success { background: rgba(39,174,96,0.14); border-color: rgba(39,174,96,0.4); color: #b8f5d0; }

/* ============ 顶栏 HUD：渐变从物理顶端（含刘海）往下变浅；提示左、榜右 ============ */
.kio_top_banner_host {
    box-sizing: border-box;
    left: 0;
    pointer-events: none;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 12;
    /* 渐变从物理顶端开始；内容紧贴安全区下沿，避免「提示不在最顶」 */
    background: linear-gradient(
        180deg,
        rgba(8, 12, 20, 0.78) 0%,
        rgba(8, 12, 20, 0.42) 48%,
        rgba(8, 12, 20, 0.1) 82%,
        transparent 100%
    );
    padding: 0 0.4rem 0.3rem;
}
.kio_top_bar {
    align-items: flex-start;
    display: flex;
    gap: 0.45rem;
    justify-content: space-between;
    width: 100%;
}
.kio_top_bar_main {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 0;
    pointer-events: none;
}
.kio_top_bar_side {
    align-items: flex-end;
    display: flex;
    flex: 0 1 auto;
    flex-direction: column;
    gap: 0.35rem;
    /* 给右下快捷栏/左下入口留空，过长内部滚动，不靠「自动挪开」 */
    max-height: min(42vh, calc(100dvh - 11rem));
    max-width: min(15rem, 38vw);
    overflow: visible;
    padding-top: 0;
    pointer-events: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(52,172,224,0.45) rgba(0,0,0,0.2);
}
/* 禁止 .kio_top_bar_side > * { auto }：特异性会压过 .org_scoreboard/.plb_float 的 none，
   关 mouse_over_ui 后整列透明区域会挡住拖兵与双指缩放。榜/开关各自声明 auto。 */
.kio_top_bar_side #leaderboard {
    margin: 0;
    padding: 0;
}
.kio_top_bar_side #leaderboard > p {
    margin-bottom: 0;
    margin-top: 0.2rem;
}
.kio_top_bar_side::-webkit-scrollbar { width: 5px; }
.kio_top_bar_side::-webkit-scrollbar-thumb {
    background: rgba(52,172,224,0.5);
    border-radius: 999px;
}
.kio_top_banner {
    background: none;
    box-sizing: border-box;
    padding: 0;
    pointer-events: none;
    width: 100%;
}
.kio_top_banner.empty {
    background: none;
    min-height: 0;
    padding: 0;
}
.kio_top_banner_row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.45rem;
    justify-content: flex-start;
    max-width: 100%;
    pointer-events: none;
}
.kio_alert_chip {
    align-items: center;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e8f3ff;
    display: inline-flex;
    font-size: 0.8rem;
    gap: 0.35rem;
    max-width: 100%;
    padding: 0.22rem 0.45rem;
    pointer-events: auto;
    white-space: nowrap;
}
.kio_alert_chip.clickable { cursor: pointer; }
.kio_alert_chip.clickable:hover { border-color: rgba(255, 255, 255, 0.28); }
.kio_alert_text {
    overflow: hidden;
    text-overflow: ellipsis;
}
.kio_alert_dismiss {
    appearance: none;
    background: transparent;
    border: 0;
    color: rgba(255,255,255,0.55);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0 0.15rem;
}
.kio_alert_dismiss:hover { color: #fff; }

/* 兼容旧类名（若别处引用） */
.kio_right_stack {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-width: 100%;
    pointer-events: none;
    position: relative;
    right: auto;
    top: auto;
}
.kio_right_stack > * { pointer-events: auto; }

/* ============ 组织积分榜浮层 ============ */
.org_scoreboard {
    align-items: flex-end; display: flex; flex-direction: column; gap: 0.4rem;
    max-width: 100%; pointer-events: none; position: relative; right: auto;
    top: auto; z-index: 40; width: 100%;
}
.org_sb_toggle {
    align-items: center; appearance: none;
    background: #1e2a38; border: 1px solid rgba(52,172,224,0.28);
    border-radius: 0; box-shadow: none; color: #c8d8ea; cursor: pointer;
    display: inline-flex; font-family: inherit; font-size: 0.72rem; font-weight: 600; gap: 0.35rem;
    padding: 0.35rem 0.75rem; pointer-events: auto;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.org_sb_toggle:hover, .org_sb_toggle.open {
    background: rgba(50,75,110,0.92); border-color: rgba(52,172,224,0.55); color: #e8f3ff;
}
.org_sb_chevron { font-size: 0.6rem; }
/* 展开面板贴在对应按钮正下方（相对父级），不再 fixed 到屏幕某一固定高度 */
.org_sb_body {
    animation: org_fade_in 0.24s ease both;
    background: #16202c; border: 1px solid rgba(52,172,224,0.22);
    border-radius: 0; box-shadow: none;
    box-sizing: border-box;
    max-height: min(70vh, calc(100dvh - 8rem));
    overflow-y: auto;
    padding: 0.65rem 0.7rem;
    pointer-events: auto;
    position: absolute;
    right: 0;
    top: calc(100% + 0.25rem);
    width: min(16rem, calc(100vw - 1rem));
    z-index: 46;
    scrollbar-width: thin; scrollbar-color: rgba(52,172,224,0.45) rgba(0,0,0,0.2);
}
.org_sb_body::-webkit-scrollbar { width: 5px; }
.org_sb_body::-webkit-scrollbar-thumb {
    background: rgba(52,172,224,0.5); border-radius: 999px;
}
.org_sb_title { color: #a9dcf0; font-size: 0.72rem; letter-spacing: 0.05em; margin: 0; }
.org_sb_head {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.org_sb_close,
.plb_close {
    appearance: none;
    background: transparent;
    border: 1px solid rgba(120,150,190,0.35);
    color: #c8d8ea;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0.85rem;
    line-height: 1;
    padding: 0.2rem 0.45rem;
}
.org_sb_close:hover,
.plb_close:hover {
    background: rgba(52,172,224,0.15);
    border-color: rgba(52,172,224,0.55);
    color: #fff;
}
.plb_head {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    margin-bottom: 0.45rem;
}
.plb_title {
    color: #a9dcf0;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
}
.org_sb_empty { color: #8fa0b3; font-size: 0.78rem; padding: 0.6rem 0; text-align: center; }
.org_sb_row {
    align-items: center; animation: org_card_in 0.28s ease both; border-top: 1px solid rgba(120,150,190,0.1);
    display: flex; font-size: 0.8rem; gap: 0.5rem; padding: 0.28rem 0;
}
.org_sb_rank { color: #9fb2c9; flex-shrink: 0; font-weight: 700; text-align: center; width: 1.3rem; }
.org_sb_rank.top { color: #ffd873; }
.org_sb_name {
    color: #dbe6f2; flex: 1; font-style: italic; font-weight: 700;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.org_sb_name.gold { color: #ffd873; text-shadow: 0 0 6px rgba(255,196,87,0.4); }
.org_sb_score { color: #b9c6d6; flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* ---------- 个人排行榜（日/周/总） ---------- */
.plb_float {
    align-items: flex-end; display: flex; flex-direction: column; gap: 0.4rem;
    max-width: 100%; pointer-events: none; position: relative; right: auto;
    top: auto; z-index: 40; width: 100%;
}
.plb_toggle {
    align-items: center; appearance: none;
    background: #1e2a38; border: 1px solid rgba(52,172,224,0.28);
    border-radius: 0; box-shadow: none; color: #c8d8ea; cursor: pointer;
    display: inline-flex; font-family: inherit; font-size: 0.72rem; font-weight: 600; gap: 0.35rem;
    padding: 0.35rem 0.75rem; pointer-events: auto;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.plb_toggle:hover, .plb_toggle.open {
    background: rgba(50,75,110,0.92); border-color: rgba(52,172,224,0.55); color: #e8f3ff;
}
.plb_body {
    animation: org_fade_in 0.24s ease both;
    background: #16202c; border: 1px solid rgba(52,172,224,0.22);
    border-radius: 0; box-shadow: none;
    box-sizing: border-box;
    max-height: min(70vh, calc(100dvh - 8rem));
    overflow-y: auto;
    padding: 0.65rem 0.7rem;
    pointer-events: auto;
    position: absolute;
    right: 0;
    top: calc(100% + 0.25rem);
    width: min(16rem, calc(100vw - 1rem));
    z-index: 46;
    scrollbar-width: thin; scrollbar-color: rgba(52,172,224,0.45) rgba(0,0,0,0.2);
}
.plb_body::-webkit-scrollbar { width: 5px; }
.plb_body::-webkit-scrollbar-thumb {
    background: rgba(52,172,224,0.5); border-radius: 999px;
}
.plb_tabs { display: flex; gap: 0.3rem; margin-bottom: 0.5rem; }
.plb_tab {
    background: transparent; border: 1px solid rgba(120,150,190,0.25); border-radius: 0;
    color: #8fa0b3; cursor: pointer; flex: 1; font-family: inherit;
    font-size: 0.7rem; padding: 0.25rem 0;
    transition: background-color 0.16s ease, color 0.16s ease;
}
.plb_tab.selected {
    background: rgba(52,172,224,0.18); border-color: rgba(52,172,224,0.55); color: #e8f3ff;
}
.plb_empty { color: #8fa0b3; font-size: 0.78rem; padding: 0.6rem 0; text-align: center; }
.plb_row {
    align-items: center; border-top: 1px solid rgba(120,150,190,0.1);
    display: flex; font-size: 0.8rem; gap: 0.5rem; padding: 0.28rem 0;
}
.plb_rank { color: #9fb2c9; flex-shrink: 0; font-weight: 700; text-align: center; width: 1.3rem; }
.plb_rank.top { color: #ffd873; }
.plb_name {
    color: #dbe6f2; flex: 1; font-weight: 700;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.plb_score { color: #b9c6d6; flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* 移动端：卡片单列；榜面板仍贴按钮下方，勿再 fixed 到屏幕顶部 */
@media (max-width: 760px) {
    .org_center { width: calc(100vw - 1rem); }
    .kio_top_bar_side {
        max-height: none;
        max-width: min(48vw, 11rem);
        overflow: visible;
    }
    .org_scoreboard,
    .plb_float {
        max-width: 100%;
        font-size: 0.72rem;
        overflow: visible;
        z-index: 40;
    }
    .org_sb_body,
    .plb_body {
        position: absolute;
        right: 0;
        top: calc(100% + 0.25rem);
        width: min(18rem, calc(100vw - 1rem));
        max-width: calc(100vw - 1rem);
        max-height: min(70dvh, calc(100dvh - 9rem));
        z-index: 46;
        box-sizing: border-box;
    }
    .wc_classic_win { width: min(20rem, calc(100vw - 1rem)); }
}

/* ---------- 创建组织表单 ---------- */
.org_create_form { display: flex; flex-direction: column; gap: 0.9rem; animation: org_fade_in 0.28s ease both; }
.org_field { display: flex; flex-direction: column; gap: 0.4rem; }
.org_field > span { color: var(--kio-text-dim); font-size: 0.8rem; }
.org_field input, .org_field textarea {
    appearance: none; background: var(--kio-panel-darker); border: 1px solid transparent;
    border-radius: 0; box-sizing: border-box; color: var(--kio-text); display: block;
    font-family: inherit; font-size: 0.9rem; outline: 0; padding: 0.6rem 0.75rem;
    resize: vertical; width: 100%; transition: border-color 0.15s ease;
}
.org_field input::placeholder, .org_field textarea::placeholder { color: #6b7787; }
.org_field input:focus, .org_field textarea:focus { border-color: var(--kio-primary); }

/* ============ 世界聊天（左侧滑出抽屉，扁平直角） ============ */
.wc_root { position: fixed; inset: 0; z-index: 20; pointer-events: none; }

/* ---- 经典聊天：可拖拽悬浮小窗（默认模式），默认透明背景+白字 ---- */
.wc_classic_win {
    position: fixed; width: 22rem; max-width: calc(100vw - 2rem);
    border: 1px solid rgba(52,172,224,0.35); display: flex; flex-direction: column;
    /* 窗体可点（拖标题栏）；空隙仍靠子级控制。恢复可拖动，同时 body 内非交互区穿透 */
    pointer-events: auto; z-index: 30; color: #ffffff;
    touch-action: none;
}
.wc_classic_body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    pointer-events: auto;
    touch-action: manipulation;
}
.wc_classic_header {
    align-items: center; background: rgba(0,0,0,0.35); cursor: grab; display: flex;
    gap: 0.5rem; padding: 0.4rem 0.6rem; user-select: none;
    pointer-events: auto;
    touch-action: none;
    -webkit-user-select: none;
}
.wc_classic_header button,
.wc_classic_header input,
.wc_classic_header a {
    touch-action: manipulation;
}
.wc_classic_title { color: #ffffff; flex: 1; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.02em; }
.wc_classic_mini {
    appearance: none; background: transparent; border: 1px solid rgba(255,255,255,0.3);
    color: #ffffff; cursor: pointer; font-size: 0.72rem; line-height: 1; padding: 0.15rem 0.4rem;
}
.wc_classic_mini:hover { background: rgba(255,255,255,0.15); }
.wc_classic_opacity_row {
    align-items: center; color: #ffffff; display: flex; font-size: 0.7rem; gap: 0.5rem;
    padding: 0.3rem 0.6rem; background: rgba(0,0,0,0.2);
}
.wc_classic_opacity_row input[type="range"] { flex: 1; }
.wc_classic_msgs {
    display: flex; flex-direction: column; gap: 0.18rem; max-height: 16rem; overflow-y: auto;
    padding: 0.5rem 0.6rem; scrollbar-width: thin; scrollbar-color: rgba(52,172,224,0.3) transparent;
}
.wc_classic_msgs::-webkit-scrollbar { width: 4px; }
.wc_classic_msgs::-webkit-scrollbar-thumb { background: rgba(52,172,224,0.3); }
.wc_classic_msgs .wc_msg { color: #ffffff; font-size: 0.8rem; }
.wc_classic_msgs .wc_content { color: #ffffff; }
.wc_classic_msgs .wc_sep { color: #ffffff; }
.wc_classic_input_row { display: flex; gap: 0; padding: 0.4rem 0.5rem; background: rgba(0,0,0,0.2); }
.wc_classic_input {
    appearance: none; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.25);
    border-right: 0; color: #ffffff; flex: 1; font-family: inherit; font-size: 0.82rem;
    outline: 0; padding: 0.4rem 0.6rem;
}
.wc_classic_input::placeholder { color: rgba(255,255,255,0.6); }
.wc_classic_send {
    appearance: none; background: var(--kio-primary); border: 0; color: #fff; cursor: pointer;
    font-size: 0.82rem; font-weight: 700; padding: 0 0.8rem;
}
.wc_classic_send:hover { background: var(--kio-primary-hover); }

/* 现代抽屉顶部“切换到经典模式”按钮 */
.wc_drawer_mode {
    appearance: none; background: transparent; border: 1px solid rgba(52,172,224,0.3);
    color: #c8d8ea; cursor: pointer; font-size: 0.68rem; padding: 0.2rem 0.5rem;
    transition: background-color 0.12s ease;
}
.wc_drawer_mode:hover { background: rgba(52,172,224,0.15); }

/* 左侧中部入口标签 */
.wc_toggle { align-items: center; appearance: none; background: #24324a; border: 1px solid rgba(52,172,224,0.35); box-shadow: none; color: #c8d8ea; cursor: pointer; display: inline-flex; flex-direction: column; font-family: inherit; font-size: 0.8rem; font-weight: 700; gap: 0.5rem; letter-spacing: 0.18em; padding: 0.95rem 0.4rem; pointer-events: auto; position: fixed; left: max(0.75rem, env(safe-area-inset-left, 0px)); top: 50%; transform: translateY(-50%); transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.22s ease, transform 0.28s cubic-bezier(0.22,0.61,0.36,1); z-index: 21; }
.wc_toggle:hover { background: #32496e; border-color: rgba(52,172,224,0.7); }
.wc_toggle_text { writing-mode: vertical-rl; text-orientation: upright; }
.wc_toggle.wc_toggle_open { opacity: 0; pointer-events: none; transform: translateY(-50%) translateX(-100%); }
.wc_dot { width: 0.42rem; height: 0.42rem; background: #8fa0b3; flex-shrink: 0; }
.wc_dot.connected { background: #4ade80; box-shadow: none; }

/* 左侧滑出抽屉：全高，半屏宽，直角 */
.wc_drawer { background: #0e141e; border: 1px solid rgba(52,172,224,0.25); border-left: 0; box-shadow: none; display: flex; flex-direction: column; height: 100vh; width: 50vw; overflow: hidden; pointer-events: none; position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform 0.28s cubic-bezier(0.22,0.61,0.36,1); z-index: 90; }
.wc_drawer.open { transform: translateX(0); pointer-events: auto; }
.wc_drawer_header { align-items: center; display: flex; gap: 0.6rem; padding: 0.7rem 0.9rem; border-bottom: 1px solid rgba(52,172,224,0.15); flex-shrink: 0; }
.wc_drawer_title { color: #e0e8f0; font-size: 0.95rem; font-weight: 700; flex: 1; letter-spacing: 0.02em; }
.wc_drawer_status { color: #8fa0b3; font-size: 0.72rem; padding: 0.15rem 0.5rem; background: rgba(143,160,179,0.12); }
.wc_drawer_status.online { color: #4ade80; background: rgba(74,222,128,0.12); }
.wc_drawer_close { appearance: none; background: transparent; border: 0; color: #8fa0b3; cursor: pointer; font-size: 1.3rem; font-weight: 400; line-height: 1; padding: 0 0.2rem; transition: color 0.12s ease; }
.wc_drawer_close:hover { color: #ef4444; }
.wc_msgs { display: flex; flex-direction: column; flex: 1; gap: 0.18rem; min-height: 0; overflow-y: auto; padding: 0.6rem 0.7rem; scrollbar-width: thin; scrollbar-color: rgba(52,172,224,0.3) transparent; }
.wc_msgs::-webkit-scrollbar { width: 4px; }
.wc_msgs::-webkit-scrollbar-thumb { background: rgba(52,172,224,0.3); }
.wc_msg { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.22rem; font-size: 0.8rem; line-height: 1.4; }
.wc_msg.sys { opacity: 0.65; font-style: italic; }
.wc_org { color: var(--kio-text-muted); font-style: italic; font-weight: 700; font-size: 0.75rem; }
.wc_org_gold { color: #ffd873; text-shadow: 0 0 5px rgba(255,216,115,.35); }
.wc_level_badge { border: 1px solid currentColor; border-radius: 3px; font-size: 0.68rem; font-weight: 700; line-height: 1.3; padding: 0 0.28rem; }
.wc_name { color: var(--kio-primary); cursor: pointer; font-weight: 700; user-select: none; }
.wc_name:hover { text-decoration: underline; }
.wc_name.sys_name { color: #8fa0b3; cursor: default; font-weight: 600; }
.wc_name.wc_name_self { color: #7fd6ff; }
.wc_name.wc_name_account { font-style: italic; }
.wc_sep { color: #8fa0b3; }
.wc_content { color: #e0e8f0; word-break: break-word; }
.wc_input_row { border-top: 1px solid rgba(52,172,224,0.15); display: flex; gap: 0; padding: 0.45rem 0.5rem; }
.wc_input { appearance: none; background: #16202c; border: 1px solid rgba(52,172,224,0.2); border-right: 0; color: #e8f3ff; flex: 1; font-family: inherit; font-size: 0.82rem; outline: 0; padding: 0.45rem 0.65rem; transition: border-color 0.15s ease; }
.wc_input:focus { border-color: rgba(52,172,224,0.5); }
.wc_send { appearance: none; background: var(--kio-primary); border: 0; color: #fff; cursor: pointer; font-size: 0.85rem; font-weight: 700; padding: 0 0.9rem; transition: background-color 0.15s ease; }
.wc_send:hover { background: var(--kio-primary-hover); }
.wc_no_login { color: #8fa0b3; font-size: 0.78rem; padding: 0.6rem; text-align: center; border-top: 1px solid rgba(52,172,224,0.15); }

/* 右键菜单（扁平直角） */
.wc_ctx_menu { background: #16202e; border: 1px solid rgba(52,172,224,0.3); box-shadow: none; display: flex; flex-direction: column; min-width: 9rem; pointer-events: auto; position: fixed; z-index: 99; }
.wc_ctx_menu button { appearance: none; background: transparent; border: 0; color: #d6e2f0; cursor: pointer; font-family: inherit; font-size: 0.82rem; padding: 0.5rem 0.9rem; text-align: left; transition: background-color 0.12s ease; }
.wc_ctx_menu button:hover { background: rgba(52,172,224,0.15); }
.wc_ctx_sep { border-top: 1px solid rgba(52,172,224,0.15); margin: 0.2rem 0; }
.wc_ctx_group_label { color: #8fa0b3; font-size: 0.68rem; font-weight: 600; padding: 0.25rem 0.9rem 0.1rem; text-transform: uppercase; letter-spacing: 0.04em; }
.wc_ctx_danger { color: #fca5a5 !important; }
.wc_ctx_danger:hover { background: rgba(239,68,68,0.15) !important; }

/* 人机难度投票条：聊天框顶部常驻，四档按钮 + 实时票数。
   视觉沿用现有 wc_ 语言：扁平无阴影、--kio-primary 强调、描边徽章式按钮。
   两套布局（经典浮窗 / 现代抽屉）共用这一套类名。 */
.wc_vote { border-bottom: 1px solid var(--kio-border); display: flex; flex-direction: column; gap: 0.3rem; padding: 0.45rem 0.6rem; }
.wc_vote_head { align-items: center; display: flex; gap: 0.35rem; }
.wc_vote_label { color: var(--kio-text-dim); font-size: 0.7rem; }
.wc_vote_current { color: var(--kio-primary); font-size: 0.72rem; font-weight: 700; }
.wc_vote_btns { display: flex; flex-wrap: wrap; gap: 0.3rem; }
/* 未投的档位：描边按钮，与 wc_level_badge 同一质感。 */
.wc_vote_btn {
    background: var(--kio-panel-dark);
    border: 1px solid var(--kio-border);
    color: var(--kio-text);
    cursor: pointer;
    font-size: 0.68rem;
    padding: 0.2rem 0.4rem;
}
.wc_vote_btn:hover { border-color: var(--kio-primary); color: var(--kio-primary); }
/* 自己投的那档：实心高亮，一眼看出当前选择。 */
.wc_vote_btn.wc_vote_mine { background: var(--kio-primary); border-color: var(--kio-primary); color: #0e141e; font-weight: 700; }
.wc_vote_btn.wc_vote_mine:hover { background: var(--kio-primary-hover); border-color: var(--kio-primary-hover); color: #0e141e; }
/* 票数：跟在档位名后的小字，等宽数字避免跳动。 */
.wc_vote_n { font-variant-numeric: tabular-nums; opacity: 0.75; }

/* 个人主页 / 举报弹窗（扁平直角） */
.wc_profile_overlay { align-items: center; background: rgba(0,0,0,0.5); display: flex; inset: 0; justify-content: center; pointer-events: auto; position: fixed; z-index: 100; }
.wc_profile_card { background: var(--kio-panel); border: 1px solid var(--kio-border); box-shadow: none; display: flex; flex-direction: column; gap: 0.65rem; min-width: 16rem; padding: 1.2rem 1.3rem; width: 20rem; max-width: calc(100vw - 2rem); }
/* 顶部封面横幅：裁剪输出是 900×368（≈2.45:1）的横幅比例，所以按同比例留高，
   并用负 margin 抵掉卡片自身的 padding，让图片出血到卡片边缘。昵称/等级用
   justify-content:flex-end 压在横幅底部（那里有渐变压暗，保证可读）。
   无封面时不加 has_cover，退化成原来的普通块，布局不受影响。 */
.wc_profile_header { display: flex; flex-direction: column; gap: 0.25rem; }
.wc_profile_header.has_cover {
    aspect-ratio: 900 / 368;
    box-sizing: border-box;
    justify-content: flex-end;
    margin: -1.2rem -1.3rem 0;
    min-height: 6rem;
    padding: 1.3rem 1.3rem 0.7rem;
}
/* 封面上的文字可能压在亮色区域，加描边保证对比度。 */
.wc_profile_header.has_cover .wc_profile_name,
.wc_profile_header.has_cover .wc_profile_level { text-shadow: 0 1px 3px rgba(0,0,0,0.9); }
.wc_profile_name { align-items: center; display: flex; font-size: 1.1rem; font-weight: 800; gap: 0.5rem; flex-wrap: wrap; }
.wc_profile_org { color: #ffd873; font-style: italic; }
.wc_profile_alias { color: var(--kio-primary); }
.wc_profile_username { color: var(--kio-text-dim); font-size: 0.85rem; font-weight: 500; }
.wc_profile_level { font-size: 0.85rem; font-weight: 700; }
.wc_profile_stat { align-items: center; background: var(--kio-panel-dark); display: flex; justify-content: space-between; padding: 0.45rem 0.65rem; }
.wc_profile_stat span { color: var(--kio-text-dim); font-size: 0.8rem; }
.wc_profile_stat strong { color: var(--kio-primary); font-variant-numeric: tabular-nums; }
.wc_profile_actions { display: flex; gap: 0.5rem; margin-top: 0.2rem; }
.wc_profile_actions button { appearance: none; background: var(--kio-secondary); border: 0; color: #fff; cursor: pointer; flex: 1; font-family: inherit; font-size: 0.78rem; font-weight: 600; padding: 0.5rem 0.4rem; transition: background-color 0.15s ease; }
.wc_profile_actions button:hover { background: var(--kio-secondary-hover); }
.wc_profile_actions button:last-child { background: var(--kio-danger); }
.wc_profile_actions button:last-child:hover { background: var(--kio-danger-hover); }

/* 个性头衔徽章（显示在昵称后） */
.wc_title_badge { background: linear-gradient(135deg, #1a3a5c, #2563a8); border: 1px solid rgba(96,165,250,0.5); border-radius: 3px; color: #93c5fd; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; margin-left: 0.4rem; padding: 0.1rem 0.4rem; vertical-align: middle; white-space: nowrap; }

/* 头衔展示区 */
.wc_titles_section { background: rgba(0,0,0,0.25); border-top: 1px solid rgba(255,255,255,0.08); display: flex; flex-direction: column; gap: 0.4rem; padding: 0.5rem 0.65rem; }
.wc_titles_header { align-items: center; display: flex; justify-content: space-between; }
.wc_titles_label { color: var(--kio-text-dim); font-size: 0.78rem; }
.wc_titles_toggle { appearance: none; background: transparent; border: 1px solid rgba(96,165,250,0.4); border-radius: 3px; color: #93c5fd; cursor: pointer; font-family: inherit; font-size: 0.72rem; padding: 0.15rem 0.5rem; }
.wc_titles_toggle:hover { background: rgba(96,165,250,0.1); }
/* 头衔图片：900x383 → 缩略显示全宽 */
.wc_title_img { border-radius: 4px; display: block; max-width: 100%; object-fit: cover; width: 100%; }

/* 举报表单 */
.wc_report_area { appearance: none; background: var(--kio-panel-darker); border: 1px solid transparent; box-sizing: border-box; color: var(--kio-text); font-family: inherit; font-size: 0.86rem; outline: 0; padding: 0.6rem 0.7rem; resize: vertical; width: 100%; transition: border-color 0.15s ease; }
.wc_report_area:focus { border-color: var(--kio-primary); }
.wc_report_submit { appearance: none; background: var(--kio-danger); border: 0; color: #fff; cursor: pointer; font-family: inherit; font-size: 0.88rem; font-weight: 700; margin-top: 0.4rem; padding: 0.6rem; width: 100%; transition: background-color 0.15s ease; }
.wc_report_submit:hover:not(:disabled) { background: var(--kio-danger-hover); }
.wc_report_submit:disabled { background: var(--kio-secondary); cursor: not-allowed; }
.wc_report_result { color: #4ade80; font-size: 0.84rem; margin: 0; text-align: center; }

/* ---------- 右侧快捷操作板：离右缘留空；上下滑；默认收起 ---------- */
.kio_shortcuts {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: calc(100vh - 1rem);
    pointer-events: none;
    position: fixed;
    right: max(0.75rem, env(safe-area-inset-right, 0px));
    z-index: 15;
    touch-action: none;
    user-select: none;
}
.kio_shortcuts_toggle {
    align-items: center;
    appearance: none;
    background: #24324a;
    border: 1px solid rgba(52,172,224,0.35);
    box-shadow: none;
    color: #c8d8ea;
    cursor: ns-resize;
    display: inline-flex;
    flex-direction: column;
    gap: 0.35rem;
    justify-content: center;
    min-height: 2.8rem;
    min-width: 2.6rem;
    padding: 0.5rem 0.4rem;
    pointer-events: auto;
    touch-action: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.kio_shortcuts_toggle:active { cursor: grabbing; }
.kio_shortcuts_toggle:hover,
.kio_shortcuts_toggle.open {
    background: #32496e;
    border-color: rgba(52,172,224,0.7);
    color: #e8f3ff;
}
.kio_shortcuts_icon {
    display: block;
    flex-shrink: 0;
    height: 1.2rem;
    width: 1.2rem;
}
.kio_shortcuts_toggle_text {
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.1;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}
.kio_shortcuts_panel {
    animation: org_fade_in 0.24s ease both;
    background: rgba(22, 32, 44, 0.97);
    border: 1px solid rgba(52,172,224,0.22);
    border-right: 0;
    box-shadow: -8px 8px 24px rgba(0,0,0,0.35);
    box-sizing: border-box;
    max-height: min(78vh, calc(100vh - 1.25rem));
    max-width: min(19rem, calc(100vw - 3.2rem));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.7rem 0.75rem;
    pointer-events: auto;
    touch-action: pan-y;
    width: 18.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(52,172,224,0.45) rgba(0,0,0,0.2);
}
.kio_shortcuts_panel::-webkit-scrollbar { width: 6px; }
.kio_shortcuts_panel::-webkit-scrollbar-thumb {
    background: rgba(52,172,224,0.5); border-radius: 999px;
}
.kio_shortcuts_title {
    color: #e0e8f0;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
    text-align: center;
}
.kio_shortcuts_foot {
    border-top: 1px solid rgba(120,150,190,0.12);
    color: #8fa0b3;
    font-size: 0.7rem;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    text-align: center;
}

/* 快捷操作按钮 / 摇杆 */
.kio_sc_actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.kio_sc_btn {
    align-items: center;
    appearance: none;
    background: #1c2a3d;
    border: 1px solid rgba(52,172,224,0.28);
    color: #e8f3ff;
    cursor: pointer;
    display: flex;
    font-family: inherit;
    gap: 0.5rem;
    justify-content: space-between;
    min-height: 2.4rem;
    padding: 0.4rem 0.55rem;
    text-align: left;
    touch-action: manipulation;
    transition: background-color 0.12s ease, border-color 0.12s ease;
    width: 100%;
}
.kio_sc_btn:hover {
    background: #274063;
    border-color: rgba(52,172,224,0.55);
}
.kio_sc_btn:active {
    background: #1a334f;
}
.kio_sc_btn.armed {
    background: #1e4a3a;
    border-color: rgba(80, 220, 160, 0.55);
    color: #d6ffe8;
}
.kio_sc_btn.danger {
    border-color: rgba(224, 90, 90, 0.4);
}
.kio_sc_btn.danger:hover {
    background: #4a2430;
    border-color: rgba(224, 90, 90, 0.65);
}
.kio_sc_btn_label {
    font-size: 0.82rem;
    font-weight: 700;
}
.kio_sc_btn_key {
    background: rgba(52,172,224,0.12);
    border: 1px solid rgba(52,172,224,0.28);
    color: #9ec8e8;
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    min-width: 2.2rem;
    padding: 0.12rem 0.35rem;
    text-align: center;
}
.kio_sc_pad_label {
    color: #8fa0b3;
    font-size: 0.72rem;
    margin: 0.55rem 0 0.3rem;
    text-align: center;
}
.kio_sc_stick {
    background: radial-gradient(circle at center, rgba(40, 58, 82, 0.95) 0%, rgba(22, 32, 48, 0.98) 70%);
    border: 1px solid rgba(52,172,224,0.35);
    border-radius: 50%;
    box-sizing: border-box;
    cursor: grab;
    height: 9.2rem;
    margin: 0.15rem auto 0;
    position: relative;
    touch-action: none;
    user-select: none;
    width: 9.2rem;
}
.kio_sc_stick.active { cursor: grabbing; border-color: rgba(52,172,224,0.75); }
.kio_sc_stick_ring {
    border: 1px dashed rgba(52,172,224,0.28);
    border-radius: 50%;
    height: 62%;
    left: 50%;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 62%;
}
.kio_sc_stick_knob {
    background: linear-gradient(180deg, #5eb8e8, #2f7fb0);
    border: 2px solid rgba(232, 243, 255, 0.85);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
    height: 2.35rem;
    left: 50%;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 2.35rem;
    z-index: 2;
}
.kio_sc_stick_cross {
    color: rgba(200, 216, 234, 0.55);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    pointer-events: none;
    position: absolute;
}
.kio_sc_stick_n { left: 50%; top: 0.35rem; transform: translateX(-50%); }
.kio_sc_stick_s { bottom: 0.35rem; left: 50%; transform: translateX(-50%); }
.kio_sc_stick_w { left: 0.45rem; top: 50%; transform: translateY(-50%); }
.kio_sc_stick_e { right: 0.45rem; top: 50%; transform: translateY(-50%); }
.kio_sc_zoom {
    display: grid;
    gap: 0.35rem;
    grid-template-columns: 1fr 1fr;
    margin-top: 0.45rem;
}

@media (max-width: 760px) {
    .kio_shortcuts_panel {
        max-height: min(82vh, calc(100vh - 0.75rem));
        max-width: min(20rem, calc(100vw - 3rem));
        padding: 0.75rem;
        width: min(20rem, calc(100vw - 3rem));
    }
    .kio_sc_btn {
        min-height: 2.65rem;
        padding: 0.45rem 0.55rem;
    }
    .kio_sc_btn_label {
        font-size: 0.88rem;
        white-space: nowrap;
    }
    .kio_sc_stick {
        height: 10rem;
        width: 10rem;
    }
    .kio_shortcuts_toggle {
        gap: 0.3rem;
        min-height: 3.4rem;
        min-width: 2.75rem;
        padding: 0.45rem 0.35rem;
    }
    .kio_shortcuts_toggle_text {
        font-size: 0.62rem;
        letter-spacing: 0.1em;
    }
    .kio_top_banner_host {
        /* 手机：内容从物理顶开始，不再额外空出刘海/状态栏一块 */
        padding: 0 0.25rem 0.15rem;
    }
    .kio_top_bar { gap: 0.3rem; }
    .kio_top_bar_main { padding-top: 0; }
    .kio_top_bar_side {
        /* 与上方手机规则一致：侧栏不裁切，展开榜用 fixed */
        max-height: none;
        max-width: min(48vw, 11rem);
        overflow: visible;
        padding-top: 0;
    }
    .kio_top_bar_side #leaderboard table {
        max-height: none;
    }
    .org_sb_body, .plb_body {
        position: absolute;
        right: 0;
        top: calc(100% + 0.25rem);
        width: min(18rem, calc(100vw - 1rem));
        max-width: calc(100vw - 1rem);
        max-height: min(70dvh, calc(100dvh - 9rem));
        z-index: 46;
        box-sizing: border-box;
    }
    .kio_alert_chip { font-size: 0.72rem; white-space: normal; }
    .kio_shortcuts {
        right: max(0.75rem, env(safe-area-inset-right, 0px));
    }
    .wc_toggle {
        left: max(0.75rem, env(safe-area-inset-left, 0px));
        border-left: 1px solid rgba(52,172,224,0.35);
    }
    .wc_classic_win {
        max-width: min(17rem, calc(100vw - 1.5rem));
        width: min(17rem, calc(100vw - 1.5rem));
    }
    /* 菜单上移，避免与右下角坐标重叠 */
    #nexus_icons {
        bottom: 1.85rem !important;
        right: 0.55rem !important;
    }
}

/* 坐标显示：右下角固定小字，不遮挡操作。 */
/* Esc 暂停菜单置于最上层，避免被聊天/抽屉等遮挡导致「退出」点不了。
   菜单未打开时组件会卸载；打开时只让按钮可点，避免全屏 Positioner 吞掉画布拖兵。 */
#escape_menu {
    pointer-events: none;
    z-index: 10050;
}
#escape_menu button {
    pointer-events: auto;
}

.kio_coords {
    bottom: 0.4rem;
    color: rgba(255,255,255,0.45);
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
    position: fixed;
    right: 0.5rem;
    user-select: none;
    z-index: 10;
}

/* 菜单按钮略抬高，避免与坐标文字叠在一起 */
#nexus_icons {
    bottom: 1.65rem !important;
}

/* 塔菜单 / 通用 UI 按钮：必须可点，否则点击穿透到地图 */
.kio_tower_menu,
.kio_ui_btn,
.kio_box_upgrade {
    pointer-events: auto !important;
    z-index: 50;
}

/* ============ 通用左侧滑出抽屉（指挥官档案 / 组织中心）— 全高半宽直角 ============ */
.kio_drawer {
    background: #0e141e;
    border: 1px solid rgba(52,172,224,0.25);
    border-left: 0;
    box-shadow: none;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 50vw;
    overflow: hidden;
    /* 收起时不拦点击，否则可能盖住 Esc 菜单的「退出」 */
    pointer-events: none;
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.22,0.61,0.36,1);
    z-index: 92;
}
.kio_drawer.open {
    transform: translateX(0);
    pointer-events: auto;
}
.kio_drawer_header {
    align-items: center;
    display: flex;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(52,172,224,0.18);
    flex-shrink: 0;
    background: rgba(20,30,44,0.9);
}
.kio_drawer_title { color: #e0e8f0; font-size: 1rem; font-weight: 700; flex: 1; letter-spacing: 0.02em; }
.kio_drawer_close {
    appearance: none; background: transparent; border: 0; color: #8fa0b3;
    cursor: pointer; font-size: 1.3rem; font-weight: 400; line-height: 1;
    padding: 0 0.2rem; transition: color 0.12s ease;
}
.kio_drawer_close:hover { color: #ef4444; }
.kio_drawer_body {
    /* flex:1 + height:0：强制吃掉剩余高度，否则子内容撑开后被父 overflow:hidden 裁切且自身不出现滚动条 */
    flex: 1 1 0;
    height: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scrollbar-width: thin;
    scrollbar-color: rgba(52,172,224,0.3) transparent;
}
.kio_drawer_body::-webkit-scrollbar { width: 5px; }
.kio_drawer_body::-webkit-scrollbar-thumb { background: rgba(52,172,224,0.3); }

/* 内嵌版指挥官档案：去除全屏 fixed，融入抽屉主体 */
.ucp_embedded {
    background: transparent;
    box-sizing: border-box;
    color: #f5f5f7;
    width: 100%;
}
.ucp_embedded .user_center_page_main { max-width: none; margin: 0; padding: 1.25rem; gap: 1.1rem; }
.ucp_embedded .ucp_card { border-radius: 0; }
.ucp_embedded .ucp_form input { border-radius: 0; }

/* 内嵌版组织中心：铺满抽屉宽度 */
.kio_drawer_body .org_center { box-sizing: border-box; width: 100%; max-width: none; padding: 1.25rem; }

/* ── 聊天 @提及 ──────────────────────────────────────────────────────────── */
/* 被@到我：整行高亮（金色左边框 + 淡黄底） */
.wc_msg_at_me {
    background: rgba(255, 200, 60, 0.14);
    border-left: 3px solid #f5c542;
    border-radius: 4px;
    padding-left: 4px;
}
/* 消息里的 @昵称 token */
.wc_mention { color: #4db2ff; font-weight: 600; }
.wc_msg_at_me .wc_mention { color: #ffd561; }
/* 未读@红点徽标（聊天按钮 / 经典窗标题） */
.wc_at_badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 16px; height: 16px; padding: 0 3px; margin-left: 4px;
    border-radius: 8px; background: #e5484d; color: #fff;
    font-size: 11px; font-weight: 700; line-height: 1;
    animation: wc_at_pulse 1.2s ease-in-out infinite;
}
@keyframes wc_at_pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.18); } }
/* @ 候选下拉（挂在输入行上方） */
.wc_input_row, .wc_classic_input_row { position: relative; }
.wc_mention_dd {
    position: absolute; left: 6px; right: 6px; bottom: 100%; margin-bottom: 4px;
    background: rgba(16, 24, 38, 0.96); border: 1px solid #2c3a52; border-radius: 8px;
    overflow: hidden; z-index: 30; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    display: flex; flex-direction: column; max-height: 220px; overflow-y: auto;
}
.wc_mention_dd_item {
    text-align: left; padding: 6px 10px; background: transparent; border: none;
    color: #dbe6f5; font-size: 13px; cursor: pointer;
}
.wc_mention_dd_item:hover { background: #22406b; color: #fff; }
.wc_mention_dd_item.wc_mention_all { color: #ffd561; font-weight: 600; }
/* 「只看@我」开关激活态 */
.wc_mini_active { color: #ffd561 !important; border-color: #ffd561 !important; }

/* 等级进度条（聊天个人主页） */
.wc_profile_xp { display: flex; flex-direction: column; gap: 0.2rem; margin-top: 0.15rem; }
.wc_profile_xp_track { background: var(--kio-panel-darker); border-radius: 2px; height: 0.4rem; overflow: hidden; }
.wc_profile_xp_fill { height: 100%; transition: width 0.3s ease; }
.wc_profile_xp_label { color: var(--kio-text-dim); font-size: 0.72rem; font-variant-numeric: tabular-nums; }
.wc_profile_xp_label span { opacity: 0.75; }
.wc_profile_xp_max { color: var(--kio-primary); font-weight: 700; }

/* 等级进度（指挥官档案「我的等级」卡片） */
.ucp_level_name { font-size: 1rem; font-weight: 800; margin-bottom: 0.4rem; }
.ucp_level_track { background: var(--kio-panel-darker); border-radius: 3px; height: 0.5rem; overflow: hidden; }
.ucp_level_fill { height: 100%; transition: width 0.3s ease; }
.ucp_level_label { color: var(--kio-text-dim); font-size: 0.8rem; margin-top: 0.3rem; font-variant-numeric: tabular-nums; }
.ucp_level_label span { opacity: 0.75; }

/* 不要抬高 #canvas 的 z-index：会盖住 #nexus_icons 等菜单，并让模糊层铺满全屏。
   手机拖兵靠 v10「排除交互 UI」分流，不依赖 canvas 叠在 HUD 上面。 */
#canvas {
    touch-action: none;
}

/* 右下角菜单（暂停/设置等）必须在 canvas 之上 */
#nexus_icons {
    pointer-events: auto !important;
    z-index: 60 !important;
}

/* 引擎 ChatOverlay：容器穿透，仅输入/消息可点 */
#chat {
    pointer-events: none !important;
}
#chat input,
#chat button,
#chat a,
#chat .message {
    pointer-events: auto !important;
}

/* 左下入口：容器穿透，按钮可点 */
.corner_entries {
    pointer-events: none;
}
.corner_entries > * {
    pointer-events: auto;
}

/* 顶栏榜容器必须 none */
.kio_top_bar_side > .org_scoreboard,
.kio_top_bar_side > .plb_float {
    pointer-events: none !important;
}
.org_sb_toggle,
.org_sb_body,
.plb_toggle,
.plb_body {
    pointer-events: auto !important;
}

/* 收起抽屉时子孙也不能偷触控（parent none 时 child auto 仍可命中） */
.kio_drawer:not(.open) *,
.wc_drawer:not(.open) * {
    pointer-events: none !important;
}

/* 阿里云验证码弹层必须可点；mask 低于 window，与 index.html 一致 */
[id^="kio-aliyun-captcha"],
.aliyun-captcha,
div[class*="aliyun"][class*="captcha"] {
    pointer-events: auto !important;
}
#aliyunCaptcha-masking,
[id^="aliyunCaptcha-mask"] {
    pointer-events: auto !important;
    z-index: 2147483646 !important;
}
#aliyunCaptcha-window-popup,
[id^="aliyunCaptcha-window"] {
    pointer-events: auto !important;
    z-index: 2147483647 !important;
}
/* 账号 Curtain 半透明黑底在验证码期间不可点 */
body.kio-captcha-open *:has(> #dialog_frame),
body.kio-captcha-open #dialog_frame,
body.kio-captcha-open #dialog_content {
    pointer-events: none !important;
}
body.kio-captcha-open [id^="aliyunCaptcha"],
body.kio-captcha-open [id^="kio-aliyun-captcha"],
body.kio-captcha-open [class*="aliyunCaptcha"] {
    pointer-events: auto !important;
}

