body {
    font-family: Arial, sans-serif;
    margin: 10px;
    background: #f5f5f5;
}
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
    box-sizing: border-box;
}

/* 响应式头部 */
.header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

/* 响应式日历 */
.calendar {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 10px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto;
}

/* 响应式统计卡片 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

@media (min-width: 576px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .stats-cards {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* 图表容器样式 */
.charts-container, .charts-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .charts-container, .charts-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 图表项样式 */
.chart-item, .chart-container, .chart-large {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    height: 400px; /* 固定高度 */
    position: relative; /* 添加相对定位 */
}

.chart-item h3, .chart-container h3, .chart-large h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

/* 图表包装器样式 */
.chart-wrapper {
    position: relative;
    height: 300px; /* 固定高度 */
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.chart-wrapper canvas,
.chart-item canvas {
    max-width: 100% !important;
    height: auto !important;
    max-height: 350px !important;
    box-sizing: border-box;
}

/* 股票统计表格样式 */
.stock-stats-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.stock-stats-tables {
    display: flex;
    flex-wrap: wrap; /* 允许在小屏幕上换行 */
    gap: 20px;
    width: 100%;
}

.stock-stats-table {
    flex: 1;
    min-width: 250px; /* 设置最小宽度 */
    max-width: 100%; /* 限制最大宽度 */
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.stock-stats-table th,
.stock-stats-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.stock-stats-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.stock-stats-table tbody tr:hover {
    background: #f8f8f8;
}

.stock-stats-table .symbol {
    font-weight: 600;
    color: #2962ff;
}

.stock-stats-table .profit {
    color: #2e7d32;
}

.stock-stats-table .loss {
    background-color: white;
    color: #c62828;
}

/* 统计卡片样式 */
.stat-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

/* 添加头部控件容器样式 */
.header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-icon, .fullscreen-btn {
    cursor: pointer;
}

/* 响应式调整 */
@media (max-width: 767px) {
    .stat-modal-content {
        width: 95%;
        padding: 15px;
    }
    
    .stat-modal .chart-wrapper {
        height: 300px;
    }
}

.fullscreen-btn {
    cursor: pointer;
    color: #666;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.fullscreen-btn:hover {
    background-color: rgba(0,0,0,0.1);
}

/* 全屏模态框样式 */
.stat-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.stat-modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.stat-modal .close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}

/* 全屏图表样式 */
.stat-modal .chart-wrapper {
    height: 500px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-value.positive {
    color: #2ecc71;
}

.stat-gauge {
    display: flex;
    height: 20px;
    border-radius: 2px;
    overflow: hidden;
    width: 100%;
}

/* 修改子元素样式，不再使用flex属性固定比例 */
.win { 
    background: #2ecc71; 
    height: 100%;
    /* 宽度将通过JavaScript动态设置 */
}
.neutral { 
    background: #95a5a6; 
    height: 100%;
    /* 宽度将通过JavaScript动态设置 */
}
.loss { 
    background: #e74c3c; 
    height: 100%;
    /* 宽度将通过JavaScript动态设置 */
}

/* 回撤部分样式 */
.drawdown-section {
    display: flex;
    gap: 20px;
}

.drawdown-chart {
    flex: 1;
}

/* 图表统计部分样式 */
.chart-item stats-section {
    margin-bottom: 20px;
}

.chart-item stats-section h4 {
    margin-bottom: 10px;
    color: #333;
}

.chart-item stats-list {
    list-style: none;
    padding: 0;
}

.chart-item stats-list li {
    padding: 8px 0;
    border-bottom: 1px solid #ddd;
}

.chart-item stats-list li:last-child {
    border-bottom: none;
}

/* GitHub链接样式 */
.github-link {
    position: fixed;
    bottom: 20px;
    left: 20px;
    color: #24292e;
    opacity: 0.7;
    transition: opacity 0.2s;
    z-index: 1000;
}

.github-link:hover {
    opacity: 1;
}

/* 交易详情样式 */
.trades-details {
    max-height: 500px;
    overflow-y: auto;
    margin: 20px 0;
}

.trades-table th,
.trades-table td {
    padding: 8px 12px;
    text-align: left;
}

.trades-table tr:hover {
    background-color: #f5f5f5;
}

/* 按钮样式 */
button {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    transition: background 0.2s;
}

button:hover {
    background: #2980b9;
}

button svg {
    width: 16px;
    height: 16px;
}

.cancel-button {
    background: #95a5a6;
}

.cancel-button:hover {
    background: #7f8c8d;
}

.details-button {
    background: #3498db;
}

.details-button:hover {
    background: #2980b9;
}

.close-button {
    background: transparent;
    color: #333;
    font-size: 24px;
    position: absolute;
    right: 10px;
    top: 10px;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.close-button:hover {
    background: rgba(0,0,0,0.1);
}

/* 工具栏样式 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.toolbar-left, .toolbar-right {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 767px) {
    .toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .toolbar-right {
        margin-top: 10px;
        width: 100%;
        justify-content: space-between;
    }
    
    button {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card {
        padding: 10px;
    }
    
    .stat-header {
        font-size: 12px;
    }
    
    .stat-value {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }
}

/* 日历样式 */
#calendar {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    margin-top: 20px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.calendar-header {
    font-weight: bold;
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.calendar-day {
    min-height: 100px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.calendar-day:hover {
    transform: scale(1.02);
}

/* 日历头部样式 */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.chart-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

/* 图表全屏模态框样式 */
.chart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.chart-modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 1200px;
    height: 80vh;
    overflow-y: auto;
    position: relative;
}

.chart-modal .close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}

.chart-modal .chart-wrapper {
    width: 100%;
    height: 65vh;
    position: relative;
}

.chart-modal canvas {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
}

/* 响应式调整 */
@media (max-width: 767px) {
    .chart-modal-content {
        width: 95%;
        padding: 15px;
        height: 90vh;
    }
    
    .chart-modal .chart-wrapper {
        height: 60vh;
    }
}

.month-navigation {
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.month-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.trading-day {
    background: rgba(46, 204, 113, 0.1);
    border-left: 3px solid #2ecc71;
}

.negative {
    background: rgba(231, 76, 60, 0.1);
    border-left: 3px solid #e74c3c;
}

.trade-info {
    margin-top: 5px;
    font-size: 0.9em;
    color: #555;
}

.week-summary {
    min-height: 100px;
    padding: 10px;
    background: #eaeaea;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    text-align: center;
}

/* 添加weekly统计的正负数颜色 */
.week-summary .positive {
    color: #2ecc71;
}

.week-summary .negative {
    color: #e74c3c;
}

/* 日期选择器样式 */
.date-picker-container {
    position: relative;
}

.date-range-picker {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 100;
    min-width: 300px;
}

.date-range-picker.active {
    display: block;
}

.date-picker-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.date-picker-group input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Go按钮样式 */
.go-button {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.go-button:hover {
    background: #2980b9;
}

.preset-dates {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.preset-dates button {
    width: 100%;
    justify-content: center;
}

/* 符号过滤器样式 */
.symbol-filter-container {
    position: relative;
    margin-left: 10px;
}

.combobox-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.symbol-input {
    padding: 8px;
    border: none;
    outline: none;
    width: 150px;
    font-size: 14px;
}

.dropdown-toggle {
    padding: 8px;
    background: none;
    border: none;
    border-left: 1px solid #ddd;
    cursor: pointer;
}

.dropdown-toggle:hover {
    background: #f5f5f5;
}

.symbol-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 100;
    min-width: 300px;
}

.symbol-dropdown.active {
    display: block;
}

.symbol-option {
    padding: 8px;
    cursor: pointer;
}

.symbol-option:hover {
    background: #f5f5f5;
}

/* 弹框样式 - 默认隐藏 */
#tradeModal, #importModal, #r2ConfigModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色背景 */
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content, .trade-modal-content, .import-modal-content, .r2-config-modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    position: relative;
    margin: auto; /* 确保居中 */
    margin-top: 100px;
    width: 100%;
    max-width: 800px; /* 限制最大宽度 */
}

.import-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: #666;
}

.form-group input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.broker-select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.connect-button {
    padding: 12px;
    background: #5D5FEF;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* 当弹框显示时的样式 */
#tradeModal.show, #importModal.show, #r2ConfigModal.show {
    display: flex;
}

/* 移动设备上的日期选择器 */
@media (max-width: 767px) {
    .date-range-picker {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 350px;
    }
    
    .date-picker-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .date-picker-group input {
        width: 100%;
    }
}

/* 通配符选项样式 */
.wildcard-option {
    background-color: #f0f8ff; /* 浅蓝色背景 */
    font-weight: 500;
}

.wildcard-hint {
    font-size: 0.8em;
    color: #666;
    margin-left: 5px;
}