/**
 * 会员中心 ITP 风格样式
 * --------------------------------------------------------------
 * 视觉语言移植自 public/itp 前台模板（Tailwind + Preline）：
 *   深灰左侧边栏 + 浅灰粘性顶栏 + 背景图标题横幅 + 白色圆角卡片 + 暗黑模式
 * 不直接引用模板的 Tailwind 编译产物（其 .collapse/.hidden/.container/.table
 * 等类会与 Bootstrap 冲突，且服务器不适合跑 Tailwind 编译），因此全部手写，
 * 自有组件统一使用 itp- 前缀，并对 Bootstrap / FastAdmin 组件做风格覆盖，
 * 保证表单校验、上传、Layer 弹窗、分页等原有功能不受影响。
 * 暗黑模式：<html class="dark">，与模板 Preline 共用 localStorage 键 hs_theme。
 */

/* ========== 1. 设计令牌（亮色） ========== */
:root {
    --itp-sidebar-w: 280px;
    --itp-header-h: 58px;

    --itp-bg: #f5f5f5;              /* neutral-100 页面底色 */
    --itp-surface: #ffffff;         /* 卡片 */
    --itp-surface-2: #fafafa;       /* 卡片内次级区块 */
    --itp-border: #e5e7eb;          /* gray-200 */
    --itp-border-strong: #d1d5db;   /* gray-300 */
    --itp-text: #374151;            /* gray-700 正文 */
    --itp-text-strong: #1f2937;     /* gray-800 标题 */
    --itp-muted: #6b7280;           /* gray-500 辅助 */
    --itp-subtle: #9ca3af;          /* gray-400 */

    --itp-header-bg: #f5f5f5;
    --itp-header-border: #e5e5e5;
    --itp-hover: #e5e7eb;

    --itp-side-bg: #525252;         /* neutral-600 */
    --itp-side-border: #404040;
    --itp-side-text: #f5f5f5;
    --itp-side-muted: #a3a3a3;
    --itp-side-active-bg: #e5e7eb;  /* gray-200 */
    --itp-side-active-text: #374151;

    --itp-primary: #475569;         /* slate-600 主按钮 */
    --itp-primary-hover: #334155;   /* slate-700 */
    --itp-primary-text: #ffffff;
    --itp-primary-soft: #f1f5f9;    /* slate-100 */

    --itp-success: #16a34a;
    --itp-success-soft: #f0fdf4;
    --itp-danger: #dc2626;
    --itp-danger-soft: #fef2f2;
    --itp-warning: #d97706;
    --itp-warning-soft: #fffbeb;
    --itp-info: #0284c7;
    --itp-info-soft: #f0f9ff;

    --itp-input-bg: #ffffff;
    --itp-radius: 10px;
    --itp-radius-sm: 8px;
    --itp-shadow: 0 1px 2px rgba(0, 0, 0, .05);
    --itp-shadow-lg: 0 10px 25px -8px rgba(0, 0, 0, .18);
}

/* ========== 1.1 设计令牌（暗色） ========== */
html.dark {
    --itp-bg: #525252;              /* neutral-600 */
    --itp-surface: #404040;         /* neutral-700 */
    --itp-surface-2: #4a4a4a;
    --itp-border: #737373;          /* neutral-500 */
    --itp-border-strong: #8a8a8a;
    --itp-text: #e5e7eb;
    --itp-text-strong: #fafafa;
    --itp-muted: #c4c4c4;
    --itp-subtle: #a3a3a3;

    --itp-header-bg: #525252;
    --itp-header-border: #737373;
    --itp-hover: #404040;

    --itp-side-bg: #262626;         /* neutral-800 */
    --itp-side-border: #404040;
    --itp-side-active-bg: #e5e7eb;

    --itp-primary: #f1f5f9;         /* 暗色下主按钮反白（同模板 filter-link-active） */
    --itp-primary-hover: #ffffff;
    --itp-primary-text: #0f172a;
    --itp-primary-soft: #4b5563;

    --itp-success-soft: rgba(22, 163, 74, .18);
    --itp-danger-soft: rgba(220, 38, 38, .18);
    --itp-warning-soft: rgba(217, 119, 6, .18);
    --itp-info-soft: rgba(2, 132, 199, .18);
    --itp-success: #4ade80;
    --itp-danger: #f87171;
    --itp-warning: #fbbf24;
    --itp-info: #38bdf8;

    --itp-input-bg: #525252;
    --itp-shadow: 0 1px 2px rgba(0, 0, 0, .25);
    --itp-shadow-lg: 0 10px 25px -8px rgba(0, 0, 0, .5);
    color-scheme: dark;
}

/* ========== 2. 基础 ========== */
body.itp-body {
    padding-top: 0;
    background: var(--itp-bg);
    color: var(--itp-text);
    min-height: 100%;
    height: auto;
}
.itp-body a { color: var(--itp-text); }
.itp-body a:hover, .itp-body a:focus { color: var(--itp-text-strong); text-decoration: none; }
.itp-body .text-muted { color: var(--itp-muted); }
.itp-body .text-danger { color: var(--itp-danger); }
.itp-body .text-success { color: var(--itp-success); }
.itp-body h1, .itp-body h2, .itp-body h3, .itp-body h4, .itp-body h5 { color: var(--itp-text-strong); }
.itp-body hr { border-top-color: var(--itp-border); }
.itp-svg { width: 20px; height: 20px; fill: currentColor; flex-shrink: 0; vertical-align: middle; }
.itp-svg-sm { width: 16px; height: 16px; }

/* ========== 3. 左侧边栏 ========== */
.itp-sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 1040;
    width: var(--itp-sidebar-w);
    display: flex;
    flex-direction: column;
    background: var(--itp-side-bg);
    border-right: 1px solid var(--itp-side-border);
    color: var(--itp-side-text);
    transition: transform .2s ease;
}
.itp-sidebar a { color: var(--itp-side-text); }
.itp-sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 18px 22px 14px;
}
.itp-sidebar-brand > .itp-svg { width: 36px; height: 36px; color: #fafafa; }
.itp-sidebar-brand a.itp-brand-name {
    flex: 1; min-width: 0;
    font-size: 22px; font-weight: 600; color: #f5f5f5;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.itp-sidebar-close {
    display: none;
    width: 28px; height: 28px; border-radius: 50%;
    border: 1px solid #a3a3a3; background: #737373; color: #fafafa;
    align-items: center; justify-content: center; padding: 0;
}

/* 侧边栏会员小卡片 */
.itp-side-user {
    margin: 4px 14px 6px;
    padding: 12px;
    display: flex; align-items: center; gap: 12px;
    border-radius: var(--itp-radius);
    background: rgba(255, 255, 255, .07);
}
.itp-side-user img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #e5e7eb; }
.itp-side-user .itp-side-user-name { font-size: 15px; font-weight: 600; color: #fafafa; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.itp-side-user .itp-side-user-meta { font-size: 12px; color: var(--itp-side-muted); margin-top: 2px; }
.itp-side-user .itp-side-user-meta b { color: #fafafa; font-weight: 600; }

/* 菜单滚动区（隐藏滚动条，保持模板效果） */
.itp-sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 6px 10px 72px;
    scrollbar-width: none;
}
.itp-sidebar-scroll::-webkit-scrollbar { display: none; }

/*
 * 菜单分组：兼容 FastAdmin 原生 / 插件钩子(user_sidenav_before/after)输出的
 * <ul class="list-group"><li class="list-group-heading"> 结构，平铺显示不折叠
 */
.itp-sidenav .list-group {
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
    box-shadow: none;
}
.itp-sidenav .list-group-heading {
    list-style: none;
    padding: 14px 14px 6px;
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--itp-side-muted);
}
.itp-sidenav .list-group-item {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 2px 0;
    border-radius: var(--itp-radius-sm) !important;
}
.itp-sidenav .list-group-item > a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px;
    border-radius: var(--itp-radius-sm);
    font-size: 15px; font-weight: 500;
    color: var(--itp-side-text);
    transition: background-color .15s, color .15s;
}
.itp-sidenav .list-group-item > a .fa {
    width: 20px; text-align: center; font-size: 16px; opacity: .9;
}
.itp-sidenav .list-group-item > a:hover,
.itp-sidenav .list-group-item > a:focus {
    background: var(--itp-side-active-bg);
    color: var(--itp-side-active-text);
}
.itp-sidenav .list-group-item.active,
.itp-sidenav .list-group-item.active:hover,
.itp-sidenav .list-group-item.active:focus { background: transparent; border: 0; }
.itp-sidenav .list-group-item.active > a {
    background: var(--itp-side-active-bg);
    color: var(--itp-side-active-text);
    font-weight: 600;
    box-shadow: inset 3px 0 0 #94a3b8;
}
.itp-sidenav .list-group-item > a[target="_blank"]::after {
    content: "\f08e"; font-family: FontAwesome; font-size: 11px; margin-left: auto; opacity: .55;
}

/* 侧边栏底部：备案 + 暗黑开关 */
.itp-sidebar-foot {
    position: absolute; left: 0; right: 0; bottom: 0;
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 14px;
    background: var(--itp-side-bg);
    border-top: 1px solid #737373;
    font-size: 12px; color: #e5e5e5;
}
.itp-sidebar-foot .itp-beian { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.itp-sidebar-foot .itp-beian a, .itp-sidebar-foot .itp-beian p { color: #e5e5e5; margin: 0; display: inline; }

/* 暗黑模式滑动开关（复刻模板样式） */
.itp-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; cursor: pointer; margin: 0; }
.itp-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.itp-switch .itp-switch-track { position: absolute; inset: 0; border-radius: 999px; background: #737373; transition: background .2s; }
.itp-switch .itp-switch-thumb { position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .2s; }
.itp-switch input:checked ~ .itp-switch-track { background: #a3a3a3; }
.itp-switch input:checked ~ .itp-switch-thumb { transform: translateX(20px); }

/* 移动端遮罩 */
.itp-backdrop { display: none; }

/* ========== 4. 主区域 ========== */
.itp-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.itp-has-sidebar .itp-wrapper { margin-left: var(--itp-sidebar-w); }

/* 顶栏 */
.itp-header {
    position: sticky; top: 0; z-index: 1030;
    height: var(--itp-header-h);
    display: flex; align-items: center; gap: 12px;
    padding: 0 24px;
    background: var(--itp-header-bg);
    border-bottom: 1px solid var(--itp-header-border);
}
.itp-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; padding: 0;
    border: 0; border-radius: 50%;
    background: transparent; color: var(--itp-text);
    transition: background-color .15s;
}
.itp-icon-btn:hover, .itp-icon-btn:focus { background: var(--itp-hover); outline: none; color: var(--itp-text-strong); }
.itp-icon-btn .itp-svg { width: 22px; height: 22px; }
.itp-menu-toggle { display: none; }

/* 面包屑 */
.itp-breadcrumb { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 15px; white-space: nowrap; min-width: 0; overflow: hidden; }
.itp-breadcrumb li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.itp-breadcrumb .itp-svg { width: 16px; height: 16px; color: var(--itp-muted); }
.itp-breadcrumb a { font-weight: 500; color: var(--itp-text); }
.itp-breadcrumb a:hover { color: var(--itp-text-strong); text-shadow: 0 1px 2px rgba(0,0,0,.15); }
.itp-breadcrumb li:last-child span { color: var(--itp-muted); overflow: hidden; text-overflow: ellipsis; }

.itp-header-tools { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.itp-header-divider { width: 1px; height: 24px; background: var(--itp-subtle); margin: 0 12px; }
.itp-theme-light { display: none !important; }
html.dark .itp-theme-dark { display: none !important; }
html.dark .itp-theme-light { display: inline-flex !important; }

/* 顶栏会员下拉 */
.itp-account { position: relative; }
.itp-account > a { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 999px; }
.itp-account > a img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: #e5e7eb; }
.itp-account > a span { font-size: 15px; color: var(--itp-muted); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.itp-account > a:hover span { color: var(--itp-text-strong); }
.itp-account .dropdown-menu { min-width: 220px; padding: 0; margin-top: 10px; border-radius: var(--itp-radius); overflow: hidden; }
.itp-account .itp-dropdown-head { padding: 12px 18px; background: #6b7280; color: #f9fafb; font-size: 13px; }
.itp-account .dropdown-menu > li > a { display: flex; align-items: center; gap: 10px; padding: 9px 18px; }
.itp-account .dropdown-menu > li > a .fa { width: 16px; text-align: center; color: var(--itp-muted); }
.itp-guest-links { display: flex; gap: 8px; }

/* 标题横幅（复刻模板 s_synopsis） */
.itp-hero {
    position: relative; isolation: isolate; overflow: hidden;
    padding: 34px 32px;
    background: #9ca3af url(../itp/titlebg.jpg) center / cover no-repeat;
}
.itp-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(0, 0, 0, .7); }
.itp-hero-inner { display: flex; align-items: center; gap: 20px; max-width: 1280px; }
.itp-hero-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(255,255,255,.25); flex-shrink: 0; background: #e5e7eb; }
.itp-hero h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.01em; color: #fff !important; line-height: 1.3; }
.itp-hero p { margin: 10px 0 0; font-size: 15px; color: #a3a3a3; }
.itp-hero-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 14px; color: #a3a3a3; }
.itp-hero-stats b { color: #e5e5e5; font-weight: 600; }
.itp-hero-stats a { color: #e5e5e5; text-decoration: underline; text-underline-offset: 3px; }
.itp-hero-stats a:hover { color: #fff; }

/* 内页全宽：只保留左右外边距（说明---2026-11-26 按需求取消 1280px 最大宽度） */
.itp-main { flex: 1; width: 100%; padding: 24px; }
.itp-main-narrow { max-width: 520px; margin: 0 auto; }

/* 页脚（复刻模板 s_footer） */
.itp-footer { margin-top: 40px; padding: 48px 24px; text-align: center; background: var(--itp-header-bg); color: var(--itp-subtle); border-top: 1px solid var(--itp-header-border); }
html.dark .itp-footer { background: #404040; }
.itp-footer-brand { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 18px; font-weight: 500; color: var(--itp-subtle); }
.itp-footer-brand .itp-svg { width: 32px; height: 32px; }
.itp-footer p { margin: 0; font-size: 13px; line-height: 2; }
.itp-footer a { color: var(--itp-subtle) !important; margin-left: 8px; }
.itp-footer a:hover { color: var(--itp-text) !important; }
.itp-footer .itp-beian-inline, .itp-footer .itp-beian-inline p { display: inline; margin: 0 0 0 8px; }

/* 弹窗模式（附件选择 ?dialog=1） */
.itp-dialog { padding: 0; }
body.itp-body.itp-dialog-body { background: var(--itp-surface); }

/* ========== 5. 卡片与通用组件 ========== */
.itp-card {
    background: var(--itp-surface);
    border: 1px solid var(--itp-border);
    border-radius: var(--itp-radius);
    box-shadow: var(--itp-shadow);
    margin-bottom: 20px;
}
.itp-card-header {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    min-height: 60px;
    padding: 12px 22px;
    border-bottom: 1px solid var(--itp-border);
}
.itp-card-title { margin: 0; font-size: 17px; font-weight: 600; color: var(--itp-text-strong); display: flex; align-items: center; gap: 8px; }
.itp-card-title small { font-size: 13px; font-weight: 400; color: var(--itp-muted); }
.itp-card-tools { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.itp-card-body { padding: 22px; }
.itp-card-body > .pager:last-child, .itp-card-body > .itp-pager:last-child { margin-bottom: 0; }

/* 栅格（自有，避免与 Bootstrap .row 混用） */
.itp-grid { display: grid; gap: 16px; }
.itp-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.itp-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.itp-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* 数据小卡片 */
.itp-stat {
    display: block;
    padding: 18px 20px;
    border-radius: var(--itp-radius);
    background: var(--itp-surface);
    border: 1px solid var(--itp-border);
    box-shadow: var(--itp-shadow);
    transition: box-shadow .15s, border-color .15s;
}
a.itp-stat:hover { box-shadow: var(--itp-shadow-lg); border-color: var(--itp-border-strong); }
.itp-stat-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--itp-muted); }
.itp-stat-label .fa { width: 28px; height: 28px; line-height: 28px; text-align: center; border-radius: 8px; background: var(--itp-primary-soft); color: var(--itp-text); }
.itp-stat-value { margin-top: 10px; font-size: 24px; font-weight: 700; color: var(--itp-text-strong); line-height: 1.2; word-break: break-all; }
.itp-stat-value.is-sm { font-size: 15px; font-weight: 600; }
.itp-stat-foot { margin-top: 6px; font-size: 12px; color: var(--itp-subtle); }

/* 快捷入口 */
.itp-quick {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    padding: 18px 8px;
    border-radius: var(--itp-radius);
    border: 1px solid var(--itp-border);
    background: var(--itp-surface-2);
    font-size: 14px; color: var(--itp-text);
    transition: all .15s;
}
.itp-quick .fa { font-size: 22px; color: var(--itp-muted); transition: color .15s; }
.itp-quick:hover { background: var(--itp-surface); box-shadow: var(--itp-shadow-lg); transform: translateY(-2px); }
.itp-quick:hover .fa { color: var(--itp-text-strong); }

/* 列表条目（文档/订单/评论/收藏/余额日志） */
.itp-list { margin: 0; padding: 0; list-style: none; }
.itp-item { display: flex; gap: 18px; padding: 18px 0; border-bottom: 1px dashed var(--itp-border); }
.itp-item:first-child { padding-top: 0; }
.itp-item:last-child { border-bottom: 0; padding-bottom: 0; }
.itp-thumb { align-self: flex-start; flex: 0 0 168px; width: 168px; aspect-ratio: 4 / 3; border-radius: var(--itp-radius-sm); overflow: hidden; background: var(--itp-surface-2); border: 1px solid var(--itp-border); display: block; }
.itp-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.itp-thumb:hover img { transform: scale(1.05); }
.itp-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.itp-item-title { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.5; }
.itp-item-title a { color: var(--itp-text-strong); }
.itp-item-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.itp-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 13px; color: var(--itp-muted); }
.itp-item-meta .fa { margin-right: 4px; }
.itp-item-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.itp-quote { margin: 0; padding: 12px 14px; border-radius: var(--itp-radius-sm); background: var(--itp-surface-2); border-left: 3px solid var(--itp-border-strong); color: var(--itp-text); word-break: break-all; }
.itp-amount { font-size: 18px; font-weight: 700; white-space: nowrap; }
.itp-amount.is-plus { color: var(--itp-success); }
.itp-amount.is-minus { color: var(--itp-danger); }

/* 状态徽标 */
.itp-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 20px; background: var(--itp-primary-soft); color: var(--itp-text); }
.itp-badge.is-success { background: var(--itp-success-soft); color: var(--itp-success); }
.itp-badge.is-danger { background: var(--itp-danger-soft); color: var(--itp-danger); }
.itp-badge.is-warning { background: var(--itp-warning-soft); color: var(--itp-warning); }
.itp-badge.is-info { background: var(--itp-info-soft); color: var(--itp-info); }
a.itp-badge:hover { filter: brightness(.95); }

/* 筛选标签（复刻模板 filter-link） */
.itp-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.itp-filter a { display: inline-block; padding: 6px 14px; border-radius: 6px; font-size: 13px; background: var(--itp-primary-soft); color: var(--itp-text); transition: all .15s; }
.itp-filter a:hover { background: #94a3b8; color: #0f172a; }
.itp-filter a.active { background: var(--itp-primary); color: var(--itp-primary-text); font-weight: 500; box-shadow: var(--itp-shadow); }

/* 空状态 */
.itp-empty { padding: 48px 16px; text-align: center; color: var(--itp-subtle); }
.itp-empty .fa { display: block; font-size: 40px; margin-bottom: 12px; opacity: .6; }
.itp-empty .btn { margin-top: 14px; }

/* 搜索框（圆角胶囊，复刻模板） */
.itp-search { position: relative; }
.itp-search .fa { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--itp-subtle); }
.itp-search .form-control { padding-left: 38px; border-radius: 999px; min-width: 220px; }

/* 表单分区 */
.itp-form-section { margin: 0 0 6px; padding: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--itp-muted); border-bottom: 1px solid var(--itp-border); }

/* ========== 6. Bootstrap / FastAdmin 组件覆盖 ========== */
.itp-body .form-control,
.itp-body .bootstrap-select > .dropdown-toggle,
.itp-body .bootstrap-tagsinput,
.itp-body .input-group-addon {
    border-color: var(--itp-border-strong);
    background-color: var(--itp-input-bg);
    color: var(--itp-text);
    border-radius: var(--itp-radius-sm);
    box-shadow: none;
}
.itp-body .form-control { height: 38px; }
.itp-body textarea.form-control { height: auto; }
.itp-body .form-control:focus { border-color: #64748b; box-shadow: 0 0 0 3px rgba(100, 116, 139, .18); }
.itp-body .form-control[disabled], .itp-body .form-control[readonly] { background: var(--itp-surface-2); color: var(--itp-muted); }
.itp-body .input-group .form-control:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.itp-body .input-group .input-group-btn:last-child > .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; height: 38px; }
.itp-body .input-group-btn:last-child > .btn { line-height: 24px; }
/* 上传/选择按钮组（发布文档等）：与输入框等高并贴合 */
.itp-body .input-group-addon.no-border { background: transparent; border: 0; padding: 0 0 0 6px; white-space: nowrap; }
.itp-body .input-group-addon.no-padding .btn { height: 38px; line-height: 24px; }
.itp-body .input-group:has(> .input-group-addon.no-border) > .form-control { border-radius: var(--itp-radius-sm) !important; }
.itp-body .control-label { font-weight: 500; color: var(--itp-text); }
.itp-body .form-group { margin-bottom: 18px; }
.itp-body .help-block { color: var(--itp-subtle); }

.itp-body .btn { border-radius: var(--itp-radius-sm); font-weight: 500; transition: all .15s; }
.itp-body .btn-primary {
    background: var(--itp-primary); border-color: var(--itp-primary); color: var(--itp-primary-text);
}
.itp-body .btn-primary:hover, .itp-body .btn-primary:focus, .itp-body .btn-primary:active,
.itp-body .btn-primary.active, .itp-body .btn-primary:active:focus {
    background: var(--itp-primary-hover); border-color: var(--itp-primary-hover); color: var(--itp-primary-text);
}
.itp-body .btn-primary.disabled, .itp-body .btn-primary[disabled] { background: var(--itp-primary); border-color: var(--itp-primary); opacity: .55; }
.itp-body .btn-default { background: var(--itp-surface); border-color: var(--itp-border-strong); color: var(--itp-text); }
.itp-body .btn-default:hover, .itp-body .btn-default:focus { background: var(--itp-hover); color: var(--itp-text-strong); border-color: var(--itp-border-strong); }
.itp-body .btn-info { background: #64748b; border-color: #64748b; color: #fff; }
.itp-body .btn-info:hover, .itp-body .btn-info:focus { background: #475569; border-color: #475569; color: #fff; }
.itp-body .btn-soft { background: var(--itp-primary-soft); border-color: transparent; color: var(--itp-text); }
.itp-body .btn-soft:hover { background: var(--itp-hover); color: var(--itp-text-strong); }
.itp-body .btn-soft-danger { background: var(--itp-danger-soft); border-color: transparent; color: var(--itp-danger); }
.itp-body .btn-soft-danger:hover { background: var(--itp-danger); color: #fff; }
.itp-body .btn-soft-warning { background: var(--itp-warning-soft); border-color: transparent; color: var(--itp-warning); }
.itp-body .btn-soft-warning:hover { background: var(--itp-warning); color: #fff; }
.itp-body .btn-lg { padding: 10px 16px; font-size: 16px; }

.itp-body .alert { border-radius: var(--itp-radius-sm); border: 0; }
.itp-body .alert-info, .itp-body .alert-info-light { background: var(--itp-info-soft); color: var(--itp-info); }
.itp-body .alert-danger, .itp-body .alert-danger-light { background: var(--itp-danger-soft); color: var(--itp-danger); }
.itp-body .alert-warning { background: var(--itp-warning-soft); color: var(--itp-warning); }

/* 分页（ThinkPHP render 输出的 .pagination） */
.itp-body .pager { margin: 24px 0 0; text-align: center; }
.itp-body .pagination { display: inline-flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.itp-body .pagination > li { display: inline-block; margin: 0; }
.itp-body .pagination > li > a, .itp-body .pagination > li > span {
    float: none; display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 12px; margin: 0;
    border-radius: var(--itp-radius-sm) !important;
    border: 1px solid var(--itp-border-strong);
    background: var(--itp-surface); color: var(--itp-text);
}
.itp-body .pagination > li > a:hover { background: var(--itp-hover); color: var(--itp-text-strong); }
.itp-body .pagination > .active > span, .itp-body .pagination > .active > a,
.itp-body .pagination > .active > span:hover {
    background: #6b7280; border-color: #6b7280; color: #fff;
}
.itp-body .pagination > .disabled > span { background: var(--itp-surface-2); color: var(--itp-subtle); }

/* 下拉菜单 */
.itp-body .dropdown-menu { background: var(--itp-surface); border: 1px solid var(--itp-border); box-shadow: var(--itp-shadow-lg); }
.itp-body .dropdown-menu > li > a { color: var(--itp-text); }
.itp-body .dropdown-menu > li > a:hover, .itp-body .dropdown-menu > li > a:focus { background: var(--itp-hover); color: var(--itp-text-strong); }
.itp-body .dropdown-menu .divider { background: var(--itp-border); }

/* 表格 / 标签页（附件弹窗） */
.itp-body .table > thead > tr > th, .itp-body .table > tbody > tr > td { border-color: var(--itp-border); }
.itp-body .table-hover > tbody > tr:hover { background: var(--itp-surface-2); }
.itp-body .nav-tabs { border-bottom-color: var(--itp-border); }
.itp-body .nav-tabs > li > a { color: var(--itp-muted); border-radius: var(--itp-radius-sm) var(--itp-radius-sm) 0 0; }
.itp-body .nav-tabs > li.active > a, .itp-body .nav-tabs > li.active > a:hover { background: var(--itp-surface); color: var(--itp-text-strong); border-color: var(--itp-border) var(--itp-border) transparent; }
.itp-body .panel { background: var(--itp-surface); border-color: var(--itp-border); }
.itp-body .panel-heading { background: var(--itp-surface-2) !important; border-color: var(--itp-border); }

/* 上传预览缩略图 */
.itp-body .plupload-preview { margin-top: 10px; }
.itp-body .plupload-preview .thumbnail { background: var(--itp-surface-2); border-color: var(--itp-border); border-radius: var(--itp-radius-sm); }

/* 暗色下 Layer 弹窗 */
html.dark .layui-layer { background: #404040; color: #e5e7eb; }
html.dark .layui-layer-title { background: #525252; color: #fafafa; border-bottom-color: #737373; }
html.dark .layui-layer-btn { background: #404040; }
html.dark .layui-layer-content .form-control { background: #525252; color: #e5e7eb; border-color: #737373; }
html.dark .form-layer .form-footer { background: #525252 !important; }

/* ========== 6.1 富文本编辑器（Summernote）—— 亮/暗双主题 ========== */
.itp-body .note-editor.note-frame { border: 1px solid var(--itp-border-strong); border-radius: var(--itp-radius-sm); overflow: visible; box-shadow: none; }
.itp-body .note-editor.note-frame.focus, .itp-body .note-editor.note-frame:focus-within { border-color: #64748b; box-shadow: 0 0 0 3px rgba(100, 116, 139, .18); }
.itp-body .note-editor .note-toolbar { background: var(--itp-surface-2); border-bottom: 1px solid var(--itp-border); border-radius: var(--itp-radius-sm) var(--itp-radius-sm) 0 0; padding: 6px 8px 2px; }
/* 选择器需高于 summernote.css 自身的 .note-editor .note-toolbar>.note-btn-group .note-btn */
.itp-body .note-editor .note-toolbar .note-btn-group .note-btn { background: var(--itp-surface); border-color: var(--itp-border); color: var(--itp-text); height: 30px; padding: 4px 9px; }
.itp-body .note-editor .note-toolbar .note-btn-group .note-btn:hover, .itp-body .note-editor .note-toolbar .note-btn-group .note-btn.active { background: var(--itp-hover); color: var(--itp-text-strong); }
.itp-body .note-editor .note-editing-area .note-editable { background: var(--itp-input-bg); color: var(--itp-text); padding: 14px 16px; line-height: 1.8; }
.itp-body .note-editor .note-editing-area .note-codable { background: #1f2937; color: #e5e7eb; }
.itp-body .note-editor .note-statusbar { background: var(--itp-surface-2); border-top: 1px solid var(--itp-border); border-radius: 0 0 var(--itp-radius-sm) var(--itp-radius-sm); }
.itp-body .note-editor .note-statusbar .note-resizebar .note-icon-bar { border-top-color: var(--itp-subtle); }
.itp-body .note-dropdown-menu, .itp-body .note-popover .popover-content, .itp-body .note-popover .note-popover-content { background: var(--itp-surface); border-color: var(--itp-border); color: var(--itp-text); }
.itp-body .note-dropdown-menu .note-dropdown-item:hover, .itp-body .note-dropdown-menu > li > a:hover { background: var(--itp-hover); }
.itp-body .note-placeholder { color: var(--itp-subtle); }
html.dark .itp-body .note-editor .note-editable a { color: #93c5fd; }
html.dark .itp-body .note-modal .modal-content { background: #404040; color: #e5e7eb; }
html.dark .itp-body .note-modal .modal-header, html.dark .itp-body .note-modal .modal-footer { border-color: #737373; }
html.dark .itp-body .note-modal .close { color: #fafafa; opacity: .8; }

/* ========== 6.2 Bootstrap-table（附件选择弹窗等）========== */
.itp-body .fixed-table-container { border-color: var(--itp-border); border-radius: var(--itp-radius-sm); }
.itp-body .bootstrap-table .table > thead > tr > th { background: var(--itp-surface-2); color: var(--itp-text-strong); border-bottom-width: 1px; }
.itp-body .bootstrap-table .table > tbody > tr > td { vertical-align: middle; }
.itp-body .fixed-table-pagination { color: var(--itp-muted); }
.itp-body .fixed-table-toolbar .btn-success { background: #64748b; border-color: #64748b; color: #fff; }
.itp-body .fixed-table-toolbar .btn-success:hover { background: #475569; border-color: #475569; }
/* 「选择」按钮：user.js 的 formatter 固定输出 btn-danger，这里统一为主色 */
.itp-body .btn-chooseone, .itp-body .btn-choose-multi {
    background: var(--itp-primary); border-color: var(--itp-primary); color: var(--itp-primary-text) !important;
    border-radius: 6px; padding: 3px 10px;
}
.itp-body .btn-chooseone:hover, .itp-body .btn-choose-multi:hover { background: var(--itp-primary-hover); border-color: var(--itp-primary-hover); }
html.dark .itp-body .fixed-table-body .table, html.dark .itp-body .table { color: var(--itp-text); background: transparent; }
html.dark .itp-body .bootstrap-table .table > thead > tr > th { background: #4a4a4a; }
html.dark .itp-body .table-hover > tbody > tr:hover > td { background: #4a4a4a; }
html.dark .itp-body .table-bordered, html.dark .itp-body .table-bordered > tbody > tr > td, html.dark .itp-body .table-bordered > thead > tr > th { border-color: #737373; }

/* jquery.tagsinput（发布文档的「标签」输入）*/
.itp-body div.tagsinput { min-height: 38px !important; height: auto !important; padding: 4px 6px; border: 1px solid var(--itp-border-strong); border-radius: var(--itp-radius-sm); background: var(--itp-input-bg); }
.itp-body div.tagsinput input { background: transparent; padding: 4px; margin: 0; }
html.dark .itp-body div.tagsinput input { color: #d4d4d4 !important; }
.itp-body div.tagsinput span.tag { border: 0; border-radius: 6px; background: var(--itp-primary-soft); color: var(--itp-text); padding: 3px 8px; margin: 2px 4px 2px 0; font-size: 13px; }
.itp-body div.tagsinput span.tag a { color: var(--itp-muted); }

/* SelectPage（标签等下拉选择组件）*/
.itp-body .sp_container .sp_element_box, .itp-body .sp_container .sp_input { border-color: var(--itp-border-strong); border-radius: var(--itp-radius-sm); background: var(--itp-input-bg); color: var(--itp-text); }
.itp-body .sp_container .sp_element_box { min-height: 38px; }
html.dark .itp-body .sp_result_area { background: #404040; border-color: #737373; color: #e5e7eb; }
html.dark .itp-body .sp_result_area .sp_results > li { color: #e5e7eb; }
html.dark .itp-body .sp_result_area .sp_results > li.sp_over { background: #525252; }
html.dark .itp-body .sp_result_area .sp_pagination, html.dark .itp-body .sp_result_area .sp_navi { background: #4a4a4a; border-color: #737373; }
html.dark .itp-body .sp_container .sp_element_box li.selected_tag { background: #64748b; color: #fff; border-color: #64748b; }

/* 暗色下 bootstrap-select / 标签输入 / 弹出层 */
html.dark .itp-body .bootstrap-select .dropdown-menu li a { color: var(--itp-text); }
html.dark .itp-body .bootstrap-select .dropdown-menu li.selected a, html.dark .itp-body .bootstrap-select .dropdown-menu li a:hover { background: #525252; }
html.dark .itp-body .bootstrap-select .bs-searchbox .form-control { background: #525252; }
html.dark .itp-body .bootstrap-tagsinput .tag, html.dark .itp-body .tagsinput .tag { background: #64748b; color: #fff; }
html.dark .itp-body .popover { background: #404040; border-color: #737373; color: #e5e7eb; }
html.dark .itp-body .autocomplete-suggestions, html.dark .autocomplete-suggestions { background: #404040; color: #e5e7eb; border-color: #737373; }
html.dark .itp-body .autocomplete-searchtitle .media:hover { background: #4a4a4a; }
html.dark .itp-body .plupload-preview .thumbnail, html.dark .itp-body .faupload-preview .thumbnail { background: #4a4a4a; }
.itp-body .tooltip-inner { border-radius: 6px; }

/* ========== 7. 页面专属 ========== */
/* 会员首页：资料卡 */
.itp-profile-card { display: flex; align-items: center; gap: 18px; }
.itp-profile-card img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; border: 1px solid var(--itp-border); flex-shrink: 0; }
.itp-profile-card h3 { margin: 0 0 4px; font-size: 20px; font-weight: 700; }
.itp-profile-card p { margin: 0; color: var(--itp-muted); }
.itp-profile-card .itp-card-tools { align-self: flex-start; }

/* 个人资料：头像上传 */
.itp-avatar-uploader { position: relative; width: 104px; height: 104px; border-radius: 50%; overflow: hidden; border: 3px solid var(--itp-border); }
.itp-avatar-uploader img { width: 100%; height: 100%; object-fit: cover; }
.itp-avatar-uploader .profile-avatar-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.itp-avatar-uploader:hover .profile-avatar-text { opacity: 1; }
.itp-avatar-uploader button.faupload { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.itp-avatar-row { display: flex; align-items: center; gap: 18px; }
.itp-avatar-row .itp-avatar-tip { color: var(--itp-muted); font-size: 13px; line-height: 1.8; }
.itp-avatar-row .itp-avatar-tip b { color: var(--itp-text-strong); font-size: 15px; }

/* 充值：金额与支付方式选择 */
.itp-choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-bottom: 26px; }
.itp-choice-grid > div > label, .itp-choice-grid > label {
    position: relative; display: flex; align-items: center; justify-content: center;
    height: 52px; margin: 0;
    border: 1px solid var(--itp-border-strong); border-radius: var(--itp-radius-sm);
    background: var(--itp-surface); color: var(--itp-text);
    font-size: 16px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.itp-choice-grid label:hover { border-color: #64748b; }
.itp-choice-grid label.active { border-color: var(--itp-text-strong); box-shadow: 0 0 0 1px var(--itp-text-strong); background: var(--itp-primary-soft); }
.itp-choice-grid label.active::after {
    content: "\f00c"; font-family: FontAwesome; position: absolute; right: -1px; bottom: -1px;
    width: 20px; height: 18px; line-height: 18px; font-size: 10px; text-align: center;
    border-radius: 8px 0 7px 0; background: var(--itp-text-strong); color: var(--itp-surface);
}
.itp-choice-grid .custommoney { height: 100%; border: 0 !important; background: transparent !important; text-align: center; font-size: 16px; font-weight: 600; box-shadow: none !important; }
.itp-choice-grid.row-paytype img { height: 24px; }
html.dark .itp-choice-grid.row-paytype label { background: #f5f5f5; }
.itp-section-title { margin: 0 0 12px; font-size: 15px; font-weight: 600; color: var(--itp-text-strong); }

/* 登录 / 注册 / 绑定 */
.itp-auth-card { max-width: 460px; margin: -64px auto 0; position: relative; }
.itp-auth-tabs { display: flex; border-bottom: 1px solid var(--itp-border); }
.itp-auth-tabs a { flex: 1; padding: 16px 0; text-align: center; font-size: 16px; font-weight: 600; color: var(--itp-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.itp-auth-tabs a.active { color: var(--itp-text-strong); border-bottom-color: var(--itp-text-strong); }
.itp-auth-card .itp-card-body { padding: 26px 30px 30px; }
.itp-auth-card .form-control { height: 42px; }
.itp-auth-card .input-group-btn > .btn { height: 42px !important; line-height: 28px; }
.itp-auth-card .input-group-btn img { height: 40px; }
.itp-auth-card .control-label { font-weight: 500; margin-bottom: 6px; }
.itp-auth-card .checkbox { margin: 0; }
.itp-auth-card .itp-auth-row { display: flex; align-items: center; justify-content: space-between; }
.itp-auth-card .btn-block + .btn-block { margin-top: 10px; }
.itp-auth-card .social-login { margin-top: 14px; }
.itp-has-auth .itp-hero { padding-bottom: 96px; }
.itp-has-auth .itp-hero-inner { justify-content: center; text-align: center; margin: 0 auto; }
/* 第三方登录按钮（third 插件注入）使用品牌色 */
.itp-auth-card .social-login .btn { color: #fff; border: 0; height: 42px; line-height: 28px; }
.itp-auth-card .social-login .btn-success { background: #07c160; }
.itp-auth-card .social-login .btn-info { background: #12b7f5; }
.itp-auth-card .social-login .btn-danger { background: #e6162d; }
.itp-auth-card .social-login .btn:hover { filter: brightness(.94); color: #fff; }

/*
 * 会员中心内页表单全宽：标签固定 col-sm-2，输入列统一占满右侧剩余宽度。
 * 用样式统一覆盖而非逐个改模板，是为了把插件注入的行（第三方登录、文档模型扩展字段等）一并铺满。
 * 仅作用于 .itp-main 内（Layer 弹窗挂在 body 下，不受影响）
 */
@media (min-width: 768px) {
    .itp-main .form-horizontal .form-group > div[class*="col-sm-"]:not(.control-label) { width: 83.33333333%; }
    .itp-main .form-horizontal .form-group > .control-label[class*="col-sm-"] { width: 16.66666667%; }
}
@media (min-width: 1400px) {
    /* 超宽屏标签列不必按比例变宽，固定 160px，其余给输入 */
    .itp-main .form-horizontal .form-group > .control-label[class*="col-sm-"] { width: 160px; }
    .itp-main .form-horizontal .form-group > div[class*="col-sm-"]:not(.control-label) { width: calc(100% - 160px); }
}

/* ========== 8. 响应式 ========== */
@media (max-width: 1199px) {
    .itp-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
    /* 侧边栏变为抽屉，由 body.sidebar-open 控制（frontend.js 已支持滑动手势与 .sidebar-toggle） */
    .itp-sidebar { transform: translateX(-100%); box-shadow: none; }
    body.sidebar-open .itp-sidebar { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.35); }
    .itp-has-sidebar .itp-wrapper { margin-left: 0; }
    .itp-sidebar-close { display: inline-flex; }
    .itp-menu-toggle { display: inline-flex; }
    body.sidebar-open .itp-backdrop { display: block; position: fixed; inset: 0; z-index: 1035; background: rgba(0,0,0,.45); }
    body.sidebar-open { overflow: hidden; }
    .itp-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .itp-header { padding: 0 12px; gap: 6px; }
    .itp-breadcrumb { display: none; }
    .itp-header-divider { display: none; }
    .itp-account > a span { display: none; }
    .itp-hero { padding: 22px 16px; }
    .itp-hero h1 { font-size: 20px; }
    .itp-hero p { font-size: 13px; margin-top: 6px; }
    .itp-hero-avatar { width: 52px; height: 52px; }
    .itp-hero-stats { font-size: 13px; gap: 4px 12px; }
    .itp-main { padding: 14px 12px; }
    .itp-card-header { padding: 14px 16px; }
    .itp-card-body { padding: 16px; }
    .itp-card-tools:has(.itp-search) { margin-left: 0; width: 100%; }
    .itp-search, .itp-search .form-control { min-width: 0; flex: 1; }
    .itp-grid-2, .itp-grid-3 { grid-template-columns: minmax(0, 1fr); }
    .itp-grid-quick { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
    .itp-item { gap: 12px; }
    .itp-thumb { flex-basis: 104px; width: 104px; }
    .itp-item-title { font-size: 15px; }
    .itp-stat-value { font-size: 20px; }
    .itp-auth-card { margin-top: -48px; }
    .itp-auth-card .itp-card-body { padding: 20px 18px 24px; }
    .itp-footer { padding: 32px 16px; margin-top: 24px; }
    .itp-guest-links .btn { padding: 5px 10px; }
    /* form-horizontal 在手机上标签左对齐 */
    .itp-body .form-horizontal .control-label { text-align: left; margin-bottom: 6px; }
}
