.reviewer-layout {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* --- 入力セクション --- */
.input-section {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

/* オプションエリア */
.review-options {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option-row {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.option-label {
    font-weight: bold;
    color: #475569;
    min-width: 180px;
    font-size: 14px;
}

/* トグルボタン */
.toggle-group {
    display: flex;
    background: #e2e8f0;
    border-radius: 8px;
    padding: 4px;
}
.toggle-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: #64748b;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}
.toggle-btn.active {
    background: #fff;
    color: #4f46e5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* チェックボックス */
.checkbox-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}
.check-label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 14px;
    color: #334155;
}

/* テキスト入力 */
.text-input {
    flex-grow: 1;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
}
.text-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* 入力エリア本体 */
.smart-input-area {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    background: #fff;
    transition: all 0.3s;
    min-height: 250px;
    margin-bottom: 25px;
}
.smart-input-area.drag-over {
    border-color: #4f46e5;
    background: #e0e7ff;
}

#codeInput {
    width: 100%;
    height: 100%;
    min-height: 250px;
    padding: 20px;
    border: none;
    background: transparent;
    resize: vertical;
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    box-sizing: border-box;
}
#codeInput:focus {
    outline: none;
}

/* 画像プレビュー */
#imagePreviewWrapper {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}
#imagePreview {
    max-width: 90%;
    max-height: 90%;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.clear-btn {
    position: absolute;
    top: 10px; right: 10px;
    background: #ef4444;
    color: white;
    border: none;
    width: 30px; height: 30px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* 実行ボタン */
.review-execute-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.review-execute-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}
.review-execute-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ローディング */
.loader {
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    width: 20px; height: 20px;
    animation: spin 1s linear infinite;
}

/* --- 結果表示エリア --- */
.result-section {
    animation: fadeIn 0.4s ease;
}
.result-heading {
    font-size: 22px;
    color: #1e293b;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* 指摘カード (GitHub風) */
.review-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 5px solid #f59e0b; /* デフォルトは警告(オレンジ) */
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.card-header {
    background: #f8fafc;
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    font-weight: bold;
    font-size: 16px;
    color: #0f172a;
}

.card-body {
    padding: 20px;
    color: #334155;
    line-height: 1.6;
}

/* Before / After 比較エリア */
.code-comparison {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}
.code-box {
    flex: 1;
    min-width: 0; /* flexアイテムのはみ出し防止 */
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}
.code-box-title {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
}
.before-box .code-box-title { background: #ef4444; } /* 赤 */
.after-box .code-box-title { background: #10b981; } /* 緑 */

.code-box pre {
    margin: 0;
    padding: 15px;
    background: #1e293b;
    color: #f8fafc;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    overflow-x: auto;
}

/* ダークモード対応 */
body.dark-mode .input-section { background: #1e1e1e; border-color: #333; }
body.dark-mode .review-options { background: #252627; border-color: #333; }
body.dark-mode .option-label { color: #cbd5e1; }
body.dark-mode .toggle-group { background: #333; }
body.dark-mode .toggle-btn { color: #94a3b8; }
body.dark-mode .toggle-btn.active { background: #4f46e5; color: #fff; }
body.dark-mode .check-label { color: #cbd5e1; }
body.dark-mode .text-input { background: #333; border-color: #444; color: #fff; }
body.dark-mode .smart-input-area { background: #252627; border-color: #444; }
body.dark-mode #codeInput { color: #e2e8f0; }
body.dark-mode .result-heading { color: #e2e8f0; border-color: #333; }
body.dark-mode .review-card { background: #1e1e1e; border-color: #333; }
body.dark-mode .card-header { background: #252627; border-color: #333; color: #e2e8f0; }
body.dark-mode .card-body { color: #cbd5e1; }
body.dark-mode .code-box { border-color: #444; }

/* レスポンシブ (スマホ) */
@media (max-width: 768px) {
    .code-comparison {
        flex-direction: column; /* スマホでは上下に積む */
    }
    .option-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}