/* ═══════════════════════════════════
   geo.css — GEO 工具平台 4 频道共用样式
   v10 (step30n): 表头 text 在 [card-top, line] 严格居中 (现代 dashboard 风格)
   ═══════════════════════════════════ */

/* ═══ LAYOUT OVERRIDES ═══ */
.home-wrap{padding-top:8vh}
.search-box{max-width:800px}
.search-box-inner{position:relative}

/* ═══ GEO TOOLS GRID (4 卡, 1200 宽) ═══ */
.geo-tools{
  display:grid;grid-template-columns:repeat(4,1fr);gap:16px;
  margin-top:32px;width:100%;max-width:1200px;
}
.geo-tool{
  display:flex;align-items:flex-start;gap:14px;
  padding:18px 20px;border-radius:var(--ae-radius-s);
  background:var(--ae-glass-bg);color:var(--ae-text-2);
  cursor:pointer;transition:all .15s;
}
.geo-tool:hover{background:var(--ae-glass-bg-hover);color:var(--ae-text-1)}
.geo-tool-ico{
  width:40px;height:40px;border-radius:10px;
  background:var(--ae-glass-bg-hover);
  color:var(--ae-text-2);
  display:flex;align-items:center;justify-content:center;
  font-size:1rem;flex-shrink:0;
}
.geo-tool-text{flex:1;min-width:0}
.geo-tool-name{font-size:0.875rem;font-weight:600;margin-bottom:4px;color:var(--ae-text-1)}
.geo-tool-desc{font-size:0.75rem;color:var(--ae-text-3);line-height:1.4}

/* ═══ GEO 引用来源倾向 ═══ */
.geo-source-title{
  font-size:1.5rem;font-weight:700;color:var(--ae-text-1);
  margin:32px 0 0 0;
  text-align:center;
  width:100%;
}

/* 平台 tab */
.geo-platform-tabs{
  display:flex;flex-wrap:wrap;gap:0;
  justify-content:flex-start;
  margin:16px 0;
  border-bottom:1px solid var(--ae-glass-border);
  width:100%;max-width:1200px;
}
.geo-platform-tab{
  display:inline-block;padding:14px 24px;margin:0;
  color:var(--ae-text-2);background:transparent;
  border:none;border-radius:0;
  font-size:14px;font-weight:400;font-family:inherit;
  cursor:pointer;position:relative;
  transition:color .15s;
}
.geo-platform-tab:hover{color:var(--ae-text-1);background:transparent;}
.geo-platform-tab.active{color:var(--ae-text-1);background:transparent;font-weight:600;}
.geo-platform-tab.active::after{
  content:'';position:absolute;
  left:24px;right:24px;bottom:-1px;
  height:3px;background:var(--ae-text-1);
}

/* === GEO引用来源倾向 卡片 (card padding-top:0, head 顶 card 上沿) === */
.geo-source-card{
  position:relative;
  width:100%;max-width:1200px;
  padding:0 24px 24px;                   /* TOP: 0 */
  background:var(--ae-glass-bg);
  border-radius:16px;
  overflow:hidden;
}
.geo-source-card::after{
  content:'';
  position:absolute;
  left:0;right:0;
  top:56px;                              /* head row bottom */
  height:1px;
  background:var(--ae-glass-border);
  pointer-events:none;
}
.geo-source-grid{
  display:grid;grid-template-columns:repeat(4,1fr);gap:24px;
}
.geo-source-col{display:flex;flex-direction:column;}
.geo-source-row{
  display:grid;grid-template-columns:36px 1fr 50px;
  gap:6px;align-items:center;
  padding:7px 4px;border-radius:6px;
  transition:background .15s;
}
/* 表头: 固定 height 56, 内容 grid align-items center 严格居中 */
.geo-source-row.head{
  height:56px;
  padding:0 4px;
  margin-bottom:8px;                     /* head 跟 data 视觉空隙 (line 下 8px) */
  font-size:0.6875rem;color:var(--ae-text-3);
  font-weight:500;
}
.geo-source-row:not(.head):hover{background:var(--ae-glass-bg-hover);}
.geo-source-row > div:nth-child(3){text-align:right;}
.geo-source-name{
  font-size:0.8125rem;color:var(--ae-text-1);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}

/* ═══ 3 列大卡片 (card padding-top:0, head 顶 card 上沿) ═══ */
.geo-rank-grid{
  width:100%;max-width:1200px;margin-top:24px;
  display:grid;grid-template-columns:repeat(3,1fr);gap:16px;
}
.geo-rank-card{
  background:var(--ae-glass-bg);
  border-radius:16px;
  padding:0 20px 0;                      /* TOP: 0, BOT: 0 (more 顶 card 下沿) */
  overflow:hidden;
}
/* head: min-height 56, title align center, tabs align-self stretch (保持 active::after 对齐 border) */
.geo-rank-head{
  display:flex;
  align-items:center;                    /* title 垂直居中 */
  justify-content:space-between;
  flex-wrap:wrap;gap:8px;
  min-height:56px;
  margin:0 -20px;
  padding:0 20px;
  border-bottom:1px solid var(--ae-glass-border);
}
.geo-rank-title{
  font-size:0.9375rem;font-weight:600;color:var(--ae-text-1);
  display:flex;align-items:center;gap:8px;
  /* 无 padding-bottom, 自然居中 */
}
.geo-rank-title i{
  color:var(--ae-text-2);
  font-size:0.875rem;
}
.geo-rank-tabs{
  display:flex;gap:0;flex-wrap:wrap;
  align-self:stretch;                    /* override align-items center, 拉满 head 高度 */
}
.geo-rank-tab{
  display:flex;align-items:center;       /* tab 自己 flex, text 垂直居中 */
  padding:0 12px;                        /* 去上下 padding, 高度由 stretch 决定 */
  background:transparent;border:none;border-radius:0;
  color:var(--ae-text-3);
  font-size:13px;font-weight:400;
  cursor:pointer;font-family:inherit;
  position:relative;transition:color .15s;
}
.geo-rank-tab:hover{color:var(--ae-text-1);}
.geo-rank-tab.active{color:var(--ae-text-1);font-weight:600;}
.geo-rank-tab.active::after{
  content:'';position:absolute;
  left:12px;right:12px;bottom:-1px;      /* tab 贴 head 底, -1 压 head border */
  height:2px;background:var(--ae-text-1);
  z-index:1;
}

/* 数据行: margin -20 撑满 card, hover bg 跨满 */
.geo-rank-row{
  display:grid;
  grid-template-columns:40px 1fr 50px 90px;
  gap:8px;align-items:center;
  margin:0 -20px;
  padding:8px 20px;
  transition:background .15s;
}
.geo-rank-row.head{
  font-size:0.75rem;
  color:var(--ae-text-3);
  font-weight:500;
  padding:16px 20px;
  margin-top:4px;
}
.geo-rank-row:not(.head):hover{background:var(--ae-glass-bg-hover);}

.geo-rank-row.head > div:nth-child(1){text-align:center;}
.geo-rank-row.head > div:nth-child(2){text-align:left;}
.geo-rank-row.head > div:nth-child(3){text-align:center;}
.geo-rank-row.head > div:nth-child(4){text-align:right;}

.geo-rank-no{
  width:26px;height:26px;border-radius:50%;
  background:var(--ae-glass-bg-hover);
  display:flex;align-items:center;justify-content:center;
  font-size:0.75rem;color:var(--ae-text-2);
  font-weight:600;
  justify-self:center;
}
.geo-rank-site{
  font-size:0.8125rem;color:var(--ae-text-1);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.geo-rank-weight{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:32px;padding:2px 8px;border-radius:6px;
  background:var(--ae-glass-bg-hover);
  font-size:0.75rem;color:var(--ae-text-2);
  font-weight:600;
  justify-self:center;
}
.geo-rank-change{
  font-size:0.75rem;
  color:var(--ae-text-2);
  text-align:right;
  font-weight:500;
}
.geo-rank-more{
  margin:12px -20px 0;
  padding:0 20px;
  min-height:56px;                        /* 跟 .geo-rank-head 同高 */
  display:flex;
  align-items:center;                     /* text 垂直居中 [line, card-bot] */
  justify-content:center;                 /* text 水平居中 */
  font-size:0.75rem;
  color:var(--ae-text-3);
  cursor:pointer;
  transition:color .15s;
  border-top:1px solid var(--ae-glass-border);
}
.geo-rank-more:hover{color:var(--ae-text-1)}

/* ═══ GEO引用流量排行 表格 (card padding-top:0, thead 顶 card 上沿) ═══ */
.geo-traffic-card{
  width:100%;max-width:1200px;margin-top:16px;
  background:var(--ae-glass-bg);
  border-radius:16px;
  padding:0 0 16px;                      /* TOP: 0, 左右 0, 让 line 铺满 */
}
.geo-traffic-scroll{overflow-x:auto;}
.geo-traffic-table{
  width:100%;
  border-collapse:separate;border-spacing:0;
}
.geo-traffic-table th{
  font-size:0.6875rem;
  color:var(--ae-text-3);
  font-weight:500;
  padding:20px 4px;                      /* 上下对称 20, text 在 cell 中央 = [card-top, line] 中央 */
  text-align:right;
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
  border-bottom:1px solid var(--ae-glass-border);
  vertical-align:middle;
}
.geo-traffic-table th:first-child,
.geo-traffic-table td:first-child{padding-left:24px;}
.geo-traffic-table th:last-child,
.geo-traffic-table td:last-child{padding-right:24px;}

.geo-traffic-table th.col-rank{
  text-align:center;width:40px;cursor:default;
  padding-right:0;
}
.geo-traffic-table th.col-site{text-align:left;}
.geo-traffic-table th .sort-arr{
  display:inline-block;
  margin-left:4px;
  opacity:0.4;
  font-size:0.625rem;
}
.geo-traffic-table th:hover .sort-arr,
.geo-traffic-table th.sorted-desc .sort-arr,
.geo-traffic-table th.sorted-asc .sort-arr{
  opacity:1;
  color:var(--ae-text-1);
}
.geo-traffic-table td{
  padding:10px 4px;
  text-align:right;
  font-size:0.75rem;
  color:var(--ae-text-2);
  white-space:nowrap;
}
.geo-traffic-table td.col-rank{
  text-align:center;width:40px;
  padding-right:0;
}
.geo-traffic-table td.col-site{
  text-align:left;
  font-size:0.8125rem;
  color:var(--ae-text-1);
}
/* 第一行 data 加 padding-top 让跟 line 有空隙 */
.geo-traffic-table tbody tr:first-child td{
  padding-top:16px;
}
.geo-traffic-table .traffic-rank-no{
  width:26px;height:26px;border-radius:50%;
  background:var(--ae-glass-bg-hover);
  display:inline-flex;align-items:center;justify-content:center;
  font-size:0.75rem;color:var(--ae-text-2);
  font-weight:600;
}
.geo-traffic-table tbody tr{transition:background .15s;}
.geo-traffic-table tbody tr:hover{background:var(--ae-glass-bg-hover);}
.geo-traffic-table .num-val{
  font-size:0.8125rem;
  color:var(--ae-text-1);
  font-weight:500;
}
.geo-traffic-table .num-unit{
  font-size:0.625rem;
  color:var(--ae-text-3);
  margin-top:2px;
}

/* ═══ MOBILE ═══ */
@media(max-width:960px){
  .geo-tools{grid-template-columns:repeat(2,1fr)}
  .geo-source-grid{grid-template-columns:repeat(2,1fr)}
  .geo-rank-grid{grid-template-columns:repeat(1,1fr)}
}
@media(max-width:640px){
  .geo-tools{grid-template-columns:repeat(1,1fr)}
  .geo-source-grid{grid-template-columns:repeat(1,1fr)}
  .geo-source-card{padding:0 16px 16px;}
  .geo-source-card::after{top:48px;}
  .geo-source-row.head{height:48px;}
  .geo-source-title{font-size:1.25rem}
  .geo-platform-tab{padding:10px 16px;font-size:13px}
  .geo-platform-tab.active::after{left:16px;right:16px}
  .geo-traffic-card{padding:0 0 12px;}
  .geo-traffic-table th{padding:16px 4px;}
  .geo-traffic-table th:first-child,
  .geo-traffic-table td:first-child{padding-left:16px;}
  .geo-traffic-table th:last-child,
  .geo-traffic-table td:last-child{padding-right:16px;}
  .geo-rank-card{padding:0 16px 0;}
  .geo-rank-head{min-height:48px;margin:0 -16px;padding:0 16px}
  .geo-rank-row{margin:0 -16px;padding:8px 16px}
  .geo-rank-row.head{padding:16px 16px}
  .geo-rank-more{margin:12px -16px 0;padding:0 16px;min-height:48px;display:flex;align-items:center;justify-content:center;}
}

/* tool cards: PC hidden, mobile-only */
@media(min-width:769px){.geo-tools{display:none !important}}
