/*
WARNING: 不要使用格式化代码 (本文件内) / DON'T USE CODE FORMATTER HERE
*/

html {
    font-size: 25px;
    overflow: auto; /* 添加此行 */
}

rt {
    font-size: 0.6em;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: auto; /* 添加此行 */
}

a {
    display: inline-block;
    text-decoration: none;
}

p {
    font-size: 18px;
}

h1, h2 {
    text-align: left;
}

h1 {
    margin-bottom: 16px;
    font-size: 1.25em;
}

h2 {
    margin: 16px 0 4px 0;
    font-weight: 500;
    font-size: 0.9em;
}

body {
    /* 背景图由 CSS 直接加载，JS 仅用于记录链接 */
    background: url('/background_image?mode=cached') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ddd;
}

hr {
    border: none;
    height: 2px;
    background-color: rgba(0, 0, 0, 0.1);
    margin: 16px 0;
}

.card {
    padding: 44px 56px;

    background-color: rgba(250, 250, 250, 0.5);
    border-radius: 8px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1876);
    backdrop-filter: blur(60px);

    transition: all 0.15s;
}

.card:hover {
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.28);
}

.card .wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.setting-card {
    display: flex;
    padding: 13px 15px;
    border-radius: 8px;
    justify-content: space-between;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(0, 0, 0, 0.08);
    gap: 16px;

    transition: all 0.15s;
}

.setting-card:hover {
    opacity: 0.88;
}

.setting-card .left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.setting-card h3 {
    font-weight: normal;
    font-size: 18px;
}

.setting-card .left a, .setting-card .left p {
    color: rgba(0, 0, 0, 0.6);
    font-size: 16px;
}

.setting-card .right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.link {
    padding: 5px 6px;
    font-weight: 500;
    color: #005fb8;
    text-decoration: none;
    white-space: nowrap;
    font-size: 17px;
    border-radius: 5px;
}

.link:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.link svg {
    fill: #005fb8;
    width: 15px;
}


.container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

@media (max-width: 500px) {
    .setting-card {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 675px) {
    .container {
        /*min-width: 600px;*/
        width: 90%;
    }

    .card {
        padding: 40px;
    }
}

@media (min-width: 676px) {
    .container {
        min-width: 600px;
        width: 50%;
    }
}

/* 以下为各种状态的颜色 */

.sleeping {
    color: gray;
    background-color: #f0f0f0;
}

.awake {
    color: #0f7b0f;
    background-color: #DFF6DD;
}

.error {
    color: #c42b1c;
    background-color: #fde7e9;
}

.device-status-using {
    color: #005fb8;
}

.device-status-unused {
    color: gray;
}

#device-status {
    text-align: center;
}

#last-updated {
    margin-top: 32px;
}

.bg-info {
    position: fixed;
    right: 18px;
    bottom: 16px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.bg-info a {
    color: inherit;
    word-break: break-all;
    max-width: 260px;
    display: inline-block;
}

#status {
    font-size: 0.7em;
    padding: 4px 12px;
    border-radius: 8px;
    border: 2px solid rgba(0, 0, 0, 0.06);
    white-space: nowrap;
}

/* 留言板下拉菜单 */
.messages-dropdown {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.messages-toggle-btn {
    padding: 10px 20px;
    background-color: rgba(250, 250, 250, 0.5);
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(60px);
    transition: all 0.2s;
}

.messages-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.messages-dropdown-content {
    display: none;
    position: absolute;
    top: 50px;
    right: 0;
    width: 400px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 100px);
    background-color: rgba(250, 250, 250, 0.5);
    border-radius: 8px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(60px);
    overflow: hidden;
    flex-direction: column;
}

.messages-dropdown-content.show {
    display: flex;
}

.messages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.messages-header h3 {
    font-size: 16px;
    margin: 0;
}

.messages-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.messages-close-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #333;
}

.messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px 20px;
    max-height: 400px;
}

.messages-list > div {
    padding: 10px;
    margin-bottom: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    border-left: 3px solid #005fb8;
}

.messages-list > div > div:first-child {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.messages-list strong {
    color: #005fb8;
    font-size: 13px;
}

.messages-list span {
    font-size: 11px;
    color: #888;
}

.messages-list > div > div:last-child {
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 13px;
    line-height: 1.5;
}

.messages-form {
    padding: 15px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.message-input, .message-textarea {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
}

.message-textarea {
    resize: none;
    font-family: inherit;
    padding-bottom: 8px;
}
.message-textarea::-webkit-resizer {
    width: 15px;
    height: 15px;
    border: none;
    background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.25) 50%);
}
.message-textarea::-webkit-scrollbar {
    width: 6px;
}

.message-submit-btn {
    width: 100%;
    padding: 10px;
    background-color: #005fb8;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.message-submit-btn:hover {
    background-color: #004a94;
}

.message-submit-btn:disabled {
    background-color: #999;
    cursor: not-allowed;
}

.message-status {
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
    color: #888;
}
.message-textarea {
    resize: none;
    font-family: inherit;
    padding-bottom: 24px;
    padding-top: 12px;
    position: relative;
}
.message-textarea::-webkit-resizer {
    display: none;
}
.message-textarea-wrapper {
    position: relative;
}
.message-resize-handle {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 18px;
    width: 72px;
    height: 12px;
    cursor: ns-resize;
    touch-action: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.message-resize-handle::before {
    content: '';
    width: 100%;
    height: 4px;
    border-radius: 999px;
    display: block;
    background-image: linear-gradient(90deg, rgba(255,255,255,0.95), rgba(0,0,0,0.2), rgba(255,255,255,0.95)),
                      linear-gradient(0deg, rgba(255,255,255,0.97), rgba(0,0,0,0.15), rgba(255,255,255,0.97));
}
.messages-form {
    position: relative;
}

@media (max-width: 500px) {
    .messages-dropdown-content {
        width: calc(100vw - 40px);
        right: -10px;
    }
    .message-textarea {
        font-size: 16px;
        padding: 12px;
        min-height: 120px;
    }
    .message-input {
        font-size: 16px;
        padding: 12px;
    }
}

/* 不建议删除上面的 .sleeping .awake .error 三个默认颜色 */