.chinese-compo-shell,
.chinese-compo-shell button,
.chinese-compo-shell .essay-reader,
.chinese-compo-shell .essay-list__button {
  font-family: "Space Grotesk", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.chinese-compo-shell .essay-reader h2 {
  letter-spacing: 0;
}

.chinese-compo-shell .essay-reader {
  position: relative;
  max-height: 108vh;
}

.chinese-compo-shell .essay-workspace {
  min-height: 102vh;
}

.chinese-compo-shell .essay-list {
  max-height: calc(102vh - 7.1rem);
}

.essay-reader__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.chinese-compo-shell .essay-reader__meta {
  flex: 1 1 auto;
  min-width: 6.5rem;
  margin-bottom: 0;
  padding-right: 0;
}

.essay-reader__actions {
  flex: 0 0 auto;
  z-index: 1;
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.read-toggle,
.expand-toggle {
  padding: 0.32rem 0.72rem;
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.25;
}

.read-toggle.is-read {
  border-color: #1e7d67;
  background: #15926f;
  color: #fff;
}

.expand-toggle {
  border-color: #9fb2d9;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.expand-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.chinese-compo-shell .essay-list__button {
  position: relative;
  padding-right: 4.2rem;
}

.essay-list__status {
  position: absolute;
  top: 0.8rem;
  right: 0.9rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid #93d7c4;
  border-radius: 999px;
  background: #e2f8f1;
  color: #0f604d;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.essay-list__button.is-read .essay-list__title {
  color: #0f604d;
}

.chinese-compo-shell .filter-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0.75rem;
  padding: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: var(--surface);
}

.chinese-compo-shell .filter-tab {
  padding: 0.5rem 0.45rem;
  border: none;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.chinese-compo-shell .filter-tab.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 14px rgba(21, 42, 102, 0.08);
}

.essay-list__empty {
  margin: 0.75rem;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 0.65rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.essay-insights {
  display: grid;
  gap: 0.7rem;
  margin: 0 0 1.1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  background: #fbfcff;
}

.essay-insights__focus {
  margin: 0;
  color: #26364f;
  font-size: 0.95rem;
  line-height: 1.65;
}

.essay-insights__focus::before {
  content: "写作重点：";
  color: var(--brand);
  font-weight: 600;
}

.essay-insights__phrases {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.essay-insights__phrases::before {
  content: "好词佳句";
  align-self: center;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 600;
}

.phrase-chip {
  padding: 0.22rem 0.5rem;
  border: 1px solid #d4a05d;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
}

.phrase-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(21, 42, 102, 0.12);
}

.chinese-essay-body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 1.03rem;
  line-height: 1.9;
}

.phrase-highlight {
  display: inline;
  padding: 0.04rem 0.16rem;
  border-radius: 0.28rem;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  font-weight: 600;
  transition: box-shadow 0.2s ease, outline-color 0.2s ease;
}

.phrase-chip--0,
.phrase-highlight--0 {
  border-color: #9fb2d9;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.phrase-chip--1,
.phrase-highlight--1 {
  border-color: #8cc9b7;
  background: #e5f6f0;
  color: #0f5d4b;
}

.phrase-chip--2,
.phrase-highlight--2 {
  border-color: #dfa65b;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.phrase-chip--3,
.phrase-highlight--3 {
  border-color: #e4a1ae;
  background: #fff1f2;
  color: #8a1d2c;
}

.phrase-chip--4,
.phrase-highlight--4 {
  border-color: #b0b6d8;
  background: #edf0fb;
  color: #333d7a;
}

.phrase-chip--5,
.phrase-highlight--5 {
  border-color: #86c8df;
  background: #e8f6fb;
  color: #175a71;
}

.phrase-chip--6,
.phrase-highlight--6 {
  border-color: #cfb16b;
  background: #f8efd8;
  color: #684e18;
}

.phrase-chip--7,
.phrase-highlight--7 {
  border-color: #a8cf84;
  background: #eef8e4;
  color: #3f631a;
}

.phrase-highlight--focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(199, 106, 20, 0.2);
}

.expanded-compo-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: stretch;
  padding: clamp(0.75rem, 2vw, 1.5rem);
  background: rgba(15, 23, 42, 0.58);
}

.expanded-compo-overlay.hidden {
  display: none;
}

.expanded-compo {
  display: grid;
  grid-template-rows: auto 1fr;
  max-width: 1180px;
  width: min(100%, 1180px);
  max-height: calc(100vh - clamp(1.5rem, 4vw, 3rem));
  margin: auto;
  overflow: hidden;
  border: 1px solid #d8e0ef;
  border-radius: 0.8rem;
  background: #fff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
}

.expanded-compo__menu {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid #e4e9f2;
  background: #f8fafc;
}

.expanded-compo__toggle,
.expanded-compo__close {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #26364f;
  font-weight: 700;
}

.expanded-compo__toggle {
  padding: 0.42rem 0.75rem;
  border-radius: 0.5rem;
}

.expanded-compo__close {
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border-color: #b91c1c;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
}

.expanded-compo__close:hover {
  background: #b91c1c;
}

.expanded-compo__content {
  overflow: auto;
  padding: clamp(1.1rem, 2.5vw, 2rem);
}

.expanded-compo__content h2 {
  margin: 0 0 1rem;
  color: var(--ink);
  font-size: clamp(1.55rem, 2.8vw, 2.2rem);
  line-height: 1.25;
  letter-spacing: 0;
}

.expanded-compo__section {
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.7rem;
  background: #fbfcff;
}

.expanded-compo__section h3 {
  margin: 0 0 0.45rem;
  color: var(--brand);
  font-size: 0.92rem;
  letter-spacing: 0;
}

.expanded-compo__section p {
  margin: 0;
  color: #26364f;
  line-height: 1.7;
}

.expanded-compo__phrases {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.expanded-compo__body {
  display: grid;
  gap: 1.25rem;
  padding-top: 0.35rem;
  color: #172033;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

.expanded-compo__paragraph {
  margin: 0;
  line-height: 1.2;
}

.pinyin-char,
.pinyin-punctuation {
  display: inline-grid;
  grid-template-rows: 1.08rem 1.7rem;
  min-width: 1.45em;
  min-height: 2.95rem;
  margin: 0 0.02em 0.32em;
  justify-items: center;
  vertical-align: top;
}

.pinyin-char {
  text-align: center;
}

.pinyin-char__aid {
  grid-row: 1;
  color: #58708f;
  font-size: 0.64rem;
  line-height: 1;
  white-space: nowrap;
}

.pinyin-char__han {
  grid-row: 2;
  align-self: center;
  font-size: 1.2rem;
  line-height: 1;
  text-align: center;
}

.pinyin-char--indent {
  pointer-events: none;
}

.pinyin-punctuation {
  min-width: 0.75em;
  color: #4b5563;
  font-size: 1.2rem;
  line-height: 1;
}

.pinyin-punctuation__mark {
  grid-row: 2;
  line-height: 1;
}

.pinyin-punctuation--bottom .pinyin-punctuation__mark {
  align-self: end;
}

.pinyin-punctuation--top .pinyin-punctuation__mark {
  align-self: start;
}

.pinyin-punctuation--middle .pinyin-punctuation__mark {
  align-self: center;
}

.expanded-phrase-use {
  border-radius: 0.28rem;
}

.expanded-phrase-use--0 {
  border-color: #9fb2d9;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.expanded-phrase-use--1 {
  border-color: #8cc9b7;
  background: #e5f6f0;
  color: #0f5d4b;
}

.expanded-phrase-use--2 {
  border-color: #dfa65b;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.expanded-phrase-use--3 {
  border-color: #e4a1ae;
  background: #fff1f2;
  color: #8a1d2c;
}

.expanded-phrase-use--4 {
  border-color: #b0b6d8;
  background: #edf0fb;
  color: #333d7a;
}

.expanded-phrase-use--5 {
  border-color: #86c8df;
  background: #e8f6fb;
  color: #175a71;
}

.expanded-phrase-use--6 {
  border-color: #cfb16b;
  background: #f8efd8;
  color: #684e18;
}

.expanded-phrase-use--7 {
  border-color: #a8cf84;
  background: #eef8e4;
  color: #3f631a;
}

.expanded-phrase-use--focus {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(199, 106, 20, 0.18);
}

.expanded-compo.hide-pinyin .pinyin-char__aid {
  color: transparent;
  visibility: hidden;
}

@media (max-width: 720px) {
  .chinese-compo-shell .essay-list {
    max-height: 420px;
  }

  .essay-reader__topbar {
    gap: 0.55rem;
  }

  .expanded-compo-overlay {
    padding: 0;
  }

  .expanded-compo {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
}
