/* ==========================================================================
   基础样式
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  min-width: 610px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
  min-width: 610px;
  overflow-x: auto;
}

a {
  text-decoration: none;
  color: #333;
}

small {
  transition: all 0.2s ease;
}
small:hover {
  /* display: inline-block; */
  transform: scale(1.2);
  font-weight: bold;
  background-color: rgba(242, 248, 242, 0.06);
  backdrop-filter: blur(2px);
}

/* ==========================================================================
   滚动条样式
   ========================================================================== */
/* Webkit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #d4ecd4;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #d4ecd4;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #97db97;
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #c1c1c1 #f1f1f1;
}

/* ==========================================================================
   导航栏
   ========================================================================== */
.nav {
  display: flex;
  align-items: center;
  gap: 0px;
  padding: 8px 16px;
  min-width: 610px;
}

/* 下拉菜单容器 */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-menu {
  position: relative;
  width: fit-content;
  min-width: 64px;
}

/* 菜单项样式 */
.nav-menu .menu-item {
  display: block;
  padding: 8px 16px;
  color: #333;
  font-size: 16px;
  transition: all 0.2s ease;
  white-space: nowrap;
  border-radius: 20px;
}

.nav-menu .menu-item.default {
  display: block;
  position: relative;
  border: 1px solid transparent;
  margin: -1px;
}

/* 下拉内容 */
.nav-menu .dropdown-content {
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  min-width: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform-origin: top;
  transform: scaleY(0);
  transition: transform 0.2s ease, opacity 0.2s ease, visibility 0s linear 0.2s;
}

/* 导航交互状态 */
.nav-dropdown:hover {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.nav-dropdown:hover .menu-item.default {
  background: #fff;
  border-radius: 20px 20px 0 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-bottom: none;
}

.nav-dropdown:hover .dropdown-content {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scaleY(1);
  transition: transform 0.2s ease, opacity 0.2s ease, visibility 0s linear;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.nav-dropdown:not(:hover) .dropdown-content {
  pointer-events: none;
  opacity: 0;
  transform: scaleY(0);
}

.nav-menu .menu-item:hover {
  background: rgba(76, 201, 164, 0.08);
  color: #4cc9a4;
}

.nav-menu .menu-item.selected {
  color: #4cc9a4;
  font-weight: 500;
}

.nav-dropdown:not(:hover) .menu-item.selected:not(.default) {
  display: none;
}

/* ==========================================================================
   主容器
   ========================================================================== */
.container {
  min-width: 610px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ==========================================================================
   页面头部
   ========================================================================== */
.head {
  margin-bottom: 0px;
}

.head-title {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 12px;
}

.title {
  text-align: center;
  margin-bottom: 2rem;
  color: #2c3e50;
}

.versions {
  color: #666;
  font-size: 0.9rem;
}

.sub-title {
  text-align: left;
  margin-bottom: 8px;
  margin-top: -32px;
  font-size: 12px;
  line-height: 14px;
  color: #666;
}

/* ==========================================================================
   类型过滤器
   ========================================================================== */
.type-filter {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
  min-width: 610px;
}

.type-filter button {
  padding: 6px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  background-color: #fff;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
}

.type-filter button:hover {
  border-color: #4cc9a4;
  color: #4cc9a4;
  background-color: rgba(76, 201, 164, 0.04);
}

.type-filter button.active {
  background-color: #4cc9a4;
  color: white;
  border-color: #4cc9a4;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(76, 201, 164, 0.2);
}

/* ==========================================================================
   搜索框
   ========================================================================== */
.search-container {
  position: relative;
  flex: 1;
  max-width: 300px;
}

.search-input {
  width: 100%;
  padding: 8px 16px 8px 40px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  outline: none;
  font-size: 16px;
  color: #333;
  transition: all 0.2s ease;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E")
    12px center no-repeat;
}

.search-input:focus {
  border-color: #4cc9a4;
  box-shadow: 0 0 0 3px rgba(76, 201, 164, 0.1);
}

.search-input::placeholder {
  color: #999;
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E")
    center no-repeat;
}

.search-input:not(:placeholder-shown) + .search-clear {
  opacity: 1;
}

.search-clear:hover {
  opacity: 0.7;
}

/* ==========================================================================
   品牌过滤器
   ========================================================================== */
.brand-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0;
  min-width: 610px;
}

.brand-filter button {
  padding: 6px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  background-color: #fff;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
}

/* 品牌按钮样式 */
.brand-filter .all-brand {
  border-bottom-left-radius: 0;
}

.brand-filter .all-brand:hover {
  color: #4cc9a4;
  border-color: #4cc9a4;
  background-color: rgba(76, 201, 164, 0.04);
}

.brand-filter .qualcomm-brand:hover {
  color: #2929e6;
  border-color: #2929e6;
  background-color: rgba(41, 41, 230, 0.04);
}

.brand-filter .mediatek-brand:hover {
  color: #f39a1e;
  border-color: #f39a1e;
  background-color: rgba(243, 154, 30, 0.04);
}

.brand-filter .hi-silicon-brand:hover {
  color: #e20004;
  border-color: #e20004;
  background-color: rgba(226, 0, 4, 0.04);
}

.brand-filter .apple-brand:hover {
  color: #323232;
  border-color: #323232;
  background-color: rgba(50, 50, 50, 0.04);
}

.brand-filter .other-brand:hover {
  color: #9c27b0;
  border-color: #9c27b0;
  background-color: rgba(156, 39, 176, 0.04);
}

/* 品牌按钮激活状态 */
.brand-filter .all-brand.active {
  background-color: #4cc9a4;
  border-color: #4cc9a4;
  color: white;
  border-bottom-left-radius: 0;
}

.brand-filter .qualcomm-brand.active {
  background-color: #2929e6;
  border-color: #2929e6;
  color: white;
}

.brand-filter .mediatek-brand.active {
  background-color: #f39a1e;
  border-color: #f39a1e;
  color: white;
}

.brand-filter .hi-silicon-brand.active {
  background-color: #e20004;
  border-color: #e20004;
  color: white;
}

.brand-filter .apple-brand.active {
  background-color: #323232;
  border-color: #323232;
  color: white;
}

.brand-filter .other-brand.active {
  background-color: #9c27b0;
  border-color: #9c27b0;
  color: white;
}

.brand-filter button.active {
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   SOC表格
   ========================================================================== */
.soc-table {
  min-width: 610px;
  background: white;
  border-radius: 8px;
  border-top-left-radius: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  white-space: nowrap;
}

/* 表格布局 */
.soc-header,
.soc-row {
  display: grid;
  grid-template-columns: 75fr 46fr 46fr 46fr 46fr 46fr;
  min-width: 610px;
  align-items: center;
}

/* 表头样式 */
.soc-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.soc-header .soc-cell {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
  font-weight: bold;
  position: relative;
  gap: 0px;
}

/* 表头排序按钮行 */
.soc-header .sort-row {
  display: flex;
  gap: 2px;
  margin-bottom: 0px;
  background: rgba(255, 255, 255, 0.8);
  padding-top: 2px;
  padding-bottom: 0px;
  border-radius: 2px;
}

.soc-header .sort-button {
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  position: relative;
  padding-right: 6px;
  font-size: 8px;
}

.soc-header .sort-button::after {
  content: "";
  position: absolute;
  right: 0px;
  top: 50%;
  transform: translateY(-50%) rotate(180deg);
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-bottom: 5px solid #666;
  transition: transform 0.2s;
}

.soc-header .sort-button.active {
  color: #088560;
  opacity: 1;
}

.soc-header .sort-button.active::after {
  border-bottom-color: #088560;
}

/* 从小到大状态，三角形朝下 */
.soc-header .sort-button.active.asc::after {
  transform: translateY(-50%) rotate(0deg);
}

.soc-header .sort-button:hover {
  opacity: 0.8;
}

/* 当前激活的综合按钮 */
.soc-header .sort-button[data-type="totalInteg"].active {
  color: #088560;
  opacity: 1;
}

/* 调整表头单元格以适应排序按钮 */
.soc-header .soc-cell {
  padding-top: 0px;
  position: relative;
  user-select: none;
}

/* 表头功率显示 */
.soc-header .power-input-cell {
  margin-top: 0px;
  font-size: 11px;
  color: #666;
}

/* 表头GPU下拉选择器 */
.soc-header .custom-select {
  margin-top: 0px;
}

/* 表头文字居中 */
.soc-header
  .soc-cell
  > :not(.sort-buttons):not(.power-input-cell):not(.custom-select):not(
    .sub-text
  ):not(.gpu-row) {
  text-align: center;
}

/* 小字 */
.sub-text {
  font-size: 12px;
  color: #666;
  margin-top: -4px;
}

.soc-cell .sub-text .power-value {
  font-size: 8px;
  cursor: pointer;
  display: block;
  margin-top: -1px;
  transition: all 0.2s ease;
}

.sub-text .power-value:hover {
  color: #393;
  text-decoration: underline;
  transform: scale(1.2);
}

/* 表格单元格 */
.soc-cell {
  padding: 6px;
  position: relative;
  text-align: center;
  min-width: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0px;
}

.soc-cell:first-child {
  min-width: 150px;
  text-align: center;
  align-items: center;
}

/* 表格行 */
.soc-row {
  border: 1px solid #f0f0f0;
  transition: all 0.2s;
  border-radius: 20px;
}

.soc-row:hover {
  border: rgba(76, 201, 163, 0.618) 1px solid;
  /* border-left: #4cc9a4 3px solid;
  border-right: #4cc9a4 4px solid; */
  border-radius: 0px;
}

/* SOC名称样式 */
.soc-name {
  font-weight: bold;
  color: #333;
  display: flex;
  position: relative;
  align-items: center;
  gap: 0px;
}
.soc-name .soc-name-short {
  font-size: 18px;
}
.soc-name .soc-name-full {
  font-size: 14px;
}

/* 品牌标签样式 */
.soc-brand {
  font-size: 11px;
  padding: 0px 2px;
  border-radius: 4px;
  border: 1px solid;
  margin-right: 2px;
}

.soc-brand.qualcomm {
  color: #1a1a99;
  border-color: #1a1a99;
  background-color: rgba(41, 41, 230, 0.05);
}

.soc-brand.mediatek {
  color: #c47a16;
  border-color: #c47a16;
  background-color: rgba(243, 154, 30, 0.05);
}

.soc-brand.hisilicon {
  color: #b30003;
  border-color: #b30003;
  background-color: rgba(226, 0, 4, 0.05);
}

.soc-brand.apple {
  color: #1a1a1a;
  border-color: rgba(95, 95, 95, 0.6);
  background-color: rgba(50, 50, 50, 0.05);
}

.soc-brand.other {
  color: #7b1fa2;
  border-color: #7b1fa2;
  background-color: rgba(156, 39, 176, 0.05);
}

/* 名称切换 */
.name-switch {
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.name-switch:hover {
  text-decoration: underline;
  color: #393;
}

/* 能效分数与分数 */
.soc-cell .integ-score {
  font-size: 15px;
  color: #000;
  transition: all 0.2s ease-in-out;
}
.soc-cell .integ-score.total-score {
  font-size: 16px;
  font-weight: bold;
}
.soc-cell .integ-score:hover,
.soc-cell .efective-score:hover,
.soc-cell .score:hover {
  transform: scale(1.2);
  font-weight: bold;
  background-color: rgba(242, 248, 242, 0.06);
  border-radius: 6px;
}
.soc-cell .efective-score .power-diff,
.soc-cell .score .power-diff {
  font-size: 11px;
  color: #888;
}
.soc-cell .score {
  margin-top: -4px;
  font-size: 13px;
}
.soc-cell .efective-score {
  margin-top: -4px;
  font-size: 13px;
}

.soc-cell .sort-score {
  background: rgba(6, 241, 127, 0.1);
  border-radius: 2em;
  padding: 0px 6px;
}

/* GPU 切换  */
.gpu-row {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
}

/* 自定义下拉菜单 */
.custom-select {
  position: relative;
  margin-bottom: 3px;
}

.selected-option {
  font-size: 8px;
  color: #666;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.selected-option:hover {
  color: #393;
  text-decoration: underline;
  display: block;
  transform: scale(1.2);
}

.options-container {
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid #eee;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(2px);
  z-index: 1000;
  margin-top: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-select.active .options-container {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1.2);
  transition: translateY 0.2s ease;
}

.option {
  font-size: 8px;
  color: #666;
  padding: 4px 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.option:hover {
  background: rgba(57, 51, 51, 0.05);
  color: #393;
}

/* ==========================================================================
   功耗设置模态框
   ========================================================================== */
.power-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.power-modal.show {
  opacity: 1;
}

.modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background-color: white;
  padding: 20px;
  border-radius: 20px;
  width: 350px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.power-modal.show .modal-content {
  transform: translate(-50%, -50%) scale(1);
}

/* 模态框头部 */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.close-modal {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
}

/* 模态框内容 */
.modal-body {
  margin-bottom: 20px;
  padding: 0 10px;
}

.power-control-group {
  margin-bottom: 20px;
}

.power-control-group:last-child {
  margin-bottom: 0;
}

.power-control-group label {
  display: block;
  margin-bottom: 10px;
  color: #666;
  font-size: 14px;
}

/* 模态框底部 */
.modal-footer {
  text-align: right;
}

.reset-power {
  padding: 8px 16px;
  background-color: #4cc9a4;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.reset-power:hover {
  background-color: #30b070;
}

/* 进度条相关 */
.power-slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 0;
}

.power-value-display {
  min-width: 40px;
  text-align: right;
  margin-left: 8px;
  font-size: 14px;
  color: #333;
}

/* ==========================================================================
   响应式样式
   ========================================================================== */
@media (max-width: 558px) {
  .soc-cell:first-child {
    /* text-align: left;
    justify-content: flex-start;
    align-items: flex-start; */
  }
}

/* 加载动画样式 */
.loading-spinner {
  position: relative;
  width: 100%;
  height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
}

.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  color: #666;
  font-size: 14px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
