﻿.memory-page {
    max-width: 980px;
    margin: 20px auto;
    padding: 0 12px;
    box-sizing: border-box;
}

.memory-title {
    margin: 0 0 16px 0;
    font-size: 28px;
    font-weight: 700;
}

.memory-card {
    border: 1px solid #ddd;
    background: #fff;
    padding: 16px;
    box-sizing: border-box;
}

.memory-form-section {
    margin-bottom: 15px;
}

.memory-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
}

.memory-input,
.memory-select,
.memory-textarea,
.memory-datetime {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.memory-textarea {
    min-height: 120px;
    resize: vertical;
}

.memory-inline-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.memory-help {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.memory-error {
    font-size: 12px;
    color: #c00;
    margin-top: 4px;
}

.memory-error-box {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #d9534f;
    background: #fdf2f2;
    color: #a94442;
}

.memory-btn-row {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.memory-btn-gray {
    border: 1px solid #ccc;
    background-color: #f5f5f5;
    color: #333;
}

.memory-summary-box {
    margin: 10px 0 15px 0;
    padding: 10px;
    border: 1px solid #ddd;
    background: #fafafa;
}

.memory-toolbar {
    margin-bottom: 15px;
}

.memory-filter-links {
    margin: 10px 0 15px 0;
    line-height: 1.8;
}

.memory-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.memory-table {
    width: 100%;
    min-width: 720px;
    table-layout: fixed;
    border-collapse: collapse;
}

.memory-table th,
.memory-table td {
    border: 1px solid #ddd;
    padding: 8px;
    vertical-align: middle;
}

.memory-table th {
    background: #f7f7f7;
}

.memory-memo-link {
    text-decoration: none;
    color: #333;
    display: block;
}

.memory-info-box {
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid #ddd;
    background: #fafafa;
}

.memory-info-line {
    margin-bottom: 6px;
}

.memory-photo-help {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.memory-photo-grid,
.memory-preview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.memory-photo-item,
.memory-preview-item {
    text-align: center;
}

.memory-photo-thumb,
.memory-preview-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 1px solid #ccc;
    background: #fafafa;
    box-sizing: border-box;
}

.memory-photo-thumb {
    cursor: pointer;
}

.memory-preview-name {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
    word-break: break-all;
}

.memory-photo-check {
    font-size: 12px;
    color: #c00;
    margin-top: 4px;
    display: inline-block;
}

.memory-detail-text {
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 1024px) {
    .memory-photo-grid,
    .memory-preview-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .memory-page {
        margin: 12px auto;
        padding: 0 8px;
    }

    .memory-card {
        padding: 12px;
    }

    .memory-title {
        font-size: 24px;
    }

    .memory-btn-row {
        flex-direction: column;
    }

    .memory-btn-row .btn,
    .memory-btn-row input[type="submit"],
    .memory-btn-row button {
        width: 100%;
    }

    .memory-photo-grid,
    .memory-preview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .memory-table th,
    .memory-table td {
        font-size: 13px;
        padding: 6px;
    }
}

@media (max-width: 480px) {
    .memory-title {
        font-size: 21px;
    }

    .memory-input,
    .memory-select,
    .memory-textarea,
    .memory-datetime {
        font-size: 16px;
    }
}
