
/* 卡片/表格 */
.card { background: #fff; border-radius: 10px; padding: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.card h3 { font-size: 16px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid #f1f5f9; }
.data-table th { color: #64748b; font-weight: 600; background: #f8fafc; }
.data-table tr:hover td { background: #f9fafb; }
.data-table tr.row-warn td { background: #fef2f2; }
.data-table tr.row-warn:hover td { background: #fee2e2; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .ops { white-space: nowrap; }
.data-table .empty { text-align: center; color: #9ca3af; padding: 30px; }
.muted { color: #9ca3af; font-size: 12px; margin-top: 10px; }
.btn { padding: 7px 14px; border: 1px solid #d1d5db; background: #fff; color: #374151; border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn:hover { background: #f3f4f6; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
/* 色类必须放在 .btn 之后，否则同特异性下会被白底覆盖（修复白字白底） */
.btn-primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.btn-primary:hover { background: #1d4ed8; }
.btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-danger:hover { background: #b91c1c; }
.btn-primary:not(.login-card .btn-primary) { width: auto; margin-top: 0; padding: 7px 14px; font-size: 13px; }
.lnk { background: none; border: none; color: #2563eb; cursor: pointer; font-size: 13px; padding: 0 6px; }
.lnk.danger { color: #dc2626; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-box { background: #fff; border-radius: 14px; width: 520px; max-width: 92vw; max-height: 88vh; overflow-y: auto; padding: 30px 32px; box-shadow: 0 20px 60px rgba(0,0,0,.18); }
.modal-box.modal-md { width: 580px; }
.modal-box.modal-lg { width: 780px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.modal-title { font-size: 19px; font-weight: 700; line-height: 1.4; padding-right: 8px; }
.modal-close { flex-shrink: 0; width: 34px; height: 34px; border: none; background: #f1f5f9; color: #64748b; border-radius: 9px; font-size: 22px; line-height: 1; cursor: pointer; transition: background .15s, color .15s; margin: -2px -4px 0 0; }
.modal-close:hover { background: #e2e8f0; color: #1f2937; }
.subpage { background: #fff; border-radius: 12px; min-height: 100%; }
.subpage-bar { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid #eef2f7; position: sticky; top: 0; background: #fff; z-index: 5; border-radius: 12px 12px 0 0; }
.subpage-back { flex-shrink: 0; }
.subpage-title { font-size: 18px; font-weight: 700; margin: 0; flex: 1; }
.subpage-bar .modal-close { margin: 0; }
.subpage-body { padding: 18px; }
/* 浮动层（查找聊天记录等）：覆盖在会话之上，关闭后保留下方会话上下文，不会回到会话列表 */
.float-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; }
.float-modal-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.45); }
.float-modal-panel { position: relative; z-index: 1; width: 100%; max-width: 720px; max-height: 90vh; display: flex; flex-direction: column; background: #fff; border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.25); overflow: hidden; }
.float-modal-bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid #eef2f7; flex-shrink: 0; }
.float-modal-title { font-size: 16px; font-weight: 700; margin: 0; flex: 1; }
.float-modal-body { padding: 16px; overflow: auto; }
.subpage-foot { display: flex; justify-content: flex-end; gap: 12px; padding: 14px 18px; border-top: 1px solid #eef2f7; position: sticky; bottom: 0; background: #fff; border-radius: 0 0 12px 12px; }
.inline-confirm { display: inline-flex; align-items: center; gap: 8px; margin-left: 10px; padding: 5px 10px; background: #fff5f5; border: 1px solid #fecaca; border-radius: 8px; vertical-align: middle; }
.inline-confirm .ic-msg { font-size: 13px; color: #dc2626; }
.modal-foot { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-label { display: block; font-size: 13px; color: #374151; margin-bottom: 8px; font-weight: 500; }
/* 统一搜索框组件：替代各处散乱写法的搜索框，保证视觉一致 */
.search-box { display: inline-flex; align-items: center; gap: 8px; width: 100%; max-width: 320px; padding: 9px 14px; background: #fff; border: 1px solid #d1d5db; border-radius: 8px; transition: border-color .15s, box-shadow .15s; box-sizing: border-box; }
.search-box:focus-within { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.search-box .sb-ico { flex: 0 0 auto; color: #9ca3af; display: inline-flex; }
.search-box .sb-input { flex: 1 1 auto; border: none; outline: none; background: transparent; font-size: 14px; color: #1f2937; padding: 0; min-width: 0; }
.search-box .sb-input::placeholder { color: #9ca3af; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: #374151; user-select: none; }
.switch input { display: none; }
.switch-track { position: relative; width: 40px; height: 22px; background: #cbd5e1; border-radius: 999px; transition: background .2s; flex: 0 0 auto; }
.switch-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .switch-track { background: #2563eb; }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch-text { line-height: 22px; }
.form-input { width: 100%; padding: 11px 14px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.form-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.api-field { margin-bottom: 18px; }
.api-field .form-input { min-height: 46px; font-size: 15px; line-height: 1.5; }
.api-field textarea.form-input { min-height: 96px; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; resize: none; }
textarea.form-input { resize: none; }
.route-chip { display: inline-block; background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe; border-radius: 999px; padding: 1px 9px; font-size: 12px; margin-right: 4px; }

/* 标签 */
.tag { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; }
.tag-green { background: #dcfce7; color: #15803d; }
.tag-blue { background: #dbeafe; color: #1d4ed8; }
.tag-orange { background: #ffedd5; color: #c2410c; }
.tag-red { background: #fee2e2; color: #b91c1c; }
.tag-gray { background: #f1f5f9; color: #64748b; }
.tag-cyan { background: #cffafe; color: #0e7490; }
.tag-locked { background: #ede9fe; color: #6d28d9; }
.badge { display: inline-block; min-width: 18px; padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; line-height: 1.6; text-align: center; }
.badge-red { background: #ef4444; color: #fff; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 12px; margin-bottom: 8px; }
.stat-card { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 16px; }
.stat-value { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.stat-label { font-size: 12px; color: #64748b; }
.tabbar { display: flex; gap: 8px; }
.filter-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.filter-bar .form-input { width: auto; }

.modal-ops { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.profile { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.profile-sec { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 16px; }
.profile-sec .sec-t { font-size: 13px; font-weight: 700; color: #475569; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid #e5e7eb; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; border-bottom: 1px dashed #eef2f7; }
.kv:last-child { border-bottom: none; }
.kv .k { color: #94a3b8; flex-shrink: 0; }
.kv .v { color: #1f2937; text-align: right; font-weight: 500; word-break: break-all; }

/* 系统设置：首页装修画布与运行时叠加层 */
.hw-canvas-wrap { width: 100%; background: #f1f5f9; border: 1px dashed #cbd5e1; border-radius: 8px; overflow: hidden; }
.hw-canvas { position: relative; transform-origin: top left; background: #f8fafc; }
.hw-item { position: absolute; box-sizing: border-box; border: 1px dashed #2563eb; background: rgba(255,255,255,.65); padding: 4px 6px; cursor: move; user-select: none; overflow: hidden; }
.hw-item img { display: block; width: 100%; }
.hw-del { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; line-height: 16px; text-align: center; background: #ef4444; color: #fff; border-radius: 50%; cursor: pointer; font-size: 13px; display: none; z-index: 6; }
.hw-item:hover .hw-del { display: block; }
.hw-resize { position: absolute; right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; background: #2563eb; border-top-left-radius: 4px; z-index: 6; }
#login_overlay { position: absolute; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.lw-item { position: absolute; pointer-events: none; }
.st-text-props { display: none; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px; padding: 10px 12px; border: 1px dashed #cbd5e1; border-radius: 8px; background: #f1f5f9; }
.st-text-props.show { display: flex; }
.hw-txt { display: block; user-select: none; }
.hw-item.hw-selected { outline: 2px solid #2563eb; outline-offset: 2px; z-index: 5; }
.st-text-props .form-label { font-size: 12px; margin-bottom: 4px; display: block; }
.st-bg-thumb .btn { padding: 1px 6px; border-radius: 50%; line-height: 1; font-size: 13px; }

/* 平台管理：tab 切换 */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid #e5e7eb; }
.tabs .tab { padding: 9px 16px; cursor: pointer; color: #64748b; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs .tab:hover { color: #374151; }
.tabs .tab.active { color: #2563eb; font-weight: 700; border-bottom-color: #2563eb; }
.pf-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

/* 登录页：注册入口 */
.reg-entry { margin-top: 14px; text-align: center; }
.reg-entry .btn-ghost { font-size: 13px; color: #2563eb; text-decoration: underline; padding: 6px 4px; }
.radio-row { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; padding: 6px 0; }
.radio-row label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.reg-sub { border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; background: #fafbff; }
.reg-sub-title { font-weight: 600; color: #334155; margin-bottom: 8px; }

.onb-wrap { max-width: 760px; margin: 0 auto; }
.onb-steps { display: flex; gap: 10px; margin: 18px 0; }
.onb-step { flex: 1; display: flex; align-items: center; gap: 8px; padding: 12px; border: 1px solid #e5e7eb; border-radius: 8px; color: #94a3b8; font-size: 14px; background: #fff; }
.onb-step span { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; background: #e2e8f0; color: #64748b; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.onb-step.onb-done { border-color: #16a34a; color: #16a34a; }
.onb-step.onb-done span { background: #16a34a; color: #fff; }
.onb-step.onb-current { border-color: #2563eb; color: #2563eb; }
.onb-step.onb-current span { background: #2563eb; color: #fff; }
.reg-detail { font-size: 13px; line-height: 1.9; color: #334155; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 6px; padding: 10px 12px; }
.reg-detail a { color: #2563eb; }

/* 登录页：记住密码 / 注册 / 忘记密码 */
.login-extras { display: flex; gap: 14px; align-items: center; margin: 10px 0 4px; font-size: 13px; color: #64748b; }
.login-extras .chk-label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; user-select: none; }
.login-extras a { color: #2563eb; text-decoration: none; }
.login-extras a:hover { text-decoration: underline; }

/* 找回密码 */
.forgot-tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid #e5e7eb; }
.ftab { padding: 9px 16px; cursor: pointer; color: #64748b; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ftab:hover { color: #374151; }
.ftab.active { color: #2563eb; font-weight: 700; border-bottom-color: #2563eb; }
.login-back { text-align: center; margin-top: 12px; font-size: 13px; }
.login-back a { color: #64748b; text-decoration: none; }
.login-back a:hover { color: #2563eb; }
.auth-actions { display: flex; gap: 10px; margin-top: 18px; }
.auth-actions .btn, .auth-actions .btn-primary { flex: 1; width: auto; margin-top: 0; }

/* ===== 间距与排版优化（缓解文字排布拥挤） ===== */
.card { padding: 22px; border-radius: 12px; }
.card-head { margin-bottom: 18px; }
.card h3 { font-size: 17px; line-height: 1.5; }
.card + .card { margin-top: 18px; }
.api-field { margin-bottom: 22px; }
.api-field > .form-label { margin-bottom: 10px; }
.form-grid { gap: 20px; }
.subpage-body { padding: 22px 24px; }
.data-table th, .data-table td { padding: 11px 14px; }
.data-table th { font-size: 13px; }
.section { margin-bottom: 22px; }
.section + .section { margin-top: 6px; }
.list-row { padding: 14px 6px; }
.list-row + .list-row { border-top: 1px solid #f1f5f9; }
.muted { font-size: 12.5px; line-height: 1.6; margin-top: 12px; }
.btn { padding: 8px 16px; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-title { font-size: 19px; font-weight: 700; line-height: 1.5; margin: 0 0 16px; }
.stats-grid { gap: 16px; }
.stat-card { padding: 16px 18px; }
/* 图标与文字间距自适应：app-ico 出现在标题/按钮前时，给一点左侧呼吸位 */
.app-ico + * , h3 .app-ico, .btn .app-ico { margin-right: .35em; }
.app-ico { margin-right: .15em; }
