/* Personal homepage custom styles */

#main-container {
    padding-bottom: 60px; /* Reserve space at bottom */
}

h1 {
    font-size: 3em;
    margin-bottom: 10px;
    font-weight: 700;
}

h2 {
    font-size: 1.8em;
    margin-top: 40px;
    margin-bottom: 15px;
    font-weight: 600;
}

hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 10px 0 20px;
}

#cursor-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    margin: 10px 0;
    list-style: none;
    max-height: 250px;
    overflow-y: auto;
}

#cursor-container li {
    padding: 5px;
    border-radius: 8px;
    transition: background 0.2s;
    cursor: pointer;
    text-align: center;
}

#cursor-container li:hover {
    background-color: #f0f0f0;
}

.cursor-point {
    position: absolute;
    pointer-events: none;
    transition: opacity 1s, transform 1s;
}

/* Mobile layout */
@media (max-width: 600px) {
    h1 { font-size: 2em; }
    .top-nav ul li { padding: 0 10px; }
    .top-nav ul .icon { padding-right: 10px; }
}

/* Hobby page: section spacing and breaks */
.hobby-section {
    margin-bottom: 32px;
}

/* Splatoon section: Team.jpg as background, slightly darker overlay */
.hobby-section-splatoon {
    position: relative;
    background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.84)), url("../records/splatoon/Team.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 24px 20px;
    border-radius: 8px;
}
/* Clickable background: only empty areas open full image; content blocks pass-through except children */
.splatoon-bg-clickable {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 0;
    border-radius: 8px;
}
.hobby-section-splatoon .splatoon-content {
    position: relative;
    z-index: 1;
    pointer-events: none;
}
.hobby-section-splatoon .splatoon-content h3,
.hobby-section-splatoon .splatoon-content a,
.hobby-section-splatoon .splatoon-content > div,
.hobby-section-splatoon .splatoon-content .records-grid,
.hobby-section-splatoon .splatoon-content .record-item {
    pointer-events: auto;
}
/* 段落不拦截点击；只有文字 span 和链接拦截，这样 <p> 里没字的地方点击会穿透到背景层 */
.hobby-section-splatoon .splatoon-content p {
    pointer-events: none;
}
.hobby-section-splatoon .splatoon-content p a,
.hobby-section-splatoon .splatoon-content p .splatoon-text {
    pointer-events: auto;
}
.hobby-break {
    margin: 32px 0;
    border: none;
    border-top: 1px solid #eee;
}

/* Inline logo (e.g. Strava) */
.strava-logo-inline {
    vertical-align: middle;
    margin-right: 4px;
}

/* Strava recent activity embed box (above Running Log) - 宽度与页面其他内容一致 */
.strava-activity-box {
    width: 100%;
}
/* 本月记录板块 */
.strava-month-stats {
    margin-bottom: 0;
    padding: 10px 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #f9f9f9;
}
.strava-month-title {
    font-weight: 700;
    color: #333;
    margin: 0 0 0 0;
    font-size: 1.1em;
}
.strava-month-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.strava-month-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.strava-month-value {
    font-weight: 600;
    color: #5dade2;
    font-size: 1.25em;
}
.strava-month-unit {
    font-size: 0.85em;
    color: #666;
    margin-top: 1px;
}
.strava-activities-list {
    border: 1px solid #eee;
    border-radius: 8px;
    background: #f9f9f9;
    overflow-y: auto;
    max-height: 320px; /* 约显示 5 条，多余滑动 */
    /* 隐藏滚动条，保留滚动（鼠标滚轮/触摸仍可滚动） */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.strava-activities-list::-webkit-scrollbar {
    display: none;
}
.strava-activity-item {
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
    display: block;
}
.strava-activity-item:last-child {
    border-bottom: none;
}
.strava-activity-name {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}
.strava-activity-meta {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 2px;
}
.strava-activity-stats {
    display: block;
    font-size: 0.9em;
    color: #5dade2;
}
.strava-loading,
.strava-empty {
    padding: 20px;
    text-align: center;
    color: #666;
    margin: 0;
}
.strava-empty a {
    color: #5dade2;
}

/* Hyperlink Styles */
#main-container a {
    color: #5dade2; /* Light Blue */
    text-decoration: none;
    transition: color 0.2s;
}

#main-container a:visited {
    color: #5dade2; /* Keep same Light Blue after visited */
}

#main-container a:hover {
    color: #2e86c1; /* Slightly darker blue on hover */
    text-decoration: underline;
}

/* TOC Styles */
.toc-container {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 40px;
    display: inline-block;
    text-align: left;
    min-width: 200px;
}

.toc-container h3 {
    margin-top: 0;
    font-size: 1.1em;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin: 5px 0;
}

.toc-list a {
    color: #5dade2 !important;
    text-decoration: none;
    font-size: 0.95em;
}

.toc-list a:hover {
    text-decoration: underline;
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: black;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 2000;
    transition: transform 0.2s, background-color 0.2s;
    opacity: 0;
    visibility: hidden;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    transform: scale(1.1);
    background-color: #333;
}

#back-to-top i {
    border: solid white;
    border-width: 0 3px 3px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(-135deg);
    -webkit-transform: rotate(-135deg);
}

/* Hobby page: floating ToC + back-to-top，右侧上下居中，字体与 top nav 一致 */
.floating-toc-wrapper {
    position: fixed;
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    font-family: 'SplatoonNavFont', sans-serif;
}

.floating-toc-wrapper.visible {
    opacity: 1;
    visibility: visible;
}

/* 在 hobby 页的目录里，back-to-top 作为第一行，不用按钮样式，始终随 wrapper 显示 */
.floating-toc-wrapper #back-to-top {
    position: static;
    width: auto;
    height: auto;
    min-height: 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
    display: inline;
    opacity: 1;
    visibility: visible;
    color: #999;
}

.floating-toc-wrapper #back-to-top:hover {
    color: #666;
    transform: none;
    background: none;
}

.floating-toc-wrapper #back-to-top i {
    display: none;
}

.floating-toc {
    font-size: 0.9em;
}

.floating-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: right;
}

.floating-toc-list li {
    margin: 4px 0;
}

.floating-toc-link {
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
}

.floating-toc-link:hover {
    color: #666;
}

.floating-toc-link.toc-active {
    color: #000;
    font-weight: 500;
}

/* 窄屏专用：只显示回到顶部箭头，隐藏目录 */
.back-to-top-arrow {
    display: none;
    width: 45px;
    height: 45px;
    background-color: black;
    color: white;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    flex-shrink: 0;
    transition: transform 0.2s, background-color 0.2s;
}

.back-to-top-arrow:hover {
    transform: scale(1.1);
    background-color: #333;
}

.back-to-top-arrow i {
    border: solid white;
    border-width: 0 3px 3px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(-135deg);
    -webkit-transform: rotate(-135deg);
}

/* 当 右 nav 宽度 + main-container 宽度(840px) > 视口宽度 时只显示箭头，避免挤在一起 */
@media (max-width: 1020px) {
    .floating-toc-wrapper .floating-toc {
        display: none !important;
    }
    .floating-toc-wrapper .back-to-top-arrow {
        display: flex;
    }
}

.compact-list li {
    margin-bottom: 15px;
    line-height: 1.4;
    position: relative;
    padding-left: 15px;
}

.compact-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #5dade2;
}

.compact-list .item-title {
    font-weight: normal; /* Title not bold */
    display: inline;
    color: #000;
    font-size: 1.05em;
}

.compact-list .item-tag {
    font-weight: bold;
    color: #000;
    margin-right: 5px;
}

.compact-list .item-info {
    display: block;
    margin-top: 2px;
}

/* Overfishing Records Styles */
.records-grid {
    display: flex;
    flex-wrap: nowrap; /* Keep in one line */
    gap: 0; /* Connected */
    margin-top: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden; /* Round the corners of the container */
    background: #fff;
}

.record-item {
    padding: 10px 5px;
    text-align: center;
    flex: 1;
    min-width: 0; /* Allow shrinking */
    border-right: 1px solid #eee;
}

.record-item.record-clickable {
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.record-item.record-clickable:hover {
    background-color: #f5f5f5;
}

.record-item:last-child {
    border-right: none;
}

.record-map {
    font-size: 1em;
    color: #888;
    margin-bottom: 4px;
    display: block;
    white-space: nowrap;
}

.record-score {
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
    display: block;
}

.record-item.total {
    background: #000;
    border-left: 1px solid #333;
    border-right: none;
    min-width: 100px;
}

.record-item.total .record-map {
    color: #999;
}

.record-item.total .record-score {
    color: #fff;
    font-size: 1.2em;
}

/* Responsive adjustment for mobile */
@media (max-width: 700px) {
    .records-grid {
        flex-wrap: wrap;
        border: none;
        border-radius: 0;
        background: transparent;
        gap: 5px;
    }
    .record-item {
        border: 1px solid #eee;
        border-radius: 4px;
        background: #fff;
        min-width: 80px;
    }
    .record-item.total {
        min-width: 100%;
    }
}

/* Running log list */
.running-log-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.running-log-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.running-log-item:last-child {
    border-bottom: none;
}
.running-log-item:hover {
    background-color: #f5f5f5;
}
.running-log-date {
    color: #888;
    font-size: 0.95em;
    min-width: 5.5em;
    margin-right: 12px;
}
.running-log-name {
    font-weight: 500;
    color: #333;
}

/* Record image modal */
.record-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.2s, opacity 0.2s ease;
}
.record-modal.record-modal-open {
    visibility: visible;
    opacity: 1;
}
.record-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    cursor: pointer;
}
.record-modal-content {
    position: relative;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
.record-modal-media {
    max-width: 95vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.record-modal-content img.record-modal-media {
    object-fit: contain;
}
.record-modal-iframe {
    display: none;
    width: 90vw;
    height: 85vh;
    min-width: 280px;
    min-height: 400px;
    border: none;
}
.record-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 28px;
    line-height: 1;
    color: #fff;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}
.record-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}
.record-modal-caption {
    position: absolute;
    bottom: -32px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 1.05em;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-family: 'SplatoonHobbyFont', sans-serif;
}
.record-modal-caption a {
    color: #7dd3fc;
    text-decoration: none;
}
.record-modal-caption a:hover {
    text-decoration: underline;
}

/* Strava activity 小窗：点击 activity 在 iframe 中打开 */
.strava-activity-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.2s, opacity 0.2s ease;
}
.strava-activity-modal.strava-activity-modal-open {
    visibility: visible;
    opacity: 1;
}
.strava-activity-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    cursor: pointer;
}
.strava-activity-modal-content {
    position: relative;
    width: 95vw;
    max-width: 960px;
    height: 90vh;
    max-height: 800px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 1;
    overflow: hidden;
}
.strava-activity-iframe {
    flex: 1;
    width: 100%;
    min-height: 0;
    border: none;
    border-radius: 0 0 12px 12px;
}
.strava-activity-modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 24px;
    line-height: 1;
    color: #333;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    border-radius: 6px;
    z-index: 2;
    transition: background-color 0.15s ease;
}
.strava-activity-modal-close:hover {
    background: #fff;
}
.strava-activity-modal-open-link {
    position: absolute;
    bottom: 12px;
    left: 12px;
    margin: 0;
    font-size: 0.95em;
    z-index: 2;
}
.strava-activity-modal-open-link a {
    display: inline-block;
    padding: 10px 18px;
    background: #FC4C02;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(252, 76, 2, 0.4);
    transition: background-color 0.2s, box-shadow 0.2s;
}
.strava-activity-modal-open-link a:hover {
    background: #e64502;
    box-shadow: 0 3px 12px rgba(252, 76, 2, 0.5);
    text-decoration: none;
}
.strava-activity-item {
    cursor: inherit;
}
.strava-activity-item.strava-activity-item-clickable {
    /* cursor 由 template.js 的 POINTER_SELECTORS 注入自定义 pointer */
}
.strava-activity-item.strava-activity-item-clickable:hover {
    background-color: #f0f0f0;
}
