/* ── 字符统计 工具页样式 ── */

.zf-input {
    width: 100%;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.7;
    resize: vertical;
    background: #fafafa;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 1rem;
}

.zf-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
    background: white;
}

/* ── 分区标题 ── */
.zf-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #2563eb;
    display: inline-block;
}

/* ── 基本统计 ── */
.zf-basic {
    margin-top: 1.5rem;
}

.zf-basic-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
}

.zf-basic-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1rem;
    background: #f8f9fb;
    border: 1px solid #e8eaf0;
    border-radius: 6px;
}

.zf-basic-label {
    font-size: 0.85rem;
    color: #666;
}

.zf-basic-val {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2563eb;
    font-family: 'Fira Code', monospace;
}

/* ── Unicode类别 ── */
.zf-unicode {
    margin-top: 1.5rem;
}

.zf-category-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.zf-cat-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 0;
}

.zf-cat-name {
    font-size: 0.85rem;
    color: #555;
    min-width: 80px;
    flex-shrink: 0;
}

.zf-cat-bar-wrap {
    flex: 1;
    height: 20px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.zf-cat-bar {
    height: 100%;
    background: #2563eb;
    border-radius: 4px;
    transition: width 0.3s;
    min-width: 2px;
}

.zf-cat-val {
    font-size: 0.82rem;
    color: #888;
    min-width: 80px;
    text-align: right;
    font-family: 'Fira Code', monospace;
    flex-shrink: 0;
}

/* ── 字符频率 ── */
.zf-freq {
    margin-top: 1.5rem;
}

.zf-freq-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
    color: #666;
}

.zf-freq-controls select {
    padding: 0.3rem 0.6rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: inherit;
    background: white;
}

.zf-freq-table {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

.zf-freq-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.7rem;
    background: #f8f9fb;
    border: 1px solid #e8eaf0;
    border-radius: 6px;
    font-size: 0.82rem;
}

.zf-freq-char {
    font-weight: 600;
    color: #2563eb;
    font-size: 1rem;
    min-width: 1.2em;
    text-align: center;
    font-family: 'Fira Code', monospace;
}

.zf-freq-char.space-char {
    background: #e8eaf0;
    border-radius: 3px;
    padding: 0 0.3rem;
    font-size: 0.7rem;
    color: #999;
}

.zf-freq-info {
    text-align: right;
    color: #888;
    font-family: 'Fira Code', monospace;
}

.zf-freq-count {
    font-weight: 600;
    color: #333;
}

/* ── Mobile ── */
@media (max-width: 900px) {
    .zf-basic-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .zf-freq-table {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .zf-basic-grid {
        grid-template-columns: 1fr 1fr;
    }

    .zf-freq-table {
        grid-template-columns: repeat(2, 1fr);
    }

    .zf-freq-controls {
        flex-direction: column;
        align-items: flex-start;
    }
}
