.df-hidden {
    display: none;
}

/* 行数提示 */
.df-line-hint {
    font-size: 11px;
    opacity: 0.7;
    margin-left: 4px;
    font-weight: 400;
}

/* ===== 小数位数格式化工具样式 df- ===== */

.df-container {
    padding: 0 0 12px 0;
    font-size: 14px;
    color: #333;
}

/* ---- 顶部工具栏 ---- */
.df-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 12px;
    background: linear-gradient(to bottom, #ffffff, #f5f7fb);
    border-bottom: 1px solid #e3e6ea;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    flex-wrap: wrap;
}

.df-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.df-toolbar-right {
    display: flex;
    gap: 6px;
}

.df-toolbar-label {
    font-size: 12px;
    color: #8a95a3;
    font-weight: 600;
    white-space: nowrap;
}

.df-preset-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.df-preset-btn {
    padding: 4px 10px;
    border: 1px solid #d0d5dd;
    border-radius: 5px;
    background: #fff;
    color: #555;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.df-preset-btn:hover {
    border-color: #4a90e2;
    color: #4a90e2;
    background: #f4f8ff;
}

.df-preset-btn.active {
    background: #4a90e2;
    border-color: #4a90e2;
    color: #fff;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.28);
}

.df-btn-tool {
    padding: 4px 11px;
    border: 1px solid #d0d5dd;
    border-radius: 5px;
    background: #fff;
    color: #555;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.df-btn-tool:hover {
    border-color: #4a90e2;
    color: #4a90e2;
    background: #f0f6ff;
}

/* ---- 双列布局 ---- */
.df-two-col {
    display: flex;
    gap: 0;
    min-height: 480px;
}

.df-input-panel {
    flex: 0 0 360px;
    padding: 12px 14px;
    border-right: 1px solid #e3e6ea;
    background: #fafbff;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}
.df-input-panel::-webkit-scrollbar { width: 4px; }
.df-input-panel::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

.df-result-panel {
    flex: 1;
    padding: 12px 14px;
    overflow-y: auto;
    background: #fff;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}
.df-result-panel::-webkit-scrollbar { width: 4px; }
.df-result-panel::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

/* ---- 小节标题 ---- */
.df-section-title {
    font-size: 11px;
    font-weight: 700;
    color: #4a90e2;
    padding: 2px 0 5px 10px;
    border-bottom: 1px solid #e8edf3;
    margin-bottom: 8px;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.df-section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 5px;
    width: 3px;
    background: #4a90e2;
    border-radius: 2px;
}

.df-section-title--gap {
    margin-top: 10px;
}

/* ---- 表单行 ---- */
.df-form-row {
    margin-bottom: 8px;
}

.df-row-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.df-label {
    display: block;
    font-size: 11px;
    color: #8a95a3;
    font-weight: 700;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    min-width: 60px;
}

.df-row-inline .df-label {
    margin-bottom: 0;
}

/* 文本域 */
.df-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d8dde6;
    border-radius: 6px;
    font-size: 13px;
    color: #2c3e50;
    background: #fff;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.6;
    box-sizing: border-box;
    min-height: 180px;
}

.df-textarea:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.12);
}

/* 小数位数增减控件 */
.df-control-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.df-spin-btn {
    width: 26px;
    height: 26px;
    border: 1px solid #d0d5dd;
    border-radius: 5px;
    background: #fff;
    color: #4a90e2;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    line-height: 1;
    padding: 0;
}

.df-spin-btn:hover {
    background: #4a90e2;
    color: #fff;
    border-color: #4a90e2;
}

.df-num-input {
    width: 52px;
    padding: 4px 6px;
    border: 1px solid #d8dde6;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
    background: #fff;
    transition: border-color 0.2s;
}

.df-num-input::-webkit-inner-spin-button,
.df-num-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.df-num-input:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.15);
}

.df-unit {
    font-size: 12px;
    color: #8a95a3;
}

/* 下拉选择 */
.df-select {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid #d8dde6;
    border-radius: 6px;
    font-size: 13px;
    color: #2c3e50;
    background: #fff;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    min-width: 0;
}

.df-select:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.12);
}

/* 复选框组 */
.df-check-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 2px;
}

.df-check-item {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    user-select: none;
}

.df-check-item input[type="checkbox"] {
    display: none;
}

.df-check-box {
    width: 16px;
    height: 16px;
    border: 1.5px solid #c0c7d0;
    border-radius: 3px;
    background: #fff;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    position: relative;
}

.df-check-item input[type="checkbox"]:checked + .df-check-box {
    background: #4a90e2;
    border-color: #4a90e2;
}

.df-check-item input[type="checkbox"]:checked + .df-check-box::after {
    content: '';
    width: 9px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
    display: block;
}

.df-check-text {
    font-size: 13px;
    color: #4a5568;
}

.df-check-text em {
    font-style: normal;
    color: #888;
    font-size: 11px;
    background: #f0f4f8;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
    font-family: 'Consolas', monospace;
}

/* 提交按钮 */
.df-action-row {
    margin-top: 10px;
}

.df-btn-primary {
    width: 100%;
    padding: 9px 16px;
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 3px 10px rgba(74, 144, 226, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.df-btn-primary:hover {
    background: linear-gradient(135deg, #357abd, #2868a0);
    box-shadow: 0 4px 14px rgba(74, 144, 226, 0.38);
    transform: translateY(-1px);
}

.df-btn-primary:active {
    transform: translateY(0);
}

.df-shortcut {
    font-size: 11px;
    opacity: 0.75;
    font-weight: 400;
}

.df-shortcut kbd {
    background: rgba(255,255,255,0.22);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 3px;
    padding: 1px 4px;
    font-family: inherit;
    font-size: 10px;
}

/* 错误提示 */
.df-error-box {
    margin-top: 8px;
    padding: 8px 10px;
    background: #fff5f5;
    border: 1px solid #ffc7c7;
    border-radius: 6px;
    color: #c0392b;
    font-size: 13px;
}

/* ---- 结果区 ---- */
.df-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid #edf0f5;
    margin-bottom: 10px;
    gap: 8px;
    flex-wrap: wrap;
}

.df-result-title {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
}

.df-result-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.df-result-stat {
    font-size: 12px;
    color: #8a95a3;
}

.df-stat-ok { color: #27ae60; }
.df-stat-err { color: #e74c3c; }
.df-stat-changed { color: #2563eb; }

.df-copy-all-btn {
    padding: 4px 12px;
    border: 1px solid #4a90e2;
    border-radius: 5px;
    background: #f4f8ff;
    color: #4a90e2;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.df-copy-all-btn:hover {
    background: #4a90e2;
    color: #fff;
}

/* 设置摘要栏 */
.df-settings-bar {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e2e8f0;
}

.df-settings-chip {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
    line-height: 1.6;
}

.df-chip-active {
    background: #f0fdf4;
    color: #16a34a;
    border-color: #86efac;
    font-weight: 600;
}

/* 无变更提示 */
.df-no-change-notice {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    color: #16a34a;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
}

/* 结果表格 */
.df-result-table {
    width: 100%;
    font-size: 13px;
}

.df-table-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    background: #f5f7fa;
    border: 1px solid #e3e6ea;
    border-radius: 5px 5px 0 0;
    font-size: 11px;
    font-weight: 700;
    color: #8a95a3;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.df-table-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border: 1px solid #e3e6ea;
    border-top: none;
    background: #fff;
    transition: background 0.15s;
}

.df-table-row:hover {
    background: #f7f9ff;
}

.df-table-row:last-child {
    border-radius: 0 0 5px 5px;
}

.df-row-error {
    background: #fff8f8;
    box-shadow: inset 3px 0 0 #ef4444;
}

.df-row-error:hover {
    background: #fff0f0;
}

.df-col-seq {
    flex-shrink: 0;
    width: 22px;
    text-align: right;
    color: #c0c7d0;
    font-size: 11px;
    font-family: 'Consolas', monospace;
    padding-right: 4px;
}

.df-col-orig {
    flex: 1;
    font-family: 'Consolas', 'Monaco', monospace;
    color: #666;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.df-col-arrow {
    color: #aaa;
    font-size: 12px;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

/* 已变更行 */
.df-row-changed {
    box-shadow: inset 3px 0 0 #22c55e;
}

.df-row-changed .df-fmt-val {
    color: #16a34a;
    font-weight: 700;
}

/* 未变更行 */
.df-row-nochange .df-col-orig,
.df-row-nochange .df-col-arrow {
    opacity: 0.55;
}

.df-row-nochange .df-fmt-val {
    color: #64748b;
    font-weight: 500;
}

.df-col-fmt {
    flex: 1;
    font-family: 'Consolas', 'Monaco', monospace;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.df-fmt-val {
    color: #2c6fad;
}

/* 点击复制的格式化值 */
.df-clickcopy {
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.15s, color 0.15s;
}

.df-clickcopy:hover {
    background: #e8f0fe;
    color: #1a56db;
}

.df-fmt-error {
    color: #c0392b;
    font-weight: normal;
    font-style: italic;
}

.df-col-act {
    flex-shrink: 0;
    width: 28px;
    display: flex;
    justify-content: center;
}

.df-copy-row-btn {
    padding: 2px 5px;
    border: 1px solid #d0d5dd;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    font-size: 11px;
    color: #888;
    transition: all 0.15s;
    opacity: 0;
}

.df-table-row:hover .df-copy-row-btn {
    opacity: 1;
}

.df-copy-row-btn:hover {
    background: #4a90e2;
    border-color: #4a90e2;
    color: #fff;
}

/* 空状态 */
.df-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    color: #b0bbc8;
    gap: 8px;
    text-align: center;
    font-size: 13px;
    line-height: 1.6;
}

.df-empty-icon {
    font-size: 40px;
    margin-bottom: 4px;
}

.df-empty-state kbd {
    background: #f0f4f8;
    border: 1px solid #d0d5dd;
    border-radius: 3px;
    padding: 1px 5px;
    font-family: inherit;
    font-size: 11px;
    color: #666;
}

/* Toast */
.df-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(44, 62, 80, 0.92);
    color: #fff;
    padding: 9px 20px;
    border-radius: 20px;
    font-size: 13px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 9999;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.df-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.df-toast--success { background: rgba(22, 163, 74, 0.93); }
.df-toast--warning { background: rgba(180, 120, 0, 0.93); }
.df-toast--error   { background: rgba(220, 38, 38, 0.93); }

/* 响应式 */
@media (max-width: 768px) {
    .df-two-col {
        flex-direction: column;
    }
    .df-input-panel {
        flex: none;
        border-right: none;
        border-bottom: 1px solid #e3e6ea;
    }
    .df-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
}
