/* ==========================================================================
   Waline x.com (Twitter) Style Theme
   ========================================================================== */
#waline {
  --waline-theme-color: #1d9bf0 !important;
  --waline-active-color: #1a8cd8 !important;
  --waline-color: #0f1419 !important;
  --waline-bg-color: #ffffff !important;
  --waline-bg-color-light: #eff3f4 !important;
  --waline-bg-color-hover: rgba(0, 0, 0, 0.02) !important;
  --waline-border-color: #eff3f4 !important;
  --waline-disable-bg-color: #eff3f4 !important;
  --waline-disable-color: #536471 !important;
  --waline-code-bg-color: #f7f9f9 !important;
  --waline-avatar-radius: 9999px !important;
  --waline-avatar-size: 40px !important;
  --waline-m-avatar-size: 36px !important;
  --waline-badge-color: #1d9bf0 !important;
  --waline-badge-font-size: 11px !important;
  --waline-info-bg-color: #eff3f4 !important;
  --waline-info-color: #536471 !important;
  --waline-border: 1px solid #eff3f4 !important;
  --waline-box-shadow: none !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

html.dark #waline {
  --waline-theme-color: #1d9bf0 !important;
  --waline-active-color: #1a8cd8 !important;
  --waline-color: #e7e9ea !important;
  --waline-bg-color: #000000 !important;
  --waline-bg-color-light: #16181c !important;
  --waline-bg-color-hover: rgba(255, 255, 255, 0.03) !important;
  --waline-border-color: #2f3336 !important;
  --waline-disable-bg-color: #16181c !important;
  --waline-disable-color: #71767b !important;
  --waline-code-bg-color: #16181c !important;
  --waline-avatar-radius: 9999px !important;
  --waline-badge-color: #1d9bf0 !important;
  --waline-info-bg-color: #16181c !important;
  --waline-info-color: #71767b !important;
  --waline-border: 1px solid #2f3336 !important;
  --waline-box-shadow: none !important;
}

/* X.com Style Composer Box */
#waline .wl-panel {
  border: 1px solid #eff3f4 !important;
  border-radius: 1.25rem !important;
  background: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
  padding: 1rem 1.125rem !important;
  margin: 0 0 1.5rem 0 !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

html.dark #waline .wl-panel {
  border-color: #2f3336 !important;
  background: #000000 !important;
  box-shadow: none !important;
}

#waline .wl-panel:focus-within {
  border-color: #1d9bf0 !important;
  box-shadow: 0 0 0 1px #1d9bf0 !important;
}

/* Guest Info Inputs - Sleek X Pills */
#waline .wl-header {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.5rem !important;
  border-bottom: none !important;
  padding: 0 0 0.75rem 0 !important;
  border-radius: 0 !important;
}

#waline .wl-header-item {
  display: flex !important;
  align-items: center !important;
  flex: 1 1 160px !important;
  border: 1px solid #eff3f4 !important;
  border-radius: 9999px !important;
  background: #eff3f4 !important;
  padding: 0.25rem 0.75rem !important;
  transition: all 0.2s ease !important;
}

html.dark #waline .wl-header-item {
  border-color: #2f3336 !important;
  background: #16181c !important;
}

#waline .wl-header-item:focus-within {
  border-color: #1d9bf0 !important;
  background: transparent !important;
}

#waline .wl-header label {
  color: #536471 !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  padding: 0 0.35rem 0 0 !important;
  min-width: auto !important;
}

html.dark #waline .wl-header label {
  color: #71767b !important;
}

#waline .wl-header input {
  color: #0f1419 !important;
  background: transparent !important;
  font-size: 0.8125rem !important;
  padding: 0.25rem 0 !important;
  border: none !important;
  outline: none !important;
  width: 100% !important;
}

html.dark #waline .wl-header input {
  color: #e7e9ea !important;
}

#waline .wl-header input::placeholder {
  color: #536471 !important;
  opacity: 0.8;
}

html.dark #waline .wl-header input::placeholder {
  color: #71767b !important;
}

/* Textarea Editor */
#waline .wl-editor {
  width: 100% !important;
  min-height: 5.5rem !important;
  margin: 0 !important;
  padding: 0.5rem 0.25rem !important;
  border: none !important;
  background: transparent !important;
  font-size: 0.9375rem !important;
  line-height: 1.55 !important;
  color: #0f1419 !important;
  resize: vertical !important;
  outline: none !important;
}

html.dark #waline .wl-editor {
  color: #e7e9ea !important;
}

#waline .wl-editor:focus {
  background: transparent !important;
}

#waline .wl-editor::placeholder {
  color: #536471 !important;
  font-size: 0.9375rem !important;
}

html.dark #waline .wl-editor::placeholder {
  color: #71767b !important;
}

/* Composer Footer Toolbar */
#waline .wl-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin: 0.5rem 0 0 0 !important;
  padding-top: 0.75rem !important;
  border-top: 1px solid #eff3f4 !important;
}

html.dark #waline .wl-footer {
  border-top-color: #2f3336 !important;
}

#waline .wl-actions {
  display: flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
  flex: 1 !important;
}

#waline .wl-action {
  width: 2.125rem !important;
  height: 2.125rem !important;
  border-radius: 9999px !important;
  color: #1d9bf0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background-color 0.2s ease, transform 0.1s ease !important;
  cursor: pointer !important;
}

#waline .wl-action:hover {
  background-color: rgba(29, 155, 240, 0.1) !important;
  color: #1d9bf0 !important;
}

#waline .wl-action:active {
  background-color: rgba(29, 155, 240, 0.2) !important;
  transform: scale(0.95) !important;
}

#waline .wl-action.active {
  background-color: rgba(29, 155, 240, 0.15) !important;
  color: #1d9bf0 !important;
}

#waline .wl-info {
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
}

#waline .wl-info .wl-text-number {
  color: #536471 !important;
  font-size: 0.8125rem !important;
  font-variant-numeric: tabular-nums !important;
}

html.dark #waline .wl-info .wl-text-number {
  color: #71767b !important;
}

/* Authentic X Pill "Post" (发布) Button */
#waline .wl-btn.primary {
  border-radius: 9999px !important;
  background: #1d9bf0 !important;
  border: none !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 0.875rem !important;
  padding: 0.45rem 1.25rem !important;
  line-height: 1.25 !important;
  cursor: pointer !important;
  box-shadow: 0 1px 2px rgba(29, 155, 240, 0.2) !important;
  transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease !important;
}

#waline .wl-btn.primary:hover {
  background: #1a8cd8 !important;
  box-shadow: 0 2px 8px rgba(29, 155, 240, 0.35) !important;
}

#waline .wl-btn.primary:active {
  transform: scale(0.97) !important;
}

#waline .wl-btn.primary:disabled {
  background: #1d9bf0 !important;
  opacity: 0.5 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
}

#waline .wl-btn:not(.primary) {
  border-radius: 9999px !important;
  border: 1px solid #eff3f4 !important;
  color: #536471 !important;
  font-weight: 600 !important;
  padding: 0.4rem 1rem !important;
  transition: all 0.2s ease !important;
}

html.dark #waline .wl-btn:not(.primary) {
  border-color: #2f3336 !important;
  color: #71767b !important;
}

#waline .wl-btn:not(.primary):hover {
  background: rgba(29, 155, 240, 0.08) !important;
  border-color: #1d9bf0 !important;
  color: #1d9bf0 !important;
}

/* Top Meta & Tabs Bar */
#waline .wl-meta-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0.75rem 0.25rem !important;
  margin-bottom: 0.5rem !important;
  border-bottom: 1px solid #eff3f4 !important;
}

html.dark #waline .wl-meta-head {
  border-bottom-color: #2f3336 !important;
}

#waline .wl-count {
  font-size: 1rem !important;
  font-weight: 800 !important;
  color: #0f1419 !important;
  letter-spacing: -0.01em !important;
}

html.dark #waline .wl-count {
  color: #e7e9ea !important;
}

#waline .wl-sort {
  display: flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
}

#waline .wl-sort li {
  padding: 0.25rem 0.75rem !important;
  border-radius: 9999px !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  color: #536471 !important;
  transition: all 0.2s ease !important;
}

html.dark #waline .wl-sort li {
  color: #71767b !important;
}

#waline .wl-sort li:hover {
  background: rgba(29, 155, 240, 0.08) !important;
  color: #1d9bf0 !important;
}

#waline .wl-sort li.active {
  background: #1d9bf0 !important;
  color: #ffffff !important;
}

/* Timeline Feed Cards Stream */
#waline .wl-cards {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
}

#waline .wl-card-item {
  position: relative !important;
  display: flex !important;
  padding: 1rem 0.5rem !important;
  border-bottom: 1px solid #eff3f4 !important;
  border-radius: 0.75rem !important;
  transition: background-color 0.15s ease !important;
}

html.dark #waline .wl-card-item {
  border-bottom-color: #2f3336 !important;
}

#waline .wl-card-item:hover {
  background-color: rgba(0, 0, 0, 0.015) !important;
}

html.dark #waline .wl-card-item:hover {
  background-color: rgba(255, 255, 255, 0.02) !important;
}

#waline .wl-card-item:last-child {
  border-bottom: none !important;
}

#waline .wl-card {
  border-bottom: none !important;
  padding: 0 !important;
  margin: 0 !important;
  flex: 1 !important;
  min-width: 0 !important;
}

/* Circular Avatars */
#waline .wl-user {
  margin-inline-end: 0.75rem !important;
  flex-shrink: 0 !important;
}

#waline .wl-user .wl-user-avatar,
#waline .wl-avatar {
  width: 40px !important;
  height: 40px !important;
  border-radius: 9999px !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  box-shadow: none !important;
  object-fit: cover !important;
  transition: opacity 0.2s ease !important;
}

html.dark #waline .wl-user .wl-user-avatar,
html.dark #waline .wl-avatar {
  border-color: rgba(255, 255, 255, 0.12) !important;
}

#waline .wl-user .wl-user-avatar:hover,
#waline .wl-avatar:hover {
  opacity: 0.9 !important;
}

/* User Header & Nickname */
#waline .wl-head {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 0.35rem !important;
  line-height: 1.4 !important;
  margin-bottom: 0.25rem !important;
}

#waline .wl-nick {
  font-weight: 700 !important;
  font-size: 0.9375rem !important;
  color: #0f1419 !important;
  text-decoration: none !important;
  transition: color 0.15s ease !important;
}

html.dark #waline .wl-nick {
  color: #e7e9ea !important;
}

#waline .wl-nick:hover {
  text-decoration: underline !important;
}

/* Verified Badge (X Style Blue Pill) */
#waline .wl-badge {
  display: inline-flex !important;
  align-items: center !important;
  background: #1d9bf0 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 9999px !important;
  padding: 1px 7px !important;
  font-size: 0.6875rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  letter-spacing: 0.02em !important;
}

#waline .wl-time {
  color: #536471 !important;
  font-size: 0.8125rem !important;
  font-weight: 400 !important;
  margin-inline-end: 0.5rem !important;
}

html.dark #waline .wl-time {
  color: #71767b !important;
}

#waline .wl-time::before {
  content: "· ";
  margin-right: 2px;
}

/* Meta tags (Browser, OS, Location) */
#waline .wl-meta {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 0.25rem !important;
  margin-bottom: 0.35rem !important;
}

#waline .wl-meta > span {
  background: rgba(83, 100, 113, 0.08) !important;
  color: #536471 !important;
  border-radius: 9999px !important;
  padding: 1px 7px !important;
  font-size: 0.6875rem !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
  border: none !important;
}

html.dark #waline .wl-meta > span {
  background: rgba(113, 118, 123, 0.16) !important;
  color: #71767b !important;
}

/* Comment Body Content */
#waline .wl-content {
  font-size: 0.9375rem !important;
  line-height: 1.55 !important;
  color: #0f1419 !important;
  padding: 0.25rem 0 0.5rem 0 !important;
  margin-bottom: 0.35rem !important;
  word-break: break-word !important;
}

html.dark #waline .wl-content {
  color: #e7e9ea !important;
}

#waline .wl-content a {
  color: #1d9bf0 !important;
  text-decoration: none !important;
  font-weight: 500 !important;
}

#waline .wl-content a:hover {
  text-decoration: underline !important;
}

#waline .wl-reply-to {
  color: #1d9bf0 !important;
  font-weight: 600 !important;
  margin-right: 0.35rem !important;
}

/* Action Icons (Reply, Like, Delete) - X Style */
#waline .wl-comment-actions {
  display: flex !important;
  align-items: center !important;
  gap: 1.25rem !important;
  margin-top: 0.35rem !important;
}

#waline .wl-reply,
#waline .wl-like,
#waline .wl-delete,
#waline .wl-edit {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  color: #536471 !important;
  font-size: 0.8125rem !important;
  padding: 0.25rem 0.5rem !important;
  border-radius: 9999px !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
  background: transparent !important;
  border: none !important;
}

html.dark #waline .wl-reply,
html.dark #waline .wl-like,
html.dark #waline .wl-delete,
html.dark #waline .wl-edit {
  color: #71767b !important;
}

#waline .wl-reply:hover {
  color: #1d9bf0 !important;
  background: rgba(29, 155, 240, 0.1) !important;
}

#waline .wl-like:hover {
  color: #f91880 !important;
  background: rgba(249, 24, 128, 0.1) !important;
}

#waline .wl-like.active {
  color: #f91880 !important;
  font-weight: 700 !important;
}

#waline .wl-delete:hover,
#waline .wl-edit:hover {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.1) !important;
}

/* X Reply Threading Line */
#waline .wl-quote {
  border-left: 2px solid #eff3f4 !important;
  border-right: none !important;
  border-top: none !important;
  border-bottom: none !important;
  margin-left: 1.25rem !important;
  padding-left: 1rem !important;
  margin-top: 0.75rem !important;
  background: transparent !important;
}

html.dark #waline .wl-quote {
  border-left-color: #2f3336 !important;
}

/* Reactions Bar */
#waline .wl-reaction {
  margin-bottom: 2rem !important;
  padding: 1rem !important;
  border-bottom: 1px solid #eff3f4 !important;
}

html.dark #waline .wl-reaction {
  border-bottom-color: #2f3336 !important;
}

#waline .wl-reaction-title {
  font-size: 0.9375rem !important;
  font-weight: 700 !important;
  color: #536471 !important;
  margin-bottom: 1rem !important;
}

html.dark #waline .wl-reaction-title {
  color: #71767b !important;
}

#waline .wl-reaction-item {
  border-radius: 1rem !important;
  padding: 0.5rem 0.75rem !important;
  transition: all 0.2s ease !important;
}

#waline .wl-reaction-item:hover {
  background: rgba(29, 155, 240, 0.08) !important;
  transform: translateY(-2px) !important;
}

#waline .wl-reaction-votes {
  background: #1d9bf0 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 9999px !important;
  padding: 1px 6px !important;
  font-size: 0.6875rem !important;
  font-weight: 700 !important;
}

/* Popups (Emoji / GIF) */
#waline .wl-emoji-popup,
#waline .wl-gif-popup {
  border: 1px solid #eff3f4 !important;
  border-radius: 1rem !important;
  background: #ffffff !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}

html.dark #waline .wl-emoji-popup,
html.dark #waline .wl-gif-popup {
  border-color: #2f3336 !important;
  background: #16181c !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6) !important;
}

#waline .wl-emoji-popup .wl-tab.active {
  border-bottom: 2px solid #1d9bf0 !important;
  color: #1d9bf0 !important;
  background: transparent !important;
}

/* Load More Button */
#waline .wl-operation button {
  border-radius: 9999px !important;
  border: 1px solid #eff3f4 !important;
  background: transparent !important;
  color: #1d9bf0 !important;
  font-weight: 700 !important;
  font-size: 0.875rem !important;
  padding: 0.5rem 1.5rem !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
}

html.dark #waline .wl-operation button {
  border-color: #2f3336 !important;
}

#waline .wl-operation button:hover {
  background: rgba(29, 155, 240, 0.08) !important;
  border-color: #1d9bf0 !important;
}

/* Empty State */
#waline .wl-empty {
  color: #536471 !important;
  padding: 2.5rem 1rem !important;
  font-size: 0.9375rem !important;
}

html.dark #waline .wl-empty {
  color: #71767b !important;
}

/* Powered by Waline */
#waline .wl-power {
  color: #536471 !important;
  font-size: 0.6875rem !important;
  opacity: 0.7 !important;
  margin-top: 1rem !important;
}

html.dark #waline .wl-power {
  color: #71767b !important;
}

#waline .wl-power a {
  color: #1d9bf0 !important;
}

/* Markdown typography inside Waline comments */
#waline .wl-content code,
#waline .wl-preview code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85em;
  padding: 0.2em 0.45em;
  border-radius: 6px;
  background: rgba(29, 155, 240, 0.08);
  color: #1d9bf0;
  border: 1px solid rgba(29, 155, 240, 0.15);
}

html.dark #waline .wl-content code,
html.dark #waline .wl-preview code {
  background: rgba(29, 155, 240, 0.12);
  color: #78c8f9;
  border-color: rgba(29, 155, 240, 0.25);
}

#waline .wl-content pre,
#waline .wl-preview pre {
  margin: 0.9em 0;
  padding: 0.9rem 1.1rem;
  border-radius: 0.85rem;
  background: #16181c !important;
  border: 1px solid #2f3336;
  overflow-x: auto;
}

#waline .wl-content pre code,
#waline .wl-preview pre code {
  padding: 0;
  background: transparent !important;
  color: #e7e9ea !important;
  font-size: 0.85rem;
  border: none !important;
}

#waline .wl-content blockquote,
#waline .wl-preview blockquote {
  border-left: 3px solid #1d9bf0 !important;
  background: rgba(29, 155, 240, 0.04);
  padding: 0.6rem 1rem;
  margin: 0.85em 0;
  border-radius: 0 0.5rem 0.5rem 0;
  color: inherit;
  font-style: italic;
}

html.dark #waline .wl-content blockquote,
html.dark #waline .wl-preview blockquote {
  background: rgba(29, 155, 240, 0.06);
}

#waline .wl-content table,
#waline .wl-preview table {
  width: 100%;
  margin: 1em 0;
  border-collapse: collapse;
}

#waline .wl-content th,
#waline .wl-content td,
#waline .wl-preview th,
#waline .wl-preview td {
  border: 1px solid #eff3f4;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

html.dark #waline .wl-content th,
html.dark #waline .wl-content td,
html.dark #waline .wl-preview th,
html.dark #waline .wl-preview td {
  border-color: #2f3336;
}

#waline .wl-content th,
#waline .wl-preview th {
  background: rgba(83, 100, 113, 0.08);
  font-weight: 600;
}

html.dark #waline .wl-content th,
html.dark #waline .wl-preview th {
  background: rgba(113, 118, 123, 0.16);
}
