﻿/* 微信公众号后台管理样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; font-size: 14px; color: #333; background: #f0f2f5; }
a { color: #1677ff; text-decoration: none; }
a:hover { color: #0958d9; }

/* 布局 */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #001529; color: #fff; flex-shrink: 0; position: fixed; top: 0; bottom: 0; left: 0; overflow-y: auto; }
.sidebar .logo { height: 60px; line-height: 60px; text-align: center; font-size: 18px; font-weight: bold; border-bottom: 1px solid #1f2d3d; color: #fff; }
.sidebar .nav-group { padding: 0; }
/* 栏目标题栏：独立底色 + 分隔线，与栏目内容明显区分，可点击折叠 */
.sidebar .nav-group-title { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; color: #8fb2d4; font-size: 13px; letter-spacing: 1px; background: #0b2137; border-top: 1px solid #16324f; border-bottom: 1px solid #16324f; cursor: pointer; user-select: none; margin-top: 6px; }
.sidebar .nav-group-title:hover { color: #cfe3f7; background: #122b45; }
.sidebar .nav-group-title .arrow { width: 0; height: 0; border-left: 5px solid #8fb2d4; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transform: rotate(90deg); transition: transform .2s; }
.sidebar .nav-group.collapsed .nav-group-title .arrow { transform: rotate(0deg); }
.sidebar .nav-group.collapsed .nav-items { display: none; }
.sidebar .nav-items { padding: 6px 0 8px; }
.sidebar a.nav-item { display: block; padding: 11px 20px; color: #e6eef7; font-size: 15px; border-left: 3px solid transparent; }
.sidebar a.nav-item:hover { background: #1f2d3d; color: #fff; }
.sidebar a.nav-item.active { background: #1677ff; color: #fff; border-left-color: #fff; }

.main-area { flex: 1; margin-left: 220px; min-width: 0; }
.topbar { height: 60px; background: #fff; border-bottom: 1px solid #e8e8e8; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
.topbar .title { font-size: 16px; font-weight: bold; }
.topbar .user-info { color: #666; display: flex; align-items: center; gap: 12px; }
.topbar .user-info a { color: #1677ff; text-decoration: none; }
.topbar .user-info a:hover { color: #4096ff; }
/* 公众号切换下拉 */
.topbar .user-info select.form-control { width: 190px; display: inline-block; height: 34px; padding: 0 10px; border-radius: 6px; border: 1px solid #d9d9d9; background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23999' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center; appearance: none; -webkit-appearance: none; cursor: pointer; font-size: 13px; }
.topbar .user-info select.form-control:focus { outline: none; border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,.15); }
/* 当前用户名 */
.topbar .username { font-weight: 600; color: #333; }
/* 角色徽标 */
.role-tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: linear-gradient(135deg, #e6f4ff, #f0f7ff); border: 1px solid #b5d8ff; color: #1677ff; font-size: 12px; line-height: 18px; }
/* 退出按钮：浅红描边小按钮 */
.topbar .user-info .link-button { margin: 0; padding: 3px 12px; border: 1px solid #ffd8d6; border-radius: 6px; color: #e64340; background: #fff7f6; font-size: 13px; transition: background .15s, border-color .15s; }
.topbar .user-info .link-button:hover { background: #ffefee; border-color: #ffb3b0; text-decoration: none; }
.perm-group { border: 1px solid #eee; border-radius: 4px; padding: 12px; margin-bottom: 12px; }
.perm-group-title { font-weight: bold; color: #333; margin-bottom: 8px; }
.perm-grid { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.perm-grid label { display: inline-flex; align-items: center; gap: 4px; font-weight: normal; color: #555; cursor: pointer; }
.status-on { color: #09BB07; }
.status-off { color: #999; }
.content { padding: 24px; }

/* 卡片 */
.card { background: #fff; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.06); margin-bottom: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; font-weight: bold; }
.card-body { padding: 20px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 6px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.stat-card .label { color: #888; font-size: 13px; }
.stat-card .value { font-size: 30px; font-weight: bold; margin-top: 8px; color: #1677ff; }
.stat-card.green .value { color: #52c41a; }
.stat-card.orange .value { color: #fa8c16; }
.stat-card.purple .value { color: #722ed1; }

/* 表格 */
table.data-table { width: 100%; border-collapse: collapse; background: #fff; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; text-align: left; }
.data-table th { background: #fafafa; font-weight: bold; color: #555; }
.data-table tr:hover td { background: #f5faff; }
.data-table .actions a { margin-right: 10px; }
.data-table .actions form { display: inline; margin: 0; }
.link-button { border: 0; background: none; padding: 0; margin: 0 10px 0 0; color: #1677ff; cursor: pointer; font: inherit; }
.link-button:hover { text-decoration: underline; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: bold; color: #555; }
.form-control { width: 100%; max-width: 600px; padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; font-family: inherit; }
.form-control:focus { outline: none; border-color: #1677ff; box-shadow: 0 0 0 2px rgba(22,119,255,.1); }
textarea.form-control { min-height: 100px; resize: vertical; }
.form-hint { color: #999; font-size: 12px; margin-top: 4px; }

/* 按钮 */
.btn { display: inline-block; padding: 8px 18px; border: 1px solid #d9d9d9; background: #fff; border-radius: 4px; cursor: pointer; font-size: 14px; color: #333; font-family: inherit; }
.btn:hover { border-color: #1677ff; color: #1677ff; }
.btn-primary { background: #1677ff; border-color: #1677ff; color: #fff; }
.btn-primary:hover { background: #0958d9; color: #fff; }
.btn-danger { background: #ff4d4f; border-color: #ff4d4f; color: #fff; }
.btn-danger:hover { background: #cf1322; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* 提示 */
.alert { padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; }
.alert-success { background: #f6ffed; border: 1px solid #b7eb8f; color: #52c41a; }
.alert-error { background: #fff2f0; border: 1px solid #ffccc7; color: #ff4d4f; }
.alert-info { background: #e6f4ff; border: 1px solid #91caff; color: #1677ff; }

/* 标签 */
.label-tag { display: inline-block; padding: 2px 8px; border-radius: 10px; background: #e6f4ff; color: #1677ff; font-size: 12px; }
.label-tag.green { background: #f6ffed; color: #52c41a; }
.label-tag.red { background: #fff2f0; color: #ff4d4f; }

/* 分页 */
.pagination { margin-top: 16px; text-align: right; }
.pagination a, .pagination span { display: inline-block; padding: 5px 12px; border: 1px solid #d9d9d9; margin-left: 4px; border-radius: 3px; }
.pagination .current { background: #1677ff; color: #fff; border-color: #1677ff; }

/* 快捷入口 */
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.quick-item { display: block; background: #fff; border-radius: 6px; padding: 20px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.06); color: #333; }
.quick-item:hover { color: #1677ff; transform: translateY(-2px); transition: all .2s; }
.quick-item .icon { font-size: 28px; margin-bottom: 8px; }

/* 登录页 */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1677ff 0%, #001529 100%); }
.login-box { width: 400px; background: #fff; border-radius: 8px; padding: 40px; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.login-box h2 { text-align: center; margin-bottom: 30px; color: #001529; }
.login-box .btn { width: 100%; margin-top: 10px; }

/* 工具栏 */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.toolbar .form-control { max-width: 220px; }

/* 图片预览 */
.thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; border: 1px solid #eee; }

/* 响应式 */
@media (max-width: 768px) {
    .sidebar { width: 180px; }
    .main-area { margin-left: 180px; }
    .content { padding: 12px; }
}

/* ---- 粉丝小头像 ---- */
.avatar-sm { width: 36px; height: 36px; object-fit: cover; border-radius: 50%; border: 1px solid #eee; vertical-align: middle; }

/* ---- 侧边栏（始终展开，不做折叠） ---- */
.sidebar a.nav-item.active { font-weight: 500; }

/* ---- 日志查看 ---- */
.log-view { background: #1e1e1e; color: #d4d4d4; padding: 14px; border-radius: 6px; font-family: Consolas, 'Courier New', monospace; font-size: 12px; line-height: 1.7; max-height: 620px; overflow-y: auto; white-space: pre-wrap; word-break: break-all; }
.log-meta { color: #888; font-size: 12px; margin-bottom: 8px; }

/* ---- 详情网格 ---- */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.detail-grid .item { background: #fafafa; border-radius: 6px; padding: 10px 14px; }
.detail-grid .item .k { color: #999; font-size: 12px; }
.detail-grid .item .v { font-size: 15px; margin-top: 2px; word-break: break-all; }

/* ---- Toast 轻提示 ---- */
.ui-toast-box { position: fixed; top: 16px; right: 16px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.ui-toast { padding: 10px 16px; border-radius: 6px; font-size: 14px; box-shadow: 0 4px 12px rgba(0,0,0,.15); opacity: 0; transform: translateX(20px); transition: all .3s ease; word-break: break-all; background: #fff; border-left: 4px solid #52c41a; color: #333; }
.ui-toast.show { opacity: 1; transform: translateX(0); }
.ui-toast-error { border-left-color: #ff4d4f; background: #fff2f0; }
.ui-toast-success { border-left-color: #52c41a; background: #f6ffed; }
.ui-toast-info { border-left-color: #1677ff; background: #e6f4ff; }

/* ---- 弹窗 ---- */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 2000; align-items: flex-start; justify-content: center; padding: 24px 12px; overflow-y: auto; }
.modal-overlay.open { display: flex; }
.modal-box { background: #fff; border-radius: 8px; width: 640px; max-width: 100%; box-shadow: 0 6px 40px rgba(0,0,0,.22); animation: ui-modal-in .18s ease; margin-bottom: 40px; }
.modal-box-sm { width: 420px; }
.modal-box-lg { width: 860px; }
@keyframes ui-modal-in { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: translateY(0); } }
.modal-header { padding: 14px 20px; font-weight: bold; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; justify-content: space-between; }
.modal-close { border: 0; background: none; font-size: 22px; line-height: 1; color: #999; cursor: pointer; padding: 0 4px; }
.modal-close:hover { color: #333; }
.modal-body { padding: 16px 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid #f0f0f0; text-align: right; }
.modal-footer .btn { margin-left: 10px; }
body.ui-modal-open { overflow: hidden; }
.modal-body .form-control { max-width: 100%; }
/* 数据管理弹窗紧凑布局：间距压缩，短字段两两一行 */
.modal-body .form-group { margin-bottom: 12px; }
.modal-body .form-group label { margin-bottom: 4px; }
.modal-body .form-hint { margin-top: 3px; }
.modal-body .form-row2 { gap: 12px; }

/* ---- 简洁分页 ---- */
.pagination { margin-top: 16px; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; font-size: 13px; color: #666; }
.pagination .page-info { margin-right: 8px; color: #888; }
.pagination a, .pagination span.pg { min-width: 30px; padding: 4px 8px; text-align: center; border: 1px solid #d9d9d9; border-radius: 3px; background: #fff; color: #333; cursor: pointer; }
.pagination a:hover { border-color: #1677ff; color: #1677ff; }
.pagination .current { background: #1677ff; border-color: #1677ff; color: #fff; cursor: default; }
.pagination .ellipsis { border: 0; background: none; cursor: default; padding: 4px 2px; }
.pagination .page-jump { width: 52px; padding: 4px 6px; border: 1px solid #d9d9d9; border-radius: 3px; text-align: center; }
.pagination .page-jump:focus { outline: none; border-color: #1677ff; }
.pagination .disabled { color: #ccc; border-color: #eee; background: #fafafa; cursor: default; }

/* 批量选择与批量操作 */
.batch-bar { display: flex; align-items: center; gap: 12px; background: #e8f1ff; border: 1px solid #bcd6ff; border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; }
.batch-bar .batch-count { color: #1677ff; font-weight: bold; }
.batch-bar button[disabled] { opacity: .45; cursor: not-allowed; }
.data-table input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; vertical-align: middle; }

/* 分页当前页选中状态：蓝色边框高亮 */
.pagination .current { background: #fff; color: #1677ff; border: 2px solid #1677ff; font-weight: bold; padding: 3px 10px; cursor: default; }
.pagination .page-size select { padding: 3px 6px; border: 1px solid #d9d9d9; border-radius: 3px; margin: 0 4px; }
.pagination .page-size select:focus { outline: none; border-color: #1677ff; }

/* ---- 个人中心 ---- */
/* 我的资料：头像 + 信息卡片栅格 */
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, #1677ff, #4096ff); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: bold; flex-shrink: 0; }
.profile-name { font-size: 18px; font-weight: 600; color: #333; }
.profile-sub { margin-top: 6px; display: flex; align-items: center; gap: 8px; }
.profile-sub .role-tag { margin: 0; }
.bind-state { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; line-height: 18px; }
.bind-state.on { background: #f0fbf1; border: 1px solid #b7ebc0; color: #09bb07; }
.bind-state.off { background: #fff7f6; border: 1px solid #ffd8d6; color: #e64340; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.info-item { background: #f7f9fb; border: 1px solid #eef2f6; border-radius: 6px; padding: 10px 14px; }
.info-item .k { color: #888; font-size: 12px; }
.info-item .v { margin-top: 4px; font-size: 14px; font-weight: 500; color: #333; word-break: break-all; }
/* 一行两栏：左修改资料与密码，右微信扫码绑定；窄屏自动上下堆叠 */
/* 两卡等高：栅格默认 stretch，左卡表单纵向铺满、保存按钮沉底 */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.profile-grid .card { margin-bottom: 0; display: flex; flex-direction: column; }
.profile-form-card .card-body { flex: 1; display: flex; flex-direction: column; }
.profile-form-card form { flex: 1; display: flex; flex-direction: column; }
.profile-form-card form > .btn[type="submit"] { margin-top: auto; align-self: flex-start; }
.profile-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-actions form { margin: 0; }
/* 表单内两列小栅格 */
.form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
  .form-row2 { grid-template-columns: 1fr; }
}

/* 数据管理列表缩略图（必应美图等图片列） */
.thumb-img { width: 72px; height: 44px; object-fit: cover; border-radius: 4px; border: 1px solid #e2e8f0; display: block; cursor: zoom-in; transition: transform .15s; }
.thumb-img:hover { transform: scale(1.06); box-shadow: 0 2px 8px rgba(22,119,255,.25); }
