/* ============ 强制 hidden 属性生效（覆盖 display:flex 等） ============ */
[hidden] {
    display: none !important;
}

/* ============ 基础 ============ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: #1f2937;
    background: #f5f6f8;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
}

/* ============ 按钮：高度统一、hover 不变红 ============ */
.ls-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 16px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    outline: none;
    /* 取消荧光边框，点击边框统一 */
    -webkit-tap-highlight-color: transparent;
}

.ls-btn:focus,
.ls-btn:active {
    outline: none;
    border-color: #9ca3af;
    box-shadow: none;
}

.ls-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
}

.ls-btn-primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.ls-btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

.ls-btn-ghost {
    background: transparent;
    border-color: transparent;
    color: #4b5563;
}

.ls-btn-ghost:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #111827;
}

.ls-btn-secondary {
    background: #fff;
    border-color: #d1d5db;
    color: #374151;
}

.ls-btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #111827;
}

.ls-btn-mini {
    height: 28px;
    padding: 0 10px;
    font-size: 12px;
}

/* ============ 整体布局 ============ */
.ls-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-width: 900px;
}

/* ============ 顶部栏 ============ */
.ls-header {
    flex: 0 0 auto;
    height: 56px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.ls-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.ls-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ls-conn-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    line-height: 1;
}

.ls-conn-badge.is-online .ls-conn-status {
    color: #059669;
}

.ls-conn-badge.is-offline .ls-conn-status {
    color: #dc2626;
}

.ls-conn-badge.is-connecting .ls-conn-status {
    color: #d97706;
}

.ls-conn-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ls-my-ip {
    color: #9ca3af;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.01em;
}

.ls-my-ip::before {
    content: '·';
    margin: 0 6px;
    color: #d1d5db;
    font-family: inherit;
}

.ls-logo {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    background: #2563eb;
    color: #fff;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
}

.ls-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ls-user-welcome {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #374151;
    font-size: 14px;
    line-height: 1;
}

.ls-user-avatar {
    width: 18px;
    height: 18px;
    color: #4b5563;
    flex-shrink: 0;
}

.ls-user-name {
    color: #111827;
    font-size: 14px;
    font-weight: 600;
}

.ls-user-guest-tag {
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    padding: 1px 6px;
    border-radius: 999px;
    background: #f3f4f6;
    line-height: 1.4;
}

.ls-guest .ls-user-name {
    cursor: pointer;
}

.ls-user-sep {
    color: #9ca3af;
    margin: 0 2px;
    font-weight: 400;
    user-select: none;
}

.ls-user-link {
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    height: auto;
    font-size: 14px;
    line-height: 1;
    color: #4b5563;
    cursor: pointer;
    text-decoration: none;
    transition: color .15s ease, opacity .15s ease;
}

.ls-user-link:hover {
    color: #111827;
    text-decoration: underline;
    text-underline-offset: 3px;
    opacity: .9;
}

#ls-scan-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.ls-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 4px 12px;
    min-height: 28px;
    border-radius: 6px;
    border: 1px solid #9ca3af;
    background: #fff;
    color: #374151;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: background .18s ease, transform .1s ease, box-shadow .12s ease, border-color .18s ease, color .15s ease;
}

.ls-logout-btn:hover {
    background: #f3f4f6;
    border-color: #6b7280;
    color: #111827;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.ls-logout-btn:active {
    transform: translateY(1px) scale(0.97);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* ============ 连接状态点 ============ */
.ls-status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9ca3af;
    flex-shrink: 0;
}

.ls-dot-online {
    background: #10b981;
}

.ls-dot-offline {
    background: #ef4444;
}

.ls-dot-connecting {
    background: #f59e0b;
}

/* ============ 主区域 ============ */
.ls-main {
    flex: 1 1 auto;
    display: flex;
    overflow: hidden;
}

/* ============ 左侧侧栏 ============ */
.ls-sidebar {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid #e5e7eb;
}

.ls-sidebar-nudge {
    animation: ls-shake 0.45s ease;
}

.ls-sidebar-nudge .ls-sidebar-head {
    background: #eff6ff;
}

@keyframes ls-shake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-6px); }
    30% { transform: translateX(6px); }
    45% { transform: translateX(-4px); }
    60% { transform: translateX(4px); }
    75% { transform: translateX(-2px); }
    90% { transform: translateX(2px); }
}

.ls-sidebar-head {
    flex: 0 0 auto;
    height: 44px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid #f3f4f6;
}

.ls-sidebar-head-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #111827;
}

.ls-sidebar-head-tools {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ls-peer-count {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    line-height: 1.4;
}

.ls-sidebar-tip {
    flex: 0 0 auto;
    padding: 10px 16px;
    color: #9ca3af;
    font-size: 12px;
    border-top: 1px solid #f3f4f6;
    text-align: center;
}

.ls-refresh-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
    transition: background .15s;
    outline: none;
}

.ls-refresh-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

.ls-peer-list {
    flex: 1 1 auto;
    list-style: none;
    margin: 0;
    padding: 6px 8px;
    overflow-y: auto;
}

.ls-peer-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
}

.ls-peer-item:hover {
    background: #f9fafb;
}

.ls-peer-item.ls-peer-selected {
    background: #eff6ff;
    outline: 2px solid #2563eb;
    outline-offset: -2px;
}

.ls-sidebar-need-select .ls-peer-item::after {
    content: '点击选择';
    margin-left: auto;
    margin-top: 0;
    font-size: 11px;
    color: #2563eb;
    flex-shrink: 0;
}

.ls-peer-item.ls-peer-selected::after {
    content: '点击取消';
    margin-left: auto;
    margin-top: 0;
    font-size: 11px;
    color: #1d4ed8;
    font-weight: 600;
    flex-shrink: 0;
}

.ls-peer-avatar {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    margin-top: 0;
    border-radius: 50%;
    background: #e0e7ff;
    color: #3b82f6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ls-peer-device-svg {
    width: 18px;
    height: 18px;
    display: block;
}

.ls-peer-avatar--phone .ls-peer-device-svg {
    width: 16px;
    height: 16px;
}

.ls-peer-item.ls-peer-selected .ls-peer-avatar {
    background: #2563eb;
    color: #fff;
}

.ls-peer-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
}

.ls-peer-name {
    color: #111827;
    font-size: 14px;
    line-height: 1.45;
    white-space: normal;
    word-break: break-word;
}

.ls-peer-ip {
    color: #9ca3af;
    font-size: 12px;
}

/* ============ 右侧内容区 ============ */
.ls-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============ 发送区 ============ */
.ls-send-panel {
    flex: 0 0 auto;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ls-send-steps {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #6b7280;
}

.ls-step {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ls-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #4b5563;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.ls-step.is-current {
    color: #1d4ed8;
    font-weight: 600;
}

.ls-step.is-current .ls-step-num,
.ls-sidebar-need-select .ls-step-num {
    background: #2563eb;
    color: #fff;
}

.ls-step.is-done {
    color: #047857;
}

.ls-step.is-done .ls-step-num {
    background: #10b981;
    color: #fff;
}

.ls-step-arrow {
    color: #d1d5db;
}

.ls-send-target {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 13px;
}

.ls-target-name {
    color: #111827;
    font-weight: 600;
}

/* 未选目标时显示红色，提示用户先选接收端 */
.ls-target-name.empty {
    color: #dc2626;
    font-weight: 600;
}

.ls-dropzone {
    border: 2px dashed #93c5fd;
    border-radius: 10px;
    padding: 24px 20px;
    background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
    text-align: center;
    color: #1e40af;
    transition: border-color .24s ease, background-color .24s ease, box-shadow .24s ease, color .24s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 160px;
    box-sizing: border-box;
    cursor: pointer;
}

.ls-dropzone:hover {
    border-color: #2563eb;
    background: #dbeafe;
}

.ls-dropzone.is-locked {
    cursor: default;
    /* 与就绪态同尺寸、同虚线框，仅略降饱和提示未选人 */
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 100%);
    color: #64748b;
}

.ls-dropzone.is-locked:hover {
    border-color: #93c5fd;
    background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
}

.ls-dz-locked {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
}

.ls-dropzone.is-locked .dropzone-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #1e3a8a;
    font-size: 16px;
    font-weight: 600;
}

.ls-dz-step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    flex: 0 0 auto;
}

.ls-dropzone.is-locked .dropzone-tip {
    color: #64748b;
    max-width: none;
    font-size: 12px;
}

.ls-dropzone.ls-dz-drag {
    border-color: #2b6cb0;
    background: #ebf8ff;
    box-shadow: 0 0 0 3px rgba(66,153,225,.2);
    color: #2b6cb0;
}

.ls-dropzone.is-selected {
    border-color: #2f855a;
    background: #f0fff4;
    box-shadow: none;
    color: #2f855a;
}

.ls-dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
}

/* ============ 三行文案样式（参考 dify 园林绿化 AI 助手） ============ */
.dropzone-title {
    font-weight: 600;
    font-size: 16px;
    margin: 0;
    color: inherit;
}
.dropzone-tip {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}

.ls-dz-folder-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.ls-dz-folder-link:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}
.ls-dropzone-file-name {
    margin-top: 8px;
    font-size: 13px;
    color: #64748b;
    word-break: break-all;
    line-height: 1.5;
}

/* 选中后，拖拽提示文字隐藏，只剩文件信息居中显示 */
.ls-dropzone.is-selected .dropzone-title,
.ls-dropzone.is-selected .dropzone-tip {
    display: none;
}
.ls-dropzone.is-selected .ls-dropzone-file-name {
    margin-top: 0;
    text-align: center;
    color: #1f2937;
}

.ls-dropzone-file-name .selected-main {
    font-size: 15px;
    line-height: 1.4;
    font-weight: 700;
    color: #1f2937;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ls-dropzone-file-name .selected-icon {
    color: #16a34a;
}
.ls-dropzone-file-name .selected-sub {
    margin-top: 4px;
    font-size: 12px;
    color: #64748b;
}

.ls-dz-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.ls-dz-btn {
    min-width: 108px;
    height: 40px;
    padding: 0 22px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .12s ease;
}

.ls-dz-btn-clear {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #475569;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ls-dz-btn-clear:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.ls-dz-btn-clear:active {
    transform: translateY(1px);
    background: #f1f5f9;
    border-color: #94a3b8;
}

.ls-dz-btn-send {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    border: 1px solid #1d4ed8;
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.ls-dz-btn-send:hover {
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
    border-color: #1e40af;
    color: #fff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.36);
    transform: translateY(-1px);
}

.ls-dz-btn-send:active {
    transform: translateY(0);
    background: #1d4ed8;
    border-color: #1e40af;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.22);
}

.ls-dz-btn-send:focus,
.ls-dz-btn-clear:focus {
    outline: none;
}

.ls-dz-btn-send:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.4);
    outline-offset: 2px;
}

.ls-dz-btn-clear:focus-visible {
    outline: 2px solid rgba(100, 116, 139, 0.35);
    outline-offset: 2px;
}

.ls-dropzone.is-selected .ls-dz-actions {
    display: flex;
}

/* ============ 发送/接收列表项 ============ */
.ls-send-log-head {
    margin: 12px 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
.ls-send-queue,
.ls-recv-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ls-send-item,
.ls-recv-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    position: relative;
}

.ls-file-icon {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    text-align: center;
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ls-ftype {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
}

.ls-ftype svg {
    display: block;
    width: 28px;
    height: 28px;
    overflow: visible;
}

.ls-file-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ls-file-name {
    color: #111827;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ls-file-meta {
    color: #9ca3af;
    font-size: 12px;
}

.ls-file-status {
    flex: 0 0 auto;
    min-width: 140px;
    max-width: 220px;
    text-align: right;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ls-item-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: #e5e7eb;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.ls-item-bar-inner {
    height: 100%;
    width: 0%;
    background: #2563eb;
    transition: width .15s;
}

.ls-recv-item-queued .ls-file-status {
    color: #94a3b8;
}

.ls-recv-item-queued .ls-item-bar-inner {
    background: #cbd5e1;
}

.ls-recv-item-active .ls-item-bar-inner {
    background: #2563eb;
}

/* 发送/接收结束后隐藏进度条 */
.ls-item-done .ls-item-bar,
.ls-recv-item-done .ls-item-bar,
.ls-item-rejected .ls-item-bar {
    display: none;
}

.ls-send-item.ls-item-done .ls-file-status,
.ls-recv-item-done .ls-file-status {
    color: #059669;
}

.ls-send-item.ls-item-rejected .ls-file-status {
    color: #dc2626;
}

/* ============ 可折叠文件夹组 ============ */
.ls-folder-group {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
}

.ls-folder-head {
    cursor: pointer;
    user-select: none;
}

.ls-folder-head:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.ls-folder-toggle {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, color .15s ease;
}

.ls-folder-toggle:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.ls-folder-toggle:focus {
    outline: none;
}

.ls-folder-toggle:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.35);
    outline-offset: 1px;
}

.ls-folder-children {
    list-style: none;
    margin: 0;
    padding: 0 0 2px 28px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ls-folder-group.is-collapsed .ls-folder-children {
    display: none;
}

.ls-folder-child {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.ls-folder-child .ls-file-name {
    font-size: 12.5px;
}

.ls-folder-child .ls-file-meta,
.ls-folder-child .ls-file-status {
    font-size: 11.5px;
}

.ls-send-queue .ls-folder-group {
    gap: 6px;
}

.ls-file-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 6px;
    margin-left: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ls-btn-reveal {
    white-space: nowrap;
}

/* ============ 接收区 ============ */
.ls-recv-panel {
    flex: 1 1 auto;
    min-height: 0;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    /* 去掉内边距，表头/列表各自控制 padding，整体用外壳 overflow:hidden 裁圆角 */
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* ============ 接收到的传输：列表 ============ */
.ls-recv-list {
    list-style: none;
    margin: 0;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

/* ============ 接收到的传输：表头 ============ */
.ls-recv-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    /* 和发送面板上传区同款浅渐变，风格统一 */
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.ls-recv-head-title {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    position: relative;
    padding-left: 12px;
    line-height: 1.4;
}
/* 左侧装饰小蓝条：增强层级，和 dify 标题风格一致 */
.ls-recv-head-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 14px;
    border-radius: 3px;
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
}

.ls-recv-save {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
    justify-content: flex-end;
}

.ls-recv-save-label {
    flex: 0 0 auto;
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}

.ls-recv-save-btn {
    appearance: none;
    max-width: min(280px, 42vw);
    min-width: 0;
    margin: 0;
    padding: 4px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    line-height: 1.4;
    cursor: pointer;
    text-align: left;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.ls-recv-save-btn:hover {
    border-color: #93c5fd;
    background: #f8fafc;
    color: #1e40af;
}

#ls-save-path-val {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ls-recv-save-btn.is-set #ls-save-path-val {
    color: #1e3a8a;
    font-weight: 500;
}

.ls-recv-save-clear {
    appearance: none;
    flex: 0 0 auto;
    margin: 0;
    padding: 4px 8px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
    line-height: 1.4;
}

.ls-recv-save-clear:hover {
    color: #dc2626;
    background: #fef2f2;
}

/* ============ 空状态 ============ */
.ls-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    padding: 28px 16px;
    list-style: none;
    background: #fafbfc;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
}

.ls-empty-hint {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.5;
}

/* ============ 弹窗 ============ */
.ls-modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.ls-modal-mask.ls-modal-hidden {
    display: none !important;
}

.ls-modal {
    position: relative;
    width: 420px;
    max-width: 90vw;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.ls-modal-head {
    height: 48px;
    padding: 0 52px 0 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f3f4f6;
    font-weight: 600;
    color: #111827;
}

.ls-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 30;
    width: 34px;
    height: 34px;
    padding: 0;
    margin: 0;
    border: none;
    background: #f4f4f5;
    border-radius: 50%;
    cursor: pointer;
    color: #71717a;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    line-height: 1;
    font-size: 0;
}

.ls-modal-close svg {
    width: 16px;
    height: 16px;
    display: block;
}

.ls-modal-close:hover {
    color: #ffffff;
    background: #ef4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

.ls-modal-close:active {
    background: #dc2626;
    color: #ffffff;
}

.ls-modal-close:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.45);
    outline-offset: 2px;
}

.ls-modal-body {
    padding: 20px 16px;
}

.ls-recv-modal-name {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 12px;
}

.ls-recv-modal-file {
    background: #f9fafb;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.ls-recv-modal-fname {
    color: #111827;
    font-size: 14px;
    font-weight: 500;
    word-break: break-all;
    margin-bottom: 4px;
}

.ls-recv-modal-fsize {
    color: #9ca3af;
    font-size: 12px;
}
.ls-recv-modal-hint {
    margin-top: 12px;
    font-size: 12px;
    color: #047857;
    line-height: 1.5;
}
.ls-recv-modal-hint.is-queue {
    color: #1d4ed8;
}

.ls-modal-foot {
    padding: 16px 20px 18px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.ls-recv-modal-foot {
    justify-content: stretch;
}

.ls-recv-modal-foot .ls-modal-btn {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .12s ease;
}

.ls-modal-btn-reject {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ls-modal-btn-reject:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.ls-modal-btn-reject:active {
    transform: translateY(1px);
    background: #f1f5f9;
}

.ls-modal-btn-reject:focus,
.ls-modal-btn-accept:focus {
    outline: none;
}

.ls-modal-btn-reject:focus-visible {
    outline: 2px solid rgba(100, 116, 139, 0.35);
    outline-offset: 2px;
}

.ls-modal-btn-accept {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    border: 1px solid #1d4ed8;
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.ls-modal-btn-accept:hover {
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
    border-color: #1e40af;
    color: #fff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.36);
    transform: translateY(-1px);
}

.ls-modal-btn-accept:active {
    transform: translateY(0);
    background: #1d4ed8;
    border-color: #1e40af;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.22);
}

.ls-modal-btn-accept:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.4);
    outline-offset: 2px;
}

/* ============ 访客修改昵称弹窗 ============ */
.ls-name-modal {
    width: 400px;
}

.ls-name-modal-foot {
    gap: 12px;
}

.ls-name-modal-desc {
    margin: 0 0 14px;
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
}

.ls-name-input {
    display: block;
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    color: #111827;
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}

.ls-name-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.ls-name-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.ls-name-modal-hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.4;
}

/* ============ Toast ============ */
.ls-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    max-width: 80vw;
    text-align: center;
}

.ls-toast.ls-toast-error {
    background: #b91c1c;
}

/* ============ 滚动条美化 ============ */
.ls-peer-list::-webkit-scrollbar,
.ls-content::-webkit-scrollbar,
.ls-recv-list::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.ls-peer-list::-webkit-scrollbar-thumb,
.ls-content::-webkit-scrollbar-thumb,
.ls-recv-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.ls-peer-list::-webkit-scrollbar-thumb:hover,
.ls-content::-webkit-scrollbar-thumb:hover,
.ls-recv-list::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ============ 响应式：平板 / 手机 ============ */
@media (max-width: 980px) {
    .ls-app {
        min-width: 0;
        height: 100dvh;
        max-height: 100dvh;
    }

    .ls-main {
        flex-direction: column;
        overflow: hidden;
    }

    .ls-sidebar {
        flex: 0 0 auto;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }

    .ls-content {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 720px) {
    .ls-app {
        min-width: 0;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    /* —— 顶栏：紧凑可换行 —— */
    .ls-header {
        height: auto;
        min-height: 52px;
        padding: 8px 12px;
        padding-top: max(8px, env(safe-area-inset-top, 0px));
        flex-wrap: wrap;
        gap: 8px 12px;
        align-items: center;
    }

    .ls-brand {
        gap: 8px;
        min-width: 0;
        flex: 1 1 auto;
    }

    .ls-logo {
        width: 26px;
        height: 26px;
        font-size: 14px;
        flex-shrink: 0;
    }

    .ls-title {
        font-size: 15px;
    }

    .ls-conn-badge {
        flex-wrap: wrap;
        gap: 2px 4px;
    }

    .ls-my-ip {
        font-size: 10px;
    }

    .ls-my-ip::before {
        margin: 0 4px;
    }

    .ls-user {
        gap: 8px;
        flex: 0 0 auto;
        margin-left: auto;
    }

    .ls-user-welcome {
        gap: 4px;
        font-size: 13px;
        max-width: 46vw;
        overflow: hidden;
    }

    .ls-user-name {
        font-size: 13px;
        max-width: 28vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ls-user-sep {
        display: none;
    }

    .ls-user-link.ls-user-home,
    a.ls-user-link.ls-user-home {
        display: none;
    }

    #ls-scan-btn {
        display: inline-block;
        font-size: 13px;
    }

    .ls-logout-btn {
        height: 32px;
        padding: 0 12px;
        font-size: 13px;
    }

    /* —— 设备列表：横向滑动点选 —— */
    .ls-sidebar {
        background: #fff;
    }

    .ls-sidebar-head {
        height: 40px;
        padding: 0 12px;
    }

    .ls-sidebar-tip {
        display: none;
    }

    .ls-peer-list {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
        padding: 10px 12px 12px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
    }

    .ls-peer-list::-webkit-scrollbar {
        display: none;
    }

    .ls-peer-list .ls-empty {
        flex: 1 1 auto;
        padding: 12px 8px;
        text-align: center;
        font-size: 13px;
    }

    .ls-peer-item {
        flex: 0 0 auto;
        width: 148px;
        min-height: 72px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 10px 8px;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        background: #f8fafc;
        scroll-snap-align: start;
        text-align: center;
    }

    .ls-peer-item:hover {
        background: #f1f5f9;
    }

    .ls-peer-item.ls-peer-selected {
        background: #eff6ff;
        border-color: #2563eb;
        outline: none;
        box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
    }

    .ls-peer-avatar {
        margin-top: 0;
    }

    .ls-peer-info {
        align-items: center;
        width: 100%;
    }

    .ls-peer-name {
        font-size: 13px;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        word-break: break-all;
    }

    .ls-peer-ip {
        font-size: 11px;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ls-sidebar-need-select .ls-peer-item::after,
    .ls-peer-item.ls-peer-selected::after {
        margin-left: 0;
        margin-top: 2px;
        font-size: 10px;
    }

    /* —— 主内容 —— */
    .ls-content {
        padding: 12px;
        gap: 12px;
    }

    .ls-send-panel {
        padding: 12px;
        border-radius: 12px;
        gap: 10px;
    }

    .ls-send-steps {
        font-size: 12px;
        gap: 6px;
        flex-wrap: wrap;
    }

    .ls-send-target {
        flex-wrap: wrap;
        gap: 4px 8px;
        font-size: 13px;
        line-height: 1.4;
    }

    .ls-dropzone {
        min-height: 132px;
        padding: 18px 14px;
        border-radius: 12px;
    }

    .ls-dropzone.is-locked .dropzone-title,
    .dropzone-title {
        font-size: 15px;
    }

    .dropzone-tip {
        font-size: 12px;
        line-height: 1.5;
        padding: 0 4px;
    }

    .ls-dz-actions {
        width: 100%;
        justify-content: center;
    }

    .ls-dz-btn {
        min-height: 40px;
        padding: 0 18px;
    }

    /* —— 传输列表：状态换行，避免挤爆 —— */
    .ls-send-item,
    .ls-recv-item {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 8px 10px;
        padding: 10px;
    }

    .ls-file-status {
        flex: 1 1 100%;
        min-width: 0;
        max-width: none;
        order: 5;
        text-align: left;
        font-size: 12px;
        padding-left: 38px;
    }

    .ls-file-actions {
        margin-left: auto;
    }

    .ls-folder-head .ls-file-status,
    .ls-folder-child .ls-file-status {
        padding-left: 28px;
    }

    .ls-recv-panel {
        min-height: 200px;
        border-radius: 12px;
    }

    .ls-recv-head {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px;
        align-items: flex-start;
    }

    .ls-recv-save {
        width: 100%;
        justify-content: flex-start;
    }

    .ls-recv-save-btn {
        max-width: none;
        flex: 1 1 auto;
    }

    .ls-recv-list {
        padding: 10px;
    }

    /* —— 弹窗：贴近底部，更好点按 —— */
    .ls-modal-mask {
        align-items: flex-end;
        padding: 0;
    }

    .ls-modal {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 16px 16px 0 0;
        max-height: min(88dvh, 640px);
    }

    .ls-recv-modal-foot {
        padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
        gap: 10px;
    }

    .ls-modal-btn {
        min-height: 44px;
        font-size: 15px;
    }

    .ls-toast {
        bottom: max(16px, env(safe-area-inset-bottom, 0px));
        left: 12px;
        right: 12px;
        transform: none;
        max-width: none;
        width: auto;
    }

    .ls-name-modal,
    .ls-scan-modal {
        width: calc(100vw - 24px);
        max-width: none;
    }
}

@media (max-width: 420px) {
    .ls-peer-item {
        width: 132px;
        min-height: 84px;
    }

    .ls-user-guest-tag {
        display: none;
    }

    .ls-brand .ls-title {
        max-width: 42vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* ============ 扫码弹窗 ============ */
.ls-scan-modal {
    width: 640px;
    max-width: 92vw;
}

.ls-scan-wrap {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.ls-scan-qr {
    flex: 0 0 auto;
    width: 240px;
    height: 240px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.ls-scan-qr canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.ls-scan-loading {
    color: #6b7280;
    font-size: 13px;
    text-align: center;
    padding: 16px;
}

.ls-scan-loading.ls-scan-error {
    color: #b91c1c;
    background: #fef2f2;
    border-radius: 8px;
}

.ls-scan-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ls-scan-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.ls-scan-sub {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.7;
}

.ls-scan-url {
    font-size: 12px;
    color: #6b7280;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 10px;
    word-break: break-all;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    line-height: 1.5;
    max-height: 68px;
    overflow: hidden;
}

.ls-scan-tip {
    margin-top: 18px;
    padding: 12px 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    font-size: 13px;
    color: #1e40af;
    line-height: 1.8;
}

.ls-scan-tip strong {
    color: #1d4ed8;
}

/* 扫码来源的接收项：图标颜色区分 */
.ls-recv-item-scan .ls-file-icon {
    color: #7c3aed;
}

/* 扫码弹窗响应式 */
@media (max-width: 720px) {
    .ls-scan-wrap {
        flex-direction: column;
        align-items: center;
    }

    .ls-scan-qr {
        width: 220px;
        height: 220px;
    }

    .ls-scan-info {
        width: 100%;
    }
}

/* ============ 接收到的传输：列表项 hover 美化 ============ */
.ls-recv-item {
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.ls-recv-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.ls-recv-item .ls-file-icon {
    flex: 0 0 36px;
}
.ls-recv-item .ls-file-info {
    flex: 1 1 auto;
    min-width: 0;
}