* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

header {
    background: #4a6bdf;
    color: white;
    padding: 20px;
    text-align: center;
}

h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.main-content {
    padding: 25px;
}

.section {
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 10px;
    background: #f8f9fa;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #4a6bdf;
    display: flex;
    align-items: center;
}

h2 i {
    margin-right: 10px;
}

.input-group {
    display: flex;
    margin-bottom: 15px;
}

input[type="text"] {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px 0 0 5px;
    font-size: 14px;
}

button {
    padding: 12px 20px;
    background: #4a6bdf;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

button:hover {
    background: #3a5bc7;
}

.btn-copy {
    border-radius: 0 5px 5px 0;
}

.btn-small {
    padding: 8px 15px;
    font-size: 13px;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.status {
    padding: 10px;
    margin-top: 15px;
    border-radius: 5px;
    font-size: 14px;
}

.status.connected {
    background: #d4edda;
    color: #155724;
}

.status.disconnected {
    background: #f8d7da;
    color: #721c24;
}

.status.pending {
    background: #fff3cd;
    color: #856404;
}

.file-section {
    display: flex;
    flex-direction: column;
}

.file-input {
    margin-bottom: 15px;
}

.file-list {
    margin-top: 15px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 5px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.file-info {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 600;
}

.file-size {
    font-size: 12px;
    color: #6c757d;
}

.progress-bar {
    height: 5px;
    background: #e9ecef;
    border-radius: 5px;
    margin-top: 5px;
    overflow: hidden;
    width: 100%;
}

.progress {
    height: 100%;
    background: #4a6bdf;
    width: 0%;
    transition: width 0.3s;
}

.transfer-history {
    margin-top: 20px;
}

.history-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.history-item:last-child {
    border-bottom: none;
}

.icon {
    margin-right: 8px;
}

.user-list {
    margin-top: 10px;
}

.user-item {
    display: inline-block;
    background: #e9ecef;
    padding: 5px 10px;
    border-radius: 15px;
    margin-right: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}

.debug-console {
    background: #2b303b;
    color: #dee2e6;
    padding: 15px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 12px;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 15px;
    display: none;
}

.debug-toggle {
    background: #6c757d;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    margin-top: 10px;
}

@media (max-width: 600px) {
    .input-group {
        flex-direction: column;
    }
    
    input[type="text"] {
        border-radius: 5px;
        margin-bottom: 10px;
    }
    
    button {
        width: 100%;
        border-radius: 5px;
    }
    
    .btn-copy {
        border-radius: 5px;
    }
}

.my-user-id {
    margin-top: 10px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 15px;
    display: inline-block;
}

#my-user-id {
    font-weight: bold;
    color: #ffeb3b;
}


.qrcode-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
    height: 180px; /* 根据二维码大小设置 */
}

/* 用户列表样式 */
.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 6px;
    background: #f5f5f5;
    transition: all 0.3s ease;
}

.user-self {
    background: #e3f2fd;
    font-weight: bold;
}

.user-connected {
    background: #e8f5e8;
    border-left: 4px solid #4caf50;
}

.user-disconnected {
    background: #ffebee;
    border-left: 4px solid #f44336;
    opacity: 0.6;
}

.user-pending {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
}

/* 状态指示器 */
.status-indicator {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
}

.status-indicator.connected {
    background: #4caf50;
    color: white;
}

.status-indicator.connecting {
    background: #ff9800;
    color: white;
}

.status-indicator.disconnected {
    background: #f44336;
    color: white;
}

.status-indicator.failed {
    background: #d32f2f;
    color: white;
}

.status-indicator.self {
    background: #2196f3;
    color: white;
}

.status-indicator.new,
.status-indicator.checking {
    background: #9e9e9e;
    color: white;
}


/* 连接类型标识样式 */
.connection-type {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 8px;
    text-transform: uppercase;
}

.connection-type.p2p {
    background-color: #4caf50;
    color: white;
}

.connection-type.relay {
    background-color: #ff9800;
    color: white;
}

.connection-type.unknown {
    background-color: #9e9e9e;
    color: white;
}

.connection-type.connecting {
    background-color: #2196f3;
    color: white;
}

/* 用户项样式调整 */
.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 6px;
    background: #f8f9fa;
    border-left: 4px solid #ddd;
}

.user-item.user-connected {
    border-left-color: #4caf50;
    background: #e8f5e8;
}

.user-item.user-disconnected {
    border-left-color: #f44336;
    background: #ffebee;
}

.user-item.user-pending {
    border-left-color: #2196f3;
    background: #e3f2fd;
}

.user-item.user-self {
    border-left-color: #9c27b0;
    background: #f3e5f5;
}

.user-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.user-status {
    display: flex;
    align-items: center;
    gap: 8px;
}
.drop-zone {
  border: 2px dashed #888;
  border-radius: 12px;
  padding: 30px;
  text-align: center;
  color: #666;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  margin-bottom: 10px;
}

.drop-zone.dragover {
  background: #eef;
  border-color: #36f;
  color: #000;
}

.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.file-name {
    max-width: 50%;   /* 根据进度条宽度调整 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    flex: 1;
}

footer {
    flex-shrink: 0;
}
.qrcode-tip {
    margin-top: 10px;
    padding: 10px 15px;
    background-color: #f0f8ff;  /* 浅蓝色背景 */
    color: #333;                /* 深色文字 */
    border-radius: 8px;         /* 圆角 */
    text-align: center;         /* 居中对齐 */
    font-size: 14px;            /* 调整文字大小 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);  /* 微阴影 */
}
.file-item {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #eee;
  border-radius: 4px;
}
.progress-container {
  margin: 10px 0;
}
.progress-bar {
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: #42b983;
  transition: width 0.3s ease;
}
.status {
  margin-top: 5px;
  font-size: 0.9em;
}
.status.success {
  color: #42b983;
}
.status.error {
  color: #e74c3c;
}
.history {
  margin-top: 20px;
  padding: 10px;
  border-top: 1px solid #eee;
}
.history-item {
  padding: 5px 0;
  border-bottom: 1px solid #f5f5f5;
}
.history-time {
  color: #999;
  font-size: 0.8em;
  margin-left: 10px;
}