/* 基础样式 */
:root {
    --primary-color: var(--p, #0ea5e9);
    --secondary-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --dark-color: var(--t, #1e293b);
    --sidebar-width: 250px;
    --header-height: 60px;
    --transition-speed: 0.3s;
    --card-bg: var(--card, #fff);
    --bg-body: var(--bg, #f5f7fa);
    --text-sec: var(--t2, #64748b);
}
body[data-theme="dark"] { --dark-color: #0d0d1a; --card-bg: rgba(20,20,35,.92); --bg-body: #111; }
body[data-theme="pink"] { --dark-color: #831843; --card-bg: rgba(255,255,255,.82); --bg-body: #fdf2f8; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-body, #f5f7fa);
    color: var(--t, #1e293b);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

button, input, select, textarea {
    outline: none;
    border: none;
}

/* 卡片样式 */
.card {
    background: var(--card-bg, #fff);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
    transition: all var(--transition-speed) ease;
}

.card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: var(--text-sec, #7f8c8d);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #e67e22;
}

/* 图标颜色 */
.bg-blue {
    background-color: #3498db;
    color: white;
}

.bg-green {
    background-color: #2ecc71;
    color: white;
}

.bg-orange {
    background-color: #f39c12;
    color: white;
}

.bg-red {
    background-color: #e74c3c;
    color: white;
}

/* 管理容器布局 */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--dark-color);
    color: white;
    height: 100vh;
    position: fixed;
    transition: all var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-bottom: 10px;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar-nav ul li {
    margin-bottom: 5px;
}

.sidebar-nav ul li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    transition: all var(--transition-speed) ease;
    color: rgba(255, 255, 255, 0.8);
}

.sidebar-nav ul li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.sidebar-nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-nav ul li.active a {
    background-color: var(--primary-color);
    color: white;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.username {
    font-weight: 600;
    font-size: 14px;
}

.role {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

#logout-btn {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.7);
    transition: all var(--transition-speed) ease;
}

#logout-btn:hover {
    color: white;
}

#logout-btn i {
    margin-right: 10px;
}

/* 主内容区样式 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-header {
    height: var(--header-height);
    background-color: var(--card-bg, #fff);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left h1 {
    font-size: 20px;
    font-weight: 600;
}

.breadcrumb {
    font-size: 12px;
    color: var(--text-sec, #7f8c8d);
    display: flex;
    align-items: center;
    margin-top: 5px;
}

.breadcrumb a {
    color: var(--text-sec, #7f8c8d);
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb a.active {
    color: var(--dark-color);
    font-weight: 500;
}

.breadcrumb span {
    margin: 0 5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.notifications {
    position: relative;
    cursor: pointer;
}

.notifications .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 8px 15px 8px 35px;
    border-radius: 20px;
    background-color: #f1f3f4;
    font-size: 14px;
    width: 200px;
    transition: all var(--transition-speed) ease;
}

.search-box input:focus {
    background-color: var(--card-bg, #fff);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
    width: 250px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
}

.content-body {
    flex: 1;
    padding: 20px;
    background-color: var(--bg-body, #f5f7fa);
}

.content-footer {
    padding: 15px 20px;
    background-color: var(--card-bg, #fff);
    border-top: 1px solid var(--b, #eee);
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-sec, #7f8c8d);
}

/* 仪表板样式 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stats-cards .card {
    display: flex;
    align-items: center;
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 15px;
}

.card-info h3 {
    font-size: 14px;
    color: var(--text-sec, #7f8c8d);
    margin-bottom: 5px;
}

.card-info span {
    font-size: 24px;
    font-weight: 600;
}

.recent-activities {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.activity-card, .quick-actions {
    background-color: var(--card-bg, #fff);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.activity-card h3, .quick-actions h3 {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--b, #eee);
}

#recent-activities-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f1f3f4;
    display: flex;
    align-items: center;
}

#recent-activities-list li:last-child {
    border-bottom: none;
}

#recent-activities-list li i {
    margin-right: 10px;
    color: var(--primary-color);
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.action-btn {
    display: flex;
    align-items: center;
    padding: 12px;
    background-color: var(--card-bg, #fff);
    border: 1px solid #eee;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    text-align: left;
}

.action-btn:hover {
    background-color: var(--bg-body, #f8f9fa);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.action-btn i {
    font-size: 18px;
    margin-right: 10px;
}

/* 表格样式 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 20px;
}

.search-filter {
    display: flex;
    gap: 10px;
}

.search-filter input {
    padding: 8px 15px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.search-filter select {
    padding: 8px 15px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 14px;
    background-color: var(--card-bg, #fff);
}

.table-responsive {
    overflow-x: auto;
    background-color: var(--card-bg, #fff);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--b, #eee);
}

th {
    background-color: var(--bg-body, #f8f9fa);
    font-weight: 600;
    color: var(--t, #1e293b);
}

tr:hover {
    background-color: var(--bg-body, #f8f9fa);
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.action-btns {
    display: flex;
    gap: 5px;
}

.action-btns .btn {
    padding: 5px 10px;
    font-size: 12px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination button {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background-color: var(--card-bg, #fff);
    border: 1px solid #ddd;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination button:hover:not(:disabled) {
    background-color: var(--bg-body, #f8f9fa);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 标签页样式 */
.settings-tabs {
    background-color: var(--card-bg, #fff);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.tabs-header {
    display: flex;
    border-bottom: 1px solid var(--b, #eee);
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-sec, #7f8c8d);
    position: relative;
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.tabs-content {
    padding: 20px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--card-bg, #fff);
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--b, #eee);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-sec, #7f8c8d);
    transition: all var(--transition-speed) ease;
}

.close-modal:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--b, #eee);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .sidebar {
        width: 70px;
        overflow: hidden;
    }
    
    .sidebar-header h2,
    .sidebar-nav ul li span,
    .user-info,
    #logout-btn span {
        display: none;
    }
    
    .sidebar-nav ul li a {
        justify-content: center;
    }
    
    .sidebar-nav ul li a i {
        margin-right: 0;
        font-size: 20px;
    }
    
    .main-content {
        margin-left: 70px;
    }
    
    .recent-activities {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-container{flex-direction:column}
    .sidebar{width:100%;height:auto;position:relative;flex-direction:row;flex-wrap:wrap;padding:6px}
    .sidebar-header{padding:6px;border:none;display:flex;align-items:center;gap:8px}.sidebar-header img{width:26px;height:26px}.sidebar-header h2{font-size:13px;display:inline}
    .sidebar-nav{flex:none;padding:0;width:100%;overflow-x:auto}.sidebar-nav ul{display:flex;gap:2px;white-space:nowrap}.sidebar-nav ul li{margin:0;flex-shrink:0}.sidebar-nav ul li a{padding:6px 10px;font-size:12px}.sidebar-nav ul li a i{margin-right:4px;font-size:12px}.sidebar-nav ul li a span{font-size:12px}
    .sidebar-footer{display:none}
    .main-content{margin-left:0}
    .content-header{flex-direction:column;align-items:flex-start;height:auto;padding:10px;gap:6px}.content-header h1{font-size:18px}
    .content-body{padding:10px}
    .stats-cards{grid-template-columns:1fr 1fr;gap:10px}
    .card{padding:14px}.card-icon{width:40px;height:40px;font-size:16px}.card-info h3{font-size:12px}.card-info span{font-size:20px}
    .recent-activities{grid-template-columns:1fr;gap:10px}
    .section-header{flex-direction:column;align-items:flex-start;gap:8px}.section-header h2{font-size:16px}
    .section-actions{width:100%}.search-filter{width:100%;flex-direction:column;gap:6px}.search-filter input,.search-filter select{width:100%}
    .table-responsive{font-size:11px;overflow-x:auto;-webkit-overflow-scrolling:touch}th,td{padding:6px 8px;white-space:nowrap}
    .action-btns{gap:2px}.action-btns .btn{padding:4px 6px;font-size:10px}
    .content-footer{flex-direction:column;text-align:center;gap:2px;font-size:11px}
    .modal-content{max-width:95vw;margin:10px}.modal-header h3{font-size:16px}
    .form-group input,.form-group select,.form-group textarea{padding:8px 10px;font-size:13px}
}

@media (max-width: 480px) {
    .stats-cards{grid-template-columns:1fr}
    .content-header h1{font-size:16px}
    .sidebar-nav ul li a{padding:5px 7px;font-size:10px}.sidebar-nav ul li a i{font-size:10px;margin-right:2px}.sidebar-nav ul li a span{font-size:10px}
    .sidebar-header h2{font-size:11px}
    .pagination button{width:28px;height:28px;font-size:12px}
    .btn{padding:6px 12px;font-size:12px}
}

/* 隐藏/显示部分 */
.hidden-section {
    display: none;
}

.active-section {
    display: block;
}