/* 在线字数统计工具样式 */

/* 工具页面通用样式 */
.tool-page-section {
    padding: 100px 0 40px;
}

.tool-card-wrapper {
    margin-bottom: 40px;
}

.tool-header {
    text-align: center;
    margin-bottom: 30px;
}

.tool-header h1 {
    font-size: 2.5em;
    margin-bottom: 15px;
    color: #333;
}

.tool-header p {
    font-size: 1.1em;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

.tool-info-card {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-top: 30px;
}

.info-content {
    margin-top: 15px;
    line-height: 1.8;
}

.info-content h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #555;
}

.info-content p {
    margin-bottom: 10px;
    color: #666;
}

.faq-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

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

.tool-advantage {
    margin: 30px 0;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    text-align: center;
}

.tool-advantage p {
    margin: 0;
    font-size: 14px;
    color: #333;
}

/* 输入输出区域样式 */
.input-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 24px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.text-input {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    resize: vertical;
    transition: border-color 0.2s;
}

.text-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.button-group {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.button-group .btn {
    flex: 1;
}

.output-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 24px;
}

.output-section h2 {
    margin-bottom: 16px;
    color: #333;
}

/* 统计结果网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-item {
    background: #f9fafb;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #6366f1;
}

/* 字符频率分析区域 */
.frequency-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.frequency-section h2 {
    margin-bottom: 16px;
    color: #333;
}

.frequency-container {
    min-height: 200px;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 40px;
}

.frequency-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.frequency-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.frequency-rank {
    width: 24px;
    height: 24px;
    background: #6366f1;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.frequency-char {
    width: 32px;
    height: 32px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 500;
    flex-shrink: 0;
}

.frequency-bar-container {
    flex: 1;
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.frequency-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.frequency-count {
    width: 40px;
    text-align: right;
    font-size: 14px;
    font-weight: 500;
    color: #6366f1;
    flex-shrink: 0;
}

/* 按钮样式 */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.primary-btn {
    background: #6366f1;
    color: white;
}

.primary-btn:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

.secondary-btn {
    background: #e5e7eb;
    color: #333;
}

.secondary-btn:hover {
    background: #d1d5db;
}

.success-btn {
    background: #10b981;
    color: white;
}

.success-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* 统计结果总结区域 */
.summary-section {
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
}

.summary-section h3 {
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.summary-label {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.summary-value {
    font-size: 20px;
    font-weight: 600;
}

/* 统计说明区域 */
.stats-note {
    margin-top: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #6366f1;
}

.stats-note h4 {
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.stats-note ul {
    margin: 0;
    padding-left: 20px;
}

.stats-note li {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.stats-note li:last-child {
    margin-bottom: 0;
}

/* 高级工具区域 */
.advanced-tools {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.advanced-tools h3 {
    margin-bottom: 12px;
    font-size: 16px;
    color: #333;
}

.tool-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.tool-buttons .btn {
    font-size: 12px;
    padding: 8px 12px;
}

/* Toast提示样式 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    display: none;
    z-index: 1000;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .tool-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tool-header h1 {
        font-size: 2em;
    }
    
    .frequency-item {
        flex-wrap: wrap;
    }
    
    .frequency-bar-container {
        order: 4;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .tool-buttons {
        grid-template-columns: 1fr;
    }
    
    .tool-header h1 {
        font-size: 1.8em;
    }
    
    .frequency-rank {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
    
    .frequency-char {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .frequency-count {
        width: 35px;
        font-size: 12px;
    }
}