/* 资产管理系统 - 统一样式 */

:root {
    --bs-body-bg: #1a1a1a;
    --bs-body-color: #ffffff;
    --primary-color: #0071e3;
    --success-color: #34c759;
    --warning-color: #ff9500;
    --danger-color: #ff3b30;
    --card-bg: #2d2d2d;
    --card-border: #404040;
}

/* 基础样式 */
body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-family: 'Microsoft YaHei', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, #10131a 0%, #232526 60%, #0a0e1a 100%);
    position: relative;
}

/* 粒子背景画布 */
#particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* 系统标题 */
.system-title {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(90deg, #00eaff 0%, #3a7bd5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    z-index: 1000;
    text-shadow: 0 0 20px rgba(0,234,255,0.5);
    filter: drop-shadow(0 0 8px rgba(0,234,255,0.3));
}

/* Glassmorphism 卡片样式 */
.glass-card {
    background: rgba(30,34,54,0.60);
    box-shadow: 0 8px 32px 0 #00c3ff33, 0 1.5px 0 #fff2;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 24px;
    border: 2px solid rgba(0,195,255,0.18);
    border-top: 2.5px solid #00eaff99;
    border-left: 2.5px solid #3a7bd599;
    margin: 80px auto 24px;
    padding: 24px;
    position: relative;
    max-width: 1200px;
    width: 90%;
}

/* 卡片标题样式 */
.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #00eaff;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* 导航栏 */
.navbar {
    background-color: #1a1a1a;
    border-bottom: 1px solid var(--card-border);
    padding: 1rem;
}

.navbar-brand {
    color: var(--bs-body-color);
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.nav-link {
    color: #adb5bd;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(0, 113, 227, 0.1);
}

.nav-link.active {
    color: var(--primary-color);
    background-color: rgba(0, 113, 227, 0.2);
}

/* 卡片组件 */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
    transform: translateY(-1px);
}

.card-header {
    background-color: #363636;
    border-bottom: 1px solid var(--card-border);
    padding: 1rem;
    border-radius: 12px 12px 0 0;
}

.card-body {
    padding: 1rem;
}

/* 按钮组件 */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(90deg, #00eaff 0%, #3a7bd5 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: linear-gradient(90deg, #3a7bd5 0%, #00eaff 100%);
    transform: translateY(-1px) scale(1.02);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #28a745;
    transform: translateY(-1px);
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #e68900;
    transform: translateY(-1px);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc3545;
    transform: translateY(-1px);
}

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

.btn-block {
    display: block;
    width: 100%;
    margin-bottom: 0.75rem;
}

/* 按钮组样式 */
.btn-group {
    display: inline-flex;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-group .btn {
    border-radius: 0;
    margin: 0;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.btn-group .btn:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.btn-group .btn:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    border-right: none;
}

/* 表格组件 */
.table {
    width: 100%;
    border-collapse: collapse;
    color: var(--bs-body-color);
    margin: 1rem 0;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}

.table th {
    background-color: #363636;
    font-weight: 600;
}

.table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* 现金资产表格样式 */
.cash-assets-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    overflow: hidden;
}

.cash-assets-table th,
.cash-assets-table td {
    padding: 12px 10px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.cash-assets-table th {
    background: rgba(58,123,213,0.2);
    color: #00eaff;
    font-weight: 700;
}

.cash-assets-table tbody tr:hover {
    background: rgba(0,195,255,0.08);
}

.table-input {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(0,195,255,0.3);
    border-radius: 6px;
    padding: 6px 8px;
    color: #e2e8f0;
    font-size: 0.9rem;
    width: 100%;
    max-width: 120px;
}

.table-input:focus {
    outline: none;
    border-color: #00eaff;
    box-shadow: 0 0 0 2px rgba(0,234,255,0.2);
}

/* 表单组件 */
.form-control {
    background-color: #363636;
    border: 1px solid var(--card-border);
    color: var(--bs-body-color);
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.2);
}

.form-label {
    color: #00eaff;
    font-size: 0.9rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

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

.form-input {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(0,195,255,0.3);
    border-radius: 8px;
    padding: 8px 12px;
    color: #e2e8f0;
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #00eaff;
    box-shadow: 0 0 0 2px rgba(0,234,255,0.2);
}

.form-input::placeholder {
    color: #94a3b8;
}

.form-input[readonly] {
    background: rgba(255,255,255,0.05);
    color: #94a3b8;
}

/* 新增资产表单 */
.add-asset-form {
    background: rgba(0,234,255,0.1);
    border: 1px solid rgba(0,234,255,0.3);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

/* 模态框组件 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-dialog {
    background-color: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--card-border);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    color: var(--bs-body-color);
}

.modal-close {
    background: none;
    border: none;
    color: #adb5bd;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 1rem;
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* 布局工具类 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.5rem;
}

.col-8 {
    flex: 0 0 66.66%;
    padding: 0 0.5rem;
}

.col-4 {
    flex: 0 0 33.33%;
    padding: 0 0.5rem;
}

.col-12 {
    flex: 0 0 100%;
    padding: 0 0.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .col-8, .col-4 {
        flex: 0 0 100%;
    }
    
    .navbar-nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .col-8 .card:first-child {
        height: 220px;
    }
    
    .col-8 .card:last-child {
        height: 160px;
    }
    
    .dashboard-right-card {
        height: auto !important;
        min-height: 400px;
    }
    
    .exchange-rates {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .exchange-rate {
        padding: 8px;
        font-size: 0.8rem;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        border-radius: 8px;
        margin-bottom: 0.5rem;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .btn-group .btn:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .glass-card {
        width: 95%;
        margin: 70px auto 24px;
        padding: 16px;
    }
    
    .system-title {
        font-size: 1.4rem;
        top: 15px;
    }
}

/* 资产值样式 */
.asset-value {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 0.5rem 0;
    color: #00eaff;
}

.asset-change {
    font-size: 0.9rem;
    font-weight: 600;
}

.asset-change.up {
    color: var(--success-color);
}

.asset-change.up::before {
    content: "↗ ";
}

.asset-change.down {
    color: var(--danger-color);
}

.asset-change.down::before {
    content: "↘ ";
}

/* 资产列表样式 */
.asset-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.asset-list li {
    padding: 0.75rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.asset-list li:last-child {
    border-bottom: none;
}

.asset-list li strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* 汇率显示 */
.exchange-rates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    padding: 1rem 0;
    max-height: 160px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #00c3ff transparent;
}

.exchange-rate {
    background: linear-gradient(135deg, rgba(0,195,255,0.15) 0%, rgba(58,123,213,0.1) 100%);
    border: 1px solid rgba(0,195,255,0.2);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.exchange-rate:hover {
    background: linear-gradient(135deg, rgba(0,195,255,0.25) 0%, rgba(58,123,213,0.2) 100%);
    border-color: rgba(0,195,255,0.4);
    transform: translateY(-2px);
}

/* 加载动画 */
.loading {
    display: none;
    text-align: center;
    padding: 2rem;
}

.loading.active {
    display: block;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #404040;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 工具类 */
.text-center { text-align: center; }
.text-muted { color: #adb5bd; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-2 > * {
    margin-right: 0.5rem;
}

.gap-2 > *:last-child {
    margin-right: 0;
}

/* 仪表板右侧卡片样式 */
.dashboard-right-card {
    height: 480px;
}

.dashboard-right-card .card-body {
    padding: 1rem;
    height: calc(100% - 60px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #00c3ff transparent;
}

.dashboard-right-card #assetSnapshotData {
    height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #00c3ff transparent;
}

/* 左侧第一个卡片 - 资产趋势图 */
.col-8 .card:first-child {
    height: 260px;
}

.col-8 .card:first-child .card-body {
    padding: 1rem;
    height: calc(100% - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
}

#assetTrendChart {
    width: 100% !important;
    height: 100% !important;
    max-height: 180px;
}

.chart-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 左侧第二个卡片 - 实时汇率 */
.col-8 .card:last-child {
    height: 200px;
}

.col-8 .card:last-child .card-body {
    padding: 1rem;
    height: calc(100% - 60px);
    overflow: hidden;
}

/* 按钮变体 */
.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-outline-success {
    background: transparent;
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.btn-outline-success:hover {
    background: var(--success-color);
    color: white;
}

/* 资产盘点表格 */
#inventoryTable {
    margin-top: 1rem;
}

#inventoryTable th {
    background: linear-gradient(135deg, rgba(0,195,255,0.2) 0%, rgba(58,123,213,0.15) 100%);
    color: #00eaff;
    font-weight: 700;
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid rgba(0,195,255,0.3);
    position: sticky;
    top: 0;
    z-index: 10;
}

#inventoryTable td {
    padding: 8px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

#inventoryTable .form-control {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(0,195,255,0.3);
    color: #e2e8f0;
    padding: 6px 8px;
    font-size: 0.9rem;
}

#inventoryTable .form-control:focus {
    border-color: #00eaff;
    box-shadow: 0 0 0 2px rgba(0,234,255,0.2);
}

#inventoryTable .btn-danger {
    background: linear-gradient(135deg, #ff3b30 0%, #dc3545 100%);
    border: none;
    color: white;
    padding: 4px 8px;
    font-size: 0.8rem;
}

#inventoryTable .btn-danger:hover {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

/* 表格响应式 */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* 可编辑下拉框样式 */
.editable-select {
    position: relative;
    width: 100%;
}

.select-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.select-input {
    width: 100%;
    padding: 8px 30px 8px 12px;
    border: 1px solid rgba(0, 195, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    font-size: 14px;
    transition: all 0.3s ease;
}

.select-input:focus {
    outline: none;
    border-color: #00c3ff;
    box-shadow: 0 0 0 2px rgba(0, 195, 255, 0.2);
}

.select-arrow {
    position: absolute;
    right: 10px;
    color: #00c3ff;
    cursor: pointer;
    transition: transform 0.3s ease;
    pointer-events: none;
}

.select-input-wrapper.open .select-arrow {
    transform: rotate(180deg);
}

.select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(20, 30, 48, 0.95);
    border: 1px solid rgba(0, 195, 255, 0.3);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-height: 200px;
    overflow-y: auto;
    margin-top: 2px;
    backdrop-filter: blur(10px);
}

.select-options {
    max-height: 150px;
    overflow-y: auto;
}

.select-option {
    padding: 10px 12px;
    cursor: pointer;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
}

.select-option:hover,
.select-option.highlighted {
    background: rgba(0, 195, 255, 0.2);
}

.select-option:last-child {
    border-bottom: none;
}

.select-add-option {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px;
}

.add-new-btn {
    width: 100%;
    padding: 8px 12px;
    background: rgba(0, 195, 255, 0.2);
    border: 1px solid rgba(0, 195, 255, 0.4);
    border-radius: 4px;
    color: #00c3ff;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.add-new-btn:hover {
    background: rgba(0, 195, 255, 0.3);
    border-color: #00c3ff;
}

.no-options {
    padding: 12px;
    text-align: center;
    color: #9ca3af;
    font-style: italic;
}

.editable-select::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.editable-select::-webkit-calendar-picker-indicator {
    display: none;
}

/* 输入提示样式 */
.input-hint {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

/* 资产盘点 - 新增区域样式 */
.asset-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #00eaff;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(0,234,255,0.3);
}

.asset-item.investment-asset,
.asset-item.fixed-asset {
    background: rgba(30,34,54,0.40);
    border: 1px solid rgba(0,195,255,0.2);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.asset-item.investment-asset:hover,
.asset-item.fixed-asset:hover {
    background: rgba(30,34,54,0.60);
    border-color: rgba(0,234,255,0.4);
    transform: translateY(-1px);
}

.asset-item.investment-asset {
    border-left: 4px solid #9333ea;
}

.asset-item.fixed-asset {
    border-left: 4px solid #10b981;
}

.asset-badge {
    background: rgba(0,234,255,0.2);
    color: #00eaff;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.asset-summary {
    margin: 1rem 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.summary-label {
    color: #adb5bd;
    font-size: 0.9rem;
}

.summary-value {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
}

.summary-value.positive {
    color: #10b981;
}

.summary-value.negative {
    color: #ef4444;
}

.asset-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.btn-link {
    color: #00eaff;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-link:hover {
    background: rgba(0,234,255,0.1);
    color: #3a7bd5;
}

.empty-section {
    text-align: center;
    padding: 2rem;
    color: #adb5bd;
}

.empty-section .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-section .empty-text {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.empty-section .btn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0,234,255,0.1);
    border: 1px solid rgba(0,234,255,0.3);
    border-radius: 8px;
    color: #00eaff;
    text-decoration: none;
    transition: all 0.2s;
}

.empty-section .btn-link:hover {
    background: rgba(0,234,255,0.2);
    border-color: rgba(0,234,255,0.5);
    transform: translateY(-1px);
}