/* 通用样式 */
body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #121212;
    color: #fff;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 42px;
    padding-top: 0;
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

/* 头部区域 */
header {
    width: 100%;
    background-color: #1e1e1e;
    padding: 20px;
    text-align: center;
    font-size: 24px;
    color: #ffffff;
    border-bottom: 1px solid #333;
}

header h1 {
    margin: 0;
}

.container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    gap: 0;
    padding-top: 42px;
    box-sizing: border-box;
    margin: 0;
    height: calc(180vh - 42px); /* 42px为顶部navbar高度，按实际调整 */
    overflow-y: auto;
}

/* 🔹 让导航栏固定在顶部 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #282c34;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1px;
    box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

/* 🔹 每个 Tab 样式 */
.nav-item {
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 14px;
    transition: background 0.3s;
}

.nav-item:hover,
.nav-item.active {
    background: #444;
}

/* 🔹 加入社区 */
.join-community {
    margin-left: auto;
    margin-right: 40px;
    display: flex;
    align-items: center;
    gap: 50px;
    font-weight: bold;
}

/* 🔹 让"加入社区"靠右 */
.nav-links {
    list-style: none;
    display: flex;
    flex-grow: 1; /* 让前面的Tab占据空间 */
    gap: 15px;
    padding: 0;
    margin: 0;
}




.chart-container {
    width: 50%;
    min-width: 350px;
    max-width: 1000px;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    box-sizing: border-box;
}

/* 表格样式 */
.table-container {
    max-width: 100%;       /* 设置最大宽度 */
    min-width: 100%;  
    overflow-y: auto;      /* 启用垂直滚动条 */
    height: 400px;         /* 设置表格的固定高度，根据需要调整 */
}

table {
    width: auto;  /* 让表格宽度自适应内容 */
    border-collapse: collapse;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    table-layout: auto; /* 自适应内容宽度 */
    max-width: 100%;       /* 设置最大宽度 */
    min-width: 100%;  
}

table, th, td {
    border: 1px solid #444;
    font-size: 10px; /* 修改字体大小 */
}

th {
    background-color: #f4f4f4; /* 可选：为表头添加背景色 */
    font-weight: bold; /* 可选：让表头的字体加粗 */
}

td {
    text-align: center; /* 可选：让单元格内容居中 */
}

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

th {
    background-color: #2b2b2b;
    color: #fff;
    font-weight: bold;
    position: sticky;      /* 启用粘性定位 */
    top: 0;
}

tr:nth-child(even) {
    background-color: #222;
}

td {
    background-color: #333;
}

/* 按钮样式 */
button {
    background-color: #f0b90b;
    color: white;
    font-size: 16px;
    /* padding: 10px 20px; */
    border: none;
    cursor: pointer;
    border-radius: 5px;
    margin: 10px;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #e0a700;
}

/* 胜率和盈亏汇总 */
#summary {
    display: flex;
    flex-direction: column;
    padding: 10px;
    margin: 0px auto;
    background-color: #1e1e1e;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    justify-content: space-between;
    width: 98%;
    text-align: center;
}

#summary span {
    font-size: 20px;
    margin-top: 10px;
}

#summary-win-rate {
    color: #00b894;
}

#summary-profit-loss {
    font-weight: bold;
}

.profit {
    color: #2ecc71;
}

.loss {
    color: #e74c3c;
}

/* 倒计时格式化 */
#countdown {
    font-size: 18px;
    font-weight: bold;
    color: #f0b90b;
}

/* 输入框 */
input[type="number"] {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #444;
    border-radius: 5px;
    background-color: #333;
    color: #fff;
    width: 150px;
}

input[type="number"]:focus {
    outline: none;
    border-color: #f0b90b;
}

/* 辅助类 */
.text-center {
    text-align: center;
}

.hidden {
    display: none;
}

/* 优化按钮区 */
#up, #down {
    /* margin: 8px; */
    width: 100px;
    height: 32px;
    font-size: 14px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold; /* 加粗文字 */
}

#up {
    background-color: #2ecc71;
}

#down {
    background-color: #e74c3c;
}

#up:hover {
    background-color: #27ae60;
}

#down:hover {
    background-color: #c0392b;
}

/* 设置绿色和红色文本 */
.green {
    color: #2ecc71;
}

.red {
    color: #e74c3c;
}

/* 控制区域布局 */
.guess-container {
    width: 100%;
}
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-size: 12px;
}

.radio-inputs {
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid #2c2f3f;
    border-radius: 8px;
    overflow: hidden;
    width: 45%;
    margin-right: 20px; /* 增加右边距 */
    margin-left: 0px; /* 增加右边距 */
}

.radio {
    margin: 0;
    padding: 7px 14px;
    background-color: #2c2f3f;
    color: #ffffff;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-align: center;
    width: 45px;
    position: relative; /* 为伪元素提供定位上下文 */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* 确保伪元素不会溢出 */
}

.radio input {
    display: none; /* 隐藏原生的 radio button */
}

.radio:hover {
    background-color: #3e4559;
}

/* 选中时改变整个 .radio 容器的背景色 */
.radio input:checked + .name {
    color: #000000; /* 可选：调整文字颜色以确保可读性 */
}

/* 选中时改变整个 .radio 容器的背景色 */
.radio input:checked + .name::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; /* 覆盖整个容器 */
    height: 100%; /* 覆盖整个容器 */
    background-color: #f0b90b;
    z-index: -1; /* 确保伪元素在文字下方 */
}
/* 输入框样式 */
#usdt-count {
    padding: 4px;
    width: 60px;
    font-size: 12px;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-right: 10px; /* 增加右边距 */
    margin-left: 0px; /* 增加右边距 */
}

/* 按钮样式 */
.buysell-button-container {
    display: flex;
    gap: 1px;
    width: 30%;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .radio-inputs {
        flex-direction: column;
        width: 100%;
    }

    .buysell-button-container {
        flex-direction: column;
        width: 100%;
        gap: 5px;
    }

    #usdt-count {
        width: 150px;
    }
}

/* 使箭头和文字显示在一起 */
.buysell-button-container button {
    font-size: 12px;
}

/* 使箭头和文字显示在一起 */
.buysell-button-container button .arrow {
    display: inline-block;
    transform: rotate(45deg); /* 旋转箭头 45 度 */
    font-weight: bold; /* 加粗箭头 */
}

/* 上涨箭头倾斜45度向上 */
.buysell-button-container .up-button .arrow {
    transform: rotate(45deg); /* 向上的箭头倾斜 45 度 */
}

/* 下跌箭头倾斜45度向下 */
.buysell-button-container .down-button .arrow {
    transform: rotate(-45deg); /* 向下的箭头倾斜 -45 度 */
}

/* 弹窗样式 */
#clear-modal {
    display: none;  /* 默认隐藏弹窗 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#clear-modal .modal-content {
    background-color: #333;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    width: 300px;
}

#clear-modal .modal-button {
    background-color: #f0b90b;
    color: #2c2f3f;
    padding: 10px;
    margin: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    transition: background-color 0.3s ease;
}

#clear-modal .modal-button:hover {
    background-color: #e0a80c;
}

/* 关闭按钮样式 */
.close-btn {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 20px;
    color: #333;
    cursor: pointer;  /* 默认显示为可点击 */
    transition: color 0.3s ease, transform 0.3s ease; /* 加入过渡效果 */
}

/* 鼠标悬停时的样式 */
.close-btn:hover {
    color: #e74c3c;  /* 悬停时按钮颜色变化 */
    transform: scale(1.2); /* 鼠标悬停时放大效果 */
}

.hidden-h1 {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    visibility: hidden;
    white-space: nowrap;
  }
  .container {
    display: flex;
    justify-content: space-between;
}

/* 在原有 #ranking-list 样式基础上添加 */
#ranking-list {
    left: 0px;
    top: 100px; /* 根据实际头部高度调整 */
    width: 100%;
    z-index: 0;
}

/* 修改排行榜表格样式 */
#ranking-list table {
    border: none; /* 移除表格边框 */
    box-shadow: none; /* 移除阴影效果 */
}

#ranking-list th,
#ranking-list td {
    border: none !important; /* 强制移除所有单元格边框 */
    background-color: transparent; /* 透明背景 */
    font-size: 10px !important;
}

#ranking-list tr:nth-child(even) {
    background-color: #2c2c2c; /* 更柔和的交替行颜色 */
}

#ranking-list tr:hover {
    background-color: #373737; /* 悬停效果颜色 */
}

#ranking-list th {
    background-color: #1a1a1a; /* 表头背景色微调 */
    color: #f0b90b; /* 表头文字颜色改为金色 */
    font-size: 12px; /* 适当增大表头字号 */
    padding: 10px 14px; /* 增加表头内边距 */
}


.current-user {
    background-color: #3a3a3a !important;
    box-shadow: inset 0 0 8px rgba(244, 199, 28, 0.3);
    position: relative;
}

.ranking-container table th,
.ranking-container table td {
    padding: 4px 2px; /* 减少内边距 */
    border: 1px solid #444;
    text-align: center;
    font-size: 6px; /* 减小字号 */
}

.ranking-container table th {
    background-color: #333;
    cursor: pointer;
}

.ranking-container .current-user {
    background-color: #4a4a4a; /* 当前用户高亮 */
    font-weight: bold;
}

/* 新增样式 */
#ranking-list table {
    table-layout: fixed;
    width: 100%;
    word-break: break-word;
}

#ranking-list th:nth-child(1),
#ranking-list td:nth-child(1) {
    width: 15%; /* 排名 */
}

#ranking-list th:nth-child(2),
#ranking-list td:nth-child(2) {
    width: 25%; /* 用户 */
}

#ranking-list th:nth-child(3),
#ranking-list td:nth-child(3) {
    width: 30%; /* 胜率 */
}

#ranking-list th:nth-child(4),
#ranking-list td:nth-child(4) {
    width: 30%; /* 盈亏 */
}

/* 悬浮广告滚动位样式 */
.ad-banner {
    /* 移除fixed，作为普通区块插入 */
    position: static;
    width: 50vw;
    z-index: 9999;
    /* background: linear-gradient(90deg, #fffbe6 0%, #e6f7ff 100%); */
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 0;
    height: 38px;
    display: flex;
    align-items: center;
    overflow: hidden;
    margin: 0;
  }
  
  .ad-banner-content {
    display: flex;
    align-items: center;
    gap: 48px;
    white-space: nowrap;
    font-size: 1rem;
    font-weight: 500;
    color: white;
    font-size: 14px;
    animation: ad-scroll 18s linear infinite;
  }
  
  @keyframes ad-scroll {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
  }
  
  .sort-arrows {
    display: inline-flex;
    flex-direction: column;
    margin-left: 2px;
    vertical-align: middle;
    position: relative;
    top: 1px;
  }
  .arrow-up, .arrow-down {
    width: 10px;
    height: 6px;
    display: block;
    margin: 0;
    padding: 0;
  }
  .arrow-up path, .arrow-down path {
    fill: #bbb;
    transition: fill 0.2s;
  }
  .sortable.sorted-asc {
    color: #f0b90b;
  }
  .sortable.sorted-desc {
    color: #f0b90b;
  }
  .sortable.sorted-asc .arrow-up path {
    fill: #f0b90b;
  }
  .sortable.sorted-desc .arrow-down path {
    fill: #f0b90b;
  }

.ranking-board {
    width: 17%;
    margin-right: 0;
    padding: 0;
    box-sizing: border-box;
    /* 保持顶部对齐 */
}

.ranking-board h3 {
    text-align: center;
    font-size: 18px;
    color: #f0b90b;
}

.predict-container {
    width: 32%;
    margin-left: 0;
    padding: 0;
    box-sizing: border-box;
    font-size: 6px;
    /* 保持顶部对齐 */
}

.predict-container h3 {
    font-size: 18px;
}
#predict-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 18px 32px;
    font-size: 12px;
    color: #f0b90b;
    margin-bottom: 6px;
    max-width: 100%;
}
#predict-summary .summary-item {
    display: flex;
    align-items: center;
    min-width: 180px;
    margin-bottom: 4px;
    justify-content: center;
}
#predict-summary .summary-label {
    color: #fff;
    font-weight: normal;
    margin-right: 2px;
}
#predict-summary .summary-value {
    color: #f0b90b;
    font-weight: bold;
    margin-right: 8px;
}

.predict-container table {
    width: 100%;
    table-layout: auto;
    word-break: break-all;
    border: none !important; /* 强制移除所有单元格边框 */
}
.predict-container th, .predict-container td {
    font-size: 10px !important;
    /* padding: 2px 4px; */
    word-break: break-all;
    white-space: normal;
    text-align: center;
    padding: 6px 8px;
}

.predict-container th {
    background-color: #1a1a1a;
    color: #f0b90b;
    font-size: 10px;
    font-weight: bold;
    padding: 10px 10px;
}

.predict-container-title-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin: 8px 0 4px 0;
}
.predict-container-title-bar h3 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    color: #f0b90b;
    letter-spacing: 2px;
}
#strategyTypeSelect {
    padding: 4px 16px;
    border-radius: 6px;
    border: 1px solid #f0b90b;
    background: #222;
    color: #f0b90b;
    font-size: 14px;
    outline: none;
    transition: border 0.2s;
    margin-left: 8px;
    cursor: pointer;
}
#strategyTypeSelect:focus {
    border: 1.5px solid #ffd700;
}

@media (max-width: 1200px) {
    .container {
        flex-direction: column;
        align-items: stretch;
    }
    .ranking-board, .predict-container, .chart-container {
        width: 100%;
        min-width: unset;
        max-width: unset;
        margin: 0 0 20px 0;
    }
}

.chart-container {
    align-items: flex-start;
    max-height: 1000px !important;
}
.ranking-board, .predict-container {
    /* height: 100%; */
    max-height: 1000px; /* 与chart-container高度一致，或可根据实际chart高度调整 */
    overflow-y: auto;
}

.tooltip-wrapper {
    position: relative;
    display: inline-block;
    margin-left: 0px;
  }
  .tooltip-wrapper:hover .tooltip-text,
.tooltip-text:hover {
  display: block;
}
  .tooltip-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background-color: #f0b90b;
    color: #000;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border: 1px solid #000;
  }
  
  .tooltip-text {
    visibility: hidden;
    width: max-content;
    max-width: 260px;
    background-color: #333;
    color: #fff;
    text-align: left;
    padding: 6px 10px;
    border-radius: 4px;
    position: absolute;
    z-index: 9999; /* 提高优先级，防止被遮挡 */
    top: 100%; /* 改为显示在下方 */
    left: 100%;
    transform: translateX(-100%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    white-space: normal;
    line-height: 1.4;
  }
  
  
  .tooltip-wrapper:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
  }
  .tooltip-text a {
    color: #00aeff; /* 蓝色，可以改为其他颜色 */
    text-decoration: underline;
    font-weight: 500;
  }
  
  .tooltip-text a:hover {
    color: #347ece; /* 深蓝色悬停效果 */
    text-decoration: underline;
  }
  
/* 移动端适配样式 */
@media (max-width: 768px) {
    /* 基础布局调整 */
    body {
        padding-top: 0;
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
    }

    /* 确保页面内容合理分布 */
    body {
        padding-top: 0;
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        background: #121212;
    }

    /* 优化滚动体验 */
    .container {
        scroll-behavior: smooth;
    }

    /* 确保图表容器有足够空间 */
    .guess-container {
        margin-top: 10px;
    }

    /* 优化表格容器 */
    .table-container {
        margin-top: 10px;
    }

    .container {
        flex-direction: column;
        padding-top: 75px; /* 为移动端导航栏留出空间 */
        height: auto;
        gap: 12px;
        min-height: 100vh;
        overflow-y: auto;
        padding-left: 8px;
        padding-right: 8px;
    }

    /* 导航栏移动端适配 */
    .navbar {
        flex-direction: column;
        padding: 5px;
        height: auto;
        min-height: 70px;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 4px;
        justify-content: center;
        width: 100%;
    }

    .nav-item {
        padding: 8px 10px;
        font-size: 12px;
        flex: 1;
        min-width: 80px;
        text-align: center;
        border-radius: 6px;
        background: #333;
        margin: 1px;
    }

    .nav-item.active {
        background: #f0b90b;
        color: #000;
        font-weight: bold;
    }

    .join-community {
        margin: 5px 0;
        width: 100%;
        justify-content: center;
        gap: 15px;
        padding: 8px;
        background: #333;
        border-radius: 6px;
        font-size: 12px;
    }

    /* 广告横幅移动端适配 */
    .ad-banner {
        width: 100%;
        height: 35px;
        margin: 5px 0;
        background: #2a2a2a;
        border-radius: 8px;
        padding: 6px;
    }

    .ad-banner-content {
        font-size: 12px;
        gap: 20px;
        font-weight: bold;
    }

    /* 排行榜移动端适配 */
    .ranking-board {
        width: 100%;
        margin: 8px 0;
        order: 1;
        max-height: 300px;
        overflow-y: auto;
        background: #1a1a1a;
        border-radius: 12px;
        padding: 12px;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-height: 200px;
        border: 1px solid #333;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    #ranking-list {
        min-height: 150px;
        background: #2a2a2a;
        border-radius: 8px;
        padding: 12px;
    }

    #ranking-list:empty::after {
        content: "排行榜加载中...";
        display: block;
        text-align: center;
        color: #f0b90b;
        padding: 30px;
        font-size: 16px;
    }

    .ranking-board h3 {
        font-size: 16px;
        margin: 10px 0;
    }

    #ranking-list table {
        font-size: 10px;
    }

    #ranking-list th,
    #ranking-list td {
        padding: 4px 2px;
        font-size: 8px;
    }

    /* 图表容器移动端适配 */
    .chart-container {
        width: 100%;
        min-width: unset;
        max-width: unset;
        margin: 10px 0;
        order: 2;
        min-height: 500px;
        max-height: 800px;
        overflow-y: auto;
        background: #1a1a1a;
        border-radius: 12px;
        padding: 15px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    /* TradingView图表移动端适配 */
    #tradingview-chart,
    .chart-container div[id*="tradingview"],
    .chart-container iframe {
        height: 450px !important;
        max-height: 450px !important;
        min-height: 450px !important;
    }

    /* 控制区域移动端适配 */
    .controls {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
        background: #1a1a1a;
        border-radius: 12px;
        margin: 10px 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .radio-inputs {
        width: 100%;
        flex-wrap: wrap;
        gap: 5px;
        background: #2a2a2a;
        border-radius: 8px;
        padding: 10px;
    }

    .radio {
        flex: 1;
        min-width: 70px;
        padding: 12px 8px;
        font-size: 12px;
        border-radius: 6px;
        background: #333;
    }

    #usdt-count {
        width: 100%;
        max-width: 200px;
        margin: 5px 0;
    }

    .buysell-button-container {
        width: 100%;
        flex-direction: row;
        gap: 15px;
        justify-content: center;
        background: #2a2a2a;
        border-radius: 8px;
        padding: 15px;
    }

    .buysell-button-container button {
        flex: 1;
        max-width: 140px;
        height: 50px;
        font-size: 16px;
        border-radius: 8px;
        font-weight: bold;
    }

    /* 表格移动端适配 */
    .table-container {
        height: 350px;
        margin: 15px 0;
        background: #2a2a2a;
        border-radius: 8px;
        padding: 10px;
    }

    table {
        font-size: 10px;
    }

    th, td {
        padding: 8px 6px;
        font-size: 10px;
        word-break: break-word;
    }

    /* 预测容器移动端适配 */
    .predict-container {
        width: 100%;
        margin: 8px 0;
        order: 3;
        max-height: 400px;
        overflow-y: auto;
        background: #1a1a1a;
        border-radius: 12px;
        padding: 12px;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-height: 250px;
        border: 1px solid #333;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    #predict-summary {
        min-height: 80px;
        background: #2a2a2a;
        border-radius: 8px;
        padding: 15px;
        margin-bottom: 15px;
    }

    #predict-summary:empty::after {
        content: "预测详情加载中...";
        display: block;
        text-align: center;
        color: #f0b90b;
        padding: 20px;
        font-size: 16px;
    }

    .predict-container h3 {
        font-size: 16px;
    }

    .predict-container-title-bar {
        flex-direction: column;
        gap: 10px;
        margin: 10px 0;
    }

    #strategyTypeSelect {
        width: 100%;
        max-width: 200px;
        margin: 0;
    }

    #predict-summary {
        flex-direction: column;
        gap: 10px;
        font-size: 10px;
    }

    #predict-summary .summary-item {
        min-width: unset;
        width: 100%;
        justify-content: space-between;
    }

    .predict-container table {
        font-size: 8px;
    }

    .predict-container th,
    .predict-container td {
        font-size: 8px !important;
        padding: 4px 2px;
    }

    /* 弹窗移动端适配 */
    .modal-content {
        width: 90%;
        max-width: 300px;
        padding: 15px;
    }



    /* 按钮移动端适配 */
    button {
        font-size: 14px;
        padding: 10px 15px;
        margin: 5px;
    }

    /* 输入框移动端适配 */
    input[type="number"] {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 12px;
        width: 100%;
        max-width: 200px;
    }

    /* 汇总信息移动端适配 */
    #summary {
        padding: 20px;
        margin: 15px 0;
        background: #2a2a2a;
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    #summary span {
        font-size: 18px;
        font-weight: bold;
    }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
    .nav-item {
        font-size: 12px;
        padding: 8px 10px;
        min-width: 80px;
    }

    .controls {
        padding: 15px;
    }

    .radio {
        font-size: 11px;
        padding: 10px 6px;
    }

    .buysell-button-container button {
        font-size: 14px;
        height: 45px;
    }

    table {
        font-size: 9px;
    }

    th, td {
        padding: 6px 4px;
        font-size: 9px;
    }

    .predict-container table {
        font-size: 9px;
    }

    .predict-container th,
    .predict-container td {
        font-size: 9px !important;
    }

    .ranking-board {
        min-height: 180px;
        max-height: 250px;
    }

    .chart-container {
        min-height: 400px;
        max-height: 600px;
    }

    .predict-container {
        min-height: 200px;
        max-height: 350px;
    }

    /* TradingView图表超小屏幕适配 */
    #tradingview-chart,
    .chart-container div[id*="tradingview"],
    .chart-container iframe {
        height: 350px !important;
        max-height: 350px !important;
        min-height: 350px !important;
    }
}

/* 横屏模式适配 */
@media (max-width: 768px) and (orientation: landscape) {
    .container {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }

    .ranking-board {
        width: 30%;
        order: 1;
        min-height: 400px;
    }

    .chart-container {
        width: 40%;
        order: 2;
        min-height: 500px;
    }

    /* TradingView图表横屏模式适配 */
    #tradingview-chart,
    .chart-container div[id*="tradingview"],
    .chart-container iframe {
        height: 400px !important;
        max-height: 400px !important;
        min-height: 400px !important;
    }

    .predict-container {
        width: 30%;
        order: 3;
        min-height: 400px;
    }

    .controls {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }

    .radio-inputs {
        width: auto;
        flex: 1;
    }

    .buysell-button-container {
        width: auto;
        flex: 0 0 auto;
    }

    .navbar {
        min-height: 60px;
        flex-direction: row;
    }

    .nav-links {
        flex: 1;
    }

    .ad-banner {
        width: auto;
        flex: 1;
    }
}

/* 触摸友好的交互优化 */
@media (max-width: 768px) {
    /* 增加触摸目标大小 */
    .nav-item,
    button,
    .radio,
    input[type="number"],
    select {
        min-height: 44px; /* iOS推荐的最小触摸目标 */
    }

    /* 增加按钮间距 */
    .buysell-button-container {
        gap: 15px;
    }

    /* 优化表格滚动 */
    .table-container {
        -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
    }

    /* 优化输入框 */
    input[type="number"] {
        -webkit-appearance: none; /* 移除iOS默认样式 */
        border-radius: 8px;
    }

    /* 优化选择框 */
    select {
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 8px center;
        background-size: 16px;
        padding-right: 30px;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .nav-item,
    button,
    .radio {
        border-width: 0.5px;
    }
}

/* 减少动画以提高性能 */
@media (prefers-reduced-motion: reduce) {
    .ad-banner-content {
        animation: none;
    }

    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}