/* 班级管理 - v19 1:1 复刻 banchong.cn/setting */
#class-management { display: none; }
#class-management.active { display: flex; height: calc(100vh - 80px); background: #F3F4F6; }
#tab-points-rule.active { display: flex !important; }

.management-layout { display: flex; flex: 1; height: 100%; }

/* 左侧边栏 - 精确 224px */
.management-sidebar { width: 224px; background: white; border-right: 1px solid #f3f4f6; flex-shrink: 0; overflow-y: auto; padding: 16px 12px; }
.sidebar-section-title { font-size: 12px; color: #9ca3af; padding: 8px 12px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 8px; }
.sidebar-menu-item { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 500; color: #4B5563; transition: all .2s var(--ease-out); position: relative; width: 100%; text-align: left; border: none; background: none; font-family: inherit; }
.sidebar-menu-item:hover { background: #f3f4f6; color: #111827; transform: translateX(2px); }
.sidebar-menu-item.active { background: linear-gradient(135deg, var(--brand-50) 0%, var(--brand-100) 100%); color: var(--brand-700); font-weight: 600; box-shadow: inset 3px 0 0 var(--brand-500), 0 1px 3px rgba(79, 70, 229,0.08); }
.sidebar-menu-item .menu-icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; transition: transform .2s var(--ease-out); }
.sidebar-menu-item.active .menu-icon { transform: scale(1.08); }
.sidebar-menu-item .menu-text { flex: 1; }
.sidebar-menu-item .menu-arrow { font-size: 12px; color: #e5e7eb; transition: all .2s; }
.sidebar-menu-item.active .menu-arrow { color: var(--brand-600); }

/* VIP推广条 */
.vip-banner { margin: 12px; padding: 12px; background: linear-gradient(90deg, var(--sun-100), #fbbf24); border-radius: 8px; display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--gold-700); }
.vip-banner .vip-icon { font-size: 18px; }
.vip-banner .vip-text { font-size: 12px; font-weight: 500; }
.vip-banner .vip-tag { font-size: 10px; background: var(--brand-600); color: #FFFFFF; padding: 1px 6px; border-radius: 4px; margin-left: auto; }

/* 工具栏 (VIP 推广条 - 36px) */
.mgmt-toolbar { height: 36px; background: var(--sun-100); border-bottom: 1px solid #fbbf24; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; font-size: 13px; flex-shrink: 0; }
.mgmt-toolbar .toolbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--gold-700); }
.mgmt-toolbar .toolbar-left span.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mgmt-toolbar .toolbar-link { font-weight: 500; color: var(--gold-700); flex-shrink: 0; text-decoration: none; font-size: 14px; }

/* 主内容区 */
.management-content { flex: 1; display: flex; flex-direction: column; background: #F9FAFB; overflow: hidden; }
.content-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; background: white; border-bottom: 1px solid #f3f4f6; box-shadow: rgba(0,0,0,0) 0px 0px 0px 0px, rgba(0,0,0,0) 0px 0px 0px 0px, rgba(0,0,0,0.05) 0px 1px 2px 0px; flex-shrink: 0; }
.content-header h2 { font-size: 18px; font-weight: 600; color: #111827; margin: 0; }
.content-actions { display: flex; gap: 8px; align-items: center; }
.roster-search-input { padding: 8px 16px; border: 1px solid #e5e7eb; border-radius: 24px; font-size: 14px; color: #111827; outline: none; width: 220px; transition: border-color 0.2s; background: #fff; }
.roster-search-input:focus { border-color: var(--brand-500); }
.roster-search-input::placeholder { color: #9ca3af; }
.btn-batch-import { padding: 8px 16px; font-size: 14px; border-radius: 8px; background: transparent; color: #4B5563; border: 1px solid #e5e7eb; cursor: pointer; font-weight: 500; transition: all 0.2s; }
.btn-batch-import:hover { border-color: #d1d5db; color: #111827; background: #f9fafb; }
.btn-add-student-primary { padding: 9px 20px; font-size: 14px; border-radius: var(--radius-md); background: linear-gradient(135deg, var(--brand-400) 0%, var(--brand-600) 100%); color: #FFFFFF; border: 1px solid rgba(255,255,255,0.15); cursor: pointer; font-weight: 600; transition: all .25s var(--ease-out); box-shadow: 0 2px 8px rgba(79, 70, 229,0.28), inset 0 1px 0 rgba(255,255,255,0.18); position: relative; overflow: hidden; }
.btn-add-student-primary::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,0.14) 0%, transparent 50%); pointer-events: none; border-radius: inherit; }
.btn-add-student-primary:hover { box-shadow: 0 6px 20px rgba(79, 70, 229,0.36); filter: brightness(1.04); transform: translateY(-1px); }
.btn-add-student-primary:active { transform: scale(0.97); }

.content-body { flex: 1; padding: 24px; overflow-y: auto; background: #F9FAFB; }
.management-tab-content { height: 100%; display: none; }
.management-tab-content.active { display: block; }

/* ---- 标签管理 ---- */
.tag-area { min-height: 300px; }
.tag-card { border: 1px solid #E5E7EB; border-radius: 12px; padding: 16px; transition: all .2s; background: #fff; }
.tag-card:hover { border-color: var(--gold-400); box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.tag-label { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: #111827; }
.tag-member-btn { padding: 6px 12px; border-radius: 8px; font-size: 11px; font-weight: 600; border: 1px solid var(--gold-200); background: var(--gold-50); color: var(--gold-700); transition: all .15s; cursor: pointer; }
.tag-member-btn:hover { background: var(--sun-100); }
.tag-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 64px 20px; }
.tag-empty-icon { width: 64px; height: 64px; border-radius: 16px; background: var(--brand-50); display: flex; align-items: center; justify-content: center; font-size: 28px; margin-bottom: 16px; }
.tag-empty-title { font-size: 15px; font-weight: 600; color: #374151; margin-bottom: 8px; }
.tag-empty-desc { font-size: 13px; color: #9CA3AF; margin-bottom: 24px; max-width: 400px; }
.tag-empty-btn { padding: 10px 20px; background: var(--brand-50); color: var(--brand-600); font-size: 13px; font-weight: 700; border-radius: 12px; border: 1px solid var(--brand-300); cursor: pointer; transition: all .15s; }
.tag-empty-btn:hover { background: var(--brand-100); }
/* 标签管理弹窗 */
.tag-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.25); backdrop-filter: blur(4px); z-index: 2000; display: none; }
.tag-modal-overlay.show { display: block; }
.tag-modal-wrap { position: fixed; inset: 0; display: flex; align-items: flex-start; justify-content: center; padding: 24px; pointer-events: none; z-index: 2001; display: none; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.tag-modal-wrap.show { display: flex; }
.tag-modal-card { pointer-events: auto; background: #fff; border-radius: 16px; box-shadow: 0 25px 50px -12px rgba(0,0,0,.25); display: flex; flex-direction: column; overflow: hidden; width: 100%; margin: auto; max-height: calc(100vh - 48px); }
.tag-modal-card.max-w-sm { max-width: 384px; }
.tag-modal-card.max-w-lg { max-width: 620px; }
.tag-modal-card.max-w-2xl { max-width: 672px; }
.tag-modal-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(0,0,0,.05); color: #6B7280; border: none; cursor: pointer; z-index: 10; }
.tag-modal-close:hover { background: rgba(0,0,0,.1); }
.tag-modal-header { padding: 24px 24px 12px; }
.tag-modal-body { padding: 0 24px 16px; flex: 1; overflow-y: auto; }
.tag-modal-footer { display: flex; border-top: 1px solid #F3F4F6; }
.tag-modal-footer button { flex: 1; padding: 14px; font-size: 13px; font-weight: 700; border: none; cursor: pointer; transition: all .15s; }
.tag-modal-footer .cancel { color: #9CA3AF; background: transparent; }
.tag-modal-footer .cancel:hover { background: #F9FAFB; }
.tag-modal-footer .confirm { color: #FFFFFF; background: var(--brand-400); border-radius: 0 0 16px 0; }
.tag-modal-footer .confirm:hover { background: var(--brand-500); }
.tag-search-wrap { position: relative; margin-bottom: 12px; }
.tag-search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9CA3AF; }
.tag-search-input { width: 100%; padding: 10px 12px 10px 38px; border-radius: 12px; border: 1px solid #E5E7EB; background: #F3F4F6; font-size: 13px; outline: none; transition: all .2s; box-sizing: border-box; }
.tag-search-input:focus { border-color: var(--brand-400); background: #fff; }
.tag-section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; position: sticky; top: 0; background: rgba(255,255,255,.9); backdrop-filter: blur(4px); padding: 4px 0; z-index: 1; }
.tag-section-dot { width: 6px; height: 16px; border-radius: 999px; flex-shrink: 0; }
.tag-section-label { font-size: 13px; font-weight: 700; color: #374151; }
.tag-student-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
@media (min-width: 640px) { .tag-student-grid { grid-template-columns: repeat(4,1fr); } }
.tag-student-btn { position: relative; display: flex; flex-direction: column; align-items: flex-start; padding: 10px; border-radius: 12px; border: 1px solid; font-size: 13px; text-align: left; cursor: pointer; transition: all .15s; height: 66px; box-sizing: border-box; }
.tag-student-btn-top { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.tag-student-name { font-weight: 500; }
.tag-student-code { font-size: 11px; color: #9CA3AF; }
.tag-student-hint { font-size: 10px; margin-top: 2px; }
.tag-check-icon { width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tag-check-icon.checked { background: var(--brand-400); border: 1px solid var(--brand-400); }
.tag-check-icon.unchecked { background: #fff; border: 1px solid #D1D5DB; }

/* ---- 勋章管理 ---- */
.badge-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 640px) { .badge-grid-3 { grid-template-columns: repeat(2, 1fr); } }
.badge-card { display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: all .2s; padding: 20px 16px; background: #fff; border: 2px solid #F3F4F6; border-radius: 16px; box-sizing: border-box; min-height: 210px; }
.badge-card:hover { border-color: var(--brand-200); }
.badge-card.selected { background: #FAF5FF; border-color: #A855F7; }
.badge-card-icon-frame { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #F3F4F6; flex-shrink: 0; border: 3px solid #E5E7EB; }
.badge-card-icon-inner { width: 100%; height: 100%; border-radius: 50%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.badge-card-emoji { font-size: 44px; line-height: 1; }
.badge-card-name { font-size: 14px; font-weight: 600; color: #111827; margin-top: 12px; text-align: center; line-height: 1.3; }
.badge-rarity-mgr-label { font-size: 10px; font-weight: 700; text-align: center; letter-spacing: 0.05em; margin-top: 2px; text-transform: uppercase; }
.badge-card.selected.badge-rarity-mgr-legendary,
.badge-rarity-mgr-legendary:not(.selected) { border-color: #fbbf24; }
.badge-rarity-mgr-legendary .badge-rarity-mgr-label { color: #C8A163; }
.badge-card.selected.badge-rarity-mgr-epic,
.badge-rarity-mgr-epic:not(.selected) { border-color: #d8b4fe; }
.badge-rarity-mgr-epic .badge-rarity-mgr-label { color: #a855f7; }
.badge-card.selected.badge-rarity-mgr-rare,
.badge-rarity-mgr-rare:not(.selected) { border-color: #bfdbfe; }
.badge-rarity-mgr-rare .badge-rarity-mgr-label { color: #2563eb; }
.badge-rarity-mgr-common { border-color: #e5e7eb; }
.badge-rarity-mgr-common .badge-rarity-mgr-label { color: #9ca3af; }
.badge-card.selected.badge-rarity-mgr { border-color: #A855F7; }
.badge-card-desc { font-size: 12px; color: #6B7280; line-height: 1.4; text-align: center; margin-top: 6px; }
.badge-student-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge-student-btn { text-align: left; transition: all .2s; height: 44px; padding: 10px 12px; border-radius: 12px; background: #F9FAFB; border: 2px solid #F3F4F6; color: #374151; font-size: 14px; font-weight: 500; cursor: pointer; width: 100%; }
.badge-student-btn:hover { background: var(--brand-50); border-color: var(--brand-200); }
.badge-student-btn.selected { background: #FAF5FF; border-color: #A855F7; color: #7E22CE; }
.badge-step-btn { width: 100%; padding: 10px 16px; font-size: 13px; font-weight: 600; border-radius: 12px; transition: all .2s; border: none; cursor: pointer; height: 40px; }
.badge-step-btn:disabled { background: #F3F4F6; color: #9CA3AF; cursor: not-allowed; }
.badge-step-btn:not(:disabled) { background: #A855F7; color: #FFFFFF; }
.badge-step-btn:not(:disabled):hover { background: #9333EA; }
.badge-modal-body { flex: 1; overflow-y: auto; padding: 0 20px 12px; }
.badge-awarded-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid #F3F4F6; background: #fff; margin-bottom: 8px; }
.badge-awarded-img { width: 36px; height: 36px; border-radius: 8px; background: #F3F4F6; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.badge-awarded-emoji { font-size: 24px; }
.badge-awarded-info { flex: 1; min-width: 0; }
.badge-awarded-name { font-size: 14px; font-weight: 500; color: #111827; }
.badge-awarded-name .student-name { color: #9333EA; font-weight: 600; }
.badge-awarded-name .separator { color: #9CA3AF; margin: 0 4px; }
.badge-awarded-time { font-size: 12px; color: #9CA3AF; white-space: nowrap; }

/* 等级/积分规则样式 */
.level-rule-container { padding: 20px; }
.level-rule-header { margin-bottom: 24px; display: flex; align-items: flex-start; justify-content: space-between; }
.level-rule-title { font-size: 18px; font-weight: 600; color: #111827; margin-bottom: 4px; }
.level-rule-desc { font-size: 13px; color: #9ca3af; }
.btn-edit-level { height: 32px; padding: 0 16px; border-radius: 8px; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; background: white; color: #4B5563; border: 1px solid #e5e7eb; cursor: pointer; transition: all .15s; }
.btn-edit-level:hover { background: #f9fafb; border-color: #d1d5db; color: #111827; }
.level-edit-input { height: 32px; padding: 4px 8px; border: 1px solid #e5e7eb; border-radius: 6px; font-size: 14px; font-weight: 500; color: #111827; outline: none; transition: border-color .15s; }
.level-edit-input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 2px rgba(98,180,165,.15); }
.level-rule-table { width: 100%; background: white; border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid #f3f4f6; }
.level-rule-thead { display: grid; grid-template-columns: 1.5fr 2fr 1fr 1fr; padding: 12px 24px; background: var(--bg-body); font-weight: 500; color: var(--text-secondary); font-size: 13px; border-bottom: 1px solid #f3f4f6; }
.level-rule-tr { display: grid; grid-template-columns: 1.5fr 2fr 1fr 1fr; padding: 14px 24px; border-bottom: 1px solid #f3f4f6; align-items: center; }
.level-rule-tr:last-child { border-bottom: none; }
.level-rule-tr:hover { background: #fafafa; }
.level-rule-td { font-size: 14px; color: #333; }
.level-rule-td .level-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 6px; background: #f3f4f6; }
.level-rule-td .btn-level-cancel { height: 30px; padding: 0 12px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; background: linear-gradient(180deg,#fff,#f9fafb); color: var(--text-secondary); border: 1.5px solid var(--border); cursor: pointer; transition: all .25s var(--ease-out); box-shadow: var(--shadow-xs); }
.level-rule-td .btn-level-cancel:hover { background: var(--brand-50); border-color: var(--brand-300); color: var(--brand-600); transform: translateY(-1px); }
.level-rule-td .btn-level-cancel:active { transform: scale(0.97); }
.level-rule-footer { margin-top: 20px; display: flex; justify-content: flex-end; }
.btn-level-reset { padding: 8px 20px; background: #f3f4f6; color: #6b7280; border: none; border-radius: 8px; font-size: 13px; cursor: pointer; transition: all .2s; }
.btn-level-reset:hover { background: #e5e7eb; }

/* ---- 花名册表格 ---- */
.roster-table { width: 100%; background: white; border-radius: 12px; overflow: hidden; box-shadow: rgba(0,0,0,0) 0px 0px 0px 0px, rgba(0,0,0,0) 0px 0px 0px 0px, rgba(0,0,0,0.05) 0px 1px 2px 0px; border: 1px solid #f3f4f6; }
.roster-thead { display: grid; grid-template-columns: 110px 110px 110px 155px 1fr 113px 113px; padding: 12px 24px; background: #f9fafb; font-weight: 500; color: #6b7280; font-size: 13px; border-bottom: 1px solid #f3f4f6; height: 44.5px; align-items: center; }
.roster-row { display: grid; grid-template-columns: 110px 110px 110px 155px 1fr 113px 113px; padding: 10px 24px; border-bottom: 1px solid #f3f4f6; align-items: center; background: white; min-height: 49px; transition: background .15s; }
.roster-row:hover { background: #f9fafb; }
.roster-row:last-child { border-bottom: none; }
.roster-cell { font-size: 14px; color: #111827; }
.roster-cell.muted { color: #9ca3af; font-size: 13px; }
.roster-cell.pet-name { color: var(--brand-600); font-size: 13px; font-weight: 500; }
.roster-cell.position { color: #6b7280; font-size: 13px; }
.roster-actions { display: flex; gap: 4px; justify-content: flex-end; }
.roster-empty { color: #999; font-size: 14px; }
.action-btn { width: 30px; height: 30px; border-radius: 6px; border: none; cursor: pointer; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; background: transparent; transition: background 0.2s; }
.action-btn.edit { color: #6b7280; }
.action-btn.edit:hover { background: #f3f4f6; color: #374151; }
.action-btn.delete { color: #9ca3af; }
.action-btn.delete:hover { background: #fef2f2; color: #ef4444; }

/* 宠物胶囊 */
.pet-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 9999px; font-size: 12px; color: #111827; }
.pet-pill.orange { background: var(--brand-50); color: var(--brand-600); }
.pet-change-btn { font-size: 12px; color: #6b7280; cursor: pointer; background: none; border: none; padding: 2px 4px; }
.pet-change-btn:hover { color: #374151; }

/* 性别标签 */
.gender-tag { display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.gender-tag.male { background: #dbeafe; color: #1e40af; }
.gender-tag.female { background: #fce7f3; color: #9d174d; }
.gender-tag.none { background: #f3f4f6; color: #6b7280; }

.energy-num { font-weight: 600; color: #111827; }
.energy-num.zero { color: #9ca3af; }
.energy-num.high { color: var(--brand-600); }
.number-badge { font-variant-numeric: tabular-nums; }

/* ---- 积分规则 ---- */
.tab-group { display: inline-flex; background: #f3f4f6; padding: 2px; border-radius: 8px; border: 1px solid #e5e7eb; }
.tab-pill { height: 28px; padding: 0 12px; border-radius: 6px; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; transition: all .15s; }
.tab-pill.active { background: white; color: #111827; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.tab-pill.inactive { color: #6b7280; }
.tab-pill.inactive:hover { color: #111827; }

.rule-card { background: white; border: 1px solid #e5e7eb; border-radius: 12px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; transition: all .15s; cursor: default; }
.rule-card:hover { border-color: var(--brand-500); box-shadow: 0 1px 4px rgba(98,180,165,.05); }
.rule-num { width: 24px; height: 24px; border-radius: 50%; background: #f3f4f6; color: #6b7280; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.rule-emoji { font-size: 28px; line-height: 1; }
.rule-name { font-size: 14px; font-weight: 600; color: #111827; }

.score-pill { font-size: 14px; font-weight: 700; padding: 4px 10px; border-radius: 6px; }
.score-pill.positive { background: #DCFCE7; color: #059669; }
.score-pill.negative { background: #fee2e2; color: #991b1b; }

.cat-select { height: 26px; padding: 4px 8px; font-size: 12px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 6px; color: #111827; cursor: pointer; }
.cat-select:hover { border-color: #d1d5db; }
.op-btn-icon-only { width: 28px; height: 28px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: #9ca3af; cursor: pointer; border: none; background: none; transition: all .15s; }
.op-btn-icon-only:hover { background: #f3f4f6; color: #111827; }

/* 规则分类tab & 能量切换 — 参考 banchong.cn */
.rule-cat-tab { height: 32px; padding: 0 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; border: 1.5px solid transparent; background: transparent; color: #6b7280; transition: all .2s var(--ease-out); white-space: nowrap; }
.rule-cat-tab:hover { background: #FFF7ED; color: #EA580C; transform: translateY(-1px); }
.rule-cat-tab.active { background: linear-gradient(135deg, #FFB877 0%, #EA580C 100%); color: #FFFFFF; font-weight: 700; box-shadow: 0 2px 10px rgba(234,88,12,0.28), inset 0 1px 0 rgba(255,255,255,0.2); }
.cat-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.rule-cat-tab.active .cat-count { background: rgba(249,115,22,0.15); color: #EA580C; }
.rule-cat-tab:not(.active) .cat-count { background: #f3f4f6; color: #6b7280; }
/* 侧边栏分类按钮 */
.rule-cat-sidebar { width: 100%; height: 42px; padding: 0 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; justify-content: space-between; cursor: pointer; border: none; background: transparent; color: #6b7280; transition: all .2s var(--ease-out); }
.rule-cat-sidebar:hover { background: #F9FAFB; color: #111827; }
.rule-cat-sidebar.active { background: linear-gradient(135deg, #FFF7ED 0%, #FFE8D0 100%); color: #EA580C; font-weight: 600; box-shadow: inset 3px 0 0 #EA580C; }
.rule-cat-sidebar.active .cat-count { background: rgba(249,115,22,0.15); color: #EA580C; }
.rule-cat-sidebar:not(.active) .cat-count { background: #E5E7EB; color: #6b7280; }
.rule-energy-btn { height: 26px; padding: 0 10px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid transparent; background: transparent; color: #6b7280; transition: all .2s var(--ease-out); white-space: nowrap; }
.rule-energy-btn:hover { background: #f3f4f6; color: #111827; }
.rule-energy-btn.active { background: var(--brand-50); color: var(--brand-700); font-weight: 700; border-color: var(--brand-200); }

.sort-btn { height: 32px; padding: 0 12px; border-radius: 6px; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; border: 1px solid #e5e7eb; background: white; color: #4B5563; cursor: pointer; transition: all .15s; white-space: nowrap; flex-shrink: 0; }
.sort-btn:hover { background: #f9fafb; border-color: #d1d5db; }

/* ---- 小组管理 ---- */
.group-card { background: white; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; display: flex; align-items: center; gap: 16px; transition: all .15s; }
.group-card:hover { border-color: var(--brand-500); box-shadow: 0 2px 8px rgba(98,180,165,.05); }
.group-avatar { width: 56px; height: 56px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 28px; line-height: 1; }
.group-avatar.monkey { background: linear-gradient(135deg, var(--sun-100), var(--gold-200)); }
.group-avatar.mouse { background: linear-gradient(135deg, #E0E7FF, #C7D2FE); }
.group-name { font-size: 16px; font-weight: 600; color: #111827; }
.member-pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 9999px; background: #f3f4f6; color: #4B5563; font-size: 12px; font-weight: 500; }
.claim-hint { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--brand-600); background: var(--brand-50); padding: 4px 8px; border-radius: 6px; }
.op-btn { height: 34px; padding: 0 18px; border-radius: var(--radius-md); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; border: none; transition: all .25s var(--ease-out); white-space: nowrap; position: relative; overflow: hidden; }
.op-btn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,0.14) 0%, transparent 50%); pointer-events: none; border-radius: inherit; }
.op-btn-secondary { border: 1.5px solid var(--border); color: var(--text-secondary); background: linear-gradient(180deg, #fff 0%, #f9fafb 100%); box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255,255,255,0.7); }
.op-btn-secondary:hover { background: var(--brand-50); border-color: var(--brand-300); color: var(--brand-600); box-shadow: 0 2px 10px rgba(79, 70, 229,0.14); transform: translateY(-1px); }
.op-btn-primary { background: linear-gradient(135deg, var(--brand-400) 0%, var(--brand-600) 100%); color: #FFFFFF; box-shadow: 0 2px 8px rgba(79, 70, 229,0.28), inset 0 1px 0 rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.15); }
.op-btn-primary:hover { box-shadow: 0 6px 20px rgba(79, 70, 229,0.36); filter: brightness(1.04); transform: translateY(-1px); }
.op-btn-icon { width: 30px; height: 30px; border-radius: var(--radius-sm); color: var(--text-tertiary, #9ca3af); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; border: 1px solid transparent; background: transparent; transition: all .25s var(--ease-out); position: relative; overflow: hidden; }
.op-btn-icon::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,0.14) 0%, transparent 50%); pointer-events: none; border-radius: inherit; }
.op-btn-icon:hover { background: var(--brand-50); color: var(--brand-600); border-color: var(--brand-200); box-shadow: 0 2px 8px rgba(79, 70, 229,0.12); }
.op-btn-icon:active { transform: scale(0.92); }

.btn-add-rule { height: 34px; padding: 0 18px; border-radius: var(--radius-md); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(135deg, var(--brand-400) 0%, var(--brand-600) 100%); color: #FFFFFF; border: 1px solid rgba(255,255,255,0.15); cursor: pointer; transition: all .25s var(--ease-out); white-space: nowrap; position: relative; overflow: hidden; box-shadow: 0 2px 8px rgba(79, 70, 229,0.28), inset 0 1px 0 rgba(255,255,255,0.18); }
.btn-add-rule::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,0.14) 0%, transparent 50%); pointer-events: none; border-radius: inherit; }
.btn-add-rule:hover { box-shadow: 0 6px 20px rgba(79, 70, 229,0.36); filter: brightness(1.04); transform: translateY(-1px); }
.btn-add-rule:active { transform: scale(0.97); }

/* flex 工具类 */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-1\.5 { gap: 6px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-1 { margin-bottom: 4px; }
.space-y-2 > * + * { margin-top: 8px; }
.text-base { font-size: 16px; }
.font-semibold { font-weight: 600; }
.text-slate-700 { color: #374151; }
.text-slate-500 { color: #6b7280; }
.w-4 { width: 16px; }
.h-4 { height: 16px; }
.w-3\.5 { width: 14px; }
.h-3\.5 { height: 14px; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shrink-0 { flex-shrink: 0; }
.min-w-0 { min-width: 0; }
.flex-1 { flex: 1; }

.empty-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 400px; color: #999; }
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-text { font-size: 16px; color: #666; margin-bottom: 8px; }
.empty-desc { font-size: 13px; color: #999; }

/* 宠物分类弹窗（旧版保留兼容，新版用 adopt-tab / adopt-card 体系） */
.adopt-pet-modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.45); align-items: flex-start; justify-content: center; padding: 24px; overflow-y: auto; -webkit-overflow-scrolling: touch; z-index: 1000; }
.adopt-pet-modal.active { display: flex; }
.adopt-pet-content {
    background: #fff;
    border-radius: 18px;
    width: 920px;
    max-width: 94vw;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.pet-categories { padding: 14px 28px 0; border-bottom: 1px solid #f0f0f0; display: flex; gap: 8px; overflow-x: auto; }
.pet-category { padding: 7px 18px; border-radius: 20px; background: #f5f6fa; cursor: pointer; font-size: 14px; font-weight: 500; color: #555; transition: all 0.2s; white-space: nowrap; border: none; user-select: none; }
.pet-category.active { background: linear-gradient(135deg, #ff8a50, #ff6b35); color: #FFFFFF; box-shadow: 0 2px 10px rgba(255,107,53,0.3); }
.pet-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 14px; }
.pet-item { background: #fff; border: 1.5px solid #eef0f4; border-radius: 14px; padding: 14px 8px 10px; text-align: center; cursor: pointer; overflow: hidden; transition: all 0.2s ease; }
.pet-item.selected { border-color: #ff6b35; background: linear-gradient(180deg, #fff8f5 0%, #fff 100%); box-shadow: 0 4px 16px rgba(255,107,53,0.18); }
.pet-item-image { width: 72px; height: 72px; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; border-radius: 12px; overflow: hidden; }
.pet-item-image img { width: 100%; height: 100%; object-fit: contain; }
.pet-item > div:last-child { font-size: 13px; color: #666; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* === 宠物图鉴卡片 === */
.pet-handbook-card:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,.1); }
.pet-series-tag { transition: all .15s; cursor: pointer; }
.pet-series-tag:hover { transform: translateY(-1px); }
.pet-series-tag.active { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.08); }

/* Tailwind 兼容 - 弹窗 hidden 类 */
.hidden { display: none !important; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.inset-x-0 { left: 0; right: 0; }
.bg-black\/40 { background-color: rgba(0,0,0,0.4); }
.backdrop-blur-sm { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.flex-col { flex-direction: column; }
.p-6 { padding: 24px; }
.px-6 { padding-left: 24px; padding-right: 24px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-2\.5 { padding-top: 10px; padding-bottom: 10px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.pt-2 { padding-top: 8px; }
.pt-5 { padding-top: 20px; }
.pb-3 { padding-bottom: 12px; }
.gap-6 { gap: 24px; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }
.rounded-2xl { border-radius: 16px; }
.rounded-xl { border-radius: 12px; }
.rounded-lg { border-radius: 8px; }
.rounded-full { border-radius: 9999px; }
.border { border: 1px solid #e5e7eb; }
.border-2 { border-width: 2px; }
.border-b { border-bottom: 1px solid #e5e7eb; }
.border-b-2 { border-bottom-width: 2px; border-bottom-style: solid; }
.border-transparent { border-color: transparent; }
.border-orange-500 { border-color: var(--brand-500); }
.border-slate-200 { border-color: #e5e7eb; }
.border-slate-100 { border-color: #f3f4f6; }
.bg-orange-50 { background-color: var(--brand-50); }
.bg-orange-500 { background-color: var(--brand-500); }
.text-amber-600 { color: #d97706; }
.text-orange-600 { color: var(--brand-600); }
.text-xs { font-size: 12px; }
.text-sm { font-size: 14px; }
.text-lg { font-size: 18px; }
.text-2xl { font-size: 24px; }
.text-4xl { font-size: 36px; }
.text-5xl { font-size: 48px; }
.font-bold { font-weight: 700; }
.leading-none { line-height: 1; }
.tracking-tight { letter-spacing: -0.025em; }
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.w-full { width: 100%; }
.w-8 { width: 32px; }
.h-8 { height: 32px; }
.h-24 { height: 96px; }
.max-w-4xl { max-width: 896px; }
.relative { position: relative; }
.absolute { position: absolute; }
.top-3 { top: 12px; }
.right-3 { right: 12px; }
.top-16 { top: 64px; }
.z-10 { z-index: 10; }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.hover\:bg-slate-100:hover { background-color: #f3f4f6; }
.hover\:bg-orange-600:hover { background-color: var(--brand-600); }
.hover\:text-slate-700:hover { color: #374151; }
.hover\:border-orange-300:hover { border-color: var(--brand-300); }
.hover\:shadow-md:hover { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.transition-all { transition: all 0.2s; }
.cursor-pointer { cursor: pointer; }
.text-center { text-align: center; }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-cols-8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }

/* ============================================================
   班级设置
   ============================================================ */
.settings-body { max-width: 720px; margin: 0 auto; padding: 24px 0; }

.settings-card { background: #fff; border-radius: 12px; border: 1px solid #f3f4f6; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.settings-card--danger { border-color: #fecaca; }

.settings-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.settings-card-title { font-size: 16px; font-weight: 700; color: #111827; margin-bottom: 16px; }
.settings-card-header .settings-card-title { margin-bottom: 0; }

.settings-edit-btn { font-size: 12px; color: #6b7280; background: transparent; border: none; cursor: pointer; padding: 0; }
.settings-edit-btn:hover { color: #374151; }

.settings-info-grid { display: flex; gap: 40px; }
.settings-info-item { }
.settings-info-label { font-size: 14px; color: #9ca3af; margin-bottom: 6px; }
.settings-info-value { font-size: 18px; font-weight: 700; color: #111827; }
.settings-color-dot { display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: #6366f1; box-shadow: 0 1px 4px rgba(0,0,0,.18); vertical-align: middle; }
/* 编辑班级弹窗内的颜色选择 */
#settings-edit-modal .class-color-label { font-size: 13px; font-weight: 500; color: #6b7280; margin: -4px 0 10px; }
#settings-edit-modal .class-color-picker { margin-bottom: 20px; }

.settings-field { display: flex; align-items: flex-start; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid #f3f4f6; gap: 24px; }
.settings-field:last-child { border-bottom: none; padding-bottom: 0; }
.settings-field:first-child { padding-top: 0; }
.settings-field-info { flex: 1; min-width: 0; }
.settings-field-label { font-size: 14px; font-weight: 500; color: #374151; margin-bottom: 4px; }
.settings-field-desc { font-size: 12px; color: #9ca3af; line-height: 1.4; }

.settings-tab-group { display: flex; gap: 4px; background: #f3f4f6; border-radius: 8px; padding: 4px; flex-shrink: 0; }
.settings-tab-btn { padding: 6px 12px; font-size: 12px; border-radius: 6px; background: transparent; color: #6b7280; border: none; cursor: pointer; transition: all 0.15s; font-family: inherit; white-space: nowrap; }
.settings-tab-btn.active { background: #fff; color: var(--brand-600); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.settings-tab-btn:hover:not(.active) { color: #374151; }

.settings-toggle { position: relative; width: 44px; height: 24px; border-radius: 9999px; background: var(--brand-500); border: none; cursor: pointer; flex-shrink: 0; transition: background 0.2s; padding: 0; }
.settings-toggle.off { background: #d1d5db; }
.settings-toggle-knob { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; background: #fff; border-radius: 9999px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); transition: all 0.2s; }
.settings-toggle.off .settings-toggle-knob { right: auto; left: 2px; }

.settings-danger-btn { padding: 8px 16px; font-size: 14px; border-radius: 8px; border: 1px solid #fecaca; color: #ef4444; background: transparent; cursor: pointer; transition: all 0.15s; font-family: inherit; flex-shrink: 0; }
.settings-danger-btn:hover { background: #fef2f2; border-color: #fca5a5; }

/* 弹窗 */
.settings-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 2000; }
.settings-modal-card { background: #fff; border-radius: 16px; width: 100%; max-width: 384px; padding: 24px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); }
.settings-modal-title { font-size: 18px; font-weight: 700; color: #111827; margin: 0 0 8px; }
.settings-modal-desc { font-size: 14px; color: #6b7280; margin: 0 0 24px; line-height: 1.5; }
.settings-modal-input { width: 100%; padding: 12px 14px; font-size: 14px; border: 2px solid #e5e7eb; border-radius: 12px; outline: none; margin-bottom: 20px; box-sizing: border-box; font-family: inherit; }
.settings-modal-input:focus { border-color: var(--brand-500); }
.settings-modal-actions { display: flex; gap: 8px; }
.settings-modal-btn { flex: 1; padding: 10px; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; border: none; font-family: inherit; transition: all 0.15s; }
.settings-modal-btn--secondary { background: transparent; border: 1px solid #e5e7eb; color: #4B5563; }
.settings-modal-btn--secondary:hover { background: #f9fafb; }
.settings-modal-btn--primary { background: var(--brand-500); color: #FFFFFF; }
.settings-modal-btn--primary:hover { background: var(--brand-600); }
.settings-modal-btn--danger { background: #dc2626; color: #FFFFFF; }
.settings-modal-btn--danger:hover { background: #b91c1c; }

/* Toast */
.settings-toast { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); background: #10b981; color: #FFFFFF; padding: 8px 16px; border-radius: 8px; font-size: 14px; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); z-index: 3000; }

/* ============================================================
   小组管理（自定义颜色分组 / 成员管理 / 整组加减分）
   ============================================================ */

/* 列表容器与空状态 */
#groups-list { display: flex; flex-direction: column; gap: 12px; }
.group-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; text-align: center; color: #94a3b8; gap: 8px;
}
.group-empty-icon { font-size: 48px; margin-bottom: 4px; }
.group-empty-title { font-size: 17px; font-weight: 800; color: #475569; }
.group-empty-desc { font-size: 13px; color: #94a3b8; max-width: 360px; line-height: 1.6; }
.group-empty-btn {
  margin-top: 14px; padding: 12px 22px; border: none; border-radius: 14px; cursor: pointer;
  font-size: 14px; font-weight: 800; color: #fff; font-family: inherit;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-500));
  box-shadow: 0 6px 16px rgba(79,70,229,0.25); transition: all .2s;
}
.group-empty-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(79,70,229,0.32); }

/* 小组卡片 */
.group-row-card {
  display: flex; align-items: stretch; overflow: hidden;
  background: #fff; border: 1px solid #eef0f4; border-radius: 16px;
  box-shadow: 0 2px 10px rgba(15,23,42,0.04); transition: box-shadow .2s, transform .2s;
}
.group-row-card:hover { box-shadow: 0 8px 24px rgba(15,23,42,0.08); }
.group-color-bar { width: 6px; flex-shrink: 0; }
.group-row-body { flex: 1; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.group-row-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.group-row-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.group-dot { width: 12px; height: 12px; border-radius: 999px; flex-shrink: 0; }
.group-row-name { font-size: 16px; font-weight: 800; color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-row-count { font-size: 12px; font-weight: 600; color: #94a3b8; flex-shrink: 0; }
.group-row-actions { display: flex; gap: 8px; flex-shrink: 0; }
.group-action-btn {
  padding: 6px 12px; border-radius: 10px; border: 1px solid #e2e8f0; background: #fff;
  font-size: 13px; font-weight: 700; color: #475569; cursor: pointer; font-family: inherit; transition: all .15s;
}
.group-action-btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.group-action-btn.danger { color: #ef4444; border-color: #fecaca; }
.group-action-btn.danger:hover { background: #fef2f2; }

.group-row-members { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.group-member-tag {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  background: #f1f5f9; color: #475569; font-size: 12px; font-weight: 600;
}
.group-member-more {
  display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px;
  background: #e2e8f0; color: #64748b; font-size: 12px; font-weight: 700;
}
.group-no-member { font-size: 12px; color: #94a3b8; font-style: italic; }

/* 新建小组 FAB（列表底部） */
.group-create-fab {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border: none; border-radius: 14px; cursor: pointer;
  font-size: 14px; font-weight: 800; color: #fff; font-family: inherit;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-500));
  box-shadow: 0 6px 16px rgba(79,70,229,0.25); transition: all .2s;
}
.group-create-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(79,70,229,0.32); }
.group-create-fab span { font-size: 18px; line-height: 1; }

/* 新建/编辑通用模态卡片 */
.group-modal-card {
  width: 100%; max-width: 420px; background: #fff; border-radius: 20px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(15,23,42,0.25); animation: groupModalIn .25s ease;
}
@keyframes groupModalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.group-modal-header { padding: 18px 20px; border-bottom: 1px solid #f1f5f9; }
.group-modal-header h3 { margin: 0; font-size: 17px; font-weight: 800; color: #1f2937; }
.group-modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.group-form-row { display: flex; flex-direction: column; gap: 8px; }
.group-form-row label { font-size: 13px; font-weight: 700; color: #475569; }
.group-form-row input[type="text"] {
  width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0; border-radius: 12px;
  font-size: 14px; font-family: inherit; color: #1f2937; outline: none; transition: border-color .15s;
}
.group-form-row input[type="text"]:focus { border-color: var(--brand-400); }

.group-color-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.group-color-dot {
  width: 30px; height: 30px; border-radius: 999px; border: 2px solid rgba(0,0,0,0.06);
  cursor: pointer; padding: 0; transition: transform .15s, box-shadow .15s; position: relative;
}
.group-color-dot:hover { transform: scale(1.1); }
.group-color-dot.selected { box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(15,23,42,0.25); transform: scale(1.05); }

.group-modal-footer { padding: 14px 20px; border-top: 1px solid #f1f5f9; display: flex; gap: 10px; justify-content: flex-end; }
.group-modal-footer button {
  padding: 10px 18px; border-radius: 12px; font-size: 14px; font-weight: 700; cursor: pointer;
  border: 1px solid #e2e8f0; background: #fff; color: #475569; font-family: inherit; transition: all .15s;
}
.group-modal-footer button:hover { background: #f8fafc; }
.group-modal-footer button.primary { border: none; color: #fff; background: linear-gradient(135deg, var(--brand-500), var(--brand-600)); box-shadow: 0 3px 10px rgba(79,70,229,.25); }
.group-modal-footer button.primary:hover:not(:disabled) { filter: brightness(1.06); }
.group-modal-footer button.primary:disabled,
.group-modal-footer button.primary[disabled] { background: #cbd5e1 !important; color: #f8fafc !important; cursor: not-allowed; box-shadow: none; filter: none; }

/* 成员管理模态 */
.group-member-modal {
  position: relative; width: 100%; max-width: 560px; max-height: 84vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 24px 60px rgba(15,23,42,0.28);
  animation: groupModalIn .25s ease;
}
.group-modal-close {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 10px;
  border: none; background: #f1f5f9; color: #64748b; cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: all .15s; z-index: 2;
}
.group-modal-close:hover { background: #e2e8f0; color: #334155; }
.group-member-modal-header { padding: 20px 24px 14px; border-left: 4px solid var(--brand-500); background: #f8fafc; }
.group-member-modal-header h3 { margin: 0 0 4px; font-size: 17px; font-weight: 800; color: #1f2937; }
.group-member-modal-header p { margin: 0; font-size: 13px; color: #94a3b8; }
.group-member-modal-body { padding: 8px 24px 16px; overflow-y: auto; flex: 1; }
.group-member-modal-footer { padding: 14px 24px; border-top: 1px solid #f1f5f9; display: flex; gap: 10px; justify-content: flex-end; }
.group-member-modal-footer button {
  padding: 10px 18px; border-radius: 12px; font-size: 14px; font-weight: 700; cursor: pointer;
  border: 1px solid #e2e8f0; background: #fff; color: #475569; font-family: inherit; transition: all .15s;
}
.group-member-modal-footer button:hover { background: #f8fafc; }
.group-member-modal-footer button.primary { border: none; color: #fff; }

.group-member-section { margin-top: 14px; }
.group-member-section-title { font-size: 13px; font-weight: 800; color: #475569; margin-bottom: 10px; }
.group-member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.group-member-btn {
  display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; text-align: left;
  border: 1.5px solid #e2e8f0; border-radius: 12px; background: #fff; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.group-member-btn:hover { border-color: #cbd5e1; background: #f8fafc; }
.group-member-btn.selected { border-color: var(--brand-500); background: rgba(79,70,229,0.06); }
.group-member-btn-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.group-member-btn-name { font-size: 14px; font-weight: 700; color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-member-check {
  width: 18px; height: 18px; border-radius: 999px; border: 1.5px solid #cbd5e1; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.group-member-check.checked { border-color: var(--brand-500); }
.group-member-hint { font-size: 11px; font-weight: 600; }
