:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 背景效果 */
.background-effects {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3), transparent 70%);
    top: -200px;
    left: -200px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.25), transparent 70%);
    bottom: -150px;
    right: -150px;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.2), transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -30px) scale(1.05);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }

    75% {
        transform: translate(20px, 10px) scale(1.02);
    }
}

.orb-3 {
    animation-name: float-center;
}

@keyframes float-center {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
    }

    25% {
        transform: translate(-45%, -55%) scale(1.05);
    }

    50% {
        transform: translate(-55%, -45%) scale(0.95);
    }

    75% {
        transform: translate(-48%, -52%) scale(1.02);
    }
}

/* 容器 */
.container {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部 */
.header {
    text-align: center;
    margin-bottom: 48px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    color: var(--accent-primary);
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* 连接状态 */
.connection-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    width: fit-content;
    margin: 0 auto 32px;
    backdrop-filter: blur(10px);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
}

.status-indicator.connected {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.status-indicator.connecting {
    animation: pulse 1.5s ease-in-out infinite;
}

.status-indicator.error {
    background: var(--error);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.connection-status span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* 我的设备信息 */
.my-device-info {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.my-device-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}

.my-device-icon {
    font-size: 2rem;
}

.my-device-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.my-device-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.my-device-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.my-device-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.edit-name-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.edit-name-btn svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.edit-name-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.edit-name-btn:hover svg {
    color: var(--accent-primary);
}

/* 主内容区 */
.main-content {
    flex: 1;
}

/* 设备区域 */
.devices-section {
    margin-bottom: 32px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.section-title svg {
    width: 20px;
    height: 20px;
}

.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.no-devices {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
}

.no-devices svg {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.no-devices p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.no-devices .hint {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* 设备卡片 */
.device-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.device-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.device-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 40px -20px rgba(99, 102, 241, 0.3);
}

.device-card:hover::before {
    opacity: 0.05;
}

.device-card.drag-over {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.05);
}

.device-avatar {
    width: 64px;
    height: 64px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 1.5rem;
    position: relative;
    z-index: 1;
}

.device-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
    text-align: center;
    word-break: break-word;
}

.device-type {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    position: relative;
    z-index: 1;
}

/* 拖拽区域 */
.drop-zone {
    padding: 48px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-xl);
    text-align: center;
    transition: all 0.3s ease;
    background: var(--bg-card);
}

.drop-zone.drag-active {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.drop-icon {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.drop-zone.drag-active .drop-icon {
    color: var(--accent-primary);
    transform: translateY(-8px);
}

.drop-zone p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.drop-zone span {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* 传输面板 */
.transfer-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 360px;
    max-height: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: none;
    z-index: 100;
}

.transfer-panel.active {
    display: block;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.transfer-panel h3 {
    padding: 16px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}

.transfers-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 12px;
}

.transfer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.transfer-item:last-child {
    margin-bottom: 0;
}

.transfer-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.transfer-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.transfer-info {
    flex: 1;
    min-width: 0;
}

.transfer-name {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transfer-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.transfer-size,
.transfer-speed {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.transfer-progress {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.transfer-progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.transfer-status {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.transfer-status.sending {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-primary);
}

.transfer-status.receiving {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.transfer-status.complete {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.transfer-status.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

/* 模态框 */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 400px;
    width: 100%;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.modal-header svg {
    width: 32px;
    height: 32px;
    color: var(--accent-primary);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.file-name {
    font-weight: 500;
    word-break: break-all;
}

.file-size {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.file-sender {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.modal-progress {
    margin-bottom: 24px;
    display: none;
}

.modal-progress.active {
    display: block;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.2s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    display: block;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* 响应式 */
@media (max-width: 640px) {
    .container {
        padding: 24px 16px;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .devices-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .drop-zone {
        padding: 32px 20px;
    }

    .transfer-panel {
        left: 16px;
        right: 16px;
        width: auto;
        bottom: 16px;
    }

    .modal-content {
        padding: 24px;
    }
}