*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #79b8ff;
    --added-bg: rgba(63, 185, 80, 0.15);
    --added-border: #3fb950;
    --removed-bg: rgba(248, 81, 73, 0.15);
    --removed-border: #f85149;
    --border: #30363d;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header { text-align: center; padding: 2rem 1rem 1rem; }
header h1 { font-size: 2rem; font-weight: 700; }
.subtitle { color: var(--text-secondary); margin-top: 0.5rem; }

main { flex: 1; max-width: 1200px; width: 100%; margin: 0 auto; padding: 1rem; }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: center;
}

.diff-stats { color: var(--text-secondary); font-size: 0.85rem; margin-left: auto; }

.btn {
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s;
}

.btn:hover { background: var(--border); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }

.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.editor-panel label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

textarea {
    width: 100%;
    height: 250px;
    font-family: var(--mono);
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    resize: vertical;
}

textarea:focus { outline: none; border-color: var(--accent); }
textarea::placeholder { color: var(--text-secondary); opacity: 0.6; }

.diff-output {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    font-family: var(--mono);
    font-size: 0.85rem;
    line-height: 1.6;
}

.diff-line {
    padding: 2px 1rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.diff-line.added {
    background: var(--added-bg);
    border-left: 3px solid var(--added-border);
}

.diff-line.removed {
    background: var(--removed-bg);
    border-left: 3px solid var(--removed-border);
}

.diff-line.unchanged {
    color: var(--text-secondary);
    border-left: 3px solid transparent;
}

.line-num {
    display: inline-block;
    width: 40px;
    color: var(--text-secondary);
    text-align: right;
    margin-right: 1rem;
    user-select: none;
    opacity: 0.5;
}

.info-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.info-section h2 { font-size: 1.25rem; margin-bottom: 0.75rem; }
.info-section p, .info-section li { color: var(--text-secondary); line-height: 1.7; }
.info-section ul { margin-top: 0.5rem; padding-left: 1.5rem; }
.info-section li { margin-bottom: 0.25rem; }

.ad-placeholder { margin: 2rem 0; min-height: 100px; }

footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
    header h1 { font-size: 1.5rem; }
    .editor-container { grid-template-columns: 1fr; }
    textarea { height: 150px; }
}
