// 全局变量
:root {
  --primary: #1890ff;
  --primary-dark: #096dd9;
  --primary-light: #e6f7ff;
  --success: #52c41a;
  --warning: #faad14;
  --danger: #ff4d4f;
  --text-1: #262626;
  --text-2: #595959;
  --text-3: #8c8c8c;
  --border: #e8e8e8;
  --bg: #f5f7fa;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-1);
  background: var(--bg);
}

// 实体高亮样式
.entity-highlight {
  display: inline;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;

  &.entity {
    border: 1px solid var(--primary);
    color: var(--primary);
    background: rgba(24, 144, 255, 0.1);

    &:hover {
      background: var(--primary);
      color: white;
    }
  }

  &.concept {
    border: 1px solid #722ed1;
    color: #722ed1;
    background: rgba(114, 46, 209, 0.1);

    &:hover {
      background: #722ed1;
      color: white;
    }
  }

  &.data {
    border: 1px solid #52c41a;
    color: #52c41a;
    background: rgba(82, 196, 26, 0.1);

    &:hover {
      background: #52c41a;
      color: white;
    }
  }

  &.location {
    border: 1px solid #faad14;
    color: #d48806;
    background: rgba(250, 173, 20, 0.1);

    &:hover {
      background: #faad14;
      color: white;
    }
  }

  &.asset {
    border: 1px solid #eb2f96;
    color: #eb2f96;
    background: rgba(235, 47, 150, 0.1);

    &:hover {
      background: #eb2f96;
      color: white;
    }
  }
}

// 卡片样式
.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

// 页面标题
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;

  h1 {
    font-size: 20px;
    font-weight: 600;
  }
}

// 统计卡片
.stat-card {
  padding: 18px;
  cursor: pointer;
  transition: all 0.3s;

  &:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 10px;

    &.blue { background: linear-gradient(135deg, #e6f7ff, #bae7ff); }
    &.purple { background: linear-gradient(135deg, #f9f0ff, #efdbff); }
    &.green { background: linear-gradient(135deg, #f6ffed, #d9f7be); }
    &.orange { background: linear-gradient(135deg, #fff7e6, #ffe7ba); }
  }

  .stat-value {
    font-size: 26px;
    font-weight: 700;
  }

  .stat-label {
    font-size: 13px;
    color: var(--text-2);
    margin-bottom: 6px;
  }

  .stat-trend {
    font-size: 12px;

    &.up { color: var(--success); }
    &.down { color: var(--danger); }
  }
}

// 模板卡片
.tpl-card {
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;

  &:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  }

  .tpl-preview {
    height: 100px;
    background: linear-gradient(135deg, #f5f7fa, #e8ecf0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
  }

  .tpl-info {
    padding: 14px;
  }

  .tpl-name {
    font-weight: 600;
    margin-bottom: 6px;
  }

  .tpl-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-3);
    margin-bottom: 10px;
  }

  .tpl-tags {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
  }

  .tpl-tag {
    padding: 2px 6px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 3px;
    font-size: 10px;

    &.hot { background: #fff1f0; color: var(--danger); }
  }
}

// 变量标签样式
.var-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;

  &:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
  }

  &.entity { border-left: 3px solid var(--primary); }
  &.concept { border-left: 3px solid #722ed1; }
  &.data { border-left: 3px solid var(--success); }
  &.location { border-left: 3px solid var(--warning); }
  &.asset { border-left: 3px solid #eb2f96; }

  .tag-icon { font-size: 12px; }
  .tag-name { font-weight: 500; }
}
