/* 基础样式 */
body {
    background-color: #1a1a1a; /* 深黑色背景，主界面 */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: #f8f9fa;
}

/* 顶部导航栏 */
.navbar {
    background-color: #0a0a0a !important; /* 强制黑色背景，防止被覆盖 */
    border-bottom: 1px solid #d4af37; /* 金色边框 */
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
    color: #d4af37 !important; /* 金色标题 */
}

.navbar-nav .nav-link {
    color: #d4af37 !important; /* 金色链接 */
}

.navbar-nav .nav-link:hover {
    color: #ffffff !important; /* 悬停变白 */
}

/* 横幅样式 */
.banner {
    width: 100%;
    overflow: hidden;
}

.banner img {
    width: 100%;
    height: auto;
    aspect-ratio: 10 / 1.5; /* 长宽比 10:4 */
    object-fit: cover;
    display: block;
}

/* 主界面子导航栏 */
.sub-nav {
    background-color: #2a2a2a; /* 稍浅的黑色 */
    border-bottom: 1px solid #d4af37; /* 金色边框 */
    padding: 10px 0;
}

.sub-nav .container {
    width: 95%; /* 占90%宽度 */
    max-width: 1200px; /* 限制最大宽度 */
    margin: 0 auto; /* 居中 */
}

.sub-nav .nav-link {
    color: #d4af37; /* 金色文字 */
    font-weight: 500;
    padding: 10px 15px;
    transition: all 0.3s ease;
}

.sub-nav .nav-link:hover {
    background-color: #d4af37; /* 悬停金色背景 */
    color: #ffffff; /* 文字变白 */
    border-radius: 5px;
}

/* 响应式调整 */
@media (max-width: 767.98px) {
    .sub-nav .nav {
        flex-direction: column; /* 小屏幕垂直排列 */
    }
    .sub-nav .nav-link {
        text-align: center;
        margin: 5px 0;
    }
}

/* 保留原有样式 */
.card {
    border-radius: 0.5rem;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    font-weight: 500;
}

.table {
    background-color: #fff;
    border-radius: 0.5rem;
    overflow: hidden;
}

.table th, .table td {
    vertical-align: middle;
}

.alert {
    border-radius: 0.5rem;
}

/* 模态框文字样式 */
.modal-content {
    color: #000000; /* 设置模态框内所有文字为黑色 */
}

.modal-title {
    color: #000000; /* 确保标题文字为黑色 */
}

.modal-body p {
    color: #000000; /* 确保正文段落文字为黑色 */
}

.modal-footer .btn {
    color: #000000; /* 确保按钮文字为黑色 */
}

/* 设置聊天窗口样式 */
#chat-window {
    position: fixed;
    bottom: 20px;    /* 距离底部20px */
    right: 20px;     /* 距离右边20px */
    width: 400px;    /* 设置宽度 */
    height: 600px;   /* 设置高度 */
    background-color: #1a1a1a;  /* 背景颜色为深色 */
    border-radius: 10px;  /* 圆角效果 */
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.7);  /* 阴影效果 */
    overflow: hidden;  /* 超出部分隐藏 */
    display: none;  /* 默认隐藏 */
    z-index: 9999;  /* 确保在最上层 */
    color: white;  /* 文字颜色为白色 */
    font-family: 'Arial', sans-serif;
    font-size: 14px;
}

/* 聊天窗口的头部样式 */
.chat-header {
    background-color: #333;  /* 头部背景色 */
    color: #f4c542;   /* 文字颜色为金色 */
    padding: 10px;
    text-align: center;
    font-size: 18px;
    position: relative;
}

/* 聊天窗口的消息区域 */
.chat-content {
    padding: 10px;
    overflow-y: auto;  /* 允许纵向滚动 */
    height: calc(100% - 100px); /* 除去头部和输入框的高度 */
    word-wrap: break-word;  /* 自动换行 */
    white-space: pre-wrap;  /* 处理多行文本 */
}

/* 输入框的样式 */
.chat-input-container {
    position: relative;
    width: 100%;
    height: 51px;  /* 设置输入框区域的高度（增加1个像素格） */
}

.chat-input {
    width: 90%;  /* 输入框占 90% 宽度 */
    padding: 10px;
    border: none;
    border-top: 1px solid #444;
    background-color: #333;
    color: white;
    font-size: 14px;
    border-radius: 10px;
    height: 100%;
}

/* 发送按钮 */
.chat-send-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #f4c542;
    border: none;
    padding: 14px;  /* 增加发送按钮的高度1px */
    color: white;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
}

/* 聊天消息的样式 */
.message {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 15px;
    max-width: 80%;
    font-size: 16px;
}

/* 发送方的消息样式 */
.message-right {
    background-color: #f4c542;  /* 发送方的背景色为金色 */
    margin-left: auto;
    text-align: right;
}

/* 接收方的消息样式 */
.message-left {
    background-color: #333;  /* 接收方的背景色为深色 */
    margin-right: auto;
    text-align: left;
}

/* 用户名显示 */
.message .username {
    font-size: 12px;
    color: black;  /* 用户名颜色改为黑色 */
    font-weight: bold;
    margin-bottom: 5px;
}

/* 聊天窗口控制按钮 */
button {
    top: 10px;
    padding: 5px 10px;
    font-size: 16px;
    background-color: transparent;
    color: #f4c542;
    border: 1px solid #f4c542;
    cursor: pointer;
    border-radius: 5px;
}

#chat-close {
    right: 10px;
}

#chat-minimize {
    right: 60px;
}

    .modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.75);
        z-index: 1000;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    .modal.show {
        display: flex;
        opacity: 1;
    }
    .modal-content {
        width: 90%;
        max-width: 480px;
        margin: auto;
        background: linear-gradient(135deg, #1c2526, #2e3b3e);
        border: 2px solid #e6b800;
        border-radius: 12px;
        padding: 24px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
        transform: translateY(-100px);
        transition: transform 0.3s ease;
    }
    .modal.show .modal-content {
        transform: translateY(0);
    }
    .gold-text {
        color: #e6b800;
    }
    .gold-button {
        background: linear-gradient(135deg, #e6b800, #b38f00);
        color: #1c2526;
        padding: 8px 16px;
        border-radius: 8px;
        font-weight: 600;
        transition: background 0.2s ease;
    }
    .gold-button:hover {
        background: linear-gradient(135deg, #b38f00, #e6b800);
    }
    .cancel-button {
        background: #4b5e61;
        color: #ffffff;
        padding: 8px 16px;
        border-radius: 8px;
        transition: background 0.2s ease;
    }
    .cancel-button:hover {
        background: #5e7478;
    }
    input {
        background: #2e3b3e;
        border: 1px solid #e6b800;
        color: #ffffff;
        border-radius: 8px;
        padding: 8px;
        width: 100%;
        outline: none;
        transition: border-color 0.2s ease;
    }
    input:focus {
        border-color: #ffca28;
    }
    .button-group {
        margin-top: 16px; /* 添加与上一个输入框的间距 */
    }
    @media (max-width: 640px) {
        .modal-content {
            width: 95%;
            padding: 16px;
        }
    }

    #coinPaymentModal .modal-dialog {
    max-width: 900px;
    width: 90%;
}

#coinPaymentModal .modal-content {
    min-height: 450px;
}

.truncate-attrs {
display: inline-block;
max-width: 20ch;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: middle;
}
.truncate-username {
display: inline-block;
max-width: 7ch;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
vertical-align: middle;
}

.message-meta {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
}

.message .username {
    font-weight: bold;
}

.timestamp-status {
    font-size: 0.75em;
    color: gray;
}