/* ========================================
   Signal Page Styles - 信号页样式
   ======================================== */

/* X信号搜索横幅的AI按钮降调样式，避免与主探索混淆 */
#opinions-search-banner-btn {
  font-size: 11px;
  color: var(--muted);
  background: rgba(255,255,255,0.88);
  border-color: var(--border);
}

#opinions-search-banner-btn:hover {
  filter: brightness(1.02);
}

/* 关注项忙碌指示：头像右上角旋转小圈 */
.tge-item.busy .tge-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: var(--accent-3);
  animation: spin 0.8s linear infinite;
  background: transparent;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
  z-index: 2;
}

.tge-item .tge-icon {
  position: relative;
}

@keyframes spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 重点关注（原 TGE 项目标记，仅样式类名保留） */
.tge-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min-content;
  gap: 8px;
  padding: 10px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-left: 12px;
  scroll-padding-right: 12px;
  -webkit-overflow-scrolling: touch;
  align-items: center;
}

/* 让添加按钮不受 grid-auto-columns 影响 */
.tge-grid > .tge-add-btn {
  width: 26px;
  min-width: 26px;
  max-width: 26px;
  justify-self: start;
}

/* 当第一个元素是添加按钮时，使用 grid-template-columns 为第一个元素设置固定宽度，其他元素使用 auto */
.tge-grid:has(.tge-add-btn:first-child) {
  grid-template-columns: 26px;
  grid-auto-columns: min-content;
}

/* 兼容性方案：如果 :has() 不支持，直接为第一个添加按钮设置 */
.tge-grid > .tge-add-btn:first-child {
  grid-column: 1;
}

.tge-grid > .tge-item:first-child {
  margin-left: 0;
}

.tge-item {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  scroll-snap-align: start;
  overflow: hidden;
  min-width: 70px;
  width: fit-content;
}

.tge-item > * {
  min-width: 0;
}

/* 紧凑的添加关注按钮 - 只显示+图标 */
.tge-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  cursor: pointer;
  transition: all 160ms ease;
  flex-shrink: 0;
  scroll-snap-align: start;
  position: relative;
  /* 覆盖 grid-auto-columns，让列宽自适应内容 */
  grid-column: span 1;
  justify-self: start;
}

.tge-add-btn:hover {
  background: rgba(255,255,255,0.75);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(17,24,39,0.08);
}

.tge-add-btn::before,
.tge-add-btn::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  border-radius: 2px;
}

.tge-add-btn::before {
  width: 12px;
  height: 1.5px;
}

.tge-add-btn::after {
  width: 1.5px;
  height: 12px;
}

.tge-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent-3), var(--accent-1));
  box-shadow: 0 6px 16px rgba(52,211,153,0.35);
  position: relative;
}

.tge-icon.plus {
  background: rgba(255,255,255,0.65);
  box-shadow: 0 6px 12px rgba(17,24,39,0.08);
}

.tge-icon.plus::before,
.tge-icon.plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  border-radius: 2px;
}

.tge-icon.plus::before {
  width: 18px;
  height: 2px;
}

.tge-icon.plus::after {
  width: 2px;
  height: 18px;
}

.tge-name {
  font-size: 12px;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 横屏优化：提高可视数量与一致性 */
@media (orientation: landscape) {
  .tge-grid {
    gap: 6px;
    grid-auto-columns: min-content;
  }
  .tge-item {
    padding: 6px 10px;
    min-width: 65px;
  }
  .tge-icon {
    width: 32px;
    height: 32px;
  }
  .tge-name {
    font-size: 11px;
  }
}

/* 手机端优化：提高重点关注板块展示密度 */
@media (max-width: 767px) {
  .tge-grid {
    gap: 6px;
    grid-auto-columns: 85px;
    padding: 8px 10px;
    align-items: center;
  }
  .tge-item {
    padding: 6px 10px;
    min-width: 65px;
  }
  .tge-icon {
    width: 32px;
    height: 32px;
  }
  .tge-name {
    font-size: 11px;
  }
}

/* 观点事件 */
.opinions {
  padding: 8px;
  display: grid;
  gap: 8px;
  overflow-x: hidden;
}

.op-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.60);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  min-width: 0; /* 防止在 grid 中因 min-width:auto 导致文本不换行撑宽 */
}

.op-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.type-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: #fff;
  box-shadow: 0 2px 6px rgba(17,24,39,0.12), inset 0 1px rgba(255,255,255,0.5);
}

.type-opinion {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
}

.type-news {
  background: linear-gradient(135deg, var(--accent-3), var(--accent-1));
}

.type-action {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.op-title {
  font-size: 14px;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.op-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* 将类型标签以内联形式放到作者与时间之后，尺寸与元信息一致 */
.op-meta .type-chip {
  padding: 0 5px;
  font-size: 10px;
  line-height: 1.2;
  margin-left: 6px;
  vertical-align: 1px;
  box-shadow: none;
}

/* 观点事件筛选：紧凑分段控件 + 微型搜索 */
.opinions-filter {
  --filter-h: 30px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  margin-bottom: 0;
  box-sizing: border-box;
}

.segmented {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  align-items: center;
  gap: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.65);
  box-shadow: inset 0 1px rgba(255,255,255,0.70), 0 6px 16px var(--shadow);
  overflow: hidden;
  height: var(--filter-h);
  box-sizing: border-box;
}

.segmented .tab {
  position: relative;
  z-index: 2;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  padding: 0 8px;
  cursor: pointer;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--filter-h);
  white-space: nowrap;
  user-select: none;
  text-align: center;
}

.segmented .tab:hover {
  filter: brightness(1.02);
}

.segmented {
  --seg-index: 0;
}

.segmented[data-active="all"] {
  --seg-index: 0;
}

.segmented[data-active="opinion"] {
  --seg-index: 1;
}

.segmented[data-active="news"] {
  --seg-index: 2;
}

.segmented[data-active="action"] {
  --seg-index: 3;
}

.seg-indicator {
  position: absolute;
  z-index: 1;
  top: 0;
  left: calc(var(--seg-index) * 25%);
  width: 25%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 4px 12px rgba(17,24,39,0.12), inset 0 1px rgba(255,255,255,0.55);
  transition: left 160ms cubic-bezier(.2,.8,.2,1);
}

.segmented .tab.active {
  color: #fff;
  font-weight: 600;
}

.segmented .tab .tab-count {
  margin-left: 6px;
  font-size: 11px;
  color: var(--muted);
  vertical-align: baseline;
}

.segmented .tab.active .tab-count {
  color: #fff;
  opacity: 0.95;
}

.micro-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  height: var(--filter-h);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.70);
  box-shadow: inset 0 1px rgba(255,255,255,0.70), 0 6px 16px var(--shadow);
  width: auto;
  max-width: 140px;
  box-sizing: border-box;
}

.micro-search .icon.search {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 40%, var(--accent-2) 0 30%, transparent 31%),
    radial-gradient(circle at 80% 80%, var(--accent-2) 0 16%, transparent 17%),
    linear-gradient(135deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 1px 4px rgba(17,24,39,0.12);
}

.micro-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  padding: 0;
  line-height: 1;
}

/* 隐藏浏览器内置的搜索输入清除按钮，避免与自定义清除重复 */
.micro-search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.micro-search input[type="search"]::-ms-clear {
  display: none;
  width: 0;
  height: 0;
}

@media (max-width: 420px) {
  .micro-search {
    max-width: 100px;
    gap: 4px;
  }
  .micro-search input {
    font-size: 11px;
  }
}

.micro-search ::placeholder {
  color: var(--muted);
}

.micro-search .icon.clear {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.85);
  box-shadow: inset 0 1px rgba(255,255,255,0.70);
  position: relative;
  display: none;
  cursor: pointer;
}

.micro-search .icon.clear::before,
.micro-search .icon.clear::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 1px;
  background: var(--muted);
  transform-origin: center;
  border-radius: 2px;
}

.micro-search .icon.clear::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.micro-search .icon.clear::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.micro-search .icon.clear.show {
  display: inline-flex;
}

/* 交互与触感 */
.news-item:active,
.tge-item:active,
.op-item:active,
.market-item:active {
  transform: translateY(1px);
  transition: transform 120ms ease;
}


