body {
    margin: 0;
    background: #f5f5f5;
    color: #222;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

.site-header {
    background: #ffffff;
    border-bottom: 1px solid #ddd;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-title {
    color: #222;
    font-size: 20px;
    font-weight: bold;
    text-decoration: none;
}

.site-nav a {
    color: #444;
    text-decoration: none;
}

.site-nav a:hover {
    text-decoration: underline;
}

.main-content {
    min-height: calc(100vh - 130px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

h1 {
    margin-top: 0;
    font-size: 26px;
}

/* =========================
   アーカイブ検索・フィルタ
   ========================= */

.filter-form {
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 14px;
}

.filter-row:first-child {
    grid-template-columns: minmax(300px, 2fr) 1fr 1fr;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-item label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.filter-item input,
.filter-item select {
    width: 100%;
    box-sizing: border-box;
    height: 40px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    color: #222;
    font-size: 14px;
}

.filter-item input::placeholder {
    color: #aaa;
}

.filter-item input:focus,
.filter-item select:focus {
    outline: none;
    border-color: #888;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 4px;
}

.filter-actions button {
    min-width: 110px;
    height: 40px;
    padding: 0 22px;
    border: none;
    border-radius: 6px;
    background: #333;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.filter-actions button:hover {
    background: #111;
}

.filter-actions a {
    color: #666;
    font-size: 13px;
    text-decoration: none;
}

.filter-actions a:hover {
    text-decoration: underline;
}

.summary {
    margin: 16px 0 10px;
    color: #666;
    font-size: 14px;
}

.summary strong {
    color: #222;
    font-size: 18px;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    vertical-align: top;
}

th {
    background: #eee;
    white-space: nowrap;
}

.date {
    white-space: nowrap;
}

.first-detection {
    font-weight: bold;
}

a {
    color: #0066cc;
}

table a {
    text-decoration: none;
}

table a:hover {
    text-decoration: underline;
}

.pagination {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 20px;
}

.pagination a {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-decoration: none;
}

.site-footer {
    margin-top: 40px;
    border-top: 1px solid #ddd;
    background: #fff;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
    color: #777;
    font-size: 13px;
}

@media (max-width: 800px) {
    .filter-form {
        padding: 14px;
    }

    .filter-row,
    .filter-row:first-child {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .filter-actions {
        margin-top: 8px;
    }

    .filter-actions button {
        flex: 1;
    }

    .header-inner,
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    table {
        font-size: 13px;
    }

    th,
    td {
        padding: 7px;
    }
}

/* =========================
   見どころ記録ボタン
   ========================= */

.highlight-column,
.highlight-cell {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}

.highlight-cell {
    vertical-align: middle;
}

.highlight-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #d7dce2;
    border-radius: 8px;
    background: #fff;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.highlight-button:hover {
    background: #f7f8fa;
    border-color: #bfc5cc;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.highlight-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.highlight-button-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

@media (max-width: 800px) {
    .highlight-button {
        padding: 0 10px;
    }
}

/* =========================
   掲示板
   ========================= */

.board-container {
    max-width: 900px;
}

.board-header {
    margin-bottom: 18px;
}

.board-header h1 {
    margin-bottom: 6px;
}

.board-description {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.7;
}

/* 投稿フォーム */
.board-composer {
    margin-bottom: 26px;
    background: #fff;
    border: 1px solid #e0e3e7;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.board-composer-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 16px;
    cursor: pointer;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    list-style: none;
    user-select: none;
}

.board-composer-toggle::-webkit-details-marker {
    display: none;
}

.board-composer-toggle:hover {
    background: #f8f9fa;
}

.board-composer-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #333;
    color: #fff;
    font-size: 17px;
    line-height: 1;
    transition: transform 0.15s ease;
}

.board-composer[open] .board-composer-icon {
    transform: rotate(45deg);
}

.board-composer-body {
    padding: 0 18px 18px;
    border-top: 1px solid #eceef0;
}

.board-highlight-notice {
    margin: 16px 0;
    padding: 10px 12px;
    border-radius: 7px;
    background: #f5f7fa;
    color: #555;
    font-size: 13px;
    line-height: 1.6;
}

.board-form-item {
    margin-top: 16px;
}

.board-form-item label {
    display: block;
    margin-bottom: 6px;
    color: #444;
    font-size: 13px;
    font-weight: 600;
}

.board-form-optional {
    margin-left: 5px;
    color: #999;
    font-size: 11px;
    font-weight: 400;
}

.board-form-item input,
.board-form-item textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #ccd1d7;
    border-radius: 7px;
    background: #fff;
    color: #222;
    font: inherit;
}

.board-form-item input {
    height: 40px;
}

.board-form-item textarea {
    min-height: 150px;
    resize: vertical;
    line-height: 1.6;
}

.board-form-item input:focus,
.board-form-item textarea:focus {
    outline: none;
    border-color: #888f98;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.board-form-help {
    margin-top: 5px;
    color: #999;
    font-size: 11px;
}

.board-form-error {
    margin-top: 6px;
    color: #b42318;
    font-size: 12px;
}

.board-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.board-submit-button {
    min-width: 110px;
    height: 40px;
    padding: 0 20px;
    border: 0;
    border-radius: 7px;
    background: #333;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.board-submit-button:hover {
    background: #111;
}

/* 投稿一覧 */
.board-posts-section {
    margin-top: 8px;
}

.board-section-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}

.board-section-header h2 {
    margin: 0;
    font-size: 20px;
}

.board-post-count {
    color: #999;
    font-size: 12px;
}

.board-post-list {
    background: #fff;
    border: 1px solid #e0e3e7;
    border-radius: 10px;
    overflow: hidden;
}

.board-post {
    padding: 16px 18px;
    border-bottom: 1px solid #eceef0;
}

.board-post:last-child {
    border-bottom: 0;
}

.board-post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
}

.board-post-author {
    color: #333;
    font-size: 14px;
    font-weight: 700;
}

.board-post-date {
    flex: 0 0 auto;
    color: #999;
    font-size: 12px;
}

.board-post-body {
    color: #333;
    font-size: 14px;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.board-post-body a {
    color: #0066cc;
    text-decoration: none;
}

.board-post-body a:hover {
    text-decoration: underline;
}

.board-empty {
    padding: 42px 20px;
    color: #888;
    text-align: center;
    font-size: 14px;
}

.board-empty p {
    margin: 4px 0;
}

@media (max-width: 800px) {
    .board-composer-body {
        padding-left: 14px;
        padding-right: 14px;
    }

    .board-post {
        padding: 14px;
    }

    .board-post-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .board-submit-button {
        width: 100%;
    }
}

/* =========================
   掲示板 投稿番号
   ========================= */

.board-post-meta-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.board-post-number {
    flex: 0 0 auto;
    color: #777;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.board-post-number:hover {
    color: #333;
    text-decoration: underline;
}

/* アンカーで直接開いた投稿を少し分かりやすくする */
.board-post:target {
    background: #fafbfc;
    box-shadow: inset 3px 0 0 #777;
}

@media (max-width: 800px) {
    .board-post-meta-left {
        flex-wrap: wrap;
    }
}

.board-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.access-card {
    max-width: 420px;
    margin: 70px auto;
    padding: 28px;
    background: #fff;
    border: 1px solid #e0e3e7;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.access-card h1 {
    margin-bottom: 8px;
    text-align: center;
}

.access-description {
    margin-bottom: 24px;
    color: #666;
    font-size: 14px;
    text-align: center;
}

.access-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
}

.access-form input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    height: 42px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 7px;
    font-size: 15px;
}

.access-form button {
    width: 100%;
    height: 42px;
    margin-top: 16px;
    border: 0;
    border-radius: 7px;
    background: #333;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.access-form button:hover {
    background: #111;
}

.access-error {
    margin-top: 8px;
    color: #b42318;
    font-size: 13px;
}

/* =========================
   お気に入り・メモ
   ========================= */

.popularity-column,
.popularity-cell {
    white-space: nowrap;
    text-align: center;
}

.favorite-count {
    color: #666;
    font-size: 13px;
    font-weight: 600;
}

.my-record-column,
.my-record-cell {
    white-space: nowrap;
}

.my-record-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.favorite-form {
    margin: 0;
}

.favorite-button {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #d7dce2;
    border-radius: 8px;
    background: #fff;
    color: #777;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}

.favorite-button:hover {
    background: #f7f8fa;
    border-color: #bfc5cc;
    transform: translateY(-1px);
}

.favorite-button.is-active {
    color: #222;
    background: #f5f5f5;
    border-color: #aeb4bb;
}

.memo-editor {
    position: relative;
}

.memo-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 9px;
    border: 1px solid #d7dce2;
    border-radius: 7px;
    background: #fff;
    color: #555;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.memo-toggle::-webkit-details-marker {
    display: none;
}

.memo-toggle:hover,
.memo-toggle.has-memo {
    background: #f7f8fa;
}

.memo-editor-panel {
    position: absolute;
    z-index: 20;
    right: 0;
    top: calc(100% + 7px);
    width: 300px;
    padding: 12px;
    border: 1px solid #d7dce2;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.memo-editor-panel textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    padding: 9px 10px;
    border: 1px solid #ccd1d7;
    border-radius: 7px;
    font: inherit;
    font-size: 13px;
    line-height: 1.5;
}

.memo-editor-panel textarea:focus {
    outline: none;
    border-color: #888f98;
}

.memo-editor-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.memo-editor-actions button {
    min-width: 72px;
    height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 7px;
    background: #333;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.memo-editor-actions button:hover {
    background: #111;
}

@media (max-width: 800px) {
    .memo-editor-panel {
        right: auto;
        left: 0;
        width: min(280px, 80vw);
    }
}


/* =========================
   アーカイブ注意事項
   ========================= */

.archive-notice {
    margin: -4px 0 18px;
    padding: 11px 14px;
    border: 1px solid #e0e3e7;
    border-radius: 8px;
    background: #fafafa;
    color: #666;
    font-size: 12px;
    line-height: 1.7;
}

.archive-notice p {
    margin: 0;
}

.archive-notice p + p {
    margin-top: 2px;
}


/* =========================
   Ajax保存時の表示
   ========================= */

.favorite-button:disabled,
.memo-editor-actions button:disabled {
    opacity: 0.55;
    cursor: wait;
}

.memo-save-status {
    margin-right: auto;
    color: #777;
    font-size: 11px;
    line-height: 1.4;
}

.memo-save-status.is-error {
    color: #b42318;
}

@media (max-width: 800px) {
    .archive-notice {
        font-size: 11px;
    }
}

/* =========================
   アーカイブ一覧 スマホ表示
   ========================= */

.mobile-only {
    display: none;
}

@media (max-width: 800px) {
    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: inline;
    }

    .table-wrapper {
        overflow-x: visible;
    }

    .archive-table {
        display: block;
        width: 100%;
        background: transparent;
    }

    .archive-table thead {
        display: none;
    }

    .archive-table tbody {
        display: block;
    }

    .archive-table tbody tr {
        display: grid;
        grid-template-columns: auto auto minmax(0, 1fr) auto;
        gap: 8px 10px;
        margin-bottom: 12px;
        padding: 13px 14px;
        border: 1px solid #e0e3e7;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    }

    .archive-table tbody td {
        display: block;
        padding: 0;
        border: 0;
        min-width: 0;
    }

    .archive-date-cell {
        grid-column: 1 / 4;
        grid-row: 1;
        align-self: center;
        color: #888;
        font-size: 11px;
    }

    .archive-user-cell {
        grid-column: 1 / -1;
        grid-row: 2;
        font-size: 14px;
        overflow-wrap: anywhere;
    }

    .archive-user-label {
        margin-right: 6px;
        color: #999;
        font-size: 11px;
        font-weight: 500;
    }

    .archive-user-cell a {
        color: #333;
        font-weight: 700;
    }

    .archive-title-cell {
        grid-column: 1 / -1;
        grid-row: 3;
        padding-bottom: 2px !important;
        font-size: 14px;
        line-height: 1.5;
        overflow-wrap: anywhere;
    }

    .archive-title-cell a {
        color: #0066cc;
        font-weight: 700;
    }

    .archive-title-icon {
        margin-right: 3px;
        font-size: 10px;
        vertical-align: 1px;
    }

    .archive-first-cell,
    .archive-kind-cell,
    .archive-visibility-cell {
        grid-row: 4;
        align-self: center;
        width: max-content;
        max-width: 100%;
        padding: 3px 7px !important;
        border-radius: 999px;
        background: #f4f5f6;
        color: #666;
        font-size: 10px;
        line-height: 1.4;
        white-space: nowrap;
    }

    .archive-first-cell {
        grid-column: 1;
    }

    .archive-kind-cell {
        grid-column: 2;
    }

    .archive-visibility-cell {
        grid-column: 3;
    }

    .archive-first-cell.is-empty {
        display: none;
    }

    .archive-first-cell.is-empty + .archive-kind-cell {
        grid-column: 1;
    }

    .archive-first-cell.is-empty + .archive-kind-cell + .archive-visibility-cell {
        grid-column: 2 / 4;
    }

    .first-detection {
        font-weight: 600;
    }

    .popularity-cell {
        grid-column: 4;
        grid-row: 1;
        align-self: center;
        text-align: right;
    }

    .favorite-count {
        font-size: 12px;
    }

    .my-record-cell {
        grid-column: 1 / 4;
        grid-row: 5;
        align-self: center;
        padding-top: 4px !important;
    }

    .highlight-cell {
        grid-column: 4;
        grid-row: 5;
        align-self: center;
        padding-top: 4px !important;
    }

    .my-record-actions {
        gap: 7px;
    }

    .favorite-button {
        width: 36px;
        height: 36px;
    }

    .memo-toggle {
        min-height: 34px;
        padding: 0 10px;
    }

    .highlight-button {
        min-height: 36px;
        padding: 0 11px;
    }

    .memo-editor-panel {
        position: fixed;
        z-index: 100;
        left: 12px;
        right: 12px;
        top: 50%;
        width: auto;
        max-width: none;
        transform: translateY(-50%);
        box-sizing: border-box;
    }

    .memo-editor-panel textarea {
        min-height: 120px;
    }
}

/* =========================
   アーカイブ一覧 サイト説明
   ========================= */

.archive-description {
    margin: -4px 0 14px;
    color: #444;
    font-size: 14px;
    line-height: 1.7;
}

.archive-description p {
    margin: 0;
}

.archive-description p + p {
    margin-top: 2px;
}

@media (max-width: 800px) {
    .archive-description {
        font-size: 13px;
        line-height: 1.65;
    }
}

/* =========================
   ヘッダーナビゲーション
   ========================= */

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid #d9dde2;
    border-radius: 7px;
    background: #fff;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease;
}

.site-nav a:hover {
    background: #f5f6f7;
    border-color: #bfc5cc;
    text-decoration: none;
}

@media (max-width: 800px) {
    .header-inner {
        gap: 10px;
    }

    .site-title {
        font-size: 17px;
    }

    .site-nav {
        gap: 4px;
    }

    .site-nav a {
        min-height: 32px;
        padding: 0 7px;
        font-size: 12px;
    }
}

/* =========================
   メンテナンス画面
   ========================= */

.maintenance-page .site-nav {
    display: none;
}

.maintenance-container {
    max-width: 560px;
    margin: 80px auto;
    padding: 0 24px;
}

.maintenance-card {
    padding: 42px 32px;
    border: 1px solid #e0e3e7;
    border-radius: 12px;
    background: #fff;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.maintenance-icon {
    margin-bottom: 14px;
    color: #666;
    font-size: 32px;
    line-height: 1;
}

.maintenance-card h1 {
    margin: 0 0 18px;
    font-size: 24px;
}

.maintenance-card p {
    margin: 4px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.7;
}

@media (max-width: 800px) {
    .maintenance-container {
        margin: 55px auto;
        padding: 0 16px;
    }

    .maintenance-card {
        padding: 34px 20px;
    }

    .maintenance-card h1 {
        font-size: 21px;
    }
}

