/* 文本统计工具样式 */
.text-stats-section {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 20px;
}

.text-stats-section .container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 页面头部 */
.tool-header {
    text-align: center;
    margin-bottom: 40px;
}

.header-content {
    animation: fadeInUp 0.6s ease;
}

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

.tool-title {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.tool-title i {
    font-size: 32px;
}

.tool-subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
}

.tool-badge {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.badge-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    color: #fff;
    backdrop-filter: blur(10px);
}

/* 工具主体 */
.tool-main {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 0;
}

@media (max-width: 992px) {
    .tool-main {
        grid-template-columns: 1fr;
    }
}

/* 主面板 */
.main-panel {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border-right: 1px solid #eee;
}

@media (max-width: 992px) {
    .main-panel {
        border-right: none;
        border-bottom: 1px solid #eee;
    }
}

/* 侧边面板 */
.side-panel {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 输入区域 */
.input-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid #ddd;
    color: #666;
}

.btn-outline:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

textarea {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea::placeholder {
    color: #999;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 14px;
    color: #666;
}

.char-count, .word-count {
    font-weight: 500;
}

/* 结果区域 */
.result-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
}

/* 统计网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}

.stat-icon.bg-blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon.bg-green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-icon.bg-purple {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
}

.stat-icon.bg-orange {
    background: linear-gradient(135deg, #fc4a1a 0%, #f7b733 100%);
}

.stat-icon.bg-red {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

.stat-icon.bg-teal {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.stat-label {
    font-size: 13px;
    color: #888;
}

/* 时间估算 */
.time-estimation {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.time-estimation h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 480px) {
    .time-grid {
        grid-template-columns: 1fr;
    }
}

.time-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
}

.time-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.time-info {
    display: flex;
    flex-direction: column;
}

.time-value {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.time-label {
    font-size: 13px;
    color: #888;
}

.time-hint {
    font-size: 12px;
    color: #aaa;
    margin-top: 2px;
}

/* 详细分析 */
.detailed-stats {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.detailed-stats h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

.detail-label {
    font-size: 14px;
    color: #666;
}

.detail-value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* 高频词统计 */
.keyword-section {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
}

.keyword-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
}

.keyword-count {
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

/* 提示卡片 */
.tips-card {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #f59e0b;
}

.tips-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: #856404;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tips-list {
    margin: 0;
    padding-left: 20px;
}

.tips-list li {
    font-size: 14px;
    color: #856404;
    margin-bottom: 8px;
    line-height: 1.5;
}

.tips-list li:last-child {
    margin-bottom: 0;
}

/* 设置卡片 */
.settings-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
}

.settings-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.setting-item {
    margin-bottom: 16px;
}

.setting-item:last-child {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.setting-item input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.setting-item input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
}

.toast-error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: #fff;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .text-stats-section {
        padding: 40px 15px;
    }

    .tool-title {
        font-size: 28px;
    }

    .tool-subtitle {
        font-size: 16px;
    }

    .main-panel,
    .side-panel {
        padding: 20px;
    }

    textarea {
        min-height: 150px;
    }

    .section-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
}