/**
 * 共通CSSスタイル
 */

/* 基本リセット */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

/* コンテナ（統一された幅と余白） */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

/* コンテンツエリア（統一された余白） */
.content {
    padding: 40px 30px;
}

/* セクション（統一されたスタイル） */
.section {
    margin-bottom: 25px;
    padding: 24px 0;
}

.section-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

/* ヘッダー */
.header {
    background: 
        linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.5) 100%),
        url('https://images.unsplash.com/photo-1573496359142-b8d87734a5a2?w=1200&h=400&fit=crop') center center / cover;
    color: #333;
    padding: 60px 30px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    overflow: hidden;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-content p {
    white-space: pre-line;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
    color: #333;
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.9), 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.beta-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    font-size: 0.4em;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(238, 90, 111, 0.4);
    text-shadow: none;
    vertical-align: middle;
    line-height: 1.2;
}

.header h2 {
    font-size: 1.5em;
    margin-top: 10px;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    text-shadow: 0 2px 6px rgba(255, 255, 255, 0.9), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.header p {
    font-size: 1.1em;
    opacity: 0.95;
    color: #333;
    text-shadow: 0 2px 6px rgba(255, 255, 255, 0.9), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.breadcrumb {
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    color: #666;
    font-size: 0.95em;
    background: white;
    border-bottom: 1px solid #f0f0f0;
}

.breadcrumb a {
    color: #c85a7a;
    text-decoration: none;
    font-weight: 700;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-divider {
    color: #c85a7a;
    font-weight: 600;
}

.breadcrumb-current {
    color: #333;
    font-weight: 600;
}

/* メニュートグルボタン */
.menu-toggle {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 1001;
    transition: background 0.2s;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 1);
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ユーザー情報（ヘッダー右上） */
.user-info {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1001;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
}

.user-name {
    color: #333;
    font-weight: 600;
    font-size: 0.95em;
    text-shadow: 0 2px 6px rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.3s ease;
}

.user-name:hover {
    color: #c85a7a;
    text-decoration: underline;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.9);
    color: #c85a7a;
    border: 1px solid #e0e0e0;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    line-height: 1;
}

.logout-btn:hover {
    background: white;
    border-color: #c85a7a;
}

/* ログインボタン（ヘッダー右上） */
.login-btn-header {
    background: rgba(255, 255, 255, 0.9);
    color: #c85a7a;
    border: 1px solid #e0e0e0;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.login-btn-header:hover {
    background: white;
    border-color: #c85a7a;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(200, 90, 122, 0.2);
}

/* ナビゲーションメニュー */
.nav-menu {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: left 0.3s ease;
    padding: 60px 20px 20px;
    overflow-y: auto;
}

.nav-menu.active {
    left: 0;
}

.nav-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.nav-menu-overlay.active {
    display: block;
}

.nav-menu-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.nav-menu-header h3 {
    color: #333;
    margin-bottom: 15px;
}

.user-info-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.user-avatar-menu {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    object-fit: cover;
}

.user-name-menu {
    color: #333;
    font-weight: 600;
    font-size: 0.95em;
    text-decoration: none;
    transition: color 0.3s ease;
}

.user-name-menu:hover {
    color: #c85a7a;
    text-decoration: underline;
}

.nav-menu-links {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.nav-menu-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-menu-group-title {
    font-size: 0.85em;
    font-weight: 700;
    color: #c85a7a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    padding: 0 4px;
}

.nav-link-menu {
    color: #333;
    text-decoration: none;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.95em;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-link-menu:hover {
    background: #e9ecef;
}

.nav-menu-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.logout-btn-menu {
    margin-top: 20px;
    padding: 12px 16px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
    width: 100%;
    transition: background 0.2s;
    text-decoration: none;
    display: block;
    text-align: center;
}

.logout-btn-menu:hover {
    background: #c0392b;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .header {
        min-height: 250px;
        padding: 40px 20px;
    }

    .header h1 {
        font-size: 2em;
    }

    .header h2 {
        font-size: 1.3em;
    }
}

/* マークダウン変換結果のスタイル */
.result-content,
.diagnosis-result {
    line-height: 1.8;
    color: #333;
    font-weight: 500; /* 400 → 500 に変更 */
}

.result-content h1,
.result-content h2,
.result-content h3,
.result-content h4,
.result-content h5,
.diagnosis-result h1,
.diagnosis-result h2,
.diagnosis-result h3,
.diagnosis-result h4,
.diagnosis-result h5 {
    margin-top: 24px;
    margin-bottom: 12px;
    color: #c85a7a;
    font-weight: 700; /* 見出しは700 */
}

.result-content h1,
.diagnosis-result h1 {
    font-size: 1.8em;
}

.result-content h2,
.diagnosis-result h2 {
    font-size: 1.5em;
}

.result-content h3,
.diagnosis-result h3 {
    font-size: 1.3em;
    font-weight: 700;
}

.result-content h4,
.diagnosis-result h4 {
    font-size: 1.1em;
    font-weight: 700;
}

.result-content h5,
.diagnosis-result h5 {
    font-size: 1em;
    font-weight: 700;
}

.result-content h1:first-child,
.result-content h2:first-child,
.result-content h3:first-child,
.result-content h4:first-child,
.result-content h5:first-child,
.diagnosis-result h1:first-child,
.diagnosis-result h2:first-child,
.diagnosis-result h3:first-child,
.diagnosis-result h4:first-child,
.diagnosis-result h5:first-child {
    margin-top: 0;
}

.result-content ul,
.result-content ol,
.diagnosis-result ul,
.diagnosis-result ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.result-content li,
.diagnosis-result li {
    margin-bottom: 8px;
}

.result-content p,
.diagnosis-result p {
    margin-bottom: 16px;
    font-weight: 500; /* 400 → 500 に変更 */
}

.result-content strong,
.diagnosis-result strong {
    color: #c85a7a;
    font-weight: 600;
}

.result-content code,
.diagnosis-result code {
    background: #fafafa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #333;
    border: 1px solid #e0e0e0;
}

.result-content blockquote,
.diagnosis-result blockquote {
    border-left: 3px solid #c85a7a;
    padding-left: 15px;
    margin-left: 0;
    color: #666;
    font-style: italic;
    background: #fafafa;
    padding: 10px 15px;
    border-radius: 4px;
}

.result-content hr,
.diagnosis-result hr {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin: 24px 0;
}

/* アコーディオン（折りたたみ）スタイル */
.accordion {
    margin-bottom: 16px;
}

.accordion-header {
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #333;
    transition: all 0.2s ease;
}

.accordion-header:hover {
    background: #e9ecef;
}

.accordion-header.active {
    background: #fff;
    border-color: #c85a7a;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.accordion-icon {
    transition: transform 0.2s ease;
    font-size: 1.2em;
    color: #c85a7a;
}

.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 6px 6px;
}

.accordion-content.active {
    max-height: 5000px;
    padding: 16px;
}

/* 重要ポイント要約スタイル */
.summary-points {
    background: #fff5f8;
    border-left: 4px solid #c85a7a;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 24px;
}

.summary-points h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.2em;
    font-weight: 700;
    color: #c85a7a;
}

.summary-points ul {
    margin: 0;
    padding-left: 20px;
}

.summary-points li {
    margin-bottom: 8px;
    font-weight: 500;
}

