/* 管理后台样式 */
.admin-body {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

.admin-sidebar {
    width: 240px;
    background: var(--primary);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

.sidebar-header {
    padding: 20px;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

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

.nav-item {
    display: block;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255,255,255,0.1);
    color: var(--white);
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 12px 20px;
}

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

.admin-main {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
}

.admin-header {
    background: var(--white);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-title { font-size: 1.25rem; font-weight: 600; }
.header-user { color: var(--text-light); }

.admin-content { padding: 24px; flex: 1; }

/* 统计卡片 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .stat-label {
    color: var(--text-light);
    margin-top: 4px;
}

/* 操作栏 */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.action-bar > div {
    display: flex;
    gap: 6px;
    align-items: center;
}

.filter-form {
    display: flex;
    gap: 6px;
    align-items: center;
}

.filter-form .form-control {
    padding: 6px 10px;
    font-size: 13px;
    min-width: 0;
    width: auto;
}

.filter-form select.form-control {
    max-width: 140px;
}

.filter-form input[type="text"].form-control {
    width: 150px;
}

.action-bar .btn {
    padding: 6px 12px;
    font-size: 13px;
    white-space: nowrap;
}

/* 可搜索下拉选择器 */
.searchable-select {
    position: relative;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
    margin-top: 4px;
}

.search-dropdown.hidden {
    display: none;
}

.search-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background: #f5f5f5;
}

.search-item.disabled {
    color: #999;
    cursor: default;
    text-align: center;
}

.search-item.disabled:hover {
    background: white;
}

.search-item-name {
    font-weight: 500;
    color: #333;
}

.search-item-info {
    font-size: 12px;
    color: #888;
}

/* 已选择标签 */
.selected-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 4px;
    font-size: 13px;
}

.remove-tag {
    cursor: pointer;
    font-weight: bold;
    color: #1976d2;
    margin-left: 2px;
}

.remove-tag:hover {
    color: #c62828;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden { display: none; }

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 { margin: 0; }

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body { padding: 24px; }

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 响应式 */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 60px;
    }
    .sidebar-header span:not(.logo-icon),
    .nav-item span { display: none; }
    .admin-main { margin-left: 60px; }
}


/* 自定义标签 */
.custom-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #e8f4fd;
    color: #1976d2;
    border-radius: 4px;
    font-size: 13px;
}

.custom-tag .remove-tag {
    cursor: pointer;
    font-weight: bold;
    color: #1976d2;
}

.custom-tag .remove-tag:hover {
    color: #c62828;
}
