/* Excel 表格拼接工具页样式 */
.container {
    padding: 10px 15px;
}

/* 区块标题 */
.sec-title {
    font-size: 14px;
    color: #555;
    margin: 18px 0 8px;
    font-weight: bold;
}

.sec-title .badge {
    background: #337ab7;
    font-size: 12px;
    margin-right: 6px;
    vertical-align: 1px;
}

.hint {
    color: #999;
    font-size: 12px;
    margin-top: 5px;
}

.hint b {
    color: #666;
}

/* 预览表格（表头吸顶，便于长表滚动查看） */
#previewWrap {
    max-height: 320px;
    overflow: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#previewWrap table {
    margin-bottom: 0;
}

#previewWrap thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8f8f8;
    white-space: nowrap;
}

#previewWrap th,
#previewWrap td {
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
}

#previewWrap .td-index {
    color: #999;
    min-width: 36px;
}

/* 是否换行复选框（与左侧 input-group 同高对齐） */
.nl-check {
    display: block;
    margin: 0;
    line-height: 34px;
    font-weight: normal;
    cursor: pointer;
    color: #555;
    white-space: nowrap;
}

.nl-check input {
    margin: 0 5px 0 0;
    vertical-align: -1px;
    cursor: pointer;
}

/* ① 文件选择：自绘控件（原生 file input 的按钮在各浏览器下垂直居中不一致） */
.file-pick {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 34px;
    margin: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-weight: normal;
    cursor: pointer;
}

.file-pick:hover {
    border-color: #8ecbeb;
}

.file-pick:focus-within {
    border-color: #66afe9;
    box-shadow: 0 0 6px rgba(102, 175, 233, .35);
}

/* 真实 file input 铺满整个控件并透明，点哪都能唤起选择框 */
.file-pick input[type=file] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-pick-btn {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    height: 100%;
    padding: 0 14px;
    background: #f5f7fa;
    border-right: 1px solid #e3e6ea;
    color: #333;
    font-size: 13px;
}

.file-pick:hover .file-pick-btn {
    background: #eef4fa;
}

.file-pick-name {
    flex: 1 1 auto;
    padding: 0 12px;
    color: #999;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-pick.has-file .file-pick-name {
    color: #333;
}

/* 模板列标签（点选插入占位符） */
.tpl-tags {
    margin-top: 8px;
    line-height: 24px;
}

.tpl-tags .tpl-tag {
    display: inline-block;
    max-width: 220px;
    margin: 0 6px 6px 0;
    padding: 1px 9px;
    font-family: Consolas, Menlo, monospace;
    font-size: 12px;
    color: #31708f;
    background: #eaf4fb;
    border: 1px solid #bce0f5;
    border-radius: 12px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.tpl-tags .tpl-tag:hover {
    background: #d6ebf9;
    border-color: #8ecbeb;
}

.tpl-tags .tpl-tag:active {
    background: #c3e2f5;
}

/* 输出区 */
#output {
    font-family: Consolas, Menlo, monospace;
    font-size: 13px;
    min-height: 200px;
    background: #fcfcfc;
}

/* 操作按钮组 */
.btn-group {
    width: 100%;
    margin-top: 10px;
}

.btn-group span {
    margin-left: 15px;
    line-height: 34px;
    color: #888;
    font-size: 13px;
}

.alert {
    margin: 10px 0 0;
}

/* 小屏优化 */
@media (max-width: 767px) {
    .btn-group .btn {
        margin-bottom: 6px;
    }

    .file-pick {
        margin-bottom: 8px;
    }
}
