/* ============================================
   SEKAI Rich Text & Media (Minimalist Geometric Redesign)
   ============================================ */

/* --- Typography & Inline Elements --- */

.sekai-text-node {
  line-height: 1.6;
}

/* Bold text styling */
.sekai-text-node strong {
  font-weight: 700;
  color: #fff;
}

/* Italic text styling */
.sekai-text-node em {
  font-style: italic;
  color: #e0d4f7;
}

/* Strikethrough text styling */
.sekai-text-node del {
  text-decoration: line-through;
  opacity: 0.7;
}

/* Inline code styling */
.sekai-code-inline {
  font-family: var(--sekai-font-mono);
  background: #2b2633;
  color: #f8c555;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
  border: 1px solid rgba(255,255,255,0.05);
}

/* --- Code Block (IDE Style Integration) --- */
.sekai-code-block {
  font-family: var(--sekai-font-mono);
  display: block;
  /* Upgrade to gradient glass background to match file-card */
  background: linear-gradient(145deg, rgba(43, 38, 51, 0.9), rgba(30, 25, 40, 0.95));
  color: #e0d4f7; /* Keep the soft purple text */
  padding: 12px 16px;
  border-radius: 8px; /* Slightly smoother radius */
  margin: 10px 0;
  white-space: pre; /* Use pre to strictly respect formatting */
  overflow-x: auto; /* Scroll for long lines */
  
  /* Geometric Accent: Left border strip */
  border-left: 3px solid rgb(var(--sekai-accent) / 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08); /* Unified border style */
  border-left-width: 3px; /* Ensure left border takes precedence */
  
  line-height: 1.6;
  font-size: 0.9em; /* Slightly smaller for density */
  tab-size: 2;
  
  /* UX: Subtle shadow to lift it from chat background */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s;
}

.sekai-code-block:hover {
  border-color: rgba(167, 139, 250, 0.3); /* Integrated hover state */
  border-left-color: #a78bfa; /* Highlight accent on hover */
}

/* Scrollbar styling for code block */
.sekai-code-block::-webkit-scrollbar {
  height: 6px;
}
.sekai-code-block::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
.sekai-code-block::-webkit-scrollbar-track {
  background: transparent;
}

/* Spoiler / 黑幕 - Optical Blur Redesign */
/* Spoiler / 黑幕 - Digital Interference Tape */
.sekai-spoiler {
  /* "Stuck on" feel: Solid noise texture masking the text */
  background: #2a2635;
  color: transparent;
  text-shadow: none; /* Removed text hint to ensure total spoiler safety */
  padding: 0 4px; /* Tighter padding like a tape */
  margin: 0 2px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  font-weight: 500;
  border: 1px solid rgb(var(--sekai-accent) / 0.2);
  
  /* Texture: Digital Noise Stripe */
  background-image: repeating-linear-gradient(
    135deg,
    #2a2635,
    #2a2635 6px,
    #332e42 6px,
    #332e42 12px
  );
  /* Soft shadow to lift it up (Layering) */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sekai-spoiler:hover {
  /* Interactive feedback: Brighter, slightly unstable feel */
  border-color: rgba(167, 139, 250, 0.6); /* Purple accent highlight */
  background-image: repeating-linear-gradient(
    135deg,
    #322d40,
    #322d40 6px,
    #3e3750 6px,
    #3e3750 12px
  );
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255,255,255,0.05);
}

.sekai-spoiler.revealed {
  /* "Dug out" / Contextual feel: Texture vanishes, text remains */
  background: rgb(var(--sekai-accent) / 0.15);
  background-image: none;
  color: inherit;
  text-shadow: none; /* Clear blur */
  cursor: text;
  user-select: text;
  border-color: transparent;
  box-shadow: none;
  padding: 0 2px; /* Slight shrink to fit text naturally */
  animation: sekai-spoiler-reveal 0.3s ease-out;
}

@keyframes sekai-spoiler-reveal {
  0% { filter: blur(4px); opacity: 0.5; }
  100% { filter: blur(0); opacity: 1; }
}

/* Auto-linked URLs */
.sekai-link-inline {
  color: #88b3f5;
  text-decoration: none; /* No underline by default to keep clean */
  border-bottom: 1px solid rgba(136, 179, 245, 0.3); /* Subtle hint instead */
  transition: all 0.2s;
  padding-bottom: 0px;
}

.sekai-link-inline:hover {
  color: #a8c9ff;
  border-bottom-color: #a8c9ff; /* Fully underline on hover */
  border-bottom-width: 1.5px;
}

/* --- Stickers --- */

.sekai-sticker {
  vertical-align: middle;
  transition: transform 0.2s;
}

.sekai-sticker-inline {
  height: 60px; /* Restored to original size */
  width: auto;
  margin: 0 4px;
}

@media screen and (max-width: 600px) {
  .sekai-sticker-inline {
    height: 48px;
  }
} 


.sekai-sticker-single {
  max-width: var(--sticker-size);
  max-height: var(--sticker-size);
  display: block;
  margin: 4px 0;
  border-radius: var(--sekai-radius-control);
}

.sekai-sticker-single:hover {
  transform: scale(1.02);
}

/* --- Images --- */

.sekai-image-container {
  display: inline-block;
  margin: 6px 0;
  position: relative;
  overflow: hidden;
  border-radius: var(--sekai-radius-control);
  background: rgba(0,0,0,0.1);
  max-width: 100%;
}

/* Loading 状态默认使用 large 尺寸 */
.sekai-image-container.loading {
  width: min(400px, 100%);
  height: 225px;
}

.sekai-image-container.loading::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, #2b2633 25%, #352d42 50%, #2b2633 75%);
  background-size: 200% 100%;
  animation: sekai-shimmer 1.5s infinite;
}

.sekai-image-content {
  display: block;
  max-width: 100%;
  max-height: 400px;
  transition: opacity 0.3s;
}

.sekai-image-caption {
  padding: 4px 8px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.85em;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  transform: translateY(100%);
  transition: transform 0.2s;
}

.sekai-image-container:hover .sekai-image-caption {
  transform: translateY(0);
}

/* Image size classes - based on naturalWidth */
.sekai-image-container.sekai-image-large {
  max-width: 400px;
}

.sekai-image-container.sekai-image-small {
  max-width: 200px;
}

.sekai-error-placeholder {
  padding: 20px;
  text-align: center;
  color: #ff6b6b;
}

.sekai-error-icon {
  font-size: 24px;
  display: block;
  margin-bottom: 8px;
}

.sekai-error-text {
  font-size: 13px;
  font-style: italic;
}

/* --- Audio Player (Flat Industrial: Walkman x DAW) --- */
.sekai-audio-player {
  --player-bg: #1e1e24;       /* Deep matte chassis */
  --screen-bg: #0a0a0c;       /* Pitch black screen */
  --accent-on: #ff5500;       /* Walkman Orange / Rec Red */
  --accent-dim: #552b11;
  --text-main: #d0d0d0;
  --text-dim: #505050;
  --border-color: #333333;
  
  display: flex;
  gap: 0; /* Seamless modular design */
  background-color: var(--player-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden; /* Contain inner borders */
  margin: 12px 0;
  width: fit-content;
  min-width: 400px;
  height: 96px; 
  font-family: 'JetBrains Mono', 'Consolas', monospace; /* Monospaced for tech feel */
  user-select: none;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Common Borders */
.sekai-audio-player > div {
  border-right: 1px solid var(--border-color);
}
.sekai-audio-player > div:last-child {
  border-right: none;
}

/* 1. Console Fader Module */
.sekai-console-module {
  width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #232329;
  position: relative;
  padding: 8px 0;
}

/* Fader Scale Markings */
.sekai-fader-scale {
  position: absolute;
  top: 13px; bottom: 13px;
  left: 8px;
  width: 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.sekai-fader-tick {
  width: 100%; height: 1px; background: #444;
}
.sekai-fader-tick.major { width: 200%; background: #666; }

.sekai-fader-track {
  width: 4px;
  height: 70px;
  background: #111;
  border-radius: 2px;
  position: relative;
}

.sekai-fader-cap {
  position: absolute;
  left: 50%;
  /* top set by JS */
  transform: translateX(-50%) translateY(-50%);
  width: 24px;
  height: 12px; 
  background: #888;
  border-radius: 1px;
  cursor: grab;
  /* Flat Indent line */
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.sekai-fader-cap::after {
  content: ''; width: 100%; height: 1px; background: #222;
}
.sekai-fader-cap:active {
  background: #ccc;
  cursor: grabbing;
}


/* 2. Main Screen Module (Tape + DAW) */
.sekai-audio-content {
  flex: 1;
  background: var(--screen-bg);
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 240px;
}

/* Top Bar: Status + Track Info + Time */
.sekai-screen-meta {
  height: 20px;
  border-bottom: 1px solid #222;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  font-size: 10px;
  color: var(--text-dim);
  gap: 8px;
  overflow: hidden;
}

/* Status Indicator (LED + STEREO) */
.sekai-status-indicator {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.sekai-status-text {
  font-size: 9px;
  letter-spacing: 1px;
}

.sekai-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #333;
  flex-shrink: 0;
}

.sekai-led.active {
  background: var(--accent-on);
  box-shadow: 0 0 4px var(--accent-on);
}

/* Track Info (Title - Artist) */
.sekai-track-info {
  display: flex;
  gap: 6px;
  align-items: center;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.sekai-track-title {
  font-size: 11px;
  font-weight: 600;
  color: #eee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}

.sekai-track-artist {
  font-size: 9px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.7;
  flex-shrink: 2;
}

.sekai-track-artist::before {
  content: '- ';
}

/* Center: Visualizer & Tape Overlay */
.sekai-viz-area {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Tape Reels (Background) */
.sekai-tape-mechanism {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  opacity: 0.2; /* Subtle background mechanism */
  pointer-events: none;
}
.sekai-reel {
  width: 48px; height: 48px;
  border: 4px solid #444;
  border-radius: 50%;
  position: relative;
}
.sekai-reel::before, .sekai-reel::after {
  content: ''; position: absolute; background: #444;
  top: 50%; left: 0; right: 0; height: 2px;
}
.sekai-reel::after { transform: rotate(90deg); }
.sekai-audio-player.playing .sekai-reel {
  animation: reel-spin 4s linear infinite;
}
@keyframes reel-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Waveform Bars (Foreground) */
.sekai-audio-visualizer-bars {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end; /* DAW style: ground up */
  gap: 2px;
  height: 30px;
}
.sekai-viz-bar {
  width: 3px;
  background: #333;
  height: 100%;
  transform: scaleY(0.1);
  transition: transform 0.1s;
  transform-origin: bottom;
}
.sekai-audio-player.playing .sekai-viz-bar {
  background: var(--text-main); /* White bars */
}

/* Bottom: Progress/Scrubber */
.sekai-tape-scrubber {
  height: 16px;
  background: #151515;
  border-top: 1px solid #222;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: height 0.1s ease;
}

.sekai-tape-scrubber:hover {
  height: 18px;
}

.sekai-tape-scrubber:active {
  cursor: grabbing;
}

/* Buffered Progress (background layer) */
.sekai-scrub-buffered {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.08);
  width: 0%;
  z-index: 1;
  transition: width 0.3s ease, opacity 0.5s ease;
}

.sekai-scrub-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.05);
  width: 0%;
  border-right: 1px solid var(--accent-on);
  z-index: 2;
  transition: background 0.1s ease;
}

.sekai-tape-scrubber:hover .sekai-scrub-progress {
  background: rgba(255, 255, 255, 0.08);
}

/* Playhead triangle */
.sekai-scrub-progress::after {
  content: ''; position: absolute;
  right: -3px; top: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid var(--accent-on);
  transition: border-top-width 0.1s ease;
}

.sekai-tape-scrubber:hover .sekai-scrub-progress::after {
  border-top-width: 6px;
}

.sekai-scrub-time {
  position: absolute;
  right: 6px;
  font-size: 10px;
  color: var(--text-main);
  pointer-events: none;
  z-index: 3;
}


/* 3. Transport Module (Walkman Keys) */
.sekai-walkman-transport {
  width: 50px;
  background: #232329;
  display: flex;
  flex-direction: column;
  padding: 6px;
  gap: 4px;
}

.sekai-transport-btn {
  flex: 1;
  background: #333;
  border: none;
  border-radius: 2px;
  color: #888;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sekai-transport-btn:hover {
  background: #444;
  color: #fff;
} /* Hover brightness */
.sekai-transport-btn.active {
  background: var(--accent-on); /* Physical latch down look */
  color: #000;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}
.sekai-transport-btn svg {
  width: 14px; height: 14px; fill: currentColor;
}

/* Removed sekai-mech-icon styles */

/* --- Simple Audio Player (for [audio:URL|Duration]) - Nightcord Modern --- */

.sekai-audio-player-simple {
  /* Concept: A specialized DAW track embedded in a modern chat interface.
     Refined to blend seamlessly with Nightcord's flat-but-deep aesthetic. */

  --player-bg: #2f273f; /* Slightly lighter than chat bg */
  --player-border: rgba(255, 255, 255, 0.08);
  --control-hover: rgba(255, 255, 255, 0.05);
  --primary-accent: #a78bfa;
  --track-bg: rgba(0, 0, 0, 0.2);
  --accent-on: #ff5500; /* Added for indicator */

  display: flex;
  align-items: stretch;
  gap: 0;
  background-color: var(--player-bg);
  border-radius: 8px;
  margin: 8px 0;
  width: fit-content;
  min-width: 320px;
  max-width: 440px;
  height: 52px;

  border: 1px solid var(--player-border);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
  user-select: none;
}

.sekai-audio-player-simple:hover {
  border-color: rgba(167, 139, 250, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.sekai-audio-player-simple.playing {
  border-color: rgba(167, 139, 250, 0.5);
  background-color: #352e46;
}

/* Control Button */

.sekai-audio-control {
  width: 52px;
  height: 100%;
  border-radius: 8px 0 0 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0) 100%);
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.05);

  color: #bbb;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s ease-out; /* Faster matching tactile feel */
  flex-shrink: 0;
  
  /* Tactile Button Feel */
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2px 4px rgba(0, 0, 0, 0.2);
}

.sekai-audio-control:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
  color: #fff;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 3px 6px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

.sekai-audio-control:active {
  background: rgba(0, 0, 0, 0.15);
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.2),
    0 0 0 rgba(0, 0, 0, 0);
  transform: translateY(1px);
  border-right-color: transparent;
}

.sekai-audio-player-simple.playing .sekai-audio-control {
  color: var(--primary-accent);
  /* Playing state "pressed" or active feel if desired, but user asked for button feel generally */
}

/* Specific wrappers for layout */
.sekai-audio-icon-span {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px; /* Space between icon and indicator */
}

.sekai-audio-control svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 0;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3)); /* Depth for icon */
}

/* Status Indicator */
.sekai-audio-indicator {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2); /* Inactive state */
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3); /* Recessed look when off */
  transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.sekai-audio-indicator.active {
  background-color: var(--accent-on); /* Active Color */
  box-shadow: 0 0 6px var(--accent-on); /* Glow */
}

/* Content Area */

.sekai-audio-content-simple {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 14px;
  position: relative;
  box-shadow: inset 4px 0 8px -4px rgba(0,0,0,0.1);
  height: 100%;
  gap: 0;
}

.sekai-audio-info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 14px;
  margin-bottom: 6px;
}

/* Visualizer */

.sekai-audio-visualizer {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 100%;
  flex: 1;
  margin-right: 10px;
  opacity: 0.3;
  transition: opacity 0.3s;
}

.sekai-audio-player-simple.playing .sekai-audio-visualizer {
  opacity: 0.8;
}

.sekai-audio-visualizer-bar {
  flex: 1;
  background: var(--primary-accent);
  min-width: 2px;
  border-radius: 1px 1px 0 0;
  margin-top: auto;
  box-shadow: none;
  max-width: 3px;
}

/* Time Display */

.sekai-audio-time {
  font-family: var(--sekai-font-mono, monospace);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  letter-spacing: 0;
  text-align: right;
  text-shadow: none;
  background: transparent;
}

/* Progress Container */

.sekai-audio-progress-container {
  height: 12px;
  width: 100%;
  position: relative;
  cursor: pointer;
  z-index: 2;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
}

.sekai-audio-track {
  width: 100%;
  height: 4px;
  background: var(--track-bg);
  position: relative;
  border-radius: 2px;
  overflow: hidden;
  transition: height 0.2s ease;
}

.sekai-audio-progress-container:hover .sekai-audio-track {
  height: 6px;
  background: rgba(0, 0, 0, 0.3);
}

.sekai-audio-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--track-bg);
  position: relative;
  border-radius: 2px;
  overflow: hidden;
  transition: height 0.2s ease;
}

.sekai-audio-progress-container:hover .sekai-audio-progress-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.3);
}

.sekai-audio-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--primary-accent);
  box-shadow: none;
  border-radius: 0 2px 2px 0;
  width: 0%;
}

.sekai-audio-progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translate(50%, -50%);
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.2s;
}

.sekai-audio-progress-bar:hover .sekai-audio-progress-fill::after {
  opacity: 1;
}

/* --- File Card --- */

.sekai-file-card {
  display: flex;
  align-items: center;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border-radius: 8px; /* Slightly less rounded than audio for distinct feel */
  padding: 12px;
  margin: 6px 0;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
  border: 1px solid rgba(255,255,255,0.1);
  width: fit-content;
  min-width: 300px;
  max-width: 450px;
  backdrop-filter: blur(4px);
}

.sekai-file-card:hover {
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

.sekai-file-icon {
  width: 48px;
  height: 48px;
  background: rgba(167, 139, 250, 0.15); /* Purple tint instead of grey-white */
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a78bfa; /* Purple icon */
}

.sekai-file-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
}

.sekai-file-name {
  font-size: 0.95em;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #eee;
}

.sekai-file-meta {
  font-size: 0.75em;
  color: rgb(var(--sekai-fg-subtle) / 0.55);
  margin-top: 2px;
  font-family: var(--sekai-font-mono);
}

.sekai-file-action {
  color: rgb(var(--sekai-fg-subtle) / 0.55);
  opacity: 0.6;
  transition: opacity 0.2s;
  padding: 4px;
  display: flex;
}

.sekai-file-action:hover {
  opacity: 1;
  color: #fff;
}

/* --- Link Card --- */

.sekai-link-card {
  display: flex;
  background: rgb(var(--sekai-surface-card) / 0.9);
  border-radius: var(--sekai-radius-control);
  margin: 6px 0;
  text-decoration: none;
  overflow: hidden;
  transition: background 0.2s;
  max-width: 480px;
  align-items: stretch;
}

.sekai-link-card:hover {
  background: rgb(var(--sekai-surface-hover) / 0.85);
}

.sekai-link-accent {
  width: 4px;
  background: rgb(var(--sekai-accent));
}

.sekai-link-content {
  padding: 10px 12px;
  flex: 1;
  overflow: hidden;
}

.sekai-link-site {
  font-size: 0.75em;
  color: rgb(var(--sekai-fg-subtle) / 0.55);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.sekai-link-title {
  color: #cbbde2;
  font-weight: 600;
  font-size: 0.95em;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sekai-link-desc {
  font-size: 0.85em;
  color: #888;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sekai-link-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  color: rgba(255,255,255,0.2);
  font-size: 1.2em;
  font-weight: 300;
}

/* --- Reply Chip --- */

.sekai-reply-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(40, 35, 50, 0.4);
  padding: 3px 8px 3px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  color: #a0a0a0;
  cursor: pointer;
  border-left: 3px solid #7c6fac;
  transition: all 0.2s ease;
  margin-right: 4px;
  margin-bottom: 2px;
  user-select: none;
  max-width: 100%;
}

.sekai-reply-chip:hover {
  background: rgba(65, 55, 90, 0.5);
  color: #eee;
  border-left-color: #9d8ec4;
}

.sekai-reply-accent {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7c6fac;
  flex-shrink: 0;
  opacity: 0.8;
}

.sekai-reply-chip:hover .sekai-reply-accent {
  opacity: 1;
  color: #9d8ec4;
}

.sekai-reply-content {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  font-weight: 500;
}

/* --- Animations --- */

@keyframes sekai-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* --- Colored Text --- */

.sekai-colored-text {
  font-weight: 500;
  transition: text-shadow 0.2s;
}

.sekai-colored-text:hover {
  filter: brightness(1.1);
}

/* Truecolor mode: Original colors without adjustment */
.sekai-truecolor {
  /* Distinct styling to indicate "raw" mode */
  font-weight: 600;
  position: relative;
}

/* --- Mention chips (SEKAI v2) --- */
.sekai-mention {
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  margin: 0 1px;
  border-radius: 4px;
  background: rgb(var(--sekai-accent) / 0.28);
  color: #d4c8ff;
  font-weight: 600;
  font-size: 0.95em;
  cursor: pointer;
  vertical-align: baseline;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.sekai-mention:hover,
.sekai-mention:focus {
  background: rgb(var(--sekai-accent) / 0.45);
  color: #fff;
  outline: none;
}
.sekai-mention-ai {
  background: rgba(255, 85, 0, 0.22);
  color: #ffb48a;
}
.sekai-mention-ai:hover,
.sekai-mention-ai:focus {
  background: rgba(255, 85, 0, 0.4);
  color: #fff;
}
.sekai-mention-all {
  background: rgba(239, 68, 68, 0.25);
  color: #fecaca;
  font-weight: 700;
}
.sekai-mention-all:hover,
.sekai-mention-all:focus {
  background: rgba(239, 68, 68, 0.4);
  color: #fff;
}
.sekai-mention-role {
  background: rgba(56, 189, 248, 0.22);
  color: #bae6fd;
}

/* Image spoiler blur (SEKAI v2 Image:spoiler=true) */
.sekai-image-spoiler:not(.revealed) .sekai-image-content {
  filter: blur(18px);
  transform: scale(1.05);
  cursor: pointer;
}
.sekai-image-spoiler:not(.revealed)::after {
  content: '点击显示敏感内容';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  background: rgba(0, 0, 0, 0.25);
  pointer-events: none;
  border-radius: inherit;
}
.sekai-image-spoiler {
  position: relative;
  overflow: hidden;
}
.sekai-image-spoiler.revealed .sekai-image-content {
  filter: none;
  transform: none;
}

/* Code wrapper (SEKAI v2 Code) */
.sekai-code-wrapper {
  display: block;
  margin: 6px 0;
  border-radius: var(--sekai-radius-control);
  background: rgba(20, 16, 30, 0.65);
  overflow: hidden;
  max-width: 100%;
}
.sekai-code-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  font-size: 12px;
  color: rgb(var(--sekai-fg-subtle) / 0.55);
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sekai-code-name {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}
.sekai-code-lang {
  opacity: 0.7;
  font-family: var(--sekai-font-mono);
  text-transform: lowercase;
}
.sekai-code-toggle {
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: inherit;
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 11px;
  cursor: pointer;
}
.sekai-code-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}
.sekai-code-wrapper.collapsed .sekai-code-block {
  max-height: 4.5em;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, #000 40%, transparent);
}
.sekai-code-wrapper .sekai-code-block {
  display: block;
  margin: 0;
  border-radius: 0;
}

/* Optional: Add a subtle indicator that this is unmodified color */
.sekai-truecolor::before {
  content: '◆';
  font-size: 0.7em;
  opacity: 0.3;
  margin-right: 2px;
  vertical-align: super;
}

/* Mobile Adjustments */
@media screen and (max-width: 600px) {
  .sekai-link-card, .sekai-file-card, .sekai-audio-player {
    min-width: 100%;
    max-width: 100%;
  }
}

/* Additional SEKAI Fixes */

/* Show full URL in link card */
.sekai-link-url {
  font-size: 0.75em;
  color: #666; /* Even dimmer */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  font-family: var(--sekai-font-mono);
}

/* Blockquote */
.sekai-text-node blockquote {
  border-left: 4px solid rgb(var(--sekai-accent));
  margin: 10px 0;
  padding: 8px 16px;
  background: rgb(var(--sekai-accent) / 0.08);
  color: #eeeff1;
  border-radius: 0 8px 8px 0;
  font-style: normal; /* Modern UI prefers normal style */
}

/* Mobile spoiler adjustment - click to reveal instead of hover */
@media screen and (max-width: 768px) {
  .sekai-spoiler:hover {
    background: #000;
  }
}

