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

/* アクセシビリティ用の視覚的に隠されたラベル */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    text-align: center;
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

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

.main-content {
    display: grid;
    grid-template-columns: 50% 50%;
    gap: 0;
    min-height: 600px;
    overflow: hidden;
}

.input-section,
.output-section {
    padding: 30px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.input-section {
    border-right: 1px solid #eee;
}

.section-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #555;
    font-weight: 600;
}

.textarea {
    flex: 1;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    padding: 15px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    resize: none;
    outline: none;
    transition: border-color 0.3s ease;
}

.textarea:focus {
    border-color: #667eea;
}

.preview {
    flex: 1;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    padding: 15px;
    background: #fafafa;
    overflow: auto;
    max-height: 820px;
    font-size: 14px;
    line-height: 1.6;
    min-width: 0;
}

.stats-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stat-group {
    text-align: left;
    padding: 15px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.stat-group-title {
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: #555;
    font-weight: 600;
}

.stat-line {
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.stat-line:last-child {
    margin-bottom: 0;
}

.stat-number {
    font-weight: 700;
    color: #333;
    font-size: 1.2em;
}

.stat-number.stat-primary {
    color: #667eea;
    font-size: 1.4em;
}

.stat-number.stat-secondary {
    color: #666;
    font-size: 1.2em;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.stat-item:last-child {
    margin-bottom: 0;
}

.stat-label {
    color: #666;
}

.stat-value {
    font-weight: 600;
    color: #333;
}

.rendered-count {
    color: #667eea;
    font-size: 16px;
    font-weight: 700;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .input-section {
        border-right: none;
        border-bottom: 1px solid #eee;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .container {
        margin: 10px;
        width: calc(100% - 20px);
    }

    .stats-header {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }

    .stat-group {
        padding: 12px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-number.stat-primary {
        font-size: 1.7rem;
    }

    .stat-number.stat-secondary {
        font-size: 1rem;
    }
}

/* プレビュー内のマークダウンスタイル */
.preview h1,
.preview h2,
.preview h3,
.preview h4,
.preview h5,
.preview h6 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
    line-height: 1.25;
}

.preview h1 {
    font-size: 2em;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.preview h2 {
    font-size: 1.5em;
}

.preview h3 {
    font-size: 1.25em;
}

.preview p {
    margin-bottom: 16px;
}

.preview ul,
.preview ol {
    margin-bottom: 16px;
    padding-left: 30px;
}

.preview li {
    margin-bottom: 4px;
}

.preview blockquote {
    border-left: 4px solid #ddd;
    padding-left: 16px;
    margin: 16px 0;
    color: #666;
}

.preview code {
    background: #f1f3f4;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.9em;
}

.preview pre {
    background: #f6f8fa;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 16px;
    white-space: pre;
    border: 1px solid #ddd;
    max-width: 100%;
    word-wrap: normal;
}

.preview pre code {
    background: none;
    padding: 0;
    white-space: pre;
    word-break: normal;
    word-wrap: normal;
}

.preview table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 16px;
}

.preview th,
.preview td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.preview th {
    background: #f1f3f4;
    font-weight: 600;
}
