/* 在 app.css 中添加以下样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f6fa;
    color: #333;
    line-height: 1.6;
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 导航栏样式 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
}

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

.user-info {
    font-size: 14px;
    font-weight: 500;
    margin-right: 10px;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-primary {
    background-color: #8264ee;
    color: white;
}

.btn-primary:hover {
    background-color: #7d41ad;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #7451aa;
    color: white;
}

.btn-secondary:hover {
    background-color: #7d41ad;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid #7452ac;
    color: #642cbf;
}

.btn-outline:hover {
    background-color: #7d41ad;
    color: white;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

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

/* 主内容区域 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 100px);
}

/* 未登录状态样式 */
.logged-out {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    text-align: center;
}

.logged-out-content {
    max-width: 500px;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.logged-out-content h2 {
    color: #333;
    margin-bottom: 15px;
}

.logged-out-content p {
    color: #666;
    margin-bottom: 25px;
}

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

/* 认证页面样式 */
.login-container,
.register-container {
    display: flex;
    min-height: 100vh;
}

.login-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.register-container {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
}

.login-left,
.register-left {
    flex: 1;
    display: none;
}

.login-right,
.register-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background: white;
}

.login-form-container,
.register-form-container {
    width: 100%;
}

.login-form-container {
    max-width: 400px;
}

.register-form-container {
    max-width: 450px;
}

.login-logo,
.register-logo {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo h1,
.register-logo h1 {
    color: #333;
    margin-bottom: 10px;
}

.login-logo p,
.register-logo p {
    color: #666;
}

.login-form,
.register-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-form .form-group input,
.register-form .form-group input {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.login-form .form-group input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.register-form .form-group input:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.remember-me {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.remember-me input {
    margin-right: 10px;
    width: auto;
}

.remember-me label {
    margin-bottom: 0;
    color: #666;
    font-weight: normal;
}

.password-requirements {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.login-btn,
.register-btn {
    width: 100%;
    padding: 12px;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-btn {
    background: #667eea;
}

.login-btn:hover {
    background: #5a67d8;
}

.register-btn {
    background: #4299e1;
}

.register-btn:hover {
    background: #3182ce;
}

.login-btn:disabled,
.register-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

.login-footer,
.register-footer {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.login-footer a {
    color: #667eea;
}

.register-footer a {
    color: #4299e1;
}

.login-footer a,
.register-footer a {
    text-decoration: none;
    margin-left: 5px;
}

.login-footer a:hover,
.register-footer a:hover {
    text-decoration: underline;
}

.error-message {
    color: #e53e3e;
    background: #fed7d7;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: none;
}

.success-message {
    color: #38a169;
    background: #c6f6d5;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: none;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

@media (min-width: 768px) {
    .login-left,
    .register-left {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        color: white;
        padding: 40px;
    }

    .login-left h2,
    .register-left h2 {
        font-size: 2.5rem;
        margin-bottom: 20px;
    }

    .login-left p,
    .register-left p {
        font-size: 1.2rem;
        opacity: 0.9;
    }
}

/* 已登录页面样式 */
.funds-page {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.page-title h2 {
    margin: 0;
    color: #2d3748;
}

.page-subtitle {
    margin: 5px 0 0 0;
    color: #718096;
    font-size: 14px;
}

.page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

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

.page-subheader h3 {
    margin: 0;
    color: #2d3748;
}

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

/* 基金卡片样式 */
.fund-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

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

.fund-title .fund-code {
    margin: 0 0 5px 0;
    color: #2d3748;
    font-size: 18px;
}

.fund-name {
    margin: 0;
    color: #2d3748;
    font-size: 14px;
}

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

.fund-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.fund-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #f7fafc;
}

.fund-detail-row:last-child {
    border-bottom: none;
}

.fund-detail-row .label {
    color: #718096;
    font-size: 13px;
}

.fund-detail-row .value {
    color: #2d3748;
    font-weight: 500;
}

/* 刷新按钮加载状态 */
#refreshPortfolioBtn.loading {
    position: relative;
    padding-left: 40px;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}


.price-arrow {
    display: inline-block;
    margin-right: 4px;
    font-weight: bold;
}


@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 消息提示样式 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    z-index: 10000;
    animation: slideIn 0.3s ease;
    max-width: min(400px, calc(100vw - 32px));
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.message.info {
    background: #4299e1;
}

.message.success {
    background: #48bb78;
}

.message.error {
    background: #f56565;
}

.message.warning {
    background: #ed8936;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    padding: 20px 30px;
}

.modal-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #2d3748;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #718096;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.close-btn:hover {
    color: #4a5568;
}

.modal-body {
    padding: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

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

/* 搜索相关样式 */
.search-container {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-results.show {
    display: block;
}

.search-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f7fafc;
    transition: background-color 0.2s;
}

.search-item:hover {
    background-color: #f7fafc;
}

.search-item:last-child {
    border-bottom: none;
}

.fund-name {
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 2px;
}

.fund-code {
    font-size: 12px;
    color: #718096;
}

.search-loading,
.search-empty,
.search-error {
    padding: 15px;
    text-align: center;
    color: #718096;
    font-size: 14px;
}

.search-note {
    padding: 10px 15px;
    border-top: 1px solid #e2e8f0;
    color: #718096;
    font-size: 12px;
    text-align: center;
}

/* 投资组合概览样式 */
.portfolio-summary {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.summary-section {
    margin-bottom: 30px;
}

.simplified-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.summary-item {
    background: #f8f9fa;
    padding: 1.5rem 1rem;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #8264ee;
}

.summary-item label {
    display: block;
    color: #718096;
    font-size: 14px;
    margin-bottom: 5px;
}

.summary-item .value {
    font-size: 24px;
    font-weight: 600;
}

.summary-item.greeting-item {
    display: flex;
    align-items: center;
    justify-content: center;
}

.greeting-text {
    font-size: 18px;
    font-weight: 500;
}

.red{
    color: red;
}

.profit-positive {
    color: #e53e3e;
}

.profit-negative {
    
    color: #38a169;
}

.valuation-section {
    margin-bottom: 30px;
}

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

.valuation-item {
    padding: 15px;
    border-radius: 8px;
}

.valuation-item.low-valuation {
    background: #c6f6d5;
    border: 1px solid #38a169;
}

.valuation-item.high-valuation {
    background: #fed7d7;
    border: 1px solid #e53e3e;
}

.valuation-item h5 {
    margin: 0 0 10px 0;
    color: #2d3748;
}

.fund-codes {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.fund-code-tag {
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
}

.funds-details-section {
    margin-top: 30px;
}

.funds-details-section h4 {
    margin: 0 0 15px 0;
    color: #2d3748;
}

.funds-table-container {
    overflow-x: auto;
}

.funds-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 10px;
}

.funds-table th,
.funds-table td {
    padding: 8px 12px;
    text-align: center;
    border: 1px solid #dee2e6;
}

.funds-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #4a5568;
    position: sticky;
    top: 0;
    z-index: 10;
}

.funds-table td {
    border-bottom: 1px solid #e2e8f0;
}

.funds-table tr:hover,
.funds-table tbody tr:hover {
    background: #f7fafc;
}

.funds-table .fund-code {
    font-family: monospace;
    font-weight: 600;
}

.funds-table .fund-name {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.no-funds {
    text-align: center;
    padding: 40px;
    color: #718096;
}

.no-funds-hint {
    margin-top: 10px;
    font-size: 14px;
    color: #a0aec0;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #718096;
    font-style: italic;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .page-actions {
        justify-content: center;
        flex-wrap: wrap;
    }

    .page-actions .btn {
        flex: 1 1 calc(50% - 10px);
        min-width: 140px;
    }

    .message {
        left: 16px;
        right: 16px;
        top: 16px;
        max-width: none;
    }

    .fund-details {
        grid-template-columns: 1fr;
    }

    .simplified-summary-grid {
        grid-template-columns: 1fr;
    }

    .valuation-grid {
        grid-template-columns: 1fr;
    }

    .funds-table th,
    .funds-table td {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* 页面加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}


/* 可选的额外样式增强 */
.funds-table td.profit-positive,
.funds-table td.profit-negative {
    font-weight: 600; /* 加粗显示 */
}

.funds-table td.profit-positive {
    background-color: rgba(229, 62, 62, 0.05); /* 淡红色背景 */
}

.funds-table td.profit-negative {
    background-color: rgba(56, 161, 105, 0.05); /* 淡绿色背景 */
}

/* 鼠标悬停效果 */
.funds-table tr:hover td.profit-positive {
    background-color: rgba(229, 62, 62, 0.1);
}

.funds-table tr:hover td.profit-negative {
    background-color: rgba(56, 161, 105, 0.1);
}


        /* 新增图表模态框专用样式 */
#chartModalContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1100; /* 比普通模态框更高的层级 */
}

#chartModalContainer.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 图表模态框可以比普通模态框更大 */
.trend-modal .modal-content {
    width: 92%;
    max-width: 1400px;
    max-height: 92vh;
    overflow-y: auto;
    height: auto;
}

.chart-modal .trend-chart-container {
    height: 500px;
}

/* 调整关闭按钮位置，使其更明显 */
.chart-modal .close-btn {
    position: absolute;
    right: 15px;
    top: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 10;
}

.chart-modal .close-btn:hover {
    background: rgba(0, 0, 0, 0.2);
}

.trend-chart-container {
    width: 100%;
    height: 300px;  /* 移动端默认高度 */
}

.trend-chart-container canvas {
    display: block; /* 确保 block 显示 */
    box-sizing: border-box;
    width: 100% !important;
    height: 100% !important;
}

/* =============================================
   移动端基金卡片样式
   ============================================= */

/* 桌面/移动端显示切换 */
/* 移动端/桌面端显示切换 */
.mobile-only { display: none !important; }

/* desktop-only 不强制 display 值，避免覆盖元素自身的 flex/grid */
@media (max-width: 768px) {
    /* 通用mobile-only恢复显示，flex容器单独覆盖 */
    .mobile-only                     { display: block !important; }
    .mobile-only.fund-cards-list     { display: flex !important; }
    .mobile-only.summary-mobile-grid { display: grid !important; }
    .desktop-only                    { display: none !important; }
}

/* 卡片列表容器 */
.fund-cards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px 0;
}

/* 单张卡片 */
.fund-mobile-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* 数据获取失败状态 */
.fund-mobile-card--unavailable {
    border-color: #fed7d7;
    background: #fff5f5;
}

/* 卡片头部：名称 + 涨跌幅 */
.fmc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #f0f0f0;
}

.fmc-title {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0; /* 防止长名称撑破布局 */
}

.fmc-name {
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fmc-code {
    font-size: 12px;
    color: #a0aec0;
    font-family: monospace;
}

.fmc-change {
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    margin-left: 12px;
    text-align: right;
}

/* 核心数据行：今日收益 / 总收益 / 收益比例 */
.fmc-key-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 12px 16px;
    gap: 8px;
    background: #fafbfc;
}

.fmc-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.fmc-metric-label {
    font-size: 11px;
    color: #718096;
}

.fmc-metric-value {
    font-size: 15px;
    font-weight: 600;
}

/* 次要数据行：净值、成本 */
.fmc-sub-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 10px 16px;
    gap: 8px;
    border-top: 1px solid #f0f0f0;
}

.fmc-sub-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.fmc-sub-label {
    font-size: 11px;
    color: #a0aec0;
}

.fmc-sub-value {
    font-size: 13px;
    color: #4a5568;
    font-weight: 500;
}

/* 卡片底部：操作按钮 */
.fmc-footer {
    padding: 10px 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.fmc-trend-btn {
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 20px;
    background: #f0eeff;
    color: #6b46c1;
    border: 1px solid #d6bcfa;
    font-weight: 500;
}

.fmc-trend-btn:hover {
    background: #e9d8fd;
}

.fmc-no-trend {
    font-size: 12px;
    color: #a0aec0;
}

/* 移动端按钮触控区域增大 */
@media (max-width: 768px) {
    .page-actions .btn {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 40px;
    }

    .funds-details-section h4 {
        font-size: 15px;
        margin-bottom: 12px;
    }
}

/* =============================================
   移动端趋势图适配
   ============================================= */
@media (max-width: 768px) {
    /* 模态框撑满屏幕，便于阅读 */
    .trend-modal .modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    /* 图表区域在手机上给固定高度，不随内容撑开 */
    .trend-chart-container {
        height: 220px;
    }

    /* 模态框标题字号缩小 */
    .trend-modal .modal-header h3 {
        font-size: 14px;
        line-height: 1.4;
    }

    /* 数据表格在手机上字号缩小，列宽紧凑 */
    .trend-data-summary table {
        font-size: 12px;
    }

    .trend-data-summary th,
    .trend-data-summary td {
        padding: 6px 8px;
    }
}

@media (min-width: 769px) {
    /* 桌面端图表给更大高度 */
    .trend-chart-container {
        height: 420px;
    }
}

/* =============================================
   移动端汇总区域 2 卡片样式
   ============================================= */
.summary-mobile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;          /* 撑满父容器宽度 */
    box-sizing: border-box;
}

.summary-mobile-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 14px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border-top: 3px solid #8264ee;
    min-width: 0;         /* 防止内容撑破网格列 */
}

.smc-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.smc-label {
    font-size: 11px;
    color: #a0aec0;
}

.smc-value {
    font-size: 16px;
    font-weight: 700;
    color: #2d3748;
}

/* 颜色优先级：profit类覆盖smc-value默认色 */
.smc-value.profit-positive { color: #dc3545; }
.smc-value.profit-negative { color: #28a745; }

.smc-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 10px 0;
}

.smc-greeting {
    align-items: center;
    text-align: center;
}

.smc-greeting .smc-value {
    font-size: 15px;
}

/* 自选基金页面样式 */
.watchlist-page {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.watchlist-summary {
    margin-bottom: 20px;
}

.watchlist-summary h3 {
    margin: 0;
    color: #2d3748;
    font-size: 18px;
}

.watchlist-table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    overflow-x: auto;
}

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

.funds-table th,
.funds-table td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.funds-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #4a5568;
    position: sticky;
    top: 0;
    z-index: 10;
}

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

.funds-table .fund-code {
    font-family: monospace;
    font-weight: 600;
}

.funds-table .fund-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.action-cell {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: nowrap;
}

.action-cell .btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    white-space: nowrap;
}

/* 持有状态标签 */
.holding-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    background-color: #e6f7ff;
    color: #1890ff;
}

.not-holding-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    background-color: #f5f5f5;
    color: #999;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .watchlist-table-container {
        overflow-x: scroll;
    }

    .funds-table {
        min-width: 900px;
    }
}

/* =============================================
   自选基金移动端卡片样式
   ============================================= */
.watchlist-cards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px 0;
}

.watchlist-mobile-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.wmc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #f0f0f0;
}

.wmc-title {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.wmc-name {
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wmc-code {
    font-size: 12px;
    color: #a0aec0;
    font-family: monospace;
}

.wmc-change {
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    margin-left: 12px;
    text-align: right;
}

.wmc-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 12px 16px;
    gap: 8px;
    background: #fafbfc;
}

.wmc-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.wmc-metric-label {
    font-size: 11px;
    color: #718096;
}

.wmc-metric-value {
    font-size: 14px;
    font-weight: 600;
}

.wmc-sub-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    padding: 10px 16px;
    gap: 8px;
    border-top: 1px solid #f0f0f0;
}

.wmc-sub-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.wmc-sub-label {
    font-size: 11px;
    color: #a0aec0;
}

.wmc-sub-value {
    font-size: 13px;
    color: #4a5568;
    font-weight: 500;
}

.wmc-footer {
    padding: 10px 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.wmc-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.wmc-tag--holding {
    background-color: #e6f7ff;
    color: #1890ff;
}

.wmc-tag--not-holding {
    background-color: #f5f5f5;
    color: #999;
}

/* 趋势数据移动端表格优化 */
@media (max-width: 768px) {
    .trend-data-summary {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .trend-data-summary table {
        min-width: 100%;
    }

    .trend-data-summary th,
    .trend-data-summary td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .trend-modal .modal-body {
        padding: 10px;
    }

    .trend-modal h4 {
        font-size: 14px;
        margin-bottom: 10px;
    }
}

/* 移动端趋势数据列表 */
.trend-mobile-list {
    background: #fafbfc;
    border-radius: 8px;
    overflow: hidden;
}

.trend-mobile-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    padding: 10px 12px;
    background: #f0f0f0;
    font-size: 12px;
    color: #718096;
    text-align: center;
}

.trend-mobile-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    text-align: center;
}

.trend-mobile-row:last-child {
    border-bottom: none;
}

.tmr-date {
    color: #4a5568;
}

.tmr-nav {
    color: #2d3748;
    font-weight: 500;
}

.tmr-growth {
    font-weight: 600;
}

.trend-mobile-more {
    text-align: center;
    padding: 8px;
    font-size: 12px;
    color: #a0aec0;
    background: #f5f5f5;
}