/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
}

body {
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  color: #303133;
  background-color: #f5f7fa;
}

#app {
  height: 100%;
}

/* 常用工具类 */
.text-primary {
  color: #1890ff;
}

.text-success {
  color: #52c41a;
}

.text-warning {
  color: #faad14;
}

.text-danger {
  color: #f5222d;
}

.text-info {
  color: #909399;
}

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

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.items-center {
  align-items: center;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.mb-10 {
  margin-bottom: 10px;
}

.mt-10 {
  margin-top: 10px;
}

.mr-10 {
  margin-right: 10px;
}

.ml-10 {
  margin-left: 10px;
}

.p-10 {
  padding: 10px;
}

.py-10 {
  padding-top: 10px;
  padding-bottom: 10px;
}

.px-10 {
  padding-left: 10px;
  padding-right: 10px;
}

/* 可点击元素统一手型光标 */
.el-button,
.el-button--link,
.el-tag.is-closable .el-tag__close,
.el-dropdown,
.el-dropdown-menu__item,
.el-switch,
.el-checkbox,
.el-radio,
.el-select .el-input__wrapper,
.el-table__body tr.el-table__row {
  cursor: pointer;
}
.back-btn {
  cursor: pointer;
}

/* ==================== 全局弹窗卡片样式 ==================== */
/* 自动为所有未手动分区的弹窗表单添加卡片背景 */
.el-dialog:not(.tk-dialog):not(.token-dialog):not(.token-result-dialog) .el-dialog__body > .el-form {
  background: #fafbfc;
  border-radius: 8px;
  padding: 20px 20px 4px;
  border: 1px solid #f0f2f5;
}
/* 统一弹窗 footer 按钮对齐 */
.el-dialog .el-dialog__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
}
.tk-dialog .el-dialog__body {
  max-height: 70vh;
  overflow-y: auto;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge */
}
.tk-dialog .el-dialog__body::-webkit-scrollbar {
  display: none;                  /* Chrome/Safari */
}
.tk-dialog .el-form {
  padding: 0 4px;
}
.tk-section {
  background: #fafbfc;
  border-radius: 8px;
  padding: 20px 20px 4px;
  margin-bottom: 16px;
  border: 1px solid #f0f2f5;
}
.tk-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #1d2129;
  margin-bottom: 18px;
  padding-left: 10px;
  border-left: 3px solid #409eff;
  line-height: 1;
}
.tk-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.tk-resource-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}
.tk-resource-grid .el-form-item {
  margin-bottom: 18px;
}
.tk-resource-grid .el-form-item .el-form-item__label {
  width: 80px !important;
}
.tk-resource-grid .el-form-item .el-form-item__content {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.tk-resource-grid .el-input-number {
  flex: 1;
  min-width: 0;
}
.tk-unit-select {
  width: 68px;
  flex-shrink: 0;
}
.tk-res-unit {
  font-size: 13px;
  color: #909399;
  flex-shrink: 0;
  white-space: nowrap;
}
.tk-inline-unit {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.tk-inline-unit .el-input-number,
.tk-inline-unit .el-input,
.tk-inline-unit .el-select {
  flex: 1;
  min-width: 0;
}

/* ==================== 全局页面布局组件 ==================== */

/* 页面头部 */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #ebeef5;
}
.page-header .header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.page-header .header-info h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1d2129;
}
.page-header .sub-info {
  font-size: 13px;
  color: #909399;
  margin-top: 2px;
}
.page-header .header-right {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* 嵌入式工具栏 */
.embedded-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* 通用工具栏 */
.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

/* 筛选栏 */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

/* 筛选区域（卡片式） */
.filter-section {
  margin-bottom: 16px;
}

/* 分页 */
.pagination-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 8px;
}

/* 绑定选择器行 */
.bind-selector-row {
  display: flex;
  align-items: center;
  width: 100%;
}

/* 详情操作按钮组 */
.detail-actions {
  margin-top: 16px;
  display: flex;
  gap: 8px;
}

/* ==================== 全局表格增强 ==================== */
.el-table {
  --el-table-header-bg-color: #fafafa;
  --el-table-row-hover-bg-color: #f5f7fa;
  --el-table-border-color: #ebeef5;
}
.el-table th.el-table__cell {
  font-weight: 600 !important;
  color: #1d2129 !important;
  font-size: 13px !important;
  border-bottom: 2px solid #e1e8ed !important;
}
.el-table td.el-table__cell {
  border-bottom: 1px solid #f0f2f5 !important;
  color: #34495e !important;
  transition: background-color 0.15s ease;
}
.el-table .el-table__empty-block {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.el-table .el-table__empty-text {
  color: #909399;
  font-size: 14px;
  line-height: 1.6;
}
/* 表格固定列阴影 */
.el-table__fixed {
  box-shadow: 4px 0 8px -4px rgba(0, 0, 0, 0.1);
}
.el-table__fixed-right {
  box-shadow: -4px 0 8px -4px rgba(0, 0, 0, 0.1);
}

/* ==================== 全局骨架屏样式 ==================== */
@keyframes tk-skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-container {
  padding: 20px;
}
.skeleton-row {
  display: flex;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 16px;
}
.skeleton-row:last-child {
  border-bottom: none;
}
.skeleton-cell {
  height: 20px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: tk-skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

/* ==================== 全局过渡动画 ==================== */
.el-table,
.el-card,
.el-tag,
.el-button {
  transition: all 0.2s ease;
}

/* ==================== 通用文本类 ==================== */
.text-muted {
  color: #c0c4cc;
}
.mono-text {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  color: #409eff;
  font-size: 13px;
}

/* ==================== 视觉增强 ==================== */

/* 卡片式筛选区域 */
.filter-card {
  background: #ffffff;
  border: 1px solid #ebeef5;
  padding: 16px 20px;
  margin-bottom: 16px;
}

/* 操作栏 */
.action-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 通用结果/令牌展示 */
.tk-result-wrapper { text-align: center; }
.tk-result-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; text-align: left; }
.tk-result-icon { font-size: 36px; color: #e6a23c; background: #fdf6ec; border-radius: 50%; padding: 10px; }
.tk-result-name { font-size: 16px; font-weight: 600; color: #1d2129; }
.tk-result-meta { font-size: 13px; color: #909399; margin-top: 2px; }
.tk-token-block { background: #1d2129; border-radius: 8px; padding: 16px; margin-bottom: 16px; text-align: left; }
.tk-token-label { font-size: 11px; color: #909399; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.tk-token-value { font-family: 'Consolas', 'Monaco', 'Courier New', monospace; font-size: 13px; color: #67c23a; word-break: break-all; line-height: 1.6; user-select: all; }
.tk-copy-btn { width: 100%; }

/* 表单提示 */
.form-hint {
  font-size: 12px;
  color: #909399;
  margin-top: 4px;
}

/* 资源信息标签组 */
.resource-info {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ==================== 响应式工具类 ==================== */

/* 表格横向滚动提示 */
.el-table {
  overflow: visible;
}

@media (max-width: 768px) {
  .hidden-xs {
    display: none !important;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .page-header .header-right {
    width: 100%;
    flex-wrap: wrap;
  }
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-bar .el-input,
  .filter-bar .el-select {
    width: 100% !important;
  }
  .pagination-wrapper {
    justify-content: center;
  }
  .pagination-wrapper .el-pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
  /* 弹窗在移动端更宽 */
  .el-dialog {
    width: 92% !important;
    margin: 5vh auto !important;
  }
  /* 表格小屏字号调整 */
  .el-table td.el-table__cell {
    font-size: 13px !important;
  }
  /* 表单小屏行距压缩 */
  .el-form-item {
    margin-bottom: 16px;
  }
  /* tk-resource-grid 在移动端变为单列 */
  .tk-resource-grid {
    grid-template-columns: 1fr;
  }
}

/* 中等屏幕适配 */
@media (max-width: 1200px) {
  .el-table .el-table__body-wrapper {
    overflow-x: auto;
  }
}

@media (min-width: 768px) and (max-width: 992px) {
  .hidden-sm {
    display: none !important;
  }
}

@media (min-width: 992px) and (max-width: 1200px) {
  .hidden-md {
    display: none !important;
  }
}

@media (min-width: 1200px) {
  .hidden-lg {
    display: none !important;
  }
}
