/* ========================================
   文本对比工具样式
   ======================================== */

/* 主内容 */
.main-content { 
    width: 100%; 
    max-width: 1200px;
    height: calc(100vh - 120px); 
    display: flex; 
    align-items: center; 
    padding: 0 20px; 
    padding-bottom: 50px; 
    z-index: 10; 
}
.container { width: 100%; height: 100%; display: flex; flex-direction: column; }
.tool-card { 
    background: var(--bg-card); 
    border: 1px solid var(--border-color); 
    border-radius: var(--radius-xl); 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    width: 100%;
    height: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* 顶部工具栏 */
.toolbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 10px 16px; 
    border-bottom: 1px solid var(--border-color); 
    background: rgba(0,0,0,0.2); 
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 10px;
}
.actions-left, .actions-right { display: flex; align-items: center; gap: 10px; }

.btn-action { 
    padding: 8px 16px; 
    border-radius: var(--radius-md); 
    border: 1px solid var(--border-color); 
    background: rgba(255,255,255,0.05); 
    color: var(--text-secondary); 
    cursor: pointer; 
    font-size: 13px; 
    display: flex; 
    align-items: center; 
    gap: 6px;
    transition: 0.2s;
}
.btn-action:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.btn-action.btn-blue { background: rgba(59, 130, 246, 0.2); border-color: rgba(59, 130, 246, 0.3); color: #60a5fa; }
.btn-action.btn-blue:hover { background: rgba(59, 130, 246, 0.3); }

.toggle-option {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--text-secondary);
    cursor: pointer; user-select: none;
}
.toggle-option input { cursor: pointer; }

/* 输入区 */
.editor-container {
    display: flex;
    flex: 1; /* 占满剩余高度 */
    min-height: 0;
    overflow: hidden;
}
.editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.editor-panel:not(:last-child) { border-right: 1px solid var(--border-color); }

.panel-header {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}

textarea {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    font-family: var(--font-mono, 'Consolas', 'Monaco', monospace);
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary);
    overflow: auto;
}
textarea::placeholder { color: var(--text-muted); }

/* 结果区样式 (直接嵌入面板) */
.diff-content {
    flex: 1;
    padding: 16px;
    overflow: auto;
    font-family: var(--font-mono, 'Consolas', 'Monaco', monospace);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    background: rgba(0,0,0,0.1); /* 稍微区分一下输入框 */
    cursor: text; /* 保持光标样式提示这是文本区域 */
}

/* Diff 高亮 */
.diff-added {
    background-color: rgba(20, 184, 166, 0.2);
    color: var(--primary-color);
    text-decoration: none;
    padding: 2px 0;
    border-radius: 2px;
}
.diff-removed {
    background-color: rgba(20, 184, 166, 0.2);
    color: #f87171;
    text-decoration: line-through;
    padding: 2px 0;
    border-radius: 2px;
    opacity: 0.8;
}
.diff-equal {
    color: var(--text-muted);
}

/* 响应式 */
@media (max-width: 768px) {
    .editor-container { flex-direction: column; height: auto; flex: 0 0 auto; }
    .editor-panel:not(:last-child) { border-right: none; border-bottom: 1px solid var(--border-color); }
    .editor-panel { min-height: 120px; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .actions-left, .actions-right { justify-content: space-between; }
}
