/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    overflow: auto;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow: auto;
    color: #333;
    background: url('https://alist.sunmx.top/d/%E7%BD%91%E7%AB%99%E7%B4%A0%E6%9D%90/%E8%83%8C%E6%99%AF.jpg') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    padding-top: 20px;
    padding-bottom: 50px;
}

/* 背景遮罩 */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: -1;
    will-change: transform;
}

/* 主容器 */
.container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 90%;
    max-width: 500px;
    z-index: 1;
    margin-top: 20px;
    margin-bottom: 50px;
}

/* 状态卡片 */
.status-card {
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 10px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    color: #333;
    letter-spacing: 1px;
}

rt {
    font-size: 0.4em;
    font-weight: normal;
}

/* 状态部分 */
.status-section {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 15px 0 25px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

/* 状态指示器 */
.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.status-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

.status-text {
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.5px;
}

/* 状态描述 */
.status-description {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 25px;
    color: #555;
    line-height: 1.5;
}

/* 设备状态 */
.device-status {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.device-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    transition: background-color 0.3s ease;
}

.device-item:hover {
    background-color: rgba(255, 255, 255, 0.7);
}

.device-icon {
    font-size: 1.5rem;
    margin-right: 15px;
}

.device-label {
    font-weight: 500;
    flex-grow: 1;
}

.device-value {
    font-weight: 700;
    color: #333;
}

/* 信息卡片 */
.info-card {
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

/* 最后更新时间 */
.last-update {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.refresh-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 15px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.refresh-btn:hover {
    background-color: #3a7bc8;
}

.refresh-btn.refreshing {
    background-color: #95a5a6;
    cursor: not-allowed;
    opacity: 0.7;
}

.refresh-btn.refreshing:hover {
    background-color: #95a5a6;
}

/* 底部链接 */
.footer-links {
    text-align: center;
}

.footer-links p {
    margin-bottom: 15px;
    color: #555;
}

.links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.contact-link, .site-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.contact-link {
    color: #2ecc71;
    background-color: rgba(46, 204, 113, 0.1);
}

.contact-link:hover {
    background-color: rgba(46, 204, 113, 0.2);
}

.site-link {
    color: #3498db;
    background-color: rgba(52, 152, 219, 0.1);
}

.site-link:hover {
    background-color: rgba(52, 152, 219, 0.2);
}

.links svg {
    width: 20px;
    height: 20px;
}

/* 评论区折叠样式 */
.comment-card {
    overflow: visible;
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
}

.comment-card .title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    padding: 15px 25px;
    margin: 0;
    border-radius: 20px 20px 0 0;
    transition: background-color 0.3s ease;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.comment-card .title:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* 药丸开关样式 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 45px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4a90e2;
}

input:checked + .slider:before {
    transform: translateX(21px);
}

/* 初始化开关状态 */
.comment-card:not(.collapsed) #commentSwitch {
    checked: true;
}

#commentContent {
    max-height: 0;
    height: auto;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    display: block;
    position: relative;
    z-index: 0;
    flex-grow: 1;
    align-self: stretch;
    transform-origin: top;
    transform: scaleY(0);
    width: 100%;
    padding: 0 20px;
    margin: 0;
}

#commentContent #waline {
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

/* Waline评论组件样式调整 */
#waline {
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

#waline .wl-btn {
    border-radius: 6px !important;
    margin: 0 !important;
    padding: 6px 12px !important;
}

#waline .wl-panel {
    border-radius: 8px !important;
    margin: 0 !important;
    padding: 10px !important;
}

#waline .wl-header {
    border-radius: 8px !important;
    margin: 0 !important;
    padding: 10px !important;
}

#waline .wl-editor {
    border-radius: 8px !important;
    margin: 0 !important;
    padding: 10px !important;
}

#waline .wl-preview {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-footer {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-action {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-meta {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-sort {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-power {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-count {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-card {
    border-radius: 8px !important;
    margin: 0 !important;
    padding: 10px !important;
}

#waline .wl-content {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-info {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-login-info {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-textarea {
    border-radius: 8px !important;
    margin: 0 !important;
    padding: 10px !important;
    border: 1px solid #ddd !important;
}

#waline .wl-input {
    border-radius: 8px !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    border: none !important;
    outline: none !important;
}

#waline .wl-select {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-checkbox {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-radio {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-submit {
    border-radius: 6px !important;
    margin: 0 !important;
    padding: 6px 12px !important;
}

#waline .wl-cancel {
    border-radius: 6px !important;
    margin: 0 !important;
    padding: 6px 12px !important;
}

#waline .wl-reply {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-like {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-share {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-report {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-delete {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-admin {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-user {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-guest {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-nick {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-mail {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-link {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-avatar {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-emoji {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-image {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-sticker {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#waline .wl-gif {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.comment-card:not(.collapsed) #commentContent {
    opacity: 1;
    transform: scaleY(1);
    max-height: 2000px; /* 设置一个足够大的值，确保内容能够完全显示 */
    padding: 0 20px;
}



/* 状态颜色 */
.sleeping {
    color: #95a5a6;
    background-color: #95a5a6;
}

.awake {
    color: #2ecc71;
    background-color: #2ecc71;
}

.class {
    color: #fff700;
    background-color: #fff700;
}

.error {
    color: #e74c3c;
    background-color: #e74c3c;
}



/* 响应式设计 */
/* 当屏幕宽度小于等于 675px 时，调整以下元素样式以适应小屏幕 */
@media (max-width: 675px) {
    /* 确保 body 保持 flex 布局 */
    body {
        display: flex;
    }
    
    /* 增大容器宽度以充分利用小屏幕空间 */
    .container {
        width: 95%;
    }
    
    /* 减小标题字体大小，避免在小屏幕上显示溢出 */
    .header h1 {
        font-size: 2rem;
    }
    
    /* 减小状态文本字体大小，适应小屏幕布局 */
    .status-text {
        font-size: 1.3rem;
    }
    
    /* 减小设备项内边距，节省空间 */
    .device-item {
        padding: 10px;
    }
    
    /* 将链接布局改为垂直排列，避免在小屏幕上水平溢出 */
    .links {
        flex-direction: column;
        gap: 10px;
    }
    
    /* 使链接内容居中显示，提升小屏幕下的视觉效果 */
    .contact-link, .site-link {
        justify-content: center;
    }
}

/* 当屏幕宽度小于等于 480px 时，进一步调整以下元素样式以适配更小屏幕 */
@media (max-width: 480px) {
    /* 减小状态卡片和信息卡片的内边距，节省屏幕空间 */
    /* .status-card, .info-card {
        padding: 20px;
    } */
    
    /* 再次减小标题字体大小，适配更小屏幕 */
    .header h1 {
        font-size: 1.8rem;
    }
    
    /* 再次减小状态文本字体大小，适配更小屏幕 */
    .status-text {
        font-size: 1.2rem;
    }
    
    /* 减小设备图标字体大小，适配更小屏幕 */
    .device-icon {
        font-size: 1.3rem;
    }
}