/* ==========================================================================
   文本转表格 专用样式
   依赖：home.css（--c-* 设计令牌）、tool-detail.css、tools/calc-common.css、tools/text-tools.css
   全部使用 --c-* 令牌，自动适配黑夜模式
   ========================================================================== */

/* ---------- 表格预览 ---------- */
.tt-table-wrap {
    border: 1px solid var(--c-border);
    border-radius: 12px;
    overflow: auto;
    max-height: 360px;
    background: var(--c-bg-card, #fff);
}
.tt-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-size: 13px;
}
.tt-table th,
.tt-table td {
    padding: 7px 11px;
    border-bottom: 1px solid var(--c-border);
    border-right: 1px solid var(--c-border);
    text-align: left;
    white-space: nowrap;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--c-text);
    background: var(--c-bg-card, #fff);
}
.tt-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--c-surface-soft, #f8fafc);
    font-weight: 700;
    color: var(--c-text);
}
.tt-table th.tt-idx,
.tt-table td.tt-idx {
    position: sticky;
    left: 0;
    z-index: 1;
    width: 46px;
    text-align: right;
    font-size: 11.5px;
    color: var(--c-text-muted);
    background: var(--c-surface-soft, #f8fafc);
}
.tt-table th.tt-idx { z-index: 3; }
.tt-table tr:last-child td { border-bottom: none; }
.tt-table th:last-child,
.tt-table td:last-child { border-right: none; }
.tt-table td.tt-empty { color: var(--c-text-muted); font-style: italic; }

.tt-table td.tt-region {
    background: color-mix(in srgb, var(--c-primary) 8%, transparent);
}

.tt-more {
    font-size: 12.5px;
    color: var(--c-text-muted);
    margin: 8px 0 0;
}

/* ---------- 输入框 ---------- */
.tt-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--c-border);
    border-radius: 10px;
    background: var(--c-bg-card, #fff);
    color: var(--c-text);
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tt-input:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px var(--c-primary-soft);
}

/* ---------- 解析结果提示 ---------- */
.tt-alert {
    padding: 10px 13px;
    border-radius: 10px;
    font-size: 12.5px;
    line-height: 1.65;
    margin-bottom: 12px;
    word-break: break-all;
    background: color-mix(in srgb, #ef4444 12%, transparent);
    color: #ef4444;
}
.tt-alert.is-ok {
    background: color-mix(in srgb, var(--c-primary) 12%, transparent);
    color: var(--c-primary);
}

/* ---------- 输出格式说明 ---------- */
.tt-note {
    font-size: 12.5px;
    line-height: 1.85;
    color: var(--c-text-sub);
    margin: 10px 0 0;
}
.tt-note b { color: var(--c-text); }

@media (max-width: 900px) {
    .tt-table th, .tt-table td { max-width: 160px; }
    .tt-table-wrap { max-height: 280px; }
}
