/* 控制台样式：借鉴成熟后台风格，左侧深色菜单 + 浅灰内容区 + 卡片 */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --brand: #2563eb; --brand-d: #1d4ed8;
  --sidebar: #1e2733; --sidebar-t: #9aa6b6;
  --bg: #f4f6f9; --card: #fff; --line: #e8ebf0;
  --text: #1f2329; --muted: #8a94a6; --danger: #dc2626;
}
body { font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
       background: var(--bg); color: var(--text); font-size: 14px; }
.hidden { display: none !important; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }

.btn { border: none; border-radius: 7px; padding: 8px 16px; background: var(--brand);
       color: #fff; font-size: 14px; cursor: pointer; transition: .15s; }
.btn:hover { background: var(--brand-d); }
.btn.ghost { background: #dbe2ec; color: var(--text); }
.btn.ghost:hover { background: #cbd5e1; }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #b91c1c; }
.btn-export { background: #4caf50; color: #fff; }
.btn-export:hover { background: #43a047; }
input { padding: 8px 11px; border: 1px solid #d5dae2; border-radius: 7px; font-size: 14px; }
input:focus { outline: none; border-color: var(--brand); }

/* 登录 */
.login-wrap { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-box { background: #fff; padding: 44px 40px; border-radius: 14px; width: 380px;
             box-shadow: 0 8px 40px rgba(0,0,0,.10); text-align: center; }
.login-logo { font-size: 22px; font-weight: 700; color: var(--brand); margin-bottom: 6px; }
.login-box h1 { font-size: 16px; font-weight: 500; color: var(--muted); margin-bottom: 26px; }
.login-box input { width: 100%; margin-bottom: 14px; }
.login-box button { width: 100%; padding: 10px; }
.err { color: var(--danger); margin-top: 12px; min-height: 18px; font-size: 13px; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 210px; background: var(--sidebar); color: var(--sidebar-t);
           display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; }
.brand { padding: 20px 22px; font-size: 18px; font-weight: 700; color: #fff;
         border-bottom: 1px solid rgba(255,255,255,.08); }
.menu { padding: 12px 0; flex: 1; }
.menu-item { display: block; padding: 12px 22px; cursor: pointer; font-size: 15px;
             border-left: 3px solid transparent; transition: .15s; }
.menu-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.menu-item.active { background: rgba(37,99,235,.16); color: #fff; border-left-color: var(--brand); }
.sidebar-foot { padding: 16px 22px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; }
.sidebar-foot a { cursor: pointer; }
.sidebar-foot a:hover { color: #fff; }

.main { flex: 1; margin-left: 210px; padding: 22px 26px; }
.topbar { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 20px; font-weight: 600; }
.page-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.batch-sel { padding: 6px 10px; border: 1px solid #d5dae2; border-radius: 6px; font-size: 13px; background: #fff; cursor: pointer; }
.table-title { font-size: 16px; font-weight: 600; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.topbar h2 { font-size: 20px; font-weight: 600; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
        padding: 18px 20px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.03); }
.card h3 { font-size: 15px; margin-bottom: 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 18px; }
.stat { text-align: center; padding: 26px 18px; }
.stat-v { font-size: 30px; font-weight: 700; color: var(--brand); }
.stat-v.green { color: #4caf50; }
.stat-v.red { color: #dc2626; }
.stat-v.orange { color: #e08a00; }
.stat-t { color: var(--muted); margin-top: 6px; }

/* 总库筛选条（参考 Layui 排版：标签左+控件右、统一高度、装进浅色条） */
.mfilter-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; }
.mfilter-bar .mf-item { display: flex; align-items: center; gap: 7px; }
.mfilter-bar .mf-item > label { color: #1f2329; font-size: 13px; white-space: nowrap; }
.mfilter-bar .mf-input { height: 32px; border: 1px solid #d5dae2; border-radius: 6px; padding: 0 9px; font-size: 13px; background: #fff; width: auto; }
.mfilter-bar select.mf-input { min-width: 88px; }
.mfilter-bar .mf-kw { width: 220px; }
.mfilter-bar .mf-num { width: 76px; }
.mfilter-bar .mf-range { display: flex; align-items: center; gap: 4px; }
.mfilter-bar .mf-reset { height: 32px; border: none; border-radius: 6px; background: #8a94a6; color: #fff; padding: 0 16px; cursor: pointer; font-size: 13px; }
.mfilter-bar .mf-reset:hover { background: #6b7684; }

/* 占位页 */
.placeholder { text-align: center; padding: 70px 20px; }
.ph-title { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.ph-desc { color: var(--muted); }

/* 表格 */
.table-card { padding: 0; overflow: visible; background: transparent; border: none; box-shadow: none; border-radius: 0; }
.table-wrap { overflow: visible; }
/* 右侧纵向滚动条美化；底部横向滚动条隐藏（仍可滚动/Shift+滚轮查看） */
.table-wrap::-webkit-scrollbar { width: 8px; height: 0; }
.table-wrap::-webkit-scrollbar-thumb { background: rgba(0,0,0,.16); border-radius: 4px; }
.table-wrap::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.28); }
table { border-collapse: collapse; width: 100%; table-layout: fixed; white-space: nowrap; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
td { overflow: hidden; text-overflow: ellipsis; }
.resizer { position: absolute; right: 0; top: 0; height: 100%; width: 6px; cursor: col-resize; user-select: none; }
.resizer:hover, .resizer.active { background: rgba(37,99,235,.35); }
th { background: #fafbfc; position: sticky; top: 0; cursor: pointer; font-weight: 600; color: #4a5568; }
th:hover { background: #f0f3f7; }
tbody tr:hover { background: #f7f9fc; }
.bottombar { display: flex; justify-content: center; align-items: center; gap: 20px; padding: 14px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pager { display: flex; gap: 10px; align-items: center; }
.pagesize { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-size: 13px; }
.bottombar .muted { color: var(--text); }
.pagesize select { padding: 5px 8px; border: 1px solid #d5dae2; border-radius: 6px; font-size: 13px; background: #fff; cursor: pointer; }

.col-panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px;
             margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 16px; }
.col-panel label { display: flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; }
textarea { width: 100%; border: 1px solid #d5dae2; border-radius: 8px; padding: 10px 12px; font-size: 13px; font-family: inherit; resize: vertical; line-height: 1.6; }
textarea:focus { outline: none; border-color: var(--brand); }
.progress { margin-top: 14px; width: 320px; background: #eef1f5; border-radius: 8px; height: 22px; position: relative; overflow: hidden; }
.progress .bar { height: 100%; width: 0; background: var(--brand); transition: width .4s; }
.progress .ptext { position: absolute; left: 0; right: 0; top: 0; line-height: 22px; text-align: center; font-size: 12px; color: #4caf50; font-weight: 600; }
.count { color: var(--text); font-size: 13px; margin-top: 6px; }
.view-start p.muted { color: var(--text); }

/* 单元格可点击提示 */
tbody td { cursor: pointer; }
tbody td:hover { color: var(--brand); }

/* 内联浮层：贴着被点击单元格下方展开，展示完整内容 */
.cell-pop { position: fixed; z-index: 200; background: #fff; border: 1px solid var(--line);
            border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.18); width: min(520px, 90vw);
            max-height: 60vh; display: flex; flex-direction: column; }
.cp-label { font-size: 12px; color: var(--muted); padding: 10px 14px 0; }
.cp-value { padding: 6px 14px 10px; font-size: 14px; color: var(--text); overflow: auto;
            white-space: pre-wrap; word-break: break-all; user-select: text; }
.cp-foot { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--line); }

/* 账号页（登录/账号池） */
.sec-title { font-size: 16px; font-weight: 600; }
.tip { color: var(--text); margin-top: 6px; font-size: 13px; }
.qr-box { margin-top: 16px; text-align: center; }
.qr-box img { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 10px; }
.qr-tip { color: var(--muted); font-size: 13px; margin-top: 8px; }
.acc-tbl { width: 100%; border-collapse: collapse; table-layout: auto; }
.acc-tbl th, .acc-tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: normal; word-break: break-all; }
.acc-tbl th { color: #4a5568; font-weight: 600; background: #fafbfc; }

/* 隐藏数字输入框（跳转页码框）的上下微调箭头 */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* ---------- 私信页：子标签 + 卡片表 + 编辑弹窗 ---------- */
.dm-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.dm-tab { padding: 9px 20px; font-size: 14px; color: var(--muted); cursor: pointer;
          border-bottom: 2px solid transparent; margin-bottom: -1px; transition: .15s; }
.dm-tab:hover { color: var(--text); }
.dm-tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.dm-empty { text-align: center; color: var(--muted); padding: 34px 0; font-size: 13px; }

/* 私信的两张表用自动布局：列多且长短不一，固定宽度会挤 */
.dm-tbl { table-layout: auto; white-space: normal; }
.dm-tbl th, .dm-tbl td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line);
                         font-size: 13px; word-break: break-all; }
.dm-tbl th { color: #4a5568; font-weight: 600; background: #fafbfc; }
.dm-tbl td { overflow: visible; text-overflow: clip; cursor: default; }
.dm-tbl tbody tr:hover { background: #f7f9fc; }
.dm-ico { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; background: #eef1f5; display: block; }
/* 操作列：五个按钮排成一行、宽度统一，不再换行错开 */
.dm-acts { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.dm-acts .btn { flex: 0 0 auto; min-width: 56px; padding: 5px 8px; font-size: 12px;
                text-align: center; white-space: nowrap; }
.btn.off { background: #c3cad4; color: #4a5568; }
.btn.off:hover { background: #b2bbc8; }
/* 停用中的卡片：备注、标题与描述变灰，不靠单独状态列也能一眼看出来 */
.dm-tbl td.dim { color: #a6afbc; }
.tag-on { color: #4caf50; font-weight: 600; }
.tag-off { color: var(--muted); }

/* 居中弹窗（卡片编辑） */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 300;
              display: flex; align-items: center; justify-content: center; }
.modal { background: #fff; border-radius: 12px; width: min(560px, 92vw); max-height: 88vh;
         display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.modal-head { display: flex; justify-content: space-between; align-items: center;
              padding: 16px 20px; border-bottom: 1px solid var(--line); font-size: 15px; }
.modal-x { cursor: pointer; color: var(--muted); font-size: 22px; line-height: 1; padding: 0 4px; }
.modal-x:hover { color: var(--text); }
.modal-body { padding: 18px 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.fld { margin-bottom: 14px; }
.fld > label { display: block; font-size: 13px; color: #1f2329; margin-bottom: 5px; }
.fld input[type=text], .fld input:not([type]), .fld select { width: 100%; padding: 8px 11px;
        border: 1px solid #d5dae2; border-radius: 7px; font-size: 14px; }
.fld-tip { font-size: 12px; color: var(--muted); margin-top: 4px; display: block; }
.fld .chk { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
.fld .chk input { width: auto; }
.icon-row { display: flex; align-items: center; gap: 10px; }
.icon-prev { width: 44px; height: 44px; border-radius: 8px; object-fit: cover;
             background: #eef1f5; border: 1px solid var(--line); }
.icon-prev:not([src]), .icon-prev[src=""] { display: none; }

/* 右上角浮层提示（卡片保存/复制/删除等操作的即时反馈） */
.toast-box { position: fixed; top: 22px; right: 26px; z-index: 400; background: #1f2329; color: #fff;
             padding: 11px 20px; border-radius: 8px; font-size: 13px; max-width: 60vw;
             box-shadow: 0 6px 24px rgba(0,0,0,.22); opacity: 0; transform: translateY(-10px);
             transition: .22s; pointer-events: none; word-break: break-all; }
.toast-box.show { opacity: 1; transform: translateY(0); }

/* ========== 卡片预览弹窗：手机外形 + 分步预览 ========== */
.pv-modal { width: min(430px, 94vw); display: flex; flex-direction: column; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
/* 停用卡提醒 */
.pv-warn { margin: 12px 20px 0; padding: 9px 12px; background: #fff4e5; border: 1px solid #ffd9a0;
           color: #8a5200; border-radius: 8px; font-size: 12.5px; line-height: 1.6; }
/* 中转页地址行 */
.pv-addr { display: flex; align-items: center; gap: 8px; margin: 12px 20px 0; }
.pv-addr span { flex: 1 1 auto; min-width: 0; font-size: 11.5px; color: var(--muted);
                overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-addr .btn { flex: 0 0 auto; }
/* 手机外壳 */
.pv-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 12px 18px 0; }
.pv-phone { width: 330px; margin: 0 auto; border: 9px solid #1f2329; border-radius: 30px;
            background: #f4f6f9; overflow: hidden; }
.pv-topbar { height: 26px; background: #1f2329; color: #fff; font-size: 11px;
             display: flex; align-items: center; justify-content: space-between; padding: 0 14px; }
/* 屏高跟着窗口走：屏幕不够高时手机屏自己缩（内容在屏内滚），而不是把整个弹窗撑出屏幕
   225 = 弹窗内除屏以外的固定占用(标题/地址行/手机壳与顶栏/说明文字/底栏)，实测再留 20 余量 */
.pv-screen { height: clamp(240px, calc(88vh - 245px), 470px);
             overflow: auto; background: #f4f6f9; position: relative; }
.pv-frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.pv-cap { margin-top: 10px; font-size: 12px; color: #5a6675; text-align: center;
          line-height: 1.6; }
.pv-foot { justify-content: space-between; align-items: center; }
/* 第1步：聊天里的卡片示意 */
.pv-chat { padding: 12px; min-height: 100%; background: #f1f2f4; }
.pv-tag { display: inline-block; font-size: 11px; color: #fff; background: rgba(31,35,41,.62);
          padding: 3px 9px; border-radius: 10px; margin-bottom: 10px; }
.pv-them { display: flex; justify-content: flex-start; }
.pv-bubble { max-width: 88%; background: #fff; border-radius: 12px; padding: 9px 10px;
             box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.pv-bt { font-size: 13px; color: #8a94a6; margin-bottom: 8px; }
.pv-linkcard { display: flex; gap: 9px; align-items: center; padding: 9px; background: #fafbfc;
               border: 1px solid var(--line); border-radius: 9px; }
.pv-linkcard img { width: 44px; height: 44px; border-radius: 7px; object-fit: cover; flex: 0 0 auto; }
.pv-noico { width: 44px; height: 44px; border-radius: 7px; background: #e8edf5; color: #8a94a6;
            display: flex; align-items: center; justify-content: center; font-size: 18px; flex: 0 0 auto; }
.pv-lc-txt { min-width: 0; }
.pv-lc-txt b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-lc-txt span { display: block; font-size: 12px; color: #5a6675; margin-top: 3px; line-height: 1.5;
                  max-height: 36px; overflow: hidden; }
.pv-src { font-size: 11px; color: #8a94a6; margin-top: 6px; }


