/* =========================================
   創作×歴史 同期年表メーカー 最終決定版CSS
   (入力拡大・上部通知・指定フッター・指定TOPボタン)
   ========================================= */

/* 1. 基本レイアウト */
body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 20px 0 20px;
    background-color: #fcfaf2;
}

h1 {
    border-bottom: 2px solid #8b4513;
    padding-bottom: 10px;
    color: #5d3d21;
    text-align: center;
    margin-bottom: 5px;
}

p {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
}

/* 2. 入力・コントロールセクション */
.input-section {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    margin-bottom: 25px;
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.control-panel:first-child { flex: 2; min-width: 350px; display: flex; flex-direction: column; }
.control-panel:last-child { flex: 1; min-width: 280px; display: flex; flex-direction: column; }

textarea {
    width: 100% !important;
    min-width: 100%;
    max-width: 100%;
    height: 350px; 
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
    background-color: #fafafa;
    box-sizing: border-box;
    resize: vertical;
    margin-top: 10px;
    line-height: 1.6;
}

/* 3. ボタンデザイン */
button { cursor: pointer; border: none; border-radius: 4px; font-weight: bold; transition: all 0.2s ease; }

.btn-generate {
    width: 100%;
    padding: 20px;
    background-color: #8b4513;
    color: #fff;
    font-size: 1.15em;
    margin-top: 10px;
    box-shadow: 0 4px 0 #5d3d21;
}
.btn-generate:hover { background-color: #a0522d; transform: translateY(-1px); }
.btn-generate:active { transform: translateY(2px); box-shadow: none; }

.action-buttons { display: flex; gap: 10px; margin-top: 15px; }
.btn-save, .btn-reset { flex: 1; padding: 12px 5px; font-size: 0.9em; color: #fff; }
.btn-save { background-color: #78909c; }
.btn-reset { background-color: #e57373; }

/* 4. 通知メッセージ（上部配置・アコーディオンの色 #5d3d21 と同期） */
.toast-msg {
    position: fixed;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    /* 背景：アコーディオンと同じ濃い茶色 (#5d3d21) を、少し透けさせて高級感を出す */
    background-color: rgba(93, 61, 33, 0.92); 
    backdrop-filter: blur(4px); /* 背景をわずかにぼかして視認性をアップ */
    color: #ffffff;
    padding: 14px 28px;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: bold;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    pointer-events: none;
    animation: toast-fade-in-top 0.4s ease;
    /* 囲み：細い白の透過枠で、濃い茶色を引き締める */
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes toast-fade-in-top {
    from { opacity: 0; transform: translate(-50%, -20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.toast-msg.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}




/* 5. ガイド・テーブル */
.usage-guide-mini { margin-top: 15px; font-size: 0.85em; padding: 15px; background: #fdfaf0; border: 1px dashed #8b4513; color: #5d3d21; }
.usage-guide { background: #fdfaf0; border: 1px solid #8b4513; border-radius: 8px; padding: 25px; margin-bottom: 30px; color: #5d3d21; text-align: left; }

table { width: 100%; border-collapse: collapse; background: #fff; table-layout: fixed; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
th { background-color: #5d3d21; color: #fff; padding: 14px; text-align: left; position: sticky; top: 0; z-index: 10; }
td { padding: 14px; border-bottom: 1px solid #eee; vertical-align: top; word-wrap: break-word; }

.century-header { background-color: #5d3d21 !important; color: #fff !important; cursor: pointer; }
.century-header td { padding: 12px 15px !important; border-top: 6px solid #fcfaf2 !important; }

.year-col { background-color: #f9f5ec !important; font-weight: bold; color: #8b4513; text-align: center; width: 100px; }
.creation-col { background-color: #fffde7 !important; color: #d32f2f; font-weight: bold; }

/* 6. フッター (指定デザイン) */
#footer {
    text-align: center;
    padding: 20px 20px;
    background: #5d3d21; 
    margin-top: 80px;
    border-top: 5px solid #8b4513;
}
#footer p {
    font-size: 0.9rem; 
    font-weight: bold;
    letter-spacing: 0.15em;
    color: #fff; 
    margin: 0;
}

/* 7. トップへ戻るボタン (アコーディオンの色 #5d3d21) */
.back-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    padding: 12px 24px;
    /* --- 初期状態：背景に馴染むよう薄めの透過 (0.6) --- */
    background-color: rgba(93, 61, 33, 0.6); 
    backdrop-filter: blur(5px); /* ぼかしを少し強めて高級感を出す */
    color: rgba(255, 255, 255, 0.9); /* 文字も少しだけ透けさせて馴染ませる */
    text-decoration: none;
    border-radius: 30px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* 滑らかな動き */
    border: 1px solid rgba(255, 255, 255, 0.3); /* 枠も控えめに */
    display: block;
}

/* --- マウスホバー：ハッキリと「ボタン」であることを示す --- */
.back-to-top:hover {
    /* 不透明度をほぼMAX(0.95)にして、アコーディオンと同じ色をハッキリ出す */
    background-color: rgba(93, 61, 33, 0.95); 
    color: #ffffff; /* 文字をクッキリ白に */
    transform: translateY(-4px); /* 以前より少し多めに浮かす */
    box-shadow: 0 8px 20px rgba(0,0,0,0.3); /* 影を深めて立体感を出す */
    border: 1px solid rgba(255, 255, 255, 0.8); /* 枠を明るくして強調 */
}





@media (max-width: 800px) {
    .input-section { flex-direction: column; }
    th, td { font-size: 12px; padding: 10px; }
}
html { scroll-behavior: smooth; }
