/* ===================
   通用内容容器（无侧栏页面）
   =================== */
.content {
    padding: 2rem;
    background-color: #fff;
    border-radius: 8px;
    margin: 2rem auto;
    max-width: 1000px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* ===================
   有侧栏的页面布局
   =================== */
.page-with-sidebar {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    max-width: 1500px !important;
    margin: 2rem auto;
    padding: 0 1rem;
}

.page-with-sidebar .sidebar {
    position: sticky;
    top: 80px;
    flex: 0 0 220px;
    max-width: 220px;
    background: #ffffff;
    padding: 1rem 1.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.page-with-sidebar .content {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;               /* 覆盖全局 margin */
    max-width: none;         /* 覆盖 1000px 限制 */
}

/* ===================
   侧栏基础样式（无论是否双列）
   =================== */
.sidebar h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.sidebar ul {
    list-style: none;
    padding-left: 0;
}

.sidebar li {
    margin-bottom: 0.5rem;
}

.sidebar a {
    text-decoration: none;
    color: #007bff;
}

.sidebar a:hover {
    text-decoration: underline;
}

/* ===================
   表单样式
   =================== */
form label {
    display: block;
    margin-top: 1rem;
    font-weight: 600;
}

form input[type="text"],
form input[type="number"],
form input[type="file"],
form textarea,
form select {
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.3rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

textarea {
    resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
    margin-right: 0.5rem;
}

/* ===================
   图片上传样式
   =================== */
.image_upload_section {
    margin-top: 1rem;
    border: 1px dashed #ccc;
    padding: 1rem;
    text-align: center;
    border-radius: 6px;
    position: relative;
}

.image_upload_section img {
    max-width: 100%;
    height: auto;
    margin-bottom: 0.5rem;
}

.delete-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
}

/* ===================
   货币输入行
   =================== */
.currency-pair {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.currency-pair input[type="text"],
.currency-pair input[type="number"] {
    flex: 1;
    min-width: 120px;
}

.delete-currency {
    background-color: #dc3545;
    border: none;
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
}

.delete-currency:hover {
    background-color: #c82333;
}

/* ===================
   按钮样式
   =================== */
.buttons {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

#saveButton {
    background-color: #28a745;
}

#backButton {
    background-color: #6c757d;
}

#saveButton, #backButton, #addCurrencyButton {
    color: #fff;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

#addCurrencyButton {
    background-color: #007bff;
    margin-top: 1rem;
}

#addCurrencyButton:hover,
#saveButton:hover,
#backButton:hover {
    opacity: 0.9;
}

/* ===================
   代码弹窗
   =================== */
#codeModal, #modalOverlay {
    transition: all 0.3s ease;
}

#codeModal h3 {
    margin-top: 0;
}

#codeModal button {
    margin-top: 1rem;
    margin-right: 1rem;
    padding: 0.4rem 0.8rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#codeModal button:hover {
    background-color: #0056b3;
}

/* ===================
   图表样式
   =================== */
canvas {
    width: 100% !important;
    max-width: 900px;
    height: auto !important;
    margin-top: 1rem;
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 1rem;
}