* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
}

.left-panel {
    flex: 2;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.calendar-header h2 {
    font-size: 24px;
    color: #333;
}

.calendar-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.month-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.month-selector label {
    font-size: 14px;
    color: #666;
}

.month-selector select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: white;
}

.date-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-selector button {
    background: #f0f0f0;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.date-selector button:hover {
    background: #e0e0e0;
}

.date-selector span {
    font-size: 18px;
    font-weight: bold;
}

/* 日历样式 */
.calendar {
    margin-bottom: 30px;
}

#calendarContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.month-container {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #e9ecef;
}

.month-title {
    text-align: center;
    margin-bottom: 15px;
}

.month-title h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    margin-bottom: 10px;
}

.weekday {
    padding: 10px;
    text-align: center;
    font-weight: bold;
    background: #f8f9fa;
    color: #666;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e9ecef;
}

.calendar-day {
    background: white;
    border: 1px solid #e9ecef;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    transition: all 0.2s ease;
}

.calendar-day:hover {
    background: #f8f9fa;
}

.calendar-day.today {
    background: #333;
    color: white;
}

.calendar-day.other-month {
    background: #f8f9fa;
    color: #ccc;
}

.calendar-day.has-record {
    border: 2px solid;
}

.calendar-day.has-record.profit {
    border-color: #28a745;
    background: #f8fff9;
}

.calendar-day.has-record.loss {
    border-color: #dc3545;
    background: #fff8f8;
}

.day-number {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 16px;
}

.day-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-profit {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

.day-profit.positive {
    color: #28a745;
}

.day-profit.negative {
    color: #dc3545;
}



.profit-positive {
    color: #28a745;
}

.profit-negative {
    color: #dc3545;
}


/* 右侧面板样式 */
.total-profit {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.total-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.total-amount {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 20px;
}

.profit-chart {
    margin-top: 20px;
}

.win-rate {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.win-rate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.win-rate-label {
    font-size: 14px;
    color: #666;
}

.win-rate-value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.win-loss-ratio {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.ratio-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.ratio-label {
    font-size: 14px;
    color: #666;
}

.ratio-value {
    font-size: 18px;
    font-weight: bold;
}

.ratio-chart {
    text-align: center;
    margin-top: 20px;
}

.historical-ratio {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.historical-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.historical-value {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.historical-bar {
    display: flex;
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.bar-positive {
    background: #28a745;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.bar-negative {
    background: #dc3545;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.risk-reward {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.risk-reward h3 {
    margin-bottom: 15px;
    color: #333;
}

.risk-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.risk-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.risk-label {
    font-size: 12px;
    color: #666;
}

.risk-value {
    font-size: 14px;
    font-weight: bold;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 15px;
}

.close:hover {
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group textarea {
    resize: vertical;
}

.form-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.form-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}

.form-buttons button[type="submit"] {
    background: #007bff;
    color: white;
}

.form-buttons button[type="submit"]:hover {
    background: #0056b3;
}

.form-buttons button[type="button"] {
    background: #6c757d;
    color: white;
}

.form-buttons button[type="button"]:hover {
    background: #545b62;
}

.form-buttons button#deleteBtn {
    background: #dc3545;
}

.form-buttons button#deleteBtn:hover {
    background: #c82333;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .container {
        flex-direction: column;
        padding: 10px;
        gap: 15px;
    }
    
    .left-panel {
        padding: 15px;
    }
    
    .right-panel {
        gap: 15px;
    }
    
    /* 日历头部移动端优化 */
    .calendar-header {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 15px;
    }
    
    .calendar-header h2 {
        font-size: 20px;
    }
    
    .calendar-controls {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .month-selector {
        justify-content: center;
    }
    
    .month-selector select {
        padding: 10px;
        font-size: 16px;
        min-width: 120px;
    }
    
    .date-selector {
        justify-content: center;
        gap: 15px;
    }
    
    .date-selector button {
        padding: 12px 16px;
        font-size: 18px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .date-selector span {
        font-size: 16px;
    }
    
    /* 多月份布局移动端优化 */
    #calendarContainer {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .month-container {
        padding: 12px;
    }
    
    .month-title h3 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    /* 日历移动端优化 */
    .calendar-weekdays {
        gap: 1px;
        margin-bottom: 8px;
    }
    
    .weekday {
        padding: 10px 4px;
        font-size: 11px;
        font-weight: 600;
    }
    
    .calendar-days {
        grid-template-columns: repeat(7, 1fr);
        gap: 1px;
        background: #e9ecef;
    }
    
    .calendar-day {
        min-height: 85px;
        padding: 8px 4px;
        font-size: 12px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        /* 改善触摸体验 */
        touch-action: manipulation;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
        border-radius: 0;
    }
    
    .calendar-day:active {
        background: #e9ecef;
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .day-number {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 4px;
        text-align: center;
    }
    
    .day-content {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .day-profit {
        font-size: 9px;
        line-height: 1.1;
        text-align: center;
        font-weight: 600;
        word-break: break-all;
    }
    
    
    
    
    /* 右侧面板移动端优化 */
    .total-profit,
    .win-rate,
    .win-loss-ratio,
    .historical-ratio,
    .risk-reward {
        padding: 15px;
    }
    
    .total-amount {
        font-size: 24px;
    }
    
    .win-rate-value {
        font-size: 20px;
    }
    
    .ratio-value {
        font-size: 16px;
    }
    
    .historical-value {
        font-size: 18px;
    }
    
    /* 模态框移动端优化 */
    .modal-content {
        margin: 10px;
        padding: 20px;
        width: calc(100% - 20px);
        max-width: none;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }
    
    .form-group label {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px;
        font-size: 16px;
        border-radius: 8px;
        box-sizing: border-box;
        /* 防止iOS缩放 */
        -webkit-appearance: none;
    }
    
    .form-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-buttons button {
        padding: 12px 20px;
        font-size: 16px;
        min-height: 44px;
        border-radius: 8px;
    }
    
    .close {
        font-size: 32px;
        right: 20px;
        top: 20px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .container {
        padding: 5px;
    }
    
    .left-panel {
        padding: 10px;
    }
    
    .calendar-day {
        min-height: 75px;
        padding: 6px 2px;
    }
    
    .day-number {
        font-size: 14px;
    }
    
    .day-profit {
        font-size: 8px;
        line-height: 1.0;
    }
    
    .weekday {
        padding: 8px 2px;
        font-size: 9px;
    }
    
    .total-amount {
        font-size: 20px;
    }
    
}

/* 资金管理样式 */
.fund-management {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.fund-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.fund-input-group label {
    font-weight: bold;
    min-width: 60px;
}

.fund-input-group input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.fund-input-group button {
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.fund-input-group button:hover {
    background: #0056b3;
}

.fund-display {
    margin-bottom: 15px;
}

.fund-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.fund-label {
    font-weight: bold;
    color: #666;
}

.fund-value {
    font-weight: bold;
}

/* 分析报告样式 */
.analysis-report {
    max-width: 1400px;
    margin: 20px auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.report-header h2 {
    font-size: 24px;
    color: #333;
    margin: 0;
}

.report-controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: white;
}

.report-content {
    padding: 20px;
}

/* 核心指标概览 */
.metrics-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    border-left: 4px solid #007bff;
}

.metric-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.metric-value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.metric-value.positive {
    color: #28a745;
}

.metric-value.negative {
    color: #dc3545;
}

/* 图表区域 */
.charts-section {
    margin-bottom: 30px;
}

.chart-container {
    margin-bottom: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.chart-container h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.chart-container canvas {
    display: block;
    margin: 0 auto;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    background: white;
}

/* 详细统计表格 */
.detailed-stats {
    margin-top: 30px;
}

.detailed-stats h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stats-table th,
.stats-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.stats-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #495057;
}

.stats-table td {
    color: #333;
}

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

/* 移动端响应式增强 */
@media (max-width: 768px) {
    .metrics-overview {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .fund-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .fund-input-group label {
        min-width: auto;
    }

    .chart-container canvas {
        max-width: 100%;
        height: auto;
    }

    .report-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .analysis-report {
        margin: 10px;
    }

    .report-content {
        padding: 15px;
    }
}

/* 交易日志样式 */
.trading-logs-section {
    max-width: 1400px;
    margin: 20px auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.logs-header h2 {
    font-size: 24px;
    color: #333;
    margin: 0;
}

.add-log-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}

.add-log-btn:hover {
    background: #0056b3;
}

.logs-container {
    padding: 20px;
    max-height: 600px;
    overflow-y: auto;
}

.no-logs {
    text-align: center;
    color: #666;
    font-size: 16px;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
}

.log-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #007bff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.log-timestamp {
    color: #666;
    font-size: 14px;
}

.log-actions {
    display: flex;
    gap: 10px;
}

.edit-log-btn, .delete-log-btn {
    padding: 5px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
}

.edit-log-btn {
    background: #28a745;
    color: white;
}

.edit-log-btn:hover {
    background: #218838;
}

.delete-log-btn {
    background: #dc3545;
    color: white;
}

.delete-log-btn:hover {
    background: #c82333;
}

.log-content {
    color: #333;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
    white-space: pre-wrap;
}

.log-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.log-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.log-image:hover {
    border-color: #007bff;
    transform: scale(1.05);
}

/* 日志模态框样式 */
.log-modal-content {
    max-width: 700px;
    width: 90%;
}

.image-upload-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.select-images-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.select-images-btn:hover {
    background: #0056b3;
}

.upload-hint {
    color: #666;
    font-size: 12px;
}

.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.image-preview-item {
    position: relative;
    display: inline-block;
}

.image-preview-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.remove-image-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.remove-image-btn:hover {
    background: #c82333;
}

/* 图片放大预览模态框 */
.image-view-modal {
    z-index: 2000;
}

.image-view-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    margin: 5vh auto;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-view-content .close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 32px;
    z-index: 10;
}

.image-view-content .close:hover {
    color: #ccc;
}

#enlargedImage {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.nav-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* 移动端样式优化 */
@media (max-width: 768px) {
    .trading-logs-section {
        margin: 10px;
    }

    .logs-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .logs-header h2 {
        font-size: 20px;
    }

    .log-item {
        padding: 15px;
    }

    .log-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .log-content {
        font-size: 14px;
    }

    .log-images {
        justify-content: center;
    }

    .log-image {
        width: 80px;
        height: 80px;
    }

    .log-modal-content {
        width: 95%;
        max-width: none;
        margin: 10px;
    }

    .image-upload-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .image-preview-item img {
        width: 80px;
        height: 80px;
    }

    .image-view-content {
        margin: 2vh auto;
        max-height: 96vh;
    }

    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

