/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background: #0a0a0a;
    color: #00ff00;
    overflow: hidden;
    height: 100vh;
}

/* 页面切换 */
.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    transform: translateX(100px);
}

.page.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* ==================== 连接页面样式 ==================== */
.terminal-container {
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    display: flex;
    flex-direction: column;
}

.terminal-header {
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.terminal-controls {
    display: flex;
    gap: 8px;
}

.control-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.control-dot.red { background: #ff5f56; }
.control-dot.yellow { background: #ffbd2e; }
.control-dot.green { background: #27ca3f; }

.terminal-title {
    font-size: 14px;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
}

/* 启动序列 */
.boot-sequence {
    padding: 20px;
    font-family: monospace;
}

.boot-line {
    color: #00ff00;
    margin: 5px 0;
    opacity: 0;
    animation: fadeInUp 0.5s ease-in-out forwards;
}

.boot-line:nth-child(1) { animation-delay: 0.2s; }
.boot-line:nth-child(2) { animation-delay: 0.4s; }
.boot-line:nth-child(3) { animation-delay: 0.6s; }
.boot-line:nth-child(4) { animation-delay: 0.8s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 连接区域 */
.connection-section {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 30px;
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
}

.section-header i {
    font-size: 28px;
}

/* 设备信息 */
.device-info {
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid #00ff00;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 18px;
}

.label {
    color: #888;
}

.device-code {
    font-size: 32px;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 15px #00ff00;
    letter-spacing: 3px;
}

.icon-btn {
    background: transparent;
    border: 1px solid #00ff00;
    color: #00ff00;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: #00ff00;
    color: #000;
    box-shadow: 0 0 15px #00ff00;
}

/* 连接输入 */
.connect-section {
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    align-items: center;
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid #00ff00;
    border-radius: 8px;
    overflow: hidden;
}

.input-icon {
    padding: 15px;
    color: #00ff00;
    background: rgba(0, 255, 0, 0.1);
}

#connect-to-id {
    flex: 1;
    background: transparent;
    border: none;
    color: #00ff00;
    font-size: 18px;
    padding: 15px;
    outline: none;
    text-align: center;
    letter-spacing: 2px;
}

#connect-to-id::placeholder {
    color: #555;
}

.connect-btn {
    background: #00ff00;
    color: #000;
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.connect-btn:hover {
    background: #00cc00;
    box-shadow: 0 0 20px #00ff00;
}

/* 状态指示 */
.status-section {
    text-align: center;
    margin-bottom: 30px;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 18px;
}

.status-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.status-dot.online {
    background: #00ff00;
    box-shadow: 0 0 15px #00ff00;
}

.status-dot.offline {
    background: #ff4444;
    box-shadow: 0 0 15px #ff4444;
}

/* ==================== 传输页面样式 ==================== */
.transfer-container {
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    display: flex;
    flex-direction: column;
}

.transfer-header {
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    flex: 1;
}

.header-center {
    flex: 2;
    text-align: center;
}

.header-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.nav-btn {
    background: transparent;
    border: 1px solid #00ff00;
    color: #00ff00;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: #00ff00;
    color: #000;
}

.nav-btn.danger {
    border-color: #ff4444;
    color: #ff4444;
}

.nav-btn.danger:hover {
    background: #ff4444;
    color: #fff;
}

.connection-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
}

.connection-icon {
    color: #00ff00;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.peer-id {
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
}

/* 传输内容区域 */
.transfer-content {
    flex: 1;
    display: flex;
    gap: 20px;
    padding: 20px;
    overflow: hidden;
}

.transfer-panel {
    flex: 1;
    background: rgba(0, 255, 0, 0.02);
    border: 1px solid #333;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.panel-header {
    background: rgba(0, 255, 0, 0.1);
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    color: #00ff00;
}

/* 文件拖拽区域 */
.file-drop-zone {
    margin: 20px;
    border: 2px dashed #333;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: #00ff00;
    background: rgba(0, 255, 0, 0.05);
}

.drop-icon {
    font-size: 48px;
    color: #555;
    margin-bottom: 15px;
}

.drop-text {
    font-size: 18px;
    color: #888;
    margin-bottom: 5px;
}

.drop-subtext {
    font-size: 14px;
    color: #555;
}

/* 文件列表 */
.selected-files-section,
.received-files-section {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    color: #888;
    font-size: 14px;
}

.file-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
}

.file-item {
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-item.pending {
    border-color: #ffaa00;
    background: rgba(255, 170, 0, 0.05);
}

.file-item.pending .file-status {
    color: #ffaa00;
}

.file-item.transferring {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.05);
}

.file-item.transferring .file-status {
    color: #3498db;
}

.file-item.completed {
    border-color: #27ae60;
    background: rgba(39, 174, 96, 0.05);
}

.file-item.completed .file-status {
    color: #27ae60;
}

.file-info {
    flex: 1;
}

.file-name {
    color: #00ff00;
    font-weight: bold;
    margin-bottom: 4px;
}

.file-size {
    color: #888;
    font-size: 12px;
}

.file-status {
    color: #ffaa00;
    font-size: 12px;
    font-style: italic;
    margin-top: 4px;
}

.no-files {
    text-align: center;
    color: #555;
    padding: 40px 20px;
    font-style: italic;
}

.no-files i {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

/* 按钮样式 */
.action-btn {
    background: #00ff00;
    color: #000;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #00cc00;
    box-shadow: 0 0 15px #00ff00;
}

.action-btn:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
    box-shadow: none;
}

.action-btn.sending {
    background: #ffaa00;
    color: #000;
    animation: sendingPulse 1.5s infinite;
}

@keyframes sendingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.terminal-btn {
    background: transparent;
    border: 1px solid #00ff00;
    color: #00ff00;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.terminal-btn:hover {
    background: #00ff00;
    color: #000;
}

/* 传输统计 */
.transfer-stats {
    padding: 20px;
    border-top: 1px solid #333;
    background: rgba(0, 255, 0, 0.02);
}

.stats-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    color: #00ff00;
    font-weight: bold;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(0, 255, 0, 0.05);
    border-radius: 4px;
}

.stat-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 255, 0, 0.1);
    border-radius: 50%;
    color: #00ff00;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #00ff00;
}

.stat-label {
    font-size: 12px;
    color: #888;
}

/* 底部命令区域 */
.command-footer {
    border-top: 1px solid #333;
    background: rgba(0, 255, 0, 0.02);
}

.command-section {
    padding: 15px 20px;
}

.command-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.command-prompt {
    color: #00ff00;
    font-weight: bold;
}

#command-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #00ff00;
    font-family: monospace;
    outline: none;
    padding: 5px 0;
}

#command-input::placeholder {
    color: #555;
}

/* ==================== 进度覆盖层 ==================== */
.progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.progress-content {
    background: #1a1a1a;
    border: 1px solid #00ff00;
    border-radius: 8px;
    padding: 30px;
    min-width: 400px;
    text-align: center;
}

.progress-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 18px;
    color: #00ff00;
}

.progress-filename {
    color: #00ff00;
    font-weight: bold;
    margin-bottom: 10px;
    word-break: break-all;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    color: #888;
}

.progress-bar-container {
    background: #333;
    border-radius: 4px;
    overflow: hidden;
    height: 8px;
}

.progress-bar {
    background: linear-gradient(90deg, #00ff00, #00cc00);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px #00ff00;
}

/* ==================== 模态框 ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.modal-content {
    background: #1a1a1a;
    border: 1px solid #00ff00;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-icon {
    font-size: 64px;
    color: #00ff00;
    margin-bottom: 20px;
    animation: successPulse 1s ease-in-out;
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.success-title {
    font-size: 24px;
    color: #00ff00;
    font-weight: bold;
    margin-bottom: 10px;
}

.success-message {
    color: #888;
    margin-bottom: 15px;
}

.success-subtitle {
    color: #00ff00;
    font-weight: bold;
    margin-bottom: 25px;
}

.success-btn {
    background: #00ff00;
    color: #000;
    border: none;
    padding: 12px 25px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.success-btn:hover {
    background: #00cc00;
    transform: translateY(-1px);
}

/* 文件接收确认弹窗 */
.confirm-header {
    text-align: center;
    margin-bottom: 20px;
}

.confirm-header i {
    font-size: 48px;
    color: #00ff00;
    margin-bottom: 10px;
}

.confirm-header h3 {
    color: #00ff00;
    margin: 0;
    font-size: 20px;
}

.confirm-body {
    text-align: center;
    margin-bottom: 25px;
}

.file-details {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.file-details .file-name {
    color: #00ff00;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.file-details .file-size {
    color: #888;
    font-size: 14px;
}

.confirm-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-accept, .btn-reject {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.btn-accept {
    background: #00ff00;
    color: #000;
}

.btn-accept:hover {
    background: #00cc00;
    transform: translateY(-1px);
}

.btn-reject {
    background: #ff4444;
    color: #fff;
}

.btn-reject:hover {
    background: #cc0000;
    transform: translateY(-1px);
}

/* 错误弹窗 */
.error-modal .modal-content {
    border: 2px solid #ff4444;
}

.error-header {
    text-align: center;
    margin-bottom: 20px;
}

.error-header i {
    font-size: 48px;
    color: #ff4444;
    margin-bottom: 10px;
}

.error-header h3 {
    color: #ff4444;
    margin: 0;
    font-size: 20px;
}

.error-body {
    text-align: center;
    margin-bottom: 25px;
    color: #ccc;
}

.error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-resume, .btn-close {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.btn-resume {
    background: #ffaa00;
    color: #000;
}

.btn-resume:hover {
    background: #cc8800;
    transform: translateY(-1px);
}

.btn-close {
    background: #666;
    color: #fff;
}

.btn-close:hover {
    background: #555;
    transform: translateY(-1px);
}

/* 未完成任务弹窗 */
.incomplete-modal .modal-content {
    border: 2px solid #ffaa00;
    max-width: 500px;
}

.incomplete-header {
    text-align: center;
    margin-bottom: 20px;
}

.incomplete-header i {
    font-size: 48px;
    color: #ffaa00;
    margin-bottom: 10px;
}

.incomplete-header h3 {
    color: #ffaa00;
    margin: 0;
    font-size: 20px;
}

.incomplete-body {
    margin-bottom: 25px;
}

.tasks-list {
    max-height: 200px;
    overflow-y: auto;
    margin: 15px 0;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    border-radius: 6px;
    margin-bottom: 8px;
}

.task-info {
    flex: 1;
}

.task-name {
    color: #00ff00;
    font-weight: bold;
    margin-bottom: 4px;
}

.task-progress {
    color: #888;
    font-size: 12px;
}

.btn-resume-task {
    padding: 6px 12px;
    background: #ffaa00;
    color: #000;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-resume-task:hover {
    background: #cc8800;
}

.incomplete-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-clear-all {
    padding: 12px 24px;
    background: #ff4444;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.btn-clear-all:hover {
    background: #cc0000;
    transform: translateY(-1px);
}

/* 文件状态样式 */
.file-item.pending {
    border-left: 4px solid #ffaa00;
}

.file-item.transferring {
    border-left: 4px solid #00ff00;
}

.file-item.completed {
    border-left: 4px solid #00cc00;
}

.file-item.error {
    border-left: 4px solid #ff4444;
}

.file-status {
    font-size: 11px;
    margin-top: 4px;
    font-style: italic;
}

.file-item.pending .file-status {
    color: #ffaa00;
}

.file-item.transferring .file-status {
    color: #00ff00;
}

.file-item.completed .file-status {
    color: #00cc00;
}

.file-item.error .file-status {
    color: #ff4444;
}

/* ==================== 工具类 ==================== */
.hidden {
    display: none !important;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .transfer-content {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .connection-section {
        padding: 20px;
    }
    
    .device-code {
        font-size: 24px;
        letter-spacing: 2px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .transfer-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 10px;
    }
    
    .header-left,
    .header-center,
    .header-right {
        flex: none;
    }
    
    .nav-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .connection-info {
        font-size: 14px;
    }
    
    .transfer-panel {
        min-height: auto;
    }
    
    .panel-header {
        padding: 12px 15px;
        font-size: 16px;
    }
    
    .file-item {
        padding: 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .file-info {
        width: 100%;
    }
    
    .terminal-btn {
        align-self: flex-end;
        padding: 8px 12px;
    }
    
    .action-btn {
        padding: 15px 20px;
        font-size: 16px;
    }
    
    .command-footer {
        padding: 10px;
    }
    
    .command-input-group {
        flex-wrap: wrap;
    }
    
    #command-input {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .connection-section {
        padding: 15px;
    }
    
    .section-header {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .device-info {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .info-row {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .device-code {
        font-size: 28px;
        letter-spacing: 3px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-icon {
        padding: 12px;
        border-bottom: 1px solid #333;
    }
    
    #connect-to-id {
        padding: 15px;
        font-size: 20px;
        letter-spacing: 3px;
    }
    
    .connect-btn {
        padding: 15px;
        font-size: 16px;
    }
    
    .file-drop-zone {
        margin: 10px;
        padding: 30px 15px;
    }
    
    .drop-icon {
        font-size: 36px;
    }
    
    .drop-text {
        font-size: 16px;
    }
    
    .drop-subtext {
        font-size: 12px;
    }
    
    .progress-content {
        margin: 15px;
        padding: 20px;
        min-width: auto;
    }
    
    .progress-filename {
        font-size: 14px;
        word-break: break-all;
        margin-bottom: 8px;
    }
    
    .progress-details {
        font-size: 12px;
    }
    
    .modal-content {
        margin: 20px;
        padding: 30px 20px;
        max-width: none;
        width: calc(100% - 40px);
    }
    
    .success-icon {
        font-size: 48px;
    }
    
    .success-title {
        font-size: 20px;
    }
    
    .transfer-stats {
        padding: 15px;
    }
    
    .stat-item {
        padding: 8px;
    }
    
    .stat-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .stat-label {
        font-size: 11px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .icon-btn,
    .nav-btn,
    .terminal-btn,
    .action-btn,
    .connect-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .file-drop-zone {
        padding: 40px 20px;
    }
    
    .file-item {
        padding: 15px;
    }
    
    #command-input {
        padding: 12px 0;
        font-size: 16px;
    }
    
    #connect-to-id {
        font-size: 18px;
        padding: 18px;
    }
}
