.skill-node-refresh-btn {
    margin-right: 8px;
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px 6px;
}
.skill-node-refresh-btn:hover {
    background: #e9ecef;
}
/* removed sync banner styles */
.skill-tree-login-banner {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    color: #495057;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
}
.skill-tree-login-banner .login-link {
    color: #0d6efd;
    text-decoration: none;
    font-weight: 600;
    margin-left: 6px;
}
.skill-tree-login-banner .login-link:hover {
    text-decoration: underline;
}
.floating-problem-lock-tooltip {
    position: fixed; /* avoid parent clipping and scroll with viewport */
    background: rgba(0,0,0,0.88);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 5000; /* above everything */
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* Ensure red X inside global floating tooltip */
.floating-problem-lock-tooltip .dep-cross {
    color: #e03131 !important;
    font-weight: 700;
}
/* Nowcoder Green Theme */

:root {
    --primary-color: #32ca99;
    --primary-color-light: #eafaf4; /* 8% opacity equivalent */
    --background-color: #f7f8f9;
    --text-color-primary: #222;
    --text-color-secondary: #666;
    --border-color: #e8e8e8;
    --card-background: #ffffff;
    --success-bg: #bfe6de; /* User requested color */
    --rival-bg: rgba(255, 152, 0, 0.25); /* Orange with 25% opacity - deeper orange */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color-primary);
    margin: 0;
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1600px;
    margin: 20px auto;
    padding: 0;
    background-color: transparent;
}

header {
    text-align: center;
    padding: 0;
    background: #fff;
    border-radius: 0;
    margin: 0;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Tracker导航栏样式 */
.tracker-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.tracker-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 56px;
    max-width: 1400px;
    margin: 0 auto;
}

.tracker-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    margin-right: 32px;
}

.tracker-nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    gap: 0;
    /* 允许下拉菜单溢出显示（否则会被裁掉）
       注意：当 overflow-x 不是 visible 时，overflow-y: visible 可能会被计算为 auto 导致仍裁剪 */
    overflow: visible;
}

.tracker-nav-item {
    position: relative;
}

.tracker-nav-link {
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 56px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}

.tracker-nav-link:hover {
    color: #1890ff;
}

.tracker-nav-item.active .tracker-nav-link {
    color: #1890ff;
}

.tracker-nav-item.active .tracker-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 2px;
    background: #1890ff;
}

.tracker-nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.tracker-user-avatar {
    position: relative;
    cursor: pointer;
}

.tracker-user-avatar img {
    border: 2px solid #e5e7eb;
    transition: border-color 0.2s;
}

.tracker-user-avatar:hover img {
    border-color: #1890ff;
}

.tracker-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 1001;
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 镜像流光溢彩动画 */
@keyframes mirrorRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes mirrorShimmer {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes mirrorShine {
    0% {
        opacity: 0.3;
        transform: rotate(0deg) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: rotate(180deg) scale(1.05);
    }
    100% {
        opacity: 0.3;
        transform: rotate(360deg) scale(1);
    }
}

/* 镜像头像容器hover效果 */
.mirror-icon-container:hover .mirror-glow-ring {
    animation-duration: 1.5s;
    filter: brightness(1.2);
}

.mirror-icon-container:hover .mirror-border-glow {
    box-shadow: 0 0 30px rgba(24, 144, 255, 0.8),
                0 0 60px rgba(135, 206, 250, 0.5),
                inset 0 0 30px rgba(24, 144, 255, 0.3);
}

.mirror-icon-container:hover .mirror-avatar {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.mirror-avatar-wrapper {
    transition: transform 0.3s ease;
}

.mirror-icon-container:hover .mirror-avatar-wrapper {
    transform: scale(1.1);
}

.tracker-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #f5f7fa 0%, #fff 100%);
}

.tracker-dropdown-user-info {
    flex: 1;
    min-width: 0;
}

.tracker-dropdown-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tracker-dropdown-id {
    font-size: 13px;
    color: #999;
}

.tracker-dropdown-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 8px 0;
}

.tracker-dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
}

.tracker-dropdown-item:hover {
    background: #f5f7fa;
}

/* 帮助菜单样式 */
.tracker-help-menu {
    position: relative;
}

.tracker-help-link {
    cursor: pointer;
}

.tracker-help-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 140px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 1001;
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}

/* “我的”下拉菜单（hover触发） */
.tracker-my-menu {
    position: relative;
}

.tracker-my-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 160px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 1001;
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}

.tracker-my-dropdown::before {
    /* hover 桥接：覆盖“我的”与下拉之间的 8px 间隙，避免鼠标下移时菜单消失 */
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
    background: transparent;
}

.tracker-my-menu:hover .tracker-my-dropdown {
    display: block;
}

.tracker-my-menu.is-open .tracker-my-dropdown {
    display: block;
}

.tracker-my-menu:focus-within .tracker-my-dropdown {
    display: block;
}


h1 {
    color: var(--text-color-primary);
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 20px 0;
    cursor: pointer;
    transition: transform 0.2s;
}

.nav-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: none;
    color: #333;
    padding: 10px 16px;
    border-radius: 0;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: color 0.2s ease;
    backdrop-filter: none;
}

.tab-btn:hover {
    background: transparent;
    transform: none;
    color: #111;
}

.tab-btn.active {
    background: transparent;
    border-bottom: 2px solid #111;
    box-shadow: none;
}

main {
    flex: 1;
    background: white;
    border-radius: 15px;
    /* 原来 40px 留白偏大，内容利用率不高；收紧一点更紧凑 */
    padding: 24px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* General tab content visibility */
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* Base styles for problems, rankings, etc. */
#problems, #rankings, #daily, #skill-tree, #achievements, #faq {
    padding: 20px;
}

/* Daily 顶部横幅：防止在某些布局/缩放下出现横向溢出 */
#daily { overflow-x: hidden; }
#daily .daily-page-banner { max-width: 100%; box-sizing: border-box; }
#daily .daily-page-banner img { max-width: 100%; }

.coming-soon {
    text-align: center;
    padding: 50px 20px;
    color: #666;
}

.coming-soon h2 {
    font-size: 2em;
    margin-bottom: 10px;
}

/* Problems Tab Styles */
.problems-header {
    margin-bottom: 30px;
}

.search-section {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.input-group input,
.problem-style-input {
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    min-width: 200px;
}

.input-group input:focus {
    outline: none;
    border-color: #c5cbd3;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.06);
}

.search-btn {
    background: #32ca99;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.search-btn:hover {
    background: #2ab88b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(50, 202, 153, 0.3);
}

.search-btn[disabled] {
    background-color: #adb5bd !important;
    cursor: not-allowed !important;
    transform: none !important;
    color: #f8f9fa !important;
}

.search-btn:not([disabled]):hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* Contest Tabs */
.contest-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.view-type-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.view-type-tab {
    background: none;
    border: none;
    padding: 10px 0;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.view-type-tab:hover {
    color: #111;
}

.view-type-tab.active {
    color: #111;
    border-bottom: 2px solid #111;
}

.contest-tab {
    background: none;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.contest-tab:hover {
    background: #f8f9fa;
    color: #111;
}

.contest-tab.active {
    background: transparent;
    color: #111;
    border-bottom: 2px solid #111;
    box-shadow: none;
}

.sub-tabs {
    padding-bottom: 5px;
    margin-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.sub-tabs .contest-tab {
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
    padding: 6px 12px;
}

.sub-tabs .contest-tab.active {
    color: #111;
    border-bottom: 2px solid #32ca99; /* Green highlight for active sub-tab */
}



/* Problems Table */
.problems-table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.problems-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

/* Contest view specific table layout */
#contests-view .problems-table {
    table-layout: fixed;
}

#contests-view .problems-table th,
#contests-view .problems-table td {
    width: 12.5%; /* 8 columns: Contest + A-G */
}

.problems-table th {
    background: #f7f8f9;
    color: #333;
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
}

.problems-table th:first-child {
    text-align: left;
    padding-left: 20px;
}

.problems-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e9ecef;
    text-align: center;
    vertical-align: middle;
}

.problems-table td:first-child {
    text-align: left;
    padding-left: 20px;
    font-weight: 600;
    color: #333;
    white-space: normal; /* Allow contest names to wrap */
}

a.contest-link,
a.problem-link {
    text-decoration: none;
    color: #333;
    transition: color 0.2s ease;
}

a.contest-link:hover,
a.problem-link:hover {
    color: #888;
}

.problems-table tr:hover {
    background: #f8f9fa;
}

.problem-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    min-width: 0; /* Allow flex item to shrink */
}

.problem-cell:first-child {
    justify-content: flex-start;
}

a.problem-link,
span.problem-title-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    max-width: 200px; /* Adjust as needed */
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Difficulty Circles */
.difficulty-circle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
    border: 2px solid;
    cursor: default;
    transition: transform 0.2s ease;
}

.difficulty-circle:hover {
    transform: none;
}

/* 自定义提示框样式 */
.custom-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

/* 灰色：0到699分 */
.difficulty-circle.easy {
    border-color: #6c757d;
    background: #6c757d;
}

/* 紫色：700到1099分 */
.difficulty-circle.medium {
    border-color: #6f42c1;
    background: #6f42c1;
}

/* 蓝色：1100到1499分 */
.difficulty-circle.hard {
    border-color: #007bff;
    background: #007bff;
}

/* 绿色：1500到1999分 */
.difficulty-circle.expert {
    border-color: #28a745;
    background: #28a745;
}

/* 黄色：2000到2399分 */
.difficulty-circle.master {
    border-color: #ffc107;
    background: #ffc107;
}

/* 橙色：2400到2799分 */
.difficulty-circle.grandmaster {
    border-color: #fd7e14;
    background: #fd7e14;
}

/* 红色：2800分以上 */
.difficulty-circle.legend {
    border-color: #dc3545;
    background: #dc3545;
}

/* 基础圆圈样式 - 现在通过JavaScript动态设置 */

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.modal-content {
    background: #fff;
    width: 520px;
    max-width: calc(100% - 40px);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
}
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close {
    background: transparent;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.modal-body { padding: 16px; flex: 1; }
.form-row { margin-bottom: 12px; display: flex; gap: 8px; align-items: center; }
.form-row label { width: 80px; color: #555; }
.form-row input,
.form-row textarea {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 14px;
}
.modal-actions { padding: 12px 16px; border-top: 1px solid #f0f0f0; display: flex; justify-content: flex-end; gap: 8px; }
.modal-secondary { background: #f5f5f5; color: #333; }

/* Rankings Tab Styles */
.rankings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.rankings-header h2 {
    margin: 0;
    color: #111;
    font-size: 2rem;
}

.rankings-search {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rankings-search input {
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    min-width: 200px;
}

.rankings-search input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.rankings-search-btn {
    background: #32ca99;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.rankings-search-btn:hover {
    background: #2ab88b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(50, 202, 153, 0.3);
}

.rankings-container {
    max-width: 800px;
    margin: 0 auto;
}

/* 分页控制样式 */
.rankings-controls {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.page-size-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-size-control label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.page-size-control select {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.page-size-control select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 分页容器样式 */
.pagination-container {
    margin-top: 20px;
    padding: 20px 0;
    border-top: 1px solid #e9ecef;
}

.pagination-info {
    text-align: center;
    margin-bottom: 15px;
    color: #666;
    font-size: 0.9rem;
}

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

.pagination-btn {
    background: #32ca99;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: #2ab88b;
    transform: translateY(-1px);
}

.pagination-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.page-numbers {
    display: flex;
    gap: 5px;
    align-items: center;
}

.page-number {
    background: white;
    border: 2px solid #e9ecef;
    color: #333;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

.page-number:hover {
    border-color: #c5cbd3;
    background: #f8f9fa;
}

.page-number.active {
    background: #e9ecef;
    border-color: #e9ecef;
    color: #333;
}

.page-number.disabled {
    background: #f8f9fa;
    color: #ccc;
    cursor: not-allowed;
    border-color: #e9ecef;
}

.rankings-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.rankings-table th {
    background: #f7f8f9;
    color: #333;
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
}

.rankings-table th:first-child {
    text-align: center;
    width: 60px;
}

.rankings-table th:nth-child(2) {
    text-align: left;
    padding-left: 20px;
}

.rankings-table th:last-child {
    text-align: center;
    width: 100px;
}

.rankings-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e9ecef;
    text-align: center;
    vertical-align: middle;
}

.rankings-table td:first-child {
    text-align: center;
    font-weight: 600;
    color: #333;
}

.rankings-table td:nth-child(2) {
    text-align: left;
    padding-left: 20px;
}

.rankings-table td:last-child {
    text-align: center;
    font-weight: 600;
    color: #333;
}

.rankings-table tr:hover {
    background: #f8f9fa;
}

/* Only highlight the actual top 3 ranks globally, not per page */
.rankings-table tr[data-rank="1"] td:first-child {
    color: #ffd700;
    font-weight: bold;
}

.rankings-table tr[data-rank="2"] td:first-child {
    color: #c0c0c0;
    font-weight: bold;
}

.rankings-table tr[data-rank="3"] td:first-child {
    color: #cd7f32;
    font-weight: bold;
}

.rankings-table tr.highlighted {
    background: #f3f4f6 !important;
    border-left: 4px solid #e9ecef;
    animation: highlightRow 0.5s ease;
}

@keyframes highlightRow {
    0% {
        background: #fff3e0;
        transform: scale(1.02);
    }
    100% {
        background: #e3f2fd;
        transform: scale(1);
    }
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-cell .username {
    font-weight: 600;
    transition: color 0.3s ease;
}

/* Rating Circles - 复用difficulty-circle的样式 */
.rating-circle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
    border: 2px solid;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.rating-circle:hover {
    transform: scale(1.2);
}

/* Submissions Tab Styles */
.submissions-container {
    max-width: 1000px;
    margin: 0 auto;
}

.submission-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    margin: 10px 0;
    background: #ffffff;
    border-radius: 8px;
    border-left: 4px solid #e9ecef;
}

/* FAQ Tab Styles */
#faq {
    padding-left: 0;
}

.faq-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.faq-mascot {
    flex-shrink: 0;
    width: 20%;
    min-width: 180px;
}

.faq-mascot-img {
    width: 100%;
    height: auto;
}

.faq-content-wrapper {
    flex: 1;
    min-width: 0;
}

.faq-content-wrapper h2 {
    margin-bottom: 30px;
}

.faq-item {
    background: #ffffff;
    border-radius: 10px;
    padding: 25px;
    margin: 20px 0;
    border-left: 4px solid #e9ecef;
}

.faq-item h3 {
    color: #111;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.faq-item p {
    color: #666;
    line-height: 1.6;
}

.faq-icon {
    width: 32px;
    height: 32px;
    vertical-align: middle;
    margin-right: 8px;
}

/* 按钮样式 */
.view-btn {
    background: #32ca99;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
    margin-top: 10px;
}

.view-btn:hover {
    background: #2ab88b;
}

/* 难度标签样式 */
.difficulty {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.difficulty.简单 {
    background: rgba(50, 202, 153, 0.08);
    color: #32ca99;
}

.difficulty.中等 {
    background: rgba(50, 202, 153, 0.08);
    color: #32ca99;
}

.difficulty.困难 {
    background: rgba(50, 202, 153, 0.08);
    color: #32ca99;
}

/* 状态标签样式 */
.status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.status.accepted {
    background: rgba(50, 202, 153, 0.08);
    color: #32ca99;
}

.status.wrong-answer {
    background: rgba(50, 202, 153, 0.08);
    color: #32ca99;
}

.status.time-limit-exceeded {
    background: rgba(50, 202, 153, 0.08);
    color: #32ca99;
}

.time {
    color: #666;
    font-size: 0.9rem;
    margin-left: 10px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

footer {
    text-align: center;
    padding: 20px 0;
    color: #999;
    opacity: 0.8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .tracker-nav {
        padding: 0 16px;
    }
    
    .tracker-nav-menu {
        gap: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tracker-nav-link {
        padding: 0 12px;
        font-size: 14px;
        white-space: nowrap;
    }
    
    .tracker-logo {
        margin-right: 16px;
    }
    
    .tracker-logo img {
        height: 28px;
    }
    
    .tracker-user-dropdown {
        width: 240px;
        right: -10px;
    }
    
    header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .nav-tabs {
        justify-content: center;
    }
    
    .tab-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    main {
        padding: 16px;
    }
    
    .tab-content h2 {
        font-size: 1.5rem;
    }
    
    .search-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-group input {
        min-width: auto;
    }
    
    .contest-tabs {
        flex-wrap: wrap;
    }
    
    .contest-tab {
        flex: 1;
        min-width: 120px;
    }
    
    .problems-table-container {
        font-size: 0.9rem;
    }
    
    .problem-cell {
        flex-direction: column;
        gap: 4px;
    }
    
    .rankings-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .rankings-search {
        justify-content: center;
    }
    
    .rankings-search input {
        min-width: auto;
        flex: 1;
    }
    
    .rankings-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .page-size-control {
        justify-content: center;
    }
    
    .pagination-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .page-numbers {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .faq-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .faq-mascot {
        width: 100%;
        text-align: center;
    }
    
    .faq-mascot-img {
        width: 280px;
        max-width: 90%;
    }
}

/* Tutorial section styles */
.tutorial-section {
    margin-bottom: 20px;
}

.tutorial-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tutorial-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.tutorial-icon {
    font-size: 48px;
    margin-right: 20px;
    flex-shrink: 0;
}

.tutorial-content {
    flex: 1;
    color: white;
}

.tutorial-content h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
}

.tutorial-content p {
    margin: 0 0 15px 0;
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.5;
}

.tutorial-link {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.tutorial-link:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.tutorial-link:active {
    transform: translateY(0);
}

/* Practice View Table Styles */
.practice-table th.knowledge-point-header {
    width: 15%;
    text-align: left;
    padding-left: 20px;
}
.practice-table th.problems-header {
    width: 85%;
}
.practice-table td.knowledge-point-cell {
    font-weight: 600;
    vertical-align: top;
    text-align: left;
    padding-top: 15px;
    padding-left: 20px;
}
.practice-table .problems-cell-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 5px 0;
}
.practice-problem-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 0 18%; /* Allows up to 5 items per row */
    min-width: 150px;
    padding: 5px;
    border-bottom-right-radius: 6px;
}

/* Practice Problem Highlighting */
.practice-problem-item.status-ac {
    background-color: var(--success-bg);
    border-radius: 4px;
    padding: 2px 6px;
    display: inline-block; /* Ensure background covers the item */
}
.practice-problem-item.status-rival-ac {
    background-color: var(--rival-bg);
    border-radius: 4px;
    padding: 2px 6px;
    display: inline-block; /* Ensure background covers the item */
}

/* New styles for problem cell content and truncation */
.problem-cell-content {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
}

.problem-cell-content .problem-link {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px; /* Adjust as needed */
    display: inline-block;
    vertical-align: middle;
}

.practice-problem-item .problem-cell-content .problem-link {
    max-width: 250px; /* Allow more space in practice view */
}

.difficulty-circle {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid;
    flex-shrink: 0;
}

.custom-tooltip {
    position: absolute;
    background-color: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9em;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none; /* Avoid tooltip blocking mouse events */
    white-space: pre-wrap; /* Respect newlines from JS */
}

/* Contest Link Styling */
.problems-table td a {
    color: inherit; /* Inherit color from the table cell */
    text-decoration: none;
}

.problems-table td a:hover {
    text-decoration: underline;
}

/* Practice view table: Use fixed layout and precise widths */
#practice-view .problems-table {
    table-layout: fixed;
}

#practice-view .problems-table td:first-child {
    width: 18%; /* Fixed width for the knowledge-point column */
    min-width: 140px;
}

#practice-view .problems-table td:not(:first-child):not(:empty) {
    width: 16.4%; /* (100% - 18%) / 5 */
}

/* Interview view table: Use same layout as practice view */
#interview-view .problems-table {
    table-layout: fixed;
}

#interview-view .problems-table td:first-child {
    width: 18%; /* Fixed width for the knowledge-point column */
    min-width: 140px;
}

#interview-view .problems-table td:not(:first-child):not(:empty) {
    width: 82%; /* Remaining width for problems column */
    text-align: center; /* Center the problems content */
}

/* Interview view specific styles for practice-style rendering */
#interview-view .problems-cell-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 5px 0;
    justify-content: center; /* Center the problems within the container */
}

#interview-view .practice-problem-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 0 18%; /* Allows up to 5 items per row */
    min-width: 150px;
    padding: 5px;
    border-bottom-right-radius: 6px;
    justify-content: center; /* Center content within each problem item */
}

/* Problem Cell Highlighting - Increased specificity to override other styles */
body .problems-table tbody tr td.status-ac,
body .problems-table tbody tr td.status-all-ac {
    background-color: var(--success-bg) !important;
}

body .problems-table tbody tr td.status-rival-ac {
    background-color: var(--rival-bg) !important;
}

body .problems-table tbody tr td.status-none {
    background-color: transparent;
}

/* course：比赛名全AC时，仅做“加粗”提示，文字颜色保持黑色 */
#course-view td.course-contest-cell.status-all-ac a {
    color: var(--text-color-primary) !important;
    font-weight: 700;
}

/* Rankings Tab Styles */
.rankings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.rankings-table th, .rankings-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
    vertical-align: middle;
}

.rankings-table th {
    background-color: #f2f2f2;
}

.rank-header {
    width: 15%;
}

.user-header {
    width: 55%;
}

.ac-header {
    width: 30%;
}

.user-cell {
    display: flex;
    align-items: center;
    justify-content: start;
    text-align: left;
    padding-left: 20px; /* Add some padding */
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
}

.user-nickname {
    font-weight: bold;
}

.user-nickname-link {
    text-decoration: none;
    color: inherit;
}

.user-nickname-link:hover .user-nickname {
    text-decoration: underline;
}

.user-rank-container {
    margin: 20px 0;
    padding: 15px;
    background-color: #eef7ff;
    border: 1px solid #cce5ff;
    border-radius: 5px;
    text-align: center;
}

.highlight-row {
    background-color: #fff3cd !important;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    position: relative;
    width: auto;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
    max-width: 750px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #111;
    margin: 0;
}

.modal-close {
    display: none;
}

/* Daily Problem Styles */
.daily-container {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.daily-problem-card {
    width: 100%;
    text-align: center;
}

.niukeniang-container {
    text-align: center;
    background: transparent;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

/* Daily video tutorial banner */
.video-tutorial-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.video-tutorial-icon { font-size: 22px; }
.video-tutorial-content { display: flex; align-items: center; gap: 12px; }
.video-tutorial-title { font-weight: 600; color: #333; }
.video-tutorial-link {
    display: inline-flex;
    align-items: center;
    background: #e8f5ff;
    color: #007bff;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: 600;
}
.video-tutorial-link:hover { background: #d9efff; text-decoration: none; }
.video-tutorial-link.is-disabled {
    background: #f0f2f5;
    color: #9aa4b2;
    cursor: not-allowed;
    pointer-events: none;
}

/* Inline video player under daily video banner */
.inline-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}
.inline-video iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Inline video with right sidebar list */
.inline-video-layout {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-top: 10px;
}
.inline-video-layout .inline-video { flex: 1 1 auto; margin-top: 0; order: 2; }
.inline-video-sidebar {
    order: 1;
    width: 240px;
    max-height: 420px;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.video-ym {
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 6px;
    margin-bottom: 6px;
}
.video-ym:last-child { border-bottom: none; margin-bottom: 0; }
.video-ym__header { display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-weight: 600; color: #333; padding: 6px 4px; border-radius: 6px; }
.video-ym__header:hover { background: #f7f9fb; }
.video-ym.open .video-ym__days { display: grid; }
.video-ym__days { display: none; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 6px 2px; }
.video-day { text-align: center; padding: 6px 0; border-radius: 6px; cursor: pointer; background: #f5f7fa; color: #333; font-weight: 600; }
.video-day:hover { background: #e9f2ff; color: #007bff; }
.video-day.is-today { border: 1px solid #007bff; }
.video-day.is-selected { background: #007bff; color: #fff; }
.video-day.is-disabled { background: #f0f2f5; color: #9aa4b2; cursor: not-allowed; pointer-events: none; }

@media (max-width: 900px) {
    .inline-video-layout { flex-direction: column; }
    .inline-video-sidebar { width: 100%; max-height: none; }
    .video-ym__days { grid-template-columns: repeat(7, 1fr); }
}

/* Admin sharelink panel */
.admin-sharelink-panel {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.admin-sharelink-panel .row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.admin-sharelink-panel label { color: #555; font-weight: 600; }
.admin-sharelink-panel input[type="date"] { padding: 6px 8px; border: 1px solid #d0d7de; border-radius: 6px; }
.admin-sharelink-panel input[type="url"] { flex: 1; padding: 6px 8px; border: 1px solid #d0d7de; border-radius: 6px; }
.admin-sharelink-actions { display: flex; gap: 8px; }
.admin-btn { display: inline-flex; align-items: center; background: #e8f5ff; color: #007bff; padding: 6px 10px; border-radius: 6px; font-weight: 600; cursor: pointer; border: none; }
.admin-btn:hover { background: #d9efff; }
.admin-toolbar { display: flex; gap: 10px; margin: 8px 0; }

.niukeniang-large-img {
    width: 200px;
    height: auto;
    border: none;
    border-radius: 0;
    object-fit: cover;
    box-shadow: none;
}

/* Speech bubble for Niukeniang */
.niukeniang-speech {
    background: #ffffff;
    border: 4px solid #000;
    border-radius: 12px;
    padding: 12px 14px;
    color: #222;
    font-weight: 600;
    max-width: 520px;
    line-height: 1.5;
    position: relative;
    margin-top: -60px; /* lift bubble a bit upwards */
}
.niukeniang-speech::before {
    content: '';
    position: absolute;
    left: -22px;
    top: 50%;
    transform: translateY(-50%);
    width: 0; height: 0;
    border-top: 14px solid transparent;
    border-bottom: 14px solid transparent;
    border-right: 22px solid #000; /* outer border */
}
.niukeniang-speech::after {
    content: '';
    position: absolute;
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 0; height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 16px solid #ffffff; /* bubble fill */
}

@media (max-width: 720px) {
    .niukeniang-container { flex-direction: column; gap: 10px; }
    .niukeniang-speech { max-width: 100%; }
    .niukeniang-speech::before, .niukeniang-speech::after { display: none; }
}

.daily-problem-card h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #333;
    font-weight: 500;
    text-align: center;
}

.daily-problem-card h3 a.problem-title-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.daily-problem-card h3 a.problem-title-link:hover {
    color: #0056b3;
}

.daily-problem-card .problem-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 10px;
}

/* Daily Card top stats (above title) */
.daily-top-stats {
    text-align: center;
    margin-bottom: 8px;
    font-size: 14px;
    color: #495057;
}

.daily-problem-card .meta-item {
    padding: 3px 8px;
    background-color: #f8f9fa;
    border-radius: 20px;
}

.go-to-problem-btn {
    display: inline-block;
    background-color: #28a745;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: background-color 0.2s, transform 0.1s;
    width: 80px;
    text-align: center;
    box-sizing: border-box;
    flex-shrink: 0;
    cursor: pointer;
}

.go-to-problem-btn:hover {
    background-color: #218838;
}

.debug-controls {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px dashed #ced4da;
    border-radius: 8px;
    text-align: center;
    color: #6c757d;
}

.debug-controls p {
    margin-bottom: 15px;
    font-style: italic;
}

.debug-btn {
    padding: 5px 10px;
    font-size: 12px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.debug-btn:hover {
    background-color: #5a6268;
}

.go-to-problem-btn.check-in-btn[disabled] {
    background-color: #28a745;
    color: white;
    cursor: default;
    opacity: 0.8;
}

.go-to-problem-btn.check-in-btn[disabled]::after {
    content: " ✔";
    font-weight: bold;
}

.daily-action-container {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ac-status-note {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 5px;
}

.go-to-problem-btn.check-in-prompt {
    background-color: #ffc107; /* Yellowish/Orange for prompt */
    color: #212529;
    width: 80px;
}

.go-to-problem-btn.check-in-prompt:hover {
    background-color: #e0a800;
}

.go-to-problem-btn.check-in-complete[disabled] {
    background-color: #28a745;
    color: white;
    cursor: default;
    opacity: 0.8;
    width: 120px;
}

.go-to-problem-btn.check-in-complete[disabled]::after {
    content: " ✔";
    font-weight: bold;
}

/* --- Daily View Layout --- */
#daily .daily-page-banner {
    width: 100%;
    margin: 12px 0 18px;
    border-radius: 12px;
    overflow: hidden;
    background: #0b1220;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    display: block;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
}

#daily .daily-page-banner:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

#daily .daily-page-banner:focus-visible {
    outline: 3px solid rgba(50, 202, 153, 0.65);
    outline-offset: 3px;
}

#daily .daily-page-banner img {
    width: 100%;
    height: auto;
    display: block;
    /* 原图为 2400x300 => 8:1，按此比例展示避免过高 */
    aspect-ratio: 8 / 1;
    object-fit: cover;
    /* 顶部对齐，便于裁切时不丢上沿元素 */
    object-position: top center;
}

.daily-view-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.left-column {
    flex: 0 0 75%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.right-column {
    flex: 0 0 20%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Login Prompt Styles */
.login-prompt {
    padding: 20px;
    text-align: center;
    background-color: #f8f9fa;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;
    align-items: center;
    height: 100%;
}
.login-prompt .prompt-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: #343a40;
    margin: 0;
}
.login-prompt .login-btn {
    display: inline-block;
    padding: 10px 25px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.2s ease;
}
.login-prompt .login-btn:hover {
    background-color: #0056b3;
}
.login-prompt .refresh-note {
    font-size: 0.8rem;
    color: #6c757d;
    margin: 0;
}


/* Calendar Stats */
.calendar-stats {
    text-align: center;
    margin-bottom: 15px;
    padding: 10px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.calendar-stats .stats-text {
    font-size: 0.9rem;
    color: #495057;
    font-weight: 500;
    margin: 0;
}

.calendar-stats .stats-highlight {
    color: #32ca99;
    font-weight: 600;
}

/* Calendar Styles */
#check-in-calendar-container {
    max-width: 100%;
    padding: 10px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

#calendar-month-year {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
}

.calendar-nav-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 11px;
    color: #555;
    transition: background-color 0.2s, color 0.2s;
    padding: 0;
    line-height: 20px;
}

.calendar-nav-btn:hover {
    background-color: #f0f0f0;
    color: #000;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    text-align: center;
}

.calendar-weekday {
    font-size: 0.75rem;
    padding: 0;
    color: #6c757d;
}

.calendar-day {
    width: 100%;
    padding-bottom: 100%; /* Creates a square aspect ratio */
    position: relative;
    background-color: #ebedf0; /* Default GitHub grey */
    border-radius: 50%; /* Changed to circle */
    cursor: pointer;
    font-size: 0.7rem; /* Font size for the number */
    color: #666;
}

.calendar-day-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none; /* Allow mouse events to pass through to the parent div */
}

.calendar-day.other-month {
    visibility: hidden; /* Hide days from other months */
}

/* --- CALENDAR DAY STYLING LOGIC --- */

/* Level 3: Base style for any day with a problem */
.calendar-grid .calendar-day.has-problem {
    cursor: pointer;
    background-color: #f0f8ff; /* A light blue to indicate it's special */
}
.calendar-grid .calendar-day.has-problem:hover {
    background-color: #e3f2fd;
    border: 1px solid #90caf9;
}

/* Level 2: Today's style (overrides has-problem) */
.calendar-grid .calendar-day.today {
    background-color: #1976d2;
    color: white;
    border-radius: 50%;
}
.calendar-grid .calendar-day.today:hover {
     background-color: #1565c0; /* A slightly darker blue on hover */
}
.calendar-grid .calendar-day.today .calendar-day-number {
    color: white;
}


/* Level 1 (Highest Priority): Checked-in style (overrides everything) */
.calendar-day.checked-in,
.calendar-day.checked-in:hover {
    background-color: #388e3c !important; /* A deep green background */
    color: white !important;
    border-radius: 50%;
    border: none;
}
.calendar-day.checked-in .calendar-day-number {
    color: white !important;
    font-weight: bold;
}

/* Level 1 (Highest Priority): Retro-checkin style (overrides everything) */
.calendar-day.retro-checkin,
.calendar-day.retro-checkin:hover {
    background-color: #d4edda !important; /* A light green background */
    color: #155724 !important; /* A dark green text color for contrast */
    border-radius: 50%;
    border: none;
}
.calendar-day.retro-checkin .calendar-day-number {
    color: #155724 !important;
    font-weight: bold;
}

/* Level 1 (Highest Priority): Supplemented check-in style */
.calendar-day.supplement-check-in,
.calendar-day.supplement-check-in:hover {
    background-color: #8bc34a !important; /* A light green color */
}


.loading-spinner {
    border: 4px solid #f3f3f3; /* Light grey */
    border-top: 4px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- User Summary Panel --- */
#user-summary-panel {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    width: 100%; /* Ensure it takes full width of its container */
    box-sizing: border-box; /* Include padding in width calculation */
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.summary-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #eee;
}

.summary-nickname {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
}

.summary-stats {
    display: flex;
    flex-direction: column; /* Stack stat items vertically */
    gap: 8px; /* Add some space between stat items */
    width: 100%;
    margin-top: 12px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Vertically align label and value */
    width: 100%;
    font-size: 0.9em;
}

.stat-item .label {
    color: var(--text-color-secondary);
    white-space: nowrap; /* Prevent label from wrapping */
    margin-right: 10px; /* Add some space between label and value */
}

.stat-item .value,
.stat-item .rank-link {
    font-weight: bold;
    color: var(--text-color-primary);
}

/* Daily summary specific fine-tuning */
.summary-stats .stat-item {
    padding: 2px 0; /* tighten spacing slightly */
}
.summary-stats .label {
    font-size: 0.95em;
}
.summary-stats .value {
    font-size: 1em;
}

.checked-in-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.check-in-status {
    display: inline-block;
    background-color: #28a745;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9rem;
    width: 100px;
    text-align: center;
    box-sizing: border-box;
    white-space: nowrap;
}

.share-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    transition: background-color 0.2s, transform 0.1s;
    background-color: #28a745;
    color: white;
    width: 80px;
    text-align: center;
    box-sizing: border-box;
    flex-shrink: 0;
}

.share-btn:hover {
    background-color: #218838;
}

.share-btn:active {
    transform: scale(0.98);
}

/* --- Debug Panel --- */
#debug-panel {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 193, 7, 0.9); /* Yellow, slightly transparent */
    padding: 8px;
    text-align: center;
    z-index: 2000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}

/* Admin panel for skill tree question management */
.admin-panel { font-size: 14px; }
.admin-panel .admin-tab-btn {
    padding: 6px 10px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
}
.admin-panel .admin-tab-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(50, 202, 153, 0.15) inset;
}
.admin-panel form label { font-weight: 600; color: #444; }
.admin-panel input[type="text"],
.admin-panel input[type="number"],
.admin-panel select {
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.admin-panel form button[type="submit"] {
    padding: 6px 10px;
    border: 1px solid var(--primary-color);
    background: var(--primary-color);
    color: #fff;
    border-radius: 6px;
}
.admin-panel form button[disabled] { opacity: 0.6; cursor: not-allowed; }

#debug-panel button {
    padding: 8px 15px;
    background-color: #343a40;
    color: white;
    border: 1px solid #ffc107;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
}

#debug-panel button:hover {
    background-color: #495057;
}


.daily-problem-card .problem-meta {
    display: flex;
    gap: 20px;
}

/* Coin Rule Tooltip Styles */
.coin-rule-tooltip {
    position: relative;
    display: inline-block;
    margin-left: 8px;
}

.coin-rule-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: white;
    color: #666;
    border: 2px solid #ddd;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    cursor: help;
    transition: all 0.3s ease;
    vertical-align: super;
    font-family: Arial, sans-serif;
}

.coin-rule-icon:hover {
    background-color: #f8f9fa;
    border-color: #999;
    color: #333;
    transform: scale(1.1);
}

.coin-rule-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    left: 50%;
    top: calc(100% + 10px);
    transform: translateX(-50%);
    background-color: #2c3e50;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    z-index: 1000;
    font-size: 14px;
    line-height: 1.8;
    font-weight: normal;
    text-align: left;
    transition: all 0.3s ease;
    pointer-events: none;
}

.coin-rule-content::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-bottom-color: #2c3e50;
}

.coin-rule-tooltip:hover .coin-rule-content {
    visibility: visible;
    opacity: 1;
}

.coin-rule-content strong {
    font-size: 15px;
    color: #ffd700;
}

/* Coin Exchange Link Styles */
.coin-exchange-link-container {
    margin-top: 12px;
    text-align: center;
}

.coin-exchange-link {
    display: inline-block;
    padding: 6px 12px;
    background-color: #ffd700;
    color: #333;
    text-decoration: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.coin-exchange-link:hover {
    background-color: #ffed4e;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.4);
    text-decoration: none;
    color: #333;
}

/* Daily Problem Difficulty Styles */
.daily-difficulty {
    margin: 8px 0 12px 0;
    font-size: 14px;
    font-weight: 500;
}

/* Tooltip Styles */
.tooltip {
    position: absolute;
    background-color: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 1000;
    pointer-events: none; /* Prevents the tooltip from interfering with mouse events */
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.tooltip .status-checked-in {
    color: #4caf50; /* A vibrant green for the checkmark text */
    font-weight: bold;
}

.status-retro-checkin {
    color: #28a745; /* A vibrant green for the checkmark text in tooltip */
    font-weight: bold;
}

/* Calendar day with a problem - Increased specificity */
.stats-text .stats-highlight {
    color: #4CAF50; /* A pleasant green */
    font-weight: bold;
}

#calendar-stats .stats-highlight[style*="ffd700"] {
    color: #4CAF50 !important; /* Override inline style to keep it green */
}

/* ------------------------- */
/* Skill Tree Styles         */
/* ------------------------- */

.skill-tree-container {
    padding: 20px;
    background-color: #f9fafb;
    position: relative; /* 作为 SVG 覆盖层的定位参考容器 */
}

.skill-tree-login-prompt {
    text-align: center;
    padding: 50px;
    font-size: 1.2em;
    color: #666;
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.skill-tree-graph {
    display: flex;
    flex-wrap: wrap;
    gap: 40px 20px; /* 垂直间距大，水平间距小 */
    position: relative;
    padding: 20px;
}

.skill-node {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 16px;
    text-align: center;
    transition: all 0.2s ease-in-out;
    position: relative;
    min-width: 120px;
}

/* --- New styles for DAG layout --- */

.skill-tree-dag-container {
    display: flex;
    gap: 20px;
}

.dag-main-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: relative; /* Keep for positioning child elements if needed */
}

.dag-main-column:first-child {
    flex: 0.7;
}

.skill-tree-column {
    width: 100%;
    padding: 14px;
    border: 2px dashed #e9ecef;
    border-radius: 12px;
    position: relative;
    background-color: #fff;
}

.skill-tree-column__title {
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    color: var(--text-color-secondary);
    margin-bottom: 14px;
}

.skill-tree-column__nodes {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 第三章：每个虚框内的知识点一行两个 */
.skill-tree-dag-container--stage3 .skill-tree-column__nodes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* --- Specific Column Layouts --- */

/* Input column: 2x2 grid */
#skill-tree-column-col-2 .skill-tree-column__nodes {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}
#skill-tree-column-col-2 .skill-node {
    flex: 0 1 calc(50% - 15px);
}

/* 增加“基本类型与输入”大虚框与上方模块的垂直间距 */
#skill-tree-column-col-2 {
    margin-top: 28px;
}

/* Arithmetic column: 2x3 grid */
#skill-tree-column-col-3 .skill-tree-column__nodes {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
#skill-tree-column-col-3 .skill-node {
    flex: 0 1 calc(33.33% - 15px);
    writing-mode: horizontal-tb; /* Ensure horizontal text */
}

/* Control Flow column: 2x2 grid */
#skill-tree-column-col-4 .skill-tree-column__nodes {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
#skill-tree-column-col-4 .skill-node {
    flex: 0 1 calc(50% - 15px);
}

/* Array column: horizontal layout */
#skill-tree-column-col-5 .skill-tree-column__nodes {
    flex-direction: row;
    justify-content: center; /* Center the items */
    gap: 10px;
}

/* 缩小右侧三列中的节点卡片尺寸 */
#skill-tree-column-col-3 .skill-node,
#skill-tree-column-col-4 .skill-node,
#skill-tree-column-col-5 .skill-node {
    padding: 8px 10px;
    min-width: 100px;
}

.skill-node {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
    transition: all 0.2s ease-in-out;
    position: relative;
    min-width: 110px;
}

.skill-node:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.skill-node__title {
    font-weight: 500;
    font-size: 0.85rem;
    margin-bottom: 6px;
    position: relative;
    z-index: 2;
}

/* States Override */
.skill-node--completed {
    background-color: var(--primary-color-light);
    border-color: #16a34a;
}
.skill-node--no-questions {
    background-color: #f8f9fa;
    border-color: #e5e7eb;
    color: #6b7280;
}
.skill-node--no-questions:hover {
    transform: none;
    box-shadow: none;
    border-color: #e5e7eb;
}
.skill-node--no-questions .skill-node__title {
    color: #6b7280;
}
.skill-node--no-questions .skill-node__progress-text {
    color: #9ca3af;
    font-size: 0.72rem;
}
.skill-node--locked {
    background-color: #f8f9fa;
    color: #adb5bd;
    position: relative;
}
.skill-node--locked .skill-node__title {
     color: #adb5bd;
}

/* 知识点节点的锁定图标 */
.skill-node__lock-icon {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 16px;
    height: 16px;
    opacity: 0.8;
    z-index: 3;
    cursor: help;
}

.skill-node__lock-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
}

.skill-node__lock-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.skill-node__lock-icon:hover + .skill-node__lock-tooltip,
.skill-node--locked:hover .skill-node__lock-tooltip {
    display: block;
}

.skill-node__progress-text {
    font-size: 0.7rem;
    position: relative;
    z-index: 2;
}

/* --- Refactored Lock Icon & Tooltip for Columns --- */
.skill-tree-column__lock-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 20px;
    height: 20px;
    opacity: 0.9;
    z-index: 3;
    cursor: help;
}

.skill-tree-column__tooltip {
    position: absolute;
    top: -10px;
    right: 15px;
    transform: translateY(-100%);
    background-color: #343a40;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    z-index: 10;
    min-width: 220px;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

.skill-tree-column__lock-icon:hover + .skill-tree-column__tooltip,
.skill-tree-column__tooltip:hover {
    opacity: 1;
    visibility: visible;
}

.skill-tree-column__tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 15px;
    border-width: 5px;
    border-style: solid;
    border-color: #343a40 transparent transparent transparent;
}

.tooltip-cross {
    color: #ef4444;
    font-weight: bold;
    margin-left: 4px;
}

.tooltip-check {
    color: #22c55e; /* Green checkmark */
    font-weight: bold;
    margin-left: 4px;
}

.skill-tree-column__tooltip .met {
    color: #adb5bd; /* Gray out completed items */
}

/* --- Right Side Panel for Skill Node Details --- */
.skill-node-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100%;
    background-color: #ffffff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: visible; /* allow children (tooltips) to escape panel bounds */
}

.skill-node-panel.visible {
    transform: translateX(0);
}

.skill-node-panel__close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.skill-node-panel__content {
    padding: 30px;
    overflow-y: auto;
    overflow-x: visible; /* allow tooltips to extend beyond content box horizontally */
    flex-grow: 1;
}

.skill-node-panel__title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--text-color-primary);
}

.skill-node-panel__description {
    font-size: 1rem;
    color: var(--text-color-secondary);
    margin-bottom: 25px;
    line-height: 1.6;
}

.skill-node-panel__actions {
    margin: -10px 0 18px;
}
.skill-node-panel__actions-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.skill-node-panel__actions-hint {
    color: var(--text-color-secondary);
    font-size: 12px;
}
.skill-node-learn-btn {
    background: #1890ff;
    color: #fff;
}
.skill-node-learn-btn:hover {
    background: #147ad6;
}

.skill-node-panel__divider {
    border-top: 1px solid #e9ecef;
    margin: 20px 0;
}

/* 学习 Demo：基础输出（MVP） */
.learning-demo-modal .modal-content {
    width: 980px;
    max-width: calc(100% - 40px);
    height: 82vh;
}
.learning-demo-modal__body {
    padding: 14px;
    /* 让“头部固定 + 内容区滚动”生效：关键是 min-height:0，否则内部 overflow:auto 不会滚动 */
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* 学习 Demo：原理概览页（打开时优先展示） */
.learning-demo-overview {
    padding: 6px 6px 2px 6px;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0; /* 允许内部滚动区域收缩 */
}
.learning-demo-overview__title {
    font-size: 18px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 12px;
}
.learning-demo-overview__body {
    background: linear-gradient(135deg, rgba(240, 249, 255, 0.88), rgba(255, 255, 255, 0.96));
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-radius: 14px;
    padding: 14px 14px;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.06);
    overflow: auto;
    flex: 1;
}
.learning-demo-overview__section + .learning-demo-overview__section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(229, 231, 235, 0.95);
}
.learning-demo-overview__h {
    font-weight: 800;
    color: #374151;
    margin-bottom: 6px;
}
.learning-demo-overview__p {
    color: #374151;
    line-height: 1.8;
    font-size: 14px;
}
.learning-demo-overview__p code,
.learning-demo-overview__code code {
    background: rgba(17, 24, 39, 0.06);
    padding: 1px 6px;
    border-radius: 6px;
}
.learning-demo-overview__code {
    margin-top: 8px;
    padding: 10px 12px;
    background: rgba(17, 24, 39, 0.92);
    color: #f9fafb;
    border-radius: 12px;
    font-size: 13px;
    overflow: auto;
}
.learning-demo-overview__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.learning-demo-overview__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap; /* 避免窄屏时把翻页挤出可视区域 */
}
.learning-demo-overview__head .learning-demo-overview__title {
    flex: 1;
    min-width: 220px;
}
.learning-demo-overview__pager {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.learning-demo-overview__pager-indicator {
    font-size: 13px;
    color: #6b7280;
    font-weight: 700;
    min-width: 52px;
    text-align: center;
}
.learning-demo-overview__pager-btn {
    padding: 8px 12px;
    border-radius: 10px;
}

/* 窄屏：翻页按钮换行到下一行居中 */
@media (max-width: 720px) {
    .learning-demo-overview__pager {
        width: 100%;
        justify-content: center;
        margin-top: 4px;
    }
}
.learning-demo-overview__page {
    animation: overviewFade 180ms ease;
}
@keyframes overviewFade {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
.learning-demo-diagram {
    margin-top: 10px;
    background: rgba(255,255,255,0.8);
    border: 1px solid rgba(229,231,235,0.95);
    border-radius: 14px;
    padding: 10px 10px;
    overflow: hidden;
}

/* 数位DP教程插图 */
.learning-demo-overview__img {
    width: 100%;
    height: auto;
    display: block;
    margin-top: 10px;
    border-radius: 14px;
    border: 1px solid rgba(229,231,235,0.95);
    box-shadow: 0 10px 26px rgba(17, 24, 39, 0.10);
}

/* 数位DP弹窗：更大一些，避免图片/讲解过挤（不影响基础输出 Demo） */
#digit-dp-demo-modal .modal-content.learning-demo-modal__content {
    width: 1180px;
    max-width: calc(100% - 32px);
    height: 88vh;
}

@media (max-width: 960px) {
    #digit-dp-demo-modal .modal-content.learning-demo-modal__content {
        width: calc(100% - 20px);
        height: 90vh;
    }
}
.learning-demo-layout {
    display: flex;
    gap: 14px;
    height: 100%;
}
.learning-demo-left {
    flex: 1.15;
    display: flex;
    flex-direction: column;
    min-width: 320px;
}
.learning-demo-right {
    flex: 0.85;
    display: flex;
    flex-direction: column;
    min-width: 280px;
}
.learning-demo-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.learning-demo-hint {
    color: var(--text-color-secondary);
    font-size: 12px;
}
.learning-demo-label {
    color: #555;
    font-size: 12px;
    margin-right: 4px;
}
.learning-demo-toolbar__right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.learning-demo-coach {
    margin-bottom: 10px;
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid rgba(24,144,255,0.25);
    background: linear-gradient(135deg, rgba(24,144,255,0.10), rgba(114,46,209,0.08));
    position: relative;
    overflow: hidden;
}
.learning-demo-coach::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(90deg, rgba(24,144,255,0.0), rgba(24,144,255,0.35), rgba(114,46,209,0.25), rgba(24,144,255,0.0));
    background-size: 240% 100%;
    /* 去掉扫光动画（避免分散注意力） */
    animation: none;
    transform: none;
    background-position: 50% 50%;
    pointer-events: none;
    opacity: 0.7;
}
@keyframes coachGlow {
    0% { transform: translateX(-25%); }
    100% { transform: translateX(25%); }
}
.learning-demo-coach__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}
.learning-demo-coach__title {
    font-weight: 800;
    color: #0b5ed7;
    letter-spacing: 0.5px;
}
.learning-demo-coach__subtitle {
    color: var(--text-color-secondary);
    font-size: 12px;
}
.learning-demo-coach__body {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 1;
}
.learning-demo-coach__say {
    color: #334155;
    font-size: 12px;
    line-height: 1.45;
}
.learning-demo-coach__codewrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.learning-demo-coach__btns {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.learning-demo-coach__code {
    display: inline-block;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(11,18,32,0.92);
    color: #e8f0ff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    white-space: pre;
    box-shadow: 0 10px 26px rgba(11,18,32,0.16);
    /* 代码框可滚动，避免过长撑爆布局 */
    max-height: 320px;
    overflow: auto;
}

/* 调试高亮模式：按行渲染 + 高亮当前执行行 */
.learning-demo-coach__code.code-debug {
    display: block;
    white-space: normal;
    width: 100%;
    max-width: 100%;
}
.learning-demo-coach__code .code-line {
    display: flex;
    gap: 10px;
    padding: 2px 6px;
    border-radius: 8px;
}
.learning-demo-coach__code .code-line.active {
    background: rgba(250, 204, 21, 0.22);
    box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.28);
}
.learning-demo-coach__code .code-ln {
    width: 2.4em;
    text-align: right;
    color: rgba(232, 240, 255, 0.55);
    font-variant-numeric: tabular-nums;
    user-select: none;
    flex: 0 0 auto;
}
.learning-demo-coach__code .code-src {
    /* 该换行就换行：保留缩进，同时允许长行自动折行 */
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    flex: 1 1 auto;
}
.learning-demo-coach__btn {
    background: #1890ff;
    color: #fff;
}
.learning-demo-coach__btn:hover {
    background: #147ad6;
}
.learning-demo-coach__restore-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.learning-demo-select {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    background: #fff;
}
.learning-demo-editor {
    flex: 1;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.45;
    resize: none;
    background: #fcfcff;
    tab-size: 4;
}
.learning-demo-errors {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #ffd6d6;
    background: #fff1f0;
    color: #a8071a;
    font-size: 12px;
    white-space: pre-wrap;
}
.learning-demo-panel {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
}
.learning-demo-panel__title {
    font-weight: 700;
    color: #222;
    font-size: 13px;
    margin-bottom: 8px;
}
.learning-demo-console {
    margin: 0;
    padding: 10px 10px;
    border-radius: 8px;
    background: #0b1220;
    color: #e8f0ff;
    min-height: 120px;
    max-height: 240px;
    overflow: auto;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
}
.learning-demo-steps {
    margin: 0;
    padding-left: 18px;
    max-height: 280px;
    overflow: auto;
    color: #444;
    font-size: 12px;
}
.learning-demo-steps li {
    padding: 6px 6px;
    border-radius: 8px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}
.learning-demo-steps li.is-active {
    background: #e6f7ff;
    outline: 1px solid #91d5ff;
}
.learning-demo-steps li.is-done {
    opacity: 0.65;
}
.learning-demo-steps .step-explain {
    flex: 1;
}
.learning-demo-steps .step-preview {
    color: #888;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.learning-demo-actions {
    align-items: center;
}
.learning-demo-status {
    color: #444;
    font-size: 12px;
    max-width: 55%;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
}
.learning-demo-run-btn {
    background: #1890ff;
    color: #fff;
}
.learning-demo-run-btn:hover {
    background: #147ad6;
}

@media (max-width: 960px) {
    .learning-demo-modal .modal-content {
        width: calc(100% - 20px);
        height: 86vh;
    }
    .learning-demo-layout {
        flex-direction: column;
    }
    .learning-demo-status {
        max-width: 100%;
    }
}

.skill-node-panel__content h4 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 15px;
}

.skill-node-panel__problems-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.skill-node-panel__problems-list li {
    margin-bottom: 10px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.skill-node-panel__problems-list li a {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-color-primary);
    border: 1px solid #e9ecef;
    border-radius: 6px;
}

.skill-node-panel__problems-list li a:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.skill-node-panel__problems-list li.completed a {
    background-color: #e6f4ea;
    border-color: #bce3c9;
    color: #2b643f;
}

/* Locked problem items */
.skill-node-panel__problems-list li.locked a {
    position: relative;
    background-color: #f8f9fa;
    border-color: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    pointer-events: auto; /* allow hover for tooltip; click is disabled via href */
}
.skill-node-panel__problems-list li .problem-lock-icon {
    margin-left: 10px;
    position: relative;
}
.skill-node-panel__problems-list li .problem-lock-icon .icon-lock {
    width: 16px;
    height: 16px;
    fill: #6c757d !important; /* deep gray */
    color: #6c757d !important; /* fallback */
    vertical-align: -2px;
}
.skill-node-panel__problems-list li .problem-lock-icon .problem-lock-tooltip {
    display: none;
}
.skill-node-panel__problems-list li.locked {
    position: relative; /* for tooltip positioning */
}
.skill-node-panel__problems-list li.locked .problem-lock-tooltip {
    display: none;
    position: absolute;
    right: 100%; /* place left of the gray box */
    margin-right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 2001; /* above the panel (panel is 1000) */
}
.skill-node-panel__problems-list li.locked:hover .problem-lock-tooltip {
    display: block; /* show tooltip when hovering the whole gray box */
}
.skill-node-panel__problems-list .dep-cross {
    color: #e03131; /* red X */
    font-weight: bold;
    margin-left: 4px;
}

/* --- Coming Soon Placeholder --- */
.coming-soon {
    text-align: center;
    padding: 80px 40px;
    margin-top: 50px;
    background-color: #f8f9fa;
    border-radius: 12px;
}
.coming-soon h3 {
    font-size: 1.8rem;
    color: var(--text-color-primary);
    margin-bottom: 15px;
}
.coming-soon p {
    color: var(--text-color-secondary);
    font-size: 1rem;
}

/* --- Profile View --- */
#profile.active {
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Changed from center to flex-start for top alignment */
    min-height: calc(100vh - 200px); /* Adjust based on header/footer height */
}

/* ------------------------- */
/* Achievements Styles       */
/* ------------------------- */
.achievements-container { padding: 10px; }
.achievements-layout { display: flex; gap: 20px; }
.achievements-sidebar {
    flex: 0 0 240px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    height: fit-content;
}
.achievements-content {
    flex: 1;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px 20px;
}
.achv-cat-btn { width: 100%; text-align: left; background: transparent; border: none; padding: 10px 12px; border-radius: 6px; cursor: pointer; color: #333; font-weight: 700; }
.achv-cat-btn:hover { background: #f7f8f9; }
.achv-cat-btn.active { background: #eff7f3; color: #0f5132; border-left: 3px solid #32ca99; }

.achv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.achv-grid-vertical { display: flex; flex-direction: column; gap: 12px; }
.achv-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    gap: 10px;
    align-items: center;
}
.achv-row { align-items: center; }
.achv-achieved-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.achv-chip { background: #f3f4f6; color: #333; padding: 2px 6px; border-radius: 10px; font-size: 12px; }
.achv-chip-muted { background: #f1f3f5; color: #888; }

/* 已完成成就的小图标展示（替代文字chip） */
.achv-badge-list { display: flex; align-items: center; gap: 6px; padding: 4px 0; flex-wrap: wrap; }
.achv-badge-time { color: #999; font-size: 12px; margin-left: 6px; }

/* Better tooltip for badges and titles */
.achv-tip { position: relative; cursor: default; }
.achv-tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: rgba(25, 28, 31, 0.95);
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-line;
  min-width: 180px;
  max-width: 280px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease, visibility .15s ease;
  z-index: 20;
  pointer-events: none;
}
.achv-tip::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(25, 28, 31, 0.95);
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease, visibility .15s ease;
}
.achv-tip:hover::after, .achv-tip:hover::before { opacity: 1; visibility: visible; }
.achv-target-row { color: #555; font-size: 12px; margin: 2px 0 6px; }
.achv-icon { display: none; }
.achv-info { flex: 1; min-width: 0; }
.achv-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.achv-finish-time { color: #8a8f98; font-size: 12px; white-space: nowrap; }
.achv-title { font-weight: 600; color: #222; }
.achv-desc { color: #666; font-size: 12px; margin-top: 2px; }
.achv-progress { height: 6px; background: #eef2f4; border-radius: 6px; overflow: hidden; margin-top: 8px; }
.achv-progress-inner { height: 100%; background: #32ca99; width: 0; transition: width .3s ease; }
.achv-progress-value { font-size: 14px; color: var(--primary-color); margin-top: 4px; text-align: center; font-weight: 600; }
.achv-badge { font-size: 12px; color: #888; white-space: nowrap; }
.achv-card.unlocked { border-color: #32ca99; background: #f0fbf7; }
.achv-card.unlocked .achv-badge { color: #0f5132; font-weight: 700; }
.achv-points-badge { min-width: 42px; height: 42px; border-radius: 50%; background: #f5f7f9; color: #111; display: flex; align-items: center; justify-content: center; font-weight: 800; }

/* Frame title styles */
.achv-frame { display: inline-block; padding: 4px 10px; border: 2px solid currentColor; border-radius: 12px; font-weight: 700; line-height: 1; }
.achv-frame--sm { padding: 2px 8px; border-width: 1.5px; font-size: 12px; }
.achv-frame--gray { color: #6c757d; border-color: #cfd4da; }
.achv-frame--green { color: #28a745; }
.achv-frame--blue { color: #0d6efd; }
.achv-frame--purple { color: #6f42c1; }
.achv-frame--orange { color: #fd7e14; }
.achv-frame--gold { color: #b8860b; }
.achv-frame--red { color: #dc3545; }

/* Overview */
.achv-overview { display: flex; flex-direction: column; gap: 16px; }
.achv-overview-card { background: #fff; border: 1px solid var(--border-color); border-radius: 12px; padding: 16px; min-width: 220px; width: 100%; }
.achv-overview-title { color: #666; font-size: 13px; margin-bottom: 8px; }
.achv-overview-value { font-size: 28px; font-weight: 800; color: #111; }
.achv-recent-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.achv-recent-item { border-bottom: 1px dashed #e5e7eb; padding-bottom: 8px; }
.achv-recent-item:last-child { border-bottom: none; }
.achv-recent-name { font-weight: 600; color: #222; }
.achv-recent-meta { color: #999; font-size: 12px; }
.achv-recent-desc { color: #555; font-size: 12px; margin-top: 2px; }
.achv-recent-time { color: #999; font-size: 12px; margin-top: 2px; }
.flex-1 { flex: 1; }

/* Achievements list header */
.achv-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    color: #6c757d;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
}
.achv-list-header__left { letter-spacing: 1px; }
.achv-list-header__right { letter-spacing: 1px; }

/* Achievements toolbar */
.achv-toolbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.achv-merge-toggle {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #f6f8fa;
    color: #333;
    cursor: pointer;
}
.achv-merge-toggle:hover { background: #eef2f6; }

/* Toasts */
.toast-root { position: fixed; bottom: 16px; right: 16px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--border-color); border-radius: 12px; padding: 10px 12px; box-shadow: 0 6px 24px rgba(0,0,0,0.12); min-width: 260px; max-width: 420px; }
.toast__icon { width: 36px; height: 36px; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #f6f8fa; }
.toast__icon img { width: 100%; height: 100%; object-fit: cover; }
.toast__body { flex: 1; min-width: 0; }
.toast__title { font-weight: 700; color: #111; }
.toast__desc { color: #555; font-size: 12px; margin-top: 2px; }
.toast__points { font-weight: 800; color: #111; }
.toast-enter { transform: translateY(-8px); opacity: 0; }
.toast-enter-active { transform: translateY(0); opacity: 1; transition: all .25s ease; }
.toast-leave { transform: translateY(0); opacity: 1; }
.toast-leave-active { transform: translateY(-8px); opacity: 0; transition: all .2s ease; }

/* Skill tree summary SVG overlay */
.skill-tree-svg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

.profile-logged-out {
    text-align: center;
    padding: 40px;
    background-color: var(--background-color); /* Changed to var(--background-color) for dark mode */
    border-radius: 12px;
}
.profile-logged-out h2 {
    color: var(--text-color-primary);
}
.profile-logged-out p {
    color: var(--text-color-secondary);
    margin-bottom: 20px;
}
.profile-logged-out .input-group {
    display: flex;
    justify-content: center;
}
.profile-logged-out input {
    width: 200px;
    margin-right: 10px;
}

.profile-card {
    width: 100%;
    max-width: 600px;
    background: var(--card-background); /* Changed to var(--card-background) for dark mode */
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    text-align: center;
}

.profile-header {
    background: linear-gradient(135deg, #56CCF2, #2F80ED); /* Changed to a more vibrant gradient */
    padding: 40px 20px;
    position: relative;
}

/* 名片页：浮动搜索框（玻璃态，不改变名片布局） */
.profile-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 12px;
    position: relative; /* 给下拉结果定位 */
}
.profile-search-floating {
    position: fixed;
    top: 92px;
    left: 50%;
    transform: translateX(360px);
    z-index: 2000;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(10px);
}
.profile-search-floating .profile-search-input,
.profile-search-floating .profile-search-btn {
    background: rgba(255, 255, 255, 0.92);
}
.profile-search-floating .profile-search-btn:hover {
    background: rgba(255, 255, 255, 1);
}
.profile-search-input {
    width: 180px;
    max-width: 45vw;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #111827;
    font-size: 12px;
    outline: none;
}
.profile-search-input::placeholder {
    color: #6b7280;
}
.profile-search-btn {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #1f2937;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}
.profile-search-btn:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
}

@media (max-width: 1100px) {
    .profile-search-floating {
        top: auto;
        left: auto;
        transform: none;
        right: 14px;
        bottom: 14px;
    }
}

/* 搜索结果页 */
.profile-search-page {
    max-width: 1200px;
    margin: 18px auto 0;
    padding: 0 12px;
}
.profile-search-page-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
}
.profile-search-page-card {
    background: var(--card-background);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.08);
    overflow: hidden;
}
.profile-search-page-empty {
    padding: 16px 14px;
    color: #6b7280;
    font-size: 13px;
}
.profile-search-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
}
@media (max-width: 720px) {
    .profile-search-grid {
        grid-template-columns: 1fr;
    }
}
.profile-search-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 12px;
    background: #fff;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.profile-search-card:hover {
    transform: translateY(-1px);
    border-color: rgba(24,144,255,0.35);
    box-shadow: 0 10px 22px rgba(0,0,0,0.10);
}
.profile-search-avatar-link {
    display: inline-flex;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    text-decoration: none;
}
.profile-search-avatar-lg {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.profile-search-avatar-lg.ph {
    background: #e5e7eb;
}
.profile-search-row-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.profile-search-row-name {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-search-name-link {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-search-name-link:hover {
    color: #1890ff;
    text-decoration: underline;
}
.profile-search-row-uid {
    font-size: 12px;
    color: #6b7280;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

.profile-name {
    color: white;
    font-size: 2.2em;
    font-weight: 700;
    margin: 0;
}

/* 名片页：昵称右侧关注按钮 */
.profile-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 6px;
}

.profile-follow-btn {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
    user-select: none;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.profile-follow-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}
.profile-follow-btn:active {
    transform: translateY(0);
    filter: brightness(0.98);
}
.profile-follow-btn:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.75);
    outline-offset: 3px;
}
.profile-follow-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    filter: none;
    box-shadow: none;
}

/* 粉色：关注 / 回关 */
.profile-follow-btn.is-pink {
    background: #ff4d9d;
    color: #ffffff;
    border-color: #ff4d9d;
}
.profile-follow-btn.is-pink:hover:not(:disabled) {
    background: #ff2f8f;
    border-color: #ff2f8f;
}

/* 灰色：已关注 / 已互粉 */
.profile-follow-btn.is-gray {
    background: #e5e7eb;
    color: #6b7280;
    border-color: #d1d5db;
}
.profile-follow-btn.is-gray:hover:not(:disabled) {
    background: #dfe3ea;
    border-color: #cbd5e1;
}

/* “我的”页：昵称可点击跳转个人主页 */
.profile-name-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}
.profile-name-link:hover {
    text-decoration: underline;
}
.profile-name-link:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.75);
    outline-offset: 4px;
    border-radius: 6px;
}

.profile-uid {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1em;
}

/* 名片页：对战统计（红框风格） */
.battle-mini {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.battle-mini-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.battle-mini-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-color-primary);
}
.battle-mini-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #111827;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    white-space: nowrap;
}
.battle-mini-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.battle-mini-stat {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}
.battle-mini-k {
    font-size: 13px;
    color: var(--text-color-secondary);
    white-space: nowrap;
}
.battle-mini-v {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-color-primary);
    line-height: 1;
    white-space: nowrap;
}

.battle-mini-actions {
    display: flex;
    justify-content: flex-end;
}
.battle-mini-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #1890ff;
    background: #f0f5ff;
    border: 1px solid #adc6ff;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.battle-mini-link:hover {
    background: #1890ff;
    border-color: #1890ff;
    color: #fff;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    padding: 25px 0;
    background-color: var(--background-color); /* Changed to var(--background-color) for dark mode */
}

.profile-stats .stat-item {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    color: var(--text-color-primary);
}

.stat-label {
    font-size: 0.9em;
    color: var(--text-color-secondary);
    text-transform: uppercase;
}

.profile-details {
    padding: 30px;
}

.detail-item {
    display: flex;
    align-items: center;
    font-size: 1.1em;
    color: var(--text-color-primary);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}
.detail-item:last-child {
    border-bottom: none;
}

.detail-icon {
    font-size: 1.5em;
    margin-right: 20px;
    width: 30px; /* for alignment */
}

.detail-label {
    margin-right: auto;
    text-align: left;
}

.detail-value {
    font-weight: 600;
}

/* Tooltip Styles */
.tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 5px;
}

.tooltip-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #ccc;
    color: white;
    font-size: 12px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
}

.tooltip-text {
    visibility: hidden;
    width: 180px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -90px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* --- Dark Theme --- */
body.dark-theme .profile-card {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

body.dark-theme .profile-header {
    background: linear-gradient(135deg, #233a4f, #1e456e);
}

body.dark-theme .profile-avatar {
    border-color: #333;
}

/* --- Summary & Stage --- */
.skill-tree-summary {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 调整为每行三列：每个大章占1/3宽度 */
    grid-auto-rows: minmax(120px, auto); /* 为空行提供可见占位高度 */
    gap: 20px;
    align-items: start;
}

/* 第一章下的小“简章：拂晓”与虚线连接样式 */
.skill-tree-card-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* 侧边悬浮的"间章"布局，位于第一章卡片右侧，用 LeaderLine 风格的红色虚线连接 */
.skill-tree-card-group.side-mini {
    position: relative;
}
.skill-tree-card-group.side-mini .skill-tree-mini-card {
    position: absolute;
    top: 16px; /* 默认：与第一章标题同行偏移 */
    left: calc(100% + 24px);
    border-color: #ff4d4f; /* 红色描边 */
}
.skill-tree-card-group.side-mini::before {
    content: '';
    position: absolute;
    top: 28px;
    left: 100%;
    width: 24px;
    height: 0;
    border-top: 2px dashed #ff4d4f; /* 红色虚线 */
}

/* 侧边悬浮的"间章"布局，位于第二章卡片左侧，用 LeaderLine 风格的红色虚线连接 */
.skill-tree-card-group.side-mini-left {
    position: relative;
}
.skill-tree-card-group.side-mini-left .skill-tree-mini-card {
    position: absolute;
    top: 50%; /* 垂直居中 */
    transform: translateY(-50%); /* 向上偏移自身高度的一半 */
    right: calc(100% + 24px);
    border-color: #ff4d4f; /* 红色描边 */
}
.skill-tree-card-group.side-mini-left::before {
    content: '';
    position: absolute;
    top: 50%; /* 垂直居中 */
    right: 100%;
    width: 24px;
    height: 0;
    border-top: 2px dashed #ff4d4f; /* 红色虚线 */
}

.skill-tree-mini-connector {
    width: 2px;
    height: 26px;
    border-left: 2px dashed #cfd4da; /* 虚线 */
}

.skill-tree-mini-card {
    padding: 14px 20px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    color: var(--text-color-primary);
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    min-width: 260px; /* 预留通关率一行的空间 */
    min-height: 64px; /* 预留两行文本高度 */
    text-align: center;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.skill-tree-mini-card:not(.locked) { cursor: pointer; }
.skill-tree-mini-card:not(.locked):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    border-color: var(--primary-color);
}
/* 第二章间章去掉hover移动效果，保持垂直居中 */
.skill-tree-card-group.side-mini-left .skill-tree-mini-card:not(.locked):hover {
    transform: translateY(-50%); /* 保持垂直居中，去掉向上移动效果 */
}

.skill-tree-mini-card__title { font-weight: 600; }

/* 简章的头部与进度条样式 */
.skill-tree-mini-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.skill-tree-mini-card__progress-text {
    font-size: 0.9rem;
    color: var(--text-color-secondary);
}

.skill-tree-mini-card__progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.skill-tree-mini-card__progress-bar-inner {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 6px;
    transition: width 0.5s ease;
}

/* 锁定态：与阶段卡片一致的外观与提示 */
.skill-tree-mini-card.locked {
    background-color: #f3f4f6;
    color: #9ca3af;
    position: relative;
}
.skill-tree-mini-card.locked .skill-tree-mini-card__progress-bar-inner { background-color: #d1d5db; }
.skill-tree-mini-card.locked .skill-tree-mini-card__title,
.skill-tree-mini-card.locked .skill-tree-mini-card__progress-text { color: #9ca3af; }
.skill-tree-mini-card.locked .skill-tree-card__tooltip { display: none; position: absolute; left: 0; bottom: 100%; transform: translateY(-8px); background: rgba(0,0,0,0.85); color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 12px; white-space: nowrap; z-index: 1500; pointer-events: none; }
.skill-tree-mini-card.locked:hover .skill-tree-card__tooltip { display: block; }
.skill-tree-mini-card.locked .skill-tree-card__tooltip .dep-cross { color: #e03131; font-weight: 700; }

/* 保证阶段卡片在网格中等宽展开 */
.skill-tree-card { 
    width: 100%; 
    min-height: 110px; 
    position: relative;
    overflow: hidden;
}

/* 章节背景图案容器 */
.stage-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* 确保卡片内容在背景图案之上 */
.skill-tree-card__header,
.skill-tree-card__progress-bar,
.skill-tree-card__tooltip {
    position: relative;
    z-index: 1;
}

/* 第一章：晨曦微光 - 太阳发光 */
.stage-bg-sun {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
}

.stage-bg-sun svg {
    animation: sunRotate 20s linear infinite;
}

@keyframes sunRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 第二章：懵懂新芽 - 发芽 */
.stage-bg-sprout {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 10px;
    background: linear-gradient(to top, rgba(82, 196, 26, 0.08) 0%, transparent 50%);
}

.stage-bg-sprout svg {
    animation: sproutGrow 3s ease-in-out infinite;
    transform-origin: bottom center;
}

@keyframes sproutGrow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 第三章：初显峥嵘 - 山脉 */
.stage-bg-mountain {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: linear-gradient(to top, rgba(24, 144, 255, 0.1) 0%, transparent 60%);
}

.stage-bg-mountain svg {
    width: 120%;
    height: auto;
    margin-left: -10%;
}

/* 第五章：踏浪凌云 - 波浪/流光 */
.stage-bg-wave {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 20%, rgba(145, 167, 255, 0.10) 0%, transparent 55%),
                radial-gradient(circle at 80% 30%, rgba(99, 230, 190, 0.08) 0%, transparent 60%);
}
.stage-bg-wave svg {
    transform: scale(1.06);
}
.stage-bg-wave .cloud-layer {
    transform-box: fill-box;
    transform-origin: center;
    animation: cloudDrift 6.2s ease-in-out infinite;
}
.stage-bg-wave .cloud-layer--2 { animation-duration: 7.4s; animation-delay: -1.3s; }
.stage-bg-wave .cloud-layer--3 { animation-duration: 8.2s; animation-delay: -2.0s; }
.stage-bg-wave .cloud-shine {
    animation: cloudShine 4.2s ease-in-out infinite;
}
@keyframes cloudDrift {
    0%, 100% { transform: translateX(-2.2%) translateY(0); }
    50% { transform: translateX(2.2%) translateY(-1.0%); }
}
@keyframes cloudShine {
    0%, 100% { opacity: 0.40; transform: translateX(-2%); }
    50% { opacity: 0.88; transform: translateX(2%); }
}

/* 自定义位置：第二章在第一章右下、第三章在第二章左下 */
.skill-tree-card.stage-1 { grid-column: 1 / 2; grid-row: 1; }
.skill-tree-card.stage-2 { grid-column: 3 / 4; grid-row: 3; margin-top: 40px; }
.skill-tree-card.stage-3 { grid-column: 1 / 2; grid-row: 5; margin-top: 40px; }

/* 让第一章的间章相对定位于第一章卡片 */
.skill-tree-card-group.stage-1 { grid-column: 1 / 2; grid-row: 1; }
/* 让第二章的间章相对定位于第二章卡片 */
.skill-tree-card-group.stage-2 { grid-column: 3 / 4; grid-row: 3; margin-top: 40px; }
/* 让第三章的间章相对定位于第三章卡片，保持第三章原来的位置布局 */
.skill-tree-card-group.stage-3 { grid-column: 1 / 2; grid-row: 5; margin-top: 40px; }
/* 第三章的“惊鸿”间章：在第三章卡片右侧、垂直居中，效果类似第一章与“拂晓”但位置更居中 */
.skill-tree-card-group.stage-3 .skill-tree-mini-card {
    top: 50%;
    transform: translateY(-50%);
}
.skill-tree-card-group.stage-3::before {
    top: 50%;
}

/* 第四章/第五章（潜龙篇）大卡布局：参考第一章/第二章的“左上 + 右下” */
.skill-tree-card.stage-4 { grid-column: 1 / 2; grid-row: 1; }
.skill-tree-card.stage-5 { grid-column: 3 / 4; grid-row: 3; margin-top: 40px; }

/* Summary View Card */
.skill-tree-card {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 25px;
    margin-bottom: 0; /* Use gap for spacing */
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    flex: 0 1 calc(50% - 10px); /* Two columns, no grow, accounting for gap */
    box-sizing: border-box;
}

/* Interlude Detail Styles */
.interlude-detail { padding: 12px 8px; }
.interlude-ribbon {
    display: inline-block;
    background: linear-gradient(90deg, #fff0f6, #f8f9fa);
    color: #7c2f4b;
    border: 1px solid #f3d1dc;
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 700;
    margin-bottom: 12px;
}
/* 魔法阵容器 */
.interlude-circle {
    position: relative;
    width: min(560px, 88vw);
    height: min(560px, 88vw);
    margin: 12px auto 0 auto;
}
.interlude-magic {
    position: absolute;
    inset: 0;
}
.interlude-chip {
    position: absolute;
    min-width: 120px;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 10px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.interlude-chip:hover {
    /* 保持位置不动，仅增强光影与描边 */
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    border-color: var(--primary-color);
}
/* 间章按钮复用 skill-node，但不随 hover 位移 */
.interlude-chip.skill-node:hover { transform: translateY(0) !important; }
/* 在间章视图中的 skill-node 均不做位移，完全对齐第一/二章视觉 */
.interlude-detail .skill-node { transform: translateY(0) !important; transition: box-shadow .15s ease, border-color .15s ease !important; }
.interlude-detail .skill-node:hover { transform: translateY(0) !important; }
.interlude-chip__title { font-weight: 600; color: #333; }
.interlude-chip__progress { font-size: 12px; color: var(--primary-color); font-weight: 600; margin-top: 4px; }
.interlude-chip.completed { border-color: #40c057; }

/* 将五个知识点放置到圆周五角星的五个顶点（R≈42%） */
/* 微调五个顶点坐标，使按钮恰好落在五角星顶点上 */
/* 对齐最外层大圆五个顶点（外接五角星顶点） */
.interlude-chip--pos1 { left: 40%;  top: 2%;   }
.interlude-chip--pos2 { left: 88%;  top: 36%;  }
.interlude-chip--pos3 { left: 72%;  top: 77%;  }
.interlude-chip--pos4 { left: 8%;  top: 77%;  }
.interlude-chip--pos5 { left: -10%;  top: 36%;  }

@media (max-width: 520px) {
    .interlude-chip { min-width: 100px; font-size: 14px; }
}

/* 第二章菱形布局：四个大虚框（列）菱形对称，内部知识点每行两个 */
.skill-tree-detail--stage2 .stage2-diamond {
    /* 表格(网格)布局：3行×3列。便于通过行列定位四个虚框 */
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: repeat(5, auto);
    gap: 48px 28px; /* 加大行距，提高上下两层间隔 */
    justify-items: center;
    align-items: center; /* 纵向居中每个格子中的虚框 */
    position: relative; /* 供钻石装饰 SVG 绝对定位 */
    padding: 10px 0;
}
.stage2-diamond { position: relative; }
.stage2-diamond .stage2-diamond-decor {
    position: absolute;
    /* 再缩小一些并整体上移，尽量贴合四个虚框中心 */
    left: 24%;
    right: 24%;
    top: 6%;
    bottom: 22%;
    z-index: 0;
    pointer-events: none;
}

/* 确保四个虚框在各自格子里绝对居中 */
.skill-tree-detail--stage2 .stage2-diamond > .skill-tree-column {
    justify-self: center;
    align-self: center;
}
.stage2-diamond .skill-tree-column { position: relative; z-index: 1; }

/* 四个虚框按行列放置（1,2）、（2,1）、（2,3）、（3,2） */
.skill-tree-detail--stage2 .stage2-pos-top,
.skill-tree-detail--stage2 .stage2-pos-left,
.skill-tree-detail--stage2 .stage2-pos-right,
.skill-tree-detail--stage2 .stage2-pos-bottom { position: static; transform: none; }

/* 调整第二章详情中四个板块的宽度，避免过宽互相遮挡 */
.skill-tree-detail--stage2 .skill-tree-column.two-per-row { width: 420px; }
.skill-tree-detail--stage2 .skill-tree-column.two-per-row .skill-tree-column__nodes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.skill-tree-detail--stage2 .skill-tree-column.two-per-row .skill-node { min-height: 56px; }

/* 顶、左、右、底 四个位置（网格定位） */
.skill-tree-detail--stage2 .stage2-pos-top { grid-column: 2; grid-row: 1; }
.skill-tree-detail--stage2 .stage2-pos-left { grid-column: 1; grid-row: 3; }
.skill-tree-detail--stage2 .stage2-pos-right { grid-column: 3; grid-row: 3; }
.skill-tree-detail--stage2 .stage2-pos-bottom { grid-column: 2; grid-row: 5; }

/* 第四章五边形布局：五个大虚框分别放在“五角星/五边形”五个顶点 */
.skill-tree-detail--stage4 .stage4-pentagon {
    position: relative;
    width: min(1100px, 96vw);
    height: min(720px, 78vh);
    margin: 10px auto 0 auto;
}
.skill-tree-detail--stage4 .stage4-pentagon-decor {
    position: absolute;
    left: 18%;
    right: 18%;
    top: 6%;
    bottom: 10%;
    z-index: 0;
    pointer-events: none;
}
/* 第四章中列（大虚框）的尺寸需要收敛，否则五边形会互相遮挡 */
.skill-tree-detail--stage4 .stage4-pentagon > .skill-tree-column {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 320px;
    z-index: 1;
}

/* 第四章：数学进阶（s4-col-nt）单独加宽，方便“三个一行” */
#skill-tree-column-s4-col-nt {
    width: 440px;
}

/* 第四章：每个大虚框内部知识点两列，并适当缩窄节点样式 */
.skill-tree-detail--stage4 .skill-tree-column__nodes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.skill-tree-detail--stage4 .skill-node {
    min-width: 0;              /* 允许在两列中收缩 */
    padding: 8px 10px;         /* 更紧凑 */
}
.skill-tree-detail--stage4 .skill-node__title {
    font-size: 0.82rem;
    line-height: 1.2;
    word-break: break-word;    /* 避免长标题撑破布局 */
}
.skill-tree-detail--stage4 .skill-node__progress-text {
    font-size: 0.75rem;
}
/* 五个顶点位置：沿用 interlude 的五角星顶点坐标风格 */
.skill-tree-detail--stage4 .stage4-pos-pos1 { left: 50%; top: 8%; }   /* 顶点1：上 */
.skill-tree-detail--stage4 .stage4-pos-pos2 { left: 88%; top: 34%; }  /* 顶点2：右上 */
.skill-tree-detail--stage4 .stage4-pos-pos3 { left: 74%; top: 82%; }  /* 顶点3：右下 */
.skill-tree-detail--stage4 .stage4-pos-pos4 { left: 26%; top: 82%; }  /* 顶点4：左下 */
.skill-tree-detail--stage4 .stage4-pos-pos5 { left: 12%; top: 34%; }  /* 顶点5：左上 */

@media (max-width: 980px) {
    .skill-tree-detail--stage4 .stage4-pentagon {
        height: min(820px, 85vh);
    }
    .skill-tree-detail--stage4 .stage4-pentagon > .skill-tree-column {
        width: min(320px, 86vw);
    }
}

.skill-tree-card.locked {
    background-color: #f3f4f6;
    cursor: not-allowed;
    color: #9ca3af;
}

.skill-tree-card.locked:hover {
    transform: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border-color: var(--border-color);
}

.skill-tree-card.locked::after {
    content: attr(data-lock-reason);
    position: absolute;
    left: 0;
    bottom: 100%;
    transform: translateY(-8px);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    display: none;
    z-index: 1500;
}

.skill-tree-card.locked:hover::after {
    display: block;
}

/* 确保容器允许溢出以显示左侧提示框 */
.skill-tree-summary { overflow: visible; }
.skill-tree-card { overflow: visible; position: relative; }
.skill-tree-card__tooltip {
    position: absolute;
    left: 0;
    bottom: 100%;
    transform: translateY(-8px);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    display: none;
    z-index: 1500;
}
.skill-tree-card__tooltip .dep-cross { color: #e03131; font-weight: 700; }
.skill-tree-card.locked:hover .skill-tree-card__tooltip,
.skill-tree-boss-container.locked:hover .skill-tree-card__tooltip { display: block; }

/* 关闭旧的 ::after 黑色提示残留 */
.skill-tree-card.locked::after { content: none !important; display: none !important; }


.skill-tree-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.08);
    border-color: var(--primary-color);
}

.skill-tree-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.skill-tree-card__title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color-primary);
}

.skill-tree-card.locked .skill-tree-card__title,
.skill-tree-card.locked .skill-tree-card__progress-text {
    color: #9ca3af;
}

.skill-tree-card__progress-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color-secondary);
}

.skill-tree-card__progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.skill-tree-card__progress-bar-inner {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.skill-tree-card.locked .skill-tree-card__progress-bar-inner {
    background-color: #d1d5db;
}

/* Detail View Header */
.skill-tree-detail__header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}

.back-button {
    background: transparent;
    border: 1px solid #ccc;
    color: #555;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.back-button:hover {
    background-color: #f0f0f0;
    border-color: #aaa;
}

.skill-tree-detail__description {
    margin-bottom: 30px;
    color: var(--text-color-secondary);
    font-size: 1rem;
}


/* Stages Layout */
.skill-tree-stages-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.skill-tree-stage {
    flex: 1 1 calc(50% - 20px); /* Two items per row, accounting for gap */
    box-sizing: border-box;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.skill-tree-stage__title {
    font-size: 1.3rem;
    font-weight: 600;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color-primary);
}

.skill-node-panel__problems-list .problem-title {
    flex-grow: 1;
}

.skill-node-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px; /* Add some space below the header */
}

.skill-node-panel__title {
    margin: 0; /* Reset margin from h3 */
}

.skill-node-panel__score {
  font-size: 0.9em;
  font-weight: bold;
  color: var(--text-color-secondary);
  background-color: var(--background-color-light);
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.skill-node-panel__problems-list .problem-difficulty,
.skill-node-panel__problems-list .problem-score,
.skill-node-panel__problems-list .problem-pass-total {
    font-size: 0.85em;
    color: var(--text-color-secondary);
    margin-left: 16px;
    flex-shrink: 0;
}

/* Generic fallbacks when outside list context */
.problem-pass-total { font-size: 0.85em; color: var(--text-color-secondary); margin-left: 16px; flex-shrink: 0; }
.problem-score { font-size: 0.85em; color: var(--text-color-secondary); margin-left: 16px; flex-shrink: 0; }

/* Override existing difficulty styles to be simpler */
.problem-difficulty.difficulty-basic { background-color: transparent; color: inherit; }

.skill-node-panel__footer {
    text-align: right;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.skill-node-panel__score {
  font-size: 1em;
  font-weight: bold;
  color: var(--text-color-secondary);
  background-color: transparent; /* Remove old background */
  padding: 0; /* Reset padding */
  border-radius: 0; /* Reset radius */
  white-space: nowrap;
}

.skill-node-panel__problems-list .problem-difficulty,
.skill-node-panel__problems-list .problem-score,
.skill-node-panel__problems-list .problem-pass-total {
    font-size: 0.85em;
    color: var(--text-color-secondary);
    margin-left: 16px;
    flex-shrink: 0;
}

.skill-tree-column--locked {
    position: relative; /* Needed for absolute positioning of children */
    pointer-events: none; /* Make the whole column non-interactive */
    z-index: 5; /* Raise the stacking context when locked */
}

/* Add a semi-transparent overlay to visually indicate the locked state */
.skill-tree-column--locked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 8px; /* Match the column's border-radius */
    z-index: 1;
}

.skill-tree-column__lock-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px; /* Increase size for better visibility */
    height: 48px;
    z-index: 2; /* Appear above the overlay */
    pointer-events: auto; /* Make the icon interactive */
    cursor: help; /* Change cursor on hover */
}

.skill-tree-column__tooltip {
    display: none;
    position: absolute;
    /* bottom: calc(50% + 30px); Position above the centered lock */
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    z-index: 10; /* Ensure it's on top of everything */
    pointer-events: none; /* Tooltip itself is not interactive */
    white-space: nowrap;
}

.skill-tree-column__lock-icon:hover + .skill-tree-column__tooltip {
    display: block;
}

.skill-tree-column__tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

/* 锁定整列时，列内所有知识点名称与进度文本置灰，禁用悬浮高亮 */
.skill-tree-column--locked .skill-node {
    background-color: #f8f9fa;
    border-color: #e9ecef;
}
.skill-tree-column--locked .skill-node__title,
.skill-tree-column--locked .skill-node__progress-text {
    color: #adb5bd;
}
.skill-tree-column--locked .skill-node:hover {
    transform: none;
    box-shadow: none;
    border-color: #e9ecef;
}

/* --- Special Layouts for specific columns --- */
#skill-tree-column-col-2 .skill-tree-column__nodes,
#skill-tree-column-col-4 .skill-tree-column__nodes,
#skill-tree-column-col-5 .skill-tree-column__nodes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

#skill-tree-column-col-3 .skill-tree-column__nodes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.skill-tree-column__nodes .skill-node {
    margin: 0; /* Override default margin when inside a grid */
}