/* 持仓页面样式 */
#holdPage {
    /*padding: 1px;*/
    background: white;
    min-height: 100vh;
}

.hold-container {
    max-width: 1200px;
    margin: 0 auto;
    margin-bottom: 100px;
}

/* 搜索区域 */
.search-section {
    background: white;
    border-radius: 12px;
    padding: 2px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.search-box-container {
    position: relative;
}

.search-input-group {
    display: flex;
    align-items: center;
    /*border: 1px solid #ddd;*/
    /*border-radius: 8px;*/
    padding: 0px 0px;
    transition: border-color 0.3s;
}

.search-input-group:focus-within {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24,144,255,0.1);
}

.search-icon {
    color: #999;
    margin-right: 44px;
    font-size: 16px;
}

.search-input {
    flex: 1;
    /*border: none;*/
    outline: none;
    font-size: 14px;
    color: #333;
    background: transparent;
    /*border: 1px solid #d9d9d9;*/
    /*border-radius: 8px;*/
}

/*.search-input {*/
/*    width: 100%;*/
/*    padding: 12px 20px 12px 40px;*/
/*    border: 1px solid #d9d9d9;*/
/*    border-radius: 8px;*/
/*    font-size: 16px;*/
/*    outline: none;*/
/*    transition: border-color 0.3s;*/
/*}*/

.search-input::placeholder {
    color: #999;
}

.btn-clear {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.btn-clear:hover {
    color: #666;
}

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

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

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.search-result-item:hover {
    background: #f5f5f5;
}

.search-result-info {
    flex: 1;
}

.search-result-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    margin-bottom: 2px;
}

.search-result-code {
    font-size: 12px;
    color: #999;
}

.search-result-add {
    color: #1890ff;
    font-size: 12px;
    white-space: nowrap;
}

.search-result-add:hover {
    color: #40a9ff;
}

/* 分组区域 */
.group-section {
    background: white;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

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

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.group-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.group-tab {
    padding: 6px 12px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.group-tab:hover {
    background: #e8e8e8;
}

.group-tab.active {
    background: #1890ff;
    color: white;
    border-color: #1890ff;
}

.group-tab-count {
    background: rgba(255,255,255,0.2);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 12px;
}

/* 汇总数据 */
.summary-section {
    margin-bottom: 20px;
}

.summary-cards {
    display: grid;
    /*grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));*/
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    /*text-align: center;*/
    /*border: 1px solid #f0f0f0;*/
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.summary-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.summary-value.positive {
    color: #f5222d;
}

.summary-value.negative {
    color: #52c41a;
}

/* 总资产卡片特殊样式 */
.total-assets-card {
    text-align: center;
    /*grid-column: 1 / -1; !* 占据整行 *!*/
    /*background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);*/
    color: white;
    position: relative;
    overflow: hidden;
}

.total-assets-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.total-assets-card .summary-label {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 12px;
    /*color: rgba(255,255,255,0.9);*/
    position: relative;
    z-index: 1;
}

.total-assets-card .summary-value {
    font-size: 36px;
    font-weight: 600;
    line-height: 1.2;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 收益卡片样式 */
.profit-card,
.today-card {
    text-align: center;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.profit-card .summary-label,
.today-card .summary-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    font-weight: 500;
}

/* 收益数值容器 */
.profit-value-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.profit-value {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.2;
}

.profit-rate {
    font-size: 16px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    transition: all 0.3s ease;
}

/* 正数样式 */
.profit-rate.positive {
    background: rgba(245, 34, 45, 0.1);
    color: #f5222d;
    border: 1px solid rgba(245, 34, 45, 0.2);
}

.profit-rate.positive::before {
    content: '▲';
    font-size: 12px;
    margin-right: 4px;
}

/* 负数样式 */
.profit-rate.negative {
    background: rgba(82, 196, 26, 0.1);
    color: #52c41a;
    border: 1px solid rgba(82, 196, 26, 0.2);
}

.profit-rate.negative::before {
    content: '▼';
    font-size: 12px;
    margin-right: 4px;
}

/* 零值样式 */
.profit-rate.zero {
    background: rgba(0,0,0,0.05);
    color: #333;
    border: 1px solid rgba(0,0,0,0.1);
}

.profit-rate.zero::before {
    content: '—';
    font-size: 12px;
    margin-right: 4px;
}

/* 当日收益卡片特殊样式 */
.today-card {
    /*border-top: 4px solid #1890ff;*/
}

.profit-card {
    /*border-top: 4px solid #722ed1;*/
}

/* 当日收益卡片中的今日收益日期提示 */
.today-date-hint {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
    display: none;
}

.today-date-hint.show {
    display: block;
}


/* 持仓列表 */
.holdings-section {
    background: white;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
}

.holdings-table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.holdings-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.holdings-table th {
    background: #fafafa;
    padding: 16px 5px;
    text-align: left;
    font-weight: 460;
    color: #333;
    border-bottom: 2px solid #e8e8e8;
    white-space: nowrap;
    position: relative;
    cursor: pointer;
    user-select: none;
}

.holdings-table th.sortable {
    padding-right: 40px;
}

.sort-arrow {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 20px;
    width: 20px;
}

.sort-icon {
    position: absolute;
    font-size: 12px;
    color: #999;
    transition: all 0.3s;
}

.sort-icon.fa-sort {
    top: 4px;
}

.sort-icon.fa-sort-up {
    top: 0;
}

.sort-icon.fa-sort-down {
    top: 8px;
}

.sortable[data-order="asc"] .fa-sort-up {
    display: block;
    color: #1890ff;
}

.sortable[data-order="asc"] .fa-sort-down,
.sortable[data-order="asc"] .fa-sort {
    display: none;
}

.sortable[data-order="desc"] .fa-sort-down {
    display: block;
    color: #1890ff;
}

.sortable[data-order="desc"] .fa-sort-up,
.sortable[data-order="desc"] .fa-sort {
    display: none;
}

.holdings-table td {
    padding: 16px 5px;
    border-bottom: 1px solid #e8e8e8;
    color: #333;
    font-size: 16px;
    text-align: left; /* 表格数据左对齐 */
}

.holdings-table tbody tr:hover {
    background-color: #fafafa;
}

.fund-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    min-width: 220px;
}

.fund-hold-name {
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1.4;
}

.fund-hold-name:hover {
    color: #1890ff;
}

.fund-hold-cursor {
    cursor: pointer;
}
.fund-amount {
    font-size: 12px;
    color: #999;
    line-height: 1.4;
}

.profit-cell {
    text-align: left;
    min-width:150px;
}

.today-profit,
.hold-profit {
    font-weight: 400;
    margin-bottom: 4px;
}

.today-change,
.hold-change {
    font-size: 12px;
}

.profit-cell.positive .today-profit,
.profit-cell.positive .hold-profit,
.profit-cell.positive .today-change,
.profit-cell.positive .hold-change {
    color: #f5222d;
}

.profit-cell.negative .today-profit,
.profit-cell.negative .hold-profit,
.profit-cell.negative .today-change,
.profit-cell.negative .hold-change {
    color: #52c41a;
}

.profit-cell.zero .today-profit,
.profit-cell.zero .hold-profit,
.profit-cell.zero .today-change,
.profit-cell.zero .hold-change {
    color: #333;
}

.nav-cell,
.date-cell,
.cost-cell,
.shares-cell {
    text-align: left;
    /*font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; !* 使用默认字体 *!*/
    line-height: 1.4;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    /*max-width: 500px;*/
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e8e8e8;
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
}

.fund-hold-info {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    /*background: #f8f9fa;*/
    border-radius: 8px;
}

.fund-hold-info .fund-hold-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.fund-hold-info .fund-hold-code {
    font-size: 14px;
    color: #999;
}

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

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

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24,144,255,0.1);
}

.form-hint {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.required {
    color: #f5222d;
    margin-left: 2px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e8e8e8;
}

/* 设置模态框 */
.settings-info {
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
}

.settings-list {
    max-height: 400px;
    overflow-y: auto;
}

.setting-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: border-color 0.3s;
    cursor: move;
}

.setting-item.dragging {
    background: #f8f9fa;
    border-style: dashed;
    border-color: #1890ff;
}

.setting-item:hover {
    border-color: #1890ff;
}

.setting-check {
    margin-right: 12px;
}

.setting-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.setting-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.setting-field input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.setting-field input:focus {
    border-color: #1890ff;
    outline: none;
}

.setting-delete {
    margin-left: 12px;
    color: #f5222d;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.setting-delete:hover {
    background: #fff2f0;
}

/* 分组列表 */
.groups-list {
    max-height: 400px;
    overflow-y: auto;
}

.group-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    margin-bottom: 12px;
}

.group-name {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.group-actions {
    display: flex;
    gap: 8px;
}

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

/* 空状态 */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #ccc;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #holdPage {
        padding: 10px;
    }

    .hold-container {
        padding: 0 0px;
    }

    .search-section,
    .holdings-section {
        padding: 2px;
    }

    .group-section {
        padding: 12px;
    }

    .summary-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .summary-card {
        padding: 15px;
    }

    .summary-label {
        font-size: 12px;
    }

    .summary-value {
        font-size: 16px;
    }

    .holdings-table th,
    .holdings-table td {
        padding: 12px 5px;
        font-size: 13px;
    }

    .modal-content {
        max-width: 100%;
        margin: 0 10px;
    }

    .modal-body {
        padding: 20px 15px;
    }

    .setting-content {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .group-tabs {
        flex-wrap: wrap;
    }

    .group-tab {
        padding: 6px 12px;
        font-size: 13px;
    }

    #holdEditGroupsModal .modal-content {
        max-width: 100%;
        margin: 0 10px;
    }

    .hold-group-item {
        padding: 10px 12px;
    }

    .hold-group-actions {
        opacity: 1;
    }

    .hold-action-btn {
        width: 36px;
        height: 36px;
    }

    .hold-delete-confirm {
        position: fixed;
        top: auto;
        bottom: 20px;
        left: 20px;
        right: 20px;
        transform: none;
        justify-content: center;
        margin-right: 0;
    }

    .hold-delete-confirm::after,
    .hold-delete-confirm::before {
        display: none;
    }

    .profit-card,
    .today-card {
        min-height: 100px;
    }

    .total-assets-card .summary-value {
        font-size: 28px;
    }

    .profit-value {
        font-size: 20px;
    }

    .profit-rate {
        font-size: 14px;
        padding: 3px 10px;
        min-width: 60px;
    }

    .section-header {
        display: flex; /* 启用弹性布局 */
        flex-direction: row; /* 水平排列 */
        justify-content: space-between; /* 两端对齐：标题居左，按钮组居右 */
        align-items: center; /* 垂直居中对齐 */
        width: 100%; /* 确保容器占满宽度以撑开布局 */
        box-sizing: border-box; /* 防止padding撑大盒子 */
        padding: 2px 4px; /* 保持与页面其他区域一致的左右间距 */
    }

    /* 调整按钮容器，确保它们在同一行 */
    .group-actions {
        display: flex;
        flex-direction: row;     /* 确保按钮是横向排列 */
        gap: 10px;               /* 按钮之间的间距，与原图保持一致 */
        flex-shrink: 0;          /* 防止按钮容器在空间不足时被压缩 */
    }

    /* 调整按钮宽度，使其在手机端更紧凑 */
    .group-actions .btn {
        width: auto;             /* 宽度自适应内容 */
        padding: 8px 16px;       /* 调整内边距，使按钮大小适中 */
        font-size: 14px;         /* 适当缩小字体 */
    }
}

@media (max-width: 480px) {
    .summary-card {
        padding: 16px 12px;
    }

    .total-assets-card .summary-label {
        font-size: 15px;
    }

    .total-assets-card .summary-value {
        font-size: 24px;
    }

    .profit-card .summary-label,
    .today-card .summary-label {
        font-size: 13px;
    }

    .profit-value {
        font-size: 18px;
    }

    .profit-rate {
        font-size: 13px;
    }

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

    .section-header {
        display: flex; /* 启用弹性布局 */
        flex-direction: row; /* 水平排列 */
        justify-content: space-between; /* 两端对齐：标题居左，按钮组居右 */
        align-items: center; /* 垂直居中对齐 */
        width: 100%; /* 确保容器占满宽度以撑开布局 */
        box-sizing: border-box; /* 防止padding撑大盒子 */
        padding: 2px 4px; /* 保持与页面其他区域一致的左右间距 */
    }

    /*.header-actions {*/
    /*    width: 100%;*/
    /*}*/

    /*.header-actions .btn {*/
    /*    flex: 1;*/
    /*    justify-content: center;*/
    /*}*/
    /* 调整按钮容器，确保它们在同一行 */
    .group-actions {
        display: flex;
        flex-direction: row;     /* 确保按钮是横向排列 */
        gap: 10px;               /* 按钮之间的间距，与原图保持一致 */
        flex-shrink: 0;          /* 防止按钮容器在空间不足时被压缩 */
    }

    /* 调整按钮宽度，使其在手机端更紧凑 */
    .group-actions .btn {
        width: auto;             /* 宽度自适应内容 */
        padding: 8px 16px;       /* 调整内边距，使按钮大小适中 */
        font-size: 14px;         /* 适当缩小字体 */
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* 响应式设计 */
@media (max-width: 992px) {
    .summary-cards {
        grid-template-columns: 1fr 1fr;
    }

    .total-assets-card {
        grid-column: 1 / -1;
    }

    .total-assets-card .summary-value {
        font-size: 32px;
    }

    .profit-value {
        font-size: 22px;
    }

    .profit-rate {
        font-size: 15px;
        min-width: 70px;
    }
}

.header-date {
    font-size: 11px;
    color: #999;
    font-weight: normal;
    margin-top: 2px;
    line-height: 1.3;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    opacity: 0.8;
    order: 2; /* 确保日期在排序图标下方 */
    width: 100%;
    text-align: left;
    padding-left: 0;
}

/* 持仓编辑分组模态框样式 */
#holdEditGroupsModal .modal-content {
    max-width: 500px;
    min-height: 300px;
}

#holdEditGroupsModal .modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* 操作提示 */
.hold-edit-tips {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 20px;
    padding: 10px 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #1890ff;
}

/* 分组列表容器 */
.hold-groups-list-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

/* 单个分组项 */
.hold-group-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.hold-group-item:hover {
    border-color: #d9d9d9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.hold-group-item.editing {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.hold-group-item.hold-default {
    background-color: #fafafa;
    border-color: #f0f0f0;
}

.hold-group-item.hold-default:hover {
    border-color: #f0f0f0;
    box-shadow: none;
}

.hold-group-item.hold-default .hold-group-input {
    background-color: transparent;
    color: #999;
    cursor: not-allowed;
}

/* 分组名称输入框 */
.hold-group-name {
    flex: 1;
    min-width: 0;
    margin-right: 10px;
}

.hold-group-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 15px;
    color: #333;
    background: white;
    padding: 10px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-family: inherit;
    border: 1px solid #e8e8e8;
}

.hold-group-input:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.hold-group-input:disabled {
    background-color: #f5f5f5;
    color: #999;
    border-color: #f0f0f0;
    cursor: not-allowed;
}

.hold-group-input.readonly {
    background-color: transparent;
    border-color: transparent;
    color: #333;
    cursor: default;
}

/* 操作按钮 */
.hold-group-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.hold-group-item:hover .hold-group-actions {
    opacity: 1;
}

.hold-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    background: white;
    color: #666;
    border: 1px solid #e8e8e8;
}

.hold-action-btn:hover {
    transform: scale(1.1);
}

.hold-action-btn:active {
    transform: scale(0.95);
}

.hold-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.hold-action-btn:disabled:hover {
    transform: none;
    background: white;
    color: #666;
    border-color: #e8e8e8;
}

.hold-edit-btn {
    color: #1890ff;
}

.hold-edit-btn:hover {
    background: #e6f7ff;
    border-color: #91d5ff;
    color: #096dd9;
}

.hold-edit-btn.editing {
    background: #1890ff;
    color: white;
    border-color: #1890ff;
}

.hold-delete-btn {
    color: #ff4d4f;
}

.hold-delete-btn:hover {
    background: #fff2f0;
    border-color: #ffccc7;
    color: #d9363e;
}

/* 空状态 */
.hold-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.hold-empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    color: #e8e8e8;
}

.hold-empty-state p {
    font-size: 16px;
    color: #666;
    margin-bottom: 8px;
}

.hold-empty-state .empty-hint {
    font-size: 13px;
    color: #999;
}

/* 删除确认提示 */
.hold-delete-confirm {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 1px solid #ffccc7;
    border-radius: 6px;
    padding: 8px 12px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
    margin-right: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.2s ease;
}

.hold-delete-confirm::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -6px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid #ffccc7;
}

.hold-delete-confirm::before {
    content: '';
    position: absolute;
    top: 50%;
    right: -5px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid white;
    z-index: 1;
}

.hold-delete-confirm span {
    font-size: 12px;
    color: #666;
}

.hold-delete-confirm-btn {
    background: #ff4d4f;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s;
    min-width: 40px;
}

.hold-delete-confirm-btn:hover {
    background: #d9363e;
}

.hold-delete-cancel-btn {
    background: #f5f5f5;
    color: #666;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s;
    min-width: 40px;
}

.hold-delete-cancel-btn:hover {
    background: #d9d9d9;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

td.date-cell {
    font-size: 14px;
}

.addFundColor {
    color: white;
    font-size: 13px;
}

/* 表单切换区域样式 */
.form-toggle-section {
    /*margin: 20px 3px;*/
    /*padding: 15px;*/
    /*background-color: #f8f9fa;*/
    /*border-radius: 8px;*/
    /*border: 1px solid #e8e8e8;*/
    margin-top: -40px
}

.form-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    /*width: 100%;*/
    padding: 9px 8px;
    background: white;
    border: 1px solid #1890ff;
    border-radius: 6px;
    color: #1890ff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.form-toggle-btn:hover {
    background: #e6f7ff;
    border-color: #40a9ff;
    color: #096dd9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.2);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 4px;
}

.toggle-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.form-toggle-btn:hover .toggle-icon {
    transform: rotate(180deg);
}

.toggle-hint {
    font-size: 12px;
    color: #666;
    text-align: center;
    line-height: 1.4;
    padding: 4px 0;
}

/* 表单切换样式 */
.active-form {
    display: block;
    animation: fadeIn 0.3s ease;
}

.hidden-form {
    display: none;
}

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

/* 表单组间距调整 */
#addHoldModal .form-group {
    margin-bottom: 20px;
}

#addHoldModal .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

#addHoldModal .form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

#addHoldModal .form-group input:focus {
    border-color: #1890ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

#addHoldModal .form-group input::placeholder {
    color: #999;
}

.required {
    color: #ff4d4f;
    margin-left: 2px;
}

/* 表单操作按钮 */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.form-actions .btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.form-actions .btn-outline {
    background: white;
    color: #666;
    border: 1px solid #d9d9d9;
}

.form-actions .btn-outline:hover {
    background: #f5f5f5;
    border-color: #bfbfbf;
    color: #333;
}

.form-actions .btn-primary {
    background: #1890ff;
    color: white;
    border: 1px solid #1890ff;
}

.form-actions .btn-primary:hover {
    background: #40a9ff;
    border-color: #40a9ff;
}

.fa-exchange-alt {
    font-size: 10px;
}

/*持仓设置 start*/

/* 持仓设置模态框样式 */
#holdSettingsModal .modal-content {
    max-width: 500px;
    min-height: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

#holdSettingsModal .modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* 设置头部 */
.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    /*background-color: #fafafa;*/
    flex-shrink: 0;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #d9d9d9;
    border-radius: 4px;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.checkbox-container input:checked + .checkmark {
    background-color: #1890ff;
    border-color: #1890ff;
}

.checkbox-container input:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.selected-count {
    font-size: 13px;
    color: #666;
    font-weight: 400;
}

/* 持仓列表容器 */
.holdings-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
    max-height: 400px;
    min-height: 200px;
}

/* 持仓项 */
.holding-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #f5f5f5;
    background-color: white;
    transition: all 0.3s ease;
    cursor: move;
    position: relative;
}

.holding-item:hover {
    background-color: #f9f9f9;
}

.holding-item.dragging {
    opacity: 0.5;
    background-color: #f0f8ff;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.2);
    border-radius: 4px;
}

.holding-item.drag-over {
    border-top: 2px solid #1890ff;
    margin-top: -2px;
}

/* 拖拽手柄 */
.drag-handle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    cursor: move;
    margin-right: 10px;
    flex-shrink: 0;
}

.drag-handle i {
    font-size: 16px;
}

/* 持仓复选框 */
.holding-checkbox {
    margin-right: 12px;
    flex-shrink: 0;
}

/* 基金信息 */
.holding-info {
    flex: 1;
    min-width: 0;
    margin-right: 10px;
}

.holding-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.holding-code {
    font-size: 12px;
    color: #666;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    /*background-color: #f5f5f5;*/
    padding: 1px 6px;
    border-radius: 3px;
    display: inline-block;
}

/* 删除按钮 */
.holding-delete {
    opacity: 0;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.holding-item:hover .holding-delete {
    opacity: 1;
}

.delete-btn {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid #ffa39e;
    background-color: #fff2f0;
    color: #ff4d4f;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background-color: #ffccc7;
    border-color: #ff7875;
    transform: scale(1.1);
}

.delete-btn i {
    font-size: 14px;
}

/* 空状态 */
.holdings-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #999;
    flex: 1;
}

.holdings-empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    color: #e8e8e8;
}

.holdings-empty-state p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* 操作按钮 */
.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 15px 20px;
    border-top: 1px solid #f0f0f0;
    background-color: #fafafa;
    flex-shrink: 0;
}

.settings-actions .btn {
    min-width: 80px;
    padding: 8px 20px;
    font-size: 14px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.settings-actions .btn-outline {
    background-color: white;
    border-color: #d9d9d9;
    color: #666;
}

.settings-actions .btn-outline:hover {
    border-color: #bfbfbf;
    color: #333;
}

.settings-actions .btn-danger {
    background-color: #ff4d4f;
    border-color: #ff4d4f;
    color: white;
    font-weight: 500;
}

.settings-actions .btn-danger:hover {
    background-color: #ff7875;
    border-color: #ff7875;
}

.settings-actions .btn-danger:disabled {
    background-color: #ffccc7;
    border-color: #ffccc7;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 拖拽占位符 */
.drag-placeholder {
    height: 60px;
    background-color: #f0f9ff;
    border: 2px dashed #91d5ff;
    border-radius: 4px;
    margin: 8px 20px;
    opacity: 0.6;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #holdSettingsModal .modal-content {
        max-width: 100%;
        margin: 0 10px;
        max-height: 90vh;
    }

    .holding-item {
        padding: 10px 15px;
    }

    .settings-header {
        padding: 12px 15px;
    }

    .settings-actions {
        padding: 12px 15px;
    }

    .holding-delete {
        opacity: 1; /* 移动端始终显示删除按钮 */
    }
}
/*持仓设置结束*/
