/* 基础样式 */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --gray-color: #95a5a6;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* 固定头部样式 */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* 头部样式 */
.header {
    /* background: linear-gradient(135deg, var(--primary-color), #1a2530); */
    background: linear-gradient(135deg, #8e44ad, #3498db, #2c3e50);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo .logo-image {
    width: 48px;
}

.logo h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #01bef3;
}

/* 返回链接 */
.back-link {
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    margin-right: 10px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

.back-link:hover {
    color: var(--secondary-color);
}

/* 主内容区域 */
main {
    padding: 30px 0;
    flex: 1;
}

section {
    margin-bottom: 40px;
}

h2 {
    font-size: 1.6rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

h2 i {
    color: var(--secondary-color);
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

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

.stat-header h3 {
    font-size: 1.1rem;
    color: var(--gray-color);
    font-weight: 500;
}

.stat-header i {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-value.positive {
    color: var(--success-color);
}

.stat-value.negative {
    color: var(--danger-color);
}

.stat-note {
    font-size: 0.9rem;
    color: var(--gray-color);
}

.stat-change {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    margin-top: 10px;
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--danger-color);
}

/* 周报列表样式 */
.weekly-reports-section {
    margin-bottom: 40px;
}

.reports-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.report-card {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.report-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--secondary-color);
}

.report-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.report-date {
    color: var(--gray-color);
    font-size: 0.9rem;
}

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

.report-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.report-stat:last-child {
    border-bottom: none;
}

.report-stat-label {
    font-size: 0.95rem;
    color: var(--gray-color);
}

.report-stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

.report-stat-value.positive {
    color: var(--success-color);
}

.report-stat-value.negative {
    color: var(--danger-color);
}

/* 周报详情页样式 */
.week-header {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 30px;
    margin-top: 130px;
    margin-bottom: 30px;
    box-shadow: var(--box-shadow);
    text-align: center;
}

.week-title {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.week-subtitle {
    font-size: 1.2rem;
    color: var(--gray-color);
}

/* 持仓概览样式 */
.holdings-list-container {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
}

.holdings-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.holding-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid var(--secondary-color);
}

.holding-name {
    font-weight: 500;
    color: var(--primary-color);
}

.holding-weight {
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 1.1rem;
}

/* 交易表格样式 */
.table-container {
    overflow-x: auto;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: var(--primary-color);
    color: white;
}

th {
    padding: 16px 5px;
    text-align: left;
    font-weight: 600;
}

tbody tr {
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: #f9f9f9;
}

td {
    padding: 5px;
}

/* 交易类型徽章 */
.badge {
    display: inline-block;
    padding: 0px;
   
}

.badge.buy {
    color:  var(--danger-color);
}

.badge.sell {
    color: var(--success-color);
}

/* 导航按钮 */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    margin-bottom: 30px;
    gap: 20px;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background-color: white;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.3s;
    border: 2px solid #e0e0e0;
    font-size: 1rem;
    flex: 1;
    max-width: 200px;
}

.nav-btn:hover {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.nav-btn:disabled, .nav-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.prev-btn {
    text-align: left;
}

.next-btn {
    text-align: right;
}

/* 加载动画 */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--gray-color);
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 15px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-color);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #ddd;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

/* 页脚样式 */
.footer {
    background-color: var(--primary-color);
    color: white;
    padding: 30px 0;
    margin-top: auto;
    width: 100%;
}

.footer .container {
    text-align: center;
}

.footer-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.disclaimer {
    font-size: 0.9rem;
    color: #bdc3c7;
    max-width: 800px;
    margin: 0 auto;
}
.friend-link {
    font-size: 0.9rem;
    color: #bdc3c7;
    max-width: 800px;
    margin: 0 auto;
}
.friend-link a {
    color: #bdc3c7;
    text-decoration:none;
}
.friend-link a:hover {
    color: #27ae60;
}
.runtime-counter {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #ecf0f1;
}

.time-unit {
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 3px;
    margin: 0 2px;
}

.days {
    color: #3498db;
}

.hours {
    color: #2ecc71;
}

.minutes {
    color: #f39c12;
}

.seconds {
    color: #e74c3c;
}

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

.view-all {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s;
}

.view-all:hover {
    color: #2980b9;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .holdings-list {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .date-info {
        align-items: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .reports-list {
        grid-template-columns: 1fr;
    }
    
    .report-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .report-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .report-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .navigation-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-btn {
        max-width: 100%;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .holdings-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .holdings-list {
        grid-template-columns: 1fr;
    }
    
    .logo h1 {
        font-size: 1.4rem;
    }
    
    .week-title {
        font-size: 1.6rem;
    }
    
    .report-stats {
        grid-template-columns: 1fr;
    }
}