/**
 * 下雪电竞 - 组件样式
 */

/* ==================== 模态框 ==================== */

.modal-container {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-container.show {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-container.show .modal {
    transform: scale(1);
}

.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1000px; }
.modal-sm { max-width: 400px; }

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.modal-body {
    padding: var(--space-lg);
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-light);
    background: var(--bg-tertiary);
}

/* ==================== Toast 消息 ==================== */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    min-width: 300px;
    max-width: 450px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transform: translateX(120%);
    transition: var(--transition);
    border-left: 4px solid var(--primary);
}

.toast.show {
    transform: translateX(0);
}

.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--info); }

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--success); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--info); }

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
}

.toast-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.toast-close:hover {
    background: var(--bg-hover);
    color: var(--danger);
}

/* ==================== 下拉菜单 ==================== */

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    padding: 8px 0;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 100;
}

.dropdown.show .dropdown-menu,
.dropdown-toggle:focus + .dropdown-menu,
.dropdown-menu:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-primary);
    transition: var(--transition-fast);
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--text-tertiary);
}

.dropdown-item:hover i {
    color: var(--primary);
}

.dropdown-divider {
    height: 1px;
    margin: 8px 0;
    background: var(--border-light);
}

/* ==================== 工具提示 ==================== */

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 500;
    color: white;
    background: var(--text-primary);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    z-index: 100;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ==================== 进度条 ==================== */

.progress {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
}

.progress-bar.success { background: var(--gradient-success); }
.progress-bar.warning { background: var(--gradient-warning); }
.progress-bar.danger { background: var(--gradient-danger); }

.progress-lg { height: 12px; }
.progress-sm { height: 4px; }

/* 环形进度 */
.progress-ring {
    position: relative;
    width: 120px;
    height: 120px;
}

.progress-ring-circle {
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.progress-ring-bg {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 8;
}

.progress-ring-value {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease;
}

.progress-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.progress-ring-percent {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.progress-ring-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ==================== 时间线 ==================== */

.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -24px;
    top: 4px;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border: 2px solid var(--bg-card);
    border-radius: 50%;
    z-index: 1;
}

.timeline-dot.success { background: var(--success); }
.timeline-dot.warning { background: var(--warning); }
.timeline-dot.danger { background: var(--danger); }

.timeline-content {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
}

.timeline-time {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.timeline-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.timeline-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ==================== 步骤条 ==================== */

.steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
}

.step {
    flex: 1;
    position: relative;
    text-align: center;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.step.active:not(:last-child)::after,
.step.completed:not(:last-child)::after {
    background: var(--primary);
}

.step-number {
    position: relative;
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    z-index: 1;
}

.step.active .step-number {
    color: white;
    background: var(--primary);
    border-color: var(--primary);
}

.step.completed .step-number {
    color: white;
    background: var(--success);
    border-color: var(--success);
}

.step-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.step.active .step-title {
    color: var(--primary);
}

.step.completed .step-title {
    color: var(--success);
}

/* ==================== 文件上传 ==================== */

.file-upload {
    position: relative;
}

.file-upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: var(--space-xl);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    transition: var(--transition);
    cursor: pointer;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.file-upload-icon {
    font-size: 48px;
    color: var(--text-tertiary);
    margin-bottom: var(--space-md);
}

.file-upload-text {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.file-upload-hint {
    font-size: 13px;
    color: var(--text-tertiary);
}

.file-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    margin-top: var(--space-sm);
}

.file-preview-image {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.file-preview-info {
    flex: 1;
}

.file-preview-name {
    font-weight: 500;
    color: var(--text-primary);
}

.file-preview-size {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ==================== 搜索框 ==================== */

.search-box {
    position: relative;
}

.search-box .form-control {
    padding-left: 44px;
    padding-right: 44px;
}

.search-box-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.search-box-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
}

.search-box-clear:hover {
    background: var(--bg-hover);
    color: var(--danger);
}

.search-box .form-control:not(:placeholder-shown) ~ .search-box-clear {
    opacity: 1;
    visibility: visible;
}

/* ==================== 筛选栏 ==================== */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-card);
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-item .form-control {
    min-width: 150px;
    padding: 8px 12px;
}

.filter-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

/* ==================== 评分 ==================== */

.rating {
    display: inline-flex;
    gap: 4px;
}

.rating-star {
    font-size: 18px;
    color: var(--border-color);
    cursor: pointer;
    transition: var(--transition-fast);
}

.rating-star.active,
.rating-star:hover {
    color: #ffc107;
}

.rating-star.half::before {
    content: '\f5c0';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #ffc107;
}

.rating-readonly .rating-star {
    cursor: default;
}

/* ==================== 日历 ==================== */

.calendar {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: var(--gradient-primary);
    color: white;
}

.calendar-title {
    font-size: 18px;
    font-weight: 600;
}

.calendar-nav {
    display: flex;
    gap: 8px;
}

.calendar-nav-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition-fast);
}

.calendar-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: var(--space-sm);
    background: var(--bg-tertiary);
}

.calendar-weekday {
    padding: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    text-transform: uppercase;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: var(--space-sm);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-primary);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition-fast);
}

.calendar-day:hover {
    background: var(--bg-hover);
}

.calendar-day.today {
    font-weight: 600;
    color: var(--primary);
    background: var(--bg-hover);
}

.calendar-day.selected {
    color: white;
    background: var(--gradient-primary);
}

.calendar-day.other-month {
    color: var(--text-tertiary);
}

.calendar-day.has-event::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
}

/* ==================== 标签输入 ==================== */

.tag-input {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: text;
    transition: var(--transition);
}

.tag-input:focus-within {
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.tag-input-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 13px;
    background: var(--bg-hover);
    border-radius: var(--radius-full);
}

.tag-input-remove {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.tag-input-remove:hover {
    background: var(--danger);
    color: white;
}

.tag-input-field {
    flex: 1;
    min-width: 120px;
    padding: 4px 0;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: var(--text-primary);
}

/* ==================== 音频播放器 ==================== */

.audio-player {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
}

.audio-play-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.audio-play-btn:hover {
    transform: scale(1.05);
}

.audio-info {
    flex: 1;
    min-width: 0;
}

.audio-title {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.audio-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    overflow: hidden;
}

.audio-progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.1s linear;
}

.audio-time {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* ==================== 确认弹窗 ==================== */

.confirm-dialog {
    text-align: center;
    padding: var(--space-lg);
}

.confirm-icon {
    font-size: 64px;
    margin-bottom: var(--space-lg);
}

.confirm-icon.warning { color: var(--warning); }
.confirm-icon.danger { color: var(--danger); }
.confirm-icon.success { color: var(--success); }
.confirm-icon.info { color: var(--info); }

.confirm-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.confirm-message {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
}

/* ==================== 数据列表 ==================== */

.data-list {
    display: flex;
    flex-direction: column;
}

.data-list-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition-fast);
}

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

.data-list-item:hover {
    background: var(--bg-hover);
}

.data-list-avatar {
    flex-shrink: 0;
}

.data-list-content {
    flex: 1;
    min-width: 0;
}

.data-list-title {
    font-weight: 500;
    color: var(--text-primary);
}

.data-list-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.data-list-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: right;
}

/* ==================== 响应式 ==================== */

@media (max-width: 768px) {
    .toast-container {
        left: 20px;
        right: 20px;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
    
    .modal {
        margin: var(--space-md);
        max-height: calc(100vh - 40px);
    }
    
    .filter-bar {
        flex-direction: column;
    }
    
    .filter-item {
        width: 100%;
    }
    
    .filter-item .form-control {
        flex: 1;
    }
    
    .filter-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }
    
    .steps {
        flex-direction: column;
        gap: 20px;
    }
    
    .step:not(:last-child)::after {
        display: none;
    }
}
