/* FontSea Tab 字体编码数据展示 - 优化版 */
:root {
    --fontsea-primary-color: #3b82f6;
    --fontsea-primary-hover: #2563eb;
    --fontsea-slider-bg: #e2e8f0;
    --fontsea-text-color: #334155;
    --fontsea-border-color: #e2e8f0;
    --fontsea-container-bg: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    --fontsea-container-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

/* 主容器 */
.fontsea-tab-summary {
    width: 100%;
    margin: 20px auto;
    padding: 20px;
    background: var(--fontsea-container-bg);
    border-radius: 12px;
    box-shadow: var(--fontsea-container-shadow);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--fontsea-text-color);
    transition: all 0.3s ease;
}

.fontsea-tab-summary:hover {
    box-shadow: 0 12px 45px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

/* 头部区域 */
.fontsea-tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--fontsea-border-color);
}

.fontsea-tab-title {
    margin: 0;
    font-size: 1.3em;
    font-weight: 700;
    color: #1e293b;
}

.fontsea-tab-overall-stats {
    text-align: right;
}

/* 修改：移除总字符数的背景色 */
.fontsea-tab-total-chars {
    display: block;
    font-size: 1.4em;
    font-weight: 700;
    color: var(--fontsea-primary-color);
    /* 移除背景色、内边距和阴影 */
    background: none;
    padding: 0;
    box-shadow: none;
}

/* 关键指标网格 */
.fontsea-tab-key-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.fontsea-tab-metric-item {
    background: rgba(255, 255, 255, 0.7);
    padding: 14px 16px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--fontsea-border-color);
    backdrop-filter: blur(5px);
}

.fontsea-tab-metric-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.9);
}

.fontsea-tab-metric-name {
    font-size: 0.92em;
    color: var(--fontsea-text-color);
    font-weight: 600;
}

/* 修改：移除百分比数据的背景色 */
.fontsea-tab-metric-value {
    font-weight: 700;
    font-size: 1.05em;
    color: var(--fontsea-primary-color);
    /* 移除背景色、内边距和阴影 */
    background: none;
    padding: 0;
    box-shadow: none;
    min-width: auto;
}

/* 查看完整数据按钮 */
.fontsea-tab-view-full {
    width: 100%;
    background: linear-gradient(to right, var(--fontsea-primary-color), #6366f1);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.fontsea-tab-view-full:hover {
    background: linear-gradient(to right, var(--fontsea-primary-hover), #4f46e5);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.25);
}

.fontsea-tab-view-full:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

/* 模态框样式 */
.fontsea-tab-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    animation: fontsea-tab-fadeIn 0.3s ease;
    backdrop-filter: blur(4px);
}

.fontsea-tab-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--fontsea-container-bg);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--fontsea-container-shadow);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* 优化模态框滚动条 */
.fontsea-tab-modal-content::-webkit-scrollbar {
    width: 8px;
}

.fontsea-tab-modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.fontsea-tab-modal-content::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 4px;
}

.fontsea-tab-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

.fontsea-tab-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--fontsea-border-color);
    background: var(--fontsea-container-bg);
    color: #1e293b;
    border-radius: 12px 12px 0 0;
    position: sticky;
    top: 0;
    z-index: 1;
    backdrop-filter: blur(10px);
}

/* 修改：将h2改为div */
.fontsea-tab-modal-title {
    margin: 0;
    font-size: 1.3em;
    font-weight: 700;
    color: #1e293b;
}

.fontsea-tab-close-modal {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--fontsea-border-color);
    color: #64748b;
    font-size: 1.5em;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 8px;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.fontsea-tab-close-modal:hover {
    color: #ef4444;
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.fontsea-tab-modal-body {
    padding: 0;
}

/* 加载状态 */
.fontsea-tab-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #64748b;
}

.fontsea-loader {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: fontsea-spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes fontsea-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 完整数据展示 */
.fontsea-tab-full-showcase {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
}

/* 优化完整数据展示的滚动条 */
.fontsea-tab-full-showcase::-webkit-scrollbar {
    width: 6px;
}

.fontsea-tab-full-showcase::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 3px;
}

.fontsea-tab-full-showcase::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.2);
    border-radius: 3px;
}

.fontsea-tab-full-showcase::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.4);
}

.fontsea-tab-group {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid var(--fontsea-border-color);
    backdrop-filter: blur(10px);
}

/* 修改：将h3改为div */
.fontsea-tab-group-title {
    background: var(--fontsea-container-bg);
    color: #1e293b;
    margin: 0;
    padding: 16px 20px;
    font-size: 1.15em;
    font-weight: 700;
    border-bottom: 1px solid var(--fontsea-border-color);
    backdrop-filter: blur(5px);
}

.fontsea-tab-list {
    padding: 16px 20px;
}

.fontsea-tab-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.fontsea-tab-item:last-child {
    border-bottom: none;
}

.fontsea-tab-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fontsea-tab-item-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95em;
}

/* 修改：移除数字的背景色和容器 */
.fontsea-tab-item-count {
    color: #1e293b;
    font-weight: 600;
    font-size: 0.92em;
    /* 移除背景色、边框和阴影 */
    background: none;
    padding: 0;
    border: none;
    box-shadow: none;
}

.fontsea-tab-progress {
    display: flex;
    align-items: center;
    gap: 16px;
}

.fontsea-tab-progress-track {
    flex: 1;
    height: 6px;
    background: var(--fontsea-slider-bg);
    border-radius: 3px;
    overflow: hidden;
}

.fontsea-tab-progress-value {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
    background: linear-gradient(to right, var(--fontsea-primary-color), #6366f1);
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
}

/* 修改：移除百分比的背景色和容器 */
.fontsea-tab-progress-text {
    min-width: 50px;
    text-align: right;
    color: var(--fontsea-primary-color);
    font-weight: 600;
    font-size: 0.92em;
    /* 移除背景色、边框和阴影 */
    background: none;
    padding: 0;
    border: none;
    box-shadow: none;
}

/* 动画 */
@keyframes fontsea-tab-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* SEO优化数据 - 隐藏 */
.fontsea-tab-seo-data {
    display: none;
}

/* 无数据提示 */
.fontsea-tab-no-data {
    text-align: center;
    color: #64748b;
    font-style: italic;
    padding: 40px;
    background: var(--fontsea-container-bg);
    border-radius: 12px;
    border: 1px dashed var(--fontsea-border-color);
    box-shadow: var(--fontsea-container-shadow);
    backdrop-filter: blur(10px);
}

/* 兼容性优化：增加特异性，避免主题冲突 */
body .fontsea-tab-summary,
body .fontsea-tab-modal,
body .fontsea-tab-full-showcase {
    /* 确保我们的样式优先级 */
    box-sizing: border-box;
}

/* 重置可能受主题影响的样式 */
.fontsea-tab-summary *,
.fontsea-tab-modal *,
.fontsea-tab-full-showcase * {
    box-sizing: border-box;
}

/* 响应式设计 - 平板和手机 */
@media (max-width: 768px) {
    .fontsea-tab-summary {
        padding: 15px;
        margin: 15px auto;
    }
    
    .fontsea-tab-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .fontsea-tab-overall-stats {
        text-align: left;
    }
    
    .fontsea-tab-key-metrics {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .fontsea-tab-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .fontsea-tab-modal-header {
        padding: 16px 20px;
    }
    
    .fontsea-tab-full-showcase {
        padding: 16px;
        gap: 16px;
    }
    
    .fontsea-tab-list {
        padding: 12px 16px;
    }
    
    .fontsea-tab-item {
        padding: 12px 0;
    }
    
    .fontsea-tab-metric-item {
        padding: 12px 14px;
    }
    
    .fontsea-tab-view-full {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* 方案一：移动端水平布局优化（推荐） */
@media (max-width: 480px) {
    /* 修复数字显示换行问题 */
    .fontsea-tab-item-count,
    .fontsea-tab-progress-text {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* 优化项目头部布局 */
    .fontsea-tab-item-header {
        flex-wrap: nowrap;
        gap: 8px;
    }
    
    .fontsea-tab-item-name {
        flex: 1;
        min-width: 0; /* 允许文本截断 */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.9em;
    }
    
    /* 优化进度条布局 */
    .fontsea-tab-progress {
        flex-wrap: nowrap;
        gap: 12px;
    }
    
    .fontsea-tab-progress-track {
        min-width: 120px; /* 确保进度条有最小宽度 */
    }
    
    .fontsea-tab-progress-text {
        min-width: 60px;
        text-align: left; /* 左对齐避免空间不足 */
    }
    
    /* 模态框内容优化 */
    .fontsea-tab-modal-content {
        width: 98%;
        max-height: 85vh;
    }
    
    .fontsea-tab-full-showcase {
        padding: 12px;
        gap: 12px;
    }
    
    .fontsea-tab-list {
        padding: 8px 12px;
    }
}



/* 焦点状态 */
.fontsea-tab-view-full:focus-visible,
.fontsea-tab-close-modal:focus-visible {
    outline: 2px solid var(--fontsea-primary-color);
    outline-offset: 2px;
}