/* styles.css */
:root {
  /* 支付宝主色调 */
  --alipay-blue: #1677ff;
  --alipay-blue-hover: #4096ff;
  --alipay-blue-light: #e6f4ff;
  --alipay-blue-dark: #0958d9;

  /* 支付宝辅助色 */
  --alipay-success: #52c41a;
  --alipay-warning: #faad14;
  --alipay-error: #ff4d4f;

  /* 支付宝中性色 */
  --alipay-text-primary: #262626;
  --alipay-text-secondary: #8c8c8c;
  --alipay-text-tertiary: #bfbfbf;
  --alipay-bg: #f5f5f5;
  --alipay-bg-light: #fafafa;
  --alipay-border: #e8e8e8;

  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial,
    sans-serif;
  color: var(--alipay-text-primary);
  background: linear-gradient(180deg, #f0f5ff 0%, #f5f5f5 100%);
  min-height: 100vh;
}

/* Prevent Vue-bound sections from flashing before mount */
[v-cloak] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

header {
  background: linear-gradient(
    135deg,
    var(--alipay-blue) 0%,
    var(--alipay-blue-dark) 100%
  );
  color: white;
  padding: 1.5rem 1rem;
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.15);
  margin-bottom: 1.5rem;
  position: relative; /* 为绝对定位做准备 */
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  position: relative;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1; /* 占据剩余空间 */
}

.header-icon {
  width: 48px;
  height: 48px;
  display: block;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

#qrcode-container {
  background: white;
  padding: 5px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 1rem; /* 与文字保持距离 */
}

#qrcode-container:hover {
  transform: scale(1.1);
}

/* 确保二维码图片不超出容器 */
#qrcode-container img {
  display: block;
}

header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
  color: white;
}

header p {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  opacity: 0.9;
  color: rgba(255, 255, 255, 0.9);
}

nav {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
}

.nav-link {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  text-decoration: none;
  border-radius: 20px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  box-sizing: border-box;
  line-height: 1.5;
  font-weight: 500;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ai-diagnose-btn {
  background: linear-gradient(135deg, #722ed1 0%, #b37feb 100%) !important;
  color: white !important;
  border: none !important;
  cursor: pointer;
  padding: 0.5rem 0.75rem !important;
  font-size: 0.9rem !important;
  height: 36px !important;
  line-height: 1.5 !important;
  font-weight: 500 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  border-radius: 20px !important;
  transition: all 0.3s ease !important;
  backdrop-filter: blur(10px) !important;
  gap: 0.25rem !important;
  flex: 0 0 auto !important;
  width: auto !important;
}

.ai-diagnose-btn:hover {
  background: linear-gradient(135deg, #9254de 0%, #c41d7f 100%) !important;
}

.ai-diagnose-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* AI按钮图标和文字 */
.ai-btn-icon {
  font-size: 1rem;
  display: inline-block;
}

.ai-btn-text {
  display: inline-block;
}

/* AI按钮始终显示图标+文字 */
.ai-diagnose-btn {
  padding: 0.5rem 0.75rem !important;
}

/* 更多菜单样式 */
.nav-more-menu {
  position: relative;
  display: inline-block;
}

.nav-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  text-decoration: none;
  border-radius: 20px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  white-space: nowrap;
  height: 36px;
  box-sizing: border-box;
  line-height: 1.5;
  font-weight: 500;
  cursor: pointer;
}

.nav-more-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.more-icon {
  transition: transform 0.3s ease;
}

.nav-more-btn[aria-expanded='true'] .more-icon {
  transform: rotate(180deg);
}

.nav-more-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  z-index: 1000;
  overflow: hidden;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-more-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--alipay-text-primary);
  text-decoration: none;
  transition: background 0.2s ease;
  font-size: 0.9rem;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.nav-more-item:hover {
  background: var(--alipay-bg-light);
}

.nav-more-icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

/* 桌面端：显示所有按钮，隐藏"更多"菜单 */
@media (min-width: 1024px) {
  .nav-link-primary,
  .nav-link-secondary {
    display: inline-flex !important;
  }

  .nav-more-menu {
    display: none !important;
  }

  /* 确保AI按钮在桌面端也和其他按钮一样，不会独占一行 */
  .ai-diagnose-btn {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: auto !important;
    max-width: none !important;
  }
}

/* 中等屏幕：隐藏次要按钮，使用"更多"菜单 */
@media (min-width: 768px) and (max-width: 1023px) {
  .nav-link-primary {
    display: inline-flex !important;
  }

  .nav-link-secondary {
    display: none !important;
  }

  .nav-more-menu {
    display: inline-block !important;
  }
}

/* 移动端：所有按钮换行显示，隐藏"更多"菜单 */
@media (max-width: 767px) {
  .nav-link-primary,
  .nav-link-secondary {
    display: inline-flex !important;
  }

  .nav-more-menu {
    display: none !important;
  }
}

.btn-link {
  padding: 0.5rem 1rem;
  background: var(--alipay-success);
  color: white;
  text-decoration: none;
  border-radius: 20px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  display: inline-block;
  margin-left: 0.5rem;
  box-shadow: 0 2px 8px rgba(82, 196, 26, 0.3);
}

.btn-link:hover {
  background: #73d13d;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(82, 196, 26, 0.4);
}

h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
}

h2 {
  margin: 0 0 1.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--alipay-text-primary);
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: white;
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 1px solid var(--alipay-border);
}

.card:hover {
  box-shadow: 0 4px 24px rgba(22, 119, 255, 0.12);
  transform: translateY(-2px);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

label {
  font-size: 0.9rem;
  color: var(--alipay-text-primary);
  font-weight: 500;
}

input,
textarea,
select {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--alipay-border);
  font-size: 1rem;
  transition: all 0.3s ease;
  background: white;
  color: var(--alipay-text-primary);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--alipay-blue);
  box-shadow: 0 0 0 3px var(--alipay-blue-light);
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--alipay-blue);
}

textarea {
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
}

button {
  background: linear-gradient(
    135deg,
    var(--alipay-blue) 0%,
    var(--alipay-blue-dark) 100%
  );
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.3);
  width: 100%;
  margin-top: 0.5rem;
}

button:hover {
  background: linear-gradient(
    135deg,
    var(--alipay-blue-hover) 0%,
    var(--alipay-blue) 100%
  );
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.4);
}

button:active {
  transform: translateY(0);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

#asset-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.asset-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  background: var(--alipay-bg-light);
  border: 1px solid var(--alipay-border);
  transition: all 0.3s ease;
  margin-bottom: 0.5rem;
  gap: 1rem;
}

.asset-row:hover {
  background: var(--alipay-blue-light);
  border-color: var(--alipay-blue);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.1);
}

.asset-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.asset-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.asset-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.asset-edit-btn {
  background: transparent;
  border: 1px solid var(--alipay-border);
  color: var(--alipay-text-secondary);
  padding: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  box-shadow: none;
}

.asset-edit-btn:hover {
  background: var(--alipay-blue);
  border-color: var(--alipay-blue);
  color: white;
  transform: scale(1.1);
}

.asset-description {
  font-size: 0.8rem;
  color: var(--alipay-text-tertiary);
  font-style: italic;
  margin-top: 0.25rem;
}

.asset-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--alipay-text-primary);
}

.asset-category {
  font-size: 0.85rem;
  color: var(--alipay-text-secondary);
}

.asset-owner {
  font-size: 0.8rem;
  color: var(--alipay-text-tertiary);
}

.asset-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--alipay-blue);
  font-family:
    'SF Pro Display',
    -apple-system,
    sans-serif;
}

.total-row {
  background: linear-gradient(
    135deg,
    var(--alipay-blue-light) 0%,
    #e6f4ff 100%
  );
  margin-top: 1rem;
  padding: 1.25rem;
  border: 2px solid var(--alipay-blue);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.15);
}

.total-row .asset-value {
  font-size: 1.5rem;
  color: var(--alipay-blue-dark);
  font-weight: 700;
}

.tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  margin: 1rem 0 0.75rem;
  background: linear-gradient(90deg, var(--alipay-bg-light) 0%, white 100%);
  border-left: 4px solid;
  border-radius: 8px;
  font-size: 1.05rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tier-header strong {
  color: var(--alipay-text-primary);
  font-weight: 600;
}

.tier-desc {
  display: block;
  font-size: 0.85rem;
  color: var(--alipay-text-secondary);
  font-weight: normal;
  margin-top: 0.25rem;
}

.tier-total {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--alipay-blue);
  font-family:
    'SF Pro Display',
    -apple-system,
    sans-serif;
}

.filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filters label {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.9rem;
  color: var(--alipay-text-secondary);
}

.filters input[type='date'] {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--alipay-border);
  font-size: 0.9rem;
}

.filters button {
  padding: 0.5rem 1rem;
  width: auto;
  margin-top: 0;
  font-size: 0.9rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.section-header h2 {
  margin: 0;
}

.section-header button {
  width: auto;
  margin-top: 0;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.field-hint {
  color: var(--alipay-text-tertiary);
  font-weight: normal;
  font-size: 0.85em;
}

.field-help {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--alipay-text-secondary);
  line-height: 1.4;
}

.category-custom-input {
  margin-top: 0.5rem;
}

/* 可折叠内容区域 - Grid 方案 */
.collapsible-content {
  display: grid;
  grid-template-rows: 1fr;
  transition:
    grid-template-rows 0.3s ease-out,
    opacity 0.3s ease-out,
    padding 0.3s ease;
  opacity: 1;
}

.collapsible-content.collapsed {
  grid-template-rows: 0fr;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
}

/* 必须确保 grid item overflow hidden 才能实现 0fr 隐藏 */
.collapsible-content > div {
  overflow: hidden;
  min-height: 0; /* 允许 grid item 压缩到 0 */
}

/* 切换折叠按钮 */
.toggle-collapse-btn {
  background: none; /* 移除背景 */
  border: none; /* 移除边框 */
  padding: 0; /* 移除内边距 */
  margin: 0;
  cursor: pointer;
  width: 32px; /* 固定大小 */
  height: 32px;
  display: inline-flex; /* 允许 flex 对齐图标 */
  align-items: center;
  justify-content: center;
  border-radius: 50%; /* 圆形按钮 */
  transition: background-color 0.3s ease;
  box-shadow: none; /* 移除阴影 */
  color: var(--alipay-text-secondary);
}

.toggle-collapse-btn:hover {
  background-color: var(--alipay-bg); /* 鼠标悬停背景色 */
  transform: none; /* 移除hover转换 */
  box-shadow: none; /* 移除hover阴影 */
  color: var(--alipay-text-primary);
}

/* 折叠图标 */
.collapse-icon {
  transition: transform 0.3s ease;
  transform: rotate(180deg); /* 默认朝下 */
}

.toggle-collapse-btn[aria-expanded='true'] .collapse-icon {
  transform: rotate(0deg); /* 展开时朝上 */
}

/* 其他按钮样式，防止冲突 */
.btn-icon-only {
  background: var(--alipay-blue-light);
  color: var(--alipay-blue);
  padding: 0;
  margin-left: 0.5rem; /* 与刷新按钮的间距 */
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.15);
}

.btn-icon-only:hover {
  background: var(--alipay-blue);
  color: white;
}

/* 覆盖通用button样式 */
.section-header button {
  width: auto;
  margin-top: 0;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* 资产配置金字塔样式 */
.pyramid-container {
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: auto;
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  gap: 1rem;
  width: 100%;
}

.pyramid-row {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 1rem;
}

.pyramid-row-label {
  width: 100px;
  flex-shrink: 0;
  text-align: right;
  font-weight: 700;
  font-size: 1rem;
  padding-right: 0.5rem;
}

.pyramid-row-percent {
  width: 70px; /* 固定宽度，确保对齐 */
  flex-shrink: 0;
  text-align: right; /* 数字右对齐 */
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--alipay-text-primary);
  margin-left: auto; /* 推到最右侧 */
  white-space: nowrap; /* 防止换行 */
  overflow: hidden; /* 防止溢出 */
  text-overflow: ellipsis; /* 如果溢出显示省略号 */
}

.pyramid-tier {
  position: relative;
  width: var(--tier-width); /* 由JS控制宽度 */
  min-width: 150px; /* 减小最小宽度，避免挤压百分比 */
  max-width: calc(100% - 200px); /* 确保不会挤压百分比和标签 */
  height: auto;
  min-height: 60px;
  background-color: var(--tier-color);
  border: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center; /* 内容居中 */
  color: var(--tier-text-color);
  flex-shrink: 1; /* 允许收缩 */
}

.pyramid-tier:hover {
  transform: scale(1.01);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.pyramid-tier-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.75rem;
  text-align: center;
  width: 100%;
}

.pyramid-tier-amount {
  font-size: 1.1rem;
  font-weight: 700;
  color: inherit;
  font-family:
    'SF Pro Display',
    -apple-system,
    sans-serif;
  white-space: nowrap;
}

.pyramid-tier-desc {
  font-size: 0.75rem;
  color: inherit;
  opacity: 0.85;
  margin-top: 0.1rem;
  line-height: 1.2;
}

.pyramid-total {
  margin-top: 1.5rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(
    135deg,
    var(--alipay-blue-light) 0%,
    #e6f4ff 100%
  );
  border: 2px solid var(--alipay-blue);
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.15);
  min-width: 200px;
}

.pyramid-total-label {
  font-size: 0.9rem;
  color: var(--alipay-text-secondary);
  margin-bottom: 0.5rem;
}

.pyramid-total-amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--alipay-blue-dark);
  font-family:
    'SF Pro Display',
    -apple-system,
    sans-serif;
}

/* 登录按钮脉冲动画 */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* 用户信息下拉菜单样式 */
.user-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.user-info-trigger {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 20px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  box-sizing: border-box;
  line-height: 1.5;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.user-info-trigger:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  overflow: hidden;
}

.user-menu:hover .user-menu-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-menu-header {
  padding: 1rem;
  background: linear-gradient(
    135deg,
    var(--alipay-blue-light) 0%,
    #e6f4ff 100%
  );
  border-bottom: 1px solid var(--alipay-border);
}

.user-menu-email {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--alipay-text-primary);
  margin-bottom: 0.25rem;
}

.user-menu-status {
  font-size: 0.8rem;
  color: var(--alipay-text-secondary);
}

.user-menu-divider {
  height: 1px;
  background: var(--alipay-border);
  margin: 0.5rem 0;
}

.user-menu-item {
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--alipay-text-primary);
  font-size: 0.9rem;
  transition: background 0.2s ease;
}

.user-menu-item:hover {
  background: var(--alipay-bg-light);
}

.user-menu-icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

/* 模态框样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--alipay-text-primary);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--alipay-text-secondary);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: var(--alipay-bg);
  color: var(--alipay-text-primary);
}

.modal-form {
  padding: 1.5rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

.btn-cancel {
  background: var(--alipay-bg);
  color: var(--alipay-text-primary);
  border: 1px solid var(--alipay-border);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  width: auto;
  margin: 0;
  box-shadow: none;
}

.btn-cancel:hover {
  background: var(--alipay-border);
  transform: none;
}

.btn-submit {
  background: linear-gradient(
    135deg,
    var(--alipay-blue) 0%,
    var(--alipay-blue-dark) 100%
  );
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  width: auto;
  margin: 0;
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.3);
}

.btn-submit:hover {
  background: linear-gradient(
    135deg,
    var(--alipay-blue-hover) 0%,
    var(--alipay-blue) 100%
  );
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.4);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--alipay-bg);
  color: var(--alipay-text-primary);
  border: 1px solid var(--alipay-border);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  width: auto;
  margin: 0;
  box-shadow: none;
}

.btn-secondary:hover {
  background: var(--alipay-border);
  transform: translateY(-1px);
}

/* AI 分析相关样式 */
.ai-controls {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--alipay-border);
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.ai-controls label {
  font-weight: 600;
  color: var(--alipay-text-primary);
  white-space: nowrap;
}

.ai-controls select {
  flex: 1;
  min-width: 200px;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--alipay-border);
  font-size: 0.9rem;
}

.ai-controls select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ai-result-content {
  padding: 1.5rem;
  overflow-y: auto;
  max-height: 70vh;
  line-height: 1.6;
  font-size: 0.95rem;
  color: var(--alipay-text-primary);
}

.ai-result-content h1,
.ai-result-content h2,
.ai-result-content h3,
.ai-result-content h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--alipay-text-primary);
  font-weight: 600;
}

.ai-result-content h1 {
  font-size: 1.5rem;
  border-bottom: 2px solid var(--alipay-border);
  padding-bottom: 0.5rem;
}

.ai-result-content h2 {
  font-size: 1.3rem;
}

.ai-result-content h3 {
  font-size: 1.1rem;
}

.ai-result-content p {
  margin: 0.75rem 0;
  line-height: 1.8;
}

.ai-result-content ul,
.ai-result-content ol {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
  line-height: 1.8;
}

.ai-result-content li {
  margin: 0.5rem 0;
}

.ai-result-content code {
  background: var(--alipay-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'Courier New', monospace;
}

.ai-result-content pre {
  background: var(--alipay-bg);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1rem 0;
  border: 1px solid var(--alipay-border);
}

.ai-result-content pre code {
  background: none;
  padding: 0;
}

.ai-result-content blockquote {
  border-left: 4px solid var(--alipay-blue);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--alipay-text-secondary);
  font-style: italic;
}

.ai-loading {
  text-align: center;
  padding: 3rem 2rem;
}

.ai-loading p {
  font-size: 1.1rem;
  color: var(--alipay-text-primary);
  margin: 0.5rem 0;
}

.ai-loading-hint {
  font-size: 0.9rem;
  color: var(--alipay-text-secondary);
}

.ai-error {
  color: var(--alipay-error);
  padding: 1rem;
  background: rgba(255, 77, 79, 0.1);
  border-radius: 8px;
  border: 1px solid var(--alipay-error);
}

.ai-empty {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--alipay-text-secondary);
}

.ai-history-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.ai-history-item {
  border: 1px solid var(--alipay-border);
  border-radius: 12px;
  padding: 1.5rem;
  background: var(--alipay-bg-light);
  transition: all 0.3s ease;
}

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

.ai-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--alipay-border);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ai-history-date {
  font-weight: 600;
  color: var(--alipay-text-primary);
}

.ai-history-model {
  font-size: 0.85rem;
  color: var(--alipay-text-secondary);
  background: var(--alipay-bg);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
}

.ai-history-content {
  line-height: 1.8;
  color: var(--alipay-text-primary);
}

.ai-history-content h1,
.ai-history-content h2,
.ai-history-content h3 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.ai-history-content p {
  margin: 0.5rem 0;
}

/* 隐私声明底部样式 */
.privacy-footer {
  margin-top: 3rem;
  padding: 1.5rem 1rem;
  background: var(--alipay-bg-light);
  border-top: 1px solid var(--alipay-border);
}

.privacy-footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.privacy-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: white;
  border: 1px solid var(--alipay-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  color: var(--alipay-text-primary);
  font-weight: 500;
}

.privacy-toggle:hover {
  background: var(--alipay-blue-light);
  border-color: var(--alipay-blue);
  color: var(--alipay-blue-dark);
}

.privacy-toggle[aria-expanded='true'] .privacy-icon {
  transform: rotate(180deg);
}

.privacy-icon {
  transition: transform 0.3s ease;
  color: var(--alipay-text-secondary);
}

.privacy-content {
  margin-top: 1rem;
  padding: 1.5rem;
  background: white;
  border-radius: 12px;
  border: 1px solid var(--alipay-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.privacy-section {
  margin-bottom: 1.5rem;
}

.privacy-section:last-child {
  margin-bottom: 0;
}

.privacy-section h4 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--alipay-blue-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.privacy-section h4::before {
  content: '';
  width: 4px;
  height: 16px;
  background: var(--alipay-blue);
  border-radius: 2px;
  display: inline-block;
  margin-right: 0.5rem;
}

.privacy-section p {
  margin: 0;
  line-height: 1.8;
  color: var(--alipay-text-primary);
  font-size: 0.9rem;
}

.privacy-section strong {
  color: var(--alipay-blue-dark);
  font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  /* 中等屏幕：调整三列布局 */
  main > div:first-child {
    grid-template-columns: 1.5fr 1fr 0.9fr !important;
  }
}

@media (max-width: 768px) {
  main {
    grid-template-columns: 1fr;
    padding: 0 0.75rem 1.5rem;
  }

  /* 移动端：三列变为单列 */
  main > div:first-child {
    grid-template-columns: 1fr !important;
  }

  main > div:first-child section {
    max-width: 100% !important;
  }

  header {
    padding: 1rem 0.75rem;
  }

  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  /* 在小屏幕上，重新排列头部元素 */
  .brand-wrapper {
    flex-wrap: wrap;
    justify-content: center; /* 居中对齐 */
    text-align: center;
    width: 100%;
  }

  .brand-text {
    align-items: center; /* 文字居中 */
  }

  #qrcode-container {
    display: none; /* 小屏幕隐藏二维码 */
  }

  nav {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center; /* 导航居中 */
    margin-top: 1rem;
  }

  .card {
    padding: 1.25rem;
  }

  /* 添加新的移动端适配样式 */
  .asset-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .asset-actions {
    width: 100%;
    justify-content: space-between;
  }

  .tier-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .tier-total {
    align-self: flex-end;
  }

  .pyramid-row {
    flex-wrap: nowrap; /* 保持单行，但压缩宽度 */
    gap: 0.5rem;
  }

  .pyramid-row-label {
    width: 70px;
    font-size: 0.85rem;
  }

  .pyramid-tier {
    min-width: 100px; /* 减小最小宽度 */
  }

  .pyramid-row-percent {
    width: 55px;
    font-size: 0.8rem;
  }
}

/* ==================== Toast 通知样式（居中显示） ==================== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: white;
  color: var(--alipay-text-primary);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  font-size: 1rem;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 90%;
  text-align: center;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

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

.toast-error {
  background: var(--alipay-error);
  color: white;
}

.toast-info {
  background: var(--alipay-blue);
  color: white;
}

/* ==================== 语言选择器样式 ==================== */
.language-selector {
  position: relative;
  display: inline-block;
  margin: 0;
  padding: 0;
  width: auto;
  min-width: fit-content;
}

#language-selector-container {
  display: inline-block;
  width: auto;
  min-width: fit-content;
}

.language-selector-btn {
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  height: 36px;
  box-sizing: border-box;
  backdrop-filter: blur(10px);
  white-space: nowrap;
  text-decoration: none;
  font-weight: 500;
  line-height: 1.5;
}

.language-selector-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.language-icon {
  font-size: 1rem;
}

.language-code {
  font-weight: 600;
  min-width: 2ch;
}

.language-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  min-width: 150px;
  z-index: 1000;
  overflow: hidden;
}

.language-option {
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s ease;
  font-size: 0.9rem;
  color: var(--alipay-text-primary);
}

.language-option:hover {
  background: var(--alipay-bg-light);
}

.language-option.active {
  background: var(--alipay-blue-light);
  color: var(--alipay-blue);
  font-weight: 600;
}

.language-name {
  flex: 1;
}

.language-check {
  color: var(--alipay-blue);
  font-weight: bold;
  margin-left: 0.5rem;
}


/* loading.css */
/**
 * 加载状态和骨架屏样式
 */

/* 骨架屏动画 */
@keyframes skeleton-loading {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.skeleton-container {
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-line,
.skeleton-avatar,
.skeleton-item,
.skeleton-row {
  background: linear-gradient(90deg, #f0f0f0 0%, #f8f8f8 50%, #f0f0f0 100%);
  background-size: 200px 100%;
  border-radius: 4px;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-card {
  padding: 1.5rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skeleton-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 8px;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-content {
  flex: 1;
}

.skeleton-chart {
  padding: 1rem;
}

.skeleton-table {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skeleton-row {
  display: flex;
  gap: 1rem;
  padding: 0.75rem;
}

/* 加载按钮样式 */
button.loading,
.btn-submit.loading,
.btn-secondary.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

button.loading::after,
.btn-submit.loading::after,
.btn-secondary.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* 加载中遮罩 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* 内联加载指示器 */
.inline-loader {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--alipay-border);
  border-top-color: var(--alipay-blue);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-left: 0.5rem;
}

/* 页面加载动画 - Wealth Insight 渐变文字效果 */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, #f0f5ff 0%, #e6f4ff 50%, #f5f5f5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 1;
  transition: opacity 0.5s ease-out;
}

.page-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-content {
  text-align: center;
  animation: fadeInUp 0.6s ease-out;
}

.loader-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(
    135deg,
    #1677ff 0%,
    #4096ff 25%,
    #722ed1 50%,
    #b37feb 75%,
    #1677ff 100%
  );
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
  letter-spacing: 0.05em;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial,
    sans-serif;
}

.loader-subtitle {
  font-size: 1.2rem;
  color: var(--alipay-text-secondary);
  margin-top: 0.75rem;
  font-weight: 500;
  opacity: 0.8;
  animation: fadeIn 0.8s ease-out 0.3s both;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .loader-title {
    font-size: 2.5rem;
  }

  .loader-subtitle {
    font-size: 1rem;
  }
}


/* validation.css */
/**
 * 表单验证样式
 */

/* 错误状态 */
.field-error {
  border-color: var(--alipay-error) !important;
  background-color: #fff1f0 !important;
}

.field-error:focus {
  border-color: var(--alipay-error) !important;
  box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2) !important;
}

.field-error-message {
  color: var(--alipay-error);
  font-size: 0.85rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.field-error-message::before {
  content: '⚠️';
  font-size: 0.9rem;
}

/* 成功状态 */
.field-success {
  border-color: var(--alipay-success) !important;
}

.field-success:focus {
  border-color: var(--alipay-success) !important;
  box-shadow: 0 0 0 2px rgba(82, 196, 26, 0.2) !important;
}

/* 输入提示 */
.field-hint {
  color: var(--alipay-text-secondary);
  font-size: 0.85rem;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.field-hint::before {
  content: '💡';
  font-size: 0.9rem;
}


/* empty-state.css */
/**
 * 空状态样式
 */

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--alipay-text-secondary);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.empty-state-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--alipay-text-primary);
  margin-bottom: 0.5rem;
}

.empty-state-message {
  font-size: 0.95rem;
  color: var(--alipay-text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.empty-state-action {
  margin-top: 1.5rem;
}


/* confirm.css */
/**
 * 确认对话框和撤销提示样式
 */

/* 确认对话框 */
.confirm-overlay {
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.confirm-dialog {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.confirm-icon {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 1rem;
}

.confirm-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--alipay-text-primary);
  text-align: center;
  margin-bottom: 0.75rem;
}

.confirm-message {
  color: var(--alipay-text-secondary);
  text-align: center;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.confirm-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.confirm-ok,
.confirm-cancel {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.confirm-ok {
  background: var(--alipay-blue);
  color: white;
}

.confirm-ok:hover {
  background: var(--alipay-blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.3);
}

.confirm-cancel {
  background: var(--alipay-bg);
  color: var(--alipay-text-primary);
  border: 1px solid var(--alipay-border);
}

.confirm-cancel:hover {
  background: var(--alipay-border);
}

/* 撤销提示条 */
.undo-bar {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--alipay-text-primary);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 10001;
  transition: bottom 0.3s ease-out;
  min-width: 300px;
  max-width: 90%;
}

.undo-bar.show {
  bottom: 2rem;
}

.undo-message {
  flex: 1;
  font-size: 0.95rem;
}

.undo-button {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.undo-button:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}


/* responsive.css */
/**
 * 移动端响应式样式
 * 
 * 针对小屏幕设备（手机、平板）优化布局和交互体验。
 */

/* ==================== 基础响应式断点 ==================== */
/* 
 * 断点定义：
 * - mobile: < 768px (手机)
 * - tablet: 768px - 1024px (平板)
 * - desktop: > 1024px (桌面)
 */

/* ==================== 移动端基础优化 ==================== */

@media (max-width: 768px) {
  /* 基础字体和间距调整 */
  :root {
    font-size: 14px;
  }

  body {
    padding: 0;
  }

  /* ==================== 头部导航优化 ==================== */
  header {
    padding: 1rem 0.75rem;
  }

  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  .brand-wrapper {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
  }

  .header-icon {
    width: 32px;
    height: 32px;
  }

  .brand-text h1 {
    font-size: 1.1rem;
    margin: 0;
  }

  .brand-text p {
    font-size: 0.85rem;
    margin: 0.25rem 0 0 0;
  }

  /* 隐藏二维码（移动端不需要） */
  #qrcode-container {
    display: none;
  }

  /* 导航栏优化 */
  nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-start;
  }

  .nav-link {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    flex: 1 1 auto;
    min-width: calc(50% - 0.25rem);
    text-align: center;
  }

  /* 确保AI按钮也遵循相同的flex规则，不会独占一行 */
  .ai-diagnose-btn {
    flex: 1 1 auto !important;
    min-width: calc(50% - 0.25rem) !important;
  }

  /* 移动端：隐藏"更多"菜单，所有按钮直接显示 */
  .nav-more-menu {
    display: none !important;
  }

  .nav-link-primary,
  .nav-link-secondary {
    display: inline-flex !important;
  }

  /* 用户菜单优化 */
  .user-menu {
    width: 100%;
    justify-content: center;
  }

  .user-info-trigger {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
  }

  .user-menu-dropdown {
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
  }

  /* ==================== 主内容区域优化 ==================== */
  main {
    padding: 1rem 0.75rem;
    max-width: 100%;
  }

  /* 卡片间距调整 */
  .card {
    margin-bottom: 1rem;
    padding: 1rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .section-header h2 {
    font-size: 1.2rem;
  }

  /* ==================== 网格布局优化 ==================== */
  /* 首页顶部三栏布局改为单列 */
  main > div:first-child {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  /* 财务续航卡片宽度恢复 */
  section.card[style*='max-width: 320px'] {
    max-width: 100% !important;
  }

  /* ==================== 按钮优化 ==================== */
  .btn-submit,
  .btn-secondary,
  .btn-link,
  button {
    min-height: 44px; /* 触摸友好尺寸 */
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  /* 按钮组优化 */
  .section-header > div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
  }

  .section-header .btn-link,
  .section-header button {
    flex: 1 1 auto;
    min-width: calc(50% - 0.25rem);
  }

  /* ==================== 表单优化 ==================== */
  .field {
    margin-bottom: 1rem;
  }

  .field label {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }

  input[type='text'],
  input[type='number'],
  input[type='date'],
  input[type='email'],
  input[type='password'],
  select,
  textarea {
    font-size: 16px; /* 防止iOS自动缩放 */
    padding: 0.75rem;
    min-height: 44px;
    width: 100%;
  }

  textarea {
    min-height: 100px;
  }

  /* 表单帮助文本 */
  .field-help,
  .field-hint {
    font-size: 0.8rem;
    margin-top: 0.25rem;
  }

  /* ==================== 资产列表优化 ==================== */
  .asset-list {
    gap: 0.75rem;
  }

  .asset-group-header {
    padding: 0.75rem;
    font-size: 0.95rem;
  }

  .asset-row {
    padding: 0.75rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .asset-info {
    width: 100%;
  }

  .asset-actions {
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }

  .asset-value {
    font-size: 1rem;
  }

  .asset-edit-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem;
  }

  /* ==================== 金字塔图表优化 ==================== */
  .pyramid-container {
    padding: 1rem 0.5rem;
  }

  .pyramid-row {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
  }

  .pyramid-tier {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    padding: 0.75rem;
  }

  .pyramid-row-label {
    width: 100%;
    text-align: left;
    margin-bottom: 0.5rem;
  }

  .pyramid-row-percent {
    width: auto !important;
    margin-left: auto;
  }

  /* ==================== 图表优化 ==================== */
  .chart-container {
    padding: 0.5rem;
  }

  #networth-chart-container {
    position: relative;
    height: 250px !important;
    max-height: 50vh;
  }

  .chart-controls {
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
  }

  .chart-controls label {
    width: 100%;
    padding: 0.5rem;
    background: var(--alipay-bg);
    border-radius: 4px;
  }

  /* ==================== 开销汇总优化 ==================== */
  .expense-summary-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  /* ==================== 财务续航优化 ==================== */
  .runway-info {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .info-card {
    padding: 1rem;
  }

  .info-card .value {
    font-size: 1.5rem;
  }

  /* 电池图标优化 */
  .battery-container {
    padding: 1rem 0.5rem;
  }

  .battery {
    width: 100%;
    max-width: 300px;
  }

  /* ==================== 模态框优化 ==================== */
  .modal-overlay {
    padding: 0.5rem;
    align-items: flex-start;
    overflow-y: auto;
  }

  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 90vh;
    margin: auto;
    border-radius: 8px 8px 0 0;
    overflow-y: auto;
  }

  .modal-header {
    padding: 1rem;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    border-bottom: 1px solid var(--alipay-border);
  }

  .modal-header h3 {
    font-size: 1.1rem;
  }

  .modal-form {
    padding: 1rem;
  }

  .modal-actions {
    flex-direction: column-reverse;
    gap: 0.75rem;
    padding-top: 1rem;
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid var(--alipay-border);
  }

  .modal-actions .btn-submit,
  .modal-actions .btn-cancel {
    width: 100%;
    margin: 0;
  }

  /* ==================== AI 诊断模态框优化 ==================== */
  #ai-modal .modal-content {
    max-height: 95vh;
  }

  .ai-controls {
    flex-direction: column;
    gap: 0.75rem;
  }

  .ai-controls select,
  .ai-controls button {
    width: 100%;
  }

  .ai-result-content {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  /* ==================== 确认对话框优化 ==================== */
  .confirm-dialog {
    width: 95% !important;
    max-width: 95% !important;
    margin: 1rem auto;
  }

  .confirm-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .confirm-ok,
  .confirm-cancel {
    width: 100%;
  }

  /* ==================== 撤销提示条优化 ==================== */
  .undo-bar {
    left: 0.5rem;
    right: 0.5rem;
    width: auto;
    max-width: none;
    transform: none;
    bottom: 1rem;
  }

  /* ==================== 空状态优化 ==================== */
  .empty-state {
    padding: 2rem 1rem;
  }

  .empty-state-icon {
    font-size: 3rem;
  }

  .empty-state-title {
    font-size: 1.1rem;
  }

  .empty-state-message {
    font-size: 0.9rem;
  }

  /* ==================== 骨架屏优化 ==================== */
  .skeleton-card,
  .skeleton-item {
    padding: 1rem;
  }

  /* ==================== 通知优化 ==================== */
  .toast {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: auto;
    max-width: 85%;
    font-size: 0.9rem;
    padding: 0.875rem 1.25rem;
  }

  .toast.show {
    transform: translate(-50%, -50%) scale(1);
  }

  /* ==================== 本地模式警告优化 ==================== */
  #local-mode-warning {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
  }

  #local-mode-warning p {
    font-size: 0.85rem;
    line-height: 1.5;
  }

  #dismiss-warning {
    align-self: flex-end;
  }

  /* ==================== 隐私声明优化 ==================== */
  .privacy-statement {
    padding: 1rem 0.75rem;
  }

  .privacy-toggle {
    font-size: 0.9rem;
    padding: 0.75rem;
  }

  .privacy-content {
    font-size: 0.85rem;
    line-height: 1.6;
  }

  /* ==================== 表格优化（如果有） ==================== */
  table {
    font-size: 0.85rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  thead {
    display: none; /* 移动端隐藏表头，使用数据属性显示 */
  }

  tbody {
    display: block;
  }

  tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid var(--alipay-border);
    border-radius: 8px;
    padding: 0.75rem;
  }

  td {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border: none;
  }

  td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--alipay-text-secondary);
    margin-right: 1rem;
  }
}

/* ==================== 平板端优化 (768px - 1024px) ==================== */

@media (min-width: 768px) and (max-width: 1024px) {
  /* 首页顶部三栏布局改为两列 */
  main > div:first-child {
    grid-template-columns: 1.5fr 1fr !important;
  }

  /* 导航栏优化 */
  nav {
    flex-wrap: wrap;
  }

  .nav-link {
    min-width: calc(33.333% - 0.5rem);
  }

  /* 确保AI按钮也遵循相同的flex规则 */
  .ai-diagnose-btn {
    min-width: calc(33.333% - 0.5rem) !important;
  }

  /* 平板端：显示"更多"菜单，隐藏次要按钮 */
  .nav-more-menu {
    display: inline-block !important;
  }

  .nav-link-primary {
    display: inline-flex !important;
  }

  .nav-link-secondary {
    display: none !important;
  }

  /* 金字塔图表优化 */
  .pyramid-row {
    gap: 0.75rem;
  }

  .pyramid-tier {
    min-width: 180px;
  }
}

/* ==================== 横屏模式优化 ==================== */

@media (max-width: 768px) and (orientation: landscape) {
  /* 横屏时减少垂直空间占用 */
  header {
    padding: 0.75rem;
  }

  .brand-text h1 {
    font-size: 1rem;
  }

  .brand-text p {
    display: none; /* 隐藏副标题节省空间 */
  }

  nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  #networth-chart-container {
    height: 200px !important;
  }
}

/* ==================== 触摸设备优化 ==================== */

@media (hover: none) and (pointer: coarse) {
  /* 触摸设备专用优化 */

  /* 增大可点击区域 */
  button,
  .btn-submit,
  .btn-secondary,
  .btn-link,
  a {
    min-height: 44px;
    min-width: 44px;
  }

  /* 移除悬停效果，使用点击反馈 */
  button:active,
  .btn-submit:active,
  .btn-secondary:active {
    transform: scale(0.98);
    opacity: 0.8;
  }

  /* 优化下拉菜单 */
  select {
    padding: 0.75rem 2.5rem 0.75rem 0.75rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    -webkit-appearance: none;
    appearance: none;
  }

  /* 优化输入框焦点 */
  input:focus,
  textarea:focus,
  select:focus {
    outline: 2px solid var(--alipay-blue);
    outline-offset: 2px;
  }
}

/* ==================== 高DPI屏幕优化 ==================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* 高DPI屏幕字体和图标优化 */
  .header-icon {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* ==================== 打印样式 ==================== */

@media print {
  header,
  nav,
  .btn-submit,
  .btn-secondary,
  .btn-link,
  button,
  #local-mode-warning,
  .privacy-statement {
    display: none !important;
  }

  .card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  body {
    background: white;
  }
}


