/* ==========================================================================
   UI 增强层：黑白主题切换（默认白）+ 账户中心 APP 模板
   规则约定：html 无 .dark = 白色主题（覆盖下方默认深色变量/组件）
             html.dark  = 黑色主题（沿用 theme-linear / layui-dark / 内嵌深色样式）
   ========================================================================== */

/* ===== 白色主题变量（默认） ===== */
html:not(.dark) {
    --primary: #5e6ad2;
    --primary-hover: #747fe0;
    --primary-active: #4f5ac4;
    --primary-bg: rgba(94, 106, 210, .10);

    --text-1: #1d2129;
    --text-2: #4e5969;
    --text-3: #86909c;

    --bg: #f4f6fb;
    --canvas: #f4f6fb;
    --surface-1: #ffffff;
    --surface-2: #f7f8fc;
    --surface-3: #f1f3f9;
    --surface-4: #eceef4;

    --border: #e5e8ef;
    --hairline: #e5e8ef;
    --hairline-strong: #d6dae4;

    --ink: #1d2129;
    --ink-muted: #4e5969;
    --ink-subtle: #86909c;

    --success: #27a644;
    --danger: #f0506e;
    --warning: #d9902c;
}

/* ===== 白色主题：基础 ===== */
html:not(.dark) body { background: var(--bg); color: var(--text-1); }
html:not(.dark) .sidebar,
html:not(.dark) .topbar { background: #fff; }
html:not(.dark) .sidebar { border-right-color: var(--border); }
html:not(.dark) .topbar { border-bottom-color: var(--border); }
html:not(.dark) .sidebar .brand { background: #fff; border-bottom: 1px solid var(--border); }
html:not(.dark) .sidebar .brand .mark { background: var(--primary); }
html:not(.dark) .sidebar .brand .brand-text { color: var(--text-1); }
html:not(.dark) .sidebar .menu-item { color: var(--text-2); }
html:not(.dark) .sidebar .menu-item:hover { background: var(--surface-2); color: var(--text-1); }
html:not(.dark) .sidebar .menu-item.active { background: var(--primary-bg); color: var(--primary); }
html:not(.dark) .topbar .title { color: var(--text-1); }
html:not(.dark) .collapse-btn { color: var(--text-2); }
html:not(.dark) .collapse-btn:hover { background: var(--surface-2); color: var(--primary); }
html:not(.dark) #userInfo,
html:not(.dark) .topbar .right a { color: var(--text-2); }
html:not(.dark) .topbar .right a:hover { color: var(--primary); background: var(--primary-bg); }

html:not(.dark) .card,
html:not(.dark) .stat-card,
html:not(.dark) .biz-card,
html:not(.dark) .goods-card,
html:not(.dark) .acc-card {
    background: #fff;
    border-color: var(--border);
    box-shadow: 0 1px 3px rgba(16, 24, 40, .04);
}
html:not(.dark) .card-title { color: var(--text-1); }
html:not(.dark) .stat-card .label,
html:not(.dark) .stat-card .sub,
html:not(.dark) .biz-card .biz-row { color: var(--text-3); }
html:not(.dark) .stat-card .value,
html:not(.dark) .biz-card .biz-row b { color: var(--text-1); }
html:not(.dark) .biz-card .biz-tag { background: var(--surface-2); color: var(--text-2); }
html:not(.dark) .biz-card .divider,
html:not(.dark) .data-item { border-color: #eef0f5; }
html:not(.dark) .data-item .k { color: var(--text-2); }
html:not(.dark) .quick-btn { background: #fff; border-color: var(--border); color: var(--text-1); }
html:not(.dark) .quick-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
html:not(.dark) .log-tab { background: #fff; border-color: var(--border); color: var(--text-2); }
html:not(.dark) .log-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
html:not(.dark) .card-title select { background: #fff; border-color: var(--border) !important; color: var(--text-1) !important; }
html:not(.dark) .goods-card .goods-item { color: var(--text-2); border-color: #eef0f5; }
html:not(.dark) .sel-item { background: #fff; border-color: var(--border); color: var(--text-1); }
html:not(.dark) .sel-item.selected { border-color: var(--primary); background: var(--primary-bg); }

/* ===== 白色主题：layui 组件浅色化（覆盖 layui-dark） ===== */
html:not(.dark) .layui-table-view,
html:not(.dark) .layui-table-box { border-color: var(--border) !important; }
html:not(.dark) .layui-table-tool { background: #fff !important; border-color: var(--border) !important; }
html:not(.dark) .layui-table thead tr,
html:not(.dark) .layui-table thead th { background: #fafbfe !important; color: var(--text-2) !important; font-weight: 600; }
html:not(.dark) .layui-table th,
html:not(.dark) .layui-table td { border-color: #f0f2f7 !important; }
html:not(.dark) .layui-table-cell { color: var(--text-1) !important; }
html:not(.dark) .layui-table tr:hover { background: #fafbff !important; }
html:not(.dark) .layui-input,
html:not(.dark) .layui-textarea { background: #fff !important; border-color: var(--hairline-strong) !important; color: var(--text-1) !important; }
html:not(.dark) .layui-input:focus { border-color: var(--primary) !important; }
html:not(.dark) .layui-btn { border: none; }
html:not(.dark) .layui-btn-normal { background: var(--primary) !important; color: #fff !important; }
html:not(.dark) .layui-btn-primary { background: #fff !important; border: 1px solid var(--hairline-strong) !important; color: var(--text-1) !important; }
html:not(.dark) .layui-laypage a,
html:not(.dark) .layui-laypage span { background: #fff !important; color: var(--text-2) !important; border-color: var(--border) !important; }
html:not(.dark) .layui-laypage .layui-laypage-curr .layui-laypage-em { background: var(--primary) !important; }
html:not(.dark) .layui-form-switch { border-color: var(--hairline-strong); background: #fff; }
html:not(.dark) .layui-form-onswitch { background: var(--primary); border-color: var(--primary); }
html:not(.dark) .layui-form-select dl { background: #fff; border-color: var(--border); }
html:not(.dark) .layui-form-select dl dd { color: var(--text-1); }
html:not(.dark) .layui-form-select dl dd.layui-this { background: var(--primary-bg); color: var(--primary); }
html:not(.dark) .layui-layer { box-shadow: 0 12px 34px rgba(16, 24, 40, .14) !important; }
html:not(.dark) .layui-layer-title { background: #fff; color: var(--text-1); border-color: var(--border); }
html:not(.dark) .layui-layer-content { background: #fff; color: var(--text-1); }
html:not(.dark) .layui-layer-btn { background: #fff; border-color: var(--border); }
html:not(.dark) .layui-layer-btn a { background: #fff; border-color: var(--hairline-strong); color: var(--text-1); }
html:not(.dark) .layui-layer-btn .layui-layer-btn0 { background: var(--primary); color: #fff; border: none; }

/* ===== 主题切换按钮 ===== */
#themeToggle {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 13px;
    border: 1px solid var(--border); transition: all .15s;
}
html:not(.dark) #themeToggle { background: #fff; color: var(--text-2); }
html:not(.dark) #themeToggle:hover { border-color: var(--primary); color: var(--primary); }
html.dark #themeToggle { background: var(--surface-2); color: var(--text-2); }
html.dark #themeToggle:hover { color: var(--primary); border-color: var(--primary); }

/* ===== 账户中心 APP 模板（变量驱动，黑白通吃） ===== */
#pane-account .acc-wrap { max-width: 640px; }
.acc-head {
    background: linear-gradient(135deg, #5e6ad2 0%, #7b5fd2 100%);
    border-radius: 16px; padding: 22px 24px; margin-bottom: 8px;
    display: flex; align-items: center; color: #fff;
    box-shadow: 0 8px 22px rgba(94, 106, 210, .25);
}
.acc-avatar {
    width: 60px; height: 60px; border-radius: 50%; flex-shrink: 0;
    background: rgba(255, 255, 255, .22); border: 2px solid rgba(255, 255, 255, .55);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; font-weight: 600;
}
.acc-meta { margin-left: 16px; flex: 1; min-width: 0; }
.acc-name { font-size: 19px; font-weight: 600; }
.acc-sub { font-size: 13px; opacity: .85; margin-top: 4px; word-break: break-all; }
.acc-tag {
    flex-shrink: 0; font-size: 12px; padding: 4px 12px; border-radius: 999px;
    background: rgba(255, 255, 255, .22); color: #fff; border: 1px solid rgba(255, 255, 255, .35);
}
.acc-tag.on { background: rgba(39, 200, 106, .92); border-color: transparent; }
.acc-group-title { font-size: 13px; color: var(--text-3); margin: 22px 4px 8px; }
.acc-card {
    background: var(--surface-1); border: 1px solid var(--border);
    border-radius: 16px; padding: 2px 10px; overflow: hidden;
}
.acc-item { display: flex; align-items: center; gap: 12px; padding: 15px 8px; }
.acc-item + .acc-item { border-top: 1px solid var(--border); }
.acc-ico {
    width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.acc-ico svg { width: 21px; height: 21px; }
.acc-ico.c1 { background: #eef0fb; color: #5e6ad2; }
.acc-ico.c2 { background: #e8f3ff; color: #1f7fd6; }
.acc-ico.c3 { background: #e8ffea; color: #1c8e3c; }
.acc-ico.c4 { background: #fff3e5; color: #d9902c; }
.acc-ico.c5 { background: #f4eefb; color: #8b5fd2; }
.acc-txt { flex: 1; min-width: 0; }
.acc-t { font-size: 15px; font-weight: 500; color: var(--text-1); }
.acc-s { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.acc-val { font-size: 13px; color: var(--text-2); }
.acc-input {
    border: 1px solid var(--hairline-strong); background: var(--surface-2); color: var(--text-1);
    border-radius: 8px; padding: 7px 10px; font-size: 13px; outline: none; width: 150px; flex-shrink: 0;
}
.acc-input:focus { border-color: var(--primary); background: var(--surface-1); }
.acc-btn {
    border: none; border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer;
    background: var(--surface-3); color: var(--text-1); flex-shrink: 0; transition: opacity .15s;
}
.acc-btn:hover { opacity: .8; }
.acc-btn.primary { background: var(--primary); color: #fff; }
.acc-switch { flex-shrink: 0; }
.acc-expand {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 12px; padding: 14px 14px 2px; margin: 0 6px 12px;
}
.acc-expand-title { font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.acc-expand-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.acc-expand-row .acc-input { flex-shrink: 1; }
.acc-txt .acc-s a, .acc-s { color: var(--text-3); }

/* ===== 账户修改弹窗（放大窗口） ===== */
.acc-modal { color: var(--text-2); line-height: 1.7; font-size: 14px; }
.acc-modal .acc-input { padding: 11px 14px; font-size: 14px; border-radius: 10px; }
.acc-modal .acc-btn { padding: 10px 20px; font-size: 14px; border-radius: 10px; }
.acc-modal .acc-btn.primary { padding: 12px; font-size: 15px; }
.acc-modal .acc-tip { font-size: 13px; margin-bottom: 10px; }
html.dark .layui-layer { background: var(--surface-1); }
html.dark .layui-layer-content { color: #d3d7df; }
html.dark .acc-modal .acc-input { background: var(--surface-2); color: var(--text-1); }

/* 账户修改弹窗：宽扁矩形大卡片 */
.acc-modal { min-height: 360px; display: flex; flex-direction: column; justify-content: center; }
.acc-modal .acc-input { height: 46px; padding: 0 14px; font-size: 14px; }
.acc-modal .acc-btn { height: 42px; line-height: 42px; padding: 0 22px; }
.acc-modal .acc-btn.primary { height: 46px; line-height: 46px; }

/* ===== 账户修改弹窗统一表单模板（手机号/邮箱/密码） ===== */
.acc-modal { padding: 26px 34px 24px; min-height: 320px; }
.acc-modal .acc-input { height: 46px; font-size: 14px; border-radius: 10px; padding: 0 14px; flex: 1; width: auto; }
.am-hint {
    display: flex; align-items: center; gap: 8px;
    background: var(--primary-bg); color: var(--primary);
    border-radius: 10px; padding: 11px 14px; font-size: 13px; margin-bottom: 18px;
}
.am-hint::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.am-step { display: flex; align-items: center; gap: 10px; margin: 2px 0; color: var(--text-1); font-weight: 600; font-size: 15px; }
.am-step-no {
    width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0;
}
.am-label { font-size: 13px; color: var(--text-2); margin: 16px 0 7px; font-weight: 500; }
.am-row { display: flex; gap: 10px; }
.acc-modal .am-row .acc-btn { flex-shrink: 0; height: 46px; line-height: 46px; padding: 0 22px; border-radius: 10px; }
.acc-modal .am-actions { margin-top: 24px; }
.acc-modal .am-actions .acc-btn { width: 100%; height: 48px; line-height: 48px; font-size: 15px; border-radius: 10px; }
.acc-modal input.am-text { width: 100%; }

/* ===== 分步向导弹窗（手机号/邮箱/密码） ===== */
.pm-screen { display: none; }
.pm-screen.on { display: block; }
.pm-title { font-size: 19px; font-weight: 700; color: var(--text-1); margin-bottom: 6px; }
.pm-desc { font-size: 13px; color: var(--text-3); margin-bottom: 22px; line-height: 1.7; }
.pm-field { margin-bottom: 4px; }
.pm-label { font-size: 13px; color: var(--text-2); font-weight: 500; margin-bottom: 8px; }
.pm-inline { display: flex; gap: 10px; }
.pm-inline .acc-input { flex: 1; }
.pm-inline .acc-btn { flex-shrink: 0; height: 46px; line-height: 46px; padding: 0 20px; border-radius: 10px; }
.pm-foot { margin-top: 26px; }
.pm-foot .acc-btn { width: 100%; height: 48px; line-height: 48px; font-size: 15px; border-radius: 10px; }
.pm-screen .am-hint { margin-top: 4px; }

/* v4 严格分步：当前值提示 / 通过提示 */
.pm-cur {
    display: flex; align-items: center; gap: 8px;
    background: var(--primary-bg); color: var(--primary);
    border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-bottom: 18px; line-height: 1.6;
}
.pm-done {
    display: flex; align-items: center; gap: 8px;
    background: rgba(31, 168, 85, .12); color: var(--success);
    border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-bottom: 16px; line-height: 1.6;
}

/* ===== v5 账户修改弹窗（白底 600px · 步骤文字 · 右对齐按钮组） ===== */
.acc-modal.st-modal {
    display: block !important; min-height: auto !important;
    padding: 26px 30px 22px !important; background: #fff;
}
html.dark .acc-modal.st-modal { background: var(--surface-1); }
.acc-modal.st-modal .acc-input {
    height: 40px; width: 100%; flex: 1; box-sizing: border-box;
    background: #fff; border: 1px solid #d9dde6; border-radius: 8px;
    color: #1d2129; font-size: 14px; padding: 0 12px; outline: none;
}
.acc-modal.st-modal .acc-input:focus { border-color: #2b69d1; }
html.dark .acc-modal.st-modal .acc-input { background: #fff; color: #1d2129; border-color: #d9dde6; }
.st-label { font-size: 15px; font-weight: 600; color: var(--text-1); margin-bottom: 12px; }
.st-tip { font-size: 13px; color: var(--text-3); margin-bottom: 16px; line-height: 1.8; }
.st-field { margin-bottom: 14px; }
.st-code-row { display: flex; gap: 10px; }
.st-code-btn {
    flex-shrink: 0; height: 40px; padding: 0 16px; background: #f5f7fa;
    border: 1px solid #d9dde6; border-radius: 8px; color: #4e5969;
    font-size: 13px; cursor: pointer;
}
.st-code-btn:hover { border-color: #2b69d1; color: #2b69d1; }
.st-btns { display: flex; justify-content: flex-end; gap: 12px; margin-top: 26px; }
.st-cancel {
    height: 38px; padding: 0 22px; background: #fff; border: 1px solid #d9dde6;
    border-radius: 8px; color: #4e5969; font-size: 14px; cursor: pointer;
}
.st-cancel:hover { border-color: #f0506e; color: #f0506e; }
.st-ok {
    height: 38px; padding: 0 26px; background: #2b69d1; border: none;
    border-radius: 8px; color: #fff; font-size: 14px; cursor: pointer;
}
.st-ok:hover { background: #2459b4; }

/* ===== v6 账户修改弹窗（参考样式：大标题 + label 表单 + 虚线步骤区） ===== */
.r-modal { background: #fff; padding: 28px 30px 26px; }
.r-title { font-size: 20px; font-weight: 700; color: #1d2129; margin-bottom: 14px; }
.r-tip { font-size: 14px; color: #666; margin-bottom: 20px; }
.r-item { margin-bottom: 18px; }
.r-item label { display: block; margin-bottom: 6px; color: #4e5969; font-size: 14px; }
.r-item input {
    width: 100%; box-sizing: border-box; padding: 11px 14px;
    border: 1px solid #d9dde6; border-radius: 8px; font-size: 15px;
    color: #1d2129; outline: none; background: #fff;
}
.r-item input:focus { border-color: #2b69d1; }
.r-item .r-ro { background: #f5f7fa; color: #555; }
.r-code-row { display: flex; gap: 10px; }
.r-code-row input { flex: 1; }
.r-get {
    white-space: nowrap; padding: 0 16px; border: 1px solid #2b69d1;
    background: #2b69d1; color: #fff; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.r-get:hover { background: #2459b4; }
.r-wrap { display: none; margin-top: 6px; padding-top: 20px; border-top: 1px dashed #e0e3e9; }
.r-btns { display: flex; justify-content: flex-end; gap: 12px; margin-top: 26px; }
.r-cancel { padding: 10px 22px; border: 1px solid #cfd4dd; background: #fff; border-radius: 8px; cursor: pointer; font-size: 14px; color: #4e5969; }
.r-cancel:hover { border-color: #f0506e; color: #f0506e; }
.r-submit { padding: 10px 22px; border: none; background: #2b69d1; color: #fff; border-radius: 8px; cursor: pointer; font-size: 14px; }
.r-submit:hover { background: #2459b4; }
html.dark .layui-layer { background: #fff; }

/* ===== v7 大厂 Modal 三段式（标题栏 / 内容 / 底部按钮条） ===== */
.layui-layer-title {
    background: #fff; color: #1d2129; font-size: 16px; font-weight: 600;
    height: 50px; line-height: 50px; padding-left: 24px; text-align: left;
    border-bottom: 1px solid #f0f0f0;
}
html.dark .layui-layer-content { color: #1d2129; }
.r7-body { background: #fff; padding: 24px 28px 6px; }
.r7-tip { font-size: 14px; color: #666; margin-bottom: 16px; }
.r7-item { margin-bottom: 16px; }
.r7-item label { display: block; margin-bottom: 6px; color: #1d2129; font-size: 14px; font-weight: 500; }
.r7-item input {
    width: 100%; box-sizing: border-box; padding: 10px 14px;
    border: 1px solid #d9dde6; border-radius: 6px; font-size: 15px;
    color: #1d2129; outline: none; background: #fff;
}
.r7-item input:focus { border-color: #165dff; }
.r7-item .r7-ro { background: #f7f8fa; color: #666; }
.r7-code { display: flex; gap: 10px; }
.r7-code input { flex: 1; }
.f-btn {
    height: 36px; padding: 0 20px; border: 1px solid #cfd4dd; background: #fff;
    border-radius: 6px; cursor: pointer; font-size: 14px; color: #4e5969;
}
.f-btn:hover { border-color: #165dff; color: #165dff; }
.f-btn.f-minor { white-space: nowrap; border-color: #165dff; color: #165dff; background: #fff; }
.f-btn.f-primary { background: #165dff; border-color: #165dff; color: #fff; }
.f-btn.f-primary:hover { background: #3b76ff; color: #fff; }
.r7-wrap { display: none; margin-top: 6px; padding-top: 18px; border-top: 1px dashed #e3e6eb; }
.r7-foot {
    border-top: 1px solid #f0f0f0; display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 28px; margin: 8px -28px 0; background: #fff;
}

/* ===== v8 账户修改弹窗（严格照参考代码样式） ===== */
.edit-phone-modal {
    width: 100%; background: #ffffff; border-radius: 10px;
    padding: 30px; box-sizing: border-box;
}
.modal-title { font-size: 20px; font-weight: bold; margin-bottom: 16px; color: #1d2129; }
.step-tip { font-size: 14px; color: #666; margin-bottom: 22px; }
.form-item { margin-bottom: 18px; }
.form-item label { display: block; margin-bottom: 6px; color: #4e5969; font-size: 14px; }
.form-item input {
    width: 100%; box-sizing: border-box; padding: 12px 14px;
    border: 1px solid #ddd; border-radius: 6px; font-size: 15px; color: #1d2129;
    outline: none; background: #fff;
}
.form-item input:focus { border-color: #2b69d1; }
.form-item input[readonly] { color: #555; }
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; }
.get-code-btn {
    white-space: nowrap; padding: 0 16px; border: 1px solid #2b69d1;
    background: #2b69d1; color: #fff; border-radius: 6px; cursor: pointer; font-size: 14px;
}
.btn-group { display: flex; justify-content: flex-end; gap: 12px; margin-top: 28px; }
.cancel-btn {
    padding: 10px 22px; border: 1px solid #cccccc; background: #fff;
    border-radius: 6px; cursor: pointer; font-size: 14px; color: #4e5969;
}
.submit-btn {
    padding: 10px 22px; border: none; background: #2b69d1; color: #fff;
    border-radius: 6px; cursor: pointer; font-size: 14px;
}
.new-phone-wrap {
    display: none; margin-top: 24px; padding-top: 20px; border-top: 1px dashed #eee;
}

/* ===== v9 账户修改弹窗（复用站点 layui 表单模板） ===== */
.fv-body { padding: 24px 28px 12px; }
.fv-step { font-size: 14px; color: var(--text-2); margin: 0 0 16px; font-weight: 500; }
.fv-body .layui-form-item { margin-bottom: 18px; }
.fv-body .layui-form-label { color: var(--text-1); }
.fv-foot {
    display: flex; justify-content: flex-end; gap: 10px;
    border-top: 1px solid var(--border); margin-top: 10px; padding-top: 16px;
}
.fv-foot .layui-btn { margin: 0; }

/* ===== v10 账户修改弹窗（与账户卡片同款视觉） ===== */
.acc-modal2 { padding: 24px 28px 12px; }
.acc-step { font-size: 14px; color: var(--text-2); font-weight: 500; margin-bottom: 16px; }
.acc-field { margin-bottom: 16px; }
.acc-label { font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.acc-modal2 .acc-input { width: 100%; flex: 1; }
.acc-code-row { display: flex; gap: 10px; }
.acc-code-row .acc-input { flex: 1; }
.acc-foot {
    display: flex; justify-content: flex-end; gap: 10px;
    border-top: 1px solid var(--border); margin-top: 10px; padding-top: 16px;
}
.acc-foot .acc-btn { height: 38px; padding: 0 20px; }
.acc-modal2 .acc-input[readonly] { background: var(--surface-2); color: var(--text-3); }

/* 行内展开：底部按钮行 */
.acc-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.acc-actions .acc-btn { height: 36px; padding: 0 18px; }
.acc-expand .acc-input[readonly] { background: var(--surface-3); color: var(--text-3); }
