/* ============================================================
   trace.ideatrace.cn 模块样式
   设计目标：移动端友好、多模态输入（金句/截图/语音/打字）、
   自动判断归属象限、实时点赞时间戳、预存金句展示。
   ============================================================ */

:root {
  --trace-accent: #6c4ff0;      /* 主题紫色 */
  --trace-accent-soft: rgba(108, 79, 240, .08);
  --trace-accent-strong: #4f35c9;
  --trace-warm: #e8a560;
  --trace-green: #2db77c;
  --trace-blue: #4f8df7;
  --trace-pink: #ff6b9d;
  --trace-shadow: 0 4px 24px rgba(20, 24, 60, .06);
  --trace-shadow-md: 0 6px 32px rgba(20, 24, 60, .10);
  --trace-radius: 14px;
  --trace-radius-sm: 10px;
  --trace-border: #eef0f4;
  --trace-bg: #fafbfc;
}

.tr-mx { max-width: 980px; margin: 0 auto; padding: 0 18px; }
.tr-mx-narrow { max-width: 720px; margin: 0 auto; padding: 0 18px; }

/* ========== Hero ========== */
.tr-hero {
  background: linear-gradient(135deg, #fef6ec 0%, #f7f0ff 50%, #ecf7ff 100%);
  border-bottom: 1px solid var(--trace-border);
  padding: 56px 0 36px;
  position: relative;
  overflow: hidden;
}
.tr-hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(232, 165, 96, .18) 0%, transparent 40%),
    radial-gradient(circle at 88% 82%, rgba(108, 79, 240, .16) 0%, transparent 40%);
  pointer-events: none;
}
.tr-hero h1 {
  font-size: clamp(28px, 4.4vw, 44px);
  margin: 0 0 12px;
  letter-spacing: -.02em;
  position: relative;
}
.tr-hero .tr-tagline {
  font-size: 16px;
  color: var(--text-secondary, #4a5360);
  max-width: 680px; line-height: 1.7;
  position: relative;
}
.tr-hero .tr-quick {
  display: inline-flex; gap: 6px; margin-top: 18px;
  background: #fff; border: 1px solid var(--trace-border);
  padding: 4px 6px 4px 14px; border-radius: 999px;
  box-shadow: var(--trace-shadow);
  position: relative;
}
.tr-hero .tr-quick span {
  font-size: 12.5px; color: #666; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
}
.tr-hero .tr-quick a {
  font-size: 12.5px; color: var(--trace-accent);
  padding: 4px 10px; border-radius: 999px;
  text-decoration: none; font-weight: 600;
  transition: background .15s;
}
.tr-hero .tr-quick a:hover { background: var(--trace-accent-soft); }

/* ========== 标签切换 ========== */
.tr-tabs {
  display: flex; gap: 6px;
  margin: 28px 0 0; padding: 4px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid var(--trace-border);
  border-radius: 12px;
  backdrop-filter: blur(6px);
  width: fit-content;
}
.tr-tab {
  border: none; background: transparent;
  padding: 10px 18px; border-radius: 9px;
  font-size: 14px; font-weight: 600;
  color: var(--text-secondary, #4a5360);
  cursor: pointer; transition: all .15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.tr-tab.active {
  background: #fff; color: var(--trace-accent);
  box-shadow: 0 2px 8px rgba(108, 79, 240, .15);
}

/* ========== 发布卡 ========== */
.tr-compose {
  margin: 28px 0;
  background: #fff;
  border: 1px solid var(--trace-border);
  border-radius: var(--trace-radius);
  box-shadow: var(--trace-shadow);
  overflow: hidden;
}
.tr-compose-head {
  padding: 18px 22px 12px;
  border-bottom: 1px dashed var(--trace-border);
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.tr-compose-head .who {
  font-size: 13px; color: #888;
  display: inline-flex; align-items: center; gap: 8px;
}
.tr-compose-head .who strong { color: var(--text-primary, #1a2030); font-weight: 700; }

.tr-compose-body { padding: 18px 22px 22px; }

/* 标题输入 */
.tr-input-title {
  width: 100%; border: none; outline: none;
  font-size: clamp(18px, 2.6vw, 22px);
  font-weight: 700; letter-spacing: -.01em;
  padding: 6px 0 8px; margin: 0;
  background: transparent;
  color: var(--text-primary, #1a2030);
}
.tr-input-title::placeholder { color: #b6bcc8; font-weight: 500; }

/* 正文输入 */
.tr-input-body {
  width: 100%; border: none; outline: none; resize: vertical;
  min-height: 100px; max-height: 320px;
  font-size: 15px; line-height: 1.75;
  font-family: inherit;
  padding: 8px 0 12px; margin: 0;
  background: transparent;
  color: var(--text-primary, #1a2030);
}
.tr-input-body::placeholder { color: #b6bcc8; }

/* 工具栏 */
.tr-tools {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding-top: 12px; border-top: 1px dashed var(--trace-border);
}
.tr-tool {
  border: 1px solid var(--trace-border);
  background: #fff; color: #5a6373;
  padding: 8px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: all .15s;
}
.tr-tool:hover { border-color: var(--trace-accent); color: var(--trace-accent); background: var(--trace-accent-soft); }
.tr-tool.active { border-color: var(--trace-accent); color: var(--trace-accent); background: var(--trace-accent-soft); }
.tr-tool .ic { font-size: 16px; line-height: 1; }
.tr-tool input[type=file] { display: none; }

.tr-counter {
  margin-left: auto; font-size: 12px; color: #888;
  align-self: center; padding-right: 6px;
}
.tr-counter.over { color: #d23a3a; font-weight: 700; }

/* 象限自动判断 */
.tr-quad-suggest {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: var(--trace-radius-sm);
  background: linear-gradient(135deg, rgba(108, 79, 240, .04), rgba(45, 183, 124, .04));
  border: 1px dashed rgba(108, 79, 240, .25);
  display: none;
}
.tr-quad-suggest.show { display: block; animation: tr-fade-in .25s ease; }
@keyframes tr-fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.tr-quad-suggest .qhead {
  font-size: 12px; color: #6b7185; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 8px; display: flex; align-items: center; gap: 6px;
}
.tr-quad-suggest .qhead .badge {
  font-size: 10px; padding: 2px 7px;
  background: rgba(108, 79, 240, .12);
  color: var(--trace-accent);
  border-radius: 999px; font-weight: 700;
  letter-spacing: 0;
}
.tr-quad-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.tr-quad-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--trace-border);
  border-radius: 999px; background: #fff;
  font-size: 12.5px; color: #4a5360;
  cursor: pointer; transition: all .15s;
}
.tr-quad-pill .pill-ic { font-size: 14px; }
.tr-quad-pill .pill-pct {
  font-size: 11px; font-weight: 700;
  color: var(--trace-accent);
  background: var(--trace-accent-soft);
  padding: 1px 6px; border-radius: 999px;
}
.tr-quad-pill:hover { border-color: var(--trace-accent); }
.tr-quad-pill.active {
  border-color: var(--trace-accent);
  background: var(--trace-accent);
  color: #fff;
}
.tr-quad-pill.active .pill-pct {
  background: rgba(255, 255, 255, .22);
  color: #fff;
}

/* 图片预览 */
.tr-image-previews {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 12px;
}
.tr-image-previews:empty { display: none; }
.tr-img-thumb {
  position: relative; width: 88px; height: 88px;
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--trace-border);
  background: #f3f5f8;
}
.tr-img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tr-img-thumb .remove {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  background: rgba(0, 0, 0, .55); color: #fff;
  border: none; border-radius: 50%;
  font-size: 12px; cursor: pointer;
  display: grid; place-items: center;
}
.tr-img-thumb .extracting {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, .45); color: #fff;
  font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}

/* 语音状态 */
.tr-voice-state {
  margin-top: 10px; padding: 8px 12px;
  border-radius: 8px;
  background: rgba(45, 183, 124, .08);
  color: #1c8e5c; font-size: 13px;
  display: none;
  align-items: center; gap: 8px;
}
.tr-voice-state.show { display: inline-flex; animation: tr-pulse 1.4s ease-in-out infinite; }
@keyframes tr-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }
.tr-voice-state .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #d23a3a;
}

/* 发布按钮 */
.tr-submit-row {
  margin-top: 16px;
  display: flex; align-items: center; gap: 12px;
  justify-content: space-between;
}
.tr-quad-current {
  font-size: 13px; color: #5a6373;
  display: inline-flex; align-items: center; gap: 6px;
}
.tr-quad-current .ic {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--trace-accent-soft);
  color: var(--trace-accent);
  font-size: 12px;
}
.tr-submit {
  border: none;
  background: linear-gradient(135deg, var(--trace-accent), var(--trace-accent-strong));
  color: #fff; font-size: 14.5px; font-weight: 700;
  padding: 12px 22px; border-radius: 999px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  box-shadow: 0 4px 16px rgba(108, 79, 240, .25);
  transition: transform .1s, box-shadow .15s, opacity .15s;
}
.tr-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(108, 79, 240, .35); }
.tr-submit:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* 错误提示 */
.tr-err {
  margin-top: 12px;
  padding: 10px 14px; border-radius: 10px;
  background: rgba(210, 58, 58, .08); color: #b22222;
  border: 1px solid rgba(210, 58, 58, .2);
  font-size: 13px; display: none;
  animation: tr-fade-in 0.25s ease;
}
.tr-err.show { display: block; }
.tr-success {
  background: rgba(45, 183, 124, .08); color: #1c8e5c;
  border-color: rgba(45, 183, 124, .2);
}
.tr-info {
  background: rgba(108, 79, 240, .08); color: #6c4ff0;
  border-color: rgba(108, 79, 240, .2);
}

/* 发布后脉冲高亮 */
@keyframes tr-pulse-highlight {
  0% { box-shadow: 0 0 0 0 rgba(108, 79, 240, .4); }
  20% { box-shadow: 0 0 0 12px rgba(108, 79, 240, 0); }
  100% { box-shadow: 0 0 0 0 rgba(108, 79, 240, 0); }
}
.tr-idea-card.just-published { animation: tr-pulse-highlight 2.5s ease-out; }

/* 字数超限 */
.tr-counter.over { color: #d23a3a; font-weight: 700; }

/* 工具按钮 disabled */
.tr-tool.disabled, .tr-tool:disabled {
  opacity: .4; cursor: not-allowed; pointer-events: none;
}
.tr-tool.active { background: var(--trace-accent-soft); border-color: var(--trace-accent); color: var(--trace-accent); }

/* 移动端优化 */
@media (max-width: 760px) {
  .tr-input-title { font-size: 17px; min-height: 28px; }
  .tr-input-body { min-height: 120px; }
  .tr-tool { min-height: 36px; }
  .tr-submit { min-height: 44px; }
}
@media (max-width: 420px) {
  .tr-compose { border-radius: 0; border-left: 0; border-right: 0; }
  .tr-quote-card { padding: 16px 16px 14px; }
  .tr-idea-images { grid-template-columns: repeat(2, 1fr); }
}

/* 草稿提示 */
.tr-draft-hint { display: flex; align-items: center; gap: 6px; }
.tr-draft-hint::before { content: '📝'; font-size: 13px; }

/* 发布历史 */
#trHistory { font-size: 13px; }
#trHistory h3 { color: var(--text-primary, #1a2030); }

/* ========== 元信息胶囊 ========== */
.tr-feed {
  margin: 0 0 28px;
}
.tr-section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 24px 0 14px; gap: 10px;
}
.tr-section-head h2 {
  font-size: 20px; margin: 0; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.tr-section-head h2 .num {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px;
  background: var(--trace-accent);
  color: #fff; border-radius: 6px;
  font-size: 12px; font-weight: 800;
}
.tr-section-head .more {
  font-size: 13px; color: var(--trace-accent);
  text-decoration: none; font-weight: 600;
}

/* ========== 金句卡片 ========== */
.tr-quote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.tr-quote-card {
  background: #fff;
  border: 1px solid var(--trace-border);
  border-radius: var(--trace-radius);
  padding: 20px 20px 16px;
  display: flex; flex-direction: column; gap: 10px;
  transition: all .2s;
  position: relative; overflow: hidden;
}
.tr-quote-card::before {
  content: "“";
  position: absolute; top: -10px; left: 8px;
  font-size: 72px; font-weight: 800;
  color: rgba(108, 79, 240, .12);
  line-height: 1;
  pointer-events: none;
  z-index: 0;
}
.tr-quote-card:hover {
  border-color: rgba(108, 79, 240, .35);
  transform: translateY(-2px);
  box-shadow: var(--trace-shadow-md);
}
.tr-quote-text {
  font-size: 15px; line-height: 1.7;
  color: var(--text-primary, #1a2030);
  font-weight: 500;
  position: relative;
  z-index: 1;
}
.tr-quote-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: auto;
  padding-top: 10px; border-top: 1px dashed var(--trace-border);
  gap: 8px;
}
.tr-quote-attr {
  font-size: 12.5px; color: #5a6373;
  display: inline-flex; align-items: center; gap: 6px;
}
.tr-quote-attr .author { font-weight: 700; color: var(--text-primary, #1a2030); }
.tr-quote-attr .source { color: #888; }
.tr-quote-tag {
  font-size: 10.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: var(--trace-accent-soft);
  color: var(--trace-accent);
}
.tr-quote-actions {
  display: flex; gap: 4px;
}
.tr-q-btn {
  border: 1px solid var(--trace-border);
  background: #fff; color: #5a6373;
  width: 30px; height: 30px;
  border-radius: 8px; cursor: pointer;
  font-size: 13px;
  display: grid; place-items: center;
  transition: all .15s;
}
.tr-q-btn:hover { border-color: var(--trace-accent); color: var(--trace-accent); }
.tr-q-btn.liked { background: rgba(255, 107, 157, .12); border-color: rgba(255, 107, 157, .35); color: #d24372; }

/* ========== 创意 Feed ========== */
.tr-feed-list { display: flex; flex-direction: column; gap: 12px; }
.tr-idea-card {
  background: #fff;
  border: 1px solid var(--trace-border);
  border-radius: var(--trace-radius);
  padding: 18px 20px;
  transition: all .15s;
  position: relative;
}
.tr-idea-card:hover { border-color: rgba(108, 79, 240, .35); }
.tr-idea-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
  font-size: 12px; color: #888;
}
.tr-idea-head .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--trace-accent), var(--trace-blue));
  display: grid; place-items: center;
  color: #fff; font-size: 13px; font-weight: 700;
}
.tr-idea-head .name { color: var(--text-primary, #1a2030); font-weight: 700; font-size: 13px; }
.tr-idea-head .dot { color: #c8cdd5; }
.tr-idea-head .quad {
  margin-left: auto;
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
}
.tr-idea-head .quad.q-financial { background: rgba(214, 149, 0, .12); color: #b87d00; }
.tr-idea-head .quad.q-health { background: rgba(22, 163, 74, .12); color: #16864a; }
.tr-idea-head .quad.q-relationships { background: rgba(37, 99, 235, .12); color: #2563eb; }
.tr-idea-head .quad.q-life { background: rgba(124, 58, 237, .12); color: #7c3aed; }
.tr-idea-title {
  font-size: 16px; font-weight: 700;
  margin: 0 0 6px; color: var(--text-primary, #1a2030);
  line-height: 1.4;
}
.tr-idea-body {
  font-size: 14px; line-height: 1.7;
  color: #4a5360;
  margin: 0;
}
.tr-idea-body.truncated {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tr-idea-images {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px; margin-top: 12px;
}
.tr-idea-images img {
  width: 100%; aspect-ratio: 1 / 1;
  object-fit: cover; border-radius: 8px;
  border: 1px solid var(--trace-border);
  cursor: zoom-in;
}
.tr-idea-foot {
  display: flex; align-items: center; gap: 4px;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed var(--trace-border);
  font-size: 12.5px;
}
.tr-idea-foot .ts { color: #999; margin-right: auto; }
.tr-action {
  border: none; background: transparent;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px; border-radius: 8px;
  color: #5a6373; cursor: pointer;
  font-size: 12.5px; font-weight: 600;
  transition: all .12s;
}
.tr-action:hover { background: var(--trace-accent-soft); color: var(--trace-accent); }
.tr-action.liked { color: #d24372; }
.tr-action.forked { color: var(--trace-blue); }

/* ========== 调研对比卡片 ========== */
.tr-research {
  margin: 0 0 32px;
  padding: 28px 24px;
  background: linear-gradient(135deg, #fafbfc 0%, #f6f4ff 100%);
  border: 1px solid var(--trace-border);
  border-radius: var(--trace-radius);
}
.tr-research h2 {
  font-size: 22px; margin: 0 0 6px;
  display: flex; align-items: center; gap: 10px;
}
.tr-research .sub {
  color: #5a6373; font-size: 13.5px; margin-bottom: 18px;
}
.tr-research table {
  width: 100%; border-collapse: collapse;
  font-size: 13px; background: #fff;
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 0 var(--trace-border);
}
.tr-research th, .tr-research td {
  padding: 11px 12px; text-align: left;
  border-bottom: 1px solid var(--trace-border);
}
.tr-research th {
  background: #fafbfc; font-weight: 700; color: #5a6373;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
}
.tr-research tr:last-child td { border-bottom: none; }
.tr-research tr.highlight td { background: rgba(108, 79, 240, .05); }
.tr-research tr.highlight td:first-child { font-weight: 700; color: var(--trace-accent); }
.tr-research .ok { color: #16864a; }
.tr-research .half { color: #b87d00; }
.tr-research .no { color: #b22222; }

/* ========== 大入口卡片 ========== */
.tr-big-entry {
  display: grid; grid-template-columns: 2fr 1fr; gap: 14px;
  margin: 0 0 28px;
}
.tr-big-entry .tr-today {
  background: linear-gradient(135deg, #6c4ff0 0%, #4f35c9 100%);
  color: #fff; border-radius: var(--trace-radius);
  padding: 26px 26px 22px;
  position: relative; overflow: hidden;
}
.tr-big-entry .tr-today::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 90% 10%, rgba(255, 255, 255, .18) 0%, transparent 50%);
}
.tr-big-entry .tr-today .label {
  font-size: 11px; font-weight: 700; opacity: .85;
  text-transform: uppercase; letter-spacing: .08em;
}
.tr-big-entry .tr-today .text {
  font-size: clamp(18px, 2.4vw, 22px); line-height: 1.5;
  margin: 14px 0 12px; font-weight: 600;
  position: relative;
}
.tr-big-entry .tr-today .attr {
  font-size: 12.5px; opacity: .85;
}
.tr-big-entry .tr-stats {
  display: flex; flex-direction: column; gap: 10px;
}
.tr-stat-card {
  flex: 1;
  background: #fff;
  border: 1px solid var(--trace-border);
  border-radius: var(--trace-radius);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px;
  justify-content: center;
}
.tr-stat-card .v { font-size: 26px; font-weight: 800; color: var(--trace-accent); letter-spacing: -.02em; }
.tr-stat-card .l { font-size: 11.5px; color: #5a6373; font-weight: 600; }
.tr-stat-card .d { font-size: 11px; color: #888; }

/* ========== Footer mini ========== */
.tr-cta {
  margin: 0 0 36px;
  padding: 28px 26px;
  background: #fff;
  border: 1px solid var(--trace-border);
  border-radius: var(--trace-radius);
  text-align: center;
}
.tr-cta h2 { margin: 0 0 6px; font-size: 22px; }
.tr-cta p { color: #5a6373; font-size: 13.5px; margin: 0 0 14px; }
.tr-cta-buttons { display: inline-flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.tr-cta .button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--trace-border);
  color: var(--text-primary, #1a2030);
  background: #fff;
  transition: all .15s;
}
.tr-cta .button:hover { border-color: var(--trace-accent); color: var(--trace-accent); }
.tr-cta .button.primary {
  background: var(--trace-accent);
  color: #fff; border-color: var(--trace-accent);
}

/* ========== 响应式 ========== */
@media (max-width: 760px) {
  .tr-hero { padding: 38px 0 24px; }
  .tr-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .tr-tab { white-space: nowrap; padding: 9px 14px; font-size: 13px; }
  .tr-compose-body { padding: 14px 16px 18px; }
  .tr-compose-head { padding: 14px 16px 10px; }
  .tr-input-title { font-size: 17px; }
  .tr-tools { gap: 5px; }
  .tr-tool { padding: 7px 11px; font-size: 12.5px; }
  .tr-counter { width: 100%; margin-left: 0; padding: 0; text-align: right; }
  .tr-quote-grid { grid-template-columns: 1fr; }
  .tr-big-entry { grid-template-columns: 1fr; }
  .tr-idea-images { grid-template-columns: repeat(3, 1fr); }
  .tr-submit-row { flex-direction: column; align-items: stretch; }
  .tr-submit { justify-content: center; }
  .tr-quad-current { justify-content: center; }
  .tr-research { padding: 22px 16px; }
  .tr-research table { font-size: 12px; }
  .tr-research th, .tr-research td { padding: 9px 8px; }
  .tr-cta { padding: 22px 16px; }
}

@media (max-width: 420px) {
  .tr-mx { padding: 0 14px; }
  .tr-input-title { font-size: 16px; }
  .tr-idea-images { grid-template-columns: repeat(2, 1fr); }
  .tr-stat-card { padding: 14px; }
  .tr-stat-card .v { font-size: 22px; }
}


/* ============================================================
   全站可点击性 & 链接样式增强 — 2026-08-17
   ============================================================ */

/* 所有 quote-card / idea-card 内嵌链接必须高于装饰层 */
.tr-quote-card a,
.tr-idea-card a,
.tr-quote-card button,
.tr-idea-card button {
  position: relative;
  z-index: 2;
}

/* 全站链接 hover 通用样式 */
.tr-quote-foot a,
.tr-quote-card a,
.tr-idea-foot a {
  color: var(--trace-accent);
  text-decoration: none;
  transition: opacity .15s, text-decoration .15s;
  cursor: pointer;
  word-break: break-all;
}
.tr-quote-foot a:hover,
.tr-quote-card a:hover,
.tr-idea-foot a:hover {
  text-decoration: underline;
  opacity: .85;
}

/* 来源链接更醒目 */
.tr-source-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--trace-accent-soft);
  color: var(--trace-accent);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all .15s;
  cursor: pointer;
}
.tr-source-link:hover {
  background: var(--trace-accent);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}
.tr-source-link::before {
  content: "🔗";
  font-size: 11px;
}

/* 加载骨架屏 */
.skeleton {
  background: linear-gradient(90deg,
    rgba(0,0,0,.04) 25%,
    rgba(0,0,0,.08) 37%,
    rgba(0,0,0,.04) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: 8px;
}
@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* 错误状态 */
.tr-error-state {
  padding: 24px 20px;
  text-align: center;
  background: rgba(224, 36, 94, .04);
  border: 1px dashed rgba(224, 36, 94, .3);
  border-radius: 12px;
  color: #b22222;
  font-size: 13px;
}
.tr-error-state button {
  margin-top: 8px;
  background: rgba(224, 36, 94, .12);
  border: 1px solid rgba(224, 36, 94, .3);
  color: #b22222;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* 空状态 */
.tr-empty-state {
  padding: 40px 20px;
  text-align: center;
  color: #888;
  font-size: 13px;
}
.tr-empty-state .em-icon { font-size: 32px; margin-bottom: 8px; opacity: .5; }

/* 移动端：链接点击区扩大 */
@media (max-width: 760px) {
  .tr-source-link { padding: 6px 12px; min-height: 32px; }
  .tr-quote-card a,
  .tr-idea-card a { min-height: 24px; }
}


/* 暗色适配 */
@media (prefers-color-scheme: dark) {
  :root {
    --trace-border: #2a2f3a;
    --trace-bg: #0e1116;
  }
  .tr-compose, .tr-quote-card, .tr-idea-card,
  .tr-cta, .tr-stat-card, .tr-research, .tr-research table { background: #181b22; color: #e2e6ed; }
  .tr-input-title, .tr-input-body { color: #e2e6ed; }
  .tr-input-title::placeholder, .tr-input-body::placeholder { color: #5e6470; }
  .tr-quad-pill { background: #181b22; color: #b8bec8; border-color: #2a2f3a; }
  .tr-quad-current { color: #b8bec8; }
  .tr-research .sub, .tr-research th, .tr-research td { color: #b8bec8; }
}

/* ============================================================
   暗色模式增强 v3 — 2026-08-17
   ============================================================ */
[data-theme="dark"] {
  --trace-border: #2a2f3a;
  --trace-bg: #0e1116;
  --trace-shadow: 0 4px 24px rgba(0, 0, 0, .4);
  --trace-shadow-md: 0 6px 32px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* 暗色模式手动切换按钮 */
.tr-theme-toggle {
  position: fixed; bottom: 80px; right: 16px; z-index: 99;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--trace-accent, #6c4ff0); color: #fff;
  border: none; cursor: pointer; font-size: 18px;
  box-shadow: 0 4px 16px rgba(108, 79, 240, .4);
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.tr-theme-toggle:hover { transform: scale(1.1); }
.tr-theme-toggle:active { transform: scale(0.95); }

/* 暗色模式下的金句卡装饰引号 */
[data-theme="dark"] .tr-quote-card::before { color: rgba(255, 255, 255, .08); }

/* 暗色模式下的 AI 推荐 */
[data-theme="dark"] .ai-reason { background: rgba(108, 79, 240, .12); color: #c9c4e8; }

/* 暗色模式下的搜索高亮 */
[data-theme="dark"] mark, [data-theme="dark"] .search-highlight {
  background: rgba(252, 211, 77, .3); color: #fff;
}

/* 性能优化：GPU 加速 */
.tr-quote-card, .tr-idea-card, .tr-compose, .tr-tool, .tr-submit {
  transform: translateZ(0);
  will-change: auto;
}

/* ============================================================
   观点火花 · 时尚互动活动
   ============================================================ */
.tr-campaign {
  margin: 0 0 32px;
  color: #fff;
  border-radius: 20px;
  padding: 30px 28px 26px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(70% 140% at 100% 0%, rgba(199, 243, 107, .30) 0%, transparent 55%),
    radial-gradient(60% 130% at 0% 100%, rgba(108, 79, 240, .55) 0%, transparent 55%),
    linear-gradient(118deg, #1b1330 0%, #3a2470 50%, #5a3ad6 100%);
  box-shadow: 0 14px 40px rgba(58, 36, 112, .28);
}
.tr-campaign::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at 70% 20%, #000 0%, transparent 65%);
  pointer-events: none;
}
.c-kicker {
  font-size: 11px; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase;
  opacity: .9;
  display: inline-flex; align-items: center; gap: 8px;
}
.c-kicker::before {
  content: "✦"; font-size: 14px;
  color: #c7f36b; animation: tr-spin 8s linear infinite;
}
@keyframes tr-spin { to { transform: rotate(360deg); } }
.c-title {
  font-size: clamp(20px, 3vw, 27px);
  margin: 12px 0 8px; font-weight: 800;
  letter-spacing: -.015em; line-height: 1.35;
}
.c-desc {
  font-size: 13.5px; opacity: .92; line-height: 1.7;
  margin: 0 0 20px;
}
.c-topics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.c-topic {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(6px);
  border-radius: 14px;
  padding: 16px 16px 13px;
  display: flex; flex-direction: column; gap: 8px;
  transition: all .2s;
}
.c-topic:hover {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.3);
  transform: translateY(-2px);
}
.c-topic .tq { font-size: 14px; font-weight: 700; line-height: 1.45; }
.c-topic .tq .no {
  display: inline-grid; place-items: center;
  min-width: 22px; height: 22px; margin-right: 6px;
  background: #c7f36b; color: #1b1330;
  border-radius: 7px; font-size: 12px; font-weight: 900;
}
.c-topic .ment {
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  color: #c7f36b;
  display: inline-flex; align-items: center; gap: 5px;
  align-self: flex-start;
}
.c-topic .ment small {
  font-size: 10.5px; font-weight: 800; opacity: .9;
  background: rgba(199,243,107,.2); color: #eaffc6;
  padding: 2px 6px; border-radius: 999px;
}
.c-topic .picks {
  display: flex; gap: 4px; align-items: center;
  font-size: 11px; opacity: .75;
}
.c-topic .pick-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, #ffd76b, #ff8fb1);
  box-shadow: 0 0 0 2px rgba(255,255,255,.18);
}
.c-topic .picks b { color: #fff; font-weight: 800; }
.c-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.c-btn {
  border: none; cursor: pointer;
  padding: 12px 22px; border-radius: 999px;
  font-size: 14px; font-weight: 800;
  display: inline-flex; align-items: center; gap: 7px;
  background: #c7f36b; color: #1b1330;
  transition: all .15s;
  box-shadow: 0 6px 20px rgba(199,243,107,.35);
}
.c-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.c-btn.ghost {
  background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: none;
}
.c-btn.ghost:hover { border-color: #fff; background: rgba(255,255,255,.1); }
.c-countdown {
  margin: 18px 0 0;
  font-size: 12.5px; opacity: .85;
  font-variant-numeric: tabular-nums;
}
.c-countdown b { color: #c7f36b; font-weight: 800; }

@media (max-width: 560px) {
  .tr-campaign { padding: 24px 18px 22px; border-radius: 16px; }
  .c-topics { grid-template-columns: 1fr; }
}

/* 减少动画（用户偏好） */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* 触摸设备：增大目标区 */
@media (hover: none) and (pointer: coarse) {
  .tr-tool, .tr-submit, .tr-quad-pill { min-height: 44px; }
  .tr-q-btn { width: 36px; height: 36px; }
}

/* Print 模式 */
@media print {
  .tr-toolbar, .tr-tools, .tr-history, .tr-theme-toggle,
  .tr-counter, .tr-quad-suggest, .tr-voice-state, .tr-image-previews,
  .tr-cta, .nav-actions, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  .tr-quote-card, .tr-idea-card { break-inside: avoid; border: 1px solid #ccc; }
}
