* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', Arial, sans-serif;
    background: hsl(210, 15%, 96%);
    min-height: 100vh;
    padding: 20px;
    color: hsl(210, 10%, 20%);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: hsl(210, 50%, 25%);
    margin-bottom: 30px;
    background: white;
    padding: 30px 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

header h1 {
    font-size: 2em;
    margin-bottom: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

header h1 i {
    width: 32px;
    height: 32px;
    color: hsl(210, 50%, 50%);
}

.subtitle {
    font-size: 1em;
    color: hsl(210, 10%, 45%);
}

.main-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
}

/* 侧边栏样式 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.add-fund-section,
.fund-list-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.add-fund-section h2,
.fund-list-section h2 {
    font-size: 1.1em;
    margin-bottom: 16px;
    color: hsl(210, 10%, 20%);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-fund-section h2 i,
.fund-list-section h2 i {
    width: 18px;
    height: 18px;
    color: hsl(210, 50%, 50%);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: hsl(210, 10%, 30%);
    font-size: 0.9em;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid hsl(210, 15%, 85%);
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s;
    background: white;
    color: hsl(210, 10%, 20%);
}

.form-group input:focus {
    outline: none;
    border-color: hsl(210, 50%, 50%);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: hsl(210, 50%, 50%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: hsl(210, 50%, 45%);
}

.btn-danger {
    padding: 8px 16px;
    background: hsl(0, 60%, 55%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: hsl(0, 60%, 50%);
}

/* 基金列表 */
.fund-list {
    max-height: 500px;
    overflow-y: auto;
}

.fund-item {
    padding: 15px;
    border: 1px solid hsl(210, 15%, 90%);
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.fund-item:hover {
    border-color: hsl(210, 50%, 70%);
    background: hsl(210, 50%, 98%);
}

.fund-item.active {
    border-color: hsl(210, 50%, 50%);
    background: hsl(210, 50%, 97%);
}

.fund-item-name {
    font-weight: 600;
    color: hsl(210, 10%, 20%);
    margin-bottom: 5px;
}

.fund-item-code {
    font-size: 0.85em;
    color: hsl(210, 10%, 45%);
    margin-bottom: 8px;
}

.fund-item-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
}

.fund-item-amount {
    color: hsl(210, 10%, 30%);
}

.fund-item-profit {
    font-weight: 600;
}

.fund-item-profit.positive {
    color: hsl(0, 60%, 50%);
}

.fund-item-profit.negative {
    color: hsl(140, 50%, 40%);
}

/* 内容区域 */
.content-area {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 600px;
}

/* 汇总统计 */
.summary-section h2 {
    font-size: 1.3em;
    color: hsl(210, 10%, 20%);
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-section h2 i {
    width: 24px;
    height: 24px;
    color: hsl(210, 50%, 50%);
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: hsl(210, 15%, 98%);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid hsl(210, 15%, 92%);
}

.card-label {
    font-size: 0.9em;
    color: hsl(210, 10%, 45%);
    margin-bottom: 10px;
}

.card-value {
    font-size: 1.6em;
    font-weight: 700;
    color: hsl(210, 10%, 20%);
}

/* 基金详情 */
.detail-section h2 {
    font-size: 1.6em;
    color: hsl(210, 10%, 20%);
    margin-bottom: 5px;
    font-weight: 600;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid hsl(210, 15%, 90%);
}

.fund-code-display {
    color: hsl(210, 10%, 45%);
    font-size: 0.9em;
    margin-top: 5px;
}

.fund-info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: hsl(210, 15%, 98%);
    padding: 20px;
    border-radius: 8px;
    border-left: 3px solid hsl(210, 50%, 50%);
}

.info-label {
    font-size: 0.9em;
    color: hsl(210, 10%, 45%);
    margin-bottom: 10px;
}

.info-value {
    font-size: 1.5em;
    font-weight: 700;
    color: hsl(210, 10%, 20%);
    margin-bottom: 5px;
}

.info-value.positive {
    color: hsl(0, 60%, 50%);
}

.info-value.negative {
    color: hsl(140, 50%, 40%);
}

.info-time {
    font-size: 0.8em;
    color: hsl(210, 10%, 50%);
}

.info-growth {
    font-size: 1em;
    font-weight: 600;
    margin-top: 5px;
}

.info-growth.positive {
    color: hsl(0, 60%, 50%);
}

.info-growth.negative {
    color: hsl(140, 50%, 40%);
}

/* 图表区域 */
.chart-section {
    margin-top: 30px;
    padding: 20px;
    background: hsl(210, 15%, 98%);
    border-radius: 8px;
    border: 1px solid hsl(210, 15%, 92%);
}

.chart-section h3 {
    font-size: 1.1em;
    color: hsl(210, 10%, 20%);
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-section h3 i {
    width: 20px;
    height: 20px;
    color: hsl(210, 50%, 50%);
}

#fundChart {
    max-height: 400px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: hsl(210, 10%, 50%);
}

.empty-icon {
    width: 64px;
    height: 64px;
    color: hsl(210, 10%, 60%);
    margin: 0 auto 20px;
}

.empty-state h3 {
    font-size: 1.3em;
    color: hsl(210, 10%, 35%);
    margin-bottom: 10px;
    font-weight: 600;
}

.empty-state p {
    font-size: 1em;
    color: hsl(210, 10%, 50%);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: 2;
    }
    
    .content-area {
        order: 1;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .summary-cards {
        grid-template-columns: 1fr;
    }
    
    .fund-info-cards {
        grid-template-columns: 1fr;
    }
}

/* 滚动条样式 */
.fund-list::-webkit-scrollbar {
    width: 6px;
}

.fund-list::-webkit-scrollbar-track {
    background: hsl(210, 15%, 95%);
    border-radius: 8px;
}

.fund-list::-webkit-scrollbar-thumb {
    background: hsl(210, 50%, 50%);
    border-radius: 8px;
}

.fund-list::-webkit-scrollbar-thumb:hover {
    background: hsl(210, 50%, 45%);
}

/* 安卓下载按钮样式 */
.android-download {
    position: absolute;
    top: 30px;
    right: 30px;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: hsl(140, 50%, 45%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.download-btn i {
    width: 18px;
    height: 18px;
}

.download-btn:hover {
    background: hsl(140, 50%, 40%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.qrcode-popup {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    z-index: 1000;
    min-width: 200px;
}

.android-download:hover .qrcode-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.qrcode-popup img {
    width: 180px;
    height: auto;
    display: block;
    margin: 0 auto 12px;
    border-radius: 4px;
}

.qrcode-password {
    text-align: center;
    color: hsl(210, 10%, 30%);
    font-size: 0.9em;
    margin: 0;
}

.qrcode-password strong {
    color: hsl(0, 60%, 50%);
    font-weight: 700;
    font-size: 1.1em;
    letter-spacing: 2px;
}
