/* --- 基本樣式 --- */
body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    text-align: center;
    background-color: #0f0907;
    margin: 0;
    padding: 15px;
    color: #333;
}
h2 {
    color: #444;
}
h3 {
    color: #555;
    margin-top: 30px;
    border-top: 1px solid #232323;
    padding-top: 15px;
}
#conn-status {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9em;
    font-weight: bold;
    color: white;
    background-color: #281513;
    transition: background-color 0.5s ease;
    z-index: 100;
}
#conn-status.connected {
    background-color: #12261a;
}
#conn-status.connecting {
    background-color: #f39c12;
}
.controls-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 25px;
    margin: 20px auto;
    padding: 10px;
    max-width: 900px;
    min-height: 250px;
}
.loading-placeholder {
    color: #888;
    font-style: italic;
    width: 100%;
    text-align: center;
}
.loading-placeholder.error {
    color: #3b1f1d;
    font-weight: bold;
}

/* --- 通用 Control Wrapper 樣式 --- */
.control-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-color: #110b05;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}
.control-wrapper .control-name {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 600;
    height: 20px;
    overflow: hidden;
}
.control-wrapper .control-status {
    margin-top: 5px;
    font-size: 12px;
    font-weight: normal;
    min-height: 18px;
    color: #555;
}

#request-sensors-button {
    /* 如果需要的話 */
    padding: 10px 20px;
    font-size: 1em;
    /* --- 在這裡修改顏色 --- */
    color: #c5c5c5;       /* 示例：淺灰色文字 */
    background-color: #3a3f44; /* 示例：深灰色背景 */
    /* --------------------- */
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px;
    margin-bottom: 10px;
}
/* *** FIX: Change selector *** */
#request-sensors-button:hover {
    /* --- 在這裡修改懸停顏色 --- */
    background-color: #4a4f54; /* 示例：稍亮灰色 */
    /* color: #ffffff; */
    /* ----------------------- */
}
/* *** FIX: Change selector *** */
#request-sensors-button:disabled {
    /* --- 在這裡修改禁用顏色 --- */
    background-color: #2a2f34; /* 示例：更深禁用背景 */
    color: #6a6f74;       /* 示例：深灰禁用文字 */
    /* ----------------------- */
    cursor: not-allowed;
}

/* --- Log 樣式 --- */
.log {
    max-width: 700px;
    margin: 20px auto;
    padding: 15px;
    border: 1px solid #1e0808;
    height: 250px;
    overflow-y: auto;
    text-align: left;
    font-size: 0.04em;
    background-color: #150808;
    border-radius: 4px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    line-height: 1.6;
    color: #333;
}
#log p {
    margin: 1px 0;
    padding: 3px 5px;
    border-bottom: 1px dotted #08101a;
    word-wrap: break-word;
}
#log p:last-child {
    border-bottom: none;
}
.log .log-info {
    color: #2b2b2b;
}
.log .log-success {
    color: #0e1c14;
    font-weight: bold;
}
.log .log-error {
    color: #23100e;
    font-weight: bold;
}
.log .log-warning {
    color: #f39c12;
}
.log .log-mqtt {
    color: #070838;
}
.log .log-mqtt-raw {
    color: #2a2e2e;
    font-style: italic;
}
