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

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background: url('bg.jpg') no-repeat center center fixed;
    background-size: cover;
    height: 100vh;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    overflow: hidden; /* 防止页面滚动 */
}

.container {
    width: 95%;
    max-width: 1600px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    height: 90vh; /* 固定高度 */
    overflow: hidden; /* 防止容器溢出 */
}

/* 毛玻璃效果 - 浅色 */
.header, .game-area {
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 标题栏样式 */
.header {
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* 防止标题栏压缩 */
}

.logo {
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #333;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: rgba(50, 50, 50, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px 0;
}

.nav-link:hover {
    color: #000;
    transform: translateY(-2px);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

/* 游戏区域样式 */
.game-area {
    padding: 40px;
    flex-grow: 1; /* 占用剩余空间 */
    overflow: hidden; /* 防止内容溢出 */
    display: flex;
    flex-direction: column;
}

/* 模式选择 */
.mode-selection {
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.mode-selection h2 {
    margin-bottom: 30px;
    font-size: 26px;
    color: #333;
}

.modes {
    display: flex;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap; /* 允许在小屏幕上换行 */
}

.mode {
    background: rgba(240, 240, 245, 0.8);
    padding: 30px;
    border-radius: 12px;
    width: 280px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px; /* 添加底部间距，防止在换行时模式太靠近 */
}

.mode:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    background: rgba(245, 245, 250, 0.9);
}

.mode h3 {
    margin-bottom: 15px;
    font-size: 22px;
    color: #333;
}

.best-score {
    margin-top: 15px;
    font-size: 15px;
    color: rgba(50, 50, 50, 0.8);
}

/* 游戏界面 */
.game-play {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* 防止内容溢出 */
    height: 100%; /* 确保占满游戏区域高度 */
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-shrink: 0; /* 防止头部压缩 */
    flex-wrap: wrap; /* 允许在小屏幕上换行 */
    gap: 10px; /* 元素间间距 */
}

.game-header h2 {
    color: #333;
}

/* 猜测记录区域 */
.guesses {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    overflow-y: auto !important; /* 强制启用垂直滚动 */
    flex-grow: 1; /* 占用剩余空间 */
    padding-right: 10px;
    min-height: 200px; /* 确保最小高度 */
    max-height: calc(100% - 150px); /* 限制最大高度，减去其他元素的高度 */
}

/* 滚动条样式 - 特别针对猜测区域 */
.guesses::-webkit-scrollbar {
    width: 8px;
    display: block !important;
}

.guesses::-webkit-scrollbar-track {
    background: rgba(240, 240, 245, 0.5);
    border-radius: 4px;
}

.guesses::-webkit-scrollbar-thumb {
    background: rgba(180, 180, 190, 0.7);
    border-radius: 4px;
}

.guesses::-webkit-scrollbar-thumb:hover {
    background: rgba(160, 160, 170, 0.9);
}

/* 猜测项目 */
.guess-item {
    background: rgba(240, 240, 245, 0.8);
    border-radius: 10px;
    padding: 18px;
    display: grid;
    grid-template-columns: 80px repeat(9, 1fr); /* 调整为10列，第一列为头像，其余9列为属性 */
    gap: 8px; /* 减小间距以适应一行 */
    animation: flip 0.5s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer; /* 添加指针样式，表明可点击 */
    transition: all 0.3s ease;
}

/* 猜测项目悬停效果 */
.guess-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    background: rgba(245, 245, 250, 0.9);
}

/* 已猜测角色样式 */
.character-item.guessed {
    opacity: 0.5;
    background: rgba(200, 200, 200, 0.5);
    cursor: not-allowed;
}

.character-item.guessed:hover {
    background: rgba(200, 200, 200, 0.5);
}

.guess-avatar {
    grid-column: span 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.guess-avatar img {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

/* 属性样式 */
.guess-property {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 6px 4px;
    border-radius: 6px;
    min-width: 0;
}

.property-label {
    font-size: 12px;
    color: rgba(50, 50, 50, 0.8);
    margin-bottom: 4px;
    font-weight: 500;
    white-space: nowrap;
}

.property-value {
    font-size: 13px;
    color: #333;
    text-align: center;
    word-break: break-word;
}

/* 属性颜色 */
.correct {
    background: rgba(100, 200, 100, 0.3);
    border: 1px solid rgba(100, 200, 100, 0.5);
}

.partial {
    background: rgba(220, 200, 80, 0.3);
    border: 1px solid rgba(220, 200, 80, 0.5);
}

.incorrect {
    background: rgba(200, 200, 210, 0.5);
    border: 1px solid rgba(180, 180, 190, 0.5);
}

/* 结果区域 */
.result-area {
    text-align: center;
    margin-top: 25px;
    padding: 25px;
    background: rgba(240, 240, 245, 0.8);
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.result-message {
    font-size: 22px;
    margin-bottom: 25px;
    color: #333;
}

.result-buttons {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap; /* 允许在小屏幕上换行 */
}

#play-again-btn, .return-btn {
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    margin-bottom: 10px; /* 添加底部间距，防止在换行时按钮太靠近 */
}

#play-again-btn {
    background: rgba(80, 140, 220, 0.8);
    color: white;
    border: none;
}

#play-again-btn:hover {
    background: rgba(90, 150, 230, 0.9);
}

.return-btn {
    background: rgba(200, 200, 210, 0.8);
    color: #333;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.return-btn:hover {
    background: rgba(210, 210, 220, 0.9);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: rgba(250, 250, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 35px;
    border-radius: 12px;
    width: 350px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: #333;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
    flex-wrap: wrap; /* 允许在小屏幕上换行 */
}

.modal-buttons button {
    padding: 10px 22px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    font-size: 15px;
    margin-bottom: 10px; /* 添加底部间距，防止在换行时按钮太靠近 */
}

#confirm-give-up {
    background: rgba(220, 80, 80, 0.8);
    color: white;
}

#confirm-give-up:hover {
    background: rgba(230, 90, 90, 0.9);
}

#cancel-give-up {
    background: rgba(200, 200, 210, 0.8);
    color: #333;
}

#cancel-give-up:hover {
    background: rgba(210, 210, 220, 0.9);
}

/* 确认重置按钮样式 */
#confirm-reset {
    background: rgba(220, 80, 80, 0.8);
    color: white;
}

#confirm-reset:hover {
    background: rgba(230, 90, 90, 0.9);
}

#cancel-reset {
    background: rgba(200, 200, 210, 0.8);
    color: #333;
}

#cancel-reset:hover {
    background: rgba(210, 210, 220, 0.9);
}

/* 动画效果 */
@keyframes flip {
    0% {
        transform: rotateX(90deg);
        opacity: 0;
    }
    100% {
        transform: rotateX(0);
        opacity: 1;
    }
}

/* 全局滚动条样式 - 确保所有可滚动区域都有滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(240, 240, 245, 0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(180, 180, 190, 0.7);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(160, 160, 170, 0.9);
}

/* 角色列表滚动条样式 */
.character-list::-webkit-scrollbar-track {
    border-radius: 0 8px 8px 0;
}

/* 放弃按钮样式 */
.give-up-btn {
    background: rgba(220, 80, 80, 0.8);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
}

.give-up-btn:hover:not(.disabled) {
    background: rgba(230, 90, 90, 0.9);
}

.give-up-btn.disabled {
    background: rgba(180, 180, 180, 0.8);
    cursor: not-allowed;
    opacity: 0.7;
}

/* 重置最佳成绩按钮 */
.reset-score-btn {
    margin-top: 20px;
    background: rgba(200, 200, 210, 0.8);
    color: #333;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
}

.reset-score-btn:hover {
    background: rgba(210, 210, 220, 0.9);
    transform: translateY(-2px);
}

/* 过渡动画 */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

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

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

/* 搜索区域 */
.search-area {
    margin-bottom: 25px;
    position: relative;
    flex-shrink: 0; /* 防止搜索区域压缩 */
}

#character-search {
    width: 100%;
    padding: 14px;
    background: rgba(240, 240, 245, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    color: #333;
    font-size: 16px;
}

/* 搜索提示 */
.search-tip {
    padding: 10px;
    background-color: rgba(240, 240, 250, 0.9);
    color: #666;
    text-align: center;
    font-style: italic;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* 角色列表 - 悬浮样式 */
.character-list {
    background: rgba(250, 250, 255, 0.95);
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 5px;
    display: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.no-results {
    padding: 15px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.character-item {
    display: flex;
    align-items: center;
    padding: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: #333;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.character-item:hover {
    background: rgba(230, 230, 240, 0.9);
}

.character-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
}

/* 游戏介绍样式 */
.game-intro {
    margin-top: 40px;
    background: rgba(240, 240, 245, 0.8);
    border-radius: 12px;
    padding: 25px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.intro-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

.intro-text {
    font-size: 16px;
    line-height: 1.6;
    color: #444;
    text-align: center;
}

/* 文字颜色 */
.text-green {
    color: #64c864;
    font-weight: bold;
}

.text-yellow {
    color: #dcc850;
    font-weight: bold;
}

.text-gray {
    color: #888;
    font-weight: bold;
}

/* 响应式布局 - 适配手机和小屏幕设备 */
@media (max-width: 1200px) {
    .header {
        padding: 15px 20px;
    }
    
    .logo {
        font-size: 24px;
    }
    
    .nav {
        gap: 15px;
    }
    
    .game-area {
        padding: 30px;
    }
}

@media (max-width: 992px) {
    .guess-item {
        grid-template-columns: 80px repeat(3, 1fr); /* 4列布局：头像 + 3个属性 */
        grid-auto-flow: row;
        grid-auto-rows: auto;
    }
    
    .guess-avatar {
        grid-row: span 3; /* 头像占据3行 */
    }
    
    .nav {
        gap: 10px;
    }
    
    .nav-link {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    body {
        align-items: flex-start;
        overflow-y: auto;
        height: auto;
        padding: 20px 0;
    }
    
    .container {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .game-area {
        padding: 20px;
        overflow-y: auto;
    }
    
    .mode {
        width: 100%;
        max-width: 280px;
    }
    
    .guess-item {
        grid-template-columns: 70px repeat(2, 1fr); /* 3列布局：头像 + 2个属性 */
    }
    
    .guess-avatar {
        grid-row: span 5; /* 头像占据5行 */
    }
    
    .guess-avatar img {
        width: 50px;
        height: 50px;
    }
    
    .modal-content {
        width: 90%;
        max-width: 350px;
        padding: 25px;
    }
}

@media (max-width: 576px) {
    .game-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .guess-item {
        grid-template-columns: 60px 1fr; /* 2列布局：头像 + 1个属性 */
        padding: 15px;
    }
    
    .guess-avatar {
        grid-row: span 9; /* 头像占据9行 */
    }
    
    .guess-avatar img {
        width: 45px;
        height: 45px;
    }
    
    .property-label {
        font-size: 11px;
    }
    
    .property-value {
        font-size: 12px;
    }
    
    .game-intro {
        padding: 20px;
    }
    
    .intro-title {
        font-size: 20px;
    }
    
    .intro-text {
        font-size: 14px;
    }
}

/* 添加计时器和得分显示的样式 */
.timer, .score {
    background: rgba(240, 240, 245, 0.8);
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.timer.warning {
    background: rgba(255, 200, 0, 0.3);
    color: #d63031;
    animation: pulse 1s infinite;
}

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

/* 跳过按钮样式 */
.skip-btn {
    background: rgba(240, 240, 245, 0.8);
    border: none;
    border-radius: 8px;
    padding: 8px 15px;
    cursor: pointer;
    font-weight: bold;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.skip-btn:hover {
    background: rgba(220, 220, 230, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 开始游戏按钮样式 */
.start-btn {
    background: rgba(46, 213, 115, 0.8);
    border: none;
    border-radius: 8px;
    padding: 8px 15px;
    cursor: pointer;
    font-weight: bold;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.start-btn:hover {
    background: rgba(46, 213, 115, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 解题器链接样式 */
.solver-link {
    margin-top: 15px;
    font-size: 14px;
    color: #555;
}

.solver-link a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.solver-link a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* 提示卡片样式 */
.hint-card {
    background: rgba(240, 240, 245, 0.8);
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease;
}

.hint-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.hint-content {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hint-item {
    background: rgba(255, 255, 255, 0.7);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 模式介绍动画 */
.intro-text {
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.intro-text.changing {
    opacity: 0;
    transform: translateY(-10px);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .timer, .score, .skip-btn, .start-btn {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    .hint-card {
        padding: 14px;
    }
    
    .hint-title {
        font-size: 16px;
    }
    
    .hint-item {
        padding: 6px 10px;
        font-size: 13px;
    }
}

.mode-tip {
    font-size: 14px;
    color: rgba(80, 80, 80, 0.8);
    margin-bottom: 20px;
    font-style: italic;
} 