/**
 * 组件样式
 * LAN Transfer - Component Styles
 */

/* ========== 按钮 ========== */
.btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    font-family: var(--font-sans);
}

.btn:hover:not(:disabled) {
    background: var(--border-color);
    border-color: var(--text-muted);
}

.btn:active:not(:disabled) {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-tertiary);
}

/* ========== 操作按钮组 ========== */
.action-btns {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.action-btns .btn {
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #000;
    font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
    background: #79b8ff;
    border-color: #79b8ff;
}

.btn-success {
    background: var(--accent-success);
    border-color: var(--accent-success);
    color: #000;
    font-weight: 600;
}

.btn-success:hover:not(:disabled) {
    background: #56d364;
    border-color: #56d364;
}

.btn-danger {
    background: var(--accent-danger);
    border-color: var(--accent-danger);
    color: #fff;
    font-weight: 600;
}

.btn-danger:hover:not(:disabled) {
    background: #ff6b6b;
    border-color: #ff6b6b;
}

.btn-purple {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: #fff;
    font-weight: 600;
}

.btn-purple:hover:not(:disabled) {
    background: #bc8cff;
    border-color: #bc8cff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    min-height: 32px;
}

/* ========== 输入框 ========== */
input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 40px;
    width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

/* ========== 表格 ========== */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    max-width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 850px;
}

thead {
    background: var(--bg-tertiary);
    position: sticky;
    top: 0;
    z-index: 10;
}

th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

tr {
    transition: background-color 0.1s;
}

tr:hover td {
    background: rgba(88, 166, 255, 0.06);
}

/* 批量管理模式下选中行的hover效果不覆盖选中背景 */
.batch-mode tr.batch-selected:hover td,
.batch-mode tr.batch-partial:hover td,
tr.batch-selected:hover td,
tr.batch-partial:hover td {
    background: transparent !important;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ========== 面板 ========== */
.panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    max-width: 100%; /* 确保面板不超出容器 */
}

.panel-header {
    background: var(--bg-tertiary);
    padding: 14px 24px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-body {
    padding: 24px;
    font-size: 14px;
    line-height: 1.6;
}

/* ========== 标签页 ========== */
.tabs {
    display: flex;
    gap: 0;
    padding: 0 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

/* Tab 内容区域 - 统一高度，避免闪烁和布局跳动 */
.tab-content {
    display: none;
    visibility: hidden;
    position: absolute;
    width: 100%;
    left: 0;
    top: 0;
    opacity: 0;
    transition: opacity 0.1s ease-out;
    /* 统一最小高度 */
    min-height: 500px;
}

.tab-content.active {
    display: block;
    visibility: visible;
    position: relative;
    opacity: 1;
}

/* 文件列表容器 - 固定高度，避免切换标签时页面跳动 */
.file-list-container,
.table-wrapper {
    height: 400px;
    min-height: 400px;
    max-height: 400px;
    position: relative;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
}

/* 空状态容器 - 固定高度居中显示 */
.empty-state,
.empty-private-files {
    height: 350px;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* 简化动画，仅用于初始加载 */
@keyframes tabFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========== 文件管理头部 ========== */
.manage-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.manage-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.manage-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.manage-header-label {
    font-weight: 600;
    color: var(--text-primary);
}

.manage-header-desc {
    color: var(--text-muted);
}

.manage-header-status {
    color: var(--accent-primary);
    font-weight: 500;
}

.manage-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.manage-header-status {
    font-size: 12px;
    color: var(--accent-primary);
    font-weight: 500;
    margin-left: auto;
}

.manage-header-actions .btn-sm {
    padding: 5px 12px;
    font-size: 12px;
    min-height: 28px;
}

.manage-header-actions select.btn-sm {
    padding: 5px 10px;
    min-width: 90px;
}

/* ========== 自定义筛选下拉组件 ========== */
.custom-dropdown {
    position: relative;
    display: inline-block;
}

.custom-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 32px;
    min-width: 90px;
    font-family: var(--font-sans);
    user-select: none;
}

.custom-dropdown-trigger:hover {
    border-color: var(--text-muted);
    background: var(--bg-tertiary);
}

.custom-dropdown-trigger:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.custom-dropdown-trigger .dropdown-arrow {
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
    color: var(--text-muted);
    flex-shrink: 0;
}

.custom-dropdown.open .custom-dropdown-trigger .dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 100;
    overflow: hidden;
    
    /* 动画相关 */
    opacity: 0;
    transform: translateY(-8px);
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.custom-dropdown.open .custom-dropdown-menu {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.custom-dropdown-menu .dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 14px;
    font-size: 12px;
    color: var(--text-primary);
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
    font-family: var(--font-sans);
    white-space: nowrap;
}

.custom-dropdown-menu .dropdown-item:hover {
    background: var(--bg-tertiary);
}

.custom-dropdown-menu .dropdown-item.active {
    background: rgba(88, 166, 255, 0.15);
    color: var(--accent-primary);
    font-weight: 500;
}

.custom-dropdown-menu .dropdown-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

/* ========== 弹窗 ========== */
.upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    padding: 20px;
}

.upload-modal.active {
    display: flex;
}

.upload-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.2s ease;
}

.upload-modal-header {
    background: var(--bg-tertiary);
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.upload-modal-body {
    padding: 24px;
}

.upload-modal-footer {
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
}

.upload-modal-footer.center {
    justify-content: center;
}

/* ========== 选项卡片 ========== */
.option-card {
    padding: 18px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    margin-bottom: 12px;
    transition: all 0.15s ease;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.option-card:hover {
    border-color: var(--accent-primary);
    background: rgba(88,166,255,0.05);
    transform: translateX(4px);
}

.option-card.selected {
    border-color: var(--accent-primary);
    background: rgba(88,166,255,0.1);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.option-card h4 {
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-card p {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

/* ========== 进度条 ========== */
.progress-container {
    margin-top: 16px;
    padding: 16px 20px;
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.progress-bar-bg {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), #79b8ff);
    border-radius: 3px;
    transition: width 0.15s ease;
    box-shadow: 0 0 8px rgba(88, 166, 255, 0.3);
}

.progress-bar-fill.complete {
    background: linear-gradient(90deg, var(--accent-success), #56d364);
    box-shadow: 0 0 8px rgba(63, 185, 80, 0.3);
}

/* ========== 状态消息 ========== */
.status-msg {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    font-family: var(--font-mono);
    display: none;
}

.status-msg.success {
    display: block;
    background: rgba(63,185,80,0.1);
    border: 1px solid rgba(63,185,80,0.3);
    color: var(--accent-success);
}

.status-msg.error {
    display: block;
    background: rgba(248,81,73,0.1);
    border: 1px solid rgba(248,81,73,0.3);
    color: var(--accent-danger);
}

.status-msg.warning {
    display: block;
    background: rgba(210,153,34,0.1);
    border: 1px solid rgba(210,153,34,0.3);
    color: var(--accent-warning);
}

/* ========== 成功/代码框 ========== */
.success-box {
    margin-top: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(63,185,80,0.12), rgba(63,185,80,0.05));
    border: 1px solid rgba(63,185,80,0.4);
    border-radius: var(--border-radius-sm);
    color: var(--accent-success);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.code-box {
    margin-top: 12px;
    padding: 14px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.code-box label {
    min-width: auto;
    color: var(--text-secondary);
}

.code-box .code {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-purple);
    letter-spacing: 4px;
    flex: 1;
}

/* ========== 徽章 ========== */
.private-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 10px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-purple), #8957e5);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.public-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 10px;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.direct-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 10px;
    font-weight: 600;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* 加密文件徽章 */
.encrypted-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: var(--border-radius-sm);
    font-size: 10px;
    font-weight: 600;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* 未读圆点指示器 */
.unread-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-primary);
    margin-left: 6px;
    vertical-align: middle;
    box-shadow: 0 0 4px rgba(88, 166, 255, 0.5);
}

.admin-badge {
    background: linear-gradient(135deg, var(--accent-danger), var(--accent-purple));
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse 2s infinite;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
}

/* ========== 文件信息展示 ========== */
/* 桌面端文件名样式 */
@media (min-width: 769px) {
    .filename {
        word-break: break-all;
        font-weight: 400;
        font-size: 13px;
        color: var(--text-secondary);
        line-height: 1.5;
    }

    .filename > span {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }
}

/* 文件名包装器 - 确保图标、文件名、标签在一行 */
.file-name-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: nowrap;
    width: 100%;
    text-align: left;
}

.file-name-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    white-space: nowrap;
}

.filesize {
    color: var(--accent-primary);
    font-weight: 600;
}

.device-name {
    color: var(--text-secondary);
}

.code-display {
    font-family: var(--font-mono);
    color: var(--accent-purple);
    font-weight: 600;
    letter-spacing: 3px;
    font-size: 13px;
}

/* ========== 表单行 ========== */
.form-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-row label {
    font-size: 13px;
    color: var(--text-secondary);
    min-width: 100px;
    font-weight: 500;
    flex-shrink: 0;
}

.form-row input,
.form-row select {
    flex: 1;
}

/* ========== 开关 ========== */
.switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
    vertical-align: middle;
    cursor: pointer;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.switch .slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: background-color 0.3s ease;
    border-radius: 13px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 2px;
    box-sizing: border-box;
}

.switch .slider::before {
    content: "";
    height: 20px;
    width: 20px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    margin-left: 0;
    transition: margin-left 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    flex-shrink: 0;
}

.switch input:checked + .slider {
    background-color: var(--accent-success);
    border-color: var(--accent-success);
}

.switch input:checked + .slider::before {
    margin-left: auto;
}

.switch-status {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 40px;
}

/* ========== 拖拽上传区域 ========== */
#dropZone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    padding: 48px 32px;
    text-align: center;
    transition: all 0.2s ease;
    position: relative;
    margin-top: 16px;
}

#dropZone:hover {
    border-color: var(--accent-primary);
    background: rgba(88, 166, 255, 0.03);
}

#dropZone.drag-over {
    border-color: var(--accent-primary);
    border-style: solid;
    border-width: 3px;
    background: rgba(88, 166, 255, 0.08);
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.2);
}

#dropIcon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

#dropZone:hover #dropIcon {
    opacity: 0.8;
}

#dropText1 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 500;
}

#dropText2 {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

#dropHint {
    font-size: 14px;
    color: var(--accent-primary);
    font-weight: 600;
    opacity: 0;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease;
    pointer-events: none;
    background: rgba(13, 17, 23, 0.9);
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
}

#dropZone.drag-over #dropHint {
    opacity: 1;
}

#dropZone.drag-over #dropIcon,
#dropZone.drag-over #dropText1,
#dropZone.drag-over #dropText2 {
    opacity: 0.3;
}

.upload-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}

.upload-actions .btn {
    min-width: 100px;
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* 选择文件按钮 - 柔和蓝色轮廓 */
.upload-actions #selectFileBtn {
    background: transparent;
    border: 1.5px solid var(--accent-primary);
    color: var(--accent-primary);
}

.upload-actions #selectFileBtn:hover:not(:disabled) {
    background: rgba(88, 166, 255, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.2);
}

/* 选择文件夹按钮 - 柔和紫色轮廓 */
.upload-actions #selectFolderBtn {
    background: transparent;
    border: 1.5px solid var(--accent-purple);
    color: var(--accent-purple);
}

.upload-actions #selectFolderBtn:hover:not(:disabled) {
    background: rgba(163, 113, 247, 0.1);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(163, 113, 247, 0.2);
}

/* 开始上传按钮 - 实心渐变强调色 */
.upload-actions #uploadBtn {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-purple) 100%);
    border: none;
    color: #fff;
    font-weight: 600;
}

.upload-actions #uploadBtn:hover:not(:disabled) {
    background: linear-gradient(135deg, #79b8ff 0%, #bc8cff 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(88, 166, 255, 0.35);
}

/* ========== 支持的文件类型（简化版） ========== */
.file-types-section {
    margin-top: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--bg-primary);
}

.file-types-header {
    padding: 10px 16px;
    background: var(--bg-tertiary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
    font-size: 12px;
}

.file-types-header:hover {
    background: var(--border-color);
}

.file-types-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

.file-types-icon {
    font-size: 14px;
}

.file-types-toggle {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.file-types-section.expanded .file-types-toggle {
    transform: rotate(180deg);
}

.file-types-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 16px;
    transition: max-height 0.3s ease-out, opacity 0.25s ease-out, padding 0.3s ease;
}

.file-types-content.show {
    max-height: 500px;
    opacity: 1;
    padding: 16px;
}

.file-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.file-type-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 8px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: default;
}

.file-type-item:hover {
    border-color: var(--border-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.file-type-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 20px;
    margin-bottom: 8px;
}

.file-type-icon.doc {
    background: rgba(88, 166, 255, 0.15);
}

.file-type-icon.img {
    background: rgba(163, 113, 247, 0.15);
}

.file-type-icon.video {
    background: rgba(210, 153, 34, 0.15);
}

.file-type-icon.audio {
    background: rgba(63, 185, 80, 0.15);
}

.file-type-icon.zip {
    background: rgba(139, 148, 158, 0.2);
}

.file-type-icon.code {
    background: rgba(248, 81, 73, 0.15);
}

.file-type-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.file-type-ext {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.4;
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 4px;
    border: 1px solid var(--border-color);
}

.file-types-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--text-muted);
}

.file-types-notice strong {
    color: var(--accent-primary);
    font-weight: 600;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式适配 */
@media (max-width: 600px) {
    .file-types-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .file-type-item {
        padding: 10px 6px;
    }
    
    .file-type-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
        border-radius: 10px;
    }
    
    .file-type-name {
        font-size: 11px;
    }
    
    .file-type-ext {
        font-size: 10px;
        padding: 1px 6px;
    }
}

@media (max-width: 400px) {
    .file-types-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== Skeleton 骨架屏 ========== */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--border-color) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--border-radius-sm);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.medium {
    width: 80%;
}

.skeleton-text.long {
    width: 100%;
}

.skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.skeleton-row:last-child {
    border-bottom: none;
}

/* 表格骨架屏 - 使用真实 table 结构 */
.skeleton-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 850px; /* 与实际表格一致 */
    font-size: 13px;
}

.skeleton-table th,
.skeleton-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.skeleton-table thead {
    background: var(--bg-tertiary);
}

.skeleton-table tbody tr {
    transition: none;
}

.skeleton-table tbody tr:hover td {
    background: transparent;
}

/* 骨架单元格内部元素 */
.skeleton-cell-inner {
    height: 16px;
    border-radius: var(--border-radius-sm);
}

.skeleton-table th,
.skeleton-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.skeleton-table thead {
    background: var(--bg-tertiary);
}

.skeleton-table th {
    text-align: left;
}

/* 表格骨架屏列宽 - 与真实表格对应 */
.skeleton-table .col-name { width: 38%; }
.skeleton-table .col-size { width: 12%; }
.skeleton-table .col-device { width: 18%; }
.skeleton-table .col-time { width: 16%; }
.skeleton-table .col-action { width: 16%; min-width: 130px; }

.skeleton-table .col-code { width: 14%; }
.skeleton-table .col-type { width: 10%; }

/* 日志表格列宽 */
.skeleton-table .col-action-type { width: 10%; }
.skeleton-table .col-filename { width: 32%; }
.skeleton-table .col-ip { width: 14%; }

/* 骨架单元格内部元素 */
.skeleton-cell-inner {
    height: 16px;
    width: 80%;
    border-radius: var(--border-radius-sm);
}

.skeleton-cell-inner.short {
    width: 50%;
}

.skeleton-cell-inner.long {
    width: 95%;
}

/* ========== Toast 通知系统 ========== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none;
}

@media (max-width: 640px) {
    .toast-container {
        top: auto;
        bottom: 20px;
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 14px 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    animation: toast-slide-in 0.3s ease;
    max-width: 100%;
}

.toast.toast-exit {
    animation: toast-slide-out 0.3s ease forwards;
}

@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 640px) {
    @keyframes toast-slide-in {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

@keyframes toast-slide-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@media (max-width: 640px) {
    @keyframes toast-slide-out {
        from {
            opacity: 1;
            transform: translateY(0);
        }
        to {
            opacity: 0;
            transform: translateY(100%);
        }
    }
}

.toast-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
}

.toast-success {
    border-left: 3px solid var(--accent-success);
}

.toast-success .toast-icon {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-success);
}

.toast-warning {
    border-left: 3px solid var(--accent-warning);
}

.toast-warning .toast-icon {
    background: rgba(210, 153, 34, 0.15);
    color: var(--accent-warning);
}

.toast-error {
    border-left: 3px solid var(--accent-danger);
}

.toast-error .toast-icon {
    background: rgba(248, 81, 73, 0.15);
    color: var(--accent-danger);
}

.toast-info {
    border-left: 3px solid var(--accent-primary);
}

.toast-info .toast-icon {
    background: rgba(88, 166, 255, 0.15);
    color: var(--accent-primary);
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.toast-action {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

.toast-action button {
    font-size: 12px;
    padding: 4px 10px;
    min-height: 28px;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: currentColor;
    opacity: 0.3;
    animation: toast-progress linear forwards;
}

.toast {
    position: relative;
    overflow: hidden;
}

@keyframes toast-progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* ========== 空状态组件 ========== */
.empty-state-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

/* 表格中的空状态 - 确保在单元格中居中 */
td .empty-state-container {
    min-width: 400px;
}

.empty-state-icon {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    opacity: 0.6;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state-desc {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 400px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.empty-state-action {
    display: flex;
    gap: 12px;
}

/* 不同场景的空状态 */
.empty-state-upload .empty-state-icon {
    animation: float 3s ease-in-out infinite;
}

.empty-state-search .empty-state-icon {
    opacity: 0.4;
}

.empty-state-error .empty-state-icon {
    color: var(--accent-danger);
    opacity: 0.8;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 空状态小尺寸（用于小区域） */
.empty-state-small {
    padding: 32px 16px;
}

.empty-state-small .empty-state-icon {
    width: 60px;
    height: 60px;
    font-size: 36px;
    margin-bottom: 12px;
}

.empty-state-small .empty-state-title {
    font-size: 15px;
}

.empty-state-small .empty-state-desc {
    font-size: 13px;
    margin-bottom: 12px;
}

/* ========== 分页组件 ========== */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    gap: 16px;
    flex-wrap: wrap;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--border-color);
    border-color: var(--text-muted);
    transform: translateY(-1px);
}

.pagination-btn:active:not(:disabled) {
    transform: translateY(0);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-primary);
}

.pagination-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #000;
    font-weight: 600;
}

.pagination-btn.prev,
.pagination-btn.next {
    padding: 0 14px;
    font-weight: 500;
}

.pagination-ellipsis {
    color: var(--text-muted);
    font-size: 13px;
    padding: 0 4px;
    user-select: none;
}

.pagination-page-size {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.pagination-page-size select {
    min-width: 60px;
    height: 32px;
    padding: 0 8px;
    font-size: 13px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    cursor: pointer;
}

.pagination-page-size select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}


/* ========== 批量操作栏 ========== */
.batch-action-bar {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 2px solid var(--accent-primary);
    padding: 12px 20px;
    z-index: 100;
    animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.batch-action-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.batch-divider {
    color: var(--border-color);
    font-weight: 300;
}

.batch-count {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.batch-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* 批量管理模式下的选中样式 - 覆盖整行 */
.batch-selected,
tr.batch-selected,
tbody tr.batch-selected,
table tbody tr.batch-selected,
#publicFilesBody tr.batch-selected,
#myFilesBody tr.batch-selected {
    background: rgba(88,166,255,0.22) !important;
    border-left: 4px solid var(--accent-primary) !important;
    box-shadow: inset 0 0 0 1px rgba(88,166,255,0.4), 0 0 12px rgba(88,166,255,0.15) !important;
}

/* 确保选中样式覆盖 hover 效果 */
tr.batch-selected:hover,
.file-row-flat.batch-selected,
.file-row-flat.batch-selected:hover {
    background: rgba(88,166,255,0.22) !important;
    border-left: 4px solid var(--accent-primary) !important;
}

/* 部分选中状态（用于文件夹内部分文件选中） */
.batch-partial,
tbody tr.batch-partial,
#publicFilesBody tr.batch-partial,
#myFilesBody tr.batch-partial {
    background: rgba(88,166,255,0.12) !important;
    border-left: 4px dashed var(--accent-primary) !important;
}

/* 选中行所有单元格继承行背景 */
.batch-selected td,
.batch-partial td,
tr.batch-selected td,
tr.batch-partial td,
table tr.batch-selected td,
table tr.batch-partial td {
    background-color: rgba(88,166,255,0.22) !important;
    border-color: rgba(88,166,255,0.2) !important;
}

/* 部分选中状态的单元格 */
.batch-partial td,
tr.batch-partial td,
table tr.batch-partial td {
    background-color: rgba(88,166,255,0.12) !important;
}

/* 专门修复操作列背景 - 使用更具体的选择器 */
table tbody tr.batch-selected td:last-child,
table tbody tr.batch-partial td:last-child,
#privateFilesTable tbody tr.batch-selected td:last-child,
#privateFilesTable tbody tr.batch-partial td:last-child,
#privateFilesBody tr.batch-selected td:last-child,
#privateFilesBody tr.batch-partial td:last-child {
    background-color: rgba(88,166,255,0.22) !important;
}

/* 部分选中状态的操作列 */
table tbody tr.batch-partial td:last-child,
#privateFilesTable tbody tr.batch-partial td:last-child,
#privateFilesBody tr.batch-partial td:last-child {
    background-color: rgba(88,166,255,0.12) !important;
}

.batch-selected .filename {
    color: var(--accent-primary) !important;
    font-weight: 600 !important;
}

/* 批量管理模式下的行悬停效果 */
.batch-mode table tbody tr {
    transition: all 0.15s ease;
}

.batch-mode table tbody tr:hover {
    background: rgba(88,166,255,0.08) !important;
    cursor: pointer;
}

/* 批量管理按钮激活状态 */
.btn-primary.active {
    background: var(--accent-primary);
    color: #000;
    box-shadow: 0 0 0 2px var(--accent-primary);
}

/* 全选按钮样式 */
#publicSelectAllBtn,
#mySelectAllBtn,
#adminSelectAllBtn {
    min-width: 60px;
}

#publicSelectAllBtn.active,
#mySelectAllBtn.active,
#adminSelectAllBtn.active {
    background: var(--accent-primary);
    color: #000;
}


/* ========== 子文件夹层级样式 ========== */

/* 树状线图标 */
.folder-tree-line {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* 层级类 */
.folder-level-0 {
    /* 根级文件夹 - 使用默认样式 */
}

.folder-level-1 {
    /* 一级子文件夹 */
}

.folder-level-2 {
    /* 二级子文件夹 */
}

.folder-level-3 {
    /* 三级子文件夹 */
}

/* 文件夹层级左边框淡入动画 */
.folder-level-1,
.folder-level-2,
.folder-level-3 {
    animation: folderIndentFadeIn 0.2s ease;
}

@keyframes folderIndentFadeIn {
    from {
        opacity: 0;
        transform: translateX(-5px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}


/* ========== 文件树状层级增强样式 ========== */

/* 树状前缀样式 */
.folder-tree-prefix,
.file-tree-prefix {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
    font-size: 13px;
    color: rgba(139, 148, 158, 0.6);
    white-space: pre;
    user-select: none;
    letter-spacing: -1px;
    line-height: 1;
}

/* 文件夹名称包装器 */
.folder-name-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    max-width: 100%;
}

/* 路径提示 */
.folder-path-hint {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(88, 166, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
}

/* 文件层级类 */
.file-level-1,
.file-level-2,
.file-level-3 {
    animation: folderIndentFadeIn 0.25s ease;
}

/* 文件夹行悬停效果 */
.folder-level-0:hover,
.folder-level-1:hover,
.folder-level-2:hover,
.folder-level-3:hover,
.file-level-1:hover,
.file-level-2:hover,
.file-level-3:hover {
    background: linear-gradient(90deg, rgba(88, 166, 255, 0.08) 0%, transparent 100%) !important;
}

/* 文件名单元格优化 */
.filename .folder-tree-prefix + span,
.filename .file-tree-prefix + span {
    flex-shrink: 0;
}


/* ========== 文件选中样式高优先级覆盖 ========== */

/* 公开文件列表中的文件选中 */
#publicFilesBody .file-row-flat.batch-selected,
#publicFilesBody tr.file-row-flat.batch-selected,
#publicFilesBody tbody tr.file-row-flat.batch-selected {
    background: rgba(88,166,255,0.22) !important;
    border-left: 4px solid var(--accent-primary) !important;
    box-shadow: inset 0 0 0 1px rgba(88,166,255,0.4), 0 0 12px rgba(88,166,255,0.15) !important;
}

/* 我的传输中的文件选中 */
#myFilesBody .file-row-flat.batch-selected,
#myFilesBody tr.file-row-flat.batch-selected,
#myFilesBody tbody tr.file-row-flat.batch-selected {
    background: rgba(88,166,255,0.22) !important;
    border-left: 4px solid var(--accent-primary) !important;
    box-shadow: inset 0 0 0 1px rgba(88,166,255,0.4), 0 0 12px rgba(88,166,255,0.15) !important;
}

/* 确保 hover 不影响选中状态 */
#publicFilesBody .file-row-flat.batch-selected:hover,
#myFilesBody .file-row-flat.batch-selected:hover {
    background: rgba(88,166,255,0.22) !important;
    border-left: 4px solid var(--accent-primary) !important;
}

/* 选中文件的文件名高亮 */
#publicFilesBody .file-row-flat.batch-selected .file-flat-name,
#myFilesBody .file-row-flat.batch-selected .file-flat-name {
    color: var(--accent-primary) !important;
    font-weight: 600 !important;
}


/* ========== 私发文件选中样式 ========== */

/* 私发文件列表中的文件选中 */
#privateFilesBody .batch-selected,
#privateFilesBody tr.batch-selected,
#privateFilesBody tbody tr.batch-selected {
    background: rgba(88,166,255,0.22) !important;
    border-left: 4px solid var(--accent-primary) !important;
    box-shadow: inset 0 0 0 1px rgba(88,166,255,0.4), 0 0 12px rgba(88,166,255,0.15) !important;
}

/* 确保 hover 不影响选中状态 */
#privateFilesBody .batch-selected:hover,
#privateFilesBody tr.batch-selected:hover {
    background: rgba(88,166,255,0.22) !important;
    border-left: 4px solid var(--accent-primary) !important;
}

/* 选中文件的文件名高亮 */
#privateFilesBody .batch-selected .file-name-text,
#privateFilesBody tr.batch-selected .file-name-text {
    color: var(--accent-primary) !important;
    font-weight: 600 !important;
}
