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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
    background-color: #ffffff;
    color: #24292f;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

#editor {
    min-height: 400px;
    outline: none;
    padding: 16px;
    font-size: 16px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
    line-height: 1.6;
}

#editor:empty:before {
    content: "テキストを入力してください...";
    color: #8b949e;
}

/* Markdown styling when detected */
#editor.markdown {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
}

/* Heading styles - GitHub inspired */
#editor.markdown .h1 {
    font-size: 2em;
    font-weight: 600;
    padding-bottom: 0.3em;
    border-bottom: 1px solid #d0d7de;
    margin-bottom: 16px;
    line-height: 1.25;
}

#editor.markdown .h2 {
    font-size: 1.5em;
    font-weight: 600;
    padding-bottom: 0.3em;
    border-bottom: 1px solid #d0d7de;
    margin-top: 24px;
    margin-bottom: 16px;
    line-height: 1.25;
}

#editor.markdown .h3 {
    font-size: 1.25em;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 16px;
    line-height: 1.25;
}

#editor.markdown .h4 {
    font-size: 1em;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 16px;
    line-height: 1.25;
}

#editor.markdown .h5 {
    font-size: 0.875em;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 16px;
    line-height: 1.25;
}

#editor.markdown .h6 {
    font-size: 0.85em;
    font-weight: 600;
    color: #57606a;
    margin-top: 24px;
    margin-bottom: 16px;
    line-height: 1.25;
}

/* Paragraph */
#editor.markdown .paragraph {
    margin-bottom: 16px;
}

/* Code block */
#editor.markdown .code-block {
    background-color: #f6f8fa;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
    font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
    font-size: 85%;
    line-height: 1.45;
    overflow-x: auto;
}

/* Inline code */
#editor.markdown .inline-code {
    background-color: rgba(175, 184, 193, 0.2);
    border-radius: 6px;
    padding: 0.2em 0.4em;
    font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
    font-size: 85%;
}

/* List items */
#editor.markdown .list-item {
    margin-bottom: 8px;
    margin-left: 2em;
}

#editor.markdown .ordered-list-item {
    margin-bottom: 8px;
    margin-left: 2em;
}

/* Blockquote */
#editor.markdown .blockquote {
    padding-left: 1em;
    border-left: 0.25em solid #d0d7de;
    color: #57606a;
    margin-bottom: 16px;
}

/* Links */
#editor.markdown a {
    color: #0969da;
    text-decoration: none;
}

#editor.markdown a:hover {
    text-decoration: underline;
}

/* Bold */
#editor.markdown .bold {
    font-weight: 600;
}

/* Italic */
#editor.markdown .italic {
    font-style: italic;
}

/* Horizontal rule */
#editor.markdown .hr {
    height: 0.25em;
    padding: 0;
    margin: 24px 0;
    background-color: #d0d7de;
    border: 0;
}

/* Table */
#editor.markdown .table {
    border-collapse: collapse;
    margin-bottom: 16px;
    width: 100%;
}

#editor.markdown .table-cell {
    padding: 6px 13px;
    border: 1px solid #d0d7de;
}

#editor.markdown .table-header {
    font-weight: 600;
    background-color: #f6f8fa;
}
