/* ===== 框架页（Home/Index） ===== */
html, body.shell { height: 100%; }
body.shell { display: flex; flex-direction: column; overflow: hidden; background: #f4f6f9; }
.shell-top { height: 50px; flex: 0 0 50px; background: #1f2d3d; color: #fff; display: flex; align-items: center; padding: 0 16px; gap: 12px; }
.shell-top .brand { font-weight: 600; font-size: 1.05rem; color: #fff; text-decoration: none; }
.shell-top .user { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.shell-body { flex: 1 1 auto; display: flex; min-height: 0; }

.shell-side { width: 220px; flex: 0 0 220px; background: #263445; color: #c2c7d0; overflow-y: auto; transition: margin-left .2s; }
.shell-side.collapsed { margin-left: -220px; }
.shell-side .grp-title { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 16px; color: #c2c7d0; background: none; border: 0; text-align: left; font-size: .95rem; }
.shell-side .grp-title:hover { color: #fff; background: rgba(255,255,255,.05); }
.shell-side .grp-title .chev { margin-left: auto; transition: transform .2s; font-size: .75rem; }
.shell-side .grp-title.collapsed .chev { transform: rotate(-90deg); }
.shell-side .grp-items a { display: block; padding: 9px 16px 9px 42px; color: #aeb5c0; text-decoration: none; font-size: .9rem; }
.shell-side .grp-items a:hover { color: #fff; background: rgba(255,255,255,.05); }
.shell-side .grp-items a.active { color: #fff; background: #0d6efd; }

.shell-main { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.shell-tabs { flex: 0 0 40px; display: flex; align-items: stretch; background: #fff; border-bottom: 1px solid #dee2e6; }
.shell-tabs .tab-list { flex: 1 1 auto; display: flex; overflow-x: auto; scrollbar-width: thin; margin: 0; padding: 0; list-style: none; }
.shell-tabs .tab-list li { display: flex; align-items: center; gap: 6px; padding: 0 12px; border-right: 1px solid #eee; white-space: nowrap; cursor: pointer; font-size: .875rem; color: #555; user-select: none; }
.shell-tabs .tab-list li:hover { background: #f8f9fa; }
.shell-tabs .tab-list li.active { background: #e9f2ff; color: #0d6efd; box-shadow: inset 0 -2px 0 #0d6efd; }
.shell-tabs .tab-list li .x { border: 0; background: none; padding: 0 2px; line-height: 1; color: #999; font-size: .9rem; }
.shell-tabs .tab-list li .x:hover { color: #dc3545; }
.shell-tabs .tab-tools { display: flex; align-items: center; gap: 4px; padding: 0 8px; border-left: 1px solid #eee; }
.shell-frames { flex: 1 1 auto; position: relative; }
.shell-frames iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; display: none; }
.shell-frames iframe.active { display: block; }

.tab-menu { position: fixed; z-index: 2000; background: #fff; border: 1px solid #ddd; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,.12); padding: 4px 0; min-width: 140px; display: none; }
.tab-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 6px 14px; font-size: .875rem; }
.tab-menu button:hover { background: #f1f3f5; }

/* ===== iframe 内页（_FrameLayout） ===== */
body.frame { background: #fff; padding: 16px; font-size: .9rem; }
.page-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.page-head h5 { margin: 0; }
.page-head .tools { margin-left: auto; display: flex; gap: 6px; }
.search-bar { background: #f8f9fa; border: 1px solid #eee; border-radius: 6px; padding: 10px; margin-bottom: 12px; }
.table td, .table th { vertical-align: middle; }
.table .ops { white-space: nowrap; }
.table .ops .btn { padding: .1rem .45rem; font-size: .8rem; }
.form-narrow { max-width: 720px; }
.tree-indent { display: inline-block; }
.perm-tree ul { list-style: none; padding-left: 22px; margin: 0; }
.perm-tree > ul { padding-left: 0; }
.perm-tree li { padding: 3px 0; }
.perm-tree .t1 { font-weight: 600; }
.perm-tree .t2 { font-weight: 500; }
.perm-tree .t3 { color: #555; }
.perm-tree .code { color: #999; font-size: .78rem; margin-left: 6px; }
#editor-wrap { border: 1px solid #ccc; border-radius: 4px; }
#editor-toolbar { border-bottom: 1px solid #ccc; }
#editor-text { height: 480px; overflow-y: hidden; }
pre.json { background: #f8f9fa; border: 1px solid #eee; padding: 10px; max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-all; }

/* ===== 登录页 ===== */
body.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1f2d3d, #34495e); }
.login-card { width: 360px; max-width: calc(100% - 32px); }

.toast-host { position: fixed; top: 12px; right: 12px; z-index: 3000; }

/* ===== 主题：商户后台（data-site="client"）用绿色系，与平台后台区分 ===== */
body[data-site="client"] .shell-top { background: #14532d; }
body[data-site="client"] .shell-side { background: #1c3d2b; }
body[data-site="client"] .shell-side .grp-items a.active { background: #198754; }
body[data-site="client"] .shell-tabs .tab-list li.active { background: #e8f5ee; color: #198754; box-shadow: inset 0 -2px 0 #198754; }
body.login[data-site="client"] { background: linear-gradient(135deg, #14532d, #2f6f4e); }
