/* ============ 文字竖排工具 - 工具特有样式 ============ */
/* 通用样式（卡片、按钮、分隔线、info-box、form-textarea等）已由 common.css 统一提供 */

/* ---- 容器 ---- */
#vp-container {
    margin-bottom: 15px;
}

/* ---- 左右两栏 flex 布局 ---- */
#vp-container > .section-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

#vp-container > .section-row > .settings-card,
#vp-container > .section-row > .preview-card {
    flex: 1;
    margin-top: 0;
    margin-bottom: 0;
}

/* ---- 转换统计 ---- */
.convert-stats {
    display: flex;
    gap: 24px;
    margin-top: 12px;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 13px;
    color: #6b7280;
}

.convert-stats strong {
    color: #374151;
    font-weight: 600;
}

/* ---- 字符计数 ---- */
.char-count {
    float: right;
    font-size: 12px;
    color: #9ca3af;
    font-weight: 400;
}

.char-count-warn {
    color: #ef4444;
    font-weight: 600;
}

/* ---- 设置分组 ---- */
.setting-group {
    margin-bottom: 16px;
}

.setting-group-title {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 12px;
}

/* ---- 滑块控件 ---- */
.slider-control {
    display: flex;
    gap: 12px;
    align-items: center;
}

.slider-range {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.slider-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #8b5cf6;
    border-radius: 50%;
    cursor: pointer;
}

.slider-input {
    width: 65px;
    padding: 8px 10px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    outline: none;
    box-sizing: border-box;
}

.slider-input:focus {
    border-color: #8b5cf6;
}

/* ---- 自动适配徽章 ---- */
.auto-fit-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: #8b5cf6;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    vertical-align: middle;
}

/* ---- 复选框选项 ---- */
.checkbox-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    transition: all 0.2s;
    user-select: none;
}

.checkbox-item:hover {
    border-color: #a78bfa;
    background: #f5f3ff;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ---- 分段控制器（排列方向） ---- */
.segmented-control {
    display: inline-flex;
    gap: 8px;
}

.segment-btn {
    padding: 8px 16px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.segment-btn:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.segment-btn.active {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-color: #8b5cf6;
    color: white;
}

/* ---- 结果统计 ---- */
.result-stats {
    font-size: 13px;
    color: #6b7280;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 12px;
    text-align: center;
}

.result-stats strong {
    color: #8b5cf6;
    font-weight: 600;
}

/* ---- 竖排结果区域 ---- */
.vertical-result-area {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.vertical-grid-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 20px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow-x: auto;
    min-height: 200px;
}

/* ---- 竖排网格页面 ---- */
.v-grid-page {
    display: inline-flex;
    border: 2px solid #666;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.v-grid-page-rtl {
    flex-direction: row-reverse;
}

.v-grid-page-ltr {
    flex-direction: row;
}

.v-grid-col {
    display: flex;
    flex-direction: column;
    border-left: 1px solid #ccc;
}

.v-grid-col:first-child {
    border-left: none;
}

.v-grid-cell {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #ccc;
    font-family: 'Noto Serif SC', 'SimSun', 'Songti SC', serif;
    font-size: 16px;
    color: #1f2937;
    line-height: 1;
}

.v-grid-cell:last-child {
    border-bottom: none;
}

/* ---- 空状态 ---- */
#vp-container .empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #9ca3af;
}

#vp-container .empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

#vp-container .empty-state-desc {
    font-size: 14px;
    color: #888;
}

/* ---- 功能说明信息区 ---- */
#app > .info-section {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
    #vp-container > .section-row {
        flex-direction: column;
        gap: 12px;
    }

    .convert-stats {
        flex-wrap: wrap;
        gap: 12px;
    }

    .segmented-control {
        flex-direction: column;
        width: 100%;
    }

    .segment-btn {
        width: 100%;
        text-align: center;
    }

    .checkbox-options {
        flex-direction: column;
    }

    .vertical-grid-wrapper {
        padding: 12px;
    }

    .v-grid-cell {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    #app > .info-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .slider-control {
        gap: 8px;
    }

    .slider-input {
        width: 55px;
    }

    .v-grid-cell {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }
}
