:root {
    --bg-color: #202124;
    /* Google风格深灰背景 */
    --sidebar-bg: #303134;
    /* 侧边栏/卡片背景 */
    --content-bg: #303134;
    /* 内容背景 */
    --primary-color: #81c995;
    /* Google风格绿色作为主色 */
    --text-color: #e8eaed;
    /* 主要文字颜色 */
    --text-secondary-color: #9aa0a6;
    /* 次要文字颜色 */
    --border-color: #3c4043;
    /* 边框颜色 */
    --shadow-color: rgba(0, 0, 0, 0.3);
    /* 阴影颜色 */
    --status-good: #52c41a;
    --status-moderate: #faad14;
    --status-poor: #f5222d;
    --status-occupied: #f5222d;
    --status-free: #52c41a;
    --status-online: #52c41a;
    --status-offline: #f5222d;
    --chilled-water: #8ab4f8;
    --cooling-water: #f28b82;
}

body {
    font-family: 'Roboto', sans-serif;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.fixed-right {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.z-5000s {
    z-index: 50000;
}

.w-2wh {
    width: 0.3rem;
    height: 0.3rem;
}

@media (max-width: 430px) {

    /* 全局调整 */
    body {
        font-size: 14px;
    }

    /* 主内容区边距调整 */
    main {
        padding: 2px !important;
        /* 减小内边距 */
    }

    /* 头部调整 */
    header {
        padding: 4px 8px !important;
    }

    .app-header .text-lg {
        font-size: 16px !important;
    }

    .app-header .text-xs {
        font-size: 10px !important;
    }

    /* 隐藏部分次要信息 */
    .app-header span.hidden.sm\\:inline,
    .app-header div.text-right div:first-child {
        display: none !important;
    }

    /* 卡片布局调整 */
    .bg-slate-800 {
        padding: 12px !important;
    }

    .rounded-xl {
        border-radius: 8px !important;
    }

    /* 标题大小调整 */
    h2.text-3xl {
        font-size: 1.5rem !important;
    }

    h3.text-xl {
        font-size: 1.2rem !important;
    }

    h3.text-lg {
        font-size: 1.1rem !important;
    }

    /* 网格布局调整 */
    .grid {
        gap: 4px !important;
    }

    /* 按钮调整 */
    button {
        padding: 4px 8px !important;
        font-size: 12px !important;
    }

    /* 设备状态卡片 */
    .grid-cols-2.sm\\:grid-cols-5,
    .grid-cols-2.sm\\:grid-cols-3.lg\\:grid-cols-6 {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* 楼层控制区域 */
    .grid-cols-1.sm\\:grid-cols-5,
    .grid-cols-1.sm\\:grid-cols-3 {
        grid-template-columns: 1fr !important;
    }

    .grid-cols-1.sm\\:grid-cols-5>div,
    .grid-cols-1.sm\\:grid-cols-3>div {
        margin-bottom: 8px !important;
    }

    /* 侧边栏折叠状态优化 */
    .md\\:ml-20,
    .md\\:ml-64 {
        margin-left: 0 !important;
    }

    /* 图标大小调整 */
    .icon span {
        width: 16px !important;
        height: 16px !important;
    }

    /* .space-y-6{
                width: 100% !important;
            } */

    .space-y-8>div {
        width: 90%;
        margin: auto;

    }

    .space-y-6>div {
        width: 90%;
        margin: auto;

    }

    .fcucard {
        width: 100% !important;
    }

    .fcucard>div {
        width: 90%;
        margin: auto;
        margin-bottom: 20px;
    }

    .text-right>div {
        text-align: left;
    }

    .brss {
        width: 40px;
    }

    .busston {
        width: 100px;

        border: 1px solid;
    }
}

/* 添加浅色字体样式 */
.light-text {
    color: #cbd5e1 !important;
}

/* 白色字体样式 */
.white-text {
    color: white !important;
}



.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.content-header .title-group {
    display: flex;
    align-items: center;
}

.back-button {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 20px;
    cursor: pointer;
    margin-right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.back-button:hover {
    background-color: rgba(129, 201, 149, 0.1);
}

.content-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.content-header p {
    font-size: 16px;
    color: var(--text-secondary-color);
    margin: 0;
}

.header-controls {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-left: auto;
}

.header-info {
    flex-shrink: 0;
    text-align: right;
    color: var(--text-secondary-color);
}

.location {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 8px;
    font-size: 16px;
}

.location svg {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    fill: currentColor;
}

.time {
    font-size: 14px;
    font-weight: 500;
}

.ai-analysis-button {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.ai-analysis-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.ai-analysis-button:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
}


/* --- 空间占用特定样式 --- */
.occupancy-section {
    margin-bottom: 30px;
}

.occupancy-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
    padding-bottom: 8px;
}

.occupancy-section-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.occupancy-section-header .ai-analysis-button {
    padding: 6px 12px;
    font-size: 12px;
}

.ranking-card {
    background: linear-gradient(45deg, var(--sidebar-bg), #3c4043);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--primary-color);
    cursor: pointer;
    transition: all 0.2s;
}

.ranking-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.ranking-icon {
    font-size: 40px;
    color: #fdd835;
    /* Gold color for crown */
}

.ranking-info .ranking-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.ranking-info .ranking-badge {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 500;
    margin-top: 4px;
}


.occupancy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
}





.name-input {
    background-color: var(--bg-color);
    border: 1px solid var(--primary-color);
    color: var(--text-color);
    text-align: center;
    border-radius: 4px;
    padding: 3px 4px;
    width: 90%;
    font-size: 14px;
    font-weight: 500;
    margin-top: 8px;
}

.name-input:focus {
    outline: none;
    box-shadow: 0 0 5px rgba(129, 201, 149, 0.5);
}






.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--content-bg);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-card.clickable {
    cursor: pointer;
    transition: all 0.2s;
}

.stat-card.clickable:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px var(--shadow-color);
    border-color: var(--primary-color);
}

.stat-card.ai-analysis-card {
    cursor: pointer;
    transition: all 0.2s;
    background: linear-gradient(45deg, var(--sidebar-bg), #3c4043);
}

.stat-card.ai-analysis-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px var(--shadow-color);
    border-color: var(--primary-color);
}

.stat-card.ai-analysis-card .value {
    font-size: 48px;
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-card.ai-analysis-card .label {
    font-weight: 500;
    color: var(--text-secondary-color);
}

.stat-card .label {
    font-size: 14px;
    color: var(--text-secondary-color);
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-card .value .unit {
    font-size: 14px;
    font-weight: normal;
}

.chart-section {
    background-color: var(--content-bg);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

/* --- Chart Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--sidebar-bg);
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 10px 30px var(--shadow-color);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.modal-content.modal-content-large {
    max-width: 1000px;
    /* Larger modal for AI analysis */
}

.modal-body {
    overflow-y: auto;
    max-height: 70vh;
    padding-right: 10px;
    /* for scrollbar */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    color: var(--text-color);
}

.modal-header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.chart-toggle {
    display: flex;
    gap: 10px;
}

.chart-toggle button {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary-color);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.chart-toggle button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.chart-toggle button.active {
    background-color: var(--primary-color);
    color: #202124;
    border-color: var(--primary-color);
    font-weight: 500;
}

.close-button {
    background: none;
    border: none;
    color: var(--text-secondary-color);
    font-size: 30px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close-button:hover {
    color: var(--primary-color);
}

.download-button {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: auto;
}

.download-button:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
}

/* --- AI Analysis Modal Content --- */
.ai-analysis-content h3 {
    color: var(--primary-color);
    font-size: 18px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-top: 20px;
    margin-bottom: 12px;
}

.ai-analysis-content h3:first-of-type {
    margin-top: 0;
}

.ai-analysis-content p {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary-color);
    text-align: justify;
    margin-bottom: 16px;
}

.ai-analysis-content strong {
    color: var(--text-color);
    font-weight: 500;
}

.ai-analysis-content ul {
    list-style-type: disc;
    padding-left: 20px;
    line-height: 1.8;
}

.ai-analysis-content li {
    margin-bottom: 10px;
}

.ranking-ai-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}


.axis-text {
    font-size: 12px;
    fill: var(--text-secondary-color);
}

.bar-chart-container {
    width: 100%;
    height: 300px;
    margin-top: 20px;
}

.daily-timeline-container {
    width: 100%;
    height: 100px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.month-container {
    background-color: var(--bg-color);
    padding: 15px;
    border-radius: 8px;
}

.month-name {
    text-align: center;
    font-weight: 500;
    margin-bottom: 10px;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    font-size: 10px;
    color: var(--text-secondary-color);
    text-align: center;
    margin-bottom: 5px;
}

.day-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.day-cell {
    font-size: 12px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.future-day {
    opacity: 0.6;
    /* 未来日期稍微透明 */
    cursor: default;
    /* 未来日期鼠标指针不变手型 */
}

.day-cell.has-data {
    background-color: var(--border-color);
    cursor: pointer;
}

.day-cell.future-day.has-data {
    background-color: transparent;
    /* 未来日期即使有数据也不显示阴影 */
}

.day-cell.has-data:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ranking-list-item {
    display: flex;
    align-items: center;
    background-color: var(--bg-color);
    padding: 12px 16px;
    border-radius: 8px;
}

.ranking-list-item .rank {
    font-size: 16px;
    font-weight: bold;
    color: var(--primary-color);
    width: 40px;
    text-align: center;
}

.ranking-list-item .name {
    flex-grow: 1;
    font-size: 16px;
    padding-left: 16px;
}

.ranking-list-item .duration {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary-color);
}

.yearly-calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 14px;
}









.day-cell {
    text-align: center;
    padding: 6px 0;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
}



.day-cell.current-day {
    background-color: #3b82f6;
    color: white;
    font-weight: bold;
}

.day-cell:hover {
    background-color: #475569;
}


/* 图表弹窗遮罩层 */
.chart-modal-mask {
    position: absolute;
    top: -1.5rem;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 弹窗容器 */
.chart-modal-container {
    width: 80%;
    max-width: 1000px;
    background: #303134;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 弹窗头部 */
.chart-modal-header {
    padding: 16px 24px;
    /* border-bottom: 1px solid #e5e7eb; */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-modal-header h3 {
    font-size: 24px;
    font-weight: 600;
    color: #e8eaed;
    margin: 0;
}

/* 关闭按钮 */
.chart-modal-close {
    border: none;
    background: transparent;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.chart-modal-close:hover {
    color: #333;
}

/* 弹窗内容区 */
.chart-modal-body {
    padding: 0 24px 24px 24px;
}

/* 点击卡片 hover 效果（增强交互） */
.stat-card.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.stat-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

