/* ============================================================
   毫秒科技管理后台 v2 —— 全局样式
   设计：专业深色侧边栏 + 浅色内容区 + 主色调（品牌蓝）
   响应式：桌面端固定侧边栏；移动端侧边栏变为抽屉 + 顶部快捷发布
   ============================================================ */
:root {
    --primary: #2f6bff;
    --primary-dark: #1f55d9;
    --primary-light: #eaf0ff;
    --sidebar-bg: #10182e;
    --sidebar-active: #2f6bff;
    --sidebar-text: #b6c2d9;
    --bg: #f2f5fa;
    --card-bg: #ffffff;
    --text: #1f2a3d;
    --text-2: #5b6b85;
    --text-3: #94a3b8;
    --border: #e6ebf3;
    --danger: #e5484d;
    --ok: #22a06b;
    --warning: #e8930c;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(16, 24, 46, .06);
    --topbar-h: 60px;
    --sidebar-w: 232px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }
input, select, textarea { font-family: inherit; }

/* ---------- 通用按钮 ---------- */
.tn-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 18px; border: 1px solid var(--border); border-radius: 8px;
    background: #fff; color: var(--text); font-size: 14px;
    transition: all .2s; white-space: nowrap; line-height: 1.4;
}
.tn-btn:hover { border-color: var(--primary); color: var(--primary); }
.tn-btn:disabled { opacity: .5; cursor: not-allowed; }
.tn-btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.tn-btn-primary:hover { background: var(--primary-dark); color: #fff; }
.tn-btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.tn-btn-plain { background: transparent; border-color: var(--border); color: var(--text-2); }
.tn-btn-block { width: 100%; }
.tn-btn-lg { padding: 12px 24px; font-size: 15px; border-radius: 10px; }
.tn-btn-sm { padding: 4px 10px; font-size: 13px; border-radius: 6px; }
.tn-btn-ai {
    background: linear-gradient(135deg, #7c5cff, #2f6bff);
    border: none; color: #fff;
}
.tn-btn-ai:hover { filter: brightness(1.1); color: #fff; }
.tn-icon-btn {
    width: 36px; height: 36px; border: none; background: transparent;
    font-size: 20px; color: var(--text-2); border-radius: 8px;
}
.tn-icon-btn:hover { background: var(--primary-light); color: var(--primary); }

/* ---------- 输入控件 ---------- */
.tn-input {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border);
    border-radius: 8px; background: #fff; font-size: 14px; color: var(--text);
    outline: none; transition: border-color .2s, box-shadow .2s;
}
.tn-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,107,255,.12); }
.tn-input-inline { width: 220px; }
.tn-select-inline { width: auto; }
.tn-textarea { resize: vertical; min-height: 80px; }
/* 多选列表框（如「关联MSAPI应用」）：固定行高，避免撑满表单 */
.tn-select-multiple { padding: 4px; min-height: 120px; }
.tn-select-multiple option { padding: 5px 8px; border-radius: 4px; }
.tn-input::placeholder { color: var(--text-3); }

/* ---------- 徽章 ---------- */
.tn-badge {
    display: inline-block; padding: 2px 10px; border-radius: 20px;
    font-size: 12px; background: var(--bg); color: var(--text-2);
    white-space: nowrap;
}
.tn-badge-ok { background: #e7f7ef; color: var(--ok); }
.tn-badge-gray { background: #eef1f6; color: var(--text-3); }
/* 扩展配色：用于区分密钥类型、运行状态等取值 */
.tn-badge-cyan { background: #e3f6fb; color: #0e7490; }
.tn-badge-teal { background: #e2f6f2; color: #0f766e; }
.tn-badge-green { background: #e8f8ea; color: #15803d; }
.tn-badge-orange { background: #fef3e2; color: #b45309; }
.tn-badge-purple { background: #f1ebfe; color: #6d28d9; }
.tn-badge-indigo { background: #e8ecfe; color: #3730a3; }
.tn-badge-pink { background: #fdebf3; color: #be185d; }
.tn-badge-violet { background: #f3ebfe; color: #7c3aed; }
.tn-badge-dark { background: #eceff4; color: #334155; }

/* ---------- 单元格悬浮提示 ---------- */
.tn-tip { border-bottom: 1px dashed var(--text-3); cursor: default; }
#tn-tip-float {
    position: fixed; z-index: 9999; display: none; max-width: 360px;
    padding: 8px 12px; border-radius: 8px; background: #1f2937; color: #fff;
    font-size: 12px; line-height: 1.75; white-space: pre-line; word-break: break-all;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .18); pointer-events: none;
}
#tn-tip-float.tn-tip-show { display: block; }
.tn-badge-blue { background: var(--primary-light); color: var(--primary); }
.tn-badge-red { background: #fdecec; color: var(--danger); }

/* ---------- Toast ---------- */
.tn-toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-20px);
    background: rgba(16,24,46,.9); color: #fff; padding: 10px 22px; border-radius: 8px;
    font-size: 14px; z-index: 99999; opacity: 0; transition: all .25s; pointer-events: none;
    max-width: 90vw;
}
.tn-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.tn-toast.ok { background: rgba(34,160,107,.95); }
.tn-toast.err { background: rgba(229,72,77,.95); }

/* ---------- Loading ---------- */
.tn-loading { position: fixed; inset: 0; z-index: 99998; display: none; }
.tn-loading.show { display: block; }
.tn-loading-mask { position: absolute; inset: 0; background: rgba(255,255,255,.55); backdrop-filter: blur(1px); }
.tn-loading-box {
    position: absolute; top: 42%; left: 50%; transform: translate(-50%,-50%);
    background: #fff; border-radius: 12px; padding: 22px 30px; text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,.12);
}
.tn-loading-spinner {
    width: 28px; height: 28px; margin: 0 auto 10px; border-radius: 50%;
    border: 3px solid var(--primary-light); border-top-color: var(--primary);
    animation: tn-spin .8s linear infinite;
}
.tn-loading-text { font-size: 13px; color: var(--text-2); }
@keyframes tn-spin { to { transform: rotate(360deg); } }

/* ---------- Modal ---------- */
.tn-modal-overlay {
    position: fixed; inset: 0; z-index: 9990; background: rgba(16,24,46,.45);
    display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px;
    opacity: 0; transition: opacity .2s; overflow-y: auto;
}
.tn-modal-overlay.show { opacity: 1; }
.tn-modal-overlay.hide { opacity: 0; }
.tn-modal {
    background: #fff; border-radius: 14px; width: 100%; max-width: 560px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2); animation: tn-modal-in .22s ease;
}
@keyframes tn-modal-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.tn-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.tn-modal-title { font-size: 16px; font-weight: 600; }
.tn-modal-close { border: none; background: transparent; font-size: 22px; color: var(--text-3); }
.tn-modal-body { padding: 18px 20px; max-height: 68vh; overflow-y: auto; }
.tn-modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.tn-confirm-text { padding: 6px 0 14px; }

/* ---------- 表单 ---------- */
.tn-form-item { margin-bottom: 16px; }
.tn-form-label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-2); }
.tn-required { color: var(--danger); font-style: normal; }
.tn-form-control .tn-input { max-width: 100%; }
.tn-form-tips { font-size: 12px; color: var(--text-3); margin-top: 5px; }
/* 表单分组标题（动态字段分组用） */
.tn-form-section { margin: 18px 0 12px; padding: 6px 10px; font-size: 12.5px; font-weight: 600; color: var(--text-2); background: var(--bg-2, #f5f7fa); border-left: 3px solid var(--primary); border-radius: 3px; }
.tn-form-section:first-child { margin-top: 0; }
.tn-form-row { display: flex; gap: 16px; }
.tn-form-col { flex: 1; }
.tn-radio-group { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.tn-radio, .tn-check { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-size: 14px; }
.tn-radio input, .tn-check input { accent-color: var(--primary); width: 15px; height: 15px; }

/* ---------- 表格 ---------- */
.tn-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.tn-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.tn-card-head h3 { font-size: 15px; }
.tn-table-wrap { overflow-x: auto; }
.tn-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.tn-table th, .tn-table td { padding: 12px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
.tn-table th { background: #f8fafc; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.tn-table tbody tr:hover { background: #fafcff; }
.tn-table .tn-th-op, .tn-table .tn-op { text-align: right; white-space: nowrap; }
.tn-td-title { max-width: 300px; }
.tn-td-title a { color: var(--text); font-weight: 500; }
.tn-td-title a:hover { color: var(--primary); }
.tn-cell-text { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.tn-cell-html { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-cell-html-full { max-width: 480px; white-space: normal; word-break: break-all; line-height: 1.6; }
.tn-share-covers { display: block; }
.tn-share-cover-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed #eee; }
.tn-share-cover-row:last-child { border-bottom: none; }
.tn-share-cover-label { width: 84px; flex: none; font-size: 13px; font-weight: 500; color: var(--text); }
.tn-share-cover-row .tn-config-image { flex: 1; }
.tn-cell-mono { font-family: Consolas, Menlo, monospace; font-size: 12px; }
.tn-empty { text-align: center; color: var(--text-3); padding: 30px 0 !important; }
.tn-link { margin-right: 12px; font-size: 13px; cursor: pointer; }
.tn-link-ok { color: var(--ok); }
.tn-link-danger { color: var(--danger); }
.tn-thumb {
    width: 56px; height: 40px; border-radius: 6px; overflow: hidden;
    background: var(--bg); display: flex; align-items: center; justify-content: center;
}
.tn-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 分页 ---------- */
.tn-pager-wrap { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding-top: 14px; flex-wrap: wrap; }
.tn-page-info { font-size: 13px; color: var(--text-2); margin-right: 8px; }

/* ---------- 页面 ---------- */
.tn-page { padding: 18px; max-width: 1400px; margin: 0 auto; }
.tn-page-head { margin-bottom: 16px; }
.tn-page-head h2 { font-size: 20px; font-weight: 600; }
.tn-page-head p { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.tn-flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tn-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.tn-filter-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }

/* ---------- Tabs ---------- */
.tn-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tn-tab {
    padding: 9px 18px; border: none; background: transparent; font-size: 14px;
    color: var(--text-2); border-bottom: 2px solid transparent; position: relative; top: 1px;
    flex-shrink: 0; white-space: nowrap;
}
.tn-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tn-tab.tn-tab-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ---------- 省市区三级联动 ---------- */
.tn-area-group { display: flex; gap: 8px; }
.tn-area-group .tn-input { flex: 1; min-width: 0; }

/* ---------- 统计卡片 ---------- */
.tn-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tn-stat-card {
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    padding: 18px; text-align: center;
}
.tn-stat-num { font-size: 30px; font-weight: 700; color: var(--primary); }
.tn-stat-name { font-size: 13px; color: var(--text-2); margin-top: 6px; }

/* ---------- 布局：侧边栏 + 主区 ---------- */
.tn-layout { display: flex; min-height: 100vh; }
.tn-sidebar {
    width: var(--sidebar-w); background: var(--sidebar-bg); color: var(--sidebar-text);
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 100;
    display: flex; flex-direction: column;
}
.tn-sidebar-top { flex: 1; overflow-y: auto; padding-bottom: 30px; }
.tn-sidebar-top::-webkit-scrollbar { width: 4px; }
.tn-sidebar-top::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); }
.tn-sidebar-head { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.06); }
.tn-sidebar-logo {
    width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, #7c5cff, #2f6bff);
    color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; flex-shrink: 0;
}
.tn-sidebar-title { color: #fff; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-sidebar-nav { padding: 10px 10px; flex: 1; overflow-y: auto; overflow-x: hidden; }
.tn-menu-group { margin-bottom: 8px; }
.tn-menu-group-title { padding: 10px 10px 6px; font-size: 12px; color: rgba(182,194,217,.55); letter-spacing: 1px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; user-select: none; transition: color .15s; }
.tn-menu-group-title:hover { color: rgba(255,255,255,.85); }
.tn-menu-arrow { font-size: 10px; opacity: .7; transition: transform .2s; }
.tn-menu-group.collapsed .tn-menu-item { display: none; }
.tn-menu-group.collapsed .tn-menu-arrow { transform: rotate(-90deg); }
.tn-menu-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
    color: var(--sidebar-text); margin-bottom: 2px; font-size: 14px; transition: background .15s;
}
.tn-menu-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.tn-menu-item.active { background: var(--sidebar-active); color: #fff; }
.tn-menu-icon { font-size: 16px; width: 20px; text-align: center; }
.tn-menu-badge { margin-left: auto; font-size: 10px; padding: 1px 6px; border-radius: 8px; background: rgba(255,214,102,.15); color: #ffd666; flex-shrink: 0; letter-spacing: 0; }
.tn-topbar-collapse { display: inline-flex; }

/* 侧边栏折叠态（仅桌面端生效） */
.tn-layout.collapsed { --sidebar-w: 64px; }
.tn-layout.collapsed .tn-sidebar-title { display: none; }
.tn-layout.collapsed .tn-sidebar-head { justify-content: center; padding: 18px 8px; }
.tn-layout.collapsed .tn-menu-group-title { display: none; }
.tn-layout.collapsed .tn-menu-item { justify-content: center; padding: 10px 0; }
.tn-layout.collapsed .tn-menu-text, .tn-layout.collapsed .tn-menu-badge { display: none; }

.tn-main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }
.tn-topbar {
    height: var(--topbar-h); background: #fff; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; padding: 0 20px; gap: 12px;
    position: sticky; top: 0; z-index: 50;
}
.tn-topbar-title { font-size: 16px; font-weight: 600; }
.tn-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.tn-topbar-user { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }
.tn-avatar { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; background: var(--primary); display: inline-flex; align-items: center; justify-content: center; }
.tn-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tn-avatar-text { color: #fff; font-weight: 600; font-size: 14px; }
.tn-topbar-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-topbar-logout { display: inline-flex; align-items: center; gap: 5px; }
.tn-logout-icon { vertical-align: -2px; }
/* 左侧 Logo 显示管理员头像 */
.tn-sidebar-logo-img { background: transparent !important; overflow: hidden; border-radius: 10px; }
.tn-sidebar-logo-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tn-topbar-menu { display: none; }
.tn-topbar-collapse { display: none; }
.tn-mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 99; }
.tn-mask.show { display: block; }
.tn-content { flex: 1; }

/* ---------- 登录页 ---------- */
.tn-login {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
    background: linear-gradient(135deg, #10182e 0%, #1c2c55 55%, #2f6bff 130%);
}
.tn-login-panel {
    width: 100%; max-width: 420px; background: #fff; border-radius: 18px; padding: 34px 34px 30px;
    box-shadow: 0 24px 70px rgba(0,0,0,.35);
}
.tn-login-brand { text-align: center; margin-bottom: 24px; }
.tn-login-logo {
    width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 16px;
    background: linear-gradient(135deg, #7c5cff, #2f6bff); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700;
}
.tn-login-brand h1 { font-size: 22px; font-weight: 700; }
.tn-login-brand p { color: var(--text-3); font-size: 13px; margin-top: 6px; }
.tn-login-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.tn-login-tab { flex: 1; padding: 10px; border: none; background: transparent; font-size: 14px; color: var(--text-2); border-bottom: 2px solid transparent; }
.tn-login-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tn-login-body .tn-form-item { margin-bottom: 18px; }
.tn-login-body .tn-btn-lg { margin-top: 6px; }
.tn-wx-login { text-align: center; }
.tn-wx-qr { width: 260px; height: 260px; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; background: #fafbfd; border: 1px dashed var(--border); border-radius: 14px; color: var(--text-3); font-size: 13px; }
.tn-wx-qr-img { width: 240px; height: 240px; }
.tn-wx-fallback { color: var(--primary); }
.tn-wx-err { color: var(--danger); font-size: 13px; }
.tn-wx-tip { color: var(--text-3); font-size: 13px; margin: 4px 0; }

/* ---------- 图集 ---------- */
.tn-atlas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tn-atlas-item {
    position: relative; border-radius: 10px; overflow: hidden; background: var(--bg);
    aspect-ratio: 16/10; cursor: pointer; border: 1px solid var(--border); transition: transform .15s;
}
.tn-atlas-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tn-atlas-item img { width: 100%; height: 100%; object-fit: cover; }
.tn-atlas-item.tn-atlas-selected { border: 2px solid var(--primary, #409eff); }
.tn-atlas-check {
    position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
    background: rgba(0,0,0,.45); color: #fff; font-size: 14px; line-height: 22px; text-align: center;
    display: none; font-weight: bold;
}
.tn-atlas-item.tn-atlas-selected .tn-atlas-check { display: block; background: var(--primary, #409eff); }
.tn-atlas-item-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 8px 6px; font-size: 12px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.tn-atlas-item-del {
    position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
    border: none; background: rgba(0,0,0,.55); color: #fff; font-size: 14px; line-height: 1; opacity: 0; transition: opacity .15s;
}
.tn-atlas-item:hover .tn-atlas-item-del { opacity: 1; }
.tn-atlas-toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.tn-atlas-cat-add { display: flex; gap: 10px; margin-top: 14px; }
.tn-atlas-cat-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.tn-atlas-cat-ops { display: flex; gap: 6px; }

/* ---------- 图片选择器 ---------- */
.tn-imgpicker { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.tn-imgpicker-preview { display: flex; gap: 10px; flex-wrap: wrap; }
.tn-imgpicker-item { position: relative; width: 100px; height: 74px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.tn-imgpicker-item img { width: 100%; height: 100%; object-fit: cover; }
.tn-imgpicker-del {
    position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
    border: none; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; line-height: 1;
}
.tn-imgpicker-actions { display: flex; gap: 8px; padding-top: 8px; }

/* ---------- 配置 ---------- */
.tn-config-group { border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 14px; }
.tn-config-group-title { font-weight: 600; font-size: 15px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.tn-config-group .tn-form-item:last-child { margin-bottom: 0; }

/* ---------- 配置项详细样式 ---------- */
.tn-config-item { display: flex; align-items: flex-start; padding: 12px 0; border-bottom: 1px dashed #eee; }
.tn-config-item:last-child { border-bottom: none; }
.tn-config-label { width: 160px; min-width: 160px; flex-shrink: 0; font-size: 14px; font-weight: 500; color: #333; padding-top: 8px; padding-right: 16px; line-height: 1.4; word-break: break-all; word-wrap: break-word; white-space: normal; }
.tn-config-control { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
/* 输入框收窄：普通文本/数字/下拉不再占满整行，与提示文字同行 */
.tn-config-control .tn-input { width: 280px; max-width: 100%; }
.tn-config-control textarea.tn-input { width: 100%; min-height: 80px; resize: vertical; flex-basis: 100%; }
/* 图片选择器、富文本编辑器独占整行 */
.tn-config-control .tn-config-image { width: 100%; flex-basis: 100%; }
.tn-config-control .tn-config-richtext { width: 100%; flex-basis: 100%; }
.tn-config-tip { font-size: 12px; color: #999; margin: 0; flex: 1; min-width: 220px; line-height: 1.6; word-break: break-all; word-wrap: break-word; white-space: normal; }
.tn-config-image { display: flex; align-items: center; gap: 12px; }
.tn-config-image .tn-thumb { width: 80px; height: 80px; border-radius: 8px; overflow: hidden; border: 1px solid #eee; flex-shrink: 0; }
.tn-config-image .tn-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tn-config-image .tn-thumb-empty { display: flex; align-items: center; justify-content: center; background: #f5f5f5; color: #999; font-size: 12px; }
.tn-config-richtext { border: 1px solid #ddd; border-radius: 8px; overflow: hidden; }
.tn-config-richtext .w-e-text-container { min-height: 300px !important; }
.tn-config-actions { padding: 16px 0; text-align: right; }
/* 配置项平台分组标题（分隔线 + 标题），用于区分不同平台/通道，如 ThinkAPI 与 快递100 开放平台 */
.tn-config-section { display: flex; align-items: center; gap: 12px; margin: 22px 0 2px; font-size: 13px; font-weight: 600; color: var(--primary, #409eff); letter-spacing: .2px; }
.tn-config-section::after { content: ''; flex: 1; height: 1px; background: var(--border, #e5e7eb); }
.tn-config-section:first-child { margin-top: 0; }

/* ---------- 编辑页 ---------- */
.tn-edit-wrap { display: flex; flex-wrap: wrap; }
.tn-form-card { max-width: 900px; }
.tn-edit-footer {
    position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--border);
    padding: 14px 20px; display: flex; justify-content: flex-end; gap: 12px; margin-top: 12px;
    box-shadow: 0 -4px 16px rgba(0,0,0,.04); z-index: 40;
}
.tn-ai-scope { padding: 8px 12px; background: var(--primary-light); color: var(--primary); border-radius: 8px; font-size: 13px; }
.tn-ai-note { margin-top: 10px; padding: 10px 12px; background: #fff8ec; color: #8a6100; border-radius: 8px; font-size: 12px; }

/* ---------- 移动端适配 ---------- */
@media (max-width: 900px) {
    :root { --sidebar-w: 260px; }
    .tn-topbar-menu { display: inline-flex; }
    .tn-topbar-collapse { display: none; }
    .tn-sidebar { transform: translateX(-100%); transition: transform .25s; }
    .tn-sidebar.open { transform: translateX(0); }
    .tn-main { margin-left: 0; }
    .tn-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .tn-form-row { flex-direction: column; gap: 0; }
    .tn-page { padding: 12px; }
    .tn-topbar { padding: 0 12px; }
    .tn-topbar-publish { display: inline-flex; }
    .tn-topbar-name { display: none; }
    .tn-table { min-width: 640px; }
    .tn-filter-bar .tn-input-inline { width: 100%; }
}
@media (max-width: 480px) {
    .tn-stat-num { font-size: 24px; }
    .tn-login-panel { padding: 24px 20px; }
    .tn-atlas-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 滑动开关 ===== */
.tn-switch { position: relative; display: inline-block; width: 44px; height: 24px; vertical-align: middle; }
.tn-switch input { opacity: 0; width: 0; height: 0; }
.tn-switch-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #ccc; border-radius: 24px; transition: .3s; }
.tn-switch-slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .3s; }
.tn-switch input:checked + .tn-switch-slider { background: var(--primary, #4f6ef7); }
.tn-switch input:checked + .tn-switch-slider:before { transform: translateX(20px); }
.tn-switch-loading { opacity: 0.5; pointer-events: none; }


/* ===== 移动端增强适配 ===== */
@media (max-width: 900px) {
    /* 表格横向滚动 */
    .tn-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tn-table { min-width: 640px; }
    .tn-table th, .tn-table td { white-space: nowrap; padding: 8px 10px; font-size: 13px; }
    /* 操作列固定 */
    .tn-th-op, .tn-td-op { position: sticky; right: 0; background: #fff; z-index: 1; }
    /* 模态框自适应 */
    .tn-modal-mask { padding: 12px; }
    .tn-modal { width: 100% !important; max-width: 100%; max-height: 90vh; overflow-y: auto; }
    .tn-modal-body { padding: 16px; }
    /* tab可横向滚动 */
    .tn-tabs { display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; border-bottom: 1px solid #e8e8e8; }
    .tn-tab { flex-shrink: 0; padding: 10px 16px; font-size: 14px; }
    /* 按钮组自适应 */
    .tn-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
    .tn-btn { min-height: 36px; font-size: 14px; }
    /* 表单 */
    .tn-form-item { margin-bottom: 14px; }
    .tn-form-label { font-size: 13px; margin-bottom: 6px; }
    .tn-input, .tn-select, textarea.tn-input { font-size: 14px; padding: 8px 10px; }
    /* 分页 */
    .tn-pager-wrap { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
    .tn-pager-btn { min-width: 32px; height: 32px; font-size: 13px; }
    /* 统计卡片 */
    .tn-stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .tn-stat-card { padding: 14px; }
    .tn-stat-num { font-size: 22px; }
    /* 卡片 */
    .tn-card { padding: 14px; margin-bottom: 12px; }
    .tn-card-head { flex-direction: column; align-items: flex-start; gap: 8px; }
    /* 页面标题 */
    .tn-page-head { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
    .tn-page-head h2 { font-size: 18px; }
    /* 图集网格 */
    .tn-atlas-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    /* 配置项 */
    .tn-config-item { flex-direction: column; align-items: flex-start; gap: 6px; }
    .tn-config-label { width: 100%; font-size: 13px; }
    .tn-config-control { width: 100%; }
    /* 搜索栏 */
    .tn-search-bar { flex-wrap: wrap; gap: 8px; }
    .tn-search-bar .tn-input { flex: 1; min-width: 120px; }
    /* 顶部栏 */
    .tn-topbar { height: 52px; }
    .tn-topbar-title { font-size: 15px; }
    .tn-topbar-user-name { display: none; }
    /* 侧边栏 */
    .tn-sidebar { width: 240px; z-index: 1000; }
    .tn-sidebar-mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 999; }
    .tn-sidebar-mask.show { display: block; }
    /* 登录页 */
    .tn-login-wrap { padding: 20px; }
    .tn-login-panel { width: 100%; max-width: 380px; }
}

@media (max-width: 480px) {
    .tn-stat-grid { grid-template-columns: 1fr; }
    .tn-atlas-grid { grid-template-columns: repeat(2, 1fr); }
    .tn-page { padding: 10px; }
    .tn-btn { width: 100%; }
    .tn-head-actions .tn-btn { width: auto; }
    .tn-table { min-width: 560px; }
    .tn-modal-footer { flex-direction: column-reverse; gap: 8px; }
    .tn-modal-footer .tn-btn { width: 100%; }
}
/* ===== SKU 管理（商品属性/规格/参数）===== */
.sku-block { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
.sku-block-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: #f7f8fa; border-bottom: 1px solid var(--border); font-size: 14px; }
.sku-block-body { padding: 12px 14px; }
.sku-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sku-row .tn-input { flex: 1; }
.sku-table-wrap { overflow-x: auto; }
.sku-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sku-table th, .sku-table td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; white-space: nowrap; }
.sku-table th { background: #f7f8fa; font-weight: 600; }
.sku-table .sku-num { width: 88px; }
.sku-table .sku-propval { width: 110px; }
.sku-spec-img { width: 56px; height: 56px; border: 1px dashed #ccc; border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; background: #fafafa; color: #999; font-size: 20px; }
.sku-spec-img img { width: 100%; height: 100%; object-fit: cover; }
.tn-th-op, .tn-op { text-align: center; }
.tn-link-danger { color: #e74c3c; }
.tn-form-tips-inline { font-weight: 400; color: #999; font-size: 12px; margin-left: 6px; }

/* ========== 关联商品选择器（下拉列表框样式，参考旧版 el-select） ========== */
.tn-product-picker { position: relative; }
.tn-product-picker-box {
    display: flex; align-items: center; justify-content: space-between;
    height: 38px; padding: 0 12px; background: #fff;
    border: 1px solid #dcdfe6; border-radius: 4px; cursor: pointer;
    transition: border-color .2s; user-select: none;
}
.tn-product-picker-box:hover { border-color: #c0c4cc; }
.tn-product-picker-box.tn-product-picker-box-open { border-color: #409eff; }
.tn-product-picker-text {
    flex: 1; font-size: 14px; color: #c0c4cc; overflow: hidden;
    white-space: nowrap; text-overflow: ellipsis;
}
.tn-product-picker-text.tn-product-picker-text-selected { color: #606266; }
.tn-product-picker-arrow {
    margin-left: 8px; font-size: 12px; color: #c0c4cc;
    transition: transform .2s; line-height: 1;
}
.tn-product-picker-box-open .tn-product-picker-arrow { transform: rotate(180deg); color: #409eff; }
.tn-product-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 120;
    background: #fff; border: 1px solid #e4e7ed; border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0,0,0,.12); overflow: hidden;
    display: none;
}
.tn-product-search-input {
    width: 100%; border: none; border-bottom: 1px solid #ebeef5;
    border-radius: 0; padding: 8px 12px; font-size: 13px; outline: none;
}
.tn-product-search-input:focus { border-bottom-color: #409eff; }
.tn-product-options { max-height: 200px; overflow-y: auto; }
.tn-product-option {
    padding: 8px 12px; cursor: pointer; font-size: 13px; color: #333;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tn-product-option:hover { background: #f5f7fa; color: #409eff; }
.tn-product-option.tn-product-empty { cursor: default; color: #999; text-align: center; padding: 16px; }
.tn-product-selected { margin-top: 8px; }
.tn-product-tag {
    display: inline-flex; align-items: center; gap: 10px;
    background: #ecf5ff; color: #409eff; border: 1px solid #d9ecff;
    border-radius: 4px; padding: 5px 12px; font-size: 13px; max-width: 100%;
}
.tn-product-remove { color: #f56c6c; text-decoration: none; font-weight: 600; }
.tn-product-remove:hover { text-decoration: underline; }
