:root { --bg-color: #f4f7f9; --accent-color: #007bff; --del-color: #dc3545; --del-bg: #f8d7da; --ins-color: #28a745; --ins-bg: #d4edda; --text-color: #333; }
body { font-family: "Segoe UI", Roboto, "Microsoft YaHei", sans-serif; background-color: var(--bg-color); margin: 0; display: flex; flex-direction: column; height: 100vh; overflow: hidden; color: var(--text-color); }

/* Header */
header { background: #fff; padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e0e0e0; box-shadow: 0 2px 6px rgba(0,0,0,0.04); z-index: 20; }
.brand { font-size: 20px; font-weight: 700; color: #2c3e50; display: flex; align-items: center; gap: 10px; }
.tag { font-size:12px; background:#eef2f5; padding:2px 8px; border-radius:12px; color:#6c757d; border:1px solid #dee2e6; font-weight: normal; }

.toolbar { display: flex; align-items: center; gap: 20px; }
.stats-panel { font-size: 13px; background: #f8f9fa; padding: 8px 16px; border-radius: 6px; border: 1px solid #dee2e6; display: flex; gap: 16px; }
.stat-item b { font-weight: 700; }

/* Controls */
.control-group { display: flex; align-items: center; gap: 15px; padding-left: 20px; border-left: 1px solid #e0e0e0; }
.checkbox-wrapper { display: flex; flex-direction: row; gap: 4px; }
.toggle-label { font-size: 12px; user-select: none; display: flex; align-items: center; gap: 6px; cursor: pointer; color: #555; }
.toggle-label:hover { color: var(--accent-color); }

.nav-btn-group { display: flex; gap: 5px; }
.nav-btn { font-size: 14px; background: #fff; border: 1px solid #ced4da; border-radius: 4px; width: 128px; height: 32px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; color: #555; }
.nav-btn:hover { color: var(--accent-color); border-color: var(--accent-color); background: #f0f8ff; }
.nav-btn:active { transform: scale(0.95); }

/* Layout */
.main-layout { display: flex; flex: 1; padding: 20px; gap: 20px; height: calc(100vh - 64px); box-sizing: border-box; }
.input-column { display: flex; flex-direction: column; width: 35%; min-width: 350px; gap: 15px; }

.text-wrapper { flex: 1; display: flex; flex-direction: column; background: #fff; border-radius: 8px; border: 1px solid #ced4da; overflow: hidden; position: relative; transition: box-shadow 0.2s; }
.text-wrapper.active-source { border-color: var(--accent-color); box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15); }

.panel-header { background: #f8f9fa; padding: 10px 15px; border-bottom: 1px solid #e0e0e0; font-size: 15px; font-weight: 600; color: #495057; display: flex; justify-content: space-between; align-items: center; }
.span-filename{ font-family: "宋体"; font-size: 12px; }

textarea { flex: 1; border: none; padding: 15px; resize: none; outline: none; font-family: "Consolas", "Monaco", monospace; font-size: 14px; line-height: 1.6; color: #333; }

.drag-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 123, 255, 0.05); border: 2px dashed var(--accent-color); display: flex; align-items: center; justify-content: center; font-weight: 600; color: var(--accent-color); z-index: 10; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.text-wrapper.drag-active .drag-overlay { opacity: 1; }
.loading-overlay { position: absolute; top:0; left:0; right:0; bottom:0; background:rgba(255,255,255,0.95); z-index:20; display:flex; flex-direction:column; align-items:center; justify-content:center; font-size:14px; display:none; color: #555; }

/* Compact Buttons */
.action-column { display: flex; flex-direction: column; justify-content: center; gap: 12px; min-width: 70px; }
.btn-action { 
	width: 80px; height: 80px; border-radius: 8px; border: none; cursor: pointer; 
	font-size: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; 
	gap: 4px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); transition: all 0.2s; padding: 0;
}
.btn-icon { font-size: 22px; margin-bottom: 2px; }
.btn-run { background: var(--accent-color); color: white; }
.btn-run:hover { background: #0056b3; transform: translateY(-1px); }
.btn-clear { background: white; border: 1px solid #ced4da; color: #495057; }
.btn-clear:hover { color: #dc3545; border-color: #dc3545; background: #fff5f5; }

/* Result */
.result-wrapper { flex: 1; background: #fff; border-radius: 8px; border: 1px solid #ced4da; display: flex; flex-direction: column; overflow: hidden; }
#result-container { flex: 1; overflow-y: auto; padding: 40px; font-family: "Georgia", "SimSun", serif; font-size: 16px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; scroll-behavior: smooth; }

del { color: var(--del-color); background-color: var(--del-bg); text-decoration: line-through; border-radius: 2px; padding: 0 2px; }
ins { color: var(--ins-color); background-color: var(--ins-bg); text-decoration: none; border-bottom: 2px solid var(--ins-color); padding: 0 2px; border-radius: 2px; }
.diff-focus { outline: 3px solid #ffc107; outline-offset: 2px; border-radius: 2px; background-color: rgba(255, 193, 7, 0.1); }

.export-btn-group { display:flex; gap:8px; }
.btn-export { font-size:14px; padding:5px 12px; border:1px solid #ced4da; background:#fff; cursor:pointer; border-radius:4px; color: #555; display:flex; align-items:center; gap:4px; transition:all 0.2s; }
.btn-export:hover { border-color: var(--accent-color); color: var(--accent-color); background: #f0f8ff; }

@media (max-width: 1024px) { 
	.main-layout { flex-direction: column; height: auto; } 
	.input-column { width: 100%; flex-direction: row; height: 300px; } 
	.action-column { flex-direction: row; width: 100%; justify-content: flex-end; } 
	.btn-action { width: auto; height: 40px; flex-direction: row; padding: 0 15px; font-size: 14px; }
	.btn-icon { font-size: 16px; margin-bottom: 0; }
	header { height: auto; padding: 15px; flex-wrap: wrap; gap: 15px; }
}

 /* 隐藏原生 file 输入框（仅不显示，仍可被程序触发） */
#fileInput {
	display: none;
}