/* 权限管理页面样式 - 手机端优化 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 100%;
    padding: 15px;
    margin: 0 auto;
}

/* 标题样式 */
h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

/* 卡片样式 */
.card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 15px;
    margin-bottom: 15px;
}

.card-header {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
    color: #666;
}

.form-control {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.form-control:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #4caf50;
    color: #fff;
}

.btn-primary:hover {
    background-color: #45a049;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

tr:hover {
    background-color: #f8f9fa;
}

/* 权限切换开关 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4caf50;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4caf50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误提示 */
.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
}

/* 成功提示 */
.success-message {
    color: #28a745;
    font-size: 12px;
    margin-top: 5px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 20px;
    }
    
    .card {
        padding: 12px;
    }
    
    .form-control {
        padding: 10px;
    }
    
    .btn {
        padding: 10px 16px;
    }
    
    th, td {
        padding: 10px;
        font-size: 13px;
    }
}

/* 移动端菜单 */
.mobile-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1000;
}

.mobile-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    color: #666;
    text-decoration: none;
}

.mobile-menu-item.active {
    color: #4caf50;
}

.mobile-menu-icon {
    font-size: 20px;
    margin-bottom: 5px;
}

/* 权限管理页面特定样式 */
.permission-section {
    margin-bottom: 20px;
}

.position-tabs {
    display: flex;
    overflow-x: auto;
    margin-bottom: 15px;
    padding-bottom: 10px;
    white-space: nowrap;
}

.position-tab {
    flex: 0 0 auto;
    padding: 8px 16px;
    margin-right: 10px;
    border-radius: 20px;
    background-color: #f0f0f0;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.position-tab:hover {
    background-color: #e0e0e0;
}

.position-tab.active {
    background-color: #4caf50;
    color: #fff;
}

.position-tab.group-tab {
    background-color: #e3f2fd;
    font-weight: bold;
}

.position-tab.group-tab.active {
    background-color: #1976d2;
    color: white;
}

.position-tab-divider {
    flex: 0 0 auto;
    padding: 8px 16px;
    margin-right: 10px;
    color: #6c757d;
    font-style: italic;
    cursor: default;
    border-radius: 20px;
    background-color: #f1f3f4;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.permission-list {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.permission-item {
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
    flex: 1 1 calc(50% - 5px);
    min-width: 120px;
}

.permission-item:last-child {
    margin-bottom: 0;
}

.permission-item-label {
    font-size: 14px;
    color: #333;
}

/* 店铺分类管理 */
.category-list {
    margin-top: 10px;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 10px;
}

.category-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* 操作日志 */
.log-item {
    padding: 12px;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 13px;
}

.log-time {
    color: #999;
    font-size: 12px;
    margin-bottom: 5px;
}

.log-content {
    color: #333;
}

/* 通知提示框 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background-color: #4caf50;
}

.notification-error {
    background-color: #f44336;
}

.notification-info {
    background-color: #2196f3;
}

.notification-warning {
    background-color: #ff9800;
}