/* ============================================================
 * 全局重置
 * ============================================================ */
* { box-sizing: border-box; }
html, body, #app {
  margin: 0;
  padding: 0;
  height: 100%;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f5f7fa;
  color: #303133;
  font-size: 13px;
}

/* ============================================================
 * 启动状态 / 登录页
 * ============================================================ */
.auth-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  color: #909399;
  font-size: 14px;
}
.auth-view {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: linear-gradient(135deg, #1f2933 0%, #2d3a4b 100%);
}
.auth-card {
  background: #fff;
  border-radius: 12px;
  padding: 36px 36px 28px;
  width: 380px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}
.auth-brand {
  text-align: center;
  margin-bottom: 24px;
}
.auth-brand-name {
  font-size: 24px;
  font-weight: 700;
  color: #1a73e8;
  letter-spacing: 2px;
}
.auth-brand-sub {
  font-size: 12px;
  color: #909399;
  margin-top: 4px;
}
.auth-tabs {
  display: flex;
  border-bottom: 1px solid #ebeef5;
  margin-bottom: 20px;
}
.auth-tabs button {
  flex: 1;
  padding: 10px 0;
  background: transparent;
  border: none;
  font-size: 14px;
  color: #606266;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.auth-tabs button:hover { color: #1a73e8; }
.auth-tabs button.active {
  color: #1a73e8;
  border-bottom-color: #1a73e8;
  font-weight: 600;
}
.auth-error {
  color: #f56c6c;
  font-size: 12px;
  background: #fef0f0;
  border-left: 3px solid #f56c6c;
  padding: 8px 12px;
  margin: 0 0 12px;
  border-radius: 3px;
}
.auth-tip {
  margin-top: 18px;
  font-size: 12px;
  color: #909399;
  text-align: center;
  line-height: 1.6;
}

/* Admin 控制台 */
.admin-view {
  background: #fff;
  border-radius: 8px;
  padding: 0 20px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.admin-section {
  border: 1px solid #ebeef5;
  border-radius: 6px;
}
.admin-section .el-card__header {
  padding: 12px 16px;
  background: #fafbfc;
  font-weight: 600;
}
.admin-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.admin-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.admin-tip {
  background: #fff7e6;
  border-left: 3px solid #faad14;
  padding: 10px 12px;
  color: #874d00;
  font-size: 12px;
  line-height: 1.7;
  border-radius: 3px;
}
.admin-tip.danger {
  background: #fef0f0;
  border-left-color: #f56c6c;
  color: #9a2424;
}
.reveal-info {
  background: #f5f7fa;
  padding: 10px 12px;
  border-radius: 4px;
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.8;
}
.reveal-result {
  margin-top: 12px;
}

/* 顶栏用户名 / 下拉 */
.user-chip {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 14px;
  background: #f0f2f5;
  font-size: 12px;
  color: #303133;
  font-weight: 500;
  transition: background 0.15s;
}
.user-chip:hover { background: #e4e7ed; }
.user-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #67c23a;
  margin-right: 6px;
}

/* ============================================================
 * 整体壳:左 aside + 右 main
 * ============================================================ */
.app-shell {
  height: 100%;
}

/* ============================================================
 * 侧边栏(aside)
 * ============================================================ */
.aside {
  background: #1f2933;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* 品牌区(社区名) */
.brand {
  padding: 22px 24px 18px;
  border-bottom: 1px solid #2d3748;
}
.brand-name {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
}
.brand-sub {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

/* 侧边栏菜单 — 覆盖 Element Plus 默认色,做深色主题 */
.side-menu {
  border-right: none !important;
  background: transparent !important;
  flex: 1;
  padding-top: 8px;
}
.side-menu .el-menu-item {
  color: #cbd5e1;
  height: 44px;
  line-height: 44px;
  margin: 4px 12px;
  border-radius: 6px;
  padding-left: 16px !important;
}
.side-menu .el-menu-item:hover {
  background-color: #2d3748 !important;
  color: #fff;
}
.side-menu .el-menu-item.is-active {
  background-color: #1a73e8 !important;
  color: #fff !important;
}

/* ============================================================
 * 顶栏(主区上方的状态/标题条)
 * ============================================================ */
.topbar {
  background: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid #ebeef5;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.view-title {
  font-size: 16px;
  font-weight: 600;
  color: #303133;
}
.topbar-right {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 13px;
  color: #606266;
}
.filter-summary {
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", monospace;
  background: #f0f2f5;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
}
.last-update {
  font-size: 12px;
  color: #909399;
}

/* 钱包按钮(顶栏右上角)— 状态点 + 文字。三态:红=未绑 / 黄=全锁 / 绿=有解锁 */
.wallet-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f56c6c;        /* 红 = 未绑定 */
  margin-right: 6px;
  vertical-align: middle;
}
.wallet-status-dot.locked { background: #e6a23c; }   /* 黄 = 已锁 */
.wallet-status-dot.bound  { background: #67c23a; }   /* 绿 = 解锁 */

/* 钱包弹窗 — 三态共用样式 */
.wallet-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.wallet-form h3 {
  margin: 0 0 14px;
  font-size: 16px;
  color: #303133;
}
.wallet-form .hint {
  margin: 0 0 14px;
  font-size: 12px;
  color: #909399;
  line-height: 1.6;
}
.wallet-tip {
  background: #fff7e6;
  border-left: 3px solid #faad14;
  padding: 10px 12px;
  margin-top: 16px;
  color: #874d00;
  font-size: 12px;
  line-height: 1.7;
  border-radius: 3px;
}

/* ===== MetaMask 风格的钱包卡片 ===== */
.wallet-empty {
  text-align: center;
  color: #909399;
  font-size: 13px;
  padding: 40px 0;
  background: #fafbfc;
  border-radius: 8px;
  border: 1px dashed #dcdfe6;
}
.wallet-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100px;
}
.wallet-card {
  position: relative;
  padding: 18px 20px;
  background: linear-gradient(135deg, #f6f8ff 0%, #ffffff 60%);
  border: 1px solid #e1e8f5;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(26, 115, 232, 0.06);
  transition: box-shadow 0.15s, transform 0.15s;
}
.wallet-card:hover {
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.12);
}
/* 锁住的钱包整体淡化,头部状态徽章已经标红了不需要再 dim 太多 */
.wallet-card.is-locked {
  background: linear-gradient(135deg, #fafafa 0%, #ffffff 60%);
  border-color: #ebeef5;
}

.wc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.wc-label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wc-label-text {
  font-weight: 600;
  color: #303133;
  font-size: 14px;
}
.wc-label-placeholder {
  color: #c0c4cc;
  font-size: 13px;
  font-style: italic;
}
/* 可点击编辑的 label 容器 */
.wc-label-editable {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.wc-label-editable:hover {
  background: #eef4ff;
}
.wc-edit-icon {
  font-size: 12px;
  color: #c0c4cc;
  transition: color 0.15s;
}
.wc-label-editable:hover .wc-edit-icon {
  color: #1a73e8;
}

.wc-balance {
  text-align: center;
  padding: 6px 0 10px;
}
.wc-balance-num {
  font-size: 30px;
  font-weight: 700;
  color: #1a73e8;
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", monospace;
  letter-spacing: -0.5px;
}
.wc-balance-unit {
  font-size: 16px;
  color: #909399;
  margin-left: 6px;
  font-weight: 500;
}
.wallet-card.is-locked .wc-balance-num { color: #909399; }
.wc-balance-loading {
  font-size: 26px;
  color: #c0c4cc;
  font-family: ui-monospace, monospace;
}

.wc-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed #ebeef5;
  padding-top: 10px;
}
.wc-addr {
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", monospace;
  font-size: 13px;
  color: #606266;
}

/* ============================================================
 * 主区域(右侧内容)
 * ============================================================ */
.main {
  background: #f5f7fa;
  padding: 24px;
}

/* ============================================================
 * 首页
 * ============================================================ */
.home-view {
  max-width: 1200px;
  margin: 0 auto;
}

/* hero 欢迎区 */
.hero {
  text-align: center;
  padding: 40px 20px 36px;
  background: linear-gradient(135deg, #1a73e8 0%, #5e35b1 100%);
  border-radius: 10px;
  color: #fff;
  margin-bottom: 28px;
  box-shadow: 0 4px 16px rgba(26, 115, 232, 0.18);
}
.hero h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 2px;
}
.hero p {
  margin: 12px 0 0;
  font-size: 15px;
  opacity: 0.92;
}

/* 功能卡片网格 */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.feature-card {
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
}
.feature-card.available {
  cursor: pointer;
  border: 1px solid #d0e3ff;
}
.feature-card.available:hover {
  transform: translateY(-3px);
}
.feature-card.placeholder {
  opacity: 0.7;
  background: #fafbfc;
}

.card-tag {
  position: absolute;
  top: 14px;
  right: 14px;
}
.card-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 600;
  color: #1a73e8;
  padding-right: 70px;       /* 给右上角的 tag 留位置 */
}
.feature-card.placeholder .card-title {
  color: #606266;
}
.card-desc {
  margin: 0 0 14px;
  color: #606266;
  line-height: 1.6;
  font-size: 13px;
}
.card-features {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  font-size: 12.5px;
  color: #606266;
}
.card-features li {
  padding: 3px 0;
  padding-left: 16px;
  position: relative;
}
.card-features li::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: #1a73e8;
  font-weight: bold;
}
.card-footer {
  margin-top: auto;
}

/* ============================================================
 * AVE 监控视图
 * ============================================================ */
.ave-view {
  background: #fff;
  border-radius: 8px;
  padding: 0 20px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* 工具条 */
.tab-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 0 16px;
  flex-wrap: wrap;
}
.hint {
  font-size: 12px;
  color: #909399;
}
/* 工具条里区分功能组的细分割线(如"排序" | "监控规则") */
.rule-divider {
  width: 1px;
  height: 18px;
  background: #dcdfe6;
  margin: 0 6px;
}

/* 合约地址样式 */
.addr {
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", monospace;
  cursor: pointer;
  color: #606266;
}
.addr:hover {
  color: #1a73e8;
  text-decoration: underline;
}

/* 代币名链接(点击跳 ave 详情页) */
.token-link {
  color: #1a73e8;
  text-decoration: none;
  font-weight: 500;
}
.token-link:hover {
  text-decoration: underline;
}

/* 缺数据时的占位 */
.muted {
  color: #c0c4cc;
}

/* 涨跌色 */
.pct-up { color: #00b578; font-weight: 500; }
.pct-down { color: #f5222d; font-weight: 500; }

/* 行内 tag */
.row-tag {
  background: #f0f9ff;
  color: #0369a1;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  margin-left: 4px;
}

/* ============================================================
 * 监控视图(榜单监控 / 代币监控)
 * ============================================================ */
.monitor-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 上半部分:两张设置卡片并排 */
.setting-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
/* 代币监控的"目标"卡片占两列宽,自动买入单独一行 */
.setting-card-wide {
  grid-column: 1 / -1;
}

.setting-card {
  border: 1px solid #ebeef5;
  border-radius: 6px;
}
.setting-card :deep(.el-card__header),
.setting-card .el-card__header {
  padding: 12px 16px;
  background: #fafbfc;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-head-title {
  font-weight: 600;
  color: #303133;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.setting-row:last-child { margin-bottom: 0; }

/* setting-inline:把多个 setting-row 横向并排(用于宽卡片内部) */
.setting-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
}
.setting-inline .setting-row { margin-bottom: 0; }

.setting-label {
  width: 80px;
  font-size: 13px;
  color: #606266;
  text-align: right;
  flex-shrink: 0;
}
.unit {
  font-size: 12px;
  color: #909399;
}

.setting-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #ebeef5;
}

/* 添加监控代币那行 */
.add-watch-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* 中段:启动/停止控制条 */
.monitor-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: #fafbfc;
  border: 1px solid #ebeef5;
  border-radius: 6px;
}
.run-stats {
  font-size: 13px;
  color: #606266;
  font-family: ui-monospace, monospace;
}

/* 命中记录卡片 */
.hit-card {
  border: 1px solid #ebeef5;
  border-radius: 6px;
}

/* AVE 视图内的占位 tab(自动买入 / 告警通道) */
.placeholder-pane {
  padding: 32px 24px;
  text-align: center;
  color: #606266;
}
.placeholder-pane h3 {
  font-size: 18px;
  color: #1a73e8;
  margin: 0 0 16px;
}
.placeholder-pane p {
  margin: 8px 0;
}
.placeholder-pane ul {
  display: inline-block;
  text-align: left;
  margin: 16px auto;
  padding-left: 24px;
  line-height: 1.9;
}

/* 摘要卡片 */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.stat-card {
  text-align: center;
}
.stat-label {
  color: #909399;
  font-size: 13px;
}
.stat-value {
  font-size: 28px;
  font-weight: 600;
  color: #303133;
  margin-top: 8px;
}
.stat-value.pass {
  color: #00b578;
}
.summary-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.kv {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #ebeef5;
}
.kv:last-child { border-bottom: none; }
.k { color: #606266; }
.v {
  font-family: ui-monospace, monospace;
  font-weight: 600;
  color: #303133;
}

/* ============ 钱包管理独立页 ============ */
.wallet-page { padding: 4px; }

.wp-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.wp-stat-card { text-align: left; }
.wp-stat-label {
  color: #909399;
  font-size: 13px;
}
.wp-stat-value {
  font-size: 28px;
  font-weight: 600;
  color: #303133;
  margin-top: 6px;
  font-family: ui-monospace, monospace;
}
.wp-stat-sub {
  margin-left: 8px;
  font-size: 13px;
  font-weight: 400;
  color: #909399;
  font-family: inherit;
}

.wp-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.wp-tag-filter {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}

/* ============ Swap 视图 ============ */
.swap-view {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 0;
}
.swap-card .swap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.swap-card .swap-header > span:first-child {
  font-weight: 600;
  flex-shrink: 0;
}
.swap-wallet-info {
  font-size: 13px;
  color: #909399;
}
.swap-side {
  background: #f7f8fa;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 4px;
}
.swap-side-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #606266;
  margin-bottom: 8px;
}
.swap-label { font-weight: 600; }
.swap-balance { font-family: ui-monospace, monospace; font-size: 12px; }
.swap-side-body {
  display: flex;
  align-items: center;
}
.swap-amount-input :deep(input) { font-size: 22px; font-weight: 600; }
.swap-flip {
  text-align: center;
  margin: 6px 0;
}
.swap-quote-info {
  background: #fafbfc;
  border: 1px solid #ebeef5;
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 12px;
  font-size: 13px;
}
.swap-quote-info > div {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}
.swap-quote-info .quote-key { color: #909399; }
.swap-slippage {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font-size: 13px;
  color: #606266;
}
.swap-slippage .hint { color: #909399; font-size: 12px; }


/* Swap Settings 弹窗 */
.swap-header-actions { display: flex; gap: 12px; align-items: center; }
.swap-settings-btn { font-size: 12px; color: #606266; padding: 4px 8px; }
.swap-settings-btn:hover { background: #f0f2f5; border-radius: 4px; }
.settings-section { margin-bottom: 18px; }
.settings-section:last-of-type { margin-bottom: 0; }
.settings-label { font-size: 13px; font-weight: 600; color: #303133; margin-bottom: 8px; }
.settings-hint { font-size: 12px; color: #909399; margin-top: 6px; line-height: 1.5; }

/* Token Picker 弹窗 */
.token-picker-section { margin-top: 14px; }
.token-picker-section-title { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #909399; margin-bottom: 6px; }
.token-picker-list { max-height: 280px; overflow-y: auto; border: 1px solid #ebeef5; border-radius: 6px; }
.token-picker-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid #f5f7fa; }
.token-picker-row:last-child { border-bottom: none; }
.token-picker-row:hover { background: #f5f7fa; }
.token-picker-row-left { display: flex; align-items: center; gap: 8px; }
.token-picker-symbol { font-weight: 600; color: #303133; }
.token-picker-addr { font-family: ui-monospace, monospace; font-size: 11px; color: #909399; }
.token-picker-bal { font-family: ui-monospace, monospace; font-size: 13px; color: #909399; }
.token-picker-bal.has-bal { color: #303133; font-weight: 600; }

/* ============================================================
 * 监控控制台 — AVE 视图顶部卡片
 * ============================================================ */
.monitor-console { margin-bottom: 16px; }
.monitor-console .el-card__header { padding: 12px 16px; background: #fafbfc; }
.monitor-console .el-card__body { padding: 14px 16px; }
.monitor-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.monitor-title { font-weight: 600; font-size: 14px; color: #303133; flex-shrink: 0; }
.monitor-meta { font-size: 12px; color: #909399; margin-left: auto; }
.monitor-meta + .monitor-meta { margin-left: 12px; }
.monitor-error { margin-bottom: 12px; }
.monitor-body { display: flex; gap: 8px; align-items: center; }
.monitor-body .el-input { flex: 1; }
.monitor-help { margin-top: 10px; border: none; }
.monitor-help .el-collapse-item__header { font-size: 12px; color: #909399; border-bottom: none; height: 32px; }
.monitor-help .el-collapse-item__wrap { border-bottom: none; }
.monitor-help .el-collapse-item__content { padding-bottom: 8px; }
.help-steps { margin: 0; padding-left: 20px; font-size: 12px; color: #606266; line-height: 1.8; }
.help-steps code { background: #f5f7fa; padding: 1px 5px; border-radius: 3px; font-family: ui-monospace, monospace; font-size: 11px; color: #d73a49; }
.help-steps a { color: #409eff; text-decoration: none; }
.help-steps a:hover { text-decoration: underline; }
.help-note { margin: 8px 0 0; font-size: 12px; color: #909399; font-style: italic; }
