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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

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

/* 头部 Header */
.main-header {
    background-color: #fff;
    padding: 15px 0;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
}

/* 钱包区域 */
.wallet-section {
    position: relative;
}
.wallet-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 20px;
    cursor: pointer;
    background-color: #f9f9f9;
    transition: background-color 0.2s;
}
.wallet-display:hover {
    background-color: #eee;
}
#userAddress {
    font-family: monospace;
    font-size: 0.9rem;
}
#creamBalance {
    font-weight: bold;
}

/* 钱包下拉菜单 */
.wallet-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 5px);
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 200px;
    overflow: hidden;
}
.wallet-dropdown.active {
    display: block;
}
.dropdown-item {
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #333;
    text-decoration: none;
}
.dropdown-item:hover {
    background-color: #f0f2f5;
}
.dropdown-item hr {
    margin: 5px 0;
    border: 0;
    border-top: 1px solid #eee;
}

/* 主内容区 */
.main-content {
    padding-top: 20px;
}

/* 发帖区域 */
.post-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}
.post-section textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    resize: none; 
}
.input-privatekey {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    resize: none; 
}
.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}
#charCounter {
    font-size: 0.8rem;
    color: #666;
}

/* 留言板 */
.board-section h2 {
    margin-bottom: 20px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 5px;
    display: inline-block;
}
.message-item {
    background-color: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.message-content {
    overflow-wrap: break-word;
    word-wrap: break-word;
    margin-bottom: 15px;
}
.message-meta {
    display: flex;
    flex-wrap: wrap; /* 在小屏幕上换行 */
    gap: 15px;
    font-size: 0.8rem;
    color: #555;
    align-items: center;
}
.author-link {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

/* 按钮通用样式 */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: opacity 0.2s;
    text-decoration: none;
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.btn-tip {
    padding: 5px 9px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: opacity 0.2s;
    text-decoration: none;
    background-color: #007bff;
}
.btn-primary {
    background-color: #007bff;
    color: #fff;
}
.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}
.btn-full-width {
    width: 100%;
}

/* 模态框 (用于转账) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}
.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    position: relative;
}
.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
}
.form-group {
    margin-bottom: 15px;
}

/* 响应式设计媒体查询 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    .main-header .container {
        flex-direction: column;
        gap: 15px;
    }
    #loginView {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    #loginView input {
        width: 100%;
        padding: 10px;
    }
}

/* 个人主页专属样式 */

.logo-link {
    text-decoration: none;
}

.profile-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 25px 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.profile-card-title {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 1.2rem;
}

.profile-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    flex-wrap: wrap; /* 在小屏幕上换行 */
    gap: 10px;
}

.profile-item-label {
    font-weight: bold;
    color: #555;
}

.profile-item-value {
    font-family: 'Segoe UI';
    color: #007bff;
    font-weight: bold;
}

/* 调整个人主页中的地址容器，使其与新布局对齐 */
.profile-item .address-container {
    gap: 8px;
}

/* 调整复制按钮，使其更小巧 */
.profile-item .copy-btn {
    padding: 1px 6px;
}