body {
    background: #f7f7fa;
    font-family: 'Segoe UI', 'Hiragino Sans', 'Meiryo', sans-serif;
    color: #222;
    margin: 0;
    padding: 0;
}

header {
    background: linear-gradient(90deg, #0b4bc2 0%, #6fc4a1 100%);
    padding: 16px 0;
    box-shadow: 0 2px 6px rgba(40, 60, 120, 0.04);
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    border-radius: 0 0 24px 24px;
}

h1 {
    color: #fff;
    padding: 0;
    margin: 0;
    text-align: center;
    letter-spacing: 0.1em;
    font-weight: 700;
    font-size: 1.3em;
}

/* --- ヘッダーメニュー --- */
#header_menu {
    top: 0;
    right: 0;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 0.8rem;
    padding-right: 2em;
    border-top: 1px solid #3f6ecb;
}

#header_menu .nickname {
    border-radius: 6px;
    padding: 4px 8px;
    background-color: #437ce5;
    color: #fff;
}

#header_menu ul {
    display: flex;
    gap: 1em;
    margin: 0;
    list-style: none;
    color: white;
    background-color: #2177cd;
    border-radius: 6px;
    padding: 4px 8px;
}

#header_menu li {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

#header_menu a {
    color: #fff;
    text-decoration: none;
    font-weight: normal;
}

/* --- フッター --- */
#footer {
    width: 100%;
    background: #f8fafc;
    padding: 20px 0 16px 0;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 6px rgba(40, 60, 120, 0.04);
    position: relative;
    margin-top: 5em;
}

#footer .copyright {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 10px;
}

/* --- フォーム・入力 --- */
.form {
    background: #fff;
    margin: 8px auto 8px auto;
    padding: 12px 18px 8px 18px;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    max-width: 800px; /* 追加: フォームの最大幅を指定 */
    text-align: left;
}

label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.form textarea {
    width: 100%;
    box-sizing: border-box; /* 追加: パディング・ボーダーを含めて100%に */
    border: 1.5px solid #b3c6ff;
    border-radius: 8px;
    padding: 12px;
    font-size: 1rem;
    line-height: 1.5rem;
    margin-top: 8px;
    margin-bottom: 4px;
    background: #fafdff;
    transition: border 0.2s;
}

.form textarea:focus {
    border: 2px solid #4f8cff;
    outline: none;
    background: #f0f8ff;
}

button[type="submit"] {
    background: linear-gradient(90deg, #4f8cff 0%, #6ee7b7 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 32px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(79,140,255,0.10);
    transition: background 0.2s, transform 0.1s;
}

button[type="submit"]:hover {
    background: linear-gradient(90deg, #6ee7b7 0%, #4f8cff 100%);
    transform: translateY(-2px) scale(1.03);
}

.form input[type="number"],
.form input[type="text"],
.form input[type="email"],
.form input[type="password"] {
    width: 100%;
    box-sizing: border-box; /* 追加: パディング・ボーダーを含めて100%に */
    border: 1.5px solid #b3c6ff;
    border-radius: 8px;
    padding: 12px;
    font-size: 1rem;
    margin-top: 8px;
    margin-bottom: 16px;
    background: #fafdff;
    transition: border 0.2s;
}
.form input[type="text"]:focus,
.form input[type="email"]:focus,
.form input[type="password"]:focus {
    border: 2px solid #4f8cff;
    outline: none;
    background: #f0f8ff;
}
.form select {
    width: 100%;
    box-sizing: border-box; /* 追加: パディング・ボーダーを含めて100%に */
    border: 1.5px solid #b3c6ff;
    border-radius: 8px;
    padding: 12px;
    font-size: 1rem;
    margin-top: 8px;
    margin-bottom: 16px;
    background: #fafdff;
    transition: border 0.2s;
}
.form select:focus {
    border: 2px solid #4f8cff;
    outline: none;
    background: #f0f8ff;
}

/* --- セクションタイトル --- */
h2 {
    color: #4f8cff;
    margin-top: 40px;
    text-align: center;
    letter-spacing: 0.05em;
}

/* --- 校正結果・リスト --- */
#result-block {
    margin-top: 24px;
}

.result-container {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(79,140,255,0.07);
    margin: 8px auto 0 auto;
    padding: 8px 12px;
    text-align: left;
}

.result-container ul {
    padding-left: 0;
    list-style: none;
}

.result-container li {
    margin-bottom: 8px;
    padding: 14px 14px;
    background: #f0f4ff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(79,140,255,0.04);
}

.result-container li strong {
    color: #2563eb;
    font-size: 1.08rem;
}

.info-message {
    color: #2563eb !important;
    font-weight: normal;
    font-size: 1.05rem;
    background-color: #f4f7fd;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.error-message {
    color: #ef4444 !important;
    font-weight: 700;
    font-size: 1.05rem;
}

.error-detail {
    color: #374151 !important;
    font-size: 0.8rem;
    text-align: left;
    padding: 8px;
}

.error-line-info {
    cursor: pointer;
    border-bottom: 1px dotted #8888ef;
    margin-bottom: 0.3em;
}

.no-error {
    color: #10b981;
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
    display: block;
    margin: 18px 0;
}

a {
    color: #4f8cff;
    text-decoration: none;
    font-weight: 600;
    margin-left: 8px;
}

a:hover {
    text-decoration: underline;
    color: #2563eb;
}

/* --- ボタン --- */
#proofread-buttons {
    text-align: center;
    gap: 1.5em;
}
#proofread-buttons button {
    margin-left: 8px;
    margin-right: 8px;
}
.btn-size-m {
    width: 10rem;
}
.btn-size-s {
    width: 4rem;
}

.proofread-btn {
    background-color: #4CAF50;
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}
.proofread-btn:hover {
    background-color: #388e3c;
    transform: scale(1.05);
}

.proofread-btn-blue {
    background-color: #7d7da8;
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}
.proofread-btn-blue:hover {
    background-color: #5c5c8a;
    transform: scale(1.05);
}
.proofread-btn-blue:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(125, 125, 168, 0.5);
}
.proofread-btn-blue:disabled {
    background-color: #b0b0d0;
    cursor: not-allowed;
}


/* --- 校正修正ブロック --- */
.fix-button {
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    display: inline-flex;
    align-items: center;
}

.fix-button::before {
    content: "✔";
    font-size: 1rem;
    margin-right: 8px;
}

.fix-button:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

.fix-button:active {
    background-color: #003f7f;
    transform: scale(0.95);
}

.fix-before {
    font-size: 0.9rem;
    color: #955;
}

.fix-after {
    font-size: 0.9rem;
    color: #353;
}

.fix_block {
    margin-top: 0.3em;
    padding-top: 0.5em;
    border-top: 1px dotted #ccc;
    color: #003f7f;
    text-align: left;
    width: 100%;
}

.fix_block > ul > li {
    padding: 0;
    margin: 0;
    margin-left: 2em;
    color: #888;
    list-style-type: disc;
    font-size: 0.8rem;
}

.fix-button-block {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    padding: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.fix-button-cancel {
    background-color: rgba(230, 74, 74, 0.5);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    display: inline-flex;
    align-items: center;
}

.fix-button-cancel::before {
    content: "✖";
    font-size: 1rem;
    margin-right: 8px;
}

.fix-button-cancel:hover {
    background-color: #dc2626;
    transform: scale(1.05);
}

.fix-button-cancel:active {
    background-color: #b91c1c;
    transform: scale(0.95);
}

.fix_block_no-fix {
    text-align: right;
    padding: 0;
    margin: 0;
}

/* --- ハイライト・校正結果 --- */
.line-highlight {
    background-color: #fffbcc;
    border: 2px solid #f59e0b;
    border-left: 4px solid #f59e0b;
    padding: 0.4em 0.8em;
    border-radius: 8px;
    margin-bottom: 0.3em;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.line-highlight:hover {
    background-color: #fef3c7;
    border-color: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.line-highlight:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(245, 158, 11, 0.2);
}

.block_item {
    margin-bottom: 16px;
    padding: 12px;
    background: #ffffff;
    color: black;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(79,140,255,0.05);
}
.block_item form h3 {
    margin: 0 0 8px 0;
    color: #2563eb;
    font-size: 1.2rem;
    text-align: center;
    border-bottom: dotted 1px #d1d5db;
    padding-bottom: 4px;
    margin-bottom: 1em;
}
.description {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 12px;
}
.block_item form input[type="text"],
.block_item form input[type="email"],
.block_item form input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    margin-bottom: 12px;
    background: #f9fafb;
    transition: border-color 0.2s, background-color 0.2s;
}
.block_item form input[type="text"]:focus,
.block_item form input[type="email"]:focus,
.block_item form input[type="password"]:focus {
    border-color: #2563eb;
    background-color: #f0f4ff;
    outline: none;
}
.block_item form select {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    margin-bottom: 12px;
    background: #f9fafb;
    transition: border-color 0.2s, background-color 0.2s;
}
.block_item form input[type="file"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    margin-bottom: 12px;
    background: #f9fafb;
    transition: border-color 0.2s, background-color 0.2s;
}
form .note {
    font-size: 0.8rem;
    color: #505863;
    margin-bottom: 12px;
    text-align: right;
}
.login_info {
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: 8px;
    padding: 1em;
    background-color: #eee;
    border-radius: 8px;
    margin-bottom: 1em;
}

.project-item {
    background: #d0deff;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(79,140,255,0.05);
    margin-bottom: 16px;
}

.project-item .memo {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 12px;
}

.project-item h4 {
    margin: 0 0 8px 0;
    color: #5d73a4;
    font-size: 1.2rem;
    border-bottom: dotted 1px #173055;
}

a.s_button {
    display: inline-block;
    background-color: #4f8cff;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.2s, transform 0.1s;
}
a.s_button:hover {
    background-color: #3b6ecb;
    transform: translateY(-2px);
}
a.s_button:active {
    background-color: #2a4f9f;
    transform: translateY(0);
}

.dialog-content {
    padding: 1em;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 600px;
    /* コンテンツを中央に表示 */
    margin: 0 auto;
}

.dialog-content h3 {
    color: #4f8cff;
    font-size: 1.5rem;
    margin-bottom: 16px;
    text-align: center;
    border-bottom: 1px dashed #d1d5db;
}

span.marked {
    background-color: #fffbcc;    
    padding: 0.2em 0.5em;
    border-radius: 4px;
    margin-bottom: 0.1em;
    display: inline-block;
}

.saved_file {
    background: #afc0ef;
}

.proofread-status {
    background-color: #96cffa;
    color: rgb(11, 40, 110);
    padding: 4px;
    border-radius: 4px;
}

.help-container {
    background: #f0f4ff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(79,140,255,0.1);
    margin-top: 24px;
}

.help-container h3 {
    color: #4f8cff;
    font-size: 1.2rem;
    margin-bottom: 16px;
    text-align: left;
    border-top: 1px dashed #d1d5db;
    border-bottom: 1px dashed #d1d5db;
    border-left: 6px solid #59a5f1;
    padding-left: 12px;
}

.tab-component {
    text-align: center;
    margin-top: 16px;
}

#download-text {
    width: 100%;
    box-sizing: border-box; /* 追加: パディング・ボーダーを含めて100%に */
    border-top: 1px solid #d1d5db;
    margin-top: 5em;
    display: block; /* 変更: inline-block → block */
    background-color: #f1f2f4;
    color: rgb(36, 41, 71);
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: normal;
    transition: background-color 0.2s, transform 0.1s;
}

.warning {
    color: #ca461d;
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: 16px;
}

.button {
    display: inline-block;
    background-color: #4f8cff;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.2s, transform 0.1s;
}
.button:hover {
    background-color: #3b6ecb;
    transform: translateY(-2px);
}
.button:active {
    background-color: #2a4f9f;
    transform: translateY(0);
}

.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.file-list li {
    background: #e0e7ff;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(79,140,255,0.05);
}
.file-list li a {
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 600;
}
.file-list li a:hover {
    text-decoration: underline;
    color: #1e40af;
}

table.project-info-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}
table.project-info-table th,
table.project-info-table td {
    border: 1px solid #d1d5db;
    padding: 10px;
    background-color: #f9fafb;;
}
table.project-info-table th {
    background-color: #eaf0ff;
    color: #2563eb;
    font-weight: bold;
    text-align: right;;
    width: 6rem;
    font-size: 0.9rem;
}
table.project-info-table td {
    background-color: #f4f8ff;
    color: #374151;
    text-align: left;
    font-size: 0.9rem;
}
span.item_label {
    color: #112e6d;
}

span.diff_header {
    background-color: #f4fdc7;
    padding: 0.3em 0.6em;
    border-radius: 4px;
    margin-bottom: 0.1em;
    display: inline-block;
    text-decoration: underline;
    font-weight: bold;
}
span.diff_minus {
    background-color: #ffcccc;
    padding: 0.2em 0.5em;
    border-radius: 4px;
    margin-bottom: 0.1em;
    display: inline-block;
}
span.diff_plus {
    background-color: #ccffcc;
    padding: 0.2em 0.5em;
    border-radius: 4px;
    margin-bottom: 0.1em;
    display: inline-block;
}
div.text-description {
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: 0px;
    padding: 4px;
    background-color: #f8fafc;
    margin-bottom: 1em;
    text-align: right;
    font-family: monospace;
}

/* ページネーション */
.pagination-container {
    margin: 20px 0;
    text-align: center;
}

.pagination-info {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #666;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.page-link {
    display: inline-block;
    padding: 8px 12px;
    margin: 2px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #0b4bc2;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.page-link:hover {
    background-color: #f0f7ff;
    border-color: #0b4bc2;
}

.page-current {
    display: inline-block;
    padding: 8px 12px;
    margin: 2px;
    background-color: #0b4bc2;
    color: #fff;
    border: 1px solid #0b4bc2;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
}

.page-ellipsis {
    display: inline-block;
    padding: 8px 4px;
    margin: 2px;
    color: #999;
    font-size: 0.9rem;
}