/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #1a1a1a;
    color: #fff;
    line-height: 1.6;
}

/* 链接样式 */
a {
    color: #ffd700;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #ffed4e;
    text-decoration: underline;
}

/* 按钮基础样式 */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 16px;
    transition: all 0.3s ease;
}

/* 表单基础样式 */
input, select, textarea {
    font-family: inherit;
    padding: 10px;
    border: 1px solid #444;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 16px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* 下拉框选项样式 */
select option {
    background-color: #1a1a1a;
    color: #fff;
    padding: 8px 10px;
}

select option:checked {
    background-color: #ffd700;
    color: #1a1a1a;
    font-weight: bold;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

/* 登出按钮样式 */
.logout-button {
    background: rgba(255, 0, 0, 0.3);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 20px;
    transition: all 0.3s ease;
}

.logout-button:hover {
    background: rgba(255, 0, 0, 0.5);
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: #ffd700;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    margin-right: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    color: #ffd700;
    overflow: hidden;
    border: 1px solid #ffd700;
}

/* 当有头像时，取消边框和背景色 */
.user-avatar.has-avatar {
    border: none;
    background: transparent;
}

/* 移除了img样式，因为现在使用背景图显示头像 */

.user-details {
    display: flex;
    flex-direction: column;
}

.username {
    font-weight: bold;
    font-size: 18px;
    color: #ffd700;
}

.user-stats {
    font-size: 14px;
    color: #ccc;
}

/* 卡片样式 */
.card {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    margin-bottom: 20px;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    color: #ffd700;
    margin-bottom: 15px;
}

h1 {
    font-size: 36px;
}

h2 {
    font-size: 30px;
}

h3 {
    font-size: 24px;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

table, th, td {
    border: 1px solid #444;
}

/* Admin界面右侧面板修复 - 防止被导航栏挡住 */
.grid-layout.grid-1-3 > div:last-child {
    box-sizing: border-box;
    /* 由grid布局自动处理宽度，无需设置padding或width */
}

/* 系统设置面板修复 */
#system-settings-section {
    position: relative;
    left: 0;
    width: 100%;
    padding: 0 5px;
    box-sizing: border-box;
}

/* 时间操作框修复 - 确保不被导航栏挡住 */
.time-operation-box, .time-control, .datetime-picker {
    position: relative;
    left: 0;
    margin-right: 0;
    z-index: 100;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 5px;
}

/* 可能的时间操作框修复 */
.items-database, .panel {
    max-width: 100%;
    box-sizing: border-box;
}

/* 全局右侧定位元素修复 - 仅针对特定元素 */
.time-operation-box, .time-control, .datetime-picker {
    right: 20px !important;
    z-index: 10 !important;
    max-width: calc(100% - 40px) !important;
}

th, td {
    padding: 12px;
    text-align: left;
}

th {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
}

tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.05);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .user-info {
        margin-top: 15px;
        width: 100%;
        justify-content: space-between;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-button {
        margin-bottom: 10px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* 加载动画 */
.loader {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top: 4px solid #ffd700;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* 错误和成功消息样式 */
.error-message {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.5);
    color: #ff6b6b;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.success-message {
    background: rgba(0, 255, 0, 0.2);
    border: 1px solid rgba(0, 255, 0, 0.5);
    color: #4ecdc4;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

/* 提示信息样式 */
.info-message {
    background: rgba(0, 123, 255, 0.2);
    border: 1px solid rgba(0, 123, 255, 0.5);
    color: #6c757d;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

/* 搜索结果高亮样式 */
.search-highlight {
    background-color: #ffd700;
    color: #1a1a1a;
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 3px;
}

/* 进度条样式 */
.progress-bar {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar .progress {
    height: 100%;
    background: linear-gradient(90deg, #00ff00, #00cc00);
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* 工具提示样式 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 14px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 货币显示样式 */
.header-currency {
    display: flex;
    gap: 30px;
    align-items: center;
}

.currency-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-width: 80px;
}

.currency-label {
    font-size: 12px;
    color: #ccc;
    margin-bottom: 2px;
}

.currency-value {
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0, 120, 255, 0.8);
}

.currency-value.gold {
    color: #ffd700;
}

.currency-value.diamond {
    color: #00ffff;
}

/* 下拉菜单样式 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: rgba(0, 0, 0, 0.9);
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    z-index: 1;
    border-radius: 5px;
}

.dropdown-content a {
    color: #fff;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s ease;
}

.dropdown-content a:hover {
    background-color: rgba(255, 215, 0, 0.2);
    color: #ffd700;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* 技能卡片样式 */
.skill-container {
    position: relative;
}

.skill-level {
    position: absolute;
    top: 0px;
    left: 0px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffd700;
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 9px;
    font-weight: bold;
    z-index: 10;
}

/* 底部样式 */
.footer {
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    margin-top: 20px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    clear: both;
    z-index: 1;
}

/* 聊天系统样式 */
.chat-system {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 300px;
}

.chat-messages {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 5px;
    overflow-y: auto;
    max-height: 300px;
}

/* 聊天系统滚动条样式，与寻宝记录保持一致 */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.5);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.7);
}

.chat-message {
    margin: 5px 0;
    padding: 5px 10px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 14px;
    line-height: 1.4;
}

.chat-message .username {
    font-weight: bold;
    color: #ffd700;
    margin-right: 5px;
}

.chat-message .timestamp {
    font-size: 12px;
    color: #888;
    margin-left: 5px;
}

.chat-input-area {
    display: flex;
    gap: 5px;
}

.chat-input-area input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 215, 0, 0.5);
    border-radius: 5px;
    font-size: 14px;
}

.chat-input-area input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.chat-input-area button {
    padding: 8px 15px;
    background: rgba(255, 215, 0, 0.8);
    color: #000;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.chat-input-area button:hover {
    background: rgba(255, 215, 0, 1);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.chat-input-area button:active {
    transform: translateY(1px);
}