/* ══════════════════════════════════════════════════════════════
   apps/kp/core/styles/news.css
   新架构快讯抽屉样式 —— 1:1 对齐老架构 ui-news-drawer.js 视觉与交互规范
   ══════════════════════════════════════════════════════════════ */

/* Drawer container — 440px 宽度，GPU 加速滑入滑出
   ★ 2026-10-16 修复「桌面 K 线右侧黑带」：关闭态 width:0，不再常驻占 #chart-area 的
     440px flex 宽度（原先只 translateX 隐藏，宽度留在流里把 #chart-wrap 顶到 x=920）。
     做法对齐仓库既有正确实现 #macd-drawer（kp-main.css:5581-5588 宽度动画）。 */
#news-drawer {
  position: relative;
  width: 0;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg-1, #111318);
  border-right: 1px solid var(--border-strong, #2a2f3a);
  transition: width .25s cubic-bezier(0.22,1,0.36,1);
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}
#news-drawer.open {
  width: 440px;
}
/* 内层无需锁宽：抽屉是 flex-direction:column，子元素默认 stretch 已铺满 440px。
   ⚠️ 反面教训：曾写过 `#news-drawer > * {width:440px}`，会把绝对定位的
   .tts-now-playing（left:8/right:8）与 .tts-fab（圆形）撑成 440px → 渲染成
   诡异椭圆。勿再加通配子元素宽度。 */
#news-drawer > #nd-body,
#news-drawer > .nd-body {
  flex: 1 1 auto;
  min-height: 0;
}

/* Header — 44px, 纯图标组 */
.nd-header {
  flex: 0 0 auto;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-strong, #2a2f3a);
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.025) 0%, transparent 100%);
  position: relative;
}
.nd-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,200,61,0.25) 50%, transparent 100%);
}
.nd-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.nd-title-logo {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f8cff 0%, #3a6fd8 100%);
  border-radius: 8px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(79,140,255,.35), inset 0 1px 0 rgba(255,255,255,0.2);
}
.nd-title-logo svg {
  width: 15px;
  height: 15px;
  display: block;
}
.nd-title-text {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
}
.nd-title-yang {
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.nd-title-kuaixun {
  color: #4f8cff;
  font-weight: 800;
  letter-spacing: 0.8px;
  margin-left: 2px;
}
.nd-live-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
  padding: 3px 8px 3px 7px;
  background: rgba(63,185,80,0.1);
  border: 1px solid rgba(63,185,80,0.25);
  border-radius: 10px;
  font-size: 10px;
  color: var(--long, #26a69a);
  font-weight: 600;
  font-family: var(--font-mono, monospace);
}
.nd-live-dot::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--long, #26a69a);
  box-shadow: 0 0 6px rgba(63,185,80,0.8);
  animation: greenBlink 2s ease-in-out infinite;
}
@keyframes greenBlink {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(63,185,80,.5); }
  50% { opacity: .4; box-shadow: 0 0 0 3px rgba(63,185,80,0); }
}
.nd-spacer {
  flex: 1;
}

/* 图标按钮组 */
.nd-icon-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.nd-icon-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: all .15s ease;
  position: relative;
  padding: 0;
}
.nd-icon-btn:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
  border-color: rgba(255,255,255,0.08);
}
.nd-icon-btn svg {
  width: 15px;
  height: 15px;
  display: block;
}
.nd-icon-btn.on {
  color: var(--accent, #ffc83d);
  background: rgba(255,200,61,0.08);
  border-color: rgba(255,200,61,0.3);
}
.nd-icon-btn.on::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent, #ffc83d);
  box-shadow: 0 0 6px rgba(255,200,61,0.8);
}
.nd-divider-v {
  width: 1px;
  height: 16px;
  background: rgba(255,255,255,0.08);
  margin: 0 4px;
}

/* Calendar — 玻璃卡片(直角+暗金细边) / 全分类色 / 无圆点 */
.nd-calendar {
  flex: 0 0 auto;
  position: relative;
  margin: 8px 10px 2px;
  border: 1px solid rgba(255,200,61,0.22);
  background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(22,22,26,0.35) 100%);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05), inset 0 0 22px rgba(255,200,61,0.03);
  overflow: hidden;
}
.nd-calendar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,200,61,0.3) 50%, transparent 100%);
  pointer-events: none;
  z-index: 2;
}
.nd-cal-content {
  display: flex;
  flex-direction: column;
}

/* 日期条 */
.nd-cal-dates {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  padding: 8px 10px 7px;
}
@media(max-width:540px) {
  .nd-cal-dates {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nd-cal-dates::-webkit-scrollbar { display: none; }
  .nd-cal-date { flex: 0 0 44px; }
}
.nd-cal-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 6px 0 5px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.045);
  background: rgba(255,255,255,0.012);
  cursor: pointer;
  transition: all .22s cubic-bezier(.2,.7,.2,1);
  position: relative;
  overflow: visible;
  min-width: 0;
  min-height: 44px;
}
.nd-cal-date:hover {
  border-color: rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.022);
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(0,0,0,0.22);
}
.nd-cal-date.active {
  background: linear-gradient(180deg, rgba(255,200,61,0.09) 0%, rgba(255,200,61,0.012) 100%);
  border-color: rgba(255,200,61,0.45);
  box-shadow: 0 0 0 1px rgba(255,200,61,0.18), 0 3px 12px rgba(255,200,61,0.09);
}
.nd-cal-date.active .nd-cal-date-num {
  color: var(--accent, #ffc83d);
  text-shadow: 0 0 8px rgba(255,200,61,0.22);
}
.nd-cal-date.active .nd-cal-date-wk {
  color: rgba(255,200,61,0.85);
  font-weight: 700;
}
.nd-cal-date.weekend:not(.active) .nd-cal-date-wk {
  color: #f09595;
  font-weight: 600;
}
.nd-cal-date.weekend:not(.active) .nd-cal-date-num {
  color: #f0b5b3;
}
.nd-cal-date.weekend.active .nd-cal-date-wk {
  color: var(--accent, #ffc83d);
}
.nd-cal-date-wk {
  font-size: 9px;
  color: var(--text-muted, #7f8796);
  font-weight: 600;
  line-height: 1;
  margin-bottom: 3px;
  transition: all .2s;
}
.nd-cal-date-num {
  font-family: var(--font-mono, monospace);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary, #f2f4f8);
  line-height: 1;
  letter-spacing: -0.2px;
  transition: all .2s;
}

/* 日历 ↔ 事件 淡金分割线 */
.nd-cal-divider {
  height: 1px;
  margin: 0 10px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,200,61,0.16) 25%, rgba(255,200,61,0.22) 50%, rgba(255,200,61,0.16) 75%, transparent 100%);
}

/* 事件列表 */
.nd-cal-events {
  padding: 2px 10px 2px;
  max-height: 157px;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.nd-cal-events::-webkit-scrollbar { width: 2.5px; }
.nd-cal-events::-webkit-scrollbar-thumb {
  background: rgba(255,200,61,0.18);
  border-radius: 2px;
}

/* 日历折叠按钮 */
.nd-cal-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 18px;
  margin: 2px auto 0;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: rgba(255,200,61,0.7);
  cursor: pointer;
  transition: all .2s;
  border-radius: 4px;
}
.nd-cal-collapse-btn:hover {
  color: var(--accent, #ffc83d);
  background: rgba(255,200,61,0.08);
  border-color: rgba(255,200,61,0.25);
}
.nd-cal-collapse-btn svg {
  transition: transform .25s ease;
}
.nd-cal-content.collapsed .nd-cal-events {
  max-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden;
}
.nd-cal-content.collapsed .nd-cal-collapse-btn svg {
  transform: rotate(180deg);
}
.nd-cal-empty {
  padding: 14px 8px;
  text-align: center;
  font-size: 10.5px;
  color: var(--text-muted, #7f8796);
  font-weight: 500;
}
.nd-cal-event {
  display: flex;
  align-items: stretch;
  padding: 7px 0 7px 0;
  border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.05));
  position: relative;
  cursor: pointer;
  transition: all .2s;
  gap: 0;
}
.nd-cal-event:last-child { border-bottom: none; }
.nd-cal-event:hover { background: rgba(255,255,255,0.015); }
.nd-cal-event.dimmed { opacity: 0.2; }

/* 左角小色块 */
.ev-bar-wrap {
  flex-shrink: 0;
  width: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-top: 1px;
}
.ev-bar {
  width: 2.5px;
  height: 16px;
  border-radius: 0 2px 2px 0;
  background: var(--tc, #f0b0b0);
  opacity: 0.9;
  box-shadow: 0 0 5px var(--tc, #f0b0b0);
  transition: all .22s;
}
.nd-cal-event:hover .ev-bar {
  width: 4px;
  box-shadow: 0 0 8px var(--tc, #f0b0b0);
}

/* 7 分类语义色 */
.nd-cal-event[data-t="central_bank"] { --tc: #ef5350; }
.nd-cal-event[data-t="capital_market"] { --tc: #4f8cff; }
.nd-cal-event[data-t="confidence_index"] { --tc: #81c784; }
.nd-cal-event[data-t="commodity"] { --tc: #ffa94d; }
.nd-cal-event[data-t="trade"] { --tc: #a88aff; }
.nd-cal-event[data-t="crypto"] { --tc: #f0b90b; }
.nd-cal-event[data-t="macro"] { --tc: #9e9e9e; }

/* 接下来 分隔线 */
.nd-cal-now-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 4px;
  margin: 2px 0;
  pointer-events: none;
  user-select: none;
}
.nd-cal-now-divider .now-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,200,61,0.4) 0%, rgba(255,200,61,0.15) 100%);
}
.nd-cal-now-divider .now-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--accent, #ffc83d);
  font-family: var(--font-mono, monospace);
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nd-cal-now-divider .now-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, #ffc83d);
  box-shadow: 0 0 8px rgba(255,200,61,0.6);
  animation: pulse 1.6s ease-in-out infinite;
}
.nd-cal-now-divider .now-dot.dim {
  background: var(--text-muted, #7f8796);
  box-shadow: none;
  animation: none;
}

/* 过去事件半透明 */
.nd-cal-event.past { opacity: 0.32; }
.nd-cal-event.past .nd-cal-event-title {
  text-decoration: line-through;
  text-decoration-color: rgba(255,255,255,0.15);
}
.nd-cal-event.past:hover { opacity: 0.55; }

/* 时间胶囊 */
.nd-cal-event-time {
  font-family: var(--font-mono, monospace);
  font-size: 10.5px;
  font-weight: 700;
  flex-shrink: 0;
  width: auto;
  min-width: 46px;
  padding: 2px 6px 1.5px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--tc, #b0b0b0);
  border-radius: 5px;
  line-height: 1.3;
  align-self: flex-start;
  text-align: center;
  margin-right: 0;
}
.nd-cal-event .nd-cal-event-time {
  background: color-mix(in srgb, var(--tc, #888) 13%, transparent);
  border-color: color-mix(in srgb, var(--tc, #888) 30%, transparent);
}
.nd-cal-event-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  flex-wrap: wrap;
  padding: 0.5px 0 0 7px;
  line-height: 1.4;
}
.nd-cal-event-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary, #f2f4f8);
  flex: 1;
  min-width: 0;
  word-break: break-word;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .18s;
}
.nd-cal-event:hover .nd-cal-event-title {
  color: var(--accent, #ffc83d);
}
.nd-cal-event-tags {
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
  flex-shrink: 0;
  margin-top: 0.5px;
  flex-wrap: wrap;
}
.nd-cal-event-tag {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3.5px;
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary, #a7afbd);
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  border: none;
  transition: all .15s;
}
.nd-cal-event-tag:hover { background: rgba(255,255,255,0.07); }
.nd-cal-event-tag.impact {
  font-family: var(--font-mono, monospace);
  font-size: 8.5px;
  color: var(--text-muted, #7f8796);
  padding: 2px 5px;
}
.nd-cal-event-tag.data-type {
  border: none !important;
  color: var(--tc, #b0b0b0);
  background: color-mix(in srgb, var(--tc, #888) 13%, transparent);
}

/* 快讯悬浮分割线（日历 ↔ 短讯） */
.nd-divider-c {
  position: relative;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.nd-divider-c::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,200,61,0.4) 25%, rgba(255,200,61,0.4) 75%, transparent);
}
.nd-divider-c .nd-divider-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  color: rgba(255,200,61,0.9);
  font-family: var(--font-mono, monospace);
  background: var(--bg-1, #111318);
  border: 1px solid rgba(255,200,61,0.3);
  border-radius: 999px;
  padding: 3px 10px;
  box-shadow: 0 0 12px rgba(255,200,61,0.12);
  z-index: 1;
}
.nd-divider-c .nd-divider-chip::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent, #ffc83d);
  box-shadow: 0 0 5px rgba(255,200,61,0.7);
}

/* Body / Items — 卡片化 + 配色(白/橙/金) + line-clamp 展开 */
.nd-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 10px 12px 12px;
  position: relative;
}
.nd-body::-webkit-scrollbar { width: 4px; }
.nd-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
}
.nd-day-group {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 10px 6px 6px;
  font-family: var(--font-mono, monospace);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nd-day-group::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.08) 0%, transparent 100%);
}
.nd-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.025) 0%, rgba(255,255,255,0.012) 100%);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 8px 10px 8px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all .18s cubic-bezier(0.2,0.7,0.2,1);
  overflow: hidden;
}
.nd-item:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.045) 0%, rgba(255,255,255,0.02) 100%);
  border-color: rgba(255,255,255,0.09);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

/* 左竖条语义色 — 默认灰，urgent 金, important 橙 */
.nd-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: rgba(255,255,255,0.15);
  opacity: 0.85;
  transition: all .2s;
}
.nd-item:hover::before {
  width: 4px;
  box-shadow: 0 0 12px rgba(255,255,255,0.3);
}
.nd-item.urgent::before {
  background: var(--accent, #ffc83d);
  box-shadow: 0 0 10px rgba(255,200,61,0.5);
}
.nd-item.important::before {
  background: var(--alert, #ffb300);
}
.nd-item.urgent .nd-item-title {
  color: var(--accent, #ffc83d);
}
.nd-item.important .nd-item-title {
  color: var(--alert, #ffb300);
}
.nd-item.info .nd-item-title {
  color: var(--text-primary, #f2f4f8);
}

/* 左轨（方案2）：时间 + 等级标竖排；右侧 main/head 承载标题行与展开内容 */
.nd-item-rail {
  flex: 0 0 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  padding-top: 1px;
}
.nd-item-main { flex: 1; min-width: 0; }
.nd-item-head { display: flex; align-items: flex-start; gap: 4px; }
.nd-item-time {
  font-family: var(--font-mono, monospace);
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255,255,255,0.72);
  letter-spacing: 0;
  line-height: 1.3;
}
/* meta 行（仅展开态渲染）：现在只承载语义标签 */
.nd-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  flex-wrap: wrap;
}
.nd-grade-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 700;
  padding: 1.5px 5px;
  border-radius: 3px;
  letter-spacing: 0.3px;
  line-height: 1.4;
  border: 1px solid transparent;
  white-space: nowrap;
}
.nd-grade-tag.urgent {
  background: rgba(255,200,61,0.15);
  color: var(--accent, #ffc83d);
  border-color: rgba(255,200,61,0.4);
}
.nd-grade-tag.important {
  background: rgba(255,179,0,0.15);
  color: var(--alert, #ffb300);
  border-color: rgba(255,179,0,0.4);
}
.nd-grade-tag.info {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted, #7f8796);
  border-color: rgba(255,255,255,0.1);
}

/* 标题 — head 行内占剩余宽度，♪/分享内联在其后（方案A），不再绝对定位遮盖
   ⚠️ h3 默认 margin 不清零会把每张卡撑高 ~15px（实测 61→45），方案2 双端紧凑的前提 */
.nd-item-title {
  flex: 1;
  min-width: 0;
  display: block;
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary, #f2f4f8);
  line-height: 1.5;
  word-break: break-word;
  letter-spacing: 0.1px;
  transition: color .15s;
}

/* 正文 — 仅展开态渲染，整卡点按展开取代旧「展开详情」按钮（方案2 · 2026-10-17）
   旧 .nd-item-desc-wrap/.nd-item-expand 模板已删，样式同步移除 */
.nd-item-desc {
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(255,255,255,0.62);
  word-break: break-word;
  margin-top: 6px;
}

/* 标题尾箭头：整卡点按展开 affordance（方案2 两端统一，不再限 kp-mobile）
   与按钮同为 20px 高，与标题首行基线对齐（line-height 1.5×13.5=20px → margin-top 0 即垂直居中） */
.nd-item-chev {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  align-self: center;
  height: 20px;
  color: var(--text-muted, #7f8796);
  transition: transform .25s ease;
}
.nd-item.important .nd-item-chev,
.nd-item.urgent .nd-item-chev { color: rgba(255,200,61,0.75); }
.nd-item.open .nd-item-chev { transform: rotate(180deg); }

/* tag — 语义色 */
.nd-item-tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.06);
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.4;
  letter-spacing: 0.2px;
}
.nd-item-tag.semantic-crypto {
  color: #6aa6ff;
  border-color: rgba(79,140,255,0.25);
  background: rgba(79,140,255,0.08);
}
.nd-item-tag.semantic-astock {
  color: #ff8585;
  border-color: rgba(255,107,107,0.25);
  background: rgba(255,107,107,0.08);
}
.nd-item-tag.semantic-macro {
  color: var(--accent, #ffc83d);
  border-color: rgba(255,200,61,0.25);
  background: rgba(255,200,61,0.08);
}
.nd-item-tag.semantic-hk {
  color: #ffa94d;
  border-color: rgba(255,169,77,0.25);
  background: rgba(255,169,77,0.08);
}

/* Empty / Footer */
.nd-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 20px;
  color: var(--text-muted, #7f8796);
  text-align: center;
}
.nd-footer {
  flex: 0 0 40px;
  padding: 0 16px;
  border-top: 1px solid var(--border-strong, #2a2f3a);
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.02) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nd-footer-stats {
  font-size: 10.5px;
  color: rgba(255,255,255,0.4);
  font-family: var(--font-mono, monospace);
}
.nd-footer-stats b {
  color: var(--accent, #ffc83d);
  font-weight: 700;
}
.nd-loadmore-btn {
  background: #16161a;
  border: 1px solid rgba(255,200,61,0.35);
  color: rgba(255,200,61,0.88);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 5px;
  cursor: pointer;
  transition: all .15s;
  letter-spacing: 0.3px;
}
.nd-loadmore-btn:hover {
  background: rgba(255,200,61,0.08);
  border-color: rgba(255,200,61,0.55);
  color: var(--accent, #ffc83d);
  box-shadow: 0 0 12px rgba(255,200,61,0.2);
}
.nd-loadmore-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* 按钮动作栏 — 方案A：内联在标题行尾部，随文档流排布，不再绝对定位遮盖标题 */
.nd-item-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 5px;
  align-self: flex-start;
  margin-top: 3px;
  z-index: 3;
}
.nd-item-voice-btn, .nd-item-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 5px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 10.5px;
  width: 20px;
  height: 20px;
  padding: 0;
  transition: all .15s;
  line-height: 1;
}
.nd-item-voice-btn:hover, .nd-item-share-btn:hover {
  background: rgba(255,200,61,0.12);
  color: var(--accent, #ffc83d);
  border-color: rgba(255,200,61,0.3);
}
.nd-item-voice-btn.playing {
  color: var(--long, #26a69a);
  background: rgba(63,185,80,0.12);
  border-color: rgba(63,185,80,0.3);
  opacity: 1;
}
.nd-item-share-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* TTS FAB */
.tts-fab {
  position: absolute;
  bottom: 56px;
  right: 16px;
  z-index: 300;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-3, #1e222d);
  color: var(--text-secondary, #a7afbd);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.4);
  transition: all .3s;
  border: 2px solid var(--border-default, #2a2e39);
}
.tts-fab svg {
  width: 22px;
  height: 22px;
  display: block;
}
.tts-fab:hover {
  background: var(--bg-4, #262a35);
  color: var(--text-primary, #f2f4f8);
  border-color: var(--text-muted, #7f8796);
  transform: scale(1.05);
}
.tts-fab.on {
  background: var(--long, #26a69a);
  color: #fff;
  border-color: var(--long, #26a69a);
  box-shadow: 0 0 12px rgba(63,185,80,.5);
}
.tts-fab.speaking {
  animation: fabPulse 1.1s ease-in-out infinite;
}
@keyframes fabPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(63,185,80,.55); }
  50% { box-shadow: 0 0 0 10px rgba(63,185,80,0); }
}
.tts-fab .tts-queue-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--accent, #ffc83d);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.tts-fab .tts-queue-badge[hidden] { display: none; }

/* Now Playing */
.tts-now-playing {
  position: absolute;
  bottom: 108px;
  left: 8px;
  right: 8px;
  background: var(--bg-2, #181b22);
  border: 1px solid var(--border-strong, #2a2f3a);
  border-radius: 10px;
  padding: 10px 14px;
  z-index: 299;
  display: none;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 18px rgba(0,0,0,.55);
  font-size: 13px;
}
.tts-now-playing.show { display: flex; }
.tts-np-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  animation: npPulse 1.5s ease-in-out infinite;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--long, #26a69a);
}
.tts-np-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}
@keyframes npPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.12); opacity: .75; }
}
.tts-np-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary, #f2f4f8);
  font-size: 12px;
  font-weight: 500;
}
.tts-np-skip {
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-default, #2a2e39);
  background: transparent;
  color: var(--text-secondary, #a7afbd);
  font-size: 11px;
  cursor: pointer;
  transition: all .15s;
  font-weight: 500;
}
.tts-np-skip:hover {
  border-color: var(--accent, #ffc83d);
  color: var(--accent, #ffc83d);
  background: rgba(255,200,61,0.1);
}

/* TTS Panel */
.tts-panel {
  position: absolute;
  top: 40px;
  right: 8px;
  width: calc(100% - 16px);
  max-width: 340px;
  background: #131316;
  border: 1px solid var(--border-strong, #2a2f3a);
  border-radius: 12px;
  padding: 16px 18px;
  z-index: 400;
  display: none;
  box-shadow: 0 12px 36px rgba(0,0,0,.6);
  max-height: calc(100% - 48px);
  overflow-y: auto;
}
.tts-panel.show { display: block; }
.tts-panel::-webkit-scrollbar { width: 4px; }
.tts-panel::-webkit-scrollbar-thumb {
  background: var(--bg-4, #262a35);
  border-radius: 2px;
}
.tts-panel-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary, #f2f4f8);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tts-panel-title small {
  font-size: 10px;
  color: var(--text-muted, #7f8796);
  font-weight: 400;
  margin-left: 6px;
}
.tts-panel-close {
  cursor: pointer;
  color: var(--text-muted, #7f8796);
  font-size: 18px;
  background: none;
  border: none;
  line-height: 1;
  padding: 0 2px;
}
.tts-panel-close:hover { color: var(--text-primary, #f2f4f8); }
.tts-section { margin-bottom: 16px; }
.tts-section-label {
  font-size: 11px;
  color: var(--text-tertiary, #858b9c);
  margin-bottom: 6px;
  font-weight: 600;
}
.tts-mode-group { display: flex; gap: 6px; }
.tts-mode-btn {
  flex: 1;
  padding: 7px 0;
  text-align: center;
  font-size: 11px;
  border-radius: 8px;
  border: 1px solid var(--border-default, #2a2e39);
  background: var(--bg-1, #111318);
  color: var(--text-secondary, #a7afbd);
  cursor: pointer;
  transition: all .15s;
  font-weight: 500;
}
.tts-mode-btn:hover {
  border-color: var(--border-strong, #2a2f3a);
  color: var(--text-primary, #f2f4f8);
}
.tts-mode-btn.on {
  color: #4f8cff;
  border-color: rgba(79,140,255,.5);
  background: rgba(79,140,255,.12);
  font-weight: 600;
}
.tts-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nd-toggle-switch {
  position: relative;
  width: 30px;
  height: 16px;
  border-radius: 8px;
  background: var(--bg-4, #262a35);
  border: 1px solid var(--border-default, #2a2e39);
  flex-shrink: 0;
  cursor: pointer;
  transition: all .2s ease;
}
.nd-toggle-switch::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted, #7f8796);
  transition: all .2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.nd-toggle-switch.on {
  background: rgba(63,185,80,0.25);
  border-color: rgba(63,185,80,0.55);
}
.nd-toggle-switch.on::after {
  transform: translateX(14px);
  background: var(--long, #26a69a);
  box-shadow: 0 0 6px rgba(63,185,80,0.5);
}
.tts-rate-display {
  font-size: 11px;
  color: var(--text-secondary, #a7afbd);
  margin-bottom: 6px;
  text-align: center;
}
.tts-rate-current {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary, #f2f4f8);
}
.tts-rate-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tts-rate-mark {
  font-size: 9px;
  color: var(--text-muted, #7f8796);
  min-width: 16px;
  text-align: center;
  font-family: var(--font-mono, monospace);
}
.tts-rate-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-4, #262a35);
  outline: none;
}
.tts-rate-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #4f8cff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  border: 2px solid #fff;
}
.tts-voice-note {
  text-align: center;
  color: var(--text-muted, #7f8796);
  font-size: 12px;
  padding: 8px 0;
}
.tts-voice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tts-voice-card {
  position: relative;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-default, #2a2e39);
  background: var(--bg-1, #111318);
  cursor: pointer;
  transition: all .15s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tts-voice-card:hover {
  border-color: var(--border-strong, #2a2f3a);
  background: rgba(255,255,255,0.03);
}
.tts-voice-card.on {
  border-color: rgba(79,140,255,.55);
  background: rgba(79,140,255,.08);
}
.tts-voice-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary, #f2f4f8);
}
.tts-voice-card.on .tts-voice-name { color: #4f8cff; }
.tts-voice-desc {
  font-size: 10px;
  color: var(--text-muted, #7f8796);
}
.tts-voice-preview {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--text-muted, #7f8796);
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  transition: all .12s;
}
.tts-voice-preview:hover {
  color: #4f8cff;
  background: rgba(79,140,255,.12);
}

/* Toast */
#kp-news-toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(19,19,22,0.95);
  border: 1px solid var(--border-default, #2a2e39);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-secondary, #a7afbd);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 9999;
  font-family: var(--font-mono, monospace);
  white-space: nowrap;
}
#kp-news-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Mobile */
@media(max-width:768px) {
  body.kp-mobile #news-drawer {
    position: absolute !important;
    top: 0;
    right: 0;
    bottom: 0;
    width: 0;
    height: 100%;
    pointer-events: none;
    z-index: 50;
  }
  body.kp-mobile #news-drawer.open {
    width: 100vw !important;
    max-width: 100vw;
    pointer-events: auto;
    border-right: none;
    z-index: 200;
  }
  body.kp-mobile #news-drawer.open .nd-header {
    height: 44px;
    padding: 0 16px;
  }
  /* ── v3 移动端紧凑化（对应草图 v2/v3 尺寸对照表，桌面零影响）── */
  body.kp-mobile .nd-cal-dates { padding: 7px 8px 6px; gap: 4px; }
  body.kp-mobile .nd-cal-date { padding: 4px 0 3px; border-radius: 7px; min-height: 36px; flex: 0 0 38px; }
  body.kp-mobile .nd-cal-date .nd-cal-date-wk { font-size: 9px; }
  body.kp-mobile .nd-cal-date .nd-cal-date-num { font-size: 13px; margin-top: 1px; }
  body.kp-mobile .nd-cal-event { padding: 5px 0; }
  body.kp-mobile .nd-cal-event-time { font-size: 10px; }
  body.kp-mobile .nd-cal-event-title { font-size: 11.5px; }
  body.kp-mobile .nd-item { padding: 7px 9px 7px 11px; margin: 0 10px 5px; border-radius: 9px; gap: 7px; }
  body.kp-mobile .nd-item-rail { flex-basis: 32px; }
  body.kp-mobile .nd-item-time { font-size: 10px; }
  body.kp-mobile .nd-item-title { font-size: 13px; line-height: 1.45; letter-spacing: 0; }
  body.kp-mobile .nd-item-desc { font-size: 12px; line-height: 1.55; }
  body.kp-mobile .nd-item-meta { gap: 6px; margin-top: 6px; }
  /* 播报/分享按钮移动端保持触控目标 ≥22px（桌面 20px） */
  body.kp-mobile .nd-item-voice-btn,
  body.kp-mobile .nd-item-share-btn { width: 22px; height: 22px; }
  /* ── v3 播报回归：设置面板移动端改底部弹层（!important 覆盖 applyTtsUi 锚定 nav 的内联定位）── */
  body.kp-mobile .tts-panel.show {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 14px 14px 0 0;
    max-height: 70%;
  }
}

/* 移动端 TTS 回归（2026-10-16 用户需求，反转老架构 _applyTtsMobileVisibility 隐藏语义）：
   耳机钮=设置面板(底部弹层) / FAB=播报开关(双击跳过) / 播报条=跳过；顶部 nav 开关仍隐藏（与耳机钮冗余） */

.nav-tts-area{position:relative;display:inline-flex;align-items:center;gap:0;margin-left:8px;flex-shrink:0;height:26px;padding:0 8px 0 6px;border-radius:6px;background:#16161a;border:1px solid rgba(255,200,61,0.35);cursor:default;transition:border-color .2s;}
.nav-tts-area:hover{border-color:rgba(255,200,61,0.55);}
.nav-tts-icon{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;background:none;border:none;padding:0;color:rgba(255,200,61,0.88);transition:color .2s;flex-shrink:0;}
.nav-tts-icon:hover{color:#ffc83d;}
.nav-tts-icon svg{width:14px;height:14px;display:block;}
.nav-tts-divider{width:1px;height:14px;background:rgba(255,200,61,0.2);margin:0 6px;flex-shrink:0;}
.nav-tts-label{font-size:12px;color:var(--text-secondary);font-weight:500;white-space:nowrap;margin-right:6px;}
.nav-tts-switch{width:32px;height:16px;border-radius:8px;background:#2a2a3e;border:1px solid #3a3a4e;position:relative;cursor:pointer;transition:all .2s;flex-shrink:0;}
.nav-tts-switch::after{content:'';position:absolute;top:1px;left:1px;width:12px;height:12px;border-radius:50%;background:#8b949e;transition:all .2s;}
.nav-tts-switch.on{background:rgba(63,185,80,0.25);border-color:rgba(63,185,80,0.55);}
.nav-tts-switch.on::after{transform:translateX(16px);background:var(--long);box-shadow:0 0 6px rgba(63,185,80,0.5);}
.nav-tts-badge{position:absolute;top:-4px;right:-4px;min-width:16px;height:16px;border-radius:8px;background:var(--accent);color:#fff;font-size:8px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;padding:0 3px;pointer-events:none;box-shadow:0 1px 3px rgba(0,0,0,.4);line-height:1;}
body.kp-mobile .nav-tts-area{display:none;}
