/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f5f6fa;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    padding-bottom: 50px; /* 给底部固定导航留位置 */
}

/* ========== 非微信提示页样式 ========== */
.tip-body {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.tip-container {
    background: #fff;
    border-radius: 12px;
    padding: 40px 24px;
    text-align: center;
    max-width: 320px;
    width: 100%;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.tip-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: #ff9500;
    color: #fff;
    font-size: 36px;
    font-weight: bold;
    line-height: 64px;
}

.tip-title {
    font-size: 18px;
    color: #333;
    margin-bottom: 12px;
}

.tip-desc {
    font-size: 13px;
    color: #888;
    line-height: 1.6;
}

/* ========== Tab 切换栏样式 ========== */
.tab-bar {
    display: flex;
    background: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 9;
}

.tab-item {
    flex: 1;
    padding: 14px 4px;
    text-align: center;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.25s ease;
    border-bottom: 3px solid transparent;
    background: transparent;
    border-top: none;
    border-left: none;
    border-right: none;
    white-space: nowrap;
    line-height: 1.3;
}

.tab-item .tab-code {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.tab-item .tab-name {
    display: block;
    font-size: 11px;
    margin-top: 3px;
    opacity: 0.8;
}

.tab-item.active {
    color: #4a90e2;
    border-bottom-color: #4a90e2;
}

/* ========== Tab 内容区样式 ========== */
.tab-content-wrapper {
    padding: 12px;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-panel.active {
    display: block;
}

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

/* ========== 卡片样式 ========== */
.card {
    background: #fff;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
}

.card-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 14px;
    background: #4a90e2;
    border-radius: 2px;
    margin-right: 8px;
}

.card-date {
    font-size: 11px;
    color: #999;
}

/* ========== 关键指标区样式 ========== */
.key-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 6px;
}

.metric-item {
    background: linear-gradient(135deg, #f8f9fc 0%, #eef2f9 100%);
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
}

.metric-item.highlight-up {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e0 100%);
}

.metric-item.highlight-down {
    background: linear-gradient(135deg, #f0faf3 0%, #dcf5e3 100%);
}

.metric-label {
    font-size: 11px;
    color: #888;
    margin-bottom: 4px;
}

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

.metric-value.up {
    color: #e74c3c;
}

.metric-value.down {
    color: #27ae60;
}

/* 可点击跳转历史页面的指标标题（a 标签，需求20：入口为参数标题） */
.metric-label.metric-link {
    display: block;
    text-decoration: none;
    color: #4a90e2;
    cursor: pointer;
    position: relative;
}

.metric-label.metric-link::after {
    content: ' ›';
    font-size: 11px;
    opacity: 0.6;
    margin-left: 2px;
}

.metric-label.metric-link:active {
    opacity: 0.6;
}

/* ========== 详情信息表格样式 ========== */
.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.detail-table tr {
    border-bottom: 1px solid #f5f5f5;
}

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

.detail-table td {
    padding: 9px 4px;
    vertical-align: middle;
}

.detail-table td.label {
    color: #888;
    width: 42%;
}

.detail-table td.value {
    color: #333;
    text-align: right;
    font-weight: 500;
}

/* ========== 持仓明细表格样式 ========== */
.holdings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.holdings-table thead th {
    background: #f0f4fa;
    color: #4a90e2;
    padding: 10px 6px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    border-bottom: 1px solid #e0e8f5;
}

.holdings-table tbody td {
    padding: 10px 6px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.holdings-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

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

.holdings-table .col-code {
    color: #4a90e2;
    font-weight: 600;
}

.holdings-table .col-shares {
    font-weight: 600;
    color: #e74c3c;
}

.holdings-table .col-price {
    font-weight: 600;
    color: #4a90e2;
}

/* ========== 空数据样式 ========== */
.empty-data {
    text-align: center;
    padding: 30px 10px;
    color: #aaa;
    font-size: 13px;
}

/* ========== 页脚样式 ========== */
.footer {
    text-align: center;
    padding: 16px;
    color: #bbb;
    font-size: 11px;
}

.footer .update-time {
    margin-top: 4px;
    color: #ccc;
}

/* ========== 底部导航菜单样式（需求22） ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: #ffffff;
    border-top: 1px solid #eee;
    display: flex;
    z-index: 100;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.05);
}

.bottom-nav .nav-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #666;
    font-size: 15px;
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav .nav-item.active {
    color: #4a90e2;
    font-weight: 600;
}

.bottom-nav .nav-item:active {
    background: #f5f6f8;
}
