@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;
    }
}

/* =================================================================
   Test Box Styles
   ================================================================= */

.test-box {
    margin: 20px 0;
    padding: 16px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.test-box-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.test-box-close:hover {
    color: #495057;
}

.test-box-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.test-box-icon {
    margin-right: 8px;
    font-size: 16px;
}

.test-box-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.test-box-content {
    line-height: 1.6;
}

/* 不同类型的样式 */
.test-box-info {
    background-color: #e7f3ff;
    border-color: #007cba;
    color: #004085;
}

.test-box-info .test-box-title {
    color: #007cba;
}

.test-box-warning {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.test-box-warning .test-box-title {
    color: #b45309;
}

.test-box-success {
    background-color: #d1edcc;
    border-color: #28a745;
    color: #155724;
}

.test-box-success .test-box-title {
    color: #28a745;
}

.test-box-error {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.test-box-error .test-box-title {
    color: #dc3545;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .test-box {
        padding: 12px;
    }
    
    .test-box-title {
        font-size: 15px;
    }
}

/* =================================================================
   Star Rating Styles
   ================================================================= */

.star-rating-wrapper {
    margin: 15px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --star-color: #ffd700;
}

.star-rating-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* 星星显示区域 */
.stars-display {
    display: flex;
    align-items: center;
    gap: 2px;
    position: relative;
}

.star {
    position: relative;
    display: inline-block;
    color: var(--star-color);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.star-full {
    color: var(--star-color);
    filter: drop-shadow(0 1px 2px rgba(255, 193, 7, 0.3));
}

.star-empty {
    color: #e0e0e0;
}

.star-half {
    position: relative;
    overflow: hidden;
}

.star-half-inner {
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    overflow: hidden;
    color: var(--star-color);
    filter: drop-shadow(0 1px 2px rgba(255, 193, 7, 0.3));
}

.star-empty-bg {
    color: #e0e0e0;
}

/* 评分信息 */
.rating-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
    flex-wrap: wrap;
}

.rating-number {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.rating-count {
    color: #888;
    font-size: 13px;
}

/* 尺寸变化 */
.star-rating-small .star {
    font-size: 14px;
}

.star-rating-small .rating-number {
    font-size: 14px;
}

.star-rating-small .rating-count {
    font-size: 12px;
}

.star-rating-medium .star {
    font-size: 18px;
}

.star-rating-medium .rating-number {
    font-size: 16px;
}

.star-rating-medium .rating-count {
    font-size: 13px;
}

.star-rating-large .star {
    font-size: 24px;
}

.star-rating-large .rating-number {
    font-size: 20px;
}

.star-rating-large .rating-count {
    font-size: 15px;
}

/* 样式变化 */
.star-rating-default {
    /* 默认样式已在上面定义 */
}

.star-rating-modern {
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.star-rating-modern .stars-display {
    gap: 3px;
}

.star-rating-modern .star {
    filter: drop-shadow(0 2px 4px rgba(255, 193, 7, 0.4));
}

.star-rating-modern .rating-info {
    font-size: 15px;
}

.star-rating-minimal {
    padding: 4px 0;
}

.star-rating-minimal .stars-display {
    gap: 1px;
}

.star-rating-minimal .star {
    filter: none;
    text-shadow: none;
}

.star-rating-minimal .rating-info {
    font-size: 13px;
    color: #999;
}

/* 悬停效果 */
.star-rating-wrapper:hover .star-full {
    transform: scale(1.05);
    filter: drop-shadow(0 2px 4px rgba(255, 193, 7, 0.5));
}

.star-rating-modern:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .star-rating-container {
        gap: 8px;
    }
    
    .rating-info {
        font-size: 13px;
        gap: 6px;
    }
    
    .star-rating-small .star {
        font-size: 12px;
    }
    
    .star-rating-medium .star {
        font-size: 16px;
    }
    
    .star-rating-large .star {
        font-size: 20px;
    }
    
    .star-rating-modern {
        padding: 10px 12px;
        border-radius: 8px;
    }
}

@media screen and (max-width: 480px) {
    .star-rating-container {
        gap: 6px;
    }
    
    .rating-info {
        font-size: 12px;
        gap: 4px;
    }
    
    .star-rating-modern {
        padding: 8px 10px;
    }
}

/* 产品图片覆盖层样式 */
.star-rating-overlay {
    margin: 0;
    padding: 8px 12px;
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(255, 255, 255, 0.85) 50%, 
        rgba(255, 255, 255, 0.75) 100%);
    backdrop-filter: blur(2px);
    border-radius: 0 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.star-rating-overlay .star-rating-container {
    gap: 8px;
}

.star-rating-overlay .stars-display {
    gap: 1px;
}

.star-rating-overlay .star {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.star-rating-overlay .rating-number {
    color: #333;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.star-rating-overlay .rating-count {
    color: #555;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* 深色背景适配版本 */
.star-rating-overlay.dark-bg {
    background: linear-gradient(180deg, 
        rgba(0, 0, 0, 0.8) 0%, 
        rgba(0, 0, 0, 0.7) 50%, 
        rgba(0, 0, 0, 0.6) 100%);
}

.star-rating-overlay.dark-bg .rating-number {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.star-rating-overlay.dark-bg .rating-count {
    color: #e0e0e0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.star-rating-overlay.dark-bg .star {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

/* 覆盖层移动端适配 */
@media screen and (max-width: 768px) {
    .star-rating-overlay {
        padding: 6px 10px;
        border-radius: 6px;
    }
    
    .star-rating-overlay .star-rating-container {
        gap: 6px;
    }
}

@media screen and (max-width: 480px) {
    .star-rating-overlay {
        padding: 5px 8px;
        border-radius: 5px;
    }
    
    .star-rating-overlay .star-rating-container {
        gap: 4px;
    }
    
    .star-rating-overlay .rating-info {
        font-size: 11px;
        gap: 3px;
    }
} 