/* ===== 管理后台样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    padding: 20px;
    line-height: 1.6;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 32px 40px;
}
@media (max-width: 640px) { .container { padding: 16px; } }
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e8edf3;
    margin-bottom: 24px;
}
.header h1 { font-size: 24px; color: #1a2332; }
.header .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.btn-primary { background: #4a90d9; color: #fff; }
.btn-primary:hover { background: #3a7bc8; }
.btn-success { background: #27ae60; color: #fff; }
.btn-success:hover { background: #219a52; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #d63a2a; }
.btn-secondary { background: #e8edf3; color: #4a5a72; }
.btn-secondary:hover { background: #d5dde6; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.alert {
    padding: 12px 18px;
    border-radius: 6px;
    margin-bottom: 16px;
}
.alert-success { background: #eafaf1; color: #1a7a42; border: 1px solid #b8e6c8; }
.alert-error { background: #fdedec; color: #a93226; border: 1px solid #f5c8c5; }
.table-wrapper { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
table th {
    background: #f7f9fc;
    text-align: left;
    padding: 12px 14px;
    font-weight: 600;
    color: #2d3748;
    border-bottom: 2px solid #e8edf3;
    white-space: nowrap;
}
table td {
    padding: 12px 14px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}
table tr:hover td { background: #fafbfc; }
.text-muted { color: #8895aa; }
.tag {
    display: inline-block;
    padding: 1px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.tag-yes { background: #eafaf1; color: #1a7a42; }
.tag-no { background: #fdedec; color: #a93226; }
.file-count {
    font-size: 12px;
    color: #4a90d9;
    background: #eaf2fa;
    padding: 1px 10px;
    border-radius: 12px;
}
.login-box {
    max-width: 400px;
    margin: 60px auto;
    padding: 32px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.login-box h2 { text-align: center; margin-bottom: 20px; color: #1a2332; }
.login-box .form-group { margin-bottom: 16px; }
.login-box .form-group label { display: block; font-weight: 500; margin-bottom: 4px; }
.login-box .form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #dce1e8;
    border-radius: 6px;
    font-size: 14px;
}
.login-box .form-control:focus { outline: none; border-color: #4a90d9; }
.login-box .btn { width: 100%; justify-content: center; padding: 12px; }
.empty-state { text-align: center; padding: 40px 20px; color: #8895aa; }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { color: #4a5a72; margin-bottom: 4px; }
.badge-info {
    background: #eaf2fa;
    color: #2c6b9e;
    padding: 1px 10px;
    border-radius: 12px;
    font-size: 12px;
}
.filter-form {
    background: #f7f9fc;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.filter-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.filter-form .form-group label {
    font-size: 12px;
    color: #4a5a72;
    font-weight: 500;
}
.filter-form .form-control {
    padding: 6px 10px;
    border: 1.5px solid #dce1e8;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}
.filter-form .btn {
    padding: 6px 16px;
    font-size: 13px;
}
.checkbox-col { width: 30px; text-align: center; }
.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin: 16px 0;
    padding: 12px 16px;
    background: #f7f9fc;
    border-radius: 8px;
}
.action-bar .btn { padding: 6px 16px; font-size: 13px; }
.delete-form { display: inline; }

/* ============================================================
   手机端适配（≤640px）
   ============================================================ */
@media (max-width: 640px) {
    body {
        padding: 8px;
        font-size: 14px;
    }
    .container {
        padding: 14px 12px;
        border-radius: 8px;
    }
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-bottom: 14px;
        margin-bottom: 16px;
    }
    .header h1 {
        font-size: 18px;
    }
    .header .actions {
        width: 100%;
    }
    .header .actions .btn {
        flex: 1;
        justify-content: center;
        padding: 8px 12px;
        font-size: 13px;
    }
    /* Tab 切换 */
    .admin-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .admin-tab {
        padding: 8px 14px;
        font-size: 14px;
        white-space: nowrap;
    }
    /* 筛选表单 */
    .filter-form {
        padding: 12px 14px;
        gap: 10px;
    }
    .filter-form .form-group {
        flex: 1 1 100%;
    }
    .filter-form .form-control {
        width: 100%;
        padding: 8px 10px;
        font-size: 14px;
    }
    .filter-form .btn {
        flex: 1;
        justify-content: center;
        padding: 8px;
    }
    /* 操作栏 */
    .action-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 14px;
    }
    .action-bar form {
        width: 100%;
    }
    .action-bar .btn {
        width: 100%;
        justify-content: center;
        padding: 8px;
    }
    /* 表格：保持横向滚动，字体缩小 */
    .table-wrapper {
        -webkit-overflow-scrolling: touch;
        margin: 0 -12px;
        padding: 0 12px;
    }
    table {
        font-size: 13px;
        min-width: 600px;
    }
    table th,
    table td {
        padding: 8px 10px;
    }
    .btn-sm {
        padding: 4px 8px;
        font-size: 11px;
    }
    /* 用户管理 */
    .user-actions-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .user-actions-bar .btn {
        width: 100%;
        justify-content: center;
    }
    /* 模态框 */
    .modal-box {
        width: 95%;
        padding: 18px;
        max-height: 90vh;
        overflow-y: auto;
    }
    .modal-box h3 {
        font-size: 16px;
    }
    .modal-actions {
        flex-direction: column;
    }
    .modal-actions .btn {
        width: 100%;
        justify-content: center;
    }
    /* 登录框 */
    .login-box {
        margin: 30px auto;
        padding: 24px 20px;
    }
    .login-box h2 {
        font-size: 18px;
    }
    .alert {
        padding: 10px 14px;
        font-size: 13px;
    }
    .empty-state {
        padding: 30px 16px;
    }
    .empty-state .icon {
        font-size: 36px;
    }
}

/* 超小屏幕（≤380px） */
@media (max-width: 380px) {
    .header h1 {
        font-size: 16px;
    }
    table {
        font-size: 12px;
        min-width: 560px;
    }
    table th,
    table td {
        padding: 6px 8px;
    }
}