* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #4A90D9;
    --primary-dark: #357ABD;
    --danger: #E84D4D;
    --success: #4CAF50;
    --warning: #FF9800;
    --bg: #F5F7FA;
    --card-bg: #FFFFFF;
    --text: #333333;
    --text-sec: #666666;
    --text-muted: #999999;
    --border: #E8E8E8;
    --radius: 8px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ===== 登录页 ===== */
.login-card {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--card-bg);
    padding: 40px 32px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 90%; max-width: 380px;
    text-align: center;
}
.login-logo { font-size: 48px; margin-bottom: 8px; }
.login-card h2 { font-size: 20px; margin-bottom: 28px; font-weight: 600; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; text-align: left; }
.form-group label { display: block; font-size: 13px; color: var(--text-sec); margin-bottom: 6px; font-weight: 500; }
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"] {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 6px;
    font-size: 14px; outline: none; transition: border-color .2s;
}
.form-group input:focus { border-color: var(--primary); }

/* ===== 按钮 ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 16px; border: none; border-radius: 6px;
    font-size: 14px; cursor: pointer; transition: all .2s;
    white-space: nowrap; font-weight: 500;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-sec); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { width: 100%; padding: 12px; font-size: 16px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== 顶部导航 ===== */
.header {
    background: var(--card-bg); padding: 12px 20px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    position: sticky; top: 0; z-index: 100;
}
.header-title { font-size: 16px; font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.admin-name { font-size: 13px; color: var(--text-sec); }

/* ===== 内容区 ===== */
.content { padding: 16px; max-width: 960px; margin: 0 auto; }

.search-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.search-bar input {
    flex: 1; padding: 8px 12px;
    border: 1px solid var(--border); border-radius: 6px;
    font-size: 14px; outline: none;
}
.search-bar input:focus { border-color: var(--primary); }

.stats-bar { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }

/* ===== 用户卡片列表 ===== */
.user-list { display: flex; flex-direction: column; gap: 10px; }

.user-card {
    background: var(--card-bg); border-radius: var(--radius);
    padding: 14px 16px; box-shadow: var(--shadow);
    display: flex; align-items: center; gap: 12px;
}
.user-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    background: #E8EDF3; display: flex; align-items: center;
    justify-content: center; font-size: 18px; flex-shrink: 0;
    overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.user-name .uid { font-weight: 400; font-size: 11px; color: var(--text-muted); }
.user-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.user-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* 标签 */
.tag {
    display: inline-block; padding: 1px 6px; border-radius: 3px;
    font-size: 11px; font-weight: 500;
}
.tag-vip { background: #FFF3E0; color: #E65100; }
.tag-vip.active { background: #FF9800; color: #fff; }
.tag-wechat { background: #E8F5E9; color: #2E7D32; }
.tag-h5 { background: #E3F2FD; color: #1565C0; }

/* ===== 分页 ===== */
.pagination {
    display: flex; justify-content: center; align-items: center;
    gap: 8px; margin-top: 20px; padding-bottom: 20px;
}
.pagination .btn { min-width: 36px; }
.pagination .page-info { font-size: 13px; color: var(--text-sec); }

/* ===== 弹窗 ===== */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.modal-content {
    position: relative; background: var(--card-bg);
    border-radius: 12px; width: 90%; max-width: 420px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); padding: 0 4px; }
.modal-body { padding: 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

.info-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 14px; }
.info-row .label { color: var(--text-muted); min-width: 60px; }

.quick-btns { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }

/* ===== Toast ===== */
.toast {
    position: fixed; top: 60px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.75); color: #fff; padding: 10px 24px;
    border-radius: 8px; font-size: 14px; z-index: 999;
    opacity: 0; transition: opacity .3s; pointer-events: none;
}
.toast.show { opacity: 1; }

/* ===== 移动端适配 ===== */
@media (max-width: 640px) {
    .header { padding: 10px 12px; }
    .header-title { font-size: 14px; }
    .admin-name { display: none; }
    .content { padding: 12px; }
    .search-bar { flex-wrap: wrap; }
    .search-bar input { width: 100%; }
    .user-card { flex-wrap: wrap; padding: 12px; }
    .user-actions { width: 100%; justify-content: flex-end; margin-top: 6px; }
    .modal-content { width: 95%; }
    .quick-btns { gap: 4px; }
    .quick-btns .btn { flex: 1; }
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* ===== 加载状态 ===== */
.loading { text-align: center; padding: 40px; color: var(--text-muted); }


/* ===== Tab导航 ===== */
.tab-nav {
    display: flex;
    background: var(--card-bg);
    border-bottom: 2px solid var(--border);
    padding: 0 16px;
    max-width: 960px;
    margin: 0 auto;
}
.tab-item {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-sec);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .2s;
    white-space: nowrap;
}
.tab-item:hover { color: var(--primary); }
.tab-item.tab-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ===== 注册码管理 ===== */
.regcode-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 12px;
    flex-wrap: wrap;
}
.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.toolbar-left select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    background: #fff;
}
.stats-text { font-size: 13px; color: var(--text-muted); }

.regcode-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.regcode-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 12px 16px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
}
.regcode-code {
    font-family: monospace;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    min-width: 100px;
    letter-spacing: 1px;
}
.regcode-info {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}
.regcode-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    flex-shrink: 0;
}
.regcode-status.unused { background: #E8F5E9; color: #2E7D32; }
.regcode-status.used { background: #F5F5F5; color: #999; }
.regcode-status.expired { background: #FFF3E0; color: #E65100; }

/* 通知管理 */
.notice-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.notice-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    border-left: 4px solid #FA8C16;
}
.notice-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.notice-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    min-width: 0;
}
.notice-sort {
    font-size: 12px;
    color: var(--text-muted);
}
.notice-content {
    font-size: 13px;
    color: var(--text-sec);
    line-height: 1.6;
    margin-bottom: 10px;
    white-space: pre-wrap;
    word-break: break-all;
}
.notice-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.notice-time {
    font-size: 12px;
    color: var(--text-muted);
}
.notice-actions {
    display: flex;
    gap: 8px;
}
.tag-success { background: #E8F5E9; color: #2E7D32; }
.tag-muted { background: #F5F5F5; color: #999; }
.tag-warning { background: #FFF3E0; color: #E65100; }
.btn-warning { background: #FA8C16; color: #fff; border: none; }
.btn-warning:hover { background: #D46B08; }

@media (max-width: 640px) {
    .tab-nav { padding: 0 8px; }
    .tab-item { padding: 10px 14px; font-size: 13px; }
    .regcode-card { flex-wrap: wrap; }
    .regcode-toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-left, .toolbar-right { width: 100%; }
    .toolbar-right { display: flex; justify-content: flex-end; }
}
