@charset "UTF-8";

/**
 * Fancy Custom Shortcodes - Styles
 * 
 * This file contains styles for all shortcodes:
 * - IQ Chart: Interactive chart with animations
 * - Test Box: Information boxes with close functionality
 */

/* 图表包装器 */
.iq-chart-wrapper {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.iq-chart-title {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

/* 主容器 */
.iq-chart-container {
    display: flex;
    flex-wrap: nowrap; /* 不换行，支持横向滚动 */
    justify-content: space-around;
    align-items: flex-end; /* 底部对齐 */
    gap: 10px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 28px 10px 20px; /* 默认内边距，会被JavaScript动态调整 */
    border: 1px solid #dee2e6;
    border-radius: 12px;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    --highlight-color: #ff8c00;
    --highlight-shadow: rgba(255, 140, 0, 0.4);
    overflow-x: auto; /* 允许横向滚动 */
    overflow-y: visible;
    scroll-behavior: smooth; /* 平滑滚动 */
    transition: padding 0.3s ease; /* 平滑的内边距过渡效果 */
}

/* 单个柱状图项目 */
.iq-bar {
    flex: 0 0 12%;
    min-width: 70px;
    text-align: center;
    position: relative;
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* 底部对齐 */
    align-items: center;
    padding-bottom: 0;
}

.iq-bar:hover {
    transform: translateY(-2px);
}

/* 柱状图柱子 */
.iq-bar .bar {
    width: 100%;
    background: linear-gradient(180deg, #ced4da 0%, #adb5bd 100%);
    border-radius: 6px 6px 0 0;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    order: 1;
}

.iq-bar .bar:hover {
    background: linear-gradient(180deg, #6c757d 0%, #495057 100%);
}

/* 高亮柱子 */
.iq-bar.active .bar {
    background: var(--highlight-color);
    box-shadow: 0 4px 15px var(--highlight-shadow);
}

/* 指示箭头和标签 */
.iq-bar.active::before {
    content: "▲";
    font-size: 20px;
    color: var(--highlight-color);
    position: absolute;
    top: -32px;
    left: 50%;
    transform: translateX(-50%);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    z-index: 1001;
}

.iq-bar.active::after {
    content: "您所在分值区间";
    font-size: 11px;
    color: white;
    font-weight: 600;
    position: absolute;
    top: -62px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: var(--highlight-color);
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    z-index: 1001;
}

/* 柱子信息区域 */
.iq-bar-info {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    order: 2;
    min-height: 60px;
}

.iq-bar .label {
    font-size: 13px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 4px;
    line-height: 1.2;
    text-align: center;
}

.iq-bar .level {
    font-size: 11px;
    color: #6c757d;
    margin-bottom: 4px;
    line-height: 1.3;
    text-align: center;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.iq-bar .percent {
    font-size: 12px;
    color: #495057;
    font-weight: 500;
    text-align: center;
}

/* 高亮项目的文字样式 */
.iq-bar.active .label {
    color: var(--highlight-color);
    font-weight: 700;
}

.iq-bar.active .percent {
    color: var(--highlight-color);
    font-weight: 600;
}

/* 图表注释 */
.iq-chart-note {
    text-align: center;
    margin-top: 15px;
    color: #6c757d;
    font-style: italic;
}

/* 移动端适配 - 保持与桌面端相同的样式，只调整尺寸 */
@media screen and (max-width: 768px) {
    .iq-chart-container {
        /* 移除固定的padding设置，让JavaScript动态控制 */
        gap: 8px;
        justify-content: flex-start; /* 左对齐以便滚动 */
    }
    
    .iq-bar {
        flex: 0 0 80px; /* 固定宽度 */
        min-width: 80px;
    }
    
    .iq-bar .label {
        font-size: 12px;
    }
    
    .iq-bar .level {
        font-size: 10px;
        min-height: 32px; /* 稍微增加高度以容纳更多文本 */
    }
    
    .iq-bar .percent {
        font-size: 11px;
    }
    
    .iq-chart-title {
        font-size: 16px;
    }
    
    /* 移动端高亮指示器调整 */
    .iq-bar.active::before {
        font-size: 18px;
        top: -30px;
    }
    
    .iq-bar.active::after {
        font-size: 10px;
        top: -60px;
        padding: 1px 4px;
        color: white; /* 确保移动端也是白色文字 */
        background: var(--highlight-color); /* 确保移动端也使用高亮颜色背景 */
    }
}

@media screen and (max-width: 480px) {
    .iq-chart-container {
        /* JavaScript会动态调整padding，这里只设置其他属性 */
        gap: 6px;
    }
    
    .iq-bar {
        flex: 0 0 70px;
        min-width: 70px;
    }
    
    .iq-bar .label {
        font-size: 11px;
    }
    
    .iq-bar .level {
        font-size: 9px;
        min-height: 35px;
    }
    
    .iq-bar .percent {
        font-size: 10px;
    }
    
    .iq-chart-title {
        font-size: 15px;
    }
}
