:root {
            --primary-color: #3b82f6;
            --success-color: #10b981;
            --warning-color: #f59e0b;
            --error-color: #ef4444;
            --bg-color: #f8fafc;
            --text-color: #1e293b;
            --text-secondary: #64748b;
            --border-color: #e2e8f0;
            --card-bg: #ffffff;
            --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
            --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
            --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        }

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

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            background: var(--bg-color);
            min-height: 100vh;
            color: var(--text-color);
            line-height: 1.5;
            padding-bottom: 60px;
        }

        header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            padding: 0;
            position: sticky;
            top: 0;
            z-index: 100;
        }

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

        .app-name {
            font-size: 17px;
            font-weight: 600;
            color: white;
        }

        .header-nav {
            display: flex;
            gap: 16px;
        }

        .header-nav .nav-link {
            color: rgba(255,255,255,0.75);
            text-decoration: none;
            font-size: 14px;
            padding: 4px 8px;
            border-radius: 6px;
            transition: all 0.2s;
        }

        .header-nav .nav-link:hover,
        .header-nav .nav-link.active {
            color: white;
            background: rgba(255,255,255,0.15);
        }

        .account-tabs {
            display: flex;
            gap: 6px;
            padding: 0 16px;
            overflow-x: auto;
            scrollbar-width: none;
        }

        .account-tabs::-webkit-scrollbar {
            display: none;
        }

        .account-tab {
            padding: 4px 12px;
            border-radius: 16px;
            background: rgba(255, 255, 255, 0.15);
            color: rgba(255, 255, 255, 0.8);
            font-size: 12px;
            white-space: nowrap;
            cursor: pointer;
            border: none;
            transition: all 0.2s;
        }

        .account-tab.active {
            background: white;
            color: #667eea;
            font-weight: 500;
        }

        .market-overview {
            background: white;
            padding: 10px 12px;
            margin: 6px 0;
        }

        .index-grid {
            display: flex;
            justify-content: space-between;
            gap: 8px;
        }

        .index-card {
            flex: 1;
            text-align: center;
            padding: 8px 4px;
            background: #f8f9fa;
            border-radius: 6px;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

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

        .index-card.full-width {
            flex: 1;
        }

        .index-name {
            font-size: 11px;
            color: #999;
            margin-bottom: 4px;
        }

        .index-value {
            font-size: 14px;
            font-weight: 600;
            color: #333;
            margin-bottom: 2px;
        }

        .index-change {
            font-size: 12px;
            font-weight: 500;
        }

        .index-change.up {
            color: #ff4757;
        }

        .index-change.down {
            color: #2ed573;
        }

        .search-section {
            background: white;
            padding: 12px 16px;
            margin: 8px 0;
        }

        .search-box {
            display: flex;
            gap: 12px;
            align-items: center;
            background: #f5f7fa;
            border-radius: 20px;
            padding: 10px 16px;
        }

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

        .search-box input {
            flex: 1;
            border: none;
            background: transparent;
            font-size: 14px;
            outline: none;
        }

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

        .fund-list {
            background: white;
            max-width: 800px;
            margin: 0 auto;
        }

        .model-stats-card {
            background: white;
            max-width: 800px;
            margin: 10px auto;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            overflow: hidden;
        }

        .stats-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            padding: 12px 16px;
            display: flex;
            align-items: center;
            gap: 8px;
            color: white;
        }

        .stats-icon {
            font-size: 20px;
        }

        .stats-title {
            font-size: 16px;
            font-weight: 600;
        }

        .stats-content {
            padding: 16px;
        }

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

        .stat-item {
            background: #f8f9fa;
            padding: 12px;
            border-radius: 8px;
            text-align: center;
        }

        .stat-label {
            font-size: 12px;
            color: #666;
            margin-bottom: 4px;
        }

        .stat-value {
            font-size: 24px;
            font-weight: 600;
            color: #333;
        }

        .stat-unit {
            font-size: 12px;
            color: #999;
        }

        .accuracy-bar {
            display: flex;
            height: 24px;
            border-radius: 12px;
            overflow: hidden;
            margin: 8px 0;
        }

        .accuracy-segment {
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 11px;
            font-weight: 500;
        }

        .accuracy-excellent { background: #10b981; }
        .accuracy-good { background: #3b82f6; }
        .accuracy-normal { background: #f59e0b; }
        .accuracy-poor { background: #ef4444; }

        .recent-trained {
            margin-top: 12px;
        }

        .recent-trained-title {
            font-size: 14px;
            font-weight: 600;
            margin-bottom: 8px;
            color: #333;
        }

        .recent-trained-list {
            display: grid;
            gap: 8px;
        }

        .recent-trained-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 12px;
            background: #f8f9fa;
            border-radius: 6px;
            font-size: 13px;
        }

        .fund-info {
            display: flex;
            flex-direction: column;
        }

        .fund-code-small {
            font-size: 11px;
            color: #999;
        }

        .fund-metrics {
            display: flex;
            gap: 12px;
            font-size: 12px;
        }

        .metric {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .metric-label {
            font-size: 10px;
            color: #999;
        }

        .metric-value {
            font-weight: 600;
            color: #333;
        }

        .fund-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 16px;
            border-bottom: 1px solid #f0f0f0;
            cursor: pointer;
            transition: background 0.2s;
            position: relative;
            min-height: 48px;
        }

        .fund-item:hover {
            background: #f8f9fa;
        }

        .fund-item:active {
            background: #f0f0f0;
        }

        .fund-actions {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-left: 8px;
        }

        .fund-delete-link {
            font-size: 12px;
            color: #999;
            cursor: pointer;
            padding: 4px 8px;
            border-radius: 4px;
            transition: all 0.2s;
            display: none;
        }

        .fund-item:hover .fund-delete-link {
            display: block;
        }

        .fund-delete-link:hover {
            color: #ff4757;
            background: #fff5f5;
        }

        .fund-left {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 2px;
            min-width: 0;
        }

        .fund-header {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .fund-code {
            font-size: 12px;
            font-weight: 500;
            color: #667eea;
            background: #f0f3ff;
            padding: 2px 8px;
            border-radius: 4px;
            white-space: nowrap;
        }

        .fund-name {
            font-size: 14px;
            font-weight: 600;
            color: #333;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            flex: 1;
            min-width: 0;
        }

        .fund-tags {
            display: flex;
            gap: 4px;
            flex-wrap: wrap;
        }

        .fund-tag {
            padding: 2px 6px;
            background: #f0f2f5;
            border-radius: 3px;
            font-size: 10px;
            color: #666;
        }

        .fund-tag.focus {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
        }

        .fund-tag.correction {
            background: #e8f5e9;
            color: #2e7d32;
        }

        .fund-right {
            display: flex;
            align-items: center;
            gap: 16px;
            text-align: right;
        }

        .fund-data {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .fund-change {
            font-size: 16px;
            font-weight: 600;
        }

        .fund-change.up {
            color: #ff4757;
        }

        .fund-change.down {
            color: #2ed573;
        }

        .fund-nav {
            font-size: 11px;
            color: #999;
        }

        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: white;
            display: flex;
            justify-content: space-around;
            padding: 8px 0;
            padding-bottom: calc(8px + env(safe-area-inset-bottom));
            border-top: 1px solid #eee;
            z-index: 100;
        }

        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            cursor: pointer;
            font-size: 11px;
            color: #999;
            padding: 4px 12px;
        }

        .nav-item.active {
            color: #667eea;
        }

        .nav-icon {
            font-size: 20px;
        }

        .detail-panel {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: var(--bg-color);
            z-index: 200;
            display: none;
            overflow-y: auto;
        }

        .detail-panel.show {
            display: block;
        }

        .detail-header {
            background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
            color: white;
            padding: 12px 16px;
            padding-top: calc(12px + env(safe-area-inset-top));
            position: sticky;
            top: 0;
            z-index: 10;
            box-shadow: var(--shadow-md);
        }

        .detail-header-top {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
        }

        .back-btn {
            background: rgba(255, 255, 255, 0.2);
            color: white;
            border: none;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            transition: all 0.2s;
        }

        .back-btn:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        .detail-fund-name {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 2px;
            line-height: 1.4;
        }

        .detail-fund-code {
            font-size: 12px;
            opacity: 0.9;
        }

        .detail-value-section {
            margin-top: 12px;
            text-align: center;
        }

        .detail-nav {
            font-size: 24px;
            font-weight: 700;
            margin-bottom: 4px;
        }

        .detail-change {
            font-size: 14px;
            font-weight: 600;
        }

        .detail-content {
            padding: 12px;
        }

        .section-title {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-color);
            margin-bottom: 10px;
            padding-left: 10px;
            border-left: 3px solid var(--primary-color);
        }

        .layers-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
            margin-bottom: 16px;
        }

        .layer-card {
            background: var(--card-bg);
            border-radius: 8px;
            padding: 12px;
            text-align: center;
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border-color);
            transition: all 0.2s;
        }

        .layer-card:hover {
            box-shadow: var(--shadow-md);
            transform: translateY(-1px);
        }

        .layer-icon {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 8px;
            font-weight: bold;
            font-size: 14px;
            color: white;
        }

        .layer1 .layer-icon {
            background: var(--primary-color);
        }

        .layer2 .layer-icon {
            background: #8b5cf6;
        }

        .layer3 .layer-icon {
            background: #ec4899;
        }

        .layer3.inactive .layer-icon {
            background: #cbd5e1;
        }

        .layer3.inactive {
            opacity: 0.6;
        }

        .layer4 .layer-icon {
            background: #06b6d4;
        }

        .layer-title {
            font-size: 11px;
            color: var(--text-secondary);
            margin-bottom: 6px;
        }

        .layer-value {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-color);
        }

        .layer-desc {
            font-size: 10px;
            color: var(--text-secondary);
            margin-top: 4px;
        }

        .holdings-table {
            width: 100%;
            background: var(--card-bg);
            border-radius: 8px;
            overflow: hidden;
            margin-bottom: 16px;
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border-color);
        }

        .holdings-table th,
        .holdings-table td {
            padding: 10px 12px;
            text-align: left;
        }

        .holdings-table th {
            font-size: 11px;
            font-weight: 600;
            color: var(--text-secondary);
            background: var(--bg-color);
            border-bottom: 1px solid var(--border-color);
        }

        .holdings-table td {
            font-size: 13px;
            border-bottom: 1px solid var(--border-color);
        }

        .holdings-table tr:last-child td {
            border-bottom: none;
        }

        .up {
            color: var(--error-color);
        }

        .down {
            color: var(--success-color);
        }

        .add-btn {
            position: fixed;
            bottom: 80px;
            right: 20px;
            width: 56px;
            height: 56px;
            border-radius: 50%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            font-size: 28px;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
            z-index: 90;
            display: flex;
            align-items: center;
            justify-content: center;
        }

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

        .loading {
            text-align: center;
            padding: 60px 20px;
            color: #999;
        }

        .loading-spinner {
            width: 40px;
            height: 40px;
            border: 3px solid #f0f0f0;
            border-top-color: #667eea;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 16px;
        }

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

        .error-msg {
            background: #fff5f5;
            border: 1px solid #ffcdd2;
            border-radius: 8px;
            padding: 16px;
            color: #c62828;
            margin: 16px;
        }

        .toast {
            position: fixed;
            bottom: 100px;
            left: 50%;
            transform: translateX(-50%);
            padding: 12px 24px;
            border-radius: 8px;
            font-size: 14px;
            z-index: 1000;
            animation: fadeIn 0.3s;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .toast.success {
            background: #2ed573;
            color: white;
        }

        .toast.error {
            background: #ff4757;
            color: white;
        }

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

            to {
                opacity: 1;
                transform: translateX(-50%) translateY(0);
            }
        }

        .empty-state {
            text-align: center;
            padding: 60px 20px;
            color: #999;
        }

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

        .watchlist-btn {
            margin-top: 8px;
            padding: 8px 20px;
            border: 1px solid var(--primary-color);
            background: transparent;
            color: var(--primary-color);
            border-radius: 16px;
            cursor: pointer;
            font-size: 13px;
            transition: all 0.2s;
        }

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

        .watchlist-btn.added {
            border-color: var(--success-color);
            color: var(--success-color);
            background: rgba(16, 185, 129, 0.1);
        }

        .action-buttons {
            display: flex;
            gap: 10px;
            margin-top: 8px;
            justify-content: center;
        }

        .action-btn {
            flex: 1;
            padding: 8px 14px;
            border: none;
            border-radius: 16px;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s;
            max-width: 100px;
        }

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

        .buy-btn:hover {
            background: #dc2626;
        }

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

        .sell-btn:hover {
            background: #059669;
        }

        .modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 400;
        }

        .modal.show {
            display: flex;
        }

        .modal-content {
            background: white;
            border-radius: 16px;
            padding: 24px;
            width: 90%;
            max-width: 400px;
        }

        .modal-title {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 20px;
            text-align: center;
        }

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

        .form-label {
            display: block;
            font-size: 14px;
            color: #666;
            margin-bottom: 8px;
        }

        .form-input {
            width: 100%;
            padding: 12px;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            font-size: 16px;
            outline: none;
        }

        .form-input:focus {
            border-color: #667eea;
        }

        .modal-buttons {
            display: flex;
            gap: 12px;
            margin-top: 24px;
        }

        .modal-btn {
            flex: 1;
            padding: 12px;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            cursor: pointer;
        }

        .modal-btn.cancel {
            background: #f0f0f0;
            color: #666;
        }

        .modal-btn.confirm {
            background: #667eea;
            color: white;
        }

        .search-modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: white;
            z-index: 300;
            display: none;
            overflow-y: auto;
        }

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

        .search-modal-header {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 16px;
            padding-top: calc(16px + env(safe-area-inset-top));
            border-bottom: 1px solid #eee;
        }

        .search-modal-input {
            flex: 1;
            padding: 12px 16px;
            border: 1px solid #e0e0e0;
            border-radius: 20px;
            font-size: 15px;
            outline: none;
        }

        .search-modal-input:focus {
            border-color: #667eea;
        }

        .cancel-btn {
            color: #667eea;
            font-size: 15px;
            cursor: pointer;
            padding: 8px;
        }

        .search-results {
            padding: 16px;
        }

        .search-result-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 0;
            border-bottom: 1px solid #f0f0f0;
        }

        .search-result-name {
            font-size: 15px;
            font-weight: 500;
            color: #333;
        }

        .search-result-code {
            font-size: 13px;
            color: #999;
            margin-top: 4px;
        }

        .search-add-btn {
            padding: 8px 20px;
            background: #667eea;
            color: white;
            border: none;
            border-radius: 16px;
            font-size: 14px;
            cursor: pointer;
        }

        .confidence-section {
            background: var(--card-bg);
            border-radius: 8px;
            padding: 12px;
            margin-bottom: 16px;
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border-color);
        }

        .confidence-row {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .confidence-label {
            font-size: 12px;
            color: var(--text-secondary);
            min-width: 50px;
        }

        .confidence-bar {
            flex: 1;
            height: 6px;
            background: var(--bg-color);
            border-radius: 3px;
            overflow: hidden;
        }

        .confidence-bar .fill {
            height: 100%;
            border-radius: 3px;
            transition: width 0.3s;
        }

        .confidence-score {
            font-size: 12px;
            font-weight: 600;
            min-width: 35px;
            text-align: right;
        }

        .confidence-reasons {
            margin-top: 8px;
            font-size: 11px;
            color: var(--text-secondary);
        }

        .valuation-dimensions-section {
            background: var(--card-bg);
            border-radius: 8px;
            padding: 12px;
            margin-bottom: 16px;
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border-color);
        }

        .dimension-card {
            background: var(--bg-color);
            border-radius: 6px;
            padding: 12px;
            margin-bottom: 10px;
            border-left: 3px solid var(--primary-color);
            transition: all 0.2s;
        }

        .dimension-card:last-child {
            margin-bottom: 0;
        }

        .dimension-card:hover {
            background: #f0f4f8;
            transform: translateX(2px);
        }

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

        .dimension-name {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-color);
        }

        .dimension-value {
            font-size: 14px;
            font-weight: 600;
            color: var(--primary-color);
        }

        .dimension-details {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 6px;
            font-size: 11px;
            color: var(--text-secondary);
        }

        .detail-item {
            display: flex;
            justify-content: space-between;
        }

        .detail-label {
            color: #999;
        }

        .detail-value {
            font-weight: 500;
            color: var(--text-color);
        }

        .dimension-description {
            margin-top: 6px;
            font-size: 11px;
            color: var(--text-secondary);
            padding-top: 6px;
            border-top: 1px solid var(--border-color);
        }

        .refresh-btn {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 6px 12px;
            background: var(--primary-color);
            color: white;
            border: none;
            border-radius: 16px;
            font-size: 12px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .refresh-btn:hover {
            background: #2563eb;
            transform: translateY(-1px);
        }

        .refresh-btn:active {
            transform: translateY(0);
        }

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

        .refresh-btn.loading .refresh-icon {
            animation: spin 1s linear infinite;
        }

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

        .tracked-indices-section {
            background: var(--card-bg);
            border-radius: 8px;
            padding: 12px;
            margin-bottom: 16px;
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border-color);
        }

        .indices-grid {
            display: grid;
            gap: 10px;
        }

        .index-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 12px;
            background: var(--bg-color);
            border-radius: 6px;
            transition: all 0.2s;
            cursor: default;
        }

        .index-item:hover {
            background: #f0f4f8;
            transform: translateX(2px);
        }

        .index-info {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .index-header {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .index-code-badge {
            font-size: 10px;
            font-weight: 500;
            color: #667eea;
            background: #f0f3ff;
            padding: 2px 6px;
            border-radius: 3px;
        }

        .index-name-text {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-color);
        }

        .index-meta {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 11px;
            color: var(--text-secondary);
        }

        .index-weight {
            font-weight: 500;
        }

        .index-confidence {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .confidence-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
        }

        .confidence-high {
            background: #22c55e;
        }

        .confidence-medium {
            background: #f59e0b;
        }

        .confidence-low {
            background: #ef4444;
        }

        .index-change-value {
            font-size: 15px;
            font-weight: 600;
            min-width: 70px;
            text-align: right;
        }

        .index-empty {
            text-align: center;
            padding: 20px;
            color: var(--text-secondary);
            font-size: 13px;
        }

        .tracked-etfs-section {
            background: var(--card-bg);
            border-radius: 8px;
            padding: 12px;
            margin-bottom: 16px;
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border-color);
        }

        .etf-card {
            background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
            border-radius: 8px;
            padding: 12px;
            margin-bottom: 10px;
            border: 1px solid var(--border-color);
            transition: all 0.2s ease;
            cursor: default;
        }

        .etf-card:last-child {
            margin-bottom: 0;
        }

        .etf-card:hover {
            box-shadow: var(--shadow-md);
            transform: translateY(-2px);
            border-color: var(--primary-color);
        }

        .etf-header {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 8px;
        }

        .etf-code {
            font-size: 11px;
            font-weight: 600;
            color: white;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            padding: 3px 8px;
            border-radius: 4px;
        }

        .etf-name {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-color);
        }

        .etf-body {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .etf-meta {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .etf-weight {
            font-size: 12px;
            color: var(--text-secondary);
        }

        .etf-track {
            font-size: 11px;
            color: #999;
        }

        .etf-change {
            font-size: 16px;
            font-weight: 700;
            padding: 4px 12px;
            border-radius: 6px;
        }

        .etf-change.up {
            color: var(--error-color);
            background: rgba(239, 68, 68, 0.1);
        }

        .etf-change.down {
            color: var(--success-color);
            background: rgba(16, 185, 129, 0.1);
        }

        .etf-empty {
            text-align: center;
            padding: 20px;
            color: var(--text-secondary);
            font-size: 13px;
        }

        .top-holdings-section {
            background: var(--card-bg);
            border-radius: 8px;
            padding: 12px;
            margin-bottom: 16px;
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border-color);
        }

        .holdings-tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 12px;
        }

        .holdings-tab {
            flex: 1;
            padding: 8px 12px;
            border: none;
            border-radius: 6px;
            background: var(--bg-color);
            color: var(--text-secondary);
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

        .holdings-tab.active {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
        }

        .holdings-tab:hover:not(.active) {
            background: #e2e8f0;
        }

        .holdings-list {
            display: grid;
            gap: 8px;
        }

        .holding-card {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 12px;
            background: var(--bg-color);
            border-radius: 6px;
            transition: all 0.2s ease;
            cursor: default;
            border-left: 3px solid transparent;
        }

        .holding-card:hover {
            background: #f0f4f8;
            transform: translateX(2px);
            box-shadow: var(--shadow-sm);
        }

        .holding-card.stock {
            border-left-color: #3b82f6;
        }

        .holding-card.fund {
            border-left-color: #8b5cf6;
        }

        .holding-info {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .holding-header {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .holding-code {
            font-size: 10px;
            font-weight: 500;
            padding: 2px 6px;
            border-radius: 3px;
        }

        .holding-code.stock {
            color: #3b82f6;
            background: rgba(59, 130, 246, 0.1);
        }

        .holding-code.fund {
            color: #8b5cf6;
            background: rgba(139, 92, 246, 0.1);
        }

        .holding-name {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-color);
        }

        .holding-meta {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 11px;
            color: var(--text-secondary);
        }

        .holding-ratio {
            font-weight: 500;
            color: var(--text-color);
        }

        .holding-type-badge {
            font-size: 10px;
            padding: 1px 4px;
            border-radius: 2px;
            background: #e2e8f0;
            color: var(--text-secondary);
        }

        .holding-change {
            font-size: 15px;
            font-weight: 600;
            min-width: 70px;
            text-align: right;
        }

        .holding-empty {
            text-align: center;
            padding: 20px;
            color: var(--text-secondary);
            font-size: 13px;
        }

        .holdings-summary {
            display: flex;
            justify-content: space-between;
            padding: 8px 12px;
            background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
            border-radius: 6px;
            margin-top: 10px;
            font-size: 12px;
            color: var(--text-secondary);
        }

        .holdings-summary-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
        }

        .holdings-summary-value {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-color);
        }

        @media (max-width: 480px) {
            .detail-header {
                padding: 10px 12px;
                padding-top: calc(10px + env(safe-area-inset-top));
            }

            .detail-fund-name {
                font-size: 15px;
            }

            .detail-nav {
                font-size: 22px;
            }

            .detail-change {
                font-size: 13px;
            }

            .layers-grid {
                gap: 8px;
            }

            .layer-card {
                padding: 10px;
            }

            .layer-icon {
                width: 28px;
                height: 28px;
                font-size: 13px;
            }

            .layer-title {
                font-size: 10px;
            }

            .layer-value {
                font-size: 13px;
            }

            .layer-desc {
                font-size: 9px;
            }

            .holdings-table th,
            .holdings-table td {
                padding: 8px 10px;
            }

            .holdings-table th {
                font-size: 10px;
            }

            .holdings-table td {
                font-size: 12px;
            }

            .action-btn {
                padding: 7px 12px;
                font-size: 12px;
            }

            .watchlist-btn {
                padding: 7px 16px;
                font-size: 12px;
            }

            .section-title {
                font-size: 13px;
            }

            .confidence-section {
                padding: 10px;
            }

            .confidence-label {
                font-size: 11px;
                min-width: 45px;
            }

            .confidence-score {
                font-size: 11px;
                min-width: 30px;
            }

            .confidence-reasons {
                font-size: 10px;
            }
        }

        @media (min-width: 768px) {
            .detail-content {
                max-width: 600px;
                margin: 0 auto;
            }

            .layers-grid {
                grid-template-columns: repeat(4, 1fr);
            }
        }
