* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f7fa; color: #333; }

/* 登录页 */
.login-page { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg, #15C46D 0%, #0FAE5C 100%); }
.login-box { background: #fff; border-radius: 16px; padding: 48px 40px; width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
.login-title { font-size: 24px; font-weight: 700; text-align: center; margin-bottom: 8px; }
.login-subtitle { font-size: 14px; color: #999; text-align: center; margin-bottom: 32px; }
.login-field { margin-bottom: 20px; }
.login-field label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.login-field input { width: 100%; height: 44px; border: 1px solid #ddd; border-radius: 8px; padding: 0 14px; font-size: 15px; outline: none; transition: border-color 0.2s; }
.login-field input:focus { border-color: #15C46D; }
.login-btn { width: 100%; height: 48px; background: #15C46D; color: #fff; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.login-btn:hover { background: #0FAE5C; }
.login-btn:disabled { background: #ccc; cursor: not-allowed; }
.login-error { color: #E0625D; font-size: 13px; text-align: center; margin-top: 12px; min-height: 20px; }

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #fff; border-right: 1px solid #e8e8e8; display: flex; flex-direction: column; }
.sidebar-logo { padding: 24px 20px; border-bottom: 1px solid #e8e8e8; }
.sidebar-logo h2 { font-size: 18px; color: #15C46D; }
.sidebar-logo p { font-size: 12px; color: #999; margin-top: 4px; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-item { display: flex; align-items: center; padding: 12px 20px; color: #666; font-size: 14px; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.nav-item:hover { background: #f0faf4; color: #15C46D; }
.nav-item.active { background: #f0faf4; color: #15C46D; font-weight: 600; border-right: 3px solid #15C46D; }
.nav-icon { margin-right: 10px; font-size: 18px; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid #e8e8e8; }
.logout-btn { width: 100%; padding: 10px; background: #fff; border: 1px solid #E0625D; color: #E0625D; border-radius: 8px; font-size: 14px; cursor: pointer; transition: all 0.2s; }
.logout-btn:hover { background: #FFF1F0; }

.main { flex: 1; display: flex; flex-direction: column; }
.topbar { height: 56px; background: #fff; border-bottom: 1px solid #e8e8e8; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; }
.topbar-title { font-size: 18px; font-weight: 600; }
.content { flex: 1; padding: 24px; overflow-y: auto; }

/* 仪表盘 */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.stat-label { font-size: 13px; color: #999; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: #333; }
.stat-value.green { color: #15C46D; }
.stat-value.red { color: #E0625D; }
.stat-value.blue { color: #1677FF; }
.stat-tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; margin-top: 8px; }
.stat-tag.up { background: #f0faf4; color: #15C46D; }

/* 表格 */
.table-card { background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); overflow: hidden; }
.table-toolbar { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #f0f0f0; flex-wrap: wrap; }
.table-toolbar input, .table-toolbar select { height: 36px; border: 1px solid #ddd; border-radius: 8px; padding: 0 12px; font-size: 14px; outline: none; }
.table-toolbar input:focus, .table-toolbar select:focus { border-color: #15C46D; }
.toolbar-btn { height: 36px; padding: 0 16px; background: #15C46D; color: #fff; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; }
.toolbar-btn:hover { background: #0FAE5C; }
table { width: 100%; border-collapse: collapse; }
th { background: #fafafa; text-align: left; padding: 12px 16px; font-size: 13px; font-weight: 600; color: #666; border-bottom: 1px solid #f0f0f0; }
td { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid #f8f8f8; }
tr:hover td { background: #fafafa; }

/* 状态标签 */
.badge { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 12px; font-weight: 500; }
.badge-active { background: #f0faf4; color: #15C46D; }
.badge-disabled { background: #FFF1F0; color: #E0625D; }
.badge-admin { background: #E6F7FF; color: #1677FF; }

/* 操作按钮 */
.op-btn { padding: 4px 12px; border-radius: 6px; font-size: 13px; cursor: pointer; border: none; margin-right: 6px; transition: opacity 0.2s; }
.op-btn:hover { opacity: 0.8; }
.op-btn-danger { background: #FFF1F0; color: #E0625D; }
.op-btn-success { background: #f0faf4; color: #15C46D; }
.op-btn-primary { background: #E6F7FF; color: #1677FF; }

/* 分页 */
.pagination { display: flex; justify-content: flex-end; align-items: center; padding: 16px 20px; gap: 8px; }
.page-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: 1px solid #ddd; border-radius: 8px; background: #fff; cursor: pointer; font-size: 14px; }
.page-btn.active { background: #15C46D; color: #fff; border-color: #15C46D; }
.page-btn:disabled { background: #f5f5f5; color: #ccc; cursor: not-allowed; }
.page-info { font-size: 13px; color: #999; margin-right: 12px; }

/* 弹窗 */
.modal-mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 100; display: flex; justify-content: center; align-items: center; }
.modal { background: #fff; border-radius: 12px; padding: 24px; width: 480px; max-height: 80vh; overflow-y: auto; }
.modal-title { font-size: 18px; font-weight: 600; margin-bottom: 20px; }
.modal-row { display: flex; align-items: center; margin-bottom: 16px; }
.modal-row label { width: 100px; font-size: 14px; color: #666; flex-shrink: 0; }
.modal-row span { font-size: 14px; }
.restriction-list { display: flex; flex-direction: column; gap: 12px; }
.restriction-item { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.restriction-item input { width: 18px; height: 18px; accent-color: #E0625D; }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.modal-btn { padding: 8px 24px; border-radius: 8px; font-size: 14px; cursor: pointer; border: none; }
.modal-btn-cancel { background: #f5f5f5; color: #666; }
.modal-btn-confirm { background: #15C46D; color: #fff; }
.modal-btn-danger { background: #E0625D; color: #fff; }

/* 空状态 */
.empty-state { text-align: center; padding: 60px 0; color: #999; }
.empty-state p { font-size: 14px; }

/* 家庭详情 */
.family-info { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); margin-bottom: 20px; }
.family-info h3 { margin-bottom: 4px; }
.family-meta { margin-top: 12px; }
.family-actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

/* 等级徽章 */
.badge-vip { background: #FFF7E6; color: #FA8C16; }
.badge-member-level { background: #F5F5F5; color: #999; }
