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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    background: transparent;
}

header {
    color: #ffffff;
    padding: 30px;
    text-align: center;
    margin-bottom: 0;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.2;
}

.tool-name {
    font-size: 1.4rem;
    font-weight: 500;
    opacity: 0.85;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* USPセクションのスタイル */
.usp-section {
    margin-top: 30px;
}

.usp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.usp-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.usp-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}


.usp-item:hover .usp-icon svg {
    stroke: #ffffff;
    transform: scale(1.1);
}

.usp-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.usp-icon svg {
    width: 24px;
    height: 24px;
    stroke: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.usp-content {
    flex: 1;
}

.usp-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 5px 0;
    line-height: 1.3;
}

.usp-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    line-height: 1.4;
}

main {
    padding: 30px;
}

/* 新しい設定セクション */
.settings-section {
    margin-bottom: 30px;
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.settings-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    text-align: center;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.setting-card {
    background: #f7f9fc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.setting-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.setting-header {
    margin-bottom: 15px;
}

.setting-label {
    font-weight: 600;
    color: #2d3748;
    font-size: 1.1rem;
}

.setting-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.setting-select:hover {
    border-color: #cbd5e0;
}

.setting-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.setting-checkbox {
    width: 20px;
    height: 20px;
    accent-color: #667eea;
    cursor: pointer;
}

.checkbox-text {
    font-size: 1rem;
    color: #4a5568;
    font-weight: 500;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* チェック結果表示エリア */
.validation-results {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    margin-bottom: 25px;
}

.validation-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    text-align: center;
}

.validation-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.validation-item {
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid;
}

.validation-item.error {
    background: #fed7d7;
    border-left-color: #e53e3e;
    color: #742a2a;
}

.validation-item.warning {
    background: #fef5e7;
    border-left-color: #dd6b20;
    color: #744210;
}

.validation-item.info {
    background: #ebf8ff;
    border-left-color: #3182ce;
    color: #2a4365;
}

.validation-item.success {
    background: #c6f6d5;
    border-left-color: #38a169;
    color: #22543d;
}

.validation-type {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.validation-message {
    margin-bottom: 8px;
    line-height: 1.5;
}

.validation-suggestion {
    font-style: italic;
    opacity: 0.8;
    font-size: 0.9rem;
    white-space: pre-line;
}

.validation-details {
    margin-top: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}




/* 新しいエディター統計スタイル */
.editor-stats {
    margin-top: 10px;
    padding: 8px 15px;
    background: #f7f9fc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-size: 0.9rem;
    color: #718096;
    text-align: right;
}

.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.editor-panel {
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 5px;
}

.panel-header h2 {
    font-size: 1.2rem;
    color: #2d3748;
    font-weight: 600;
}

.panel-actions {
    display: flex;
    gap: 10px;
}

/* コードエディター */
.code-editor {
    position: relative;
    display: flex;
    width: 100%;
    height: 400px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #fafbfc;
    overflow: hidden;
    transition: all 0.3s ease;
}

.code-editor:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

.line-numbers {
    background: #f0f2f5;
    color: #8b949e;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    text-align: right;
    padding: 20px 8px 20px 12px;
    border-right: 1px solid #e2e8f0;
    user-select: none;
    min-width: 50px;
    white-space: pre;
    overflow: hidden;
}

textarea {
    flex: 1;
    height: 100%;
    padding: 20px;
    border: none;
    border-radius: 0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    background: transparent;
    outline: none;
    white-space: pre;
    overflow-wrap: normal;
    word-break: normal;
    width: 0;
    min-width: 0;
}

textarea[readonly] {
    cursor: default;
}

.code-editor[readonly] .line-numbers {
    background: #f7f9fc;
}

/* 変更箇所ハイライト */
.code-output {
    white-space: pre;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    padding: 20px;
    overflow-y: auto;
    overflow-x: auto;
    background: transparent;
    flex: 1;
    height: 100%;
    min-height: 360px;
    width: 0;
    min-width: 0;
}

.code-output:empty::before {
    content: attr(data-placeholder);
    color: #a0a0a0;
    font-style: italic;
}

.highlight-added {
    background-color: #d4edda;
    border-left: 3px solid #28a745;
    padding: 1px 3px;
    margin: -1px 0;
    display: inline-block;
    min-width: 1px;
}

.highlight-removed {
    display: none;
}

.highlight-modified {
    background-color: #fff3cd;
    border-left: 3px solid #ffc107;
    padding: 1px 3px;
    margin: -1px 0;
    display: inline-block;
    min-width: 1px;
}

.action-bar {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    grid-column: 1 / -1;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    padding: 15px 40px;
    font-size: 1.1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: white;
    color: #4a5568;
    border: 2px solid #e2e8f0;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background: #f7f9fc;
    border-color: #cbd5e0;
}


.error-message {
    display: none;
    padding: 15px 20px;
    background: #fed7d7;
    color: #c53030;
    border-radius: 10px;
    margin-top: 20px;
    border-left: 4px solid #fc8181;
}

.error-message.show {
    display: block;
    animation: slideIn 0.3s ease;
}

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

footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.5rem 0;
    margin-top: auto;
    text-align: center;
    color: #ffffff;
}

footer a {
    color: #ffffff;
    text-decoration: none;
}

footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* レスポンシブデザイン */
@media (max-width: 1024px) and (min-width: 769px) {
    /* タブレット用スタイル */
    .usp-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
    
    .usp-item {
        padding: 18px;
    }
    
    .usp-icon {
        width: 45px;
        height: 45px;
    }
    
    .usp-icon svg {
        width: 22px;
        height: 22px;
    }
    
    .usp-title {
        font-size: 1rem;
    }
    
    .usp-text {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .container {
        border-radius: 0;
        min-height: 100vh;
    }
    
    body {
        padding: 0;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .tool-name {
        font-size: 1.1rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    /* スマホ用USPスタイル */
    .usp-section {
        margin-top: 25px;
    }
    
    .usp-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 10px;
    }
    
    .usp-item {
        padding: 16px;
        gap: 12px;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .usp-icon {
        width: 40px;
        height: 40px;
    }
    
    .usp-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .usp-title {
        font-size: 0.95rem;
        margin-bottom: 3px;
    }
    
    .usp-text {
        font-size: 0.8rem;
        line-height: 1.3;
    }
    
    .editor-container {
        grid-template-columns: 1fr;
    }
    
    .code-editor {
        height: 300px;
    }
    
    .line-numbers {
        padding: 15px 6px 15px 8px;
        min-width: 40px;
        font-size: 13px;
    }
    
    textarea {
        padding: 15px;
        font-size: 13px;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .checkbox-group {
        gap: 8px;
    }
    
    .checkbox-text {
        font-size: 0.9rem;
    }
    
    .stats {
        justify-content: center;
    }
    
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .panel-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
}

/* 通知メッセージ */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background: #48bb78;
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* エラー行クリック機能 */
.clickable-line {
    cursor: pointer;
    transition: background-color 0.2s ease;
    padding: 2px 4px;
    border-radius: 3px;
}

.clickable-line:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.clickable-line:active {
    background-color: rgba(0, 0, 0, 0.1);
}