/* ===== iOS 原生极简 Light Mode 风格 - 通用UI样式 ===== */

/* ---------- CSS 变量 ---------- */
:root {
    --ios-bg: #F2F2F7;
    --ios-card: #FFFFFF;
    --ios-text: #1C1C1E;
    --ios-text-secondary: #8E8E93;
    --ios-border: #E5E5EA;
    --ios-blue: #007AFF;
    --ios-green: #34C759;
    --ios-red: #FF3B30;
    --ios-orange: #FF9500;
    --ios-separator: #E5E5EA;
    --ios-nav-bg: rgba(255,255,255,0.85);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.04);
    --radius-card: 16px;
    --radius-input: 10px;
    --radius-button: 10px;
    --ui-ease-out: cubic-bezier(.2,.8,.2,1);
    --ui-ease-spring: cubic-bezier(.2,1.2,.2,1);
    --ui-dur-fast: 160ms;
    --ui-dur: 220ms;
    --ui-dur-slow: 360ms;
}

/* ---------- 全局重置 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
html { -webkit-text-size-adjust: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
    background: var(--ios-bg);
    color: var(--ios-text);
    line-height: 1.5;
    overflow-x: hidden;
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
}

img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

/* ---------- 容器 ---------- */
.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 16px 16px calc(84px + env(safe-area-inset-bottom));
}

/* ---------- 卡片 ---------- */
.card {
    background: var(--ios-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 16px;
    margin-bottom: 12px;
    border: none;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ios-text);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--ios-separator);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---------- 用户信息 ---------- */
.user-info {
    padding: 8px 0;
}
.user-info p {
    margin-bottom: 10px;
    font-size: 15px;
    color: var(--ios-text-secondary);
}

/* ---------- 徽章 ---------- */
.badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--ios-blue);
    color: #fff;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    margin-left: 6px;
}

/* ---------- 表单 ---------- */
.form-input, .form-control {
    width: 100%;
    padding: 12px 14px;
    border: none;
    border-radius: var(--radius-input);
    font-size: 16px;
    background: #F2F2F7;
    color: var(--ios-text);
    transition: background .2s ease, box-shadow .2s ease;
    margin-bottom: 12px;
    -webkit-appearance: none;
}
.form-input::placeholder, .form-control::placeholder { color: #8E8E93; }

.form-input:focus, .form-control:focus {
    outline: none;
    background: #FFFFFF;
    box-shadow: 0 0 0 2px rgba(0,122,255,0.15);
}

/* ---------- 切换开关（iOS） ---------- */
.toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #E5E5EA;
    transition: .25s;
    border-radius: 31px;
}
.toggle-slider::before {
    position: absolute;
    content: "";
    height: 27px;
    width: 27px;
    left: 2px;
    bottom: 2px;
    background-color: #fff;
    transition: .25s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
input:checked + .toggle-slider {
    background-color: var(--ios-green);
}
input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-button);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .15s ease, transform .15s ease;
    text-decoration: none;
    text-align: center;
    -webkit-appearance: none;
    user-select: none;
}
.btn:active { opacity: 0.7; transform: scale(0.98); }

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.btn-primary {
    background: var(--ios-blue);
    color: #fff;
}

.btn-secondary {
    background: #F2F2F7;
    color: var(--ios-blue);
}

.btn-danger {
    background: var(--ios-red);
    color: #fff;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    margin-left: 0;
    border-radius: 8px;
}

/* ---------- 复制按钮组 ---------- */
.copy-btn-group {
    display: flex;
    gap: 0.5rem;
}
.copy-btn-group .btn {
    flex: 1;
}

/* ---------- 帮助文本 ---------- */
.help-text {
    color: var(--ios-text-secondary);
    font-size: 13px;
    margin-bottom: 10px;
    line-height: 1.4;
}

/* ---------- 警告文本 ---------- */
.text-warning {
    color: var(--ios-orange);
    font-size: 14px;
    margin-top: 8px;
}

/* ---------- 消息提示 ---------- */
.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 14px;
    animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success {
    background: rgba(52,199,89,0.08);
    color: #1D7A3A;
}

.alert-error {
    background: rgba(255,59,48,0.08);
    color: var(--ios-red);
}

/* ---------- 数据表格 ---------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}
.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--ios-separator);
}
.data-table th {
    background: var(--ios-bg);
    font-weight: 600;
    color: var(--ios-text-secondary);
    font-size: 13px;
}
.data-table tr:hover {
    background: var(--ios-bg);
}

/* ---------- 空状态 ---------- */
.empty-state {
    text-align: center;
    padding: 32px;
    color: var(--ios-text-secondary);
}

/* ---------- 页头 ---------- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ios-separator);
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--ios-text);
}

.logout-btn {
    font-size: 14px;
    color: var(--ios-blue);
    text-decoration: none;
    font-weight: 500;
}
.logout-btn:active { opacity: 0.5; }

/* ---------- 底部导航（iOS Tab Bar） ---------- */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: calc(50px + env(safe-area-inset-bottom));
    padding: 4px 0 calc(env(safe-area-inset-bottom));
    background: rgba(255,255,255,0.72);
    border-top: 0.5px solid rgba(0,0,0,0.08);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    z-index: 20000;
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
}

.bottom-nav .nav-item {
    flex: 1;
    max-width: 120px;
    height: 46px;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    padding-top: 4px;
    color: #8E8E93;
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease;
    background: transparent;
}

.bottom-nav .nav-item svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bottom-nav .nav-item.active {
    color: var(--ios-blue);
    background: transparent;
}

/* 底部导航滑动高亮胶囊 */
.bottom-nav { position: fixed; }
.bottom-nav::before {
    content: '';
    pointer-events: none;
    position: absolute;
    left: var(--ui-ind-left, 6px);
    top: 6px;
    height: 44px;
    width: var(--ui-ind-width, calc((100% - 18px) / 3));
    border-radius: 999px;
    background: rgba(0,122,255,0.10);
    transition: left 260ms ease, width 260ms ease;
}
.bottom-nav .nav-item { position: relative; z-index: 1; }
.bottom-nav .nav-item.active {
    background: transparent;
    color: var(--ios-blue);
}

/* ---------- 按钮涟漪 ---------- */
.btn {
    position: relative;
    overflow: hidden;
    will-change: transform;
}
.btn:active {
    transform: translateY(1px) scale(.99);
}
.btn .ui-ripple {
    position: absolute;
    border-radius: 999px;
    transform: scale(0);
    opacity: .25;
    pointer-events: none;
    background: currentColor;
    animation: uiRipple 520ms ease forwards;
    mix-blend-mode: multiply;
}
@keyframes uiRipple {
    to { transform: scale(3.4); opacity: 0; }
}

/* ---------- 按钮 Loading ---------- */
.btn.is-loading {
    cursor: progress;
}
.btn.is-loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,.55);
    border-top-color: rgba(255,255,255,.95);
    display: inline-block;
    margin-left: 8px;
    vertical-align: -2px;
    animation: uiSpin .9s linear infinite;
}
.btn.btn-secondary.is-loading::after,
.btn.btn-light.is-loading::after {
    border-color: rgba(0,0,0,0.15);
    border-top-color: rgba(0,0,0,0.5);
}
@keyframes uiSpin {
    to { transform: rotate(360deg); }
}

/* ---------- Toast 提示（iOS 风格） ---------- */
.ui-toast-wrap {
    position: fixed;
    left: 50%;
    top: calc(14px + env(safe-area-inset-top));
    transform: translateX(-50%);
    z-index: 35000;
    width: min(560px, calc(100% - 24px));
    pointer-events: none;
}
.ui-toast {
    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px 14px;
    border-radius: var(--radius-card);
    background: rgba(255,255,255,.92);
    border: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    opacity: 0;
    transform: translateY(-10px) scale(.985);
    transition: opacity 220ms ease, transform 220ms ease;
}
.ui-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.ui-toast.success { border-left: 3px solid var(--ios-green); }
.ui-toast.error { border-left: 3px solid var(--ios-red); }

.ui-toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex: 0 0 auto;
    margin-top: 1px;
}
.ui-toast.success .ui-toast-icon { background: rgba(52,199,89,0.12); color: var(--ios-green); }
.ui-toast.error .ui-toast-icon { background: rgba(255,59,48,0.12); color: var(--ios-red); }

.ui-toast-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ios-text);
    line-height: 1.2;
}
.ui-toast-msg {
    margin-top: 2px;
    font-size: 13px;
    color: var(--ios-text-secondary);
    line-height: 1.35;
    word-break: break-word;
}
.ui-toast-close {
    position: absolute;
    right: 10px;
    top: 10px;
    border: none;
    background: transparent;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: var(--ios-text-secondary);
}
.ui-toast-close:active { transform: scale(.96); }

.ui-toast-progress {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 8px;
    height: 3px;
    border-radius: 999px;
    background: var(--ios-separator);
    overflow: hidden;
}
.ui-toast-progress > i {
    display: block;
    height: 100%;
    width: 100%;
    transform-origin: left;
    animation: uiToastProgress 1800ms linear forwards;
    background: var(--ios-blue);
}
.ui-toast.error .ui-toast-progress > i {
    background: var(--ios-red);
}
@keyframes uiToastProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* ---------- 弹窗出现动画 ---------- */
#pubgUnlockModal > div,
#recharge-modal > div {
    animation: uiModalPop 220ms ease both;
}
@keyframes uiModalPop {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- 卡片切换动画 ---------- */
.ui-card-appear {
    animation: uiCardIn var(--ui-dur-slow) var(--ui-ease-out) both;
}
@keyframes uiCardIn {
    from { opacity: 0; transform: translateY(14px) scale(.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- 更新记录富文本 ---------- */
.update-rich-content p { margin: 0 0 10px; }
.update-rich-content p:last-child { margin-bottom: 0; }
.update-rich-content img {
    max-width: min(100%, 460px);
    max-height: 300px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    display: block;
    margin: 8px 0;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}
.update-rich-content a {
    color: var(--ios-blue);
    text-decoration: underline;
    word-break: break-all;
}
.update-rich-content ul,
.update-rich-content ol { padding-left: 22px; margin: 8px 0; }
.update-rich-content li { margin: 4px 0; }
.update-rich-content h1,
.update-rich-content h2,
.update-rich-content h3,
.update-rich-content h4 {
    margin: 0 0 10px;
    color: var(--ios-text);
    line-height: 1.4;
}
.update-rich-content blockquote {
    margin: 8px 0;
    padding: 10px 12px;
    border-left: 4px solid var(--ios-border);
    background: var(--ios-bg);
    border-radius: 10px;
    color: var(--ios-text-secondary);
}

/* ---------- 其他配置标签 ---------- */
.other-config-tab {
    border: none;
    background: var(--ios-border);
    color: var(--ios-text-secondary);
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s ease;
}
.other-config-tab.is-active {
    background: var(--ios-blue);
    color: #fff;
}
.other-config-pane {
    max-height: 55vh;
    overflow: auto;
    padding-right: 2px;
}

/* ---------- 抽奖表格响应式（移动端卡片化） ---------- */
@media (max-width: 640px) {
    #lotteryPrizeTbody tr {
        display: flex !important;
        flex-direction: column !important;
        padding: 0 !important;
        margin-bottom: 0 !important;
        background: transparent !important;
        border: none !important;
    }
    #lotteryPrizeTbody tr > * {
        display: flex !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    #lotteryPrizeTbody td[data-label] {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 0.4rem 0 !important;
        border-bottom: 1px solid var(--ios-separator) !important;
    }
    #lotteryPrizeTbody td[data-label]::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--ios-text-secondary);
        font-size: 0.78rem;
        min-width: 60px;
        flex: 0 0 auto;
    }
    #lotteryPrizeTbody td[data-label="预览"] { padding: 0.3rem 0 !important; }
    #lotteryPrizeTbody td[data-label="预览"]::before { display: none; }
    #lotteryPrizeTbody td[data-label="必中"],
    #lotteryPrizeTbody td[data-label="操作"] {
        justify-content: flex-start !important;
        gap: 12px !important;
    }
    .lotteryPrizeUploadBtn {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.78rem !important;
    }
    #lotteryPrizeTbody td[data-label="颜色（可选）"] > div {
        flex-wrap: wrap !important;
    }
}

/* ---------- 通用弹窗（Modal）系统 ---------- */
.ui-modal-shell,
.template-modal-overlay,
#recharge-modal,
#data-modal,
#pubgUnlockModal,
#genericTplUnlockModal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 30000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0,0,0,0.35) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    backdrop-filter: blur(10px) !important;
    padding: 20px !important;
    overflow: auto !important;
}

.ui-modal-card,
#recharge-modal > div,
#data-modal > div,
#pubgUnlockModal > div,
#genericTplUnlockModal > div,
.template-modal {
    background: var(--ios-card) !important;
    border: none !important;
    border-radius: var(--radius-card) !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.12) !important;
    width: min(100%, 420px) !important;
    max-width: min(100%, 420px) !important;
    padding: 18px !important;
    position: relative !important;
    animation: uiModalPop 220ms ease both;
}

.ui-modal-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    margin: 0 0 16px 0 !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid var(--ios-separator) !important;
}

.ui-modal-head h3,
#recharge-modal h3,
#data-modal h3 {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: var(--ios-text) !important;
}

.ui-modal-close {
    width: 38px !important;
    height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid var(--ios-separator) !important;
    border-radius: 12px !important;
    background: var(--ios-card) !important;
    color: var(--ios-text-secondary) !important;
    font-size: 22px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.ui-modal-close:hover,
#recharge-modal button[aria-label="关闭"]:hover,
#data-modal button[aria-label="关闭"]:hover {
    background: var(--ios-bg) !important;
    color: var(--ios-text) !important;
    border-color: var(--ios-border) !important;
}

.ui-modal-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
}

.ui-modal-tip {
    padding: 10px 12px !important;
    border-radius: var(--radius-input) !important;
    background: var(--ios-bg) !important;
    color: var(--ios-text-secondary) !important;
    border: none !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
}

.ui-modal-actions,
#recharge-modal form > div:last-child,
#data-modal form > div:last-child {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    margin-top: 18px !important;
    padding-top: 14px !important;
    border-top: 1px solid var(--ios-separator) !important;
}

.ui-modal-btn,
#recharge-modal .modal-btn,
#data-modal .modal-btn {
    min-width: 104px !important;
    height: 42px !important;
    padding: 0 16px !important;
    border-radius: var(--radius-button) !important;
    font-weight: 700 !important;
    border: none !important;
    background: var(--ios-blue) !important;
    color: #fff !important;
    cursor: pointer !important;
}

.ui-modal-btn-ghost,
#recharge-modal .modal-btn-ghost,
#data-modal .modal-btn-ghost {
    background: #F2F2F7 !important;
    color: var(--ios-blue) !important;
    border: none !important;
}

.ui-modal-btn:hover,
#recharge-modal .modal-btn:hover,
#data-modal .modal-btn:hover { opacity: 0.9 !important; }

.ui-modal-btn-ghost:hover,
#recharge-modal .modal-btn-ghost:hover,
#data-modal .modal-btn-ghost:hover {
    background: #E5E5EA !important;
    color: var(--ios-blue) !important;
    border: none !important;
}

.ui-modal-form textarea,
.ui-modal-form input[type="text"],
.ui-modal-form input[type="password"],
.ui-modal-form input[type="email"],
#recharge-modal textarea {
    width: 100% !important;
    border: none !important;
    border-radius: var(--radius-input) !important;
    background: #F2F2F7 !important;
    color: var(--ios-text) !important;
    padding: 12px 14px !important;
    outline: none !important;
    box-shadow: none !important;
}

.ui-modal-form textarea:focus,
.ui-modal-form input[type="text"]:focus,
.ui-modal-form input[type="password"]:focus,
.ui-modal-form input[type="email"]:focus,
#recharge-modal textarea:focus {
    box-shadow: 0 0 0 2px rgba(0,122,255,0.15) !important;
}

@media (max-width: 640px) {
    .ui-modal-shell,
    #recharge-modal,
    #data-modal,
    .template-modal-overlay,
    #genericTplUnlockModal {
        padding: 14px 12px calc(92px + env(safe-area-inset-bottom)) !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .ui-modal-card,
    #recharge-modal > div,
    #data-modal > div,
    #genericTplUnlockModal > div,
    .template-modal {
        width: min(100%, 560px) !important;
        max-width: min(100%, 560px) !important;
        border-radius: var(--radius-card) !important;
        max-height: calc(100vh - 108px - env(safe-area-inset-bottom)) !important;
        padding: 16px !important;
    }
    .ui-modal-actions,
    #recharge-modal form > div:last-child,
    #data-modal form > div:last-child { justify-content: stretch !important; }
    .ui-modal-btn,
    #recharge-modal .modal-btn,
    #data-modal .modal-btn { flex: 1 1 0 !important; width: 100% !important; }
}

/* ---------- 响应式适配 ---------- */
@media (max-width: 480px) {
    .container {
        padding: 0.75rem;
    }
    .card {
        padding: 1rem;
    }
    .copy-btn-group {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- iOS 最终全局覆盖（高优先级） ---------- */
html body {
    background: var(--ios-bg) !important;
    color: var(--ios-text) !important;
}
body::before,
body::after {
    display: none !important;
    content: none !important;
}

body .main-shell,
body .dashboard-shell,
body .card,
body .quick-panel,
body .ui-modal-card,
body .invite-card,
body .summary-card,
body .stat-card,
body .sub-card,
body .modal-card,
body .table-wrap,
body .main-card,
body .panel,
body .content-card,
body .sidebar-card,
body .module-card,
body .order-panel,
body .search-panel,
body .account-card,
body .list-card,
body .notice-card,
body .games-panel,
body .dialog-card,
body .popup-card,
body .user-card {
    background: var(--ios-card) !important;
    border: none !important;
    box-shadow: var(--shadow-card) !important;
    border-radius: var(--radius-card) !important;
}

body button,
body .btn,
body .primary-btn,
body .submit-btn,
body .action-btn {
    background: var(--ios-blue) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: none !important;
}
body button:active,
body .btn:active,
body .primary-btn:active,
body .submit-btn:active,
body .action-btn:active {
    opacity: 0.7 !important;
    transform: scale(0.98) !important;
}
body .btn-secondary,
body .btn-ghost,
body .secondary-btn,
body .ghost-btn {
    background: #F2F2F7 !important;
    color: var(--ios-blue) !important;
    border: none !important;
}
body .btn-danger,
body .danger-btn {
    background: var(--ios-red) !important;
    color: #fff !important;
    border: none !important;
}
body .btn-success,
body .success-btn {
    background: var(--ios-green) !important;
    color: #fff !important;
    border: none !important;
}
body input,
body select,
body textarea,
body .search-input,
body .form-control {
    background: #F2F2F7 !important;
    border: none !important;
    color: var(--ios-text) !important;
    border-radius: var(--radius-input) !important;
}
body input:focus,
body select:focus,
body textarea:focus,
body .form-control:focus {
    box-shadow: 0 0 0 2px rgba(0,122,255,0.15) !important;
}
body .nav-tab,
body .tab,
body .tab-item,
body .menu-item,
body .chip,
body .game-chip,
body .quick-chip,
body .badge,
body .meta-pill,
body .current-template-state-badge,
body .tpl-card-short-badge {
    background: #F2F2F7 !important;
    color: var(--ios-text) !important;
    border: none !important;
}
body .nav-tab.active,
body .tab.active,
body .tab-item.active,
body .menu-item.active,
body .chip.active,
body .game-chip.active,
body .quick-chip.active,
body .game-chip:hover,
body .quick-chip:hover {
    background: rgba(0,122,255,0.08) !important;
    color: var(--ios-blue) !important;
}

/* ---------- 个人中心页面布局 ---------- */
.profile-simple-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.profile-simple-top {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.profile-simple-avatar-wrap {
    width: 80px;
    height: 80px;
    flex: 0 0 80px;
    border-radius: 20px;
    overflow: hidden;
    border: none;
    background: #E5E5EA;
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-avatar,
.profile-avatar-lg,
.profile-simple-avatar {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    display: block !important;
    object-fit: cover !important;
    border-radius: 0 !important;
    overflow: hidden !important;
}
.profile-avatar-fallback {
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--ios-blue);
    background: #E5E5EA;
}
.profile-simple-meta {
    flex: 1 1 240px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.profile-simple-name {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ios-text);
    word-break: break-word;
}
.profile-simple-email,
.profile-simple-id,
.profile-simple-desc {
    font-size: 14px;
    color: var(--ios-text-secondary);
    word-break: break-all;
}
.profile-balance-card {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-card);
    background: var(--ios-card);
    box-shadow: var(--shadow-card);
}
.profile-balance-label {
    font-size: 14px;
    color: var(--ios-text-secondary);
    display: block;
}
.profile-balance-value {
    font-size: 32px;
    line-height: 1;
    font-weight: 700;
    color: var(--ios-blue);
    display: block;
}
.profile-action-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}
.profile-action-tile {
    display: flex !important;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 14px;
    border-radius: 14px;
    background: var(--ios-card);
    color: var(--ios-text) !important;
    text-decoration: none !important;
    box-shadow: var(--shadow-card);
    transition: transform .15s ease, opacity .15s ease;
}
.profile-action-tile:active {
    transform: scale(0.98);
    opacity: 0.8;
}
.profile-action-tile i {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,122,255,0.08);
    color: var(--ios-blue);
    font-size: 16px;
}
.profile-action-tile span {
    display: block;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-word;
}
.profile-action-tile.is-locked {
    background: #F2F2F7 !important;
    color: var(--ios-text-secondary) !important;
    border: none !important;
    box-shadow: none !important;
    opacity: .7;
}
.profile-action-tile.is-locked:active { transform: none !important; }
.profile-action-tile.is-locked i {
    background: #E5E5EA !important;
    color: var(--ios-text-secondary) !important;
}
.profile-action-tile-note {
    display: block;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--ios-text-secondary);
    margin-top: 2px;
}

.simple-security-card .data-table,
.simple-security-card table {
    table-layout: fixed;
    width: 100%;
}
.simple-security-card td,
.simple-security-card th { word-break: break-word; }

#recharge-modal textarea { min-height: 132px; }
#gameQuickChips { display: none !important; }
#quickSettingsForm .game-picker-panel .help-text { display: none !important; }
#appidSelect { margin-top: 0 !important; }

@media (max-width: 768px) {
    .profile-simple-top { align-items: flex-start; }
    .profile-simple-avatar-wrap { width: 72px; height: 72px; flex-basis: 72px; border-radius: 18px; }
    .profile-simple-name { font-size: 20px; }
    .profile-balance-card { padding: 14px; }
    .profile-balance-value { font-size: 28px; }
    .profile-action-grid { grid-template-columns: 1fr !important; }
    .profile-action-tile { padding: 12px; }
}
