/**
 * 响应式样式
 * LAN Transfer - Responsive Styles
 */

/* ========== 中等窗口 (481px - 900px) ========== */
@media (min-width: 481px) and (max-width: 900px) {
    .container {
        padding: 16px 20px;
    }

    .panel {
        margin-bottom: 16px;
    }

    th, td {
        padding: 10px 12px;
    }

    .col-device, .col-time {
        display: none;
    }

    th:first-child, td:first-child {
        width: 50%;
    }
    th:nth-child(2), td:nth-child(2) {
        width: 20%;
    }
    th:last-child, td:last-child {
        width: 30%;
    }
    
    /* 侧边栏调整 */
    .sidebar {
        position: relative;
        left: auto;
        top: auto;
        width: 100%;
        margin-bottom: 16px;
        z-index: 100;
    }
    
    .sidebar-header {
        border-radius: 12px;
    }
    
    .sidebar-content {
        border-radius: 12px;
    }
    
    /* 主内容区调整 */
    body {
        padding-top: 72px;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
        padding: 16px;
        box-sizing: border-box;
    }
}

/* ========== 大屏幕 (>1920px) ========== */
@media (min-width: 1920px) {
    :root {
        font-size: 14px;
    }

    .container {
        max-width: 1600px;
    }

    .panel {
        margin-bottom: 24px;
    }

    .panel-header {
        padding: 14px 24px;
    }

    .panel-body {
        padding: 24px;
    }

    th, td {
        padding: 14px 20px;
    }
}

/* ========== PC端 (>=769px) 保护 ========== */
@media (min-width: 769px) {
    /* 确保表格行使用标准表格布局 */
    table tbody tr {
        display: table-row !important;
    }
    
    table tbody td {
        display: table-cell !important;
        width: auto !important;
        padding: 16px 20px !important;
    }
    
    /* 确保表头显示 */
    table thead {
        display: table-header-group !important;
    }
}

/* ========== 移动端 (<768px) ========== */
@media (max-width: 768px) {
    /* 全局重置 */
    html, body {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    body {
        padding-top: 0;
        margin: 0;
    }
    
    /* ===== 头部重新设计 - 两行布局 ===== */
    .header {
        height: auto;
        min-height: auto;
        padding: 10px 12px;
        flex-direction: column;
        gap: 10px;
        -webkit-app-region: no-drag;
        app-region: no-drag;
        width: 100%;
        box-sizing: border-box;
        position: relative;
    }
    
    /* 隐藏桌面端元素 */
    .header > .header-left,
    .header > .header-right,
    .desktop-only {
        display: none !important;
    }
    
    /* 显示移动端内容 - 紧凑布局 */
    .mobile-header-content {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    
    /* 单行顶栏 */
    .mobile-header-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 8px;
        min-height: 36px;
    }
    
    /* 左侧品牌 */
    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-shrink: 0;
    }
    
    .brand-icon {
        font-size: 18px;
        line-height: 1;
    }
    
    .brand-text {
        font-size: 13px;
        font-weight: 700;
        white-space: nowrap;
    }
    
    /* 中间状态区 */
    .mobile-status {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
        justify-content: center;
        min-width: 0;
    }
    
    /* 网络状态徽章 */
    .status-badge {
        display: inline-flex;
        align-items: center;
        gap: 3px;
        background: var(--bg-tertiary);
        padding: 3px 8px;
        border-radius: 10px;
        border: 1px solid var(--border-color);
        font-size: 10px;
        color: var(--text-secondary);
        white-space: nowrap;
    }
    
    .status-dot {
        font-size: 7px;
        line-height: 1;
    }
    
    .status-dot.online {
        color: var(--accent-success);
    }
    
    .status-text {
        font-size: 10px;
        font-weight: 500;
        max-width: 70px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* 迷你存储条 */
    .storage-mini {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        background: var(--bg-tertiary);
        padding: 3px 6px;
        border-radius: 10px;
        border: 1px solid var(--border-color);
    }
    
    .storage-icon {
        font-size: 10px;
        line-height: 1;
    }
    
    .storage-bar {
        width: 30px;
        height: 4px;
        background: var(--border-color);
        border-radius: 2px;
        overflow: hidden;
    }
    
    .storage-fill {
        height: 100%;
        background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
        border-radius: 2px;
        transition: width 0.3s ease;
    }
    
    /* 右侧控制区 */
    .mobile-controls {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-shrink: 0;
    }
    
    .mobile-admin-badge {
        font-size: 9px;
        padding: 2px 5px;
        background: var(--accent-danger);
        color: #fff;
        border-radius: 8px;
        font-weight: 600;
    }
    
    .mobile-btn {
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        border-radius: 6px;
        color: var(--text-secondary);
        cursor: pointer;
        padding: 0;
        transition: all 0.2s ease;
    }
    
    .mobile-btn:active {
        background: var(--bg-secondary);
        transform: scale(0.95);
    }
    
    .mobile-btn.primary {
        background: var(--accent-primary);
        border-color: var(--accent-primary);
        color: #000;
    }
    
    .mobile-icon {
        width: 14px;
        height: 14px;
        stroke-width: 2;
    }
    
    /* 侧边栏 - 移动端改为紧凑横向列表 */
    .sidebar {
        position: relative;
        left: auto;
        top: auto;
        width: calc(100% - 24px);
        margin: 0 12px 10px;
        z-index: 100;
        box-sizing: border-box;
    }
    
    .sidebar-header {
        display: none; /* 移动端隐藏标题栏 */
    }
    
    .sidebar-content {
        display: block !important; /* 始终显示 */
        border-radius: 12px;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        padding: 8px 12px;
        max-height: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .sidebar.expanded .sidebar-content,
    .sidebar:not(.expanded) .sidebar-content {
        max-height: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* 横向滚动的用户列表 */
    .online-users-list {
        display: flex;
        flex-direction: row;
        gap: 8px;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        padding: 2px 0;
    }
    
    .online-users-list::-webkit-scrollbar {
        display: none;
    }
    
    /* 紧凑用户项 */
    .online-user-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        padding: 6px 8px;
        border-radius: 8px;
        background: var(--bg-tertiary);
        border: 1px solid var(--border-color);
        flex-shrink: 0;
        min-width: 56px;
        transition: all 0.2s ease;
    }
    
    .online-user-item.self {
        background: rgba(86, 234, 14, 0.1);
        border-color: var(--accent-primary);
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 11px;
        font-weight: 600;
        border-radius: 50%;
        background: var(--accent-primary);
        color: #000;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .user-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1px;
    }
    
    .user-name {
        font-size: 10px;
        font-weight: 500;
        color: var(--text-primary);
        max-width: 48px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .user-status {
        font-size: 9px;
        color: var(--accent-success);
        display: flex;
        align-items: center;
        gap: 2px;
    }
    
    .user-status::before {
        content: '';
        width: 5px;
        height: 5px;
        background: var(--accent-success);
        border-radius: 50%;
    }
    
    /* 主内容区 */
    body {
        padding-top: 0;
    }
    
    .main-content {
        width: 100%;
        max-width: 100%;
        padding: 12px;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }
    
    .container {
        padding: 0;
        width: 100%;
        max-width: 100%;
    }

    .panel {
        margin-bottom: 12px;
        border-radius: 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .panel-header {
        padding: 12px 14px;
        font-size: 12px;
        letter-spacing: 0.5px;
    }

    .panel-body {
        padding: 14px;
        width: 100%;
        box-sizing: border-box;
    }

    /* 表单调整 */
    .form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        margin-bottom: 12px;
        width: 100%;
    }

    .form-row label {
        min-width: auto;
        font-size: 12px;
        width: 100%;
    }
    
    .form-row input,
    .form-row button {
        width: 100%;
    }

    input[type="text"],
    input[type="password"],
    select {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 10px 12px;
        width: 100%;
        height: 44px;
        box-sizing: border-box;
    }

    .btn {
        padding: 10px 16px;
        font-size: 13px;
        min-height: 44px;
        width: 100%;
        box-sizing: border-box;
    }

    .btn-sm {
        padding: 8px 12px;
        font-size: 12px;
        min-height: 36px;
    }
    
    /* 上传操作按钮 */
    .upload-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .upload-actions .btn {
        width: 100%;
    }

    /* 拖拽区域调整 */
    #dropZone {
        padding: 24px 16px;
        min-height: 180px;
        width: 100%;
        box-sizing: border-box;
    }

    #dropIcon {
        font-size: 40px;
        margin-bottom: 12px;
    }
    
    #dropText1 {
        font-size: 15px;
    }
    
    #dropText2 {
        font-size: 12px;
    }
    
    /* 已选文件列表 */
    #selectedFilesBox {
        margin-bottom: 12px;
        width: 100%;
    }
    
    #selectedFilesBox > div:first-child {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }
    
    #selectedFilesList {
        width: 100%;
    }

    /* 已选文件列表 */
    #selectedFilesBox {
        margin-bottom: 12px;
    }
    
    #selectedFilesBox > div:first-child {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    /* 支持的文件类型 */
    .file-types-section {
        margin-top: 16px;
    }
    
    .file-types-header {
        padding: 10px 12px;
    }
    
    .file-types-title {
        font-size: 12px;
    }
    
    .file-types-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 12px;
    }
    
    .file-type-item {
        padding: 10px 8px;
    }
    
    .file-type-icon {
        font-size: 20px;
        margin-bottom: 4px;
    }
    
    .file-type-name {
        font-size: 11px;
    }
    
    .file-type-ext {
        font-size: 9px;
    }

    /* 标签页 - 可横向滚动 */
    .tabs {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 4px;
        padding: 0 4px;
    }
    
    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab {
        flex: 0 0 auto;
        padding: 10px 12px;
        font-size: 12px;
        white-space: nowrap;
    }
    
    .tab .badge {
        font-size: 10px;
        padding: 1px 6px;
        margin-left: 4px;
    }
    
    /* 下拉选择器 */
    .custom-dropdown {
        width: 100%;
    }
    
    .custom-dropdown-trigger {
        width: 100%;
        justify-content: space-between;
    }

    /* 弹窗调整 - 移动端全屏 */
    .upload-modal {
        padding: 0;
        background: var(--bg-primary);
    }
    
    .upload-modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }
    
    .upload-modal-header {
        padding: 16px;
        font-size: 16px;
        border-bottom: 1px solid var(--border-color);
    }

    .upload-modal-body {
        padding: 16px;
        flex: 1;
        overflow-y: auto;
    }

    .upload-modal-footer {
        padding: 12px 16px;
        flex-direction: row;
        gap: 12px;
        border-top: 1px solid var(--border-color);
    }

    .upload-modal-footer .btn {
        flex: 1;
    }
    
    /* 选项卡片 */
    .option-card {
        padding: 16px;
        margin-bottom: 12px;
    }
    
    .option-card h4 {
        font-size: 15px;
        margin-bottom: 4px;
    }
    
    .option-card p {
        font-size: 12px;
    }
    
    /* 提取码输入 */
    .code-input-row {
        padding: 12px 0;
    }
    
    .code-input-row label {
        font-size: 13px;
    }

    /* 表格调整为卡片式 */
    .file-list-container,
    .table-wrapper {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        min-height: 250px;
    }

    .file-list-container table,
    .table-wrapper table {
        min-width: auto !important;
        width: 100% !important;
        min-height: 200px;
    }

    table thead {
        display: none;
    }

    /* 移动端文件列表样式已移至 mobile-file-card.css
    
    .action-btns .btn {
        flex: 1;
        min-width: 70px;
        max-width: none;
    }
    
    /* ===== 移动端空状态修复 ===== */
    /* 包含空状态的整行 - 移除卡片样式 */
    #privateFilesBody > tr:has(> td .empty-state-container),
    #publicFilesBody > tr:has(> td .empty-state-container),
    #myFilesBody > tr:has(> td .empty-state-container),
    #adminFilesBody > tr:has(> td .empty-state-container) {
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 0;
        margin: 0;
    }
    
    /* 包含空状态的单元格 - 禁用卡片样式 */
    #privateFilesBody > tr > td:has(> .empty-state-container),
    #publicFilesBody > tr > td:has(> .empty-state-container),
    #myFilesBody > tr > td:has(> .empty-state-container),
    #adminFilesBody > tr > td:has(> .empty-state-container) {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        border: none !important;
    }
    
    /* 禁用空状态单元格的伪元素 */
    #privateFilesBody > tr > td:has(> .empty-state-container)::before,
    #publicFilesBody > tr > td:has(> .empty-state-container)::before,
    #myFilesBody > tr > td:has(> .empty-state-container)::before,
    #adminFilesBody > tr > td:has(> .empty-state-container)::before {
        display: none !important;
    }
    
    /* 空状态容器 - 所有文件表格 */
    #privateFilesBody .empty-state-container,
    #publicFilesBody .empty-state-container,
    #myFilesBody .empty-state-container,
    #adminFilesBody .empty-state-container {
        min-height: 200px;
        padding: 40px 20px !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* 私发文件空状态专门优化 - 确保在视口中央显示 */
    #content-private .file-list-container {
        min-height: 300px;
        display: flex;
        flex-direction: column;
    }
    
    #content-private #privateFilesTable {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 250px;
    }
    
    #content-private #privateFilesBody {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        min-height: 250px;
    }
    
    /* 私发文件空状态行样式 */
    #content-private #privateFilesBody > tr {
        width: 100% !important;
        display: flex;
        justify-content: flex-start;
        align-items: flex-start;
    }
    
    #content-private #privateFilesBody > tr > td {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        border: none !important;
        text-align: left;
    }
    
    /* 空状态容器 - 统一所有tab的样式 */
    #privateFilesBody .empty-state-container,
    #publicFilesBody .empty-state-container,
    #myFilesBody .empty-state-container,
    #adminFilesBody .empty-state-container {
        min-height: 200px;
        padding: 40px 20px !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* 超小屏幕空状态 */
    @media (max-width: 480px) {
        #privateFilesBody .empty-state-container,
        #publicFilesBody .empty-state-container,
        #myFilesBody .empty-state-container,
        #adminFilesBody .empty-state-container {
            min-height: 160px;
            padding: 30px 16px !important;
        }
    }

    /* 分页组件调整 */
    .pagination-container {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding: 16px;
    }

    .pagination-controls {
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
    }

    .pagination-info {
        text-align: center;
        font-size: 12px;
    }

    .pagination-page-size {
        font-size: 12px;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .pagination-page-size select {
        height: 32px;
        font-size: 13px;
    }

    /* 管理头部调整 */
    .manage-header {
        padding: 12px;
    }
    
    .manage-header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .manage-header-info {
        font-size: 13px;
    }

    .manage-header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    /* 批量操作栏 */
    .batch-action-bar {
        padding: 12px;
    }
    
    .batch-action-bar-inner {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .batch-count {
        font-size: 13px;
    }
    
    .batch-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .batch-actions .btn {
        flex: 1;
        min-width: 80px;
    }

    body {
        padding-bottom: env(safe-area-inset-bottom, 20px);
    }
    
    /* ===== 空状态修复 - 确保居中显示 ===== */
    .empty-state-container {
        padding: 40px 20px !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        min-width: auto !important;
    }
    
    /* 表格中的空状态修复 */
    td .empty-state-container {
        min-width: auto !important;
        min-height: 200px;
    }
    
    /* 表格行中的空状态 */
    table tbody tr td .empty-state-container {
        min-width: auto !important;
        width: 100%;
        max-width: 100%;
    }
    
    .empty-state-icon {
        font-size: 48px;
        margin-bottom: 16px;
        width: 80px;
        height: 80px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .empty-state-title {
        font-size: 16px;
        margin-bottom: 8px;
        font-weight: 600;
        color: var(--text-primary);
    }
    
    .empty-state-desc {
        font-size: 13px;
        margin-bottom: 20px;
        color: var(--text-secondary);
        max-width: 280px;
        line-height: 1.5;
        padding: 0 10px;
    }
    
    /* 空状态按钮 */
    .empty-state-action {
        width: 100%;
        max-width: 200px;
        display: flex;
        justify-content: center;
    }
    
    .empty-state-action .btn {
        width: 100%;
    }
    
    /* 进度条 */
    .progress-container {
        padding: 16px;
    }
    
    #uploadFileList {
        max-height: 250px;
    }
    
    .upload-file-item {
        padding: 12px;
    }
    
    .upload-file-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .upload-file-name {
        font-size: 13px;
        max-width: none;
    }
    
    .upload-file-size {
        font-size: 11px;
    }
    
    .upload-file-status {
        font-size: 11px;
    }
    
    /* Toast 提示 */
    .status-toast {
        left: 12px;
        right: 12px;
        top: auto;
        bottom: 20px;
        transform: none;
        max-width: none;
        padding: 14px 16px;
    }
}

/* ========== 超小屏幕 (<480px) ========== */
@media (max-width: 480px) {
    .header {
        padding: 6px 10px;
        min-height: 48px;
    }
    
    .header-logo-text {
        font-size: 14px;
    }
    
    .header-logo-icon {
        font-size: 18px;
    }
    
    .brand-icon {
        font-size: 20px;
    }
    
    /* 存储条更紧凑 */
    .storage-bar-container {
        gap: 6px;
    }
    
    .storage-bar-label {
        display: none;
    }
    
    .storage-bar-info {
        flex-direction: column;
        align-items: flex-end;
        gap: 2px;
    }

    table tbody tr {
        padding: 12px 0;
        margin-bottom: 10px;
    }
    
    /* 超小屏幕样式已移至 mobile-file-card.css

    .action-btns {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 6px;
    }

    .action-btns .btn {
        padding: 6px 10px;
        font-size: 11px;
        flex: 1;
        min-width: 60px;
        max-width: none;
    }
    
    /* 标签页更紧凑 */
    .tab {
        padding: 8px 10px;
        font-size: 11px;
    }
    
    .tab .badge {
        font-size: 9px;
        padding: 1px 5px;
    }
    
    /* 文件类型网格 */
    .file-types-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .file-type-item {
        padding: 12px 8px;
    }
    
    .file-type-icon {
        font-size: 24px;
    }
    
    .file-type-name {
        font-size: 12px;
    }
    
    .file-type-ext {
        font-size: 10px;
    }

    .pagination-btn {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
        padding: 0 8px;
    }

    .pagination-btn.prev,
    .pagination-btn.next {
        padding: 0 12px;
    }

    .pagination-info {
        font-size: 11px;
    }

    .pagination-page-size select {
        height: 32px;
        font-size: 12px;
    }
    
    /* 弹窗选项卡片 */
    .option-card {
        padding: 14px;
    }
    
    .option-card h4 {
        font-size: 14px;
    }
    
    .option-card p {
        font-size: 11px;
    }
    
    /* 超小屏幕顶栏优化 */
    .mobile-brand {
        gap: 2px;
    }
    
    .brand-icon {
        font-size: 16px;
    }
    
    .brand-text {
        font-size: 11px;
    }
    
    .mobile-status {
        gap: 4px;
    }
    
    .status-badge {
        padding: 2px 6px;
        font-size: 9px;
    }
    
    .status-text {
        max-width: 50px;
        font-size: 9px;
    }
    
    .storage-mini {
        padding: 2px 4px;
    }
    
    .storage-icon {
        font-size: 9px;
    }
    
    .storage-bar {
        width: 24px;
        height: 3px;
    }
    
    .mobile-btn {
        width: 26px;
        height: 26px;
    }
    
    .mobile-icon {
        width: 12px;
        height: 12px;
    }
    
    /* 在线用户列表 */
    .online-user-item {
        padding: 4px 6px;
        min-width: 48px;
    }
    
    .user-avatar {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    
    .user-name {
        font-size: 9px;
        max-width: 40px;
    }
    
    .user-status {
        font-size: 8px;
    }
    
    /* 批量管理 */
    .batch-action-bar-inner {
        justify-content: center;
    }
    
    .batch-actions .btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    /* 空状态超小屏幕优化 */
    .empty-state-container {
        padding: 30px 16px !important;
        min-height: 180px;
    }
    
    .empty-state-icon {
        font-size: 40px;
        width: 70px;
        height: 70px;
    }
    
    .empty-state-title {
        font-size: 15px;
    }
    
    .empty-state-desc {
        font-size: 12px;
        padding: 0 8px;
        max-width: 260px;
    }
}

/* ========== 小高度窗口 ========== */
@media (max-height: 600px) {
    .main-content {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .panel {
        margin-bottom: 12px;
    }
}

/* ========== 移动端触摸优化 ========== */
@media (hover: none) and (pointer: coarse) {
    /* 移除悬停效果，使用点击反馈 */
    .btn:hover,
    .tab:hover,
    .sidebar-header:hover,
    .online-user-item:hover {
        transform: none;
    }
    
    /* 增大触摸目标 */
    .btn,
    .tab,
    .ctrl-btn,
    .action-btns .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* 文件列表项增大触摸区域 */
    table tbody td:last-child .btn {
        min-height: 36px;
        padding: 8px 14px;
    }
    
    /* 禁用长按菜单 */
    img, 
    .user-avatar,
    .user-chip-avatar {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* 快速滚动 */
    .online-users-list,
    #uploadFileList {
        -webkit-overflow-scrolling: touch;
    }
}

/* ========== 暗黑模式适配 ========== */
@media (prefers-color-scheme: dark) {
    /* 确保移动端状态栏颜色正确 */
    meta[name="theme-color"] {
        content: #161b22;
    }
}

/* ========== 横屏模式优化 ========== */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        min-height: 44px;
        padding: 6px 12px;
    }
    
    .storage-bar-container {
        display: none;
    }
    
    .sidebar {
        margin-bottom: 8px;
    }
    
    .sidebar.expanded .sidebar-content {
        max-height: 200px;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .panel-body {
        padding: 12px;
    }
    
    /* 弹窗非全屏 */
    .upload-modal-content {
        max-height: 90vh;
        border-radius: 12px;
        margin: auto;
        max-width: 500px;
    }
}
