/* ==========================================================================
   先锋在线 · 页面级 UI 组件（参考 MDUI 视觉）
   仅在 html[theme] 下生效。
   ========================================================================== */

/* 底部版权卡（与 .main-card 同宽） */
html[theme] .xf-site-footer {
  max-width: 1260px;
  margin: 8px auto 0;
  padding: 18px 16px;
  box-sizing: border-box;
  background: var(--xf-card);
  border: 1px solid var(--xf-line);
  border-radius: var(--xf-radius);
  box-shadow: var(--xf-shadow);
  text-align: center;
}

html[theme] .xf-site-footer p {
  margin: 0;
  font-size: 11px;
  line-height: 1.7;
  color: var(--xf-muted-2);
}

/* 双列内容布局：左 68% / 右 32% */
html[theme] .xf-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 8px;
  align-items: start;
}

html[theme] .xf-col-main,
html[theme] .xf-col-side {
  min-width: 0;
}

html[theme] .xf-col-side .xf-card {
  margin-bottom: 8px;
}

/* 卡片内部元素 */
html[theme] .xf-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--xf-ink);
}

html[theme] .xf-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

html[theme] .xf-card-desc {
  margin: 5px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--xf-muted-2);
}

html[theme] .xf-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--xf-line);
  color: var(--xf-muted-2);
  font-size: 11px;
  cursor: help;
}

html[theme] .xf-sub-title {
  margin: 18px 0 4px;
  font-size: 12px;
  color: var(--xf-muted);
}

/* 空状态 */
html[theme] .xf-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: var(--xf-muted-2);
  font-size: 13px;
}

html[theme] .xf-empty--lg {
  min-height: 180px;
}

/* 按钮 */
html[theme] .xf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 16px;
  border: 1px solid var(--xf-line);
  border-radius: var(--xf-radius);
  background: var(--xf-card);
  color: var(--xf-text);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s;
  box-sizing: border-box;
}

html[theme] .xf-btn:hover {
  background: var(--xf-soft);
  border-color: var(--xf-line);
  color: var(--xf-text);
}

html[theme] .xf-btn--primary {
  background: var(--xf-primary);
  border-color: var(--xf-primary);
  color: var(--xf-ink);
}

html[theme] .xf-btn--primary:hover {
  background: var(--xf-primary-deep);
  border-color: var(--xf-primary-deep);
  color: var(--xf-ink);
}

html[theme] .xf-btn--accent {
  background: var(--xf-accent);
  border-color: var(--xf-accent);
  color: #ffffff;
}

html[theme] .xf-btn--accent:hover {
  background: var(--xf-accent-deep);
  border-color: var(--xf-accent-deep);
  color: #ffffff;
}

html[theme] .xf-btn--ghost {
  background: var(--xf-card);
  border-color: var(--xf-primary);
  color: var(--xf-text);
}

html[theme] .xf-btn--ghost:hover {
  background: #f5f9ff;
  color: var(--xf-ink);
}

html[theme] .xf-btn--sm {
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
}

/* 胶囊 / 标签 */
html[theme] .xf-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 12px;
  border: 1px solid var(--xf-line);
  border-radius: 999px;
  background: var(--xf-card);
  color: var(--xf-text);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}

html[theme] .xf-chip:hover {
  background: var(--xf-soft);
  color: var(--xf-text);
}

html[theme] .xf-chip.is-active,
html[theme] .xf-chip--active {
  background: var(--xf-primary);
  border-color: var(--xf-primary);
  color: var(--xf-ink);
}

html[theme] .xf-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

html[theme] .xf-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--xf-soft-2);
  color: var(--xf-muted);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

html[theme] .xf-tag--success {
  background: #eef7f0;
  color: var(--xf-success);
}

html[theme] .xf-tag--accent {
  background: var(--xf-accent);
  color: #ffffff;
}

html[theme] .xf-tag--muted {
  background: #eeeeee;
  color: #ffffff;
}

/* 字段 */
html[theme] .xf-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 48px;
}

html[theme] .xf-field {
  padding: 14px 0 10px;
}

html[theme] .xf-field-label {
  font-size: 11px;
  color: var(--xf-muted);
  line-height: 1.6;
}

html[theme] .xf-field-value {
  margin-top: 6px;
  padding-bottom: 6px;
  border-bottom: 1px dotted var(--xf-placeholder);
  font-size: 14px;
  color: var(--xf-text);
  line-height: 1.6;
  word-break: break-all;
}

html[theme] .xf-field-value .el-input__inner,
html[theme] .xf-field-value .el-select .el-input__inner {
  height: 28px;
  line-height: 28px;
  border: 0;
  border-bottom: 1px dotted var(--xf-placeholder);
  border-radius: 0;
  padding: 0;
  background: transparent;
  font-size: 14px;
  color: var(--xf-text);
}

html[theme] .xf-field-value .el-input__inner:focus {
  border-bottom-color: var(--xf-accent);
}

html[theme] .xf-field-help {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--xf-muted);
}

html[theme] .xf-field-help a,
html[theme] .xf-link {
  color: var(--xf-accent);
  text-decoration: none;
}

html[theme] .xf-field-help a:hover,
html[theme] .xf-link:hover {
  text-decoration: underline;
}

/* 搜索胶囊 */
html[theme] .xf-search-pill {
  width: 240px;
}

html[theme] .xf-search-pill .el-input__inner {
  height: 36px;
  line-height: 36px;
  padding-left: 36px;
  border: 0;
  border-radius: 999px;
  background: var(--xf-soft);
  font-size: 13px;
}

html[theme] .xf-search-pill .el-input__icon,
html[theme] .xf-search-pill .el-input__prefix {
  left: 12px;
  width: 20px;
  line-height: 36px;
  color: var(--xf-muted-2);
}

/* 工具行 */
html[theme] .xf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

html[theme] .xf-toolbar-left,
html[theme] .xf-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 账户卡 */
html[theme] .xf-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

html[theme] .xf-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--xf-avatar);
  color: #ffffff;
  font-size: 20px;
  font-weight: 500;
  flex-shrink: 0;
  overflow: hidden;
}

html[theme] .xf-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

html[theme] .xf-avatar--sm {
  width: 40px;
  height: 40px;
  font-size: 15px;
}

html[theme] .xf-user-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--xf-ink);
}

html[theme] .xf-user-id {
  margin-top: 4px;
  font-size: 11px;
  color: var(--xf-muted);
}

html[theme] .xf-user-welcome {
  margin: 12px 0 8px;
  font-size: 12px;
  color: var(--xf-muted);
}

html[theme] .xf-kv {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--xf-muted);
  line-height: 1.8;
}

html[theme] .xf-kv b {
  font-weight: 400;
  color: var(--xf-text);
}

/* 卡片底部操作 */
html[theme] .xf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

/* 待办 */
html[theme] .xf-todos {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

html[theme] .xf-todos li {
  position: relative;
  padding: 5px 0 5px 24px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--xf-muted-2);
}

html[theme] .xf-todos li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--xf-placeholder);
}

html[theme] .xf-todos li.is-done::before {
  border-color: var(--xf-success);
}

html[theme] .xf-todos li.is-done::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 10px;
  width: 6px;
  height: 3px;
  border-left: 1.5px solid var(--xf-success);
  border-bottom: 1.5px solid var(--xf-success);
  transform: rotate(-45deg);
}

/* 资产 */
html[theme] .xf-money {
  margin-top: 10px;
  font-size: 24px;
  line-height: 1.2;
  color: var(--xf-accent);
}

html[theme] .xf-money .xf-currency {
  font-size: 13px;
  margin-right: 2px;
}

html[theme] .xf-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--xf-muted);
}

html[theme] .xf-cost {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--xf-line);
  font-size: 11px;
  color: var(--xf-muted);
}

/* 进度条 */
html[theme] .xf-progress {
  height: 3px;
  border-radius: 2px;
  background: #eeeeee;
  overflow: hidden;
}

html[theme] .xf-progress__bar {
  height: 100%;
  background: var(--xf-success);
  border-radius: 2px;
}

/* 摘要卡（安全中心 / 实名认证） */
html[theme] .xf-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

html[theme] .xf-summary__main {
  flex: 1;
  min-width: 0;
}

html[theme] .xf-summary__side {
  width: 280px;
  font-size: 12px;
  color: var(--xf-muted);
  line-height: 1.8;
  text-align: right;
}

html[theme] .xf-summary__bar {
  margin-top: 12px;
}

html[theme] .xf-summary__hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--xf-muted);
}

/* 安全条目卡 */
html[theme] .xf-row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 20px;
}

html[theme] .xf-row-card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: var(--xf-ink);
}

html[theme] .xf-row-card__desc {
  margin-top: 6px;
  font-size: 12px;
  color: var(--xf-muted);
  line-height: 1.7;
}

html[theme] .xf-row-card__status {
  font-size: 12px;
  color: var(--xf-success);
}

/* 账单筛选 */
html[theme] .xf-filter-text {
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  font-size: 12px;
  color: var(--xf-muted);
  cursor: pointer;
}

html[theme] .xf-filter-text.is-active {
  color: var(--xf-accent);
}

html[theme] .xf-merge-btn {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--xf-radius);
  background: var(--xf-soft-2);
  color: var(--xf-muted);
  font-size: 13px;
  cursor: pointer;
}

html[theme] .xf-merge-btn.is-enabled {
  background: var(--xf-primary);
  color: var(--xf-ink);
}

/* 商品网格 */
html[theme] .xf-goods-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

html[theme] .xf-goods-card {
  display: flex;
  flex-direction: column;
  min-height: 260px;
  padding: 20px;
  border: 1px solid var(--xf-line);
  border-radius: var(--xf-radius);
  background: var(--xf-card);
  box-shadow: var(--xf-shadow);
}

html[theme] .xf-goods-card__title {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  color: var(--xf-ink);
}

html[theme] .xf-goods-card__spec {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--xf-muted);
}

html[theme] .xf-goods-card__spec i {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

html[theme] .xf-goods-card__bottom {
  margin-top: auto;
  padding-top: 16px;
}

html[theme] .xf-goods-card__price {
  font-size: 20px;
  color: var(--xf-accent);
}

html[theme] .xf-goods-card__price small {
  font-size: 11px;
  color: var(--xf-muted);
}

html[theme] .xf-stock {
  margin: 10px 0;
}

html[theme] .xf-stock__label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--xf-muted-2);
}

html[theme] .xf-stock__bar {
  height: 3px;
  margin-top: 5px;
  border-radius: 2px;
  background: #eeeeee;
  overflow: hidden;
}

html[theme] .xf-stock__fill {
  height: 100%;
  background: var(--xf-primary);
}

/* FAB */
html[theme] .xf-fab {
  position: fixed;
  right: 24px;
  bottom: 28px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--xf-accent);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(63, 81, 181, .35);
  transition: background-color .15s;
}

html[theme] .xf-fab:hover {
  background: var(--xf-accent-deep);
}

html[theme] .xf-fab i {
  color: #ffffff;
  font-size: 18px;
}

/* 首页欢迎卡 */
html[theme] .xf-welcome-title {
  margin: 0;
  font-size: 18px;
  font-weight: 400;
  color: var(--xf-accent);
}

html[theme] .xf-welcome-sub {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--xf-text);
}

html[theme] .xf-welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

html[theme] .xf-welcome-btn {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--xf-line);
  border-radius: 999px;
  background: #eef6fd;
  color: var(--xf-text);
  font-size: 12px;
  text-decoration: none;
  transition: background-color .15s;
}

html[theme] .xf-welcome-btn:hover {
  background: #e3f0fc;
  color: var(--xf-text);
}

html[theme] .xf-welcome-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--xf-card);
  color: var(--xf-accent);
  font-size: 11px;
  line-height: 1;
}

html[theme] .xf-quote {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--xf-muted-2);
}

html[theme] .xf-activated {
  position: relative;
}

html[theme] .xf-activated-blank {
  height: 96px;
}

html[theme] .xf-circle-btn {
  position: absolute;
  right: 16px;
  bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--xf-line);
  border-radius: 50%;
  background: var(--xf-card);
  color: var(--xf-muted);
  font-size: 12px;
  cursor: pointer;
}

/* 账户卡胶囊页签 */
html[theme] .xf-pill-tabs {
  display: flex;
  gap: 4px;
  margin-top: 16px;
}

html[theme] .xf-pill-tab {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--xf-soft-2);
  color: var(--xf-muted);
  font-size: 11px;
  text-decoration: none;
  white-space: nowrap;
}

html[theme] .xf-pill-tab.is-active {
  background: var(--xf-accent);
  color: #ffffff;
}

html[theme] .xf-pill-tab:hover {
  color: var(--xf-ink);
}

html[theme] .xf-pill-tab.is-active:hover {
  color: #ffffff;
}

/* 个人信息页 */
html[theme] #account .main-card-title {
  display: none;
}

html[theme] #account .el-tabs__header {
  display: none;
}

html[theme] #account .xf-account-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 500;
  color: var(--xf-ink);
}

html[theme] #account .xf-save-row {
  display: flex;
  justify-content: flex-end;
  padding: 8px 0 0;
}

html[theme] .oauth-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 48px;
}

html[theme] .oauth-box .box-item {
  min-width: 0;
}

/* 旧版分页容器 */
html[theme] .custom-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 12px;
}

/* 页面级旧类修正 */
html[theme] .content-table {
  width: 100%;
}

html[theme] .content_searchbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

html[theme] .left-btn {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 16px;
  border-radius: var(--xf-radius);
  background: var(--xf-primary);
  color: var(--xf-ink);
  font-size: 13px;
  cursor: pointer;
}

/* 响应式 */
@media (max-width: 1440px) {
  html[theme] .xf-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  html[theme] .xf-goods-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  html[theme] .xf-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  html[theme] .xf-grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}
