/* admin.css — 管理后台全套样式（11-10 治理施工）
 * 此前 admin-* 类零定义，管理后台为裸 HTML 渲染；本文件补齐全部视觉。
 * 设计基调：纯白浮窗 / 细边框 / 克制强调色（主按钮藏蓝，危险红，成功绿） */

/* ── 浮窗容器 ── */
#adminPanelContainer.admin-panel-root {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(1100px, 92vw);
    height: min(760px, 88vh);
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 18px 60px rgba(0,0,0,.22), 0 0 0 1px rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
    z-index: 9000;
    overflow: hidden;
    font-family: inherit;
    font-size: 14px;
    color: #2b2f36;
}
#adminPanelContainer.admin-panel-root::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15,18,24,.45);
    z-index: -1;
}

/* ── 头部 ── */
.admin-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #e8eaee;
    background: #fafbfc;
    flex: none;
}
.admin-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .5px;
}
.admin-panel-head-actions { display: flex; gap: 8px; }

/* ── Tabs ── */
.admin-tabs {
    display: flex;
    gap: 2px;
    padding: 0 16px;
    border-bottom: 1px solid #e8eaee;
    background: #fff;
    flex: none;
    overflow-x: auto;
}
.admin-tab {
    appearance: none;
    border: none;
    background: none;
    padding: 11px 16px;
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color .15s, border-color .15s;
}
.admin-tab:hover { color: #2b2f36; }
.admin-tab.active { color: #1d4ed8; border-bottom-color: #1d4ed8; font-weight: 600; }

.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px 28px;
}

/* ── 区块 ── */
.admin-section { margin-bottom: 22px; }
.admin-section h3 { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.admin-section h4 { margin: 0 0 10px; font-size: 14px; font-weight: 700; }
.admin-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.admin-section-header h3, .admin-section-header h4 { margin: 0; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.admin-toolbar-actions { display: flex; gap: 8px; }
.admin-filter-group { display: flex; gap: 8px; flex: 1; max-width: 420px; }

/* ── 表格 ── */
.admin-table-wrap {
    border: 1px solid #e8eaee;
    border-radius: 10px;
    overflow: auto;
    background: #fff;
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th, .admin-table td {
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid #f0f1f4;
    vertical-align: middle;
}
.admin-table thead th {
    background: #f7f8fa;
    font-weight: 600;
    color: #5b6472;
    font-size: 12.5px;
    position: sticky;
    top: 0;
    z-index: 1;
}
.admin-table tbody tr:hover { background: #f8faff; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table-slim { font-size: 12.5px; }
.admin-cell-ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-empty-cell { text-align: center; color: #9aa3af; padding: 22px 12px !important; }
.admin-actions-col { white-space: nowrap; }
.admin-actions-col .admin-btn-sm { margin-right: 4px; }
.admin-cb-col { width: 36px; text-align: center; }

/* ── 用户单元 ── */
.admin-user-cell { display: flex; flex-direction: column; line-height: 1.3; }
.admin-user-name { font-weight: 600; }
.admin-user-sub { font-size: 12px; color: #9aa3af; }

/* ── 按钮 ── */
.admin-btn, .admin-btn-sm {
    appearance: none;
    border: 1px solid #d8dce2;
    background: #fff;
    color: #2b2f36;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13.5px;
    padding: 8px 16px;
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.admin-btn:hover { background: #f5f6f8; }
.admin-btn:disabled { opacity: .45; cursor: not-allowed; }
.admin-btn-sm { padding: 4px 10px; font-size: 12.5px; border-radius: 6px; }
.admin-btn.primary { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.admin-btn.primary:hover { background: #1a44bd; }
.admin-btn.danger, .admin-btn-sm.admin-btn-danger { background: #fff; border-color: #f0b4b4; color: #d63031; }
.admin-btn.danger:hover, .admin-btn-sm.admin-btn-danger:hover { background: #fdf1f1; }
.admin-btn.secondary { background: #f5f6f8; border-color: #e3e6ea; color: #4b5563; }
.admin-btn.secondary:hover { background: #eceef1; }
.admin-btn-sm.admin-btn-info { background: #eef4ff; border-color: #c4d7f7; color: #1d4ed8; }
.admin-btn-sm.admin-btn-info:hover { background: #e2ecff; }
.admin-btn-sm.primary { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }

/* ── 表单 ── */
.admin-input, .admin-select {
    border: 1px solid #d8dce2;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13.5px;
    color: #2b2f36;
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}
.admin-input:focus, .admin-select:focus { border-color: #1d4ed8; box-shadow: 0 0 0 3px rgba(29,78,216,.12); }
.admin-input-search { max-width: 260px; }
.admin-textarea { width: 100%; min-height: 90px; resize: vertical; }
.admin-form-row { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.admin-form-row > label { font-size: 13px; font-weight: 600; color: #4b5563; }
.admin-hint { font-size: 12px; margin-top: 6px; }

/* ── 内联表单页（公告/群规编辑）── */
.admin-ann-form-page {
    max-width: 640px;
    background: #fff;
    border: 1px solid #e8eaee;
    border-radius: 12px;
    padding: 18px 20px;
}
.admin-ann-form-page h4 { margin: 0 0 14px; }
.admin-ann-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ── 权限勾选 ── */
.admin-perm-grid { display: flex; flex-direction: column; gap: 12px; max-height: 320px; overflow-y: auto; border: 1px solid #e8eaee; border-radius: 10px; padding: 12px; }
.admin-perm-group-title { font-size: 12.5px; font-weight: 700; color: #6b7280; margin-bottom: 6px; }
.admin-perm-check { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; cursor: pointer; }
.admin-perm-check code { font-size: 11px; color: #9aa3af; background: #f5f6f8; padding: 1px 6px; border-radius: 4px; }
.admin-perm-actions { display: flex; gap: 6px; margin-bottom: 8px; }

/* ── 标签 ── */
.admin-tag {
    display: inline-block;
    font-size: 12px;
    padding: 2px 9px;
    border-radius: 999px;
    background: #eef0f3;
    color: #5b6472;
    line-height: 1.6;
}
.admin-tag-ok { background: #e7f6ec; color: #1a7f37; }
.admin-tag-danger { background: #fdecec; color: #d63031; }
.admin-tag-muted { background: #f0f1f4; color: #9aa3af; }
.admin-tag-gold { background: #fdf3e0; color: #a05e03; }

/* ── 统计 ── */
.admin-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.admin-stat-card {
    background: #fafbfc;
    border: 1px solid #e8eaee;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}
.admin-stat-number { font-size: 26px; font-weight: 700; color: #1d4ed8; }
.admin-stat-label { font-size: 12.5px; color: #6b7280; margin-top: 4px; }
.admin-stats-row { display: flex; gap: 10px; }
.admin-stat-mini {
    background: #fafbfc; border: 1px solid #e8eaee; border-radius: 8px;
    padding: 8px 14px; display: flex; align-items: baseline; gap: 6px;
}
.admin-stat-mini b { font-size: 17px; color: #1d4ed8; }
.admin-stat-mini span { font-size: 12px; color: #6b7280; }

/* ── 三态 ── */
.admin-state {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; padding: 42px 20px; color: #6b7280; text-align: center;
}
.admin-state-error .admin-state-icon {
    width: 40px; height: 40px; border-radius: 50%;
    background: #fdecec; color: #d63031;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 20px;
}
.admin-state-retry { margin-top: 4px; }
.admin-spinner {
    width: 26px; height: 26px;
    border: 3px solid #e5e9f0;
    border-top-color: #1d4ed8;
    border-radius: 50%;
    animation: admin-spin .8s linear infinite;
}
@keyframes admin-spin { to { transform: rotate(360deg); } }

/* ── Modal ── */
.admin-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15,18,24,.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 9500;
    padding: 20px;
}
.admin-modal {
    background: #fff; border-radius: 14px;
    box-shadow: 0 18px 60px rgba(0,0,0,.28);
    width: 100%; max-width: 520px;
    max-height: 86vh; display: flex; flex-direction: column;
    padding: 18px 20px;
    overflow: hidden;
}
.admin-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex: none; }
.admin-modal-head h3 { margin: 0; font-size: 15.5px; }
.admin-modal-close {
    appearance: none; border: none; background: none;
    font-size: 22px; line-height: 1; color: #9aa3af; cursor: pointer; padding: 2px 6px;
}
.admin-modal-close:hover { color: #2b2f36; }
.admin-modal-body { overflow-y: auto; }
.admin-confirm-modal { max-width: 380px; }
.admin-confirm-text { font-size: 14px; line-height: 1.7; white-space: pre-line; margin-bottom: 6px; }

/* ── 详情 ── */
.admin-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.admin-detail-grid > div { display: flex; flex-direction: column; gap: 2px; }
.admin-detail-label { font-size: 12px; color: #9aa3af; }
.admin-detail-wide { grid-column: 1 / -1; }
.admin-muted { color: #9aa3af; font-size: 12.5px; }

/* ── 复制行 ── */
.admin-copy-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.admin-copy-code { flex: 1; background: #f5f6f8; border: 1px solid #e8eaee; border-radius: 8px; padding: 9px 12px; font-size: 14px; word-break: break-all; }

/* ── toast 错误色变体 ── */
#toast[data-type="error"] { background: #d63031; }
