* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    color: #e6e6e6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.5s ease;
}

/* 深色主题 */
body.theme-dark {
    background: #0a0a12;
    background: linear-gradient(135deg, #060613 0%, #0a0a1f 50%, #050510 100%);
}

/* 浅色主题 */
body.theme-light {
    background: #f0f2f5;
    background: linear-gradient(135deg, #e6e9f0 0%, #eef2f7 50%, #e6e9f0 100%);
    color: #333;
}

.container {
    max-width: 100%;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部工具栏 - 美化 */
.top-toolbar {
    height: 40px; /* 增加高度 */
    background: rgba(20, 20, 50, 0.95);
    display: flex;
    align-items: center;
    padding: 5px 15px;
    /*border-bottom: 1px solid #4a4a8a;*/
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    gap: 15px;
}

body.theme-light .top-toolbar {
    background: rgba(240, 242, 245, 0.95);
    border-bottom: 1px solid #d0d0e0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    padding-right: 15px;
    border-right: 1px solid #4a4a8a;
}

body.theme-light .logo-container {
    border-right: 1px solid #d0d0e0;
}

.logo-icon {
    width: 28px;
    height: 28px;
    /*background: linear-gradient(135deg, #00c9ff, #92fe9d);*/
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #0f0c29;
    font-weight: bold;
}

.logo-text {
    font-size: 16px;
    font-weight: bold;
    background: linear-gradient(90deg, #00c9ff, #92fe9d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* 搜索框美化 - 增加圆角 */
.search-container {
    display: flex;
    align-items: center;
    background: rgba(40, 40, 80, 0.7);
    border-radius: 15px; /* 增大圆角 */
    padding: 0 10px;
    height: 24px; /* 增加高度 */
    min-width: 120px;
    border: 1px solid #4a4a8a;
    transition: all 0.3s ease;
}

body.theme-light .search-container {
    background: rgba(240, 242, 245, 0.7);
    border: 1px solid #d0d0e0;
}

.search-container:focus-within {
    border-color: #00c9ff;
    box-shadow: 0 0 0 2px rgba(0, 201, 255, 0.3);
}

.search-container i {
    color: #b0b0ff;
    font-size: 12px;
    margin-right: 8px;
}

body.theme-light .search-container i {
    color: #666;
}

.search-container input {
    background: transparent;
    border: none;
    color: #f8f8f2;
    font-size: 12px;
    width: 100%;
    outline: none;
    height: 100%;
}

body.theme-light .search-container input {
    color: #333;
}

.search-container input::placeholder {
    color: #7272a4;
}

body.theme-light .search-container input::placeholder {
    color: #999;
}

.toolbar-intervals {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 0 5px;
    height: 100%;
    align-items: center;
    flex-grow: 1;
}

.toolbar-intervals::-webkit-scrollbar {
    height: 3px;
}

.toolbar-intervals::-webkit-scrollbar-thumb {
    background: #4a4a8a;
    border-radius: 3px;
}

body.theme-light .toolbar-intervals::-webkit-scrollbar-thumb {
    background: #d0d0e0;
}

.toolbar-btn {
    background: rgba(60, 60, 100, 0.6);
    color: #f8f8f2;
    border: none;
    padding: 3px 8px; /* 增加内边距 */
    border-radius: 6px; /* 增大圆角 */
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    height: 22px; /* 增加高度 */
    position: relative;
}

body.theme-light .toolbar-btn {
    background: rgba(220, 220, 230, 0.6);
    color: #333;
}

.toolbar-btn:hover {
    background: rgba(100, 100, 200, 0.5);
}

body.theme-light .toolbar-btn:hover {
    background: rgba(180, 180, 220, 0.7);
}

.toolbar-btn.active {
    background: linear-gradient(135deg, #00c9ff, #92fe9d);
    color: #0f0c29;
    font-weight: 600;
}

body.theme-light .toolbar-btn.active {
    background: linear-gradient(135deg, #00a2ff, #72de7d);
}

.toolbar-btn.calculated::after {
    /*content: '计算';*/
    position: absolute;
    top: -5px;
    right: -5px;
    background: rgba(176, 176, 255, 0.3);
    color: #b0b0ff;
    font-size: 8px;
    padding: 1px 3px;
    border-radius: 3px;
}

body.theme-light .toolbar-btn.calculated::after {
    background: rgba(100, 100, 200, 0.2);
    color: #6666cc;
}

/* 交易所选择器 */
#exchange-select {
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 80px;
}

.exchange-container i {
    color: #b0b0ff;
    font-size: 14px;
}

body.theme-light .exchange-container i {
    color: #666;
}

/* 语言和主题选择器 */
.toolbar-options {
    display: flex;
    gap: 10px;
    align-items: center;
    padding-left: 10px;
    border-left: 1px solid #4a4a8a;
}

body.theme-light .toolbar-options {
    border-left: 1px solid #d0d0e0;
}

.select-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
}

.select-container i {
    color: #b0b0ff;
    font-size: 14px;
}

body.theme-light .select-container i {
    color: #666;
}

.custom-select {
    background: rgba(40, 40, 80, 0.7);
    color: #f8f8f2;
    border: 1px solid #4a4a8a;
    border-radius: 6px; /* 增大圆角 */
    padding: 3px 8px; /* 调整内边距 */
    height: 24px; /* 增加高度 */
    font-size: 12px;
    cursor: pointer;
    appearance: none;
    min-width: 60px;
    transition: all 0.2s ease;
}

body.theme-light .custom-select {
    background: rgba(240, 242, 245, 0.7);
    border: 1px solid #d0d0e0;
    color: #333;
}

.custom-select:hover {
    background: rgba(60, 60, 100, 0.8);
}

body.theme-light .custom-select:hover {
    background: rgba(220, 220, 230, 0.8);
}

.select-container::after {
    content: "▼";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #b0b0ff;
    pointer-events: none;
}

body.theme-light .select-container::after {
    color: #666;
}

/* 图表类型选择器 */
.chart-type-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chart-type-container i {
    color: #b0b0ff;
    font-size: 14px;
}

body.theme-light .chart-type-container i {
    color: #666;
}

/* 主体内容 */
.main-content {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
    padding: 5px;
    gap: 5px;
    position: relative;
}

/* 左侧交易对表格 - 美化后 */
.symbols-table-container {
    width: 300px;
    background: rgba(20, 20, 50, 0.7);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid #4a4a8a;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

body.theme-light .symbols-table-container {
    background: rgba(240, 242, 245, 0.7);
    border: 1px solid #d0d0e0;
}

.table-header {
    padding: 12px 15px;
    background: rgba(30, 30, 70, 0.8);
    border-bottom: 1px solid #4a4a8a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.theme-light .table-header {
    background: rgba(230, 232, 235, 0.8);
    border-bottom: 1px solid #d0d0e0;
}

.table-header h2 {
    font-size: 1.2rem;
    color: #b0b0ff;
    display: flex;
    align-items: center;
    gap: 8px;
}

body.theme-light .table-header h2 {
    color: #666;
}

.symbols-table {
    width: 100%;
    border-collapse: collapse;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    table-layout: fixed; /* 确保列宽固定 */
}

.symbols-table thead {
    display: block;
    position: sticky;
    top: 0;
    background: rgba(30, 30, 70, 0.9);
    z-index: 10;
}

body.theme-light .symbols-table thead {
    background: rgba(230, 232, 235, 0.9);
}

.symbols-table tbody {
    display: block;
    overflow-y: auto;
    flex: 1;
    /* 自定义滚动条 */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: rgba(90, 90, 150, 0.8) rgba(30, 30, 70, 0.5); /* Firefox */
}

/* 自定义Webkit滚动条 */
.symbols-table tbody::-webkit-scrollbar {
    width: 8px; /* 滚动条宽度 */
}

.symbols-table tbody::-webkit-scrollbar-track {
    background: rgba(30, 30, 70, 0.5); /* 滚动条轨道背景 */
    border-radius: 4px;
}

.symbols-table tbody::-webkit-scrollbar-thumb {
    background: rgba(90, 90, 150, 0.8); /* 滚动条滑块颜色 */
    border-radius: 4px;
    border: 1px solid rgba(100, 100, 200, 0.3);
}

.symbols-table tbody::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 100, 200, 0.9);
}

/* 浅色主题下的滚动条 */
body.theme-light .symbols-table tbody::-webkit-scrollbar-track {
    background: rgba(220, 220, 230, 0.5);
}

body.theme-light .symbols-table tbody::-webkit-scrollbar-thumb {
    background: rgba(160, 160, 180, 0.8);
}

body.theme-light .symbols-table tbody::-webkit-scrollbar-thumb:hover {
    background: rgba(140, 140, 180, 0.9);
}

.symbols-table tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.symbols-table th {
    padding: 3px 2px;
    text-align: left;
    font-size: 12px;
    color: #b0b0ff;
    font-weight: 500;
    border-bottom: 1px solid #4a4a8a;
    white-space: nowrap;
    overflow: hidden;
    /*text-overflow: ellipsis;*/
}

body.theme-light .symbols-table th {
    color: #666;
    border-bottom: 1px solid #d0d0e0;
}

/* 设置各列宽度比例 */
.symbols-table th:nth-child(1) { /* 交易对 */
    width: 40%;
}

.symbols-table th:nth-child(2) { /* 价格 */
    width: 26%;
    text-align: right;
}

.symbols-table th:nth-child(3) { /* 涨跌幅 */
    width: 19%;
    text-align: right;
}

.symbols-table th:nth-child(4) { /* 24H交易量 */
    width: 15%;
    text-align: right;
}

.symbols-table th.sortable {
    cursor: pointer;
    position: relative;
}

.symbols-table th.sortable:hover {
    color: #00c9ff;
}

body.theme-light .symbols-table th.sortable:hover {
    color: #00a2ff;
}

.symbols-table th.sortable::after {
    content: "↕";
    margin-left: 4px;
    font-size: 10px;
    opacity: 0.6;
}

.symbols-table th.asc::after {
    content: "↑";
    color: #00c9ff;
    opacity: 1;
}

body.theme-light .symbols-table th.asc::after {
    color: #00a2ff;
}

.symbols-table th.desc::after {
    content: "↓";
    color: #00c9ff;
    opacity: 1;
}

body.theme-light .symbols-table th.desc::after {
    color: #00a2ff;
}

.symbols-table td {
    padding: 3px 2px;
    font-size: 12px;
    border-bottom: 1px solid rgba(74, 74, 138, 0.3);
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    opacity: 0.7;
    font-weight: bold;
    /*text-overflow: ellipsis;*/
}

body.theme-light .symbols-table td {
    border-bottom: 1px solid rgba(200, 200, 220, 0.3);
}

/* 设置单元格对齐方式 */
.symbols-table td:nth-child(1) { /* 交易对 */
    width: 40%;
}

.symbols-table td:nth-child(2) { /* 价格 */
    width: 26%;
    text-align: right;
}

.symbols-table td:nth-child(3) { /* 涨跌幅 */
    width: 19%;
    text-align: right;
}

.symbols-table td:nth-child(4) { /* 24H交易量 */
    width: 15%;
    text-align: right;
}

.symbols-table tbody tr:hover td {
    background: rgba(100, 100, 200, 0.2);
}

body.theme-light .symbols-table tbody tr:hover td {
    background: rgba(200, 200, 230, 0.3);
}

.symbols-table tbody tr.active td {
    background: rgba(0, 201, 255, 0.15);
    color: #00c9ff;
}

body.theme-light .symbols-table tbody tr.active td {
    background: rgba(0, 162, 255, 0.2);
    color: #00a2ff;
}

.symbols-table tbody tr.selected td {
    background: rgba(0, 201, 255, 0.3);
    /*outline: 2px solid #00c9ff;*/
    /*outline-offset: -2px;*/
}

body.theme-light .symbols-table tbody tr.selected td {
    background: rgba(0, 162, 255, 0.3);
    /*outline: 2px solid #00a2ff;*/
}

.symbol-name {
    display: flex;
    align-items: center;
    gap: 3px;
}

.symbol-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

body.theme-light .symbol-icon {
    background: rgba(0, 0, 0, 0.05);
}

.symbol-price {
    /*font-weight: 500;*/
    /*display: flex;*/
    /*align-items: center;*/
    /*gap: 3px;*/
    /*justify-content: flex-end;*/
}

.symbol-price-value {
    flex: 1;
    text-align: right;
    overflow: hidden;
    /*text-overflow: ellipsis;*/
}

.symbol-change {
    font-weight: 500;
    font-size: 12px;
    min-width: 60px;
    text-align: right;
}

.symbol-change.positive {
    color: #50fa7b;
}

.symbol-change.negative {
    color: #ff5555;
}

.symbol-volume {
    color: #b0b0ff;
    font-size: 12px;
    text-align: right;
}

body.theme-light .symbol-volume {
    color: #666;
}

/* 右侧面板 */
.right-panel {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
}

.price-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    position: relative;
    top: 3px;
    left: 15px;
    right: 15px;
    /*z-index: 100;*/
    /*background: rgb(24, 23, 51);*/
    padding: 5px;
    border-radius: 8px;
}

body.theme-light .price-display {
    background: rgba(240, 242, 245, 0.7);
}

body.theme-dark .price-display {
    background: rgba(10, 10, 18, 0.5);
}

.price-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.price-card h3 {
    color: #b0b0ff;
    font-size: 0.9rem;
    font-weight: 600;
}

body.theme-light .price-card h3 {
    color: #666;
}

.price-card .value-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-card .value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #f8f8f2;
}

body.theme-light .price-card .value {
    color: #333;
}

.price-card .change {
    font-size: 0.9rem;
    font-weight: 500;
}

.positive {
    color: #50fa7b;
}

.negative {
    color: #ff5555;
}

.base-asset {
    width: 100%;
    position: absolute;
    top: 15%;
    z-index: 500;
    font-size: 36px;
    font-weight: bolder;
    text-align: center;
    pointer-events: none;
}

.chart-container {
    background: rgba(15, 15, 35, 0.7);
    border-radius: 10px;
    overflow: hidden;
    flex-grow: 1;
    width: 100%;
    height: 100%;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid #4a4a8a;
    position: relative;
}

.chart-only-container {
    overflow: hidden;
    flex-grow: 1;
    width: 100%;
    height: 100%;
    position: relative;
    padding-bottom: 68px;
    border: none;
}

.chart {
    /*margin-top: 80px;*/
    overflow: hidden;
    flex-grow: 1;
    width: 100%;
    height: 100%;
    position: relative;
}

body.theme-light .chart-container {
    background: rgba(240, 242, 245, 0.7);
    border: 1px solid #d0d0e0;
}

body.theme-dark .chart-container {
    background: rgba(10, 10, 18, 0.7);
    border: 1px solid #3a3a7a;
}

/* K线图例 */
.chart-legend {
    position: absolute;
    top: 80px;
    left: 20px;
    /*background: rgba(20, 20, 50, 0.3);*/
    /*border: 1px solid #4a4a8a;*/
    /*border-radius: 6px;*/
    padding: 12px 15px;
    font-size: 13px;
    z-index: 100;
    pointer-events: none;
    min-width: 200px;
    opacity: 0.5;
    /*box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);*/
    /*transition: opacity 0.3s ease;*/
    /*backdrop-filter: blur(5px);*/
}

body.theme-light .chart-legend {
    background: rgba(240, 242, 245, 0.9);
    /*border: 1px solid #d0d0e0;*/
    color: #333;
}

body.theme-dark .chart-legend {
    background: rgba(10, 10, 25, 0.85);
    /*border: 1px solid #3a3a7a;*/
}

.chart-legend.show {
    opacity: 1;
}

.legend-header {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #00c9ff;
    border-bottom: 1px solid #4a4a8a;
    padding-bottom: 5px;
}

body.theme-light .legend-header {
    color: #00a2ff;
    border-bottom: 1px solid #d0d0e0;
}

body.theme-dark .legend-header {
    color: #00c9ff;
    border-bottom: 1px solid #3a3a7a;
}

.legend-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
}

.hidden {
    display: none;
}

.legend-label {
    color: #b0b0ff;
    min-width: 70px;
}

body.theme-light .legend-label {
    color: #666;
}

body.theme-dark .legend-label {
    color: #a0a0e0;
}

.legend-value {
    font-weight: 500;
    color: #f8f8f2;
}

body.theme-light .legend-value {
    color: #333;
}

.legend-value.positive {
    color: #50fa7b;
}

.legend-value.negative {
    color: #ff5555;
}

/* 底部状态栏 - 美化 */
.bottom-status-bar {
    height: 30px; /* 增加高度 */
    background: rgba(20, 20, 50, 0.9);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 15px;
    /*border-top: 1px solid #4a4a8a;*/
    font-size: 12px;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.4);
}

body.theme-light .bottom-status-bar {
    background: rgba(240, 242, 245, 0.9);
    border-top: 1px solid #d0d0e0;
}

body.theme-dark .bottom-status-bar {
    background: rgba(10, 10, 25, 0.9);
    border-top: 1px solid #3a3a7a;
}

.status-left {
    display: flex;
    align-items: center;
    gap: 3px;
    width: 26%;
}

.status-right {
    display: flex;
    align-items: center;
    gap: 3px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 100%;
}

.status-label {
    color: #b0b0ff;
}

body.theme-light .status-label {
    color: #666;
}

body.theme-dark .status-label {
    color: #a0a0e0;
}

.status-value {
    font-weight: 500;
}

body.theme-light .status-value {
    color: #333;
}

.data-source {
    color: #b0b0ff;
    font-style: italic;
}

body.theme-light .data-source {
    color: #666;
}

body.theme-dark .data-source {
    color: #a0a0e0;
}

.refresh-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auto-refresh {
    display: flex;
    align-items: center;
    gap: 5px;
}

.auto-refresh label {
    color: #b0b0ff;
}

body.theme-light .auto-refresh label {
    color: #666;
}

body.theme-dark .auto-refresh label {
    color: #a0a0e0;
}

.refresh-btn {
    background: rgba(60, 60, 100, 0.6);
    color: #f8f8f2;
    border: none;
    padding: 4px 12px; /* 调整内边距 */
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    /*display: flex;*/
    align-items: center;
    gap: 5px;
    height: 22px; /* 增加高度 */
    display: none;
}

body.theme-light .refresh-btn {
    background: rgba(220, 220, 230, 0.6);
    color: #333;
}

body.theme-dark .refresh-btn {
    background: rgba(40, 40, 80, 0.6);
}

.refresh-btn:hover {
    background: rgba(100, 100, 200, 0.5);
}

body.theme-light .refresh-btn:hover {
    background: rgba(180, 180, 220, 0.7);
}

body.theme-dark .refresh-btn:hover {
    background: rgba(80, 80, 160, 0.5);
}

.loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #b0b0ff;
    font-size: 1rem;
    display: none;
    text-align: center;
    z-index: 10;
}

body.theme-light .loader {
    color: #666;
}

body.theme-dark .loader {
    color: #a0a0e0;
}

.loader-spinner {
    border: 4px solid rgba(176, 176, 255, 0.3);
    border-top: 4px solid #b0b0ff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

body.theme-light .loader-spinner {
    border: 4px solid rgba(180, 180, 220, 0.3);
    border-top: 4px solid #6666cc;
}

body.theme-dark .loader-spinner {
    border: 4px solid rgba(120, 120, 200, 0.3);
    border-top: 4px solid #9090e0;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

footer {
    display: none;
}

.notification {
    position: fixed;
    top: 50px;
    right: 20px;
    background: rgba(20, 20, 50, 0.9);
    color: #ff5555;
    padding: 10px 20px;
    border-radius: 5px;
    border-left: 4px solid #ff5555;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transform: translateX(110%);
    transition: transform 0.3s ease;
    z-index: 200;
}

body.theme-light .notification {
    background: rgba(240, 242, 245, 0.9);
    color: #ff3333;
    border-left: 4px solid #ff3333;
}

body.theme-dark .notification {
    background: rgba(10, 10, 25, 0.9);
    color: #ff5555;
    border-left: 4px solid #ff5555;
}

.notification.show {
    transform: translateX(0);
}

.symbol-count {
    font-size: 0.9rem;
    color: #b0b0ff;
    background: rgba(40, 40, 80, 0.5);
    padding: 2px 8px;
    border-radius: 12px;
}

body.theme-light .symbol-count {
    color: #666;
    background: rgba(220, 220, 230, 0.5);
}

body.theme-dark .symbol-count {
    color: #a0a0e0;
    background: rgba(40, 40, 80, 0.5);
}

/* 新增的工具按钮样式 */
.tool-buttons {
    display: flex;
    justify-content: center;
    flex: 1;
    gap: 8px;
    padding: 0 10px;
    overflow-x: auto;
}

.tool-buttons::-webkit-scrollbar {
    height: 3px;
}

.tool-buttons::-webkit-scrollbar-thumb {
    background: #4a4a8a;
    border-radius: 3px;
}

body.theme-light .tool-buttons::-webkit-scrollbar-thumb {
    background: #d0d0e0;
}

.tool-button {
    background: rgba(60, 60, 100, 0.6);
    border: none;
    border-radius: 3px;
    color: #b0b0ff;
    cursor: pointer;
    width: 24px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.tool-button:hover {
    background: rgba(100, 100, 200, 0.5);
    transform: translateY(-1px);
}

.tool-button.active {
    background: rgba(0, 201, 255, 0.3);
    color: #00c9ff;
}

body.theme-light .tool-button {
    background: rgba(220, 220, 230, 0.6);
    color: #666;
}

body.theme-light .tool-button:hover {
    background: rgba(180, 180, 220, 0.7);
}

body.theme-light .tool-button.active {
    background: rgba(0, 162, 255, 0.3);
    color: #00a2ff;
}

body.theme-dark .tool-button {
    background: rgba(40, 40, 80, 0.6);
    color: #b0b0ff;
}

body.theme-dark .tool-button:hover {
    background: rgba(80, 80, 160, 0.5);
}

body.theme-dark .tool-button.active {
    background: rgba(0, 201, 255, 0.3);
    color: #00c9ff;
}

.tool-button svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.theme-light .tool-button svg {
    stroke: #333;
}

body.theme-dark .tool-button svg {
    stroke: #b0b0ff;
}

.tool-button.active svg {
    stroke: #00c9ff;
}

body.theme-light .tool-button.active svg {
    stroke: #00a2ff;
}

/* 交易所标签 */
.exchange-tag {
    background: rgba(100, 100, 200, 0.3);
    color: #b0b0ff;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    margin-left: 5px;
}

body.theme-light .exchange-tag {
    background: rgba(180, 180, 220, 0.3);
    color: #666;
}

@media (max-width: 1200px) {
    .symbols-table-container {
        width: 250px;
    }

    .symbols-table td {
        padding: 8px 12px;
    }

    .toolbar-options {
        flex-direction: column;
        gap: 5px;
        padding-top: 5px;
        padding-bottom: 5px;
    }
}

@media (max-width: 992px) {
    .symbols-table-container {
        width: 220px;
    }

    .price-display {
        grid-template-columns: 1fr 1fr;
    }

    .tool-buttons {
        gap: 5px;
    }
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .symbols-table-container {
        width: 100%;
        height: 250px;
    }

    .price-display {
        grid-template-columns: 1fr;
        top: 10px;
        left: 10px;
        right: 10px;
    }

    .logo-text {
        display: none;
    }

    .search-container {
        min-width: 120px;
    }

    .chart-container {
        /*padding-top: 180px;*/
    }

    .chart-legend {
        top: 190px;
    }

    .toolbar-options {
        flex-direction: row;
        gap: 8px;
        padding: 0;
    }

    .tool-buttons {
        display: none; /* 在小屏幕上隐藏工具按钮 */
    }
}

@media (max-width: 480px) {
    .top-toolbar {
        gap: 8px;
        padding: 0 10px;
    }

    .toolbar-intervals {
        gap: 4px;
    }

    .toolbar-btn {
        padding: 4px 8px;
        font-size: 11px;
    }

    .status-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .price-card h3 {
        font-size: 0.8rem;
    }

    .price-card .value {
        font-size: 1.1rem;
    }

    .price-card .change {
        font-size: 0.8rem;
    }

    .toolbar-options {
        gap: 5px;
    }

    .custom-select {
        min-width: 80px;
        padding-right: 15px;
    }
}

.delete-hint {
    position: absolute;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    z-index: 30;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* ========== 文本工具样式 - 统一前缀 text-tool- ========== */
.text-tool-toolbar {
    display: none;
    position: absolute;
    background: linear-gradient(135deg, #2c3e50, #4a6491);
    border-radius: 8px;
    padding: 4px 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6),
    0 0 0 2px rgba(100, 180, 255, 0.3);
    z-index: 100;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 300px;
    height: 30px; /* 设置固定高度 */
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
}

.text-tool-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.text-tool-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1px;
}

.text-tool-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

.text-tool-btn {
    background: linear-gradient(to bottom, rgba(70, 130, 180, 0.9), rgba(50, 100, 150, 0.9));
    border: none;
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    font-size: 0.9rem;
}

.text-tool-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    background: linear-gradient(to bottom, rgba(90, 160, 220, 0.9), rgba(70, 130, 180, 0.9));
}

.text-tool-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.text-tool-btn-delete {
    background: linear-gradient(to bottom, rgba(231, 76, 60, 0.9), rgba(192, 57, 43, 0.9));
}

.text-tool-btn-delete:hover {
    background: linear-gradient(to bottom, rgba(255, 100, 80, 0.9), rgba(231, 76, 60, 0.9));
}

.text-tool-select-container {
    position: relative;
    flex-grow: 1;
    height: 26px;
}

.text-tool-font-select {
    width: 100%;
    height: 26px;
    padding: 4px 30px 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(20, 30, 50, 0.8);
    color: white;
    font-size: 0.8rem;
    appearance: none;
    cursor: pointer;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
    transition: all 0.3s;
}

.text-tool-font-select:hover {
    background: rgba(30, 40, 60, 0.9);
    border-color: rgba(100, 180, 255, 0.5);
}

.text-tool-select-arrow {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    pointer-events: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
}

.text-tool-color-container {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-grow: 1;
    height: 26px;
}

.text-tool-color-picker {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.text-tool-color-picker::-webkit-color-swatch {
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.text-tool-color-picker::-moz-color-swatch {
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.text-tool-color-value {
    flex-grow: 1;
    padding: 4px 8px;
    background: rgba(20, 30, 50, 0.8);
    border-radius: 6px;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
    height: 26px;
    line-height: 18px;
}

.text-tool-text-element {
    position: absolute;
    padding: 8px;
    background: rgba(30, 30, 60, 0.85);
    border-radius: 6px;
    color: #ffffff;
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    cursor: move;
    pointer-events: auto;
    border: 1px solid rgba(100, 180, 255, 0.5);
    z-index: 50;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    min-width: 100px;
    min-height: 35px;
}

.text-tool-text-element:focus {
    outline: none;
    border: 1px solid rgba(100, 180, 255, 0.8);
    box-shadow: 0 0 0 2px rgba(100, 180, 255, 0.3);
}

.tech-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(0, 195, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 195, 255, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.4;
    z-index: -1;
}

.signal-svg {
    filter: drop-shadow(0 0 15px rgba(0, 195, 255, 0.6));
    animation: pulse 4s infinite ease-in-out;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.bubble-input {
    position: absolute;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 15px rgba(255, 255, 255, 0.3) inset !important;
    border-radius: 18px !important;
    font-weight: 500;
    padding: 15px;
    transition: all 0.3s ease;
    outline: none;
    resize: none;
    color: #333;
    font-size: 14px;
    width: 180px;
    height: 120px;
    overflow: auto;
    pointer-events: auto;
    display: none;
    z-index: 2000;
}

.bubble-input:focus {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 255, 255, 0.5) inset !important;
    background: rgba(255, 255, 255, 0.98) !important;
}

/* 新增工具条样式 */
.technical-analysis-toolbar {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    height: 26px;
    background: rgba(30, 30, 70, 0.85);
    backdrop-filter: blur(5px);
    border-radius: 15px;
    margin: 0 15px;
    /*display: flex;*/
    display: none;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: 1px solid #4a4a8a;
    overflow: hidden;
}

body.theme-light .technical-analysis-toolbar {
    background: rgba(240, 242, 245, 0.85);
    border: 1px solid #d0d0e0;
}

body.theme-dark .technical-analysis-toolbar {
    background: rgba(20, 20, 40, 0.9);
    border: 1px solid #3a3a7a;
}

.toolbar-buttons-container {
    display: flex;
    flex: 1;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 5px;
    scrollbar-width: thin;
    scrollbar-color: #4a4a8a transparent;
}

.toolbar-buttons-container::-webkit-scrollbar {
    height: 5px;
}

.toolbar-buttons-container::-webkit-scrollbar-track {
    background: transparent;
}

.toolbar-buttons-container::-webkit-scrollbar-thumb {
    background: #4a4a8a;
    border-radius: 4px;
    /*border: 2px solid transparent;*/
    background-clip: content-box;
}

body.theme-light .toolbar-buttons-container::-webkit-scrollbar-thumb {
    background: #b0b0d0;
}

body.theme-dark .toolbar-buttons-container::-webkit-scrollbar-thumb {
    background: #5a5a9a;
}

.ta-tool-btn {
    height: 20px;
    min-width: 36px;
    background: rgba(50, 50, 90, 0.7);
    border: none;
    border-radius: 3px;
    color: #b0b0ff;
    font-size: 11px;
    font-weight: 500;
    padding: 0 8px;
    margin: 0 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.ta-tool-btn:hover {
    background: rgba(100, 100, 200, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.ta-tool-btn.active {
    background: linear-gradient(90deg, #00c9ff, #92fe9d);
    color: #0f0c29;
    box-shadow: 0 0 8px rgba(0, 201, 255, 0.5);
}

.ta-tool-btn.active::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(30deg);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% {
        transform: rotate(30deg) translate(-50%, -50%);
    }
    100% {
        transform: rotate(30deg) translate(150%, 150%);
    }
}

body.theme-light .ta-tool-btn {
    background: rgba(220, 220, 230, 0.7);
    color: #333;
}

body.theme-light .ta-tool-btn:hover {
    background: rgba(180, 180, 220, 0.8);
}

body.theme-light .ta-tool-btn.active {
    background: linear-gradient(90deg, #00a2ff, #72de7d);
    color: #fff;
}

body.theme-dark .ta-tool-btn {
    background: rgba(40, 40, 80, 0.7);
}

.toolbar-toggle {
    position: absolute;
    top: 60px;
    max-width: 150px;
    height: 26px;
    margin-left: 10px;
    padding: 0 8px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(60, 60, 100, 0.7);
    color: #b0b0ff;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    z-index: 1500;
}

.toolbar-toggle:hover {
    background: rgba(100, 100, 200, 0.5);
}

.technical-analysis-toolbar.hidden {
    transform: translateY(-30px);
    opacity: 0;
    pointer-events: none;
}

.toolbar-buttons-container.hidden {
    transform: translateY(-30px);
    /*opacity: 0;*/
    display: none;
}

/*!* 调整图表容器位置 *!*/
/*.chart-only-container {*/
/*    padding-top: 100px; !* 增加顶部内边距容纳工具条 *!*/
/*}*/

/* 响应式调整 */
@media (max-width: 768px) {
    .technical-analysis-toolbar {
        top: 180px;
    }

    .chart-container {
        padding-top: 210px; /* 移动端调整 */
    }
}


.intersection-markers {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 300;
}

.marker-label {
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 4px;
    border-left: 3px solid;
}

.price-label {
    font-weight: bold;
}

.change-label {
    font-size: 11px;
}

.start-signal {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffcc00, #ff9900);
    box-shadow: 0 0 0 4px rgba(255, 204, 0, 0.4), 0 0 15px rgba(255, 204, 0, 0.8);
    z-index: 250;
    pointer-events: none;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 204, 0, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(255, 204, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 204, 0, 0);
    }
}