:root {
  font-family: PingFang SC, Microsoft YaHei, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  color: #f5f7ff;
  background: radial-gradient(circle at top, rgba(99,132,255,.14), transparent 34%), linear-gradient(180deg,#2c2f36,#23252c);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  min-width: 320px;
  background: #23252c;
}
body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
}
[v-cloak] {
  display: none;
}
#app {
  min-height: 100dvh;
}
.app-shell {
  min-height: 100dvh;
  padding: 4px;
}
.phone-page {
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 10px 8px 30px;
  border-radius: 26px;
  background: #1e1e1e;
  box-shadow: 0 20px 50px #00000059, inset 0 1px #ffffff0f;
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: scroll-position;
  overscroll-behavior: none;
}
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: #ccc;
  font-size: 16px;
}
.summary-panel {
  margin-bottom: 12px;
}
.summary-grid {
  display: flex;
  justify-content: space-between;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.07);
  padding: 6px;
}
.summary-card {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  text-align: center;
}
.summary-name {
  margin: 0;
  color: #f5f7ff;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.summary-value {
  margin: 8px 0 0;
  font-size: 18px;
  font-weight: 700;
}
.summary-note-line {
  font-size: 12px;
  color: #ccc;
  text-align: center;
  margin-top: 8px;
}
.summary-note-line .highlight {
  color: #ff9800;
}
.fund-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 20px;
}
.fund-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 5px 10px;
  border: 0 solid rgba(255,96,96,.9);
  border-radius: 5px;
  background: #ffffff26;
  color: inherit;
  text-align: left;
}
.fund-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.fund-name {
  display: inline-flex;
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 16px;
  white-space: nowrap;
}

/* ====================== 盘前/盘后/收盘 标签 ====================== */
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: #fff;
  background-color: #4a5568;
  margin-left: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ====================== 右下角收盘/24h切换按钮 ====================== */
.snapshot-switch {
  position: fixed;
  right: 15px;
  bottom: 15px;
  z-index: 999;
  display: flex;
  gap: 8px;
}
.snapshot-switch button {
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.snapshot-switch button.active {
  background: #4a90e2;
}

.session-badge {
  display: inline-flex;
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: #83a9ff3d;
  color: #eef3ff;
  font-size: 12px;
  line-height: 1.3;
}
.fund-impact {
  display: inline-flex;
  flex-shrink: 0;
  margin-left: 12px;
  font-size: 16px;
  font-weight: 700;
  font-family: monospace;
}
.detail-header {
  margin-bottom: 10px;
}
.back-button {
  margin-bottom: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #bcc8ff;
}
.detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.detail-title {
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}
.detail-impact {
  margin: 0;
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 700;
}
.holdings-card {
  overflow: hidden;
  border-radius: 10px;
  background: #ffffff0a;
}
.table-head,
.table-row {
  display: grid;
  grid-template-columns: minmax(0,1.6fr) 80px 80px;
  align-items: center;
  gap: 2px;
  padding: 12px;
}
.stock-change {
  font-family: monospace;
  font-weight: 700;
}
.table-head {
  border-bottom: 1px solid rgba(255,255,255,.16);
  color: #f9fbff;
  font-size: 15px;
  font-weight: 700;
}
.table-row {
  border-bottom: 1px solid rgba(255,255,255,.16);
  color: #fff;
  font-size: 15px;
}
.table-row:last-of-type {
  border-bottom: 0;
}
.stock-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stock-weight,
.stock-change,
.table-head span:nth-child(2),
.table-head span:nth-child(3) {
  text-align: right;
}
.expand-button {
  width: 100%;
  padding: 14px 12px;
  border: 0;
  border-top: 1px solid rgba(255,255,255,.16);
  background: transparent;
  color: #f2f4ff;
  font-size: 16px;
  text-align: center;
}
.detail-note {
  margin: 12px 4px 0;
  color: #f2f4ff;
  font-size: 13px;
  text-align: center;
}
.state-card {
  display: flex;
  min-height: 320px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}
.state-title {
  margin: 0;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}
.state-text {
  margin: 0;
  color: #c7c8cf;
}
.retry-button {
  padding: 10px 16px;
  border: 1px solid rgba(131,169,255,.5);
  border-radius: 10px;
  background: #83a9ff24;
  color: #f4f7ff;
}

/* 颜色规则 */
.is-up { color: #ff4d4f; }
.is-down { color: #36c275; }
.is-flat { color: #e8ebf3; }

@media (max-width: 420px) {
  .app-shell {
    padding: 0;
  }
  .phone-page {
    width: 100%;
    min-height: 100dvh;
    padding: 4px 4px 30px;
    border-radius: 0;
  }
  .summary-name {
    font-size: 12px;
  }
  .fund-name,
  .fund-impact,
  .table-head,
  .table-row,
  .detail-impact {
    font-size: 14px;
  }
}

/* ====================== 加载页面（框架内） ====================== */
.loading-page {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 100dvh;
  background: #1e1e1e;
}

.loading-content {
  text-align: center;
}

.loading-title {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.loading-subtitle {
  color: #c7c8cf;
  font-size: 14px;
}

/* ====================== 错误页面 ====================== */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 100dvh;
  background: #1e1e1e;
}

.error-content {
  text-align: center;
}

.error-title {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.error-subtitle {
  color: #c7c8cf;
  font-size: 14px;
  margin-bottom: 24px;
}

.retry-button {
  padding: 10px 16px;
  border: 1px solid rgba(131,169,255,.5);
  border-radius: 10px;
  background: #83a9ff24;
  color: #f4f7ff;
  font-size: 16px;
  cursor: pointer;
}

.retry-button:active {
  opacity: 0.7;
}
