* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    color: #333;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #4a6cf7;
    font-size: 2.2rem;
    margin-bottom: 10px;
}

header p {
    color: #666;
    font-size: 1.1rem;
}

.status-area {
    text-align: center;
    margin-bottom: 25px;
}

.status {
    border: 1px solid #ddd;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    margin-bottom: 10px;
}

.status.success {
    background-color: #e6f7e6;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.status.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.alert {
    padding: 10px 15px;
    border-radius: 6px;
    background-color: #e3f2fd;
    color: #1565c0;
    text-align: center;
    margin-top: 5px;
    display: none;
}

.alert.show {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.input-area {
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    min-height: 48px;
    position: relative;
}

.input-group input {
    width: 100%;
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.2);
}

.input-group button {
    background: #4a6cf7;
    color: white;
    border: none;
    padding: 0 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.input-group button:hover {
    background: #3a5ce5;
}

/* .connections-section {
    margin-top: 20px;
} */

.connections-section h2 {
    color: #4a6cf7;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.connection-item {
    display: flex;
    align-items: center;
    background: #f8f9ff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 12px;
    border-left: 4px solid #4a6cf7;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.connection-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.device-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-right: 12px;
}

.device-icon i {
    font-size: 28px;
    color: #4a6cf7;
}

.connection-id {
    font-weight: bold;
    font-size: 1.1rem;
    color: #2c3e50;
}

.device-type {
    font-size: 0.85em;
    color: #777;
    margin-top: 2px;
}

/* 基础按钮样式（明确背景，避免继承或默认高亮） */
.file-btn {
    background: #4a6cf7;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    /* 只对 transform 和阴影做过渡，避免背景色平滑过渡导致残留 */
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    margin-left: auto;
    font-size: 0.95rem;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    background-color: #4a6cf7;
}

/* 悬停态（只改变可安全过渡的属性） */
.file-btn:hover {
    background: #3a5ce5;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(58, 92, 229, 0.12);
}

/* 禁用态样式 */
.file-btn:disabled,
.file-btn[disabled] {
    cursor: default;
    opacity: 0.9;
    filter: none;
    transform: none;
    box-shadow: none;
}

/* 等待接收状态的按钮样式（显式禁止背景过渡） */
.file-btn.waiting {
    background-color: #ff9800 !important;
    /* 橙色背景 */
    color: white !important;
    border: none !important;
    /* 禁止背景色过渡，避免从上一个颜色平滑过渡出残留 */
    transition: none !important;
    -webkit-tap-highlight-color: transparent;
}

/* 等待悬停（同样禁止平滑背景过渡） */
.file-btn.waiting:hover {
    background-color: #f57c00 !important;
    /* 深一点的橙色 */
    transform: none;
    box-shadow: none;
}

/* 进度按钮样式（用于包含进度环的按钮） */
.file-btn.progress-button {
    background-color: transparent;
    color: none;
    border: none;
    padding: 6px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

/* 进度环容器：相对定位，百分比文本绝对居中 */
.progress-ring-container {
    position: relative;
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* SVG 占满容器 */
.progress-ring-container svg {
    display: block;
    width: 56px;
    height: 56px;
}

/* 居中显示百分比文本 */
.progress-ring-container .progress-percent {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a6cf7;
    pointer-events: none;
    white-space: nowrap;
}

/* 背景环与进度环样式 */
.progress-ring-container .ring-bg {
    stroke: #e6e6e6;
    transition: none;
}

.progress-ring-container .ring-progress {
    stroke: #4a6cf7;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.28s ease;
}

/* 防止按钮在获得焦点时出现浏览器默认黄色高亮（移动端/桌面） */
.file-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.12);
}

/* 小屏幕适配 */
@media (max-width: 420px) {
    .file-btn {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .progress-percent {
        font-size: 0.8rem;
    }
}


.connections-section {
    position: relative;
}


.default-prompt {
    text-align: center;
    color: #999;
    font-size: 1rem;
    padding: 20px 0;
    display: none;
}


/* 顶部通知样式 - 黑色半透明 */
.notification {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    z-index: 1000;
    padding: 14px 25px;
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0.85);
    /* 黑色半透明背景 (85%透明度) */
    color: #f0f0f0;
    /* 浅灰色文字 (比纯白更柔和) */
    text-align: center;
    font-size: 15px;
    line-height: 1.4;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        top 0.3s ease;
    margin-top: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 显示状态 */
.notification.show {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
    top: 25px;
}

/* 隐藏状态（自动渐隐） */
.notification.hide {
    opacity: 0;
    transform: translateX(-50%) translateY(-15px);
    top: 15px;
}


/* 扩大ID按钮和连接按钮的宽度 */
#id-btn,
#connect-btn {
    width: 140px !important;
    /* 比默认大20px */
    padding: 8px 15px !important;
    /* 增加内边距 */
    font-size: 16px !important;
    /* 字体稍大 */
    border-radius: 6px !important;
    /* 圆角更柔和 */
    transition: all 0.2s ease !important;
}

/* 保持按钮在不同状态下的高度一致 */
#id-btn:hover,
#connect-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


.footer-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    /* background: #f8f9fa; */
    padding: 12px 0;
    text-align: center;
    font-size: 12px;
    color: #6c757d;
    z-index: 1000;
    /* border-top: 1px solid #e0e0e0; */
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.contact-info {
    font-size: 12px;
    color: #adb5bd;
    margin-top: 4px;
    opacity: 0.8;
}


.suggestions-list.show {
    display: block;
}

.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    padding: 4px 0;
}

.suggestions-list li {
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.suggestions-list li:hover {
    background: #f0f5ff;
}

.suggestions-list .no-history {
    color: #999;
    padding: 8px 12px;
    text-align: center;
    cursor: default;
}

.suggestions-list .history-prompt {
    padding: 3px 12px;
    color: #888;
    font-size: 12px;
    background: #ffffff;
    cursor: default !important;
    user-select: none !important;
    pointer-events: none !important;
    user-select: none;
    line-height: 1.2;
}