/* 确保所有文本元素都继承基础字体大小 */
h1, h2, h3, h4, h5, h6,
p, span, div, a,
button, input, select, textarea {
    font-size: inherit;
}

/* 全局样式 - 针对1920×1440分辨率优化 */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    font-size: 22px; /* 增大基础字体大小 */
    line-height: 1.6; /* 增加行高 */
    color: #333;
}

/* 页眉样式 */
.header {
    background-color: #333;
    color: white;
    padding: 15px 25px; /* 增加内边距 */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    flex: 1;
    white-space: nowrap;
    margin: 0;
    font-size: 1.8rem; /* 增大标题字体 */
    font-weight: normal;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px; /* 增加间距 */
}

.username-display {
    color: white;
    font-size: 16px; /* 增大字体 */
    font-weight: 500;
    max-width: 150px; /* 增加最大宽度 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#logout {
    color: white;
    text-decoration: none;
    padding: 8px 16px; /* 增大按钮尺寸 */
    background-color: #f44336;
    border-radius: 6px; /* 增大圆角 */
    font-size: 16px; /* 增大字体 */
}

#logout:hover {
    background-color: #d32f2f;
}

/* 主容器布局 */
.container {
    display: flex;
    min-height: calc(100vh - 66px); /* 调整高度 */
}

.sidebar {
    width: 180px; /* 增加侧边栏宽度 */
    background-color: #f8f8f8;
    padding: 20px; /* 增加内边距 */
    border-right: 2px solid #ddd; /* 加粗边框 */
}

.main-content {
    flex: 1;
    padding: 20px 20px 20px 30px; /* 增加内边距 */
    background-color: #fff;
}

/* 导航树样式 */
.tree ul {
    list-style-type: none;
    padding-left: 0;
}

.tree li {
    margin: 15px 0; /* 增加间距 */
}

.tree a {
    display: block;
    padding: 12px 15px; /* 增大内边距 */
    color: #333;
    text-decoration: none;
    border-radius: 6px; /* 增大圆角 */
    font-size: 16px; /* 增大字体 */
    transition: all 0.3s ease;
}

.tree a:hover {
    background-color: #e0e0e0;
}

.tree a.current {
    background-color: #4CAF50;
    color: white;
}

/* 策略控制区 */
.strategy-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px; /* 增加间距 */
    flex-wrap: wrap;
    gap: 15px; /* 增加间距 */
}

.strategy-controls {
    display: flex;
    gap: 12px; /* 增加间距 */
    align-items: center;
}

.strategy-select {
    width: 280px; /* 增加宽度 */
    padding: 12px 16px; /* 增大内边距 */
    border: 2px solid #ddd; /* 加粗边框 */
    border-radius: 6px; /* 增大圆角 */
    font-size: 16px; /* 增大字体 */
    cursor: pointer;
    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='%23333'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
}

.common-btn {
    padding: 12px 20px; /* 增大内边距 */
    border-radius: 6px; /* 增大圆角 */
    cursor: pointer;
    font-size: 16px; /* 增大字体 */
    border: 2px solid #ddd; /* 加粗边框 */
    white-space: nowrap;
    background-color: #f5f5f5;
    color: #333;
    transition: all 0.2s ease;
}

.common-btn:hover {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.common-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #e0e0e0 !important;
    color: #999 !important;
    border-color: #ddd !important;
}
.common-input-field {
    width: 160px;
	padding: 12px 16px; /* 增大内边距 */
	font-size: 16px;
}

/* 市场信息 */
.market-info {
    font-size: 16px; /* 增大字体 */
    display: flex;
    align-items: center;
    gap: 8px; /* 增加间距 */
    white-space: nowrap;
}

.decision-time {
    font-weight: bold;
}

#decision-date, #utc-offset {
    font-family: monospace;
    font-size: 16px; /* 增大字体 */
}

.market-status {
    padding: 10px 18px; /* 增大内边距 */
    border-radius: 6px; /* 增大圆角 */
    font-weight: bold;
    margin-left: 12px; /* 增加间距 */
    border: 2px solid transparent; /* 加粗边框 */
    font-size: 16px; /* 增大字体 */
}

.market-status.open {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.market-status.closed {
    background-color: #e0e0e0;
    color: #333;
    border-color: #ddd;
}

.market-status.extended-hours {
    background-color: #FFA500;
    color: white;
    border-color: #FFA500;
}

.market-status.holiday {
    background-color: #9C27B0;
    color: white;
    border-color: #9C27B0;
}

/* 策略描述 */
.strategy-description {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px; /* 增加间距 */
    font-size: 15px; /* 增大字体 */
    line-height: 1.6; /* 增加行高 */
    margin-bottom: 25px; /* 增加间距 */
}

.requirements-column h4, 
.conditions-column h4 {
    margin-top: 0;
    border-bottom: 2px solid #eee; /* 加粗边框 */
    padding-bottom: 8px; /* 增加内边距 */
    font-size: 18px; /* 增大字体 */
}

/* 股票卡片 */
.stock-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px; /* 增加间距 */
}

.stock-card {
    flex: 1;
    min-width: 350px; /* 增加最小宽度 */
    border: 2px solid #ddd; /* 加粗边框 */
    border-radius: 8px; /* 增大圆角 */
    padding: 20px; /* 增加内边距 */
    background: #f9f9f9;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15); /* 增强阴影 */
    position: relative;
}

.stock-header {
    font-weight: bold;
    margin-bottom: 15px; /* 增加间距 */
    color: #333;
    border-bottom: 2px solid #eee; /* 加粗边框 */
    padding-bottom: 10px; /* 增加内边距 */
    font-size: 18px; /* 增大字体 */
}

.stock-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px; /* 增加间距 */
    font-size: 15px; /* 增大字体 */
    margin-bottom: 15px; /* 增加间距 */
}

.stock-info span:nth-child(odd) {
    font-weight: bold;
}

.stock-info span:nth-child(even) {
    padding: 3px 6px; /* 增加内边距 */
    border-radius: 4px; /* 增大圆角 */
    transition: background-color 0.3s;
}

/* 涨跌颜色 */
.positive {
    color: #00a800;
}
.negative {
    color: #ff0000;
}

/* 股票链接样式 */
.stock-header-link {
    display: inline;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
    padding-bottom: 2px;
}

.stock-header-link:hover {
    color: #4CAF50;
    border-bottom-color: transparent;
}

/* 计算过程 */
.calculation-process {
    font-family: monospace;
    font-size: 14px; /* 增大字体 */
    line-height: 1.5; /* 增加行高 */
    background: #f0f0f0;
    padding: 15px; /* 增加内边距 */
    border-radius: 6px; /* 增大圆角 */
    margin-top: 15px; /* 增加间距 */
    min-height: 250px; /* 增加最小高度 */
}

/* 监控按钮容器 */
.monitor-btn-container {
    margin: 15px 0; /* 增加间距 */
    text-align: right;
    padding: 0 10px; /* 增加内边距 */
}

/* 监控按钮基础样式 */
.monitor-btn, .reset-btn, .cancel-btn {
    /*padding: 12px 24px;*/ /* 增大内边距 */
    padding: 10px 20px; /* 增大内边距 */
    border-radius: 6px; /* 增大圆角 */
    font-size: 16px; /* 增大字体 */
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent; /* 加粗边框 */
    font-weight: 500;
}

/* 可点击状态（绿色） */
.active {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.active:hover {
    background-color: #45a049;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 监控中状态（红色） */
.monitored {
    background-color: #f44336;
    color: white;
    border-color: #f44336;
}

.monitored:hover {
    background-color: #d32f2f;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
	border-color: #d32f2f;
	cursor: not-allowed;
}

.hidden { display: none; }

/* 监控页面特定样式 */
.monitored-stocks {
    display: flex;
    flex-direction: column;
    gap: 20px; /* 增加间距 */
}

/* 隐藏状态 */
.stock-card.monitored {
    border-left: 4px solid #f44336;
}

.remove-btn {
    background-color: #f44336;
    color: white;
    padding: 10px 16px; /* 增大内边距 */
    border: none;
    border-radius: 6px; /* 增大圆角 */
    cursor: pointer;
    margin-top: 15px; /* 增加间距 */
    font-size: 16px; /* 增大字体 */
}

.remove-btn:hover {
    background-color: #d32f2f;
}

/* 策略对比表格 */
.monitor-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px; /* 增大字体 */
    text-align: center;
}

.monitor-sell-header {
    text-align: center !important;
}

/* 表格单元格样式 */
.monitor-buy-label {
    padding: 12px 8px; /* 增加内边距 */
    font-weight: 600;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    text-align: center;
    line-height: 1.4;
    word-break: break-word;
}

.monitor-buy-price {
    padding: 5px 8px; /* 增加内边距 */
    font-weight: 600;
    border: 1px solid #dee2e6;
    background: #f0f8ff;
}

.monitor-sell-price {
    padding: 5px 6px; /* 增加内边距 */
    min-width: 100px; /* 增加最小宽度 */
    border: 1px solid #dee2e6;
    vertical-align: middle;
}
.sub-time {
    font-size: 0.7em;
    color: #666;
    margin-top: 2px;
    display: block;
}

/* 监控表格样式 */
.monitor-table-caption {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: bold;
    padding: 15px 20px 5px; /* 增加内边距 */
    font-size: 1.4rem; /* 增大字体 */
    color: #333;
    border-bottom: none !important;
    margin: 0;
    background: #f8f9fa;
}

.monitor-comparison-table th {
    font-weight: bold;
    background: #f8f9fa;
    padding: 12px 10px; /* 增加内边距 */
    border: 1px solid #dee2e6;
    line-height: 1.4;
    font-size: 15px; /* 增大字体 */
}

/* 监控页面 caption 行左右布局 */
.monitor-table-caption {
    display: flex;
    justify-content: space-between;  /* 左右对齐 */
    align-items: center;
}

.caption-left {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.caption-right button {
    /*margin-left: 12px;*/
    margin-left: 8px;
}


.monitor-buy-label,
.monitor-buy-price,
.monitor-sell-price {
    font-weight: normal;
}

/* 价格颜色方案 */
.monitor-price-higher,
.monitor-price-diff.higher { color: #00a800; }
.monitor-price-lower,
.monitor-price-diff.lower { color: #ff0000; }

.monitor-table-wrapper {
    margin: 0;
    margin-top: 15px; /* 增加间距 */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/*
.monitor-table-wrapper:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}*/

.monitor-corner-cell,
.monitor-price-header {
    min-width: 90px !important; /* 增加最小宽度 */
    word-break: break-word;
}

.monitor-price-diff {
    font-size: 13px; /* 增大字体 */
    margin-top: 3px; /* 增加间距 */
    line-height: 1.3;
}

/* 实时指标行样式 */
.realtime-indicators {
    display: flex;
    align-items: flex-end;
    gap: 20px; /* 增加间距 */
    padding: 10px 20px 15px; /* 增加内边距 */
    background: #f8f9fa;
    font-size: 15px; /* 增大字体 */
    flex-wrap: wrap;
    min-height: 50px; /* 增加最小高度 */
}

.indicator-group {
    display: flex;
    align-items: flex-end;
    gap: 6px; /* 增加间距 */
    height: 100%;
    min-width: 100px; /* 增加最小宽度 */
}

.realtime-indicators .prev-close {
    min-width: 130px; /* 增加最小宽度 */
}

.realtime-indicators .real-time-price {
    font-size: 32px; /* 增大字体 */
}

.indicator-label {
    color: #6c757d;
    font-weight: 600;
    min-height: 30px; /* 增加最小高度 */
}

.indicator-value {
    font-weight: 600;
    color: #212529;
    min-height: 30px; /* 增加最小高度 */
}

.indicator-change {
    min-height: 30px; /* 增加最小高度 */
}

/* 价格颜色指示 */
.price-up { color: #00a800; }
.price-down { color: #ff0000; }

/* 最高/最低价颜色标识 */
.high-price { color: #00a800; }
.low-price { color: #ff0000; }

/* Top3盈利单元格样式 */
.top-profit-cell {
    position: relative;
    overflow: hidden;
    background-color: rgba(255, 215, 0, 0.1) !important;
}

.top-profit-cell::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    z-index: -1;
    opacity: 0.15;
}

.top-profit-cell.top-1::after {
    background-color: #00a800;
}

.top-profit-cell.top-2::after {
    background-color: #ffc107;
}

.top-profit-cell.top-3::after {
    background-color: #17a2b8;
}

/* 登录页面 */
.login-container {
    max-width: 480px; /* 增加最大宽度 */
    margin: 120px auto; /* 增加外边距 */
    padding: 30px; /* 增加内边距 */
    background-color: #fff;
    border-radius: 10px; /* 增大圆角 */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); /* 增强阴影 */
}

.login-container h1 {
    text-align: center;
    margin-bottom: 30px; /* 增加间距 */
    font-size: 28px; /* 增大字体 */
}

.form-group {
    margin-bottom: 20px; /* 增加间距 */
}

.form-group label {
    display: block;
    margin-bottom: 8px; /* 增加间距 */
    font-size: 16px; /* 增大字体 */
    font-weight: 500;
    color: #333;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px; /* 增大内边距 */
    border: 2px solid #ddd; /* 加粗边框 */
    border-radius: 6px; /* 增大圆角 */
    box-sizing: border-box;
    font-size: 16px; /* 增大字体 */
	transition: border-color 0.2s ease;
}

/* 表单组样式优化 */
.form-group input:focus, .form-group select:focus {
    border-color: #4CAF50;
    outline: none;
}

.login-btn {
    width: 100%;
    padding: 14px; /* 增大内边距 */
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px; /* 增大圆角 */
    cursor: pointer;
    font-size: 18px; /* 增大字体 */
}

.login-btn:hover {
    background-color: #45a049;
}

/* Toast消息 */
.toast-message {
    position: fixed;
    bottom: 30px; /* 增加间距 */
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 16px 32px; /* 增大内边距 */
    border-radius: 8px; /* 增大圆角 */
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1000;
    font-size: 16px; /* 增大字体 */
}

.toast-message.show {
    opacity: 1;
}

/* 市场开放提醒弹窗 */
.market-alert {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.market-alert .alert-content {
    background-color: white;
    padding: 30px; /* 增加内边距 */
    border-radius: 10px; /* 增大圆角 */
    max-width: 450px; /* 增加最大宽度 */
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2); /* 增强阴影 */
    text-align: center;
}

.market-alert h3 {
    color: #4CAF50;
    margin-top: 0;
    font-size: 24px; /* 增大字体 */
}

.market-alert button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px; /* 增大内边距 */
    border-radius: 6px; /* 增大圆角 */
    cursor: pointer;
    margin-top: 20px; /* 增加间距 */
    font-size: 16px; /* 增大字体 */
}

.market-alert button:hover {
    background-color: #45a049;
}

/* 动画效果 */
@keyframes valueFlash {
    0% { background-color: transparent; }
    50% { background-color: #fffacd; }
    100% { background-color: transparent; }
}

.value-changed {
    animation: valueFlash 1s ease-in-out;
}

/* 多表格布局样式 */
#tables-container {
    display: flex;
    flex-direction: column;
    gap: 30px; /* 增加间距 */
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .monitor-table-caption {
        font-size: 1.2rem; /* 调整字体大小 */
    }
}

@media (max-width: 768px) {
    body {
        font-size: 14px; /* 调整移动端基础字体 */
    }
    
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: auto;
        padding: 15px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.4rem;
    }
    
    .stock-card {
        min-width: 100%;
    }
    
    .username-display {
        max-width: 100px;
    }
    
    .strategy-select {
        width: 180px;
        font-size: 14px;
    }
    
    .common-btn {
        font-size: 14px;
        padding: 10px 16px;
    }
    
    .realtime-indicators {
        gap: 12px 15px;
    }
    
    .indicator-group {
        min-width: 80px;
    }
    
    .monitor-table-caption {
        white-space: normal;
        text-overflow: clip;
        font-size: 1.1rem;
    }
    
    #tables-container {
        gap: 20px;
    }
    
    .monitor-table-wrapper {
        border-radius: 6px;
    }
}

/* 遮罩层样式 */
#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;  /* 垂直居中 */
  justify-content: center; /* 水平居中 */
  z-index: 9999;
}

.overlay-content {
  background: #fff;
  padding: 20px 40px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 0 15px rgba(0,0,0,0.3);
}

/* loading 转圈圈 */
.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 15px auto;
  border: 4px solid #ddd;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}



/* 回测页面特定样式 */
.table-container {
    margin: 20px 0;
    overflow-x: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
}

.backtest-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.backtest-table th {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: #333;
}

.backtest-table td {
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
    vertical-align: middle;
}

.backtest-table tr:hover {
    background-color: #f8f9fa;
}

.invalid-ticker {
    color: #dc3545 !important;
    font-weight: bold;
    text-decoration: line-through;
    cursor: help;
    position: relative;
}

.invalid-ticker:hover {
    text-decoration: underline;
}

/* 可选：添加工具提示 */
.invalid-ticker:hover::after {
    content: "Invalid ticker - no data available";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

/* 操作按钮样式 */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.icon-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #666;
    width: 32px;
    height: 32px;
}

.icon-btn:hover {
    background-color: #f5f5f5;
    border-color: #999;
    color: #333;
    transform: translateY(-1px);
}

.icon-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.icon-btn:disabled:hover {
    background: none;
    border-color: #ddd;
    color: #666;
    transform: none;
}

.icon-btn.view-details:hover {
    background-color: #e3f2fd;
    border-color: #2196f3;
    color: #2196f3;
}

.icon-btn.download-report:hover {
    background-color: #e8f5e8;
    border-color: #4caf50;
    color: #4caf50;
}

.icon-btn.delete-backtest:hover {
    background-color: #ffebee;
    border-color: #f44336;
    color: #f44336;
}

/* 状态标签样式 - 优化版本 */
.status-completed {
    color: #00a800;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
    background-color: #e8f5e8;
}

.status-running {
    color: #ff9800;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
    background-color: #fff3e0;
}

.status-failed {
    color: #f44336;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
    background-color: #ffebee;
}

.status-unknown {
    color: #666;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
    background-color: #f5f5f5;
}

/* 分页样式 */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 10px 0;
}

.pagination-left, .pagination-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 添加分页信息字体大小调整 */
/*#pageInfo {
    font-size: 16px;
    color: #666;
    margin: 0 10px;
}*/
.page-info {
    font-size: 16px;
    color: #666;
    margin: 0 10px;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* 调整模态框样式以适应更大的输入区域 */
.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* 详情页面样式 */
.backtest-info {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.backtest-id-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.backtest-id-link:hover {
    text-decoration: underline;
}



/* 时间选择框样式 */
input[type="time"] {
    font-family: Arial, sans-serif;
    font-size: 16px;
}

/* 时间选择框的特定样式 */
input[type="time"]:invalid {
    border-color: #f44336;
}

input[type="time"]:valid {
    border-color: #4CAF50;
}


/* 时间输入框验证样式 */
#backtestTime {
    border-color: #ddd !important;
}

#backtestTime:valid,
#backtestTime:invalid {
    border-color: #ddd !important;
}

#backtestTime:focus {
    border-color: #4CAF50 !important;
}



/* Backtest详情页面特定样式 */
.backtest-info-section {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
    font-size: 15px;
}

.backtest-id-header {
    display: flex;
    align-items: center;
    padding: 4px 0 10px;
    border-bottom: 2px solid #ddd;
    margin-bottom: 12px;
}

.backtest-id-label {
    font-weight: 700;
    color: #333;
    font-size: 1.4rem;
    margin-right: 10px;
}

.backtest-id-value {
    color: #007bff;
    font-weight: 700;
    font-size: 1.4rem;
}

.backtest-other-info {
    width: 100%;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    align-items: center;
    padding: 4px 0;
    font-size: 14px;
    flex: 1;
    min-width: 150px;
}

.info-item.status-item {
    justify-content: flex-end;
    min-width: 120px;
}

.info-label {
    font-weight: 600;
    color: #333;
    margin-right: 8px;
    white-space: nowrap;
}

.info-value {
    color: #666;
    font-weight: 500;
    font-size: 14px;
}

.info-value.status-completed {
    color: #00a800;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    background-color: #e8f5e8;
    font-size: 13px;
}

.info-value.status-running {
    color: #ff9800;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    background-color: #fff3e0;
    font-size: 13px;
}

.info-value.status-failed {
    color: #f44336;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    background-color: #ffebee;
    font-size: 13px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .info-row {
        gap: 15px;
    }
    
    .info-item {
        min-width: 130px;
    }
}

@media (max-width: 768px) {
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .info-item {
        min-width: 100%;
        justify-content: flex-start;
    }
    
    .info-item.status-item {
        justify-content: flex-start;
    }
}

.input-label {
    font-size: 18px;
    margin-right: 4px;  /* 控件前有一点间距 */
    vertical-align: middle; /* 与控件对齐 */
    color: #333; /* 和其他文字统一颜色 */
}

/* Backtest页面-股票代码输入框样式 */
.symbols-textarea {
    width: 100%;
    min-height: 150px;
    max-height: 400px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 16px;
    line-height: 1.5;
    resize: vertical;
    box-sizing: border-box;
    overflow-y: auto;
}

.symbols-textarea:focus {
    outline: none;
    border-color: #4CAF50;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.symbols-textarea::placeholder {
    color: #999;
    font-size: 14px;
    line-height: 1.4;
}

/* Backtest页面-符号计数器 */
.symbol-counter {
    font-size: 14px;
    color: #28a745;
    font-weight: 500;
    text-align: right;
}


/* 确保模态框在移动设备上也合适 */
@media (max-width: 768px) {
    .modal-content {
        width: 90%;
        margin: 20px;
    }
    
    .symbols-textarea {
        min-height: 150px;
        font-size: 14px;
    }
}

/* Remark 字符计数器 */
.remark-counter {
    font-size: 13px;
    color: #6c757d;
    margin-top: 5px;
    text-align: right;
}

.remark-counter.warning {
    color: #ff9800;
}

.remark-counter.danger {
    color: #f44336;
    font-weight: 500;
}



/* ================ Top Gainer 页面新增 filter 样式 ================ */
/* 第一行：日期、下拉框、按钮 */
.filter-row-1 {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 15px; /* 与第二行间距 */
}

/* 第二行：参数输入框组 */
.filter-row-2 {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

/* 参数组通用样式 */
.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #f9f9f9;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid #ddd;
    flex: 0 1 auto; /* 不强制拉伸，允许收缩 */
}

.filter-group .input-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.filter-group input.filter-number {
    width: 120px;
    padding: 8px 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.filter-group input.filter-number:focus {
    border-color: #4CAF50;
    outline: none;
}

/* Market Cap 复合组特殊处理 */
.market-cap-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 响应式调整 */
@media (max-width: 1400px) {
    .filter-group input.filter-number {
        width: 80px;
    }
}

@media (max-width: 1200px) {
    .filter-row-2 .filter-group {
        flex: 1 1 200px; /* 允许换行后每组占一定宽度 */
    }
    .filter-group input.filter-number {
        width: 100%;
    }
    .market-cap-group {
        flex-wrap: wrap;
    }
}

/* 确保原有按钮和输入框高度一致 */
.filter-row-1 .common-input-field,
.filter-row-1 .common-btn {
    height: 42px; /* 与 filter-group 内输入框高度匹配 */
    box-sizing: border-box;
}


/* ================ 全局通用样式 ================ */
.dash {
    font-weight: normal;
    color: #777;
    margin: 0 2px;
    flex-shrink: 0;
}


/* ================ Settings 页面样式 ================ */
/* ================ Top Gainer Settings 页面样式 ================ */
.tab-container {
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
    display: flex;
    gap: 5px;
}
.tab-button {
    padding: 12px 24px;
    background-color: #f5f5f5;
    border: 2px solid #ddd;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}
.tab-button:hover {
    background-color: #e0e0e0;
}
.tab-button.tab-active {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}
.tab-content {
    display: none;
    padding: 20px;
    border: 2px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    background-color: #fff;
}
.tab-content.tab-active {
    display: block;
}

/* Filter 区域新布局 */
.filter-section {
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    background-color: #f9f9f9;
}
.filter-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}
.filter-row:last-child {
    margin-bottom: 0;
}
.filter-item {
    flex: 1 1 0;
    min-width: 150px;
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.filter-label {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    font-size: 15px;
    width: 120px; /* 固定宽度，保证所有标签对齐 */
    flex-shrink: 0; /* 防止缩小 */
}
.filter-item input {
    flex: 1;
    padding: 8px 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    min-width: 0;
}
.filter-item input:focus {
    border-color: #4CAF50;
    outline: none;
}
.filter-item input:disabled {
    background-color: #f0f0f0;
    color: #666;
    cursor: not-allowed;
}
/* Market Cap 复合样式 */
.market-cap-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.market-cap-item .filter-label {
    flex-shrink: 0;
}
.market-cap-item input {
    flex: 1 1 0;
    min-width: 80px;
}
.action-buttons-settings {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}
.hidden {
    display: none !important;
}



/* ================ Report Settings 页面样式 ================ */
.report-settings-container {
    padding: 20px;
    background-color: #fff;
    border-radius: 6px;
}

.setting-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.setting-label {
    width: 180px;
    font-weight: 600;
    color: #333;
    font-size: 15px;
    white-space: nowrap;
}

/* 内联辅助文本样式（与输入框文字大小一致） */
.inline-text {
	font-weight: 600;
    color: #333;
    font-size: 15px;
	margin-top: 6px;
}

/* 单输入框样式 */
.setting-item input[type="text"] {
    width: 280px;  /* 增大输入框宽度 */
    padding: 8px 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.setting-item input[type="text"]:focus {
    border-color: #4CAF50;
    outline: none;
}

.setting-item input[type="text"]:disabled {
    background-color: #f0f0f0;
    color: #666;
    cursor: not-allowed;
}

/* 双输入框容器（用于范围参数） */
.setting-item .range-inputs {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 280px;  /* 与单输入框同宽 */
}

.setting-item .range-inputs input {
    flex: 1;               /* 平分容器宽度 */
    min-width: 0;          /* 防止溢出 */
    width: auto;           /* 覆盖原有的固定宽度 */
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .setting-item {
        flex-wrap: wrap;
    }
    .setting-label {
        width: 100%;
        margin-bottom: 8px;
    }
    .setting-item input[type="text"],
    .setting-item .range-inputs {
        width: 100%;       /* 窄屏时占满 */
    }
}