/* zhuanTheme 插件样式 */

/* 分析结果样式 */
.zhuan-theme-analysis-results {
    width: 100%;
    margin: 20px 0;
}

.analysis-summary {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: white;
    border-radius: 5px;
    border-left: 4px solid #0073aa;
}

.summary-label {
    font-weight: bold;
    color: #666;
}

.summary-value {
    color: #0073aa;
    font-weight: bold;
}

.function-categories {
    margin-bottom: 20px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.category-item {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    color: #333;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.category-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 功能分类样式 */
.category-item.woocommerce { background: #f0e6ff; border-color: #d4b5ff; }
.category-item.theme { background: #e6f7ff; border-color: #91d5ff; }
.category-item.custom { background: #f6ffed; border-color: #b7eb8f; }
.category-item.general { background: #fffbe6; border-color: #ffe58f; }
.category-item.shortcodes { background: #f0f9ff; border-color: #bae6fd; }
.category-item.scripts { background: #fef2f2; border-color: #fecaca; }
.category-item.styles { background: #f0fdf4; border-color: #bbf7d0; }

/* 文件类型样式 */
.category-item.file-type-php { background: #f3e8ff; border-color: #c4b5fd; }
.category-item.file-type-css { background: #dbeafe; border-color: #93c5fd; }
.category-item.file-type-js { background: #fef3c7; border-color: #fcd34d; }
.category-item.file-type-image { background: #ecfdf5; border-color: #86efac; }
.category-item.file-type-html { background: #fef2f2; border-color: #fca5a5; }
.category-item.file-type-text { background: #f9fafb; border-color: #d1d5db; }
.category-item.file-type-json { background: #f0fdf4; border-color: #bbf7d0; }
.category-item.file-type-xml { background: #fefce8; border-color: #fde047; }
.category-item.file-type-other { background: #f1f5f9; border-color: #cbd5e1; }

.category-item h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-weight: 600;
}

.category-item .count {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.recommendations {
    margin-bottom: 20px;
}

.recommendation-section {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.recommendation-item {
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 10px;
}

.recommendation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.category-badge {
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.category-badge.woocommerce { background: #e1d7ed; }
.category-badge.theme { background: #d1e5eb; }
.category-badge.custom { background: #d4ebd6; }
.category-badge.general { background: #ffb900; }

.priority {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
}

.priority-high { background: #dc3232; color: white; }
.priority-medium { background: #ffb900; color: white; }
.priority-low { background: #d4ebd6; color: white; }

.code-suggestion {
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 10px;
}

.code-example {
    background: #f5f5f5;
    border-radius: 3px;
    padding: 10px;
    margin-top: 10px;
}

.code-example pre {
    margin: 0;
    font-size: 12px;
}

.best-practice {
    border-left: 4px solid #d4ebd6;
    padding: 15px;
    margin-bottom: 10px;
    background: #f9f9f9;
}

.warning-item {
    border-left: 4px solid #dc3232;
    padding: 15px;
    margin-bottom: 10px;
    background: #fef7f7;
}

.severity-high { border-left-color: #dc3232; }
.severity-medium { border-left-color: #ffb900; }
.severity-low { border-left-color: #d4ebd6; }

.file-details {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.file-section {
    margin-bottom: 20px;
}

.file-list, .function-list {
    max-height: 300px;
    overflow-y: auto;
    border: none;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.file-item, .function-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f3f4;
    transition: all 0.2s ease;
}

.file-item:last-child, .function-item:last-child {
    border-bottom: none;
}

.file-item:hover, .function-item:hover {
    background: #f8f9fa;
    transform: translateX(4px);
}

.function-item {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    gap: 15px;
    align-items: center;
}

.function-type {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.type-woocommerce { 
    background: linear-gradient(135deg, #7b68ee 0%, #9370db 100%); 
    color: white; 
    box-shadow: 0 2px 4px rgba(123, 104, 238, 0.3);
}
.type-theme { 
    background: linear-gradient(135deg, #20b2aa 0%, #48d1cc 100%); 
    color: white; 
    box-shadow: 0 2px 4px rgba(32, 178, 170, 0.3);
}
.type-custom { 
    background: linear-gradient(135deg, #32cd32 0%, #90ee90 100%); 
    color: white; 
    box-shadow: 0 2px 4px rgba(50, 205, 50, 0.3);
}
.type-general { 
    background: linear-gradient(135deg, #ffa500 0%, #ffd700 100%); 
    color: white; 
    box-shadow: 0 2px 4px rgba(255, 165, 0, 0.3);
}

.file-item.more, .function-item.more {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-style: italic;
    color: #6c757d;
    border-radius: 8px;
    margin: 8px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .function-item {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .recommendation-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* 模态窗口样式已移除，使用直接显示方案 */

/* ===== 分析结果页面样式 ===== */

/* 分析结果容器 */
.zhuan-theme-analysis-results {
    margin: 20px 0;
}

/* 分析摘要 */
.analysis-summary {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: white;
    border-radius: 5px;
    border-left: 4px solid #0073aa;
}

.summary-label {
    font-weight: bold;
    color: #666;
}

.summary-value {
    color: #0073aa;
    font-weight: bold;
}

/* 推荐部分 */
.recommendations {
    margin-bottom: 20px;
}

.recommendation-section {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
}

.recommendation-item {
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 10px;
}

.recommendation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* 代码建议 */
.code-suggestion {
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 10px;
}

.code-example {
    background: #f5f5f5;
    border-radius: 3px;
    padding: 10px;
    margin-top: 10px;
}

.code-example pre {
    margin: 0;
    font-size: 12px;
}

.best-practice {
    border-left: 4px solid #d4ebd6;
    padding: 15px;
    margin-bottom: 10px;
    background: #f9f9f9;
}

.warning-item {
    border-left: 4px solid #dc3232;
    padding: 15px;
    margin-bottom: 10px;
    background: #fef7f7;
}

.severity-high { border-left-color: #dc3232; }
.severity-medium { border-left-color: #ffb900; }
.severity-low { border-left-color: #d4ebd6; }

/* 文件详情 */
.file-details {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.file-section {
    margin-bottom: 20px;
}

.file-list, .function-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 5px;
}

.file-item, .function-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.file-item:last-child, .function-item:last-child {
    border-bottom: none;
}

.function-item {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    gap: 10px;
}

.file-item.more, .function-item.more {
    background: #f9f9f9;
    font-style: italic;
    color: #666;
}

/* 短代码列表 */
.shortcode-list {
    max-height: 600px;
    overflow-y: auto;
    border: none;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.shortcode-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;

    transition: all 0.2s ease;
    position: relative;  border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.shortcode-item:last-child {
    border-bottom: none;
}

.shortcode-item:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.shortcode-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shortcode-right {
    flex-shrink: 0;
    margin-left: 20px;
    display: flex;
    align-items: center;
}

.shortcode-name {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    background: #5c6ebe;
    color: #fff;
    padding: 8px 12px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    letter-spacing: 0.5px;
}

.shortcode-chinese {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #ffdc8e;
    color: #8b4513;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    box-shadow: 0 1px 3px rgba(252, 182, 159, 0.3);
    white-space: nowrap;
}

.shortcode-example {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    background: #f1f3f4;
    padding: 6px 10px;
    border-radius: 30px;
    color: #5f6368;
    font-size: 12px;
    margin-left: 0;
    margin-top: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.shortcode-function {
    font-size: 12px;
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 30px;
    border: 1px solid #e8eaed;
    font-weight: 400;
}





/* 重复短代码警告 */
.warning-section {
    border-left: 4px solid #ff6b6b;
    background: #fff5f5;
}

.duplicate-shortcode-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ff6b6b;
    border-radius: 5px;
    background: #fff;
}

.duplicate-item {
    border-bottom: 1px solid #ffe0e0;
    padding: 15px;
}

.duplicate-item:last-child {
    border-bottom: none;
}

.duplicate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.duplicate-name {
    font-family: monospace;
    background: #ff6b6b;
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-weight: bold;
}

.duplicate-count {
    background: #ffa8a8;
    color: #721c24;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.duplicate-instances {
    margin-left: 20px;
}

.instance-item {
    display: flex;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
}

.instance-item:last-child {
    border-bottom: none;
}

.instance-number {
    background: #6c757d;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin-right: 10px;
    flex-shrink: 0;
}

.instance-function {
    font-family: monospace;
    color: #495057;
}

/* 警告摘要项 */
.summary-item.warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
    padding: 10px;
    margin: 5px 0;
}

.summary-item.warning .summary-label {
    color: #856404;
    font-weight: bold;
}

.summary-item.warning .summary-value {
    color: #721c24;
    font-weight: bold;
}

/* 脚本和样式列表 */
.script-list, .style-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 5px;
}

.script-item, .style-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.script-item:last-child, .style-item:last-child {
    border-bottom: none;
}

.script-handle, .style-handle {
    font-family: monospace;
    background: #e1ecf4;
    padding: 2px 6px;
    border-radius: 3px;
    color: #0366d6;
}

.script-type, .style-type {
    color: #666;
    font-size: 12px;
}

/* 文件树样式 */
.file-tree-section {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.file-tree-container {
    margin-top: 15px;
}

.file-tree-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.file-search-input {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    width: 200px;
}

.file-tree {
    border: 1px solid #eee;
    border-radius: 5px;
    background: #fafafa;
    max-height: 500px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 13px;
}

.file-tree-item {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.file-tree-item:hover {
    background-color: #f0f8ff;
}

.file-tree-item:last-child {
    border-bottom: none;
}

.folder-toggle {
    cursor: pointer;
    margin-right: 5px;
    font-size: 12px;
    transition: transform 0.2s;
}

.folder-toggle.expanded {
    transform: rotate(90deg);
}

.file-spacer {
    width: 17px;
    margin-right: 5px;
}

.file-icon {
    margin-right: 8px;
    font-size: 14px;
}

.file-name {
    flex: 1;
    color: #2c3e50;
    font-weight: 500;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 13px;
}

.file-size {
    color: #7f8c8d;
    font-size: 11px;
    margin-left: 15px;
    background: #ecf0f1;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.important-badge {
    background: #ff6b6b;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    margin-left: 10px;
}

.folder-children {
    background: #f9f9f9;
}

.level-0 { padding-left: 10px; }
.level-1 { padding-left: 30px; }
.level-2 { padding-left: 50px; }
.level-3 { padding-left: 70px; }
.level-4 { padding-left: 90px; }
.level-5 { padding-left: 110px; }

/* 文件类型颜色 */
.file-tree-item[data-type="file"] .file-name {
    color: #0366d6;
}

.file-tree-item[data-type="folder"] .file-name {
    color: #6f42c1;
    font-weight: bold;
}

/* 搜索高亮 */
.file-tree-item.highlighted {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
}

.file-tree-item.hidden {
    display: none;
}