:root {
  --anz-md-text: #31445f;
  --anz-md-muted: #71839b;
  --anz-md-panel: #fbfdff;
  --anz-md-soft: #eef6ff;
  --anz-md-line: #cfe0f3;
  --anz-md-accent: #4f8fd8;
  --anz-md-accent-deep: #2d6fb8;
  --anz-md-paper: #f8fbff;
  --anz-md-code-bg: #edf6ff;
  --ann-text: #363636;
  --ann-muted: rgba(54, 54, 54, 0.66);
  --ann-accent: #425aef;
  --article-font: Inter, -apple-system, system-ui, 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

.anz-md-shell {
  margin: 10px 0 14px;
  overflow: hidden;
  color: var(--anz-md-text);
  background: linear-gradient(180deg, #fff, var(--anz-md-paper));
  border: 1px solid var(--anz-md-line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(58, 116, 176, 0.1);
}

.anz-md-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 8px;
  background: linear-gradient(180deg, #f9fcff, #edf6ff);
  border-bottom: 1px solid var(--anz-md-line);
  gap: 6px;
}

.anz-md-toolbar button,
.anz-md-toolbar select {
  min-height: 32px;
  padding: 0 10px;
  color: var(--anz-md-text);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--anz-md-line);
  border-radius: 6px;
  font-size: 13px;
  line-height: 32px;
}

.anz-md-toolbar button {
  min-width: 34px;
  cursor: pointer;
}

.anz-md-toolbar button:hover,
.anz-md-toolbar select:hover {
  color: var(--anz-md-accent);
  border-color: rgba(79, 143, 216, 0.52);
}

.anz-md-toolbar .anz-md-primary {
  color: #fff;
  background: var(--anz-md-accent);
  border-color: var(--anz-md-accent);
}

.anz-md-editor {
  padding: 10px;
}

.anz-md-editor textarea {
  width: 100%;
  color: var(--anz-md-text);
  background: var(--anz-md-paper);
  border-color: var(--anz-md-line);
  border-radius: 7px;
  box-shadow: inset 0 1px 4px rgba(58, 116, 176, 0.06);
  font-family: ui-serif, Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
  line-height: 1.75;
}

.anz-md-editor textarea:focus {
  border-color: var(--anz-md-accent);
  box-shadow: 0 0 0 3px rgba(79, 143, 216, 0.16);
  outline: 0;
}

.anz-md-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.anz-md-preview {
  display: none;
  padding: 14px;
  background: var(--anz-md-paper);
  border-top: 1px solid var(--anz-md-line);
}

.anz-md-preview.is-active {
  display: block;
}

.anz-md-preview-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
  color: var(--anz-md-muted);
  font-size: 13px;
  font-weight: 700;
}

.anz-md-preview-title::after {
  color: var(--anz-md-accent-deep);
  content: '实时';
  font-size: 12px;
  font-weight: 700;
}

.anz-md-content {
  color: var(--anz-md-text);
  font-family: ui-serif, Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
  line-height: 1.78;
  word-break: break-word;
}

.anz-md-content h1,
.anz-md-content h2,
.anz-md-content h3,
.anz-md-content h4,
.anz-md-content h5,
.anz-md-content h6 {
  position: relative;
  color: var(--ann-text);
  font-family: var(--article-font);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0;
}

.anz-md-content h2 {
  margin: 1.8rem 0 1rem;
  padding: 0;
  border: 0;
  font-size: 1.65rem;
}

.anz-md-content > h2:first-child,
.anz-md-content > .tianliGPT + h2 {
  margin-top: 0;
}

.anz-md-content h3 {
  margin: 1.55rem 0 0.75rem;
  font-size: 1.32rem;
}

.anz-md-content h4 {
  margin: 1.35rem 0 0.65rem;
  font-size: 1.12rem;
}

.anz-md-content h5,
.anz-md-content h6 {
  margin: 1.2rem 0 0.6rem;
  font-size: 1rem;
}

.anz-md-content .headerlink {
  float: right;
  padding: 0 0 0 0.65rem;
  color: var(--ann-muted) !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 0.16;
  text-decoration: none !important;
}

.anz-md-content h2:hover .headerlink,
.anz-md-content h3:hover .headerlink,
.anz-md-content h4:hover .headerlink,
.anz-md-content h5:hover .headerlink,
.anz-md-content h6:hover .headerlink {
  color: var(--ann-accent) !important;
  opacity: 0.85;
}

/* Fomalhaut-style rotating fan prefix for Markdown headings. */
.anz-md-content h1,
.anz-md-content h2,
.anz-md-content h3,
.anz-md-content h4,
.anz-md-content h5,
.anz-md-content h6 {
  --heading-fan-color: #f47466;
  padding-left: 1.55em;
  transition: color 0.2s ease-out;
}

.anz-md-content h1::before,
.anz-md-content h2::before,
.anz-md-content h3::before,
.anz-md-content h4::before,
.anz-md-content h5::before,
.anz-md-content h6::before {
  position: absolute;
  top: 0.22em;
  left: 0.08em;
  display: inline-block;
  color: var(--heading-fan-color);
  content: '\f863';
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free";
  font-size: 0.82em;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  transform-origin: 50% 50%;
  animation: article-heading-fan 4s linear infinite;
  transition: color 0.2s ease-out;
}

.anz-md-content h1 { --heading-fan-color: #ef50a8; }
.anz-md-content h2 { --heading-fan-color: #fb7061; }
.anz-md-content h3 { --heading-fan-color: #ffbf00; }
.anz-md-content h4 { --heading-fan-color: #8fbe00; }
.anz-md-content h5 { --heading-fan-color: #57c850; }
.anz-md-content h6 { --heading-fan-color: #39a8ca; }

.anz-md-content h1:hover,
.anz-md-content h2:hover,
.anz-md-content h3:hover,
.anz-md-content h4:hover,
.anz-md-content h5:hover,
.anz-md-content h6:hover {
  color: var(--ann-accent) !important;
}

.anz-md-content h1:hover::before,
.anz-md-content h2:hover::before,
.anz-md-content h3:hover::before,
.anz-md-content h4:hover::before,
.anz-md-content h5:hover::before,
.anz-md-content h6:hover::before {
  color: var(--ann-accent);
  animation-duration: 6s;
}

@keyframes article-heading-fan {
  from { transform: rotate(0deg); }
  to { transform: rotate(-1turn); }
}

@media (prefers-reduced-motion: reduce) {
  .anz-md-content h1::before,
  .anz-md-content h2::before,
  .anz-md-content h3::before,
  .anz-md-content h4::before,
  .anz-md-content h5::before,
  .anz-md-content h6::before {
    animation: none;
  }
}

.anz-md-content > :first-child,
.anz-tab-panel > :first-child,
.folding-content > :first-child {
  margin-top: 0;
}

.anz-md-content > :last-child,
.anz-tab-panel > :last-child,
.folding-content > :last-child {
  margin-bottom: 0;
}

.anz-md-content pre {
  overflow-x: auto;
  padding: 12px;
  color: #31445f;
  background: #edf6ff;
  border: 1px solid var(--anz-md-line);
  border-radius: 7px;
}

.anz-md-content code {
  padding: 0.12em 0.35em;
  color: var(--anz-md-accent-deep);
  background: var(--anz-md-code-bg);
  border-radius: 4px;
}

.anz-md-content pre code {
  padding: 0;
  color: inherit;
  background: transparent;
}

.anz-md-content blockquote {
  margin: 14px 0;
  padding: 10px 14px;
  color: var(--anz-md-muted);
  background: var(--anz-md-soft);
  border-left: 4px solid var(--anz-md-accent);
  border-radius: 0 7px 7px 0;
}

.anz-md-content img {
  max-width: 100%;
  height: auto;
}

.anz-md-content a {
  color: var(--anz-md-accent-deep);
  text-decoration: none;
}

.anz-md-content .tip,
.anz-md-content .anz-note,
.message .tip,
.message .anz-note,
.post-message .tip,
.post-message .anz-note {
  position: relative;
  margin: 16px 0;
  padding: 13px 15px;
  overflow: hidden;
  color: var(--anz-md-text);
  background: color-mix(in srgb, var(--plugin-color) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--plugin-color) 24%, transparent);
  border-left: 4px solid var(--plugin-color);
  border-radius: 7px;
  --plugin-color: #425aef;
}

.tip.success,
.anz-note.success { --plugin-color: #28a26b; }
.tip.warning,
.anz-note.warning { --plugin-color: #df8b36; }
.tip.error,
.tip.danger,
.anz-note.danger { --plugin-color: #e45467; }
.tip.info,
.anz-note.info { --plugin-color: #168aad; }
.anz-note.blue { --plugin-color: #425aef; }
.anz-note.green { --plugin-color: #28a26b; }
.anz-note.yellow { --plugin-color: #d99f16; }
.anz-note.red { --plugin-color: #e45467; }
.anz-note.orange { --plugin-color: #dd7c38; }
.anz-note.purple { --plugin-color: #7656c9; }

.anz-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.anz-note-icon {
  margin-top: 5px;
  color: var(--plugin-color);
}

.anz-choice {
  display: flex;
  align-items: center;
  margin: 0.42rem 0;
  color: var(--anz-md-text);
  --choice-color: #425aef;
  gap: 9px;
}

.anz-choice.red { --choice-color: #e45467; }
.anz-choice.orange { --choice-color: #dd7c38; }
.anz-choice.yellow { --choice-color: #d99f16; }
.anz-choice.green { --choice-color: #28a26b; }
.anz-choice.cyan { --choice-color: #168aad; }
.anz-choice.blue { --choice-color: #425aef; }
.anz-choice.purple { --choice-color: #7656c9; }

.anz-choice input {
  position: relative;
  width: 17px;
  min-width: 17px;
  height: 17px;
  min-height: 17px;
  margin: 0;
  appearance: none;
  background: transparent;
  border: 2px solid var(--choice-color);
  border-radius: 4px;
  opacity: 1;
}

.anz-choice input[type='radio'] { border-radius: 50%; }
.anz-choice input:checked { background: var(--choice-color); }
.anz-choice input[type='checkbox']:checked::after {
  position: absolute;
  top: 1px;
  left: 4px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  content: '';
  transform: rotate(45deg);
}
.anz-choice input[type='radio']:checked::after {
  position: absolute;
  inset: 3px;
  background: #fff;
  border-radius: 50%;
  content: '';
}

.folding-tag,
.anz-hide-toggle {
  margin: 1rem 0;
  overflow: hidden;
  color: var(--anz-md-text);
  background: #fff;
  border: 1px solid var(--anz-md-line);
  border-radius: 8px;
  --folding-color: var(--anz-md-accent);
}

.folding-tag[red] { --folding-color: #e45467; }
.folding-tag[orange] { --folding-color: #dd7c38; }
.folding-tag[yellow] { --folding-color: #d99f16; }
.folding-tag[green] { --folding-color: #28a26b; }
.folding-tag[cyan] { --folding-color: #168aad; }
.folding-tag[blue] { --folding-color: #425aef; }
.folding-tag[purple] { --folding-color: #7656c9; }

.folding-tag > summary,
.anz-hide-toggle > summary {
  position: relative;
  padding: 12px 42px 12px 15px;
  background: color-mix(in srgb, var(--folding-color) 7%, transparent);
  font-size: 0.92rem;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.folding-tag > summary::-webkit-details-marker,
.anz-hide-toggle > summary::-webkit-details-marker {
  display: none;
}

.folding-tag > summary::after,
.anz-hide-toggle > summary::after {
  position: absolute;
  top: 50%;
  right: 15px;
  color: var(--folding-color);
  content: '+';
  font-family: monospace;
  font-size: 20px;
  transform: translateY(-52%);
}

.folding-tag[open] > summary,
.anz-hide-toggle[open] > summary {
  color: #fff;
  background: var(--folding-color);
}

.folding-tag[open] > summary::after,
.anz-hide-toggle[open] > summary::after {
  color: #fff;
  content: '-';
}

.folding-content,
.anz-hide-toggle > div {
  padding: 15px;
}

.anz-hide-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.anz-hide-block {
  margin: 16px 0;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--anz-md-line);
  border-radius: 7px;
}

.anz-hide-button {
  padding: 5px 10px;
  color: var(--hide-color, #425aef);
  background: var(--hide-bg, rgba(66, 90, 239, 0.1));
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.anz-hide-content { display: none; }
.is-revealed > .anz-hide-content { display: inline; }
.anz-hide-block.is-revealed > .anz-hide-content { display: block; margin-top: 10px; }

.anz-tabs {
  margin: 20px 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--anz-md-line);
  border-radius: 8px;
}

.anz-tab-nav {
  display: flex;
  overflow-x: auto;
  padding: 7px;
  background: var(--anz-md-soft);
  gap: 5px;
}

.anz-tab-button {
  min-height: 36px;
  padding: 0 13px;
  color: var(--anz-md-muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.anz-tab-button.active {
  color: #fff;
  background: #425aef;
}

.anz-tab-panel {
  display: none;
  padding: 18px;
}

.anz-tab-panel.active {
  display: block;
}

.anz-timeline {
  --timeline-color: #425aef;
  position: relative;
  margin: 22px 0;
  padding-left: 24px;
}
.anz-timeline.pink { --timeline-color: #e95488; }
.anz-timeline.orange { --timeline-color: #e98148; }
.anz-timeline.gold { --timeline-color: #d99a2b; }
.anz-timeline.sky { --timeline-color: #5aa9e6; }
.anz-timeline.green { --timeline-color: #28a26b; }
.anz-timeline::before {
  position: absolute;
  top: 46px;
  bottom: 5px;
  left: 7px;
  width: 2px;
  background: color-mix(in srgb, var(--timeline-color) 20%, transparent);
  content: '';
}
.anz-timeline > h3 { margin: 0 0 17px; }
.anz-timeline-item {
  position: relative;
  margin: 0 0 16px;
  padding: 13px 15px;
  background: #fff;
  border: 1px solid var(--anz-md-line);
  border-radius: 7px;
}
.anz-timeline-item::before {
  position: absolute;
  top: 18px;
  left: -22px;
  width: 10px;
  height: 10px;
  background: var(--timeline-color);
  border: 3px solid #fff;
  border-radius: 50%;
  content: '';
}
.anz-timeline-title {
  color: var(--timeline-color);
  font-weight: 750;
}

.anz-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  color: #425aef;
  background: rgba(66, 90, 239, 0.1);
  border-radius: 5px;
  font-size: 0.88em;
}
.anz-label.pink { color: #df4f88; background: rgba(223, 79, 136, 0.1); }
.anz-label.red { color: #d94b60; background: rgba(217, 75, 96, 0.1); }
.anz-label.green { color: #208f61; background: rgba(32, 143, 97, 0.1); }
.anz-label.orange { color: #d97838; background: rgba(217, 120, 56, 0.11); }

.anz-inline { color: inherit; }
u.anz-inline { border-bottom: 1px solid #e45467; text-decoration: none; }
emp.anz-inline { border-bottom: 4px dotted #e45467; }
wavy.anz-inline { text-decoration: underline wavy #e45467; text-underline-offset: 3px; }
psw.anz-inline {
  color: transparent;
  background: rgba(38, 54, 77, 0.42);
  border-radius: 3px;
  transition: color 0.2s ease, background 0.2s ease;
}
psw.anz-inline:hover { color: var(--anz-md-text); background: transparent; }

.anz-text.red { color: #e45467; }
.anz-text.orange { color: #dd7c38; }
.anz-text.yellow { color: #c18a10; }
.anz-text.green { color: #28a26b; }
.anz-text.cyan { color: #168aad; }
.anz-text.blue,
.anz-text.info { color: #458ee8; }
.anz-text.purple { color: #7656c9; }
.anz-text.gray { color: var(--anz-md-muted); }
.anz-text.bold { font-weight: 700; }

.anz-btn {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  margin: 5px 7px 5px 0;
  padding: 0 14px;
  color: #fff !important;
  background: #425aef;
  border-radius: 7px;
  box-shadow: 0 6px 14px rgba(66, 90, 239, 0.16);
  font-weight: 650;
  gap: 7px;
}
.anz-btn.pink { background: #e95488; }
.anz-btn.orange { background: #eb8048; }
.anz-btn.green { background: #29a474; }
.anz-btn.outline {
  color: #425aef !important;
  background: transparent;
  border: 1px solid rgba(66, 90, 239, 0.3);
  box-shadow: none;
}

.anz-tag-link {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  margin: 1rem 0;
  padding: 11px 13px !important;
  color: var(--anz-md-text) !important;
  background: #fff;
  border: 1px solid var(--anz-md-line) !important;
  border-radius: 8px;
  gap: 11px;
}
.anz-link-icon {
  display: grid;
  width: 46px;
  height: 46px;
  overflow: hidden;
  background: rgba(66, 90, 239, 0.08);
  border-radius: 7px;
  place-items: center;
}
.anz-link-icon img { width: 28px; height: 28px; object-fit: contain; }
.anz-tag-link small { color: var(--anz-md-muted); }

.anz-image {
  margin: 20px auto;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--anz-md-line);
  border-radius: 8px;
  text-align: center;
}
.anz-image img {
  display: block;
  max-width: 100%;
  margin: auto;
  border-radius: 6px;
}
.anz-image figcaption {
  margin-top: 8px;
  color: var(--anz-md-muted);
  font-size: 13px;
}
.anz-inline-image {
  display: inline-block;
  width: auto;
  margin: 0 4px;
  vertical-align: -0.35em;
  border-radius: 4px;
}
.anz-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 20px 0 10px;
  gap: 9px;
}
.anz-gallery figure {
  position: relative;
  height: var(--gallery-row-height, 220px);
  min-height: 150px;
  margin: 0;
  overflow: hidden;
  border-radius: 7px;
}
.anz-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.anz-gallery figcaption {
  position: absolute;
  right: 7px;
  bottom: 7px;
  left: 7px;
  padding: 5px 7px;
  color: #fff;
  background: rgba(20, 28, 42, 0.56);
  border-radius: 5px;
  font-size: 11px;
}

@media (max-width: 640px) {
  .anz-md-toolbar {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .anz-gallery {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 900px) {
  .anz-md-shell.is-live-preview .anz-md-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  }

  .anz-md-shell.is-live-preview .anz-md-preview {
    border-top: 0;
    border-left: 1px solid var(--anz-md-line);
  }
}
