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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #121212;
    min-height: 100vh;
    padding: 20px;
    color: #e0e0e0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #1e1e1e;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #e0e0e0;
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid #333;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* 股票信息面板 */
.stock-info {
    padding: 30px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    position: relative;
}

.stock-info::after {
    content: '💡 点击K线图查看历史数据';
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 0.8em;
    color: #666;
    font-style: italic;
}

.main-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.price-label {
    font-size: 1.2em;
    color: #666;
}

.price-value {
    font-size: 3em;
    font-weight: bold;
    color: #259e41;
}

.price-unit {
    font-size: 1.5em;
    color: #888;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.info-item {
    background: #2d2d2d;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
}

.info-label {
    font-size: 0.9em;
    color: #888;
    margin-bottom: 5px;
}

.info-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3d3d3d;
    color: #666;
    font-size: 13px;
    font-weight: bold;
    cursor: help;
    transition: all 0.3s;
    border: 1px solid #444;
    font-family: Arial, sans-serif;
}

.info-icon:hover {
    background: #259e41;
    color: white;
    border-color: #259e41;
    transform: scale(1.15);
}

.info-icon::before {
    content: '!';
}

.info-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: rgba(30, 30, 30, 0.98);
    color: #e0e0e0;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    white-space: normal;
    width: 220px;
    text-align: left;
    line-height: 1.6;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
    border: 1px solid #444;
}

.info-icon:hover::after {
    opacity: 1;
    visibility: visible;
}

.info-value {
    font-size: 1.3em;
    font-weight: bold;
    color: #e0e0e0;
}

.info-value.danger {
    color: #ff2e2c;
}

.info-value.success {
    color: #259e41;
}

.info-value.highlight {
    color: #4a9eff;
}

/* 图表区域 */
.chart-section {
    padding: 30px;
    border-bottom: 1px solid #333;
}

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

.chart-header h2 {
    font-size: 1.5em;
    color: #e0e0e0;
}

.chart-controls {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-label {
    font-size: 0.9em;
    color: #888;
    font-weight: 600;
}

.chart-container {
    position: relative;
    height: 400px;
}

/* K线图容器显示抓取光标 */
.chart-container:first-of-type {
    cursor: grab;
}

.chart-container:first-of-type:active {
    cursor: grabbing;
}

.chart-container.small {
    height: 250px;
}

/* 输入表单 */
.input-section {
    padding: 30px;
    background: #1a1a1a;
}

.data-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #aaa;
    font-size: 0.95em;
    display: block;
}

.form-group label input[type="checkbox"] {
    margin-right: 8px;
    width: auto;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px;
    border: 2px solid #444;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
    background: #2d2d2d;
    color: #e0e0e0;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #259e41;
    background: #3d3d3d;
}

.form-group.checkbox-group {
    display: flex;
    align-items: center;
}

.form-group.checkbox-group label {
    display: flex;
    align-items: center;
    margin: 0;
    cursor: pointer;
    font-size: 0.95em;
}

.form-group.checkbox-group label input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    cursor: pointer;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

/* 按钮 */
.btn {
    padding: 12px 24px;
    border: 1px solid #444;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    background: #2d2d2d;
    color: #e0e0e0;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    background: #3d3d3d;
}

.btn-primary {
    background: linear-gradient(135deg, #259e41 0%, #1e7d34 100%);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2db84a 0%, #259e41 100%);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85em;
}

.ma-btn {
    min-width: 60px;
}

.ma-btn.active {
    background: #259e41;
    color: white;
    border-color: #259e41;
}

/* 重置缩放按钮 */
.btn[onclick="resetZoom()"] {
    background: linear-gradient(135deg, #4a9eff 0%, #2d7dd2 100%);
    border: none;
    color: white;
}

.btn[onclick="resetZoom()"]:hover {
    background: linear-gradient(135deg, #5aa9ff 0%, #3d8be8 100%);
}

.ma-btn.active {
    background: #259e41;
    color: white;
    border-color: #259e41;
}

.btn.active {
    background: #259e41;
    color: white;
    border-color: #259e41;
}

.btn-danger {
    background: #ff2e2c;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #e62826;
}

/* 数据管理 */
.data-management {
    padding: 30px;
    text-align: center;
    background: #1a1a1a;
}

.data-management h2 {
    margin-bottom: 20px;
}

.management-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* 研报区域 */
.report-section {
    padding: 30px;
    background: #1a1a1a;
}

.report-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    border: 2px solid #259e41;
    background: #2d2d2d;
    color: #259e41;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #259e41;
    color: white;
}

.report-content {
    display: none;
}

.report-content.active {
    display: block;
}

.report-content h3 {
    margin-bottom: 15px;
    color: #333;
}

#weeklyReportContent,
#monthlyReportContent {
    background: #2d2d2d;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    color: #e0e0e0;
}

/* 历史数据表格 */
.history-section {
    padding: 30px;
    background: #1a1a1a;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #2d2d2d;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

thead {
    background: linear-gradient(135deg, #259e41 0%, #1e7d34 100%);
    color: white;
}

th, td {
    padding: 15px;
    text-align: left;
    color: #e0e0e0;
}

tbody tr {
    border-bottom: 1px solid #444;
}

tbody tr:hover {
    background: #3d3d3d;
}

tbody tr:last-child {
    border-bottom: none;
}

.delete-btn {
    background: #ff2e2c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
}

.delete-btn:hover {
    background: #e62826;
}

.mark-divestment {
    display: inline-block;
    padding: 2px 6px;
    background: #259e41;
    color: white;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: bold;
    margin-right: 3px;
}

.mark-dividend {
    display: inline-block;
    padding: 2px 6px;
    background: #ff2e2c;
    color: white;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: bold;
    margin-right: 3px;
}

/* 报告样式 */
.rating-good {
    color: #259e41;
    font-weight: bold;
}

.rating-neutral {
    color: #f39c12;
    font-weight: bold;
}

.rating-bad {
    color: #ff2e2c;
    font-weight: bold;
}

.report-details p {
    margin: 10px 0;
}

.report-suggestion {
    margin-top: 15px;
    padding: 15px;
    background: #1e3d26;
    border-left: 4px solid #259e41;
    border-radius: 5px;
}

.monthly-summary p,
.monthly-review p,
.next-month-plan li {
    margin: 10px 0;
}

.next-month-plan {
    margin-top: 15px;
}

.next-month-plan ul {
    margin-left: 20px;
}

/* 时间线样式 */
.timeline-container {
    position: relative;
    padding: 20px 0;
    max-height: 600px;
    overflow-y: auto;
}

.timeline-container::-webkit-scrollbar {
    width: 8px;
}

.timeline-container::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 4px;
}

.timeline-container::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.timeline-container::-webkit-scrollbar-thumb:hover {
    background: #777;
}

.timeline-item {
    position: relative;
    padding-left: 50px;
    margin-bottom: 30px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 40px;
    bottom: -30px;
    width: 2px;
    background: #333;
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-marker {
    position: absolute;
    left: 8px;
    top: 5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid #1e1e1e;
    z-index: 1;
}

.timeline-marker.success {
    background: #259e41;
}

.timeline-marker.danger {
    background: #ff2e2c;
}

.timeline-content {
    background: #2d2d2d;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #444;
}

.timeline-header h4 {
    margin: 0;
    color: #e0e0e0;
    font-size: 1.1em;
}

.timeline-rating {
    padding: 4px 12px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9em;
}

.timeline-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 0.85em;
    color: #888;
}

.stat-value {
    font-size: 1em;
    font-weight: bold;
    color: #e0e0e0;
}

.timeline-review {
    padding: 12px;
    background: #1a1a1a;
    border-left: 3px solid #259e41;
    border-radius: 5px;
    margin-top: 10px;
}

.timeline-review p {
    margin: 0;
    color: #ccc;
    font-size: 0.95em;
    line-height: 1.5;
}

.text-green {
    color: #259e41;
    font-weight: bold;
}

.text-red {
    color: #ff2e2c;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chart-controls {
        flex-direction: column;
        gap: 10px;
    }

    .control-group {
        flex-wrap: wrap;
        justify-content: center;
    }

    .control-label {
        width: 100%;
        text-align: center;
        margin-bottom: 5px;
    }
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 1em;
    }

    .stock-info,
    .chart-section,
    .input-section,
    .data-management,
    .report-section,
    .history-section {
        padding: 20px;
    }

    .price-value {
        font-size: 2em;
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-container {
        height: 300px;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .management-buttons {
        flex-direction: column;
    }

    table {
        font-size: 0.9em;
    }

    th, td {
        padding: 10px;
    }
}

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

    .chart-controls {
        width: 100%;
    }

    .chart-controls button {
        flex: 0 0 auto;
        min-width: 50px;
        font-size: 0.75em;
        padding: 6px 10px;
    }
}

/* 补录模式样式 */
#toggleModeBtn {
    transition: all 0.3s;
}

#toggleModeBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(74, 158, 255, 0.3);
}

/* 补录模式下的提示 */
#modeHint {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}
