#dzApp {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #333;
  font-size: 14px;
}

.dz-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 16px;
  align-items: start;
}

.dz-side {
  position: sticky;
  top: 8px;
}

.dz-block {
  margin-bottom: 14px;
  padding: 12px;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 8px;
}

.dz-block h2 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: #222;
}

.dz-block-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  color: #222;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.dz-collapsible:not(.is-collapsed) .dz-block-toggle {
  margin-bottom: 10px;
}

.dz-chevron {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-right: 2px solid #999;
  border-bottom: 2px solid #999;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.dz-collapsible:not(.is-collapsed) .dz-chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.dz-collapsible.is-collapsed {
  padding-top: 10px;
  padding-bottom: 10px;
}

.dz-collapsible.is-collapsed .dz-block-body {
  display: none;
}

.dz-kinds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dz-kind {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.dz-kind span {
  font-size: 11px;
  font-weight: 400;
  color: #888;
}

.dz-kind.is-on {
  border-color: #1890ff;
  background: #e6f4ff;
  color: #0958d9;
}

.dz-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.dz-row > label:first-child {
  min-width: 72px;
  color: #666;
  font-size: 13px;
}

.dz-row input[type="number"],
.dz-row input[type="text"],
.dz-row select {
  padding: 5px 8px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 13px;
  min-width: 0;
}

.dz-row input[type="number"] {
  width: 72px;
}

.dz-row input[type="text"] {
  flex: 1;
  min-width: 120px;
}

.dz-row select {
  flex: 1;
  min-width: 120px;
}

.dz-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dz-pills button {
  padding: 4px 10px;
  border: 1px solid #d9d9d9;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
}

.dz-pills button.is-on {
  border-color: #1890ff;
  background: #e6f4ff;
  color: #0958d9;
}

.dz-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
}

.dz-note,
.dz-tip {
  margin: 6px 0 0;
  font-size: 12px;
  color: #888;
  line-height: 1.5;
}

.dz-actions {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

.dz-btn {
  padding: 8px 14px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}

.dz-btn:hover {
  border-color: #1890ff;
  color: #1890ff;
}

.dz-btn-primary {
  background: #1890ff;
  border-color: #1890ff;
  color: #fff;
  font-weight: 600;
}

.dz-btn-primary:hover {
  background: #0958d9;
  color: #fff;
}

.dz-preview {
  min-width: 0;
  width: 100%;
  background: #eef1f5;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

.dz-preview-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid #eee;
}

.dz-preview-bar > span {
  font-weight: 600;
  flex: 1;
  min-width: 100px;
}

.dz-zoom,
.dz-pager {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dz-zoom button,
.dz-pager button {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
}

#zoomFit {
  width: auto;
}

#pageLabel {
  min-width: 56px;
  text-align: center;
  font-size: 12px;
  color: #666;
}

.dz-stage {
  padding: 8px;
  overflow: hidden;
  height: calc(100vh - 130px);
  min-height: 560px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  box-sizing: border-box;
}

.dz-stage.is-zoomed {
  overflow: auto;
}

.dz-page-scale {
  transform-origin: top left;
  flex-shrink: 0;
}

.dz-page {
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
  color: #222;
}

.dz-page + .dz-page {
  margin-top: 16px;
}

.dz-page-inner {
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.dz-header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 2.5mm;
  font-size: 12px;
}

.dz-header-item {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-width: 70px;
}

.dz-header-item .line {
  flex: 1;
  border-bottom: 1px solid currentColor;
  min-width: 48px;
  height: 14px;
}

.dz-page-title {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 2.5mm;
  letter-spacing: 0.08em;
}

.dz-topic {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  margin: 2mm 0 2.5mm;
  font-size: 13px;
  color: #222;
}

.dz-topic .line {
  flex: none;
  width: 55mm;
  max-width: 45%;
  border-bottom: 1px solid currentColor;
  height: 16px;
}

.dz-body {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dz-body > .dz-dot,
.dz-body > .dz-hengxian,
.dz-body > .dz-cornell,
.dz-body > .dz-zuobiao,
.dz-body > .dz-vcenter {
  flex: 1;
  min-height: 0;
  width: 100%;
}

.dz-body > .dz-fangge {
  flex: 0 0 auto;
  width: auto;
  height: auto;
  max-width: 100%;
  align-self: flex-start;
  margin: 0 auto;
}

.dz-footer {
  flex-shrink: 0;
  text-align: center;
  font-size: 11px;
  margin-top: 1mm;
  padding-top: 0;
  color: inherit;
  opacity: 0.75;
  background: #fff;
  position: relative;
  z-index: 2;
}

.dz-grid {
  margin-left: auto;
  margin-right: auto;
  border-collapse: collapse;
  table-layout: fixed;
}

.dz-grid td {
  border: 1px solid currentColor;
  position: relative;
  padding: 0;
}

.dz-tian td::before,
.dz-tian td::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.dz-tian td::before {
  border-top: 1px dashed currentColor;
  top: 50%;
  bottom: auto;
  opacity: 0.55;
}

.dz-tian td::after {
  border-left: 1px dashed currentColor;
  left: 50%;
  right: auto;
  opacity: 0.55;
}

.dz-mi td::before,
.dz-mi td::after,
.dz-jiu td::before,
.dz-jiu td::after,
.dz-hui td::before {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0.55;
}

/* 米字格：十字虚线 */
.dz-mi td::before {
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px dashed currentColor;
  transform: translateY(-50%);
}

.dz-mi td::after {
  top: 0;
  bottom: 0;
  left: 50%;
  border-left: 1px dashed currentColor;
  transform: translateX(-50%);
}

/* 米字格：对角虚线 */
.dz-mi-diag {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
}

.dz-mi-diag::before,
.dz-mi-diag::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 141.42%;
  border-top: 1px dashed currentColor;
}

.dz-mi-diag::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.dz-mi-diag::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* 九宫格：虚线 */
.dz-jiu td::before {
  left: 0;
  right: 0;
  top: 33.33%;
  height: 33.33%;
  border-top: 1px dashed currentColor;
  border-bottom: 1px dashed currentColor;
  box-sizing: border-box;
}

.dz-jiu td::after {
  top: 0;
  bottom: 0;
  left: 33.33%;
  width: 33.33%;
  border-left: 1px dashed currentColor;
  border-right: 1px dashed currentColor;
  box-sizing: border-box;
}

/* 回宫格：内框虚线 */
.dz-hui td::before {
  inset: 18%;
  border: 1px dashed currentColor;
}

.dz-sixian-row {
  margin-bottom: 0;
}

.dz-sixian-lines {
  position: relative;
  width: 100%;
}

.dz-sixian-lines i {
  display: block;
  width: 100%;
  border-top: 1px solid currentColor;
  position: absolute;
  left: 0;
}

.dz-sixian-lines i.dash {
  border-top-style: dashed;
  opacity: 0.7;
}

.dz-pinyin-block {
  margin-bottom: 4px;
}

.dz-pinyin-tian {
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--cell, 14mm));
  gap: 0;
  width: 100%;
}

.dz-pinyin-tian .cell {
  width: var(--cell, 14mm);
  height: var(--cell, 14mm);
  border: 1px solid currentColor;
  box-sizing: border-box;
  position: relative;
}

.dz-pinyin-tian .cell::before,
.dz-pinyin-tian .cell::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  pointer-events: none;
}

.dz-pinyin-tian .cell::before {
  border-top: 1px dashed currentColor;
  top: 50%;
  bottom: auto;
}

.dz-pinyin-tian .cell::after {
  border-left: 1px dashed currentColor;
  left: 50%;
  right: auto;
}

.dz-fangge {
  flex-shrink: 0;
  overflow: hidden;
  background-clip: padding-box;
}

.dz-dot {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  align-self: stretch;
  background-color: transparent;
}

.dz-hengxian,
.dz-zuobiao {
  width: 100%;
  height: 100%;
  min-height: 0;
  align-self: stretch;
}

.dz-cornell {
  display: grid;
  grid-template-columns: 28% 1fr;
  grid-template-rows: 1fr 22%;
  width: 100%;
  height: 100%;
  border: 1px solid currentColor;
}

.dz-cornell .cue {
  grid-row: 1;
  grid-column: 1;
  border-right: 1px solid currentColor;
}

.dz-cornell .notes {
  grid-row: 1;
  grid-column: 2;
}

.dz-cornell .summary {
  grid-row: 2;
  grid-column: 1 / span 2;
  border-top: 1px solid currentColor;
  padding: 2px 4px;
  font-size: 11px;
  color: #222;
  border-top-color: var(--dz-line, currentColor);
}

.dz-vcenter {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 6mm;
  width: 100%;
  box-sizing: border-box;
}

.dz-vcenter--center {
  align-items: center;
}

.dz-seo {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 32px 0 20px;
  padding: 24px;
  background: #f9f9f9;
  border: 1px solid #e6e6e6;
  border-radius: 6px;
  line-height: 1.65;
}

.dz-seo h2 {
  margin: 0 0 14px;
  padding-bottom: 8px;
  font-size: 18px;
  color: #222;
  border-bottom: 2px solid #1890ff;
}

.dz-seo h3 {
  margin: 20px 0 10px;
  font-size: 15px;
  color: #333;
}

.dz-seo p,
.dz-seo li {
  font-size: 14px;
  color: #444;
}

.dz-seo ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.dz-seo li {
  margin-bottom: 6px;
}

@media (max-width: 960px) {
  .dz-layout {
    grid-template-columns: 1fr;
  }

  .dz-side {
    position: static;
  }

  .dz-stage {
    height: auto;
    min-height: 480px;
    max-height: 80vh;
    overflow: auto;
  }
}
