/* 
 * 通用可复用组件样式
 * 卡片、按钮、表单、进度条、标签、分页、加载动画、滚动条、工具类
 */

/* 卡片 & 毛玻璃效果 */
.glass-effect {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
}

.card {
    border-radius: var(--radius-xl);
    padding: 16px;
    min-height: calc(100vh - 115px);
}

@media (min-width: 768px) {
    .card {
        padding: 32px;
    }
}

/* 按钮通用 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    outline: none;
}

.btn i {
    font-size: 18px;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: white;
    border-color: var(--border-color);
    color: var(--text-body);
}

.btn-secondary:hover {
    background: var(--secondary);
    border-color: #cbd5e1;
}

.btn-outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--subtitle);
}

.btn-outline:hover {
    background: white;
    color: var(--title);
    border-color: #cbd5e1;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-danger-outline {
    background: transparent;
    border-color: #fca5a5;
    color: var(--danger);
}

.btn-danger-outline:hover {
    background: #fef2f2;
    border-color: var(--danger);
}

/* 表单输入框 */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 14px;
    color: #9ca3af;
    font-size: 20px;
}

.form-control,
.form-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    color: var(--title);
    transition: var(--transition);
}

.form-control:focus,
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background: white;
}

.pl-10 {
    padding-left: 42px !important;
}

/* 表单选择框 */
.form-select {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: white;
    font-size: 14px;
    color: var(--title);
    transition: var(--transition);
    appearance: auto;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transition: width 0.3s ease;
}

/* 标签样式 */
.tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    background: #e0e7ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

/* 标签筛选选项 */
.tag-filter-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    background: white;
    color: var(--text-body);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.tag-filter-item:hover {
    background: #f1f5f9;
    border-color: #93c5fd;
    color: var(--primary);
}

.tag-filter-item.selected {
    background: #eff6ff;
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 500;
}

/* 加载动画 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    color: var(--subtitle);
    grid-column: 1 / -1;
}

.loading i {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 12px;
}

/* 分页控件样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.page-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: white;
    border: 1px solid var(--border-color);
    color: var(--subtitle);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.page-number:hover:not(.disabled) {
    background: #f1f5f9;
    color: var(--title);
    border-color: #cbd5e1;
}

.page-number.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.25);
}

.page-number.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8fafc;
}

/* 自定义滚动条 */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 自定义滚动条(细) */
.scroll-custom::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.scroll-custom::-webkit-scrollbar-track {
    background: transparent;
}

.scroll-custom::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.scroll-custom::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 实用类 (Utilities) */
.hidden {
    display: none;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.flex-col {
    flex-direction: column;
}

.flex-1 {
    flex: 1;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.p-4 {
    padding: 1rem;
}

.w-full {
    width: 100%;
}

.max-w-xl {
    max-width: 36rem;
}

.max-w-3xl {
    max-width: 48rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-lg {
    font-size: 1.125rem;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.font-bold {
    font-weight: 700;
}

.font-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.text-title {
    color: var(--title);
}

.text-subtitle {
    color: var(--subtitle);
}

.text-primary {
    color: var(--primary);
}

.text-danger {
    color: var(--danger);
}

.text-success {
    color: var(--success);
}

.bg-surface {
    background-color: var(--bg-surface);
}