/* ===== 全局动画定义 ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(37, 99, 235, 0.3); }
    50% { box-shadow: 0 0 15px rgba(37, 99, 235, 0.6); }
}

@keyframes colorShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bounceInCenter {
    0% { 
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ===== MQTT配置弹窗样式 ===== */
.mqtt-config-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: none;
}
.mqtt-config-modal.show {
    display: block;
}
.modal-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}
.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 
                0 0 40px rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(255,255,255,0.8);
    overflow: hidden;
    animation: bounceInCenter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 2px solid #f0f2f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-title {
    font-size: 18px;
    color: #1f2937;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
}
.modal-close {
    font-size: 28px;
    color: #64748b;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-close:hover {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    color: #ffffff;
    transform: rotate(90deg);
}
.modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
}
.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #495057;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e6ed;
    border-radius: 10px;
    font-size: 14px;
    color: #1f2937;
    transition: all 0.3s ease;
    background: #f8fafc;
}
.form-group input:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    transform: translateY(-2px);
}
.form-group input::placeholder {
    color: #94a3b8;
}
.modal-footer {
    padding: 16px 24px;
    border-top: 2px solid #f0f2f5;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: rgba(248, 250, 252, 0.5);
}
.btn {
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.2);
    transition: left 0.4s ease;
    z-index: -1;
}

.btn:hover::before {
    left: 100%;
}

.btn-test {
    background: linear-gradient(135deg, #f8fafc, #f0f4f8);
    color: #495057;
    border: 2px solid #e0e6ed;
}
.btn-test:hover {
    background: linear-gradient(135deg, #f0f4f8, #e8f0f8);
    color: #1f2937;
    border-color: #2563eb;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.15);
    transform: translateY(-2px);
}
.btn-save {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}
.btn-save:hover {
    background: linear-gradient(135deg, #1d4ed8, #153db0);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
    transform: translateY(-3px);
}
.btn-apply {
    background: linear-gradient(135deg, #27ae60, #219653);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}
.btn-apply:hover {
    background: linear-gradient(135deg, #219653, #1a7d47);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
    transform: translateY(-3px);
}

/* ===== 关于系统弹窗 ===== */
.about-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: none;
}
.about-modal.show {
    display: block;
}

.about-content {
    padding: 24px;
    max-height: 65vh;
    overflow-y: auto;
}

.system-info {
    text-align: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f2f5;
}

.system-info h4 {
    font-size: 22px;
    color: #1f2937;
    margin: 0 0 8px 0;
    font-weight: 700;
}

.system-info .version {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.system-info .version span {
    font-weight: 700;
    color: #2563eb;
    font-size: 16px;
}

.about-section {
    margin-bottom: 24px;
}

.about-section h5 {
    font-size: 16px;
    color: #1f2937;
    margin: 0 0 12px 0;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.about-section p {
    margin: 0;
    color: #495057;
    font-size: 14px;
    line-height: 1.6;
    text-align: justify;
}

.features-list {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.features-list li {
    color: #495057;
    font-size: 14px;
    line-height: 2;
    margin: 0;
    padding-left: 24px;
    position: relative;
}

.features-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #2563eb;
    font-weight: bold;
}

.features-list strong {
    color: #1f2937;
    font-weight: 600;
}

.about-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid #f0f2f5;
}

/* 移动端弹窗适配 */
@media (max-width: 500px) {
    .modal-content {
        width: 95%;
    }
    .modal-footer {
        flex-wrap: wrap;
        justify-content: center;
    }
    .btn {
        flex: 1;
        min-width: 100px;
    }
    
    .about-content {
        padding: 20px;
        max-height: 70vh;
    }
    
    .system-info h4 {
        font-size: 18px;
    }
    
    .about-section h5 {
        font-size: 15px;
    }
    
    .about-section p,
    .features-list li {
        font-size: 13px;
    }
}

/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "SimHei", sans-serif;
}

body {
    background: linear-gradient(135deg, #f9fafb 0%, #f0f4f8 100%);
    width: 100vw;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 15px 0;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    min-height: 100vh;
}

.container {
    width: 95%;
    max-width: 1440px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 30px 25px;
    margin: 0 auto;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.08), 
                0 0 50px rgba(37, 99, 235, 0.05);
    border: 1px solid rgba(255,255,255,0.8);
    animation: slideInUp 0.6s ease;
}

/* ===== 标题容器 ===== */
.title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 40px 0;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f2f5;
    position: relative;
    min-height: 70px;
    animation: fadeIn 0.8s ease 0.2s backwards;
}
.menu-container {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 20;
}
.hamburger-menu {
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #f8fafc, #f0f4f8);
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.hamburger-menu:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: #2563eb;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
    transform: translateY(-3px);
}

.hamburger-menu:hover .hamburger-line {
    background-color: #ffffff;
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background-color: #1f2937;
    border-radius: 1px;
    transition: all 0.3s ease;
}
.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
}
.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #f0f2f5;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.12), 
                0 0 30px rgba(37, 99, 235, 0.08);
    list-style: none;
    padding: 8px 0;
    display: none;
    z-index: 19;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(8px);
}
.dropdown-menu.show {
    display: block;
}
.dropdown-item {
    padding: 14px 20px;
    color: #1f2937;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: block;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    left: -100%;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    transition: left 0.3s ease;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.04));
    color: #2563eb;
    padding-left: 24px;
}

.dropdown-item:hover::before {
    left: 100%;
}

.dropdown-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #f0f2f5, transparent);
    margin: 8px 0;
}
.title-wrapper {
    text-align: center;
    display: inline-block;
    padding: 0;
    margin: 0;
}
.main-title {
    font-size: 32px;
    color: #1f2937;
    font-weight: 700;
    letter-spacing: 1.5px;
    line-height: 1.2;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #1f2937 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.last-char {
    position: relative;
    display: inline-block;
}
.status {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    position: absolute;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
    transform: translateY(-50%);
}
.status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #27ae60;
    border: 2px solid #f0f9f4;
    transition: all 0.3s ease;
    animation: glow 2s ease-in-out infinite;
}
.status.disconnected .status-dot {
    background-color: #e74c3c;
    border-color: #ffebee;
    animation: glow 1s ease-in-out infinite;
}
.status-text {
    font-size: 15px;
    color: #495057;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    font-weight: 500;
}
.status:hover .status-text {
    visibility: visible;
    opacity: 1;
}
.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin: 0 0 20px 0;
    animation: slideInUp 0.6s ease 0.3s backwards;
}
.data-card {
    padding: 25px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f0f4f8 100%);
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08), 
                0 0 20px rgba(37, 99, 235, 0.04);
    border: 2px solid #f0f2f5;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.data-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.data-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.12), 
                0 0 30px rgba(37, 99, 235, 0.15);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-color: #2563eb;
}

.data-card:hover::before {
    opacity: 1;
}

.data-card h3 {
    color: #64748b;
    margin-bottom: 18px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}
.data-value {
    font-size: 34px;
    font-weight: bold;
    color: #1f2937;
    transition: all 0.8s ease-in-out;
    display: inline-block;
    position: relative;
    z-index: 1;
}
.data-value.changed {
    animation: pulse 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); color: #2563eb; }
    100% { transform: scale(1); }
}

.unit {
    font-size: 16px;
    color: #64748b;
    margin-left: 8px;
    position: relative;
    z-index: 1;
}

/* ===== 温度卡片增强样式 ===== */

/* 温度卡片容器 */
.temp-card {
    padding: 28px 24px !important;
    position: relative;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.temp-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.temp-card:hover::before {
    opacity: 1;
}

/* 温度卡片头部 */
.temp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.temp-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.temp-icon {
    font-size: 24px;
    animation: float 3s ease-in-out infinite;
}

/* 温度主显示 */
.temp-main-display {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 16px;
}

.temp-value-wrapper {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.temp-value {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.temp-unit {
    font-size: 20px;
    font-weight: 600;
    opacity: 0.8;
}

.temp-value.changed {
    animation: scaleBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleBounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* 温度状态 */
.temp-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.temp-level {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}

.temp-trend {
    font-size: 20px;
    transition: transform 0.4s ease;
    display: inline-block;
}

.temp-trend.up {
    color: #e65100;
    transform: rotate(45deg);
}

.temp-trend.down {
    color: #0277bd;
    transform: rotate(-45deg);
}

.temp-trend.stable {
    color: #64748b;
    transform: rotate(0deg);
}

/* 温度进度条 */
.temp-progress-bar {
    margin: 20px 0;
}

.progress-track {
    position: relative;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: linear-gradient(90deg, #4dd0e1 0%, #2196F3 25%, #FF9800 75%, #f44336 100%);
}

.progress-marker {
    position: absolute;
    top: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    background: rgba(0, 0, 0, 0.2);
    transform: translateX(-50%);
}

.progress-marker.cold {
    left: 0%;
}

.progress-marker.normal {
    left: 50%;
}

.progress-marker.hot {
    left: 100%;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: rgba(0, 0, 0, 0.5);
    font-weight: 600;
}

/* 温度详细信息 */
.temp-details {
    padding: 16px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    animation: slideInUp 0.5s ease 0.1s backwards;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.detail-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.detail-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.detail-change-rate {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    font-size: 12px;
}

.change-label {
    font-weight: 600;
    color: rgba(0, 0, 0, 0.6);
}

.change-value {
    font-weight: 700;
    font-family: 'Monaco', 'Courier New', monospace;
    color: #2563eb;
}

/* 温度颜色变化 */
#temperatureCard.temp-cold {
    background: linear-gradient(135deg, #e0f2ff 0%, #b3d9ff 100%);
    box-shadow: 0 10px 30px rgba(77, 208, 225, 0.25), 
                0 0 40px rgba(77, 208, 225, 0.15);
}

#temperatureCard.temp-cold .temp-header h3,
#temperatureCard.temp-cold .temp-level {
    color: #01579b;
}

#temperatureCard.temp-cold .temp-value {
    color: #0277bd;
}

#temperatureCard.temp-normal {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
}

#temperatureCard.temp-normal .temp-header h3,
#temperatureCard.temp-normal .temp-level {
    color: #495057;
}

#temperatureCard.temp-normal .temp-value {
    color: #1f2937;
}

#temperatureCard.temp-hot {
    background: linear-gradient(135deg, #ffe8cc 0%, #ffd699 100%);
    box-shadow: 0 10px 30px rgba(255, 152, 0, 0.25), 
                0 0 40px rgba(255, 152, 0, 0.15);
}

#temperatureCard.temp-hot .temp-header h3,
#temperatureCard.temp-hot .temp-level {
    color: #e65100;
}

#temperatureCard.temp-hot .temp-value {
    color: #e65100;
}

/* ===== 其他卡片增强样式 ===== */

/* 通用卡片容器 */
.humidity-card,
.wind-card,
.illumination-card {
    padding: 28px 24px !important;
    position: relative;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.humidity-card::before,
.wind-card::before,
.illumination-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.humidity-card:hover::before,
.wind-card:hover::before,
.illumination-card:hover::before {
    opacity: 1;
}

/* 卡片头部 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.card-icon {
    font-size: 24px;
    animation: float 3s ease-in-out infinite;
}

/* 卡片主显示 */
.card-main-display {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 16px;
}

.card-value-wrapper {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.card-value {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-unit {
    font-size: 20px;
    font-weight: 600;
    opacity: 0.8;
}

.card-value.changed {
    animation: scaleBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 卡片状态 */
.card-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.card-level {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}

.card-trend {
    font-size: 20px;
    transition: transform 0.4s ease;
    display: inline-block;
}

.card-trend.up {
    color: #e65100;
    transform: rotate(45deg);
}

.card-trend.down {
    color: #0277bd;
    transform: rotate(-45deg);
}

.card-trend.stable {
    color: #64748b;
    transform: rotate(0deg);
}

/* 卡片进度条 */
.card-progress-bar {
    margin: 20px 0;
}

/* 卡片详细信息 */
.card-details {
    padding: 16px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    animation: slideInUp 0.5s ease 0.1s backwards;
}

/* 湿度卡片颜色 */
#humidityCard {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.25), 
                0 0 40px rgba(76, 175, 80, 0.15);
}

#humidityCard .card-header h3,
#humidityCard .card-level {
    color: #1b5e20;
}

#humidityCard .card-value {
    color: #388e3c;
}

#humidityCard .progress-fill {
    background: linear-gradient(90deg, #4dd0e1 0%, #2196F3 50%, #4caf50 100%);
}

/* 风速卡片颜色 */
#windSpeedCard {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    box-shadow: 0 10px 30px rgba(33, 150, 243, 0.25), 
                0 0 40px rgba(33, 150, 243, 0.15);
}

#windSpeedCard .card-header h3,
#windSpeedCard .card-level {
    color: #0d47a1;
}

#windSpeedCard .card-value {
    color: #1976d2;
}

#windSpeedCard .progress-fill {
    background: linear-gradient(90deg, #4dd0e1 0%, #2196F3 50%, #bbdefb 100%);
}

/* 光照强度卡片颜色 */
#illuminationCard {
    background: linear-gradient(135deg, #fff8e1 0%, #ffe082 100%);
    box-shadow: 0 10px 30px rgba(255, 193, 7, 0.25), 
                0 0 40px rgba(255, 193, 7, 0.15);
}

#illuminationCard .card-header h3,
#illuminationCard .card-level {
    color: #f57f17;
}

#illuminationCard .card-value {
    color: #fbc02d;
}

#illuminationCard .progress-fill {
    background: linear-gradient(90deg, #ffeb3b 0%, #ffc107 50%, #ff9800 100%);
}

/* 移动端适配 */
@media (max-width: 500px) {
    .temp-card {
        padding: 20px 16px !important;
    }
    
    .humidity-card,
    .wind-card,
    .illumination-card {
        padding: 20px 16px !important;
    }

    .temp-value {
        font-size: 40px;
    }

    .temp-unit {
        font-size: 18px;
    }

    .temp-header {
        margin-bottom: 12px;
    }

    .temp-main-display {
        margin-bottom: 16px;
    }

    .card-value {
        font-size: 40px;
    }

    .card-unit {
        font-size: 18px;
    }

    .card-header {
        margin-bottom: 12px;
    }

    .card-main-display {
        margin-bottom: 16px;
    }

    .details-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .detail-item {
        padding: 8px;
    }

    .detail-value {
        font-size: 16px;
    }
}

.charts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 0 0 30px 0;
    width: 100%;
    min-width: 0;
    animation: slideInUp 0.6s ease 0.4s backwards;
}
.chart-container {
    width: 100%;
    height: 420px;
    padding: 10px;
    background: linear-gradient(135deg, #f8fafc 0%, #f0f4f8 100%);
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08), 
                0 0 20px rgba(37, 99, 235, 0.04);
    border: 2px solid #f0f2f5;
    min-height: 420px;
    transition: all 0.3s ease;
    position: relative;
}

.chart-container:hover {
    box-shadow: 0 12px 28px rgba(0,0,0,0.12), 
                0 0 30px rgba(37, 99, 235, 0.1);
    border-color: #e0e6ed;
}
@media (min-width: 1024px) {
    .container {
        max-width: 1600px;
        width: 90%;
    }
    .main-title {
        font-size: 36px;
    }
    .chart-container {
        height: 480px;
        min-height: 480px;
        padding: 15px;
    }
    .data-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }
    .data-card {
        min-width: 220px;
        padding: 30px 25px;
    }
    :root {
        --dot-margin: 18px;
    }
}
@media (min-width: 1440px) {
    .main-title {
        font-size: 38px;
    }
    .chart-container {
        height: 500px;
        min-height: 500px;
    }
}
@media (max-width: 767px) {
    .main-title {
        font-size: 30px;
    }
    .charts-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .chart-container {
        height: calc(85vw);
        min-height: 500px;
        padding: 10px;
    }
    .status-dot {
        width: 12px;
        height: 12px;
    }
    .status-text {
        font-size: 13px;
    }
    :root {
        --dot-margin: 15px;
    }
    .hamburger-menu {
        width: 36px;
        height: 36px;
    }
    .menu-container {
        top: 41%;
    }
    .dropdown-menu {
        width: 200px;
    }
}
@media (max-width: 500px) {
    .main-title {
        font-size: 28px;
    }
    .data-grid {
        grid-template-columns: 1fr;
    }
    .chart-container {
        height: calc(90vw);
        min-height: 480px;
    }
    :root {
        --dot-margin: 12px;
    }
}

:root {
    --dot-margin: 20px;
}

/* ===== 加载和动态效果 ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(37, 99, 235, 0.3); }
    50% { box-shadow: 0 0 15px rgba(37, 99, 235, 0.6); }
}

@keyframes colorShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 按钮加载状态样式 */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    animation: shimmer 1.5s infinite;
}

/* ===== 加载指示器 ===== */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ===== 数据卡片加载骨架屏 ===== */
.data-card.loading {
    background: linear-gradient(90deg, 
        #f0f4f8 0%, 
        #f8fafc 50%, 
        #f0f4f8 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.data-card.loading .data-value,
.data-card.loading h3 {
    color: transparent;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}