/* ============================================================
   APEX AI 算力云 · 深色科技风主题
   覆盖原有微盘交易皮肤，统一为 AI 算力租赁视觉
   引入方式：在 head.html / head2.html 中于其他 CSS 之后引入
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root,
html {
    --ai-bg: #0b0e22;                 /* 页面主背景 */
    --ai-bg-2: #10142e;               /* 次级背景 */
    --ai-surface: rgba(24, 26, 58, .72);      /* 卡片面 */
    --ai-surface-solid: #161a3a;              /* 实色卡片 */
    --ai-border: rgba(139, 92, 246, .28);     /* 描边 */
    --ai-text: #e9ecf8;               /* 主文字 */
    --ai-text-2: #94a0c8;             /* 次文字 */
    --ai-primary: #8b5cf6;            /* 主色·紫 */
    --ai-accent: #4f7cff;             /* 强调·蓝 */
    --ai-gradient: linear-gradient(135deg, #4f7cff 0%, #8b5cf6 60%, #a855f7 100%);
    --ai-glow: 0 0 14px rgba(139, 92, 246, .40);
    --ai-radius: 14px;
}

/* ---------- 全局 ---------- */
html,
body,
body.grade-a {
    background: var(--ai-bg) !important;
    color: var(--ai-text) !important;
}

body {
    background-image:
        radial-gradient(60% 40% at 85% -5%, rgba(99, 102, 241, .18) 0%, transparent 60%),
        radial-gradient(50% 35% at 0% 0%, rgba(139, 92, 246, .14) 0%, transparent 55%) !important;
    background-attachment: fixed !important;
    font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", -apple-system, sans-serif !important;
}

#container,
.scroll-content,
.content-background,
.pane,
.view-container,
ion-view,
ion-content,
ion-nav-view {
    background: transparent !important;
    color: var(--ai-text);
}

/* 文本色 */
body,
p, dt, dd, li, span, em, h1, h2, h3, h4, h5, .title {
    color: var(--ai-text);
}

a {
    color: var(--ai-primary);
}

/* ---------- 顶部导航 ---------- */
.bar-stable,
.headerbar,
.bar.bar-header,
.nav-bar-container,
.bar-header {
    background: rgba(10, 14, 26, .82) !important;
    border-bottom: 1px solid var(--ai-border) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header .header-right .language {
    color: var(--ai-text-2);
}

.header ul {
    background: var(--ai-surface-solid) !important;
    border: 1px solid var(--ai-border);
    border-radius: 10px;
}

/* ---------- 底部标签栏 ---------- */
.tab-nav.tabs,
.tabs-bottom .tabs {
    background: rgba(13, 20, 36, .92) !important;
    border-top: 1px solid var(--ai-border) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.tab-nav .tab-item .tab-title,
.tabs .tab-item .tab-title {
    color: var(--ai-text-2) !important;
}

.tab-nav .tab-item-active .tab-title,
.tabs .tab-item-active .tab-title {
    color: var(--ai-primary) !important;
    text-shadow: var(--ai-glow);
}

/* ---------- 首页 ---------- */
.home .bannar img,
.swiper-slide img {
    border-radius: var(--ai-radius);
}

/* 公告条 */
.notice-w .notice {
    background: var(--ai-surface) !important;
    border: 1px solid var(--ai-border);
    border-radius: 10px;
    color: var(--ai-text-2) !important;
}

.notice-w .notice span img {
    filter: hue-rotate(160deg) saturate(1.4);
}

/* 快捷充值 / 租用中心入口卡片 */
.info-pay a,
.info-detail a {
    display: block;
}

.info-pay dl,
.info-detail dl {
    background: var(--ai-surface) !important;
    border: 1px solid var(--ai-border);
    border-radius: var(--ai-radius) !important;
    transition: border-color .2s, box-shadow .2s;
}

.info-pay dl:hover,
.info-detail dl:hover {
    border-color: rgba(139, 92, 246, .55);
    box-shadow: var(--ai-glow);
}

.info-pay dt span {
    background: var(--ai-gradient) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent;
}

/* 热门算力列表 */
.rate .rate-hd li {
    color: var(--ai-text-2) !important;
    border-bottom: 2px solid transparent !important;
}

.rate .rate-hd li.cur {
    color: var(--ai-primary) !important;
    border-bottom-color: var(--ai-primary) !important;
    text-shadow: var(--ai-glow);
}

.rate .list-hd li {
    color: var(--ai-text-2) !important;
}

.rate .list-item,
.list .list-item {
    background: transparent !important;
    border-bottom: 1px solid rgba(94, 129, 244, .12) !important;
}

.rate .list-item .down {
    color: var(--ai-primary) !important;
}

.rate .list-item .up,
.list-item .up {
    color: #f87171 !important; /* 涨红（中式行情习惯） */
}

/* ---------- 登录 / 注册 ---------- */
.signin {
    background: transparent !important;
    padding-top: 8vh;
}

.signin .signin-header .system-logo img {
    filter: drop-shadow(0 0 18px rgba(139, 92, 246, .45));
}

/* 品牌字标（模板中以 .brand 输出） */
.brand {
    margin: 0 auto 6px;
    text-align: center;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 2px;
    background: var(--ai-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

.brand-sub {
    margin: 0 0 24px;
    text-align: center;
    font-size: 13px;
    letter-spacing: 6px;
    color: var(--ai-text-2);
}

.signin .signin-content .item-input {
    background: var(--ai-surface) !important;
    border: 1px solid var(--ai-border) !important;
    border-radius: 12px !important;
    margin-bottom: 12px;
}

.signin .signin-content .item-input input {
    background: transparent !important;
    color: var(--ai-text) !important;
}

.signin .signin-content .item-input input::placeholder {
    color: rgba(143, 163, 196, .65);
}

.signin .input-icon {
    color: var(--ai-primary) !important;
}

/* 主按钮 */
.newbutton,
.sign_button,
button.button-positive,
.btn-primary,
.button {
    background: var(--ai-gradient) !important;
    border: none !important;
    color: #fff !important;
    border-radius: 24px !important;
    box-shadow: 0 6px 20px rgba(99, 102, 241, .4) !important;
    font-weight: 600;
    letter-spacing: 2px;
}

.newbutton:active,
.sign_button:active,
.button:active {
    opacity: .85;
}

.signin .signin-footer a {
    color: var(--ai-text-2) !important;
}

/* ---------- 个人中心 ---------- */
.user-center .my-center-head {
    background:
        radial-gradient(80% 120% at 80% 0%, rgba(139, 92, 246, .35) 0%, transparent 60%),
        radial-gradient(70% 100% at 10% 0%, rgba(139, 92, 246, .3) 0%, transparent 55%),
        linear-gradient(160deg, #131c33 0%, #0d1424 100%) !important;
    border-bottom: 1px solid var(--ai-border);
}

.user-center .my-center-head .userinfo dt {
    color: #fff !important;
    font-weight: 600;
}

.user-center .my-center-head .userinfo dd {
    color: var(--ai-primary) !important;
    text-shadow: var(--ai-glow);
}

.user-center .usdt dl dt {
    color: var(--ai-text-2) !important;
}

.user-center .usdt dl dd {
    color: var(--ai-text) !important;
    font-weight: 600;
}

/* 余额/持仓概览数字 */
.usdt dd,
.my-center-head dd {
    font-variant-numeric: tabular-nums;
}

/* 充值 / 提现 快捷入口 */
.my-center-section2 .links li a {
    display: block;
    background: var(--ai-gradient) !important;
    color: #fff !important;
    border-radius: 12px !important;
    box-shadow: 0 6px 18px rgba(99, 102, 241, .35);
    font-weight: 600;
}

.my-center-section2 .links li.link2 a {
    background: linear-gradient(135deg, #4f7cff 0%, #a855f7 100%) !important;
}

/* 功能列表模块 */
.common-module {
    background: var(--ai-surface) !important;
    border: 1px solid var(--ai-border) !important;
    border-radius: var(--ai-radius) !important;
    margin: 10px 12px !important;
    transition: border-color .2s, box-shadow .2s;
}

.common-module:active {
    border-color: rgba(139, 92, 246, .6) !important;
    box-shadow: var(--ai-glow);
}

.common-module .left {
    color: var(--ai-text) !important;
}

.common-module .right {
    border-color: rgba(143, 163, 196, .4) !important;
}

.my-center-section3 {
    background: transparent !important;
}

/* ---------- 通用列表 / 表单 / 卡片 ---------- */
.list,
.card,
.table-view {
    background: transparent !important;
}

.item,
.table-view-cell {
    background: var(--ai-surface) !important;
    border-color: rgba(94, 129, 244, .14) !important;
    color: var(--ai-text) !important;
}

label.item-input input,
label.item-input textarea,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="tel"],
select,
textarea {
    background: var(--ai-surface) !important;
    border: 1px solid var(--ai-border) !important;
    border-radius: 10px !important;
    color: var(--ai-text) !important;
}

input::placeholder,
textarea::placeholder {
    color: rgba(143, 163, 196, .6) !important;
}

/* 通用按钮色覆盖（黄色系 → 渐变） */
.button-assertive,
.button-positive,
.button-balanced,
.btn-yellow,
button[class*="yellow"] {
    background: var(--ai-gradient) !important;
    color: #fff !important;
    border: none !important;
}

/* ---------- 订单 / 租用记录页 ---------- */
.order-item,
.order-list li,
.hold-item {
    background: var(--ai-surface) !important;
    border: 1px solid var(--ai-border) !important;
    border-radius: var(--ai-radius) !important;
    margin: 10px 12px;
}

/* 盈亏颜色（中式：涨红跌绿） */
.red,
.up,
.profit-up,
.zf-up {
    color: #f87171 !important;
}

.green,
.down,
.profit-down,
.zf-down {
    color: #34d399 !important;
}

/* ---------- 弹窗 / Toast ---------- */
.layer,
.layerm-main,
.modal-backdrop .modal,
.order-modal {
    background: var(--ai-surface-solid) !important;
    color: var(--ai-text) !important;
    border: 1px solid var(--ai-border) !important;
    border-radius: 14px !important;
}

.toast_section {
    background: rgba(19, 28, 51, .95) !important;
    border: 1px solid var(--ai-border) !important;
    color: var(--ai-text) !important;
}

/* ---------- 滚动条与细节 ---------- */
::-webkit-scrollbar {
    width: 0;
    height: 0;
}

* {
    -webkit-tap-highlight-color: rgba(139, 92, 246, .15);
}

/* 图片在深色背景下的白底问题：轻度混合处理 */
.common-module .icon-img,
.info-detail dl dt img {
    filter: brightness(1.05) saturate(1.1);
}
