:root {
    --bg-color: #f0f2f5;
    --panel-bg: #ffffff;
    --card-bg: #f8fafc;
    --border-color: #e2e8f0;
    --text-main: #2d3748;
    --text-sub: #718096;
    --accent-color: #4299e1;
    --radius-sm: 10px;
    --radius-lg: 20px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 20px;
    height: 100vh;
    box-sizing: border-box;
    overflow: hidden;
}

.layout-container {
    display: flex;
    gap: 15px;
    height: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

.photo-sidebar {
    width: 33%;
    display: flex;
    flex-direction: column;
    overflow-y: scroll;
    scrollbar-gutter: stable;

    background-color: var(--panel-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.photo-sidebar::-webkit-scrollbar {
    width: 6px;
}

.photo-sidebar::-webkit-scrollbar-track {
    background: transparent;
    margin-top: 15px;
    margin-bottom: 15px;
    border-radius: 10px;
}

.photo-sidebar::-webkit-scrollbar-thumb {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
}

.photo-sidebar.show-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #cbd5e0 0%, #a0aec0 100%);
}

.photo-sidebar.show-scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #a0aec0 0%, #718096 100%);
}

.category-header {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.segmented-control {
    display: flex;
    background-color: var(--bg-color);
    border-radius: var(--radius-sm);
    padding: 4px;
}

.segment-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: var(--text-sub);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.segment-btn svg {
    transition: stroke 0.3s ease;
}

.segment-btn.active {
    background-color: #ffffff;
    color: var(--accent-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.segment-btn:hover:not(.active) {
    color: var(--text-main);
}

.list-container {
    flex: 1;
    overflow-y: visible;
    display: flex;
    flex-direction: column;
}

.list-section,
.content-section {
    display: none;
}

.list-section.active {
    display: flex;
    flex-direction: column;
}

.content-section.active {
    display: block;
    height: 100%;
    width: 100%;
}

#photo-list {
    display: flex;
    flex-direction: column;
}

.year-divider {
    padding: 15px 5px 5px 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    letter-spacing: 1px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 5px;

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

    user-select: none;
    -webkit-user-select: none;
}

#photo-list .year-divider:first-child {
    padding-top: 5px;
}

.year-divider svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.year-divider.collapsed svg {
    transform: rotate(-180deg);
}

.year-group {
    display: grid;
    grid-template-rows: 1fr;
    margin-bottom: 8px;
    transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.year-group.collapsed {
    grid-template-rows: 0fr;
    margin-bottom: 0px;
}

.year-group-inner {
    min-height: 0;
    overflow: hidden;

    padding-left: 6px;
    padding-right: 6px;
    margin-left: -6px;
    margin-right: -6px;

    display: flex;
    flex-direction: column;
    gap: 10px;

    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.year-group-inner .photo-bar:first-child {
    margin-top: 4px;
}

.year-group-inner .photo-bar:last-child {
    margin-bottom: 8px;
}

.year-group.collapsed .year-group-inner {
    opacity: 0;
    transform: translateY(-20px);
}

.photo-bar {
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
}

.photo-bar:hover,
.photo-bar.highlight {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.06);
    border-color: var(--accent-color);
    background-color: #ffffff;
}

.photo-bar img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.photo-bar .info {
    margin-left: 12px;
    flex: 1;
}

.photo-bar h3 {
    margin: 0 0 4px 0;
    font-size: 15px;
    color: var(--text-main);
}

.photo-bar p {
    margin: 0;
    font-size: 12px;
    color: var(--text-sub);
}

.creative-indicator {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-sub);
    cursor: help;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.creative-indicator:hover {
    color: var(--accent-color);
}

.creative-indicator::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    right: 0;
    padding: 6px 10px;
    background-color: #2d3748;
    color: white;
    font-size: 11px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.creative-indicator:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-2px);
}

.main-content-wrapper {
    width: 67%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
    position: relative;
    border: 2px solid var(--border-color);
    background-color: var(--panel-bg);
}

#map {
    width: 100%;
    height: 100%;
}

.leaflet-tooltip.modern-tooltip {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    padding: 6px 12px;
    white-space: nowrap;
    transition: opacity 0.35s ease-in-out !important;
}

.leaflet-tooltip.modern-tooltip b {
    font-weight: 600;
}

.leaflet-tooltip-top.modern-tooltip::before {
    border-top-color: var(--border-color);
    bottom: 0;
}

.figure-detail-container {
    padding: 30px;
    height: 100%;
    overflow-y: auto;
    background-color: var(--panel-bg);
    display: flex;
    flex-direction: column;
    gap: 25px;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.figure-header {
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 15px;
}

.figure-header h1 {
    margin: 0;
    font-size: 24px;
    color: var(--text-main);
    line-height: 1.3;
}

.figure-header .original-name {
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-sub);
    font-family: "Hiragino Sans", "Meiryo", sans-serif;
}

.figure-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.figure-visual {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.img-display-frame {
    width: 100%;
    height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.img-display-frame img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.view-selector {
    display: flex;
    background-color: var(--bg-color);
    border-radius: var(--radius-sm);
    padding: 4px;
    width: 100%;
}

.view-tab-btn {
    flex: 1;
    padding: 6px;
    border: none;
    background: transparent;
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    font-family: inherit;
}

.view-tab-btn.active {
    background-color: #ffffff;
    color: var(--accent-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.view-tab-btn:hover:not(.active) {
    color: var(--text-main)
}

.figure-specs {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.spec-label {
    font-size: 12px;
    color: var(--text-sub);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spec-value {
    font-size: 15px;
    color: var(--text-main);
    line-height: 1.4;
}

.spec-value a {
    color: var(--accent-color, #4299e1);
    text-decoration: none;
    transition: color 0.3s ease;
}

.spec-value a:hover {
    color: #2b6cb0;
    text-decoration: underline;
}

.modal {
    display: flex;
    visibility: hidden;
    pointer-events: none;

    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);

    justify-content: center;
    align-items: center;
    flex-direction: column;

    opacity: 0;
    transition: opacity 0.35s ease, visibility 0.35s ease;

    user-select: none;
    -webkit-user-select: none;
}

.modal.show {
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
}

.modal-content {
    max-width: 90%;
    max-height: 80vh;
    border-radius: var(--radius-sm);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    object-fit: contain;

    transform: scale(0.7);
    opacity: 0;

    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.35s ease;
}

.modal.show .modal-content {
    transform: scale(1);
    opacity: 1;
}

#caption {
    margin-top: 20px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 1px;
}

.close-btn {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #ffffff;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--accent-color);
}

.site-footer {
    background-color: transparent;
    border-top: 1px dashed var(--border-color);
    padding: 20px 5px 10px;
    margin-top: 15px;
    text-align: center;
    font-family: inherit;
    position: relative;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: -4px;
}

.social-links a {
    color: var(--text-sub);
}

.social-links a:hover {
    color: var(--accent-color);
}

.site-copyright {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main, #2d3748);
    margin: 0;
    letter-spacing: 0.5px;
}

.photo-copyright {
    font-size: 12px;
    line-height: 1.6;
    color: #e53e3e;
    background-color: #fff5f5;
    padding: 10px;
    border-radius: var(--radius-sm, 8px);
    margin: 0;
}

.license-info {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-sub, #718096);
    line-height: 1.5;
}

.license-info a {
    color: var(--accent-color, #4299e1);
    text-decoration: none;
    transition: color 0.3s ease;
}

.license-info a:hover {
    color: #2b6cb0;
    text-decoration: underline;
}

.license-info img {
    vertical-align: middle;
    opacity: 0.85;
    transition: opacity 0.3s ease;
    margin-bottom: 6px;
}

.license-info img:hover {
    opacity: 1;
}