* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f0f2f7; color: #1f2329; }
.hidden { display: none !important; }
.muted { color: #8e8ea0; font-size: 12px; }
.btn-primary { background: #3370ff; color: #fff; border: none; border-radius: 8px; padding: 10px 18px; font-size: 14px; cursor: pointer; }
.btn-primary:hover { background: #245bdb; }
.btn-ghost { background: transparent; color: #646a73; border: 1px solid #dee0e3; border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; border: none; cursor: pointer; }
.btn-ok { background: #00b42a; color: #fff; }
.btn-warn { background: #ff7d00; color: #fff; }
.btn-danger { background: #f54a45; color: #fff; }
.btn-info { background: #3370ff; color: #fff; }

/* 登录 */
.login-mask { position: fixed; inset: 0; background: linear-gradient(135deg, #667eea, #764ba2); display: flex; align-items: center; justify-content: center; z-index: 50; }
.login-card { background: #fff; border-radius: 16px; padding: 36px 32px; width: 320px; box-shadow: 0 20px 60px rgba(0,0,0,.25); text-align: center; }
.login-logo { font-size: 22px; font-weight: 700; }
.login-sub { color: #8e8ea0; margin: 6px 0 22px; font-size: 13px; }
.login-input { width: 100%; padding: 11px 14px; border: 1px solid #dee0e3; border-radius: 8px; margin-bottom: 12px; font-size: 14px; }
.login-btn { width: 100%; }
.login-err { color: #f54a45; font-size: 13px; margin-top: 12px; min-height: 18px; }

/* 框架 */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #1f2329; color: #c9cdd4; display: flex; flex-direction: column; padding: 18px 12px; }
.brand { font-size: 18px; font-weight: 700; color: #fff; padding: 6px 10px 14px; }
.brand small { display: block; font-size: 12px; color: #8e8ea0; font-weight: 400; margin-top: 2px; }
.sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-item { background: transparent; border: none; color: #c9cdd4; text-align: left; padding: 11px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.nav-item:hover { background: #2b3138; }
.nav-item.active { background: #3370ff; color: #fff; }
.side-foot { border-top: 1px solid #2b3138; padding-top: 12px; font-size: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.side-foot #who { color: #8e8ea0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.content { flex: 1; padding: 24px 28px; }
.topbar { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.topbar h1 { font-size: 20px; }

/* 仪表盘 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.stat-card .num { font-size: 26px; font-weight: 700; }
.stat-card .lbl { color: #8e8ea0; font-size: 13px; margin-top: 4px; }
.stat-card.warn .num { color: #ff7d00; }
.stat-card.danger .num { color: #f54a45; }
.stat-card.good .num { color: #00b42a; }

/* 表格 */
.table-card { background: #fff; border-radius: 12px; padding: 8px 0; box-shadow: 0 2px 10px rgba(0,0,0,.04); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid #f0f2f7; }
th { color: #8e8ea0; font-weight: 600; background: #fafbfc; }
tbody tr:hover { background: #f7f9fc; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.tag-on { background: #e8f8ec; color: #00b42a; }
.tag-off { background: #fdeceb; color: #f54a45; }
.tag-pending { background: #fff4e6; color: #ff7d00; }
.tag-banned { background: #fdeceb; color: #f54a45; }
.tag-normal { background: #eef1f6; color: #646a73; }
.tag-admin { background: #e8f0ff; color: #3370ff; }
.tag-user { background: #eef1f6; color: #646a73; }
.tag-yes { background: #e8f8ec; color: #00b42a; }
.tag-no { background: #eef1f6; color: #8e8ea0; }
.row-actions { display: flex; gap: 6px; }
.empty { padding: 40px; text-align: center; color: #8e8ea0; }

/* 图表 */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.chart-card { background: #fff; border-radius: 12px; padding: 18px 20px; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.chart-card h3 { font-size: 14px; margin-bottom: 14px; color: #1f2329; }
.chart-card h3 .sub { color: #8e8ea0; font-weight: 400; font-size: 12px; margin-left: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 12px; font-size: 12px; color: #646a73; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.section-title { font-size: 15px; font-weight: 600; margin: 4px 0 12px; }

/* 店铺装修 */
.deco-wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; }
.card { background: #fff; border-radius: 12px; padding: 18px 20px; box-shadow: 0 2px 10px rgba(0,0,0,.04); margin-bottom: 16px; }
.card h3 { font-size: 14px; margin-bottom: 14px; }
.sec-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid #eef1f6; border-radius: 8px; margin-bottom: 8px; background: #fafbfc; }
.sec-row .grip { color: #c9cdd4; cursor: default; }
.sec-row .sec-name { flex: 1; font-size: 13px; }
.sec-row input[type=text] { flex: 1; border: 1px solid #dee0e3; border-radius: 6px; padding: 6px 8px; font-size: 13px; }
.sec-row .ord-btn { background: #eef1f6; border: none; border-radius: 6px; width: 26px; height: 26px; cursor: pointer; color: #646a73; }
.sec-row .ord-btn:hover { background: #e0e4ea; }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: #cfd3dc; border-radius: 22px; transition: .2s; cursor: pointer; }
.slider:before { content: ''; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: #00b42a; }
.switch input:checked + .slider:before { transform: translateX(18px); }
.banner-item { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.banner-item .bemoji { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff; flex: none; }
.banner-item input { flex: 1; border: 1px solid #dee0e3; border-radius: 6px; padding: 6px 8px; font-size: 13px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: #8e8ea0; margin-bottom: 5px; }
.field input[type=text], .field textarea { width: 100%; border: 1px solid #dee0e3; border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; }
.field textarea { min-height: 64px; resize: vertical; }
.deco-actions { display: flex; gap: 10px; align-items: center; }
.save-tip { color: #00b42a; font-size: 13px; }

/* 多页装修：页面切换 tab */
.page-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.page-tab { border: 1px solid #dee0e3; background: #fff; border-radius: 20px; padding: 8px 16px; font-size: 13px; color: #41464b; cursor: pointer; transition: .15s; }
.page-tab:hover { border-color: #3370ff; color: #3370ff; }
.page-tab.active { background: #3370ff; border-color: #3370ff; color: #fff; font-weight: 600; }
.deco-body { margin-top: 4px; }
.banner-fields { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.banner-fields input { border: 1px solid #dee0e3; border-radius: 6px; padding: 5px 8px; font-size: 12px; }

/* 首页预览 */
.preview-phone { width: 260px; background: #f0f2f7; border-radius: 20px; padding: 12px; border: 8px solid #1f2329; margin: 0 auto; }
.pv-banner { border-radius: 10px; padding: 16px 12px; color: #fff; font-size: 13px; margin-bottom: 8px; }
.pv-notice { background: #fff8e6; border: 1px solid #ffe1a8; color: #a8710a; font-size: 12px; padding: 8px 10px; border-radius: 8px; margin-bottom: 8px; }
.pv-sec { background: #fff; border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 7px; color: #1f2329; }
.pv-sec.off { opacity: .35; text-decoration: line-through; }

/* 消息通知 */
.notify-form { display: grid; grid-template-columns: 1fr; gap: 10px; }
.notify-form .row2 { display: flex; gap: 10px; }
.notify-form select, .notify-form input, .notify-form textarea { border: 1px solid #dee0e3; border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; }
.notify-form textarea { min-height: 70px; resize: vertical; }
.msg-type { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; background: #eef1f6; color: #646a73; }
.msg-type.system { background: #e8f0ff; color: #3370ff; }
.msg-type.content { background: #fff4e6; color: #ff7d00; }
.msg-type.income { background: #e8f8ec; color: #00b42a; }
.msg-type.service { background: #f3ebff; color: #8b5cf6; }

/* 积分/等级/运营配置 */
.cfg-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 8px; }
.cfg-table th, .cfg-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #f0f2f7; }
.cfg-table th { color: #8e8ea0; font-weight: 600; background: #fafbfc; }
.cell-input { width: 100%; border: 1px solid #dee0e3; border-radius: 6px; padding: 6px 8px; font-size: 13px; font-family: inherit; }
.cell-input.num { width: 90px; }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.kv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border: 1px solid #eef1f6; border-radius: 8px; background: #fafbfc; }
.kv-k { font-size: 13px; color: #41464b; white-space: nowrap; }
.kv-v { flex: 1; display: flex; justify-content: flex-end; }

/* 工单 FAQ */
.faq-form { display: grid; gap: 10px; margin-bottom: 4px; }
.faq-form input, .faq-form textarea { border: 1px solid #dee0e3; border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; }
.faq-form textarea { min-height: 56px; resize: vertical; }
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: #fff; border: 1px solid #eef1f6; border-radius: 10px; padding: 12px 14px; }
.faq-q { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.faq-a { font-size: 13px; color: #646a73; line-height: 1.6; }

/* 卡密管理 */
.code-cell { font-family: ui-monospace, Menlo, Consolas, monospace; color: #3370ff; font-weight: 600; }

/* 系统配置 */
.sys-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f0f2f7; }
