:root {
    --primary: #007AFF;
    --primary-hover: #005bb5;
    --danger: #FF3B30;
    --danger-hover: #d70015;
    --text-main: #1c1c1e;
    --text-muted: #8e8e93;
    --bg-body: #f2f2f7;
    --bg-container: rgba(255, 255, 255, 0.85);
    --border-color: rgba(255, 255, 255, 0.4);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    margin: 0;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.app-wrapper {
    flex: 1;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}
/* Bubble Background */
.bubble-bg {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(0, 122, 255, 0.08);
    animation: float 15s infinite ease-in-out alternate;
    filter: blur(40px);
}
.bubble-1 { width: 400px; height: 400px; top: -100px; left: -100px; }
.bubble-2 { width: 500px; height: 500px; bottom: -150px; right: -100px; animation-delay: -2s; background: rgba(52, 199, 89, 0.08); }
.bubble-3 { width: 300px; height: 300px; bottom: 20%; left: 20%; animation-delay: -5s; background: rgba(255, 59, 48, 0.05); }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, -50px) scale(1.1); }
}
.container {
    background: var(--bg-container);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    width: 98%;
    max-width: 1400px;
    box-sizing: border-box;
    z-index: 1;
}
h1 {
    text-align: center;
    color: var(--text-main);
    margin-top: 0;
    margin-bottom: 5px;
    font-weight: 700;
}
.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 25px;
    font-size: 15px;
}
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
    background: rgba(255,255,255,0.6);
    padding: 15px 20px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.05);
    align-items: center;
    justify-content: center;
}
.toolbar-group {
    display: flex;
    align-items: center;
    gap: 15px;
    border-right: 2px solid #d1d1d6;
    padding-right: 20px;
}
.toolbar-group:last-child {
    border-right: none;
    padding-right: 0;
}
.toolbar label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.toolbar select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #d1d1d6;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    background: rgba(255,255,255,0.8);
    color: var(--text-main);
}
button {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s, transform 0.1s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}
button:active { transform: scale(0.96); }
.btn-primary { background-color: var(--primary); color: white; box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3); }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-secondary { background-color: #e5e5ea; color: var(--text-main); }
.btn-secondary:hover { background-color: #d1d1d6; }
.btn-danger { background-color: var(--danger); color: white; box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3); }
.btn-danger:hover { background-color: var(--danger-hover); }

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}
.input-pane h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: var(--text-main);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pane-controls {
    display: flex;
    gap: 8px;
}
.icon-btn {
    background: rgba(255,255,255,0.6);
    color: var(--text-main);
    border-radius: 6px;
    padding: 8px;
    font-size: 14px;
}
.icon-btn:hover { background: #d1d1d6; }
.icon-btn svg { display: block; }

textarea {
    width: 100%;
    height: 300px;
    padding: 15px;
    border: 1px solid #d1d1d6;
    border-radius: 12px;
    resize: vertical;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s;
    white-space: pre;
    overflow-x: auto;
    line-height: 1.5;
    background: rgba(255,255,255,0.8);
    color: var(--text-main);
}
textarea:focus { 
    border-color: var(--primary); 
    outline: none; 
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15); 
}

.diff-container {
    border: 1px solid #d1d1d6;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    margin-top: 10px;
}
.diff-header {
    background: rgba(255,255,255,0.6);
    padding: 12px 15px;
    font-weight: 600;
    color: var(--text-main);
    border-bottom: 1px solid #d1d1d6;
    display: flex;
    justify-content: space-between;
}
.summary-container {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: rgba(255,255,255,0.4);
    border-bottom: 1px solid #d1d1d6;
}
.summary-box {
    flex: 1;
    background: white;
    border: 1px solid #d1d1d6;
    border-radius: 6px;
    padding: 12px;
    max-height: 120px;
    overflow-y: auto;
}
.summary-title {
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.summary-title.added { color: #22863a; }
.summary-title.removed { color: #cb2431; }
.summary-chip {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 12px;
    margin: 2px;
    font-family: 'Consolas', 'Courier New', monospace;
    word-break: break-word;
}
.summary-chip.added { background: #e6ffec; color: #22863a; border: 1px solid #b2e8c0; }
.summary-chip.removed { background: #ffebe9; color: #cb2431; border: 1px solid #ffc1c7; }
.split-view {
    display: flex;
    width: 100%;
}
.split-pane {
    flex: 1;
    width: 50%;
    overflow-x: auto;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
}
.split-pane:first-child { border-right: 1px solid #d1d1d6; }

.inline-view {
    padding: 15px 0;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    overflow-x: auto;
}
.inline-view.word-mode {
    padding: 15px;
    white-space: pre-wrap;
    word-break: break-word;
}

.removed { background-color: #ffebe9; color: #cb2431; }
.added { background-color: #e6ffec; color: #22863a; }
.inline-view.word-mode .removed, .split-pane.word-mode .removed { text-decoration: line-through; opacity: 0.8; }

.line { display: flex; white-space: pre; width: 100%; min-width: max-content; }
.line-num {
    width: 35px;
    min-width: 35px;
    text-align: right;
    padding-right: 10px;
    color: var(--text-muted);
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    margin-right: 10px;
    user-select: none;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.inline-view .line .line-num:nth-child(2) { margin-right: 15px; }

.line.removed { background: #ffebe9; }
.line.added { background: #e6ffec; }
.line.empty { background: #f8f9fa; }

.line.removed .line-num { background: #ffdce0; border-color: #ffc1c7; color: #cb2431; }
.line.added .line-num { background: #cdffd8; border-color: #b2e8c0; color: #22863a; }
.line.empty .line-num { background: #f8f9fa; border-color: #e0e0e0; }

.line .content { padding-right: 15px; flex: 1; }

.split-pane.word-mode { padding: 15px; white-space: pre-wrap; word-break: break-word; }

.hidden { display: none !important; }

.info-container {
    background: var(--bg-container);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    width: 98%;
    max-width: 1200px;
    box-sizing: border-box;
    z-index: 1;
    margin-top: 30px;
}
.info-container h2 {
    color: var(--text-main);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 22px;
}
.info-container p, .info-container li {
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 10px;
    font-size: 15px;
}
.faq-item {
    border-bottom: 1px solid rgba(0,0,0,0.1);
    margin-bottom: 10px;
}
.faq-item:last-child {
    border-bottom: none;
}
.faq-question {
    width: 100%;
    max-width: none;
    margin: 0;
    background: none;
    border: none;
    text-align: left;
    padding: 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: inherit;
    box-shadow: none !important;
    border-radius: 0;
}
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.faq-answer p {
    padding-bottom: 15px;
    color: var(--text-muted);
    margin: 0;
}
.arrow {
    transition: transform 0.3s;
    font-size: 12px;
}
.faq-item.active .arrow {
    transform: rotate(180deg);
}

@media (max-width: 950px) {
    .input-grid { grid-template-columns: 1fr; }
    .toolbar-group {
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid #d1d1d6;
        padding-bottom: 10px;
        width: 100%;
        justify-content: center;
    }
    .toolbar-group:last-child { border-bottom: none; padding-bottom: 0; }
    .summary-container { flex-direction: column; }
    .split-view { flex-direction: column; }
    .split-pane { width: 100%; }
    .split-pane:first-child { border-right: none; border-bottom: 1px solid #d1d1d6; }
}