:root {
  --apple-bg: #f5f5f7;
  --apple-card: #ffffff;
  --apple-sidebar: rgba(255, 255, 255, 0.78);
  --apple-text: #1d1d1f;
  --apple-text-secondary: #6e6e73;
  --apple-text-tertiary: #86868b;
  --apple-border: rgba(0, 0, 0, 0.06);
  --apple-blue: #007aff;
  --apple-green: #34c759;
  --apple-red: #ff3b30;
  --apple-orange: #ff9500;
  --apple-radius-lg: 16px;
  --apple-radius-md: 12px;
  --apple-radius-sm: 8px;
  --el-color-primary: #007aff;
  --el-border-radius-base: 10px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--apple-bg);
  color: var(--apple-text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 登录页 */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 20% 20%, #e8f1ff 0%, #f5f5f7 45%, #eef2f6 100%);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.06);
  border-radius: 22px;
  padding: 36px 32px 30px;
}

.auth-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #007aff 0%, #5856d6 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  margin: 0 auto 16px;
  box-shadow: 0 8px 20px rgba(0, 122, 255, 0.25);
}

.auth-title {
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin: 0 0 6px;
}

.auth-subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--apple-text-secondary);
  margin: 0 0 24px;
}

.segmented-control {
  display: flex;
  background: rgba(118, 118, 128, 0.12);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 22px;
}

.segmented-item {
  flex: 1;
  text-align: center;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  color: var(--apple-text-secondary);
  transition: all 0.2s ease;
  user-select: none;
}

.segmented-item.active {
  background: #ffffff;
  color: var(--apple-text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* 主布局 */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--apple-sidebar);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid var(--apple-border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 10px 20px;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #007aff 0%, #5856d6 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.brand-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.brand-sub {
  font-size: 11px;
  color: var(--apple-text-tertiary);
}

.nav-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--apple-text-tertiary);
  padding: 12px 12px 6px;
  letter-spacing: 0.3px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--apple-text-secondary);
  cursor: pointer;
  transition: all 0.16s ease;
  user-select: none;
}

.nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--apple-text);
}

.nav-item.active {
  background: rgba(0, 122, 255, 0.1);
  color: var(--apple-blue);
  font-weight: 600;
}

.sidebar-footer {
  border-top: 1px solid var(--apple-border);
  padding-top: 14px;
  margin-top: 12px;
}

.user-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.03);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e5e5ea;
  color: #1d1d1f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: 28px 34px 48px;
  max-width: 1360px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0;
}

.page-desc {
  font-size: 13.5px;
  color: var(--apple-text-secondary);
  margin: 4px 0 0;
}

/* 卡片与网格 */
.apple-card {
  background: var(--apple-card);
  border-radius: var(--apple-radius-lg);
  border: 1px solid var(--apple-border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
  padding: 20px 22px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-label {
  font-size: 12.5px;
  color: var(--apple-text-secondary);
  font-weight: 500;
}

.stat-value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.8px;
  margin: 6px 0 4px;
}

.stat-sub {
  font-size: 12px;
  color: var(--apple-text-tertiary);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.channel-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.channel-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

.token-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #f5f5f7;
  border-radius: 10px;
  padding: 8px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: #3a3a3c;
}

.code-block {
  background: #1d1d1f;
  color: #f5f5f7;
  border-radius: 12px;
  padding: 16px 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.trend-bars {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 150px;
  padding-top: 16px;
}

.trend-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.trend-bar-wrap {
  width: 100%;
  max-width: 36px;
  height: 105px;
  background: #f2f2f7;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.trend-bar-ok {
  background: linear-gradient(180deg, #34c759 0%, #28b44c 100%);
  width: 100%;
  transition: height 0.3s ease;
}

.trend-bar-fail {
  background: #ff3b30;
  width: 100%;
}

/* Element Plus 微调成 Apple 风格 */
.el-button--primary {
  --el-button-bg-color: #007aff;
  --el-button-border-color: #007aff;
  --el-button-hover-bg-color: #0066d6;
  --el-button-hover-border-color: #0066d6;
  border-radius: 10px;
  font-weight: 500;
}

.el-button {
  border-radius: 10px;
}

.el-dialog {
  border-radius: 18px !important;
  overflow: hidden;
}

.el-table {
  --el-table-border-color: rgba(0, 0, 0, 0.05);
  --el-table-header-bg-color: #fafafa;
  border-radius: 12px;
  overflow: hidden;
}

.el-tag {
  border-radius: 999px;
  font-weight: 500;
}

@media (max-width: 960px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sidebar {
    width: 200px;
  }
  .main-content {
    padding: 20px 18px;
  }
}
