* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 100%;
    padding: 15px;
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
}

h2 {
    margin: 15px 0 10px;
    color: #34495e;
    font-size: 1.2rem;
}

h3 {
    margin: 10px 0 8px;
    color: #34495e;
    font-size: 1rem;
}

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

button {
    flex: 1;
    padding: 12px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

button:not(:disabled):hover {
    background-color: #2980b9;
}

.device-info, .data-section, .status {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.device-info p, .status p {
    margin: 5px 0;
}

#deviceName, #deviceId {
    font-weight: 500;
}

.data-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.send-data, .received-data {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: none;
    font-size: 0.9rem;
}

#sendData {
    min-height: 80px;
    font-family: monospace;
}

#receivedData {
    min-height: 120px;
    font-family: monospace;
    background-color: #f8f9fa;
}

#clearBtn {
    background-color: #e74c3c;
    padding: 8px 12px;
    font-size: 0.9rem;
}

#clearBtn:hover {
    background-color: #c0392b;
}

/* 不支持蓝牙浏览器的样式 */
.bluetooth-unsupported {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.bluetooth-unsupported h2 {
    color: #e74c3c;
    margin-bottom: 15px;
}

.bluetooth-unsupported ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.bluetooth-unsupported p {
    margin-bottom: 10px;
}

/* 设备列表样式 */
.device-list-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
}

.device-list-content {
    background-color: white;
    margin: 50px 20px;
    padding: 20px;
    border-radius: 8px;
    max-height: 70vh;
    overflow-y: auto;
}

.device-list-content h2 {
    margin-bottom: 15px;
    text-align: center;
}

.close-button {
    display: block;
    margin: 10px auto 15px;
}

.scanning-text {
    text-align: center;
    margin: 10px 0;
}

.retry-button {
    display: none;
    margin: 10px auto;
    background-color: #e74c3c;
}

.retry-button:hover {
    background-color: #c0392b;
}

.device-item {
    padding: 10px;
    border: 1px solid #ddd;
    margin-bottom: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.device-item:hover {
    background-color: #f8f9fa;
}

.device-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.device-id {
    font-size: 0.9rem;
    color: #666;
}

.error-text {
    color: #e74c3c;
    text-align: center;
    margin: 10px 0;
}

/* 响应式调整 */
@media (min-width: 768px) {
    .container {
        max-width: 600px;
        margin: 0 auto;
    }

    .controls {
        flex-direction: row;
    }
}