body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
}

header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 1rem;
    text-align: center;
}

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

.layout-container {
    display: none;
}

body.pc #pc-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

body.sp #sp-layout {
    display: block;
}

/* PC Layout */
#pc-layout {
    justify-content: center;
}

.file-panel {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    flex: 1 1 45%;
    min-width: 300px;
}

.merge-panel {
    flex-basis: 100%;
    text-align: center;
    margin-top: 1rem;
}

/* SP Layout */
.step {
    display: none;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
}

.step.active {
    display: block;
}

.nav-button {
    margin-top: 1rem;
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
}

.summary {
    margin: 1.5rem 0;
    line-height: 1.6;
}

#sp-download-button {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
}

/* Common Styles */
h2 {
    margin-top: 0;
    font-size: 1.2rem;
    color: #555;
}

.drop-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background-color: var(--drop-area-bg);
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

.drop-area:hover,
.drop-area.dragover {
    background-color: var(--drop-area-hover);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-info {
    margin-top: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.file-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

button:hover {
    background-color: var(--accent-hover);
}

button:disabled {
    background-color: #aaa;
    cursor: not-allowed;
}

.error-message {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--error-bg);
    color: var(--error-text);
    padding: 1rem;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.hidden {
    display: none !important;
}

/* Conflict Modal */
.modal-overlay {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.modal-body {
    padding: 15px 0;
    overflow-y: auto;
}

.conflict-thread-info {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 15px;
    word-break: break-all;
}

.conflict-note {
    font-size: 0.8em;
    color: #888;
    text-align: center;
    margin-bottom: 15px;
}

.conflict-comparison {
    display: flex;
    gap: 20px;
}

.conflict-version {
    flex: 1;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 5px;
    background: #f9f9f9;
}

.conflict-version h3 {
    margin-top: 0;
    font-size: 1em;
}

.conflict-version button {
    width: 100%;
    margin-top: 10px;
}

.conflict-version pre {
    white-space: pre-wrap;
    word-break: break-all;
    background: #fff;
    padding: 5px;
    border-radius: 3px;
    border: 1px solid #eee;
    max-height: 150px;
    overflow-y: auto;
}

.conflict-section {
    margin-bottom: 20px;
}

.conflict-section-title {
    font-weight: bold;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.conflict-radio-group label {
    display: block;
    margin-bottom: 5px;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    cursor: pointer;
}

.conflict-radio-group label:hover {
    background: #f0f0f0;
}

.conflict-radio-group pre {
    margin-top: 5px;
    font-size: 0.9em;
    white-space: pre-wrap;
    word-break: break-all;
}

.modal-footer {
    text-align: right;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}