/* ===== 后台样式 ===== */
body { font-family: "Microsoft YaHei", sans-serif; background: #f5f7fa; color: #2c3e50; margin: 0; }
* { box-sizing: border-box; }

/* 登录页：全屏居中,不需要侧边栏偏移 */
body.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #f5f7fa; }

/* 左侧固定菜单栏 */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    background: #2c3e50;
    color: #fff;
    padding: 20px 0;
    overflow-y: auto;
    box-shadow: 2px 0 4px rgba(0,0,0,.08);
    z-index: 100;
}
.admin-sidebar .brand {
    padding: 0 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
}
.admin-sidebar .brand small { display: block; font-size: 11px; font-weight: 400; color: #95a5a6; margin-top: 4px; }
.admin-tabs { display: flex; flex-direction: column; gap: 2px; }
.admin-tabs a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #cfd8e3;
    font-size: 14px;
    background: transparent;
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all .15s;
}
.admin-tabs a:hover { background: rgba(255,255,255,.08); color: #fff; }
.admin-tabs a.active {
    background: rgba(26,95,180,.25);
    color: #fff;
    border-left-color: #1a5fb4;
}

/* 右侧主区域:为侧边栏留出空间 */
.admin-main { margin-left: 260px; min-height: 100vh; display: flex; flex-direction: column; }

/* 顶栏(标题 + 当前管理员 + 退出) */
.admin-header {
    background: #fff;
    color: #2c3e50;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    border-bottom: 1px solid #e1e8ed;
}
.admin-header h1 { font-size: 18px; font-weight: 500; margin: 0; color: #2c3e50; }
.admin-header .user { font-size: 13px; color: #6c757d; }
.admin-header .user a { color: #1a5fb4; margin-left: 16px; text-decoration: none; }
.admin-header .user a:hover { text-decoration: underline; }

.admin-container { max-width: 1200px; margin: 0 auto; padding: 24px 20px; width: 100%; }

.toolbar {
    background: #fff;
    border-radius: 6px;
    padding: 14px 20px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.toolbar .left, .toolbar .right { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar form { display: inline-flex; gap: 6px; }
.toolbar input[type=text] {
    padding: 6px 10px;
    border: 1px solid #d0d7e2;
    border-radius: 4px;
    font-size: 14px;
}

.btn {
    display: inline-block;
    padding: 7px 16px;
    background: #1a5fb4;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
    transition: all .15s;
}
.btn:hover { background: #0d4ba0; color: #fff; text-decoration: none; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-danger { background: #d33; }
.btn-danger:hover { background: #b22; }
.btn-ghost { background: #fff; color: #1a5fb4; border: 1px solid #1a5fb4; }
.btn-ghost:hover { background: #1a5fb4; color: #fff; }

.table {
    width: 100%;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    border-collapse: collapse;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.table th, .table td { padding: 12px 16px; text-align: left; font-size: 14px; }
.table th { background: #f0f4f8; color: #2c3e50; font-weight: 600; border-bottom: 2px solid #e1e8ed; }
.table td { border-bottom: 1px solid #ecf0f1; }
.table tr:hover td { background: #fafbfc; }
.table .actions { white-space: nowrap; }
.table .badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}
.badge-ok { background: #d4edda; color: #155724; }
.badge-bad { background: #f8d7da; color: #721c24; }

.pagination {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}
.pagination a, .pagination span {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 2px;
    background: #fff;
    border: 1px solid #e1e8ed;
    border-radius: 4px;
    color: #2c3e50;
    text-decoration: none;
}
.pagination a:hover { background: #1a5fb4; color: #fff; border-color: #1a5fb4; }
.pagination .current { background: #1a5fb4; color: #fff; border-color: #1a5fb4; }

.form-card {
    max-width: 720px;
    margin: 0 auto;
    background: #fff;
    border-radius: 6px;
    padding: 32px 40px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.form-card h2 { margin-top: 0; font-size: 18px; color: #2c3e50; border-bottom: 1px solid #ecf0f1; padding-bottom: 12px; }
.form-card .form-group { margin-bottom: 18px; }
.form-card label { display: block; margin-bottom: 6px; color: #2c3e50; font-size: 14px; font-weight: 500; }
.form-card label .required { color: #d33; }
.form-card input[type=text], .form-card input[type=number], .form-card select, .form-card textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d0d7e2;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}
.form-card input:focus, .form-card select:focus, .form-card textarea:focus {
    outline: none;
    border-color: #1a5fb4;
    box-shadow: 0 0 0 3px rgba(26,95,180,.1);
}
.form-card .form-actions { margin-top: 24px; display: flex; gap: 10px; }
.form-card .form-tips { font-size: 12px; color: #95a5a6; margin-top: 4px; }

.notice {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}
.notice-error { background: #fee; color: #c33; border-left: 3px solid #d33; }
.notice-ok { background: #e8f5e9; color: #2a7a3f; border-left: 3px solid #1f9d55; }
