.ce-host {
  --ce-accent: #6e40ff;
  --ce-accent-deep: #4b22d6;
  --ce-soft: #f4f2ff;
  --ce-ink: #111114;
  --ce-muted: #676579;
  --ce-line: #e5e3ef;
  min-width: 0;
  scroll-margin-top: 124px;
  color: var(--ce-ink);
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
}

.ce-panel {
  margin-block: 44px 12px;
  padding-block: 28px 6px;
  border-block-start: 1px solid var(--ce-line);
}

.ce-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
}

.ce-heading h2,
.ce-discussion-title h3 {
  margin: 0;
  color: var(--ce-ink);
  letter-spacing: -0.025em;
}

.ce-heading h2 { font-size: clamp(1.35rem, 2.5vw, 1.85rem); }
.ce-heading p { max-width: 62ch; margin: 8px 0 0; color: var(--ce-muted); font-size: .92rem; line-height: 1.7; }

.ce-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.ce-actions button,
.ce-actions .ce-share-count {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-inline: 12px;
  border: 1px solid var(--ce-line);
  border-radius: 12px;
  background: #fff;
  color: #3f3d4c;
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
}

.ce-actions button { cursor: pointer; transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease; }
.ce-actions button:hover { border-color: color-mix(in srgb, var(--ce-accent) 40%, var(--ce-line)); color: var(--ce-accent-deep); transform: translateY(-1px); }
.ce-actions button.is-active { border-color: color-mix(in srgb, var(--ce-accent) 34%, var(--ce-line)); background: var(--ce-soft); color: var(--ce-accent-deep); }
.ce-actions button:disabled { cursor: wait; opacity: .58; transform: none; }
.ce-actions svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ce-actions strong { color: inherit; font-size: .72rem; }

.ce-error {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  padding: 13px 15px;
  border: 1px solid #e7bac1;
  border-radius: 12px;
  background: #fff6f7;
  color: #8d2533;
  font-size: .85rem;
}

.ce-error button { min-height: 36px; flex: none; border: 0; border-radius: 10px; padding-inline: 13px; background: #8d2533; color: #fff; font: inherit; font-size: .75rem; font-weight: 700; cursor: pointer; }

.ce-discussion { margin-top: 28px; }
.ce-discussion-title { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--ce-line); }
.ce-discussion-title h3 { font-size: 1.03rem; }
.ce-discussion-title h3 span { color: var(--ce-accent-deep); }
.ce-discussion-title small { color: var(--ce-muted); font-size: .75rem; }

.ce-comments { display: grid; gap: 0; }
.ce-comment { min-width: 0; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding-block: 17px; border-bottom: 1px solid var(--ce-line); }
.ce-comment.is-reply { margin-inline-start: 48px; }
.ce-avatar { width: 36px; height: 36px; display: grid; place-items: center; overflow: hidden; border-radius: 11px; background: var(--ce-soft); color: var(--ce-accent-deep); font-size: .8rem; font-weight: 800; }
.ce-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ce-comment-main { min-width: 0; }
.ce-comment-main header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.ce-comment-main strong { font-size: .86rem; }
.ce-comment-main time { color: var(--ce-muted); font-size: .7rem; }
.ce-comment-main p { margin: 6px 0 8px; color: #3d3b47; font-size: .88rem; line-height: 1.72; overflow-wrap: anywhere; white-space: pre-wrap; }
.ce-comment-controls { display: flex; flex-wrap: wrap; gap: 14px; }
.ce-comment-controls button { display: inline-flex; min-height: 32px; align-items: center; gap: 5px; padding: 0; border: 0; background: transparent; color: var(--ce-muted); font: inherit; font-size: .72rem; font-weight: 700; cursor: pointer; }
.ce-comment-controls button:hover { color: var(--ce-accent-deep); }
.ce-comment-controls button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ce-empty { margin: 0; padding-block: 24px; color: var(--ce-muted); font-size: .88rem; line-height: 1.7; }

.ce-form { margin-top: 18px; padding: 17px; border-radius: 14px; background: var(--ce-soft); }
.ce-form label, .ce-form label > span { display: block; }
.ce-form label > span { margin-bottom: 9px; font-size: .8rem; font-weight: 750; }
.ce-form textarea { width: 100%; min-height: 112px; resize: vertical; box-sizing: border-box; padding: 13px 14px; border: 1px solid color-mix(in srgb, var(--ce-accent) 20%, var(--ce-line)); border-radius: 12px; background: #fff; color: var(--ce-ink); font: inherit; font-size: 1rem; line-height: 1.65; }
.ce-form textarea:focus { outline: 3px solid color-mix(in srgb, var(--ce-accent) 18%, transparent); border-color: var(--ce-accent); }
.ce-form textarea::placeholder { color: #777489; }
.ce-form > div:last-child { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 11px; }
.ce-form small { color: var(--ce-muted); font-size: .72rem; }
.ce-form button[type="submit"] { min-height: 42px; border: 0; border-radius: 11px; padding-inline: 18px; background: var(--ce-accent); color: #fff; font: inherit; font-size: .78rem; font-weight: 750; cursor: pointer; }
.ce-form button[type="submit"]:hover { background: var(--ce-accent-deep); }
.ce-form button:disabled { cursor: wait; opacity: .6; }
.ce-replying { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--ce-accent-deep); font-size: .77rem; font-weight: 700; }
.ce-replying button { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ce-read-only { margin-top: 18px; padding: 16px 17px; border: 1px solid var(--ce-line); border-radius: 14px; background: #f7f8fb; color: var(--ce-muted); }
.ce-read-only strong { color: var(--ce-ink); font-size: .86rem; }
.ce-read-only p { margin: 6px 0 0; font-size: .8rem; line-height: 1.65; }
.ce-status { min-height: 1.3em; margin: 10px 0 0; color: var(--ce-accent-deep); font-size: .73rem; }

.ce-loading { display: grid; gap: 9px; padding-block: 20px; }
.ce-loading i { display: block; height: 12px; border-radius: 6px; background: var(--ce-soft); animation: ce-pulse 1.15s ease-in-out infinite alternate; }
.ce-loading i:nth-child(2) { width: 82%; animation-delay: 120ms; }
.ce-loading i:nth-child(3) { width: 64%; animation-delay: 240ms; }
@keyframes ce-pulse { to { opacity: .38; } }

.ce-host--compact .ce-panel { margin-block: 28px 0; padding-block-start: 22px; }
.ce-host--compact .ce-heading { grid-template-columns: 1fr; gap: 16px; }
.ce-host--compact .ce-actions { justify-content: flex-start; }
.ce-host--compact .ce-heading h2 { font-size: 1.1rem; }
.ce-host--compact .ce-heading p { font-size: .79rem; }
.ce-host--compact .ce-discussion { margin-top: 22px; }
.ce-host--compact .ce-discussion-title small { display: none; }
.ce-host--compact .ce-comment.is-reply { margin-inline-start: 26px; }

@media (max-width: 720px) {
  .ce-panel { margin-block-start: 32px; padding-block-start: 23px; }
  .ce-heading { grid-template-columns: 1fr; gap: 17px; }
  .ce-actions { justify-content: flex-start; }
  .ce-actions button { flex: 1 1 auto; justify-content: center; }
  .ce-actions .ce-share-count { flex: 1 1 100%; }
  .ce-discussion-title { align-items: flex-start; flex-direction: column; gap: 4px; }
  .ce-comment.is-reply { margin-inline-start: 22px; }
  .ce-comment-controls button { min-height: 44px; }
  .ce-form { padding: 14px; }
  .ce-form > div:last-child { align-items: stretch; flex-direction: column; }
  .ce-form button[type="submit"] { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ce-actions button { transition: none; }
  .ce-loading i { animation: none; opacity: .65; }
}
