feat: fix mobile AI full-width layout and simplify instance stats

Move hub AI mobile CSS after desktop grid rules so chat fills the screen. Hide exchange and total-trade stat cards on phone across all instances and compact export bar.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-09 16:57:47 +08:00
parent ea3ef71477
commit e60beeedd3
7 changed files with 193 additions and 129 deletions
+3 -3
View File
@@ -232,7 +232,7 @@
.stats-period-block h3{font-size:1rem;color:#dbe4ff;margin-bottom:4px} .stats-period-block h3{font-size:1rem;color:#dbe4ff;margin-bottom:4px}
.stats-period-block .sub{font-size:.78rem;color:#8892b0;margin-bottom:10px;line-height:1.4} .stats-period-block .sub{font-size:.78rem;color:#8892b0;margin-bottom:10px;line-height:1.4}
</style> </style>
<link rel="stylesheet" href="/static/instance_theme.css?v=10"> <link rel="stylesheet" href="/static/instance_theme.css?v=11">
</head> </head>
<body data-page="{{ page }}"> <body data-page="{{ page }}">
@@ -309,8 +309,8 @@
<a href="/export/key_monitor_history">关键位历史</a> <a href="/export/key_monitor_history">关键位历史</a>
</div> </div>
<div class="stat-box"> <div class="stat-box">
<div class="stat-item"><div class="label">交易所</div><div class="value">{{ exchange_display }}</div></div> <div class="stat-item stat-item-desktop-only"><div class="label">交易所</div><div class="value">{{ exchange_display }}</div></div>
<div class="stat-item"><div class="label">总交易</div><div class="value">{{ total }}</div></div> <div class="stat-item stat-item-desktop-only"><div class="label">总交易</div><div class="value">{{ total }}</div></div>
<div class="stat-item"><div class="label">错过次数</div><div class="value">{{ miss_count }}</div></div> <div class="stat-item"><div class="label">错过次数</div><div class="value">{{ miss_count }}</div></div>
<div class="stat-item"><div class="label">胜率</div><div class="value">{{ rate }}%</div></div> <div class="stat-item"><div class="label">胜率</div><div class="value">{{ rate }}%</div></div>
<div class="stat-item"><div class="label">资金账户(USDT)</div><div class="value" id="total-capital">{% if funding_usdt is not none %}{{ funds_fmt(funding_usdt) }}U{% else %}—{% endif %}</div></div> <div class="stat-item"><div class="label">资金账户(USDT)</div><div class="value" id="total-capital">{% if funding_usdt is not none %}{{ funds_fmt(funding_usdt) }}U{% else %}—{% endif %}</div></div>
+3 -3
View File
@@ -232,7 +232,7 @@
.stats-period-block h3{font-size:1rem;color:#dbe4ff;margin-bottom:4px} .stats-period-block h3{font-size:1rem;color:#dbe4ff;margin-bottom:4px}
.stats-period-block .sub{font-size:.78rem;color:#8892b0;margin-bottom:10px;line-height:1.4} .stats-period-block .sub{font-size:.78rem;color:#8892b0;margin-bottom:10px;line-height:1.4}
</style> </style>
<link rel="stylesheet" href="/static/instance_theme.css?v=10"> <link rel="stylesheet" href="/static/instance_theme.css?v=11">
</head> </head>
<body data-page="{{ page }}"> <body data-page="{{ page }}">
@@ -309,8 +309,8 @@
<a href="/export/key_monitor_history">关键位历史</a> <a href="/export/key_monitor_history">关键位历史</a>
</div> </div>
<div class="stat-box"> <div class="stat-box">
<div class="stat-item"><div class="label">交易所</div><div class="value">{{ exchange_display }}</div></div> <div class="stat-item stat-item-desktop-only"><div class="label">交易所</div><div class="value">{{ exchange_display }}</div></div>
<div class="stat-item"><div class="label">总交易</div><div class="value">{{ total }}</div></div> <div class="stat-item stat-item-desktop-only"><div class="label">总交易</div><div class="value">{{ total }}</div></div>
<div class="stat-item"><div class="label">错过次数</div><div class="value">{{ miss_count }}</div></div> <div class="stat-item"><div class="label">错过次数</div><div class="value">{{ miss_count }}</div></div>
<div class="stat-item"><div class="label">胜率</div><div class="value">{{ rate }}%</div></div> <div class="stat-item"><div class="label">胜率</div><div class="value">{{ rate }}%</div></div>
<div class="stat-item"><div class="label">资金账户(USDT)</div><div class="value" id="total-capital">{% if funding_usdt is not none %}{{ funds_fmt(funding_usdt) }}U{% else %}—{% endif %}</div></div> <div class="stat-item"><div class="label">资金账户(USDT)</div><div class="value" id="total-capital">{% if funding_usdt is not none %}{{ funds_fmt(funding_usdt) }}U{% else %}—{% endif %}</div></div>
+3 -3
View File
@@ -269,7 +269,7 @@
.stats-split-row{grid-template-columns:1fr} .stats-split-row{grid-template-columns:1fr}
} }
</style> </style>
<link rel="stylesheet" href="/static/instance_theme.css?v=10"> <link rel="stylesheet" href="/static/instance_theme.css?v=11">
</head> </head>
<body data-page="{{ page }}"> <body data-page="{{ page }}">
@@ -359,8 +359,8 @@
<a href="/export/key_monitor_history">关键位历史</a> <a href="/export/key_monitor_history">关键位历史</a>
</div> </div>
<div class="stat-box"> <div class="stat-box">
<div class="stat-item"><div class="label">交易所</div><div class="value">{{ exchange_display }}</div></div> <div class="stat-item stat-item-desktop-only"><div class="label">交易所</div><div class="value">{{ exchange_display }}</div></div>
<div class="stat-item"><div class="label">总交易</div><div class="value">{{ total }}</div></div> <div class="stat-item stat-item-desktop-only"><div class="label">总交易</div><div class="value">{{ total }}</div></div>
<div class="stat-item"><div class="label">错过次数</div><div class="value">{{ miss_count }}</div></div> <div class="stat-item"><div class="label">错过次数</div><div class="value">{{ miss_count }}</div></div>
<div class="stat-item"><div class="label">胜率</div><div class="value">{{ rate }}%</div></div> <div class="stat-item"><div class="label">胜率</div><div class="value">{{ rate }}%</div></div>
<div class="stat-item"><div class="label">资金账户(USDT)</div><div class="value" id="total-capital">{% if funding_usdt is not none %}{{ money_fmt(funding_usdt) }}U{% else %}—{% endif %}</div></div> <div class="stat-item"><div class="label">资金账户(USDT)</div><div class="value" id="total-capital">{% if funding_usdt is not none %}{{ money_fmt(funding_usdt) }}U{% else %}—{% endif %}</div></div>
+3 -3
View File
@@ -232,7 +232,7 @@
.stats-period-block h3{font-size:1rem;color:#dbe4ff;margin-bottom:4px} .stats-period-block h3{font-size:1rem;color:#dbe4ff;margin-bottom:4px}
.stats-period-block .sub{font-size:.78rem;color:#8892b0;margin-bottom:10px;line-height:1.4} .stats-period-block .sub{font-size:.78rem;color:#8892b0;margin-bottom:10px;line-height:1.4}
</style> </style>
<link rel="stylesheet" href="/static/instance_theme.css?v=10"> <link rel="stylesheet" href="/static/instance_theme.css?v=11">
</head> </head>
<body data-page="{{ page }}"> <body data-page="{{ page }}">
@@ -309,8 +309,8 @@
<a href="/export/key_monitor_history">关键位历史</a> <a href="/export/key_monitor_history">关键位历史</a>
</div> </div>
<div class="stat-box"> <div class="stat-box">
<div class="stat-item"><div class="label">交易所</div><div class="value">{{ exchange_display }}</div></div> <div class="stat-item stat-item-desktop-only"><div class="label">交易所</div><div class="value">{{ exchange_display }}</div></div>
<div class="stat-item"><div class="label">总交易</div><div class="value">{{ total }}</div></div> <div class="stat-item stat-item-desktop-only"><div class="label">总交易</div><div class="value">{{ total }}</div></div>
<div class="stat-item"><div class="label">错过次数</div><div class="value">{{ miss_count }}</div></div> <div class="stat-item"><div class="label">错过次数</div><div class="value">{{ miss_count }}</div></div>
<div class="stat-item"><div class="label">胜率</div><div class="value">{{ rate }}%</div></div> <div class="stat-item"><div class="label">胜率</div><div class="value">{{ rate }}%</div></div>
<div class="stat-item"><div class="label">资金账户(USDT)</div><div class="value" id="total-capital">{% if funding_usdt is not none %}{{ funds_fmt(funding_usdt) }}U{% else %}—{% endif %}</div></div> <div class="stat-item"><div class="label">资金账户(USDT)</div><div class="value" id="total-capital">{% if funding_usdt is not none %}{{ funds_fmt(funding_usdt) }}U{% else %}—{% endif %}</div></div>
+139 -115
View File
@@ -2501,121 +2501,6 @@ body.login-page {
font-size: 15px; font-size: 15px;
} }
.ai-mobile-tabs {
display: flex;
gap: 8px;
margin-bottom: 8px;
flex-shrink: 0;
}
.ai-mobile-tab {
flex: 1;
min-height: 40px;
padding: 8px 12px;
border-radius: 8px;
border: 1px solid var(--border-soft);
background: var(--inset-surface);
color: var(--muted);
font-family: var(--font);
font-size: 0.82rem;
font-weight: 600;
cursor: pointer;
}
.ai-mobile-tab.is-active {
color: var(--text);
border-color: var(--accent);
background: var(--accent-dim);
box-shadow: var(--glow);
}
body.hub-page-ai .app-shell {
padding-bottom: max(8px, env(safe-area-inset-bottom));
height: 100dvh;
max-height: 100dvh;
overflow: hidden;
}
body.hub-page-ai {
overflow: hidden;
}
body.hub-page-ai #page-ai {
overflow: hidden;
}
.ai-layout {
grid-template-columns: 1fr;
grid-template-rows: minmax(0, 1fr);
overflow: hidden;
}
.ai-layout[data-ai-mobile-tab="chat"] .ai-summary-panel {
display: none;
}
.ai-layout[data-ai-mobile-tab="summary"] .ai-chat-panel {
display: none;
}
.ai-layout[data-ai-mobile-tab="chat"] .ai-chat-panel,
.ai-layout[data-ai-mobile-tab="summary"] .ai-summary-panel {
display: flex;
min-height: 0;
height: 100%;
}
.ai-chat-panel {
padding-bottom: 0;
}
.ai-chat-messages {
padding-bottom: 8px;
}
.ai-chat-form {
position: sticky;
bottom: 0;
z-index: 3;
margin: 0 -14px;
padding: 10px 14px max(10px, env(safe-area-inset-bottom));
background: color-mix(in srgb, var(--panel) 92%, transparent);
backdrop-filter: blur(10px);
border-top: 1px solid var(--border-soft);
box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.28);
}
.ai-chat-form textarea {
min-height: 44px;
max-height: 120px;
font-size: 16px;
}
.ai-chat-compose-actions {
display: grid;
grid-template-columns: auto 1fr auto;
gap: 8px;
align-items: center;
}
.ai-chat-upload-btn,
#btn-ai-chat-send {
min-height: 44px;
}
#btn-ai-chat-send {
min-width: 76px;
font-weight: 600;
}
.ai-msg-row-user {
max-width: 92%;
}
.ai-msg-row-coach {
max-width: 96%;
}
.page-head { .page-head {
margin: 16px 0 12px; margin: 16px 0 12px;
} }
@@ -3925,6 +3810,145 @@ body.hub-page-ai #page-ai {
.ai-mobile-tabs { .ai-mobile-tabs {
display: none; display: none;
} }
/* 手机 AI:须在 .ai-layout 双列定义之后,避免被覆盖成半屏 */
@media (max-width: 720px) {
body.hub-page-ai .app-shell {
padding-bottom: max(8px, env(safe-area-inset-bottom));
height: 100dvh;
max-height: 100dvh;
overflow: hidden;
width: 100%;
max-width: none;
}
body.hub-page-ai {
overflow: hidden;
}
body.hub-page-ai #page-ai {
overflow: hidden;
width: 100%;
min-width: 0;
}
body.hub-page-ai .ai-mobile-tabs {
display: flex;
gap: 8px;
margin-bottom: 8px;
flex-shrink: 0;
width: 100%;
}
body.hub-page-ai .ai-mobile-tab {
flex: 1;
min-height: 40px;
padding: 8px 12px;
border-radius: 8px;
border: 1px solid var(--border-soft);
background: var(--inset-surface);
color: var(--muted);
font-family: var(--font);
font-size: 0.82rem;
font-weight: 600;
cursor: pointer;
}
body.hub-page-ai .ai-mobile-tab.is-active {
color: var(--text);
border-color: var(--accent);
background: var(--accent-dim);
box-shadow: var(--glow);
}
body.hub-page-ai .ai-layout {
display: flex;
flex-direction: column;
width: 100%;
min-width: 0;
flex: 1 1 auto;
min-height: 0;
gap: 0;
overflow: hidden;
}
body.hub-page-ai .ai-layout[data-ai-mobile-tab="chat"] .ai-summary-panel,
body.hub-page-ai .ai-layout[data-ai-mobile-tab="summary"] .ai-chat-panel {
display: none !important;
}
body.hub-page-ai .ai-layout[data-ai-mobile-tab="chat"] .ai-chat-panel,
body.hub-page-ai .ai-layout[data-ai-mobile-tab="summary"] .ai-summary-panel {
display: flex;
flex: 1 1 auto;
width: 100%;
max-width: 100%;
min-height: 0;
min-width: 0;
}
body.hub-page-ai .ai-panel {
width: 100%;
max-width: 100%;
min-width: 0;
box-sizing: border-box;
}
body.hub-page-ai .ai-chat-panel {
padding-bottom: 0;
}
body.hub-page-ai .ai-chat-messages {
padding-bottom: 8px;
}
body.hub-page-ai .ai-chat-form {
position: sticky;
bottom: 0;
z-index: 3;
width: 100%;
margin: 0;
padding: 10px 0 max(10px, env(safe-area-inset-bottom));
background: color-mix(in srgb, var(--panel) 92%, transparent);
backdrop-filter: blur(10px);
border-top: 1px solid var(--border-soft);
box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.28);
}
body.hub-page-ai .ai-chat-form textarea {
min-height: 44px;
max-height: 120px;
font-size: 16px;
width: 100%;
}
body.hub-page-ai .ai-chat-compose-actions {
display: grid;
grid-template-columns: auto 1fr auto;
gap: 8px;
align-items: center;
width: 100%;
}
body.hub-page-ai .ai-chat-upload-btn,
body.hub-page-ai #btn-ai-chat-send {
min-height: 44px;
}
body.hub-page-ai #btn-ai-chat-send {
min-width: 76px;
font-weight: 600;
}
body.hub-page-ai .ai-msg-row-user {
max-width: 92%;
}
body.hub-page-ai .ai-msg-row-coach {
max-width: 96%;
}
}
.ai-panel { .ai-panel {
background: var(--panel); background: var(--panel);
border: 1px solid var(--border-soft); border: 1px solid var(--border-soft);
+2 -2
View File
@@ -15,7 +15,7 @@
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Orbitron:wght@500;600;700&display=swap" rel="stylesheet" media="print" onload="this.media='all'" /> <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Orbitron:wght@500;600;700&display=swap" rel="stylesheet" media="print" onload="this.media='all'" />
<noscript><link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Orbitron:wght@500;600;700&display=swap" rel="stylesheet" /></noscript> <noscript><link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Orbitron:wght@500;600;700&display=swap" rel="stylesheet" /></noscript>
<link rel="stylesheet" href="/assets/app.css?v=20260609-hub-mobile-ai-v1" /> <link rel="stylesheet" href="/assets/app.css?v=20260609-hub-mobile-ai-v2" />
</head> </head>
<body> <body>
<div class="app-bg" aria-hidden="true"></div> <div class="app-bg" aria-hidden="true"></div>
@@ -424,6 +424,6 @@
<script src="/assets/chart.js?v=20260608-market-tz8"></script> <script src="/assets/chart.js?v=20260608-market-tz8"></script>
<script src="/assets/archive.js?v=20260608-hub-archive-history"></script> <script src="/assets/archive.js?v=20260608-hub-archive-history"></script>
<script src="/assets/ai_review_render.js?v=2"></script> <script src="/assets/ai_review_render.js?v=2"></script>
<script src="/assets/app.js?v=20260609-hub-mobile-ai-v1"></script> <script src="/assets/app.js?v=20260609-hub-mobile-ai-v2"></script>
</body> </body>
</html> </html>
+40
View File
@@ -1,3 +1,43 @@
/* 实例页手机端:顶栏统计精简 */
@media (max-width: 720px) {
.stat-box > .stat-item-desktop-only {
display: none !important;
}
.stat-box {
gap: 8px;
margin-bottom: 12px;
}
.stat-box > .stat-item:last-child:nth-child(odd) {
grid-column: 1 / -1;
}
.stat-item {
min-height: 64px;
padding: 10px 8px;
}
.stat-item .value {
font-size: 1.1rem;
}
.export-bar > span:first-child {
display: none;
}
.export-bar {
gap: 6px;
margin-bottom: 10px;
}
.export-bar a {
flex: 1 1 auto;
text-align: center;
min-width: 0;
}
}
/* 实例页亮色主题(覆盖模板内联暗色样式) */ /* 实例页亮色主题(覆盖模板内联暗色样式) */
html[data-theme="light"] { html[data-theme="light"] {
color-scheme: light; color-scheme: light;