/* 作者统计页面样式 */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Times New Roman', 'Georgia', serif;
    line-height: 1.6;
    color: #333;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

header {
    background-color: #003C6B;
    color: white;
    text-align: center;
    padding: 20px;
}

nav {
    background-color: #D36A00;
    padding: 10px 0;
}

nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

nav ul li {
    margin: 0 15px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

/* 主内容区域 */
main {
    padding: 40px 0;
    min-height: calc(100vh - 300px);
}

.container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-left: 4px solid #D36A00;
    border-right: 1px solid #eee;
}

/* 返回链接 */
/* 页面标题 */
.section-title {
    text-align: left;
    margin-bottom: 40px;
    position: relative;
}

.section-title h2 {
    color: #003C6B;
    font-size: 1.6em;
    margin: 0;
    display: inline-block;
    animation: slideInFromLeft 0.6s ease-out;
}

/* 内联问号按钮 */
.help-icon-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background-color: #00629B;
    color: white;
    text-decoration: none;
    border-radius: 50%;
    font-size: 0.75em;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 98, 155, 0.3);
    vertical-align: middle;
    margin-left: 8px;
}

.help-icon-inline:hover {
    background-color: #D36A00;
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(211, 106, 0, 0.4);
}

/* 内联返回按钮 */
.back-button-inline {
    display: inline-block;
    color: #00629B;
    text-decoration: none;
    font-size: 0.6em;
    padding: 2px 6px;
    border: 1px solid #00629B;
    border-radius: 3px;
    transition: all 0.3s ease;
    white-space: nowrap;
    vertical-align: middle;
    margin-left: 8px;
}

.back-button-inline:hover {
    background-color: #00629B;
    color: white;
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.back-button {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-block;
    color: #00629B;
    text-decoration: none;
    font-size: 0.85em;
    padding: 4px 8px;
    border: 1px solid #00629B;
    border-radius: 3px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.back-button:hover {
    background-color: #00629B;
    color: white;
}

.help-icon {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: #00629B;
    color: white;
    text-decoration: none;
    border-radius: 50%;
    font-size: 1.2em;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 98, 155, 0.3);
}

.help-icon:hover {
    background-color: #D36A00;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 10px rgba(211, 106, 0, 0.4);
}

.subhead {
    color: #666;
    font-size: 1em;
    margin-top: 10px;
}

/* 加载状态 */
.loading-state {
    text-align: center;
    padding: 40px;
    font-size: 1.1em;
    color: #00629B;
}

.error-state {
    text-align: center;
    padding: 40px;
    color: #D36A00;
    background-color: #fff5f5;
    border-left: 4px solid #D36A00;
    border-radius: 4px;
}

/* 搜索容器 */
.search-container {
    max-width: 600px;
    margin: 0 auto 40px;
}

.search-box {
    position: relative;
}

.search-box label {
    display: block;
    font-weight: bold;
    color: #003C6B;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.search-box input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #00629B;
}

/* 作者建议列表 */
.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: none;
}

.suggestions-list.visible {
    display: block;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: #f5f5f5;
}

.suggestion-item.selected {
    background-color: #e3f2fd;
}

/* Gameme Factor 分布图 */
.distribution-chart {
    width: 100%;
    margin: 40px auto;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.distribution-chart h3 {
    color: #003C6B;
    font-size: 1.5em;
    margin: 0 0 20px 0;
    text-align: center;
    border-bottom: 3px solid #D36A00;
    display: inline-block;
    padding-bottom: 10px;
    width: 100%;
}

#gamemeCanvas {
    display: block;
    margin: 0 auto;
    max-width: 100%;
}

/* 统计指标摘要 */
.statistics-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 6px;
    border-left: 4px solid #00629B;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stat-label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 8px;
    font-weight: bold;
}

.stat-value {
    display: block;
    font-size: 1.4em;
    color: #D36A00;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    transition: color 0.3s ease;
}

/* 正常范围（绿色） */
.stat-value.normal {
    color: #28a745;
}

/* 警告范围（红色） */
.stat-value.warning {
    color: #dc3545;
}

/* 作者结果展示 */
.author-result {
    max-width: 1000px;
    margin: 0 auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.author-header-info {
    background: linear-gradient(135deg, #00629B 0%, #003C6B 100%);
    color: white;
    padding: 30px;
}

.author-header-info h3 {
    margin: 0 0 20px 0;
    font-size: 1.8em;
    color: white;
}

.gameme-factor-display,
.paper-count-display {
    display: inline-block;
    margin-right: 30px;
    padding: 10px 20px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
}

.factor-label,
.count-label {
    font-size: 0.9em;
    opacity: 0.9;
    margin-right: 8px;
}

.factor-value,
.count-value {
    font-size: 1.4em;
    font-weight: bold;
}

/* 论文部分 */
.papers-section {
    padding: 30px;
}

.papers-section h4 {
    color: #003C6B;
    font-size: 1.3em;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #D36A00;
}

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

.paper-item {
    padding: 15px;
    margin-bottom: 15px;
    background-color: #f9f9f9;
    border-left: 4px solid #00629B;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.paper-item:hover {
    background-color: #f0f0f0;
    transform: translateX(5px);
}

.paper-title {
    font-weight: bold;
    color: #003C6B;
    margin-bottom: 8px;
    font-size: 1.05em;
}

.paper-meta {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.paper-authors {
    color: #888;
    font-size: 0.85em;
    margin-bottom: 5px;
}

.paper-doi {
    font-size: 0.85em;
    color: #00629B;
}

.paper-doi a {
    color: #00629B;
    text-decoration: none;
}

.paper-doi a:hover {
    text-decoration: underline;
    color: #D36A00;
}

/* 调试信息 */
.debug-info {
    margin-top: 30px;
    padding: 15px;
    background-color: #f5f5f5;
    border: 1px dashed #ccc;
    font-size: 0.85em;
    color: #666;
    font-family: 'Courier New', monospace;
    display: none;
}

.debug-info.visible {
    display: block;
}

/* 统计控制面板 */
.stats-controls {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-left: 4px solid #00629B;
}

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

.control-group label {
    font-weight: bold;
    color: #003C6B;
}

.control-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95em;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.control-group select:focus {
    outline: none;
    border-color: #00629B;
}

/* 统计表格容器 */
.stats-table-container {
    overflow-x: auto;
    margin-top: 20px;
}

/* 统计表格 */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stats-table thead {
    background: linear-gradient(135deg, #00629B 0%, #003C6B 100%);
    color: white;
}

.stats-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9em;
}

.stats-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    font-size: 0.95em;
}

.stats-table tbody tr {
    transition: background-color 0.2s ease;
}

.stats-table tbody tr:hover {
    background-color: #f5f5f5;
}

.stats-table tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.stats-table tbody tr:nth-child(even):hover {
    background-color: #f0f0f0;
}

/* 排名列 */
.rank-cell {
    font-weight: bold;
    color: #D36A00;
    text-align: center;
}

/* 前三名的特殊样式 */
.rank-1 {
    color: #FFD700;
    font-size: 1.2em;
}

.rank-2 {
    color: #C0C0C0;
    font-size: 1.1em;
}

.rank-3 {
    color: #CD7F32;
    font-size: 1.05em;
}

/* 作者姓名列 */
.author-name-cell {
    font-weight: bold;
    color: #003C6B;
}

/* Gameme Factor 列 */
.gameme-factor-cell {
    font-weight: bold;
    color: #D36A00;
    text-align: center;
}

/* 链接样式 */
.detail-link {
    color: #00629B;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease;
}

.detail-link:hover {
    color: #D36A00;
    text-decoration: underline;
}

/* 游戏迷因子说明 */
.gameme-explanation {
    max-width: 900px;
    margin: 30px auto 40px;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #00629B;
}

.gameme-explanation h3 {
    color: #003C6B;
    font-size: 1.6em;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 3px solid #D36A00;
}

.explanation-intro {
    font-size: 1.05em;
    line-height: 1.8;
    color: #333;
    margin-bottom: 25px;
}

.formula-section,
.scoring-section,
.significance-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.formula-section h4,
.scoring-section h4,
.significance-section h4 {
    color: #00629B;
    font-size: 1.2em;
    margin: 0 0 15px 0;
}

.formula-display {
    background-color: #f5f5f5;
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid #D36A00;
    margin-bottom: 15px;
}

.formula-display code {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.95em;
    color: #333;
    line-height: 2;
    display: block;
}

.formula-note {
    font-size: 0.95em;
    color: #666;
    line-height: 1.7;
    margin-top: 10px;
}

.scoring-section p,
.significance-section p {
    line-height: 1.8;
    color: #555;
    font-size: 1em;
}

.scoring-section strong {
    color: #D36A00;
    font-size: 1.1em;
}

/* 页脚 */
.site-footer {
    background: linear-gradient(to bottom, #003C6B, #002147);
    padding: 20px 0;
    margin-top: 50px;
}

.footer-hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .section-title h2 {
        font-size: 1.6em;
    }
    
    .gameme-explanation {
        padding: 20px;
        margin: 20px auto 30px;
    }
    
    .gameme-explanation h3 {
        font-size: 1.4em;
    }
    
    .formula-display code {
        font-size: 0.85em;
    }
    
    .stats-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .control-group {
        justify-content: space-between;
    }
    
    .stats-table th,
    .stats-table td {
        padding: 10px 8px;
        font-size: 0.85em;
    }
}
