/* Writing module */

.writing-main { max-width: 1200px; }

/* Tabs */
.wt-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  border-bottom: 2px solid #e5e7eb;
}
.wt-tab {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  padding: 12px 22px;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
}
.wt-tab:hover { color: #2c6cf6; }
.wt-tab.active { color: #2c6cf6; border-bottom-color: #2c6cf6; }

/* Category filter */
.wt-cats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.wt-cat {
  background: #ffffff;
  border: 1.5px solid #e5e7eb;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: #4b5563;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.wt-cat:hover { border-color: #93c5fd; color: #1e40af; }
.wt-cat.active { background: #2c6cf6; color: #fff; border-color: #2c6cf6; }
.wt-cat-count {
  display: inline-block;
  margin-left: 6px;
  background: rgba(0,0,0,0.08);
  border-radius: 999px;
  padding: 0 7px;
  font-size: 11px;
}
.wt-cat.active .wt-cat-count { background: rgba(255,255,255,0.25); }

/* List */
.wt-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.wt-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 18px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.wt-card:hover {
  border-color: #2c6cf6;
  transform: translateY(-2px);
  box-shadow: 0 10px 26px -8px rgba(15,23,42,0.12);
}
.wt-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wt-card-num {
  background: linear-gradient(135deg, #2c6cf6 0%, #6f5af6 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 5px;
  letter-spacing: 0.5px;
}
.wt-card-cat {
  background: #f3f4f6;
  color: #4b5563;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}
.wt-card-cat.cat-chart { background: #dbeafe; color: #1e40af; }
.wt-card-cat.cat-process { background: #dcfce7; color: #166534; }
.wt-card-cat.cat-map { background: #fef3c7; color: #92400e; }
.wt-card-cat.cat-letter { background: #fee2e2; color: #991b1b; }
.wt-card-cat.cat-opinion { background: #ede9fe; color: #5b21b6; }
.wt-card-cat.cat-problem { background: #fed7aa; color: #9a3412; }
.wt-card-cat.cat-discuss { background: #cffafe; color: #155e75; }
.wt-card-cat.cat-double { background: #fce7f3; color: #9d174d; }
.wt-card-cat.cat-agree { background: #e0e7ff; color: #3730a3; }
.wt-card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #111827;
}
.wt-card-prompt {
  font-size: 12.5px;
  color: #6b7280;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wt-card-done {
  position: absolute;
  top: 12px; right: 12px;
  background: #16a34a;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

/* === Editor page === */
/* Default (Task 2): stacked single column, centered */
.editor-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 24px 60px;
}
/* Task 1 variant: side-by-side, chart left + editor right */
.editor-page.editor-page-t1 {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr);
  gap: 22px;
  max-width: 1400px;
  align-items: start;
}
.editor-page-t1 .editor-left {
  position: sticky;
  top: 18px;
  align-self: start;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
}
.editor-left {
  background: #f9fafb;
  border-radius: 14px;
  padding: 22px 28px;
  border: 1px solid #e5e7eb;
  width: 100%;
}
.editor-prompt-tag {
  display: inline-block;
  background: linear-gradient(135deg, #2c6cf6 0%, #6f5af6 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.editor-prompt-title {
  font-size: 20px;
  font-weight: 700;
  margin: 4px 0 12px;
  color: #111827;
}
.editor-prompt-text {
  font-size: 14.5px;
  line-height: 1.65;
  color: #1f2937;
  white-space: pre-line;
  margin-bottom: 14px;
}
.editor-meta {
  display: flex;
  gap: 14px;
  font-size: 12.5px;
  color: #6b7280;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.editor-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 14px;
}
.editor-stats {
  display: flex;
  gap: 16px;
  font-size: 12.5px;
  color: #4b5563;
}
.editor-stats span strong {
  color: #1e40af;
  font-size: 14px;
  font-weight: 800;
  margin-right: 3px;
}
.editor-actions {
  display: flex;
  gap: 8px;
}
.editor-btn {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .12s;
}
.editor-btn:hover { border-color: #2c6cf6; color: #1e40af; }
.editor-btn-primary {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #fff;
  border: none;
  padding: 8px 20px;
  font-size: 14px;
}
.editor-btn-primary:hover { color: #fff; opacity: 0.92; }
.editor-textarea {
  width: 100%;
  min-height: 520px;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 18px 22px;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.75;
  color: #111827;
  resize: vertical;
  outline: none;
  transition: border-color .15s;
}
.editor-textarea:focus { border-color: #2c6cf6; box-shadow: 0 0 0 3px rgba(44, 108, 246, 0.1); }
.editor-textarea.flagged {
  background-image:
    linear-gradient(180deg, transparent 95%, rgba(239,68,68,0.04) 95%);
}

/* === Result panel === */
.result-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 22px 26px;
  margin-top: 14px;
}
.rp-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #2c6cf6 0%, #6f5af6 100%);
  color: #fff;
  padding: 18px 24px;
  border-radius: 10px;
  margin-bottom: 18px;
}
.rp-band-overall { font-size: 14px; opacity: 0.92; }
.rp-band-num { font-size: 42px; font-weight: 900; line-height: 1; }
.rp-band-cefr { font-size: 13px; opacity: 0.92; }
.rp-criteria {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.rp-crit {
  background: #f9fafb;
  border-radius: 8px;
  padding: 12px 14px;
}
.rp-crit-name { font-size: 12px; color: #6b7280; font-weight: 600; }
.rp-crit-score {
  font-size: 22px;
  font-weight: 800;
  color: #1e40af;
  margin: 4px 0;
}
.rp-crit-bar {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}
.rp-crit-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #2c6cf6 0%, #6f5af6 100%);
  border-radius: 3px;
  transition: width .4s;
}

.rp-section {
  margin-bottom: 22px;
}
.rp-section h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 10px;
  color: #111827;
  padding-bottom: 6px;
  border-bottom: 1px solid #e5e7eb;
}
.rp-feedback-list { list-style: none; padding: 0; margin: 0; }
.rp-feedback-item {
  background: #f9fafb;
  border-left: 4px solid #d1d5db;
  border-radius: 0 6px 6px 0;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 13.5px;
  line-height: 1.55;
}
.rp-feedback-item.error { border-left-color: #ef4444; background: #fef2f2; }
.rp-feedback-item.warn  { border-left-color: #f59e0b; background: #fffbeb; }
.rp-feedback-item.good  { border-left-color: #16a34a; background: #f0fdf4; }
.rp-fb-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-right: 6px;
}
.rp-feedback-item.error .rp-fb-label { color: #991b1b; }
.rp-feedback-item.warn  .rp-fb-label { color: #92400e; }
.rp-feedback-item.good  .rp-fb-label { color: #166534; }

.rp-error-mark {
  background: #fee2e2;
  border-bottom: 2px wavy #ef4444;
  padding: 0 2px;
  border-radius: 2px;
  cursor: help;
}
.rp-error-mark.warn { background: #fef3c7; border-bottom-color: #f59e0b; }

.rp-annotated {
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px 20px;
  font-family: "Georgia", serif;
  font-size: 14.5px;
  line-height: 1.85;
  white-space: pre-wrap;
}

.rp-suggestion {
  background: #eff6ff;
  border: 1px dashed #93c5fd;
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 6px;
  font-size: 13px;
  color: #1e40af;
}
.rp-suggestion strong { color: #1e3a8a; }

@media (max-width: 720px) {
  .editor-page { padding: 12px; }
  .editor-left { padding: 16px 18px; }
}
/* Narrow screens: collapse Task 1 to stacked too */
@media (max-width: 1100px) {
  .editor-page.editor-page-t1 {
    grid-template-columns: 1fr;
    max-width: 880px;
  }
  .editor-page-t1 .editor-left {
    position: static;
    max-height: none;
  }
}

/* === Sample template modal === */
.sample-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity .18s;
  padding: 20px;
}
.sample-modal-overlay.open { opacity: 1; }
.sample-modal {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 880px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px -10px rgba(15, 23, 42, 0.4);
  overflow: hidden;
  transform: translateY(8px) scale(0.98);
  transition: transform .18s;
  position: relative;
}
.sample-modal-overlay.open .sample-modal {
  transform: translateY(0) scale(1);
}
.sample-close {
  position: absolute;
  top: 14px; right: 16px;
  background: rgba(255,255,255,0.18);
  border: none;
  font-size: 24px;
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background .15s, transform .12s;
  line-height: 1;
}
.sample-close:hover { background: rgba(255,255,255,0.35); transform: rotate(90deg); }

.sample-head {
  background: linear-gradient(135deg, #2c6cf6 0%, #6f5af6 60%, #a855f7 100%);
  color: #fff;
  padding: 22px 28px 20px;
  position: relative;
}
.sample-tag {
  display: inline-block;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  backdrop-filter: blur(4px);
}
.sample-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 6px;
}
.sample-sub {
  font-size: 12.5px;
  opacity: 0.92;
}
.sample-sub strong { font-weight: 700; }

.sample-body {
  padding: 24px 30px;
  overflow-y: auto;
  flex: 1;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.85;
  color: #1f2937;
  background: #fafafa;
}
.sample-body p {
  margin: 0 0 14px;
}
.sample-body p:last-child { margin-bottom: 0; }
.sample-body mark {
  background: linear-gradient(180deg, transparent 55%, #fef3c7 55%);
  color: #92400e;
  font-weight: 700;
  padding: 0 3px;
  border-radius: 3px;
  font-family: inherit;
}

.sample-foot {
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  padding: 14px 24px 18px;
}
.sample-tips {
  font-size: 12.5px;
  color: #4b5563;
  background: #eff6ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  line-height: 1.55;
}
.sample-tips strong { color: #1e40af; }
.sample-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .sample-title { font-size: 16px; }
  .sample-body { padding: 18px 18px; font-size: 14px; }
  .sample-actions { justify-content: stretch; }
  .sample-actions button { flex: 1; }
}

/* Chart container in editor */
.chart-container svg { display: block; margin: 0 auto; }

/* Sample template Markdown rendering */
.sample-body .tpl-heading {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: #1e3a8a;
  background: linear-gradient(90deg, #eff6ff 0%, transparent 80%);
  border-left: 4px solid #2c6cf6;
  padding: 8px 14px;
  margin: 18px 0 10px;
  border-radius: 0 6px 6px 0;
  line-height: 1.4;
}
.sample-body .tpl-heading:first-child { margin-top: 0; }
.sample-body .tpl-bold {
  color: #b91c1c;
  font-weight: 800;
  background: #fee2e2;
  padding: 0 4px;
  border-radius: 3px;
  font-family: inherit;
}

/* === Writing glass workbench === */
html:has(.writing-main),
html:has(.editor-page),
body:has(.writing-main),
body:has(.editor-page) {
  background: #04060a !important;
}

body:has(.writing-main)::before,
body:has(.editor-page)::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 34%),
    #04060a;
  z-index: -1;
}

.writing-main {
  max-width: 1240px;
  color: #ffffff;
  padding-top: 28px;
  padding-bottom: 72px;
  background: #04060a;
  min-height: calc(100vh - 64px);
}

.writing-main .page-head,
.writing-main .stat-pill,
.wt-card,
.editor-left,
.editor-toolbar,
.result-panel,
.rp-crit,
.sample-modal {
  background: rgba(60, 66, 76, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(22px) saturate(120%);
  -webkit-backdrop-filter: blur(22px) saturate(120%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 22px 60px rgba(0, 0, 0, 0.32);
}

.writing-main .page-head {
  border-radius: 18px;
  padding: 24px;
}

.writing-main .page-title,
.editor-prompt-title,
.wt-card-title,
.rp-section h3 {
  color: #ffffff;
}

.writing-main .page-title {
  letter-spacing: 0;
  text-shadow: 0 1px 18px rgba(255, 255, 255, 0.08);
}

.writing-main .page-sub,
.wt-card-prompt,
.editor-prompt-text,
.editor-meta,
.rp-crit-name,
.rp-band-overall,
.rp-band-cefr {
  color: rgba(255, 255, 255, 0.76);
}

.writing-main .stat-pill {
  border-radius: 14px;
  min-width: 104px;
}

.writing-main .sp-num {
  color: #ffffff;
}

.writing-main .sp-label {
  color: rgba(255, 255, 255, 0.66);
}

.wt-tabs {
  gap: 10px;
  border-bottom: 0;
  margin: 22px 0 16px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(60, 66, 76, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px) saturate(115%);
  -webkit-backdrop-filter: blur(18px) saturate(115%);
}

.wt-tab {
  flex: 1;
  min-height: 46px;
  margin-bottom: 0;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
}

.wt-tab:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.14);
}

.wt-tab.active {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.wt-cats {
  margin-bottom: 22px;
}

.wt-cat {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.wt-cat:hover,
.wt-cat.active {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.22);
}

.wt-cat-count,
.wt-cat.active .wt-cat-count {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.wt-list {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.wt-card {
  border-radius: 16px;
  color: #ffffff;
  min-height: 178px;
}

.wt-card:hover {
  border-color: rgba(255, 255, 255, 0.34);
  transform: translateY(-3px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 28px 70px rgba(0, 0, 0, 0.38);
}

.wt-card-num {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.wt-card-cat,
.wt-card-cat.cat-chart,
.wt-card-cat.cat-process,
.wt-card-cat.cat-map,
.wt-card-cat.cat-letter,
.wt-card-cat.cat-opinion,
.wt-card-cat.cat-problem,
.wt-card-cat.cat-discuss,
.wt-card-cat.cat-double,
.wt-card-cat.cat-agree {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.78);
}

.wt-card-done {
  background: rgba(49, 190, 130, 0.86);
  color: #03120c;
}

.editor-page {
  color: #ffffff;
  max-width: 980px;
  padding-top: 24px;
}

.editor-page.editor-page-t1 {
  max-width: 1440px;
}

.editor-left {
  background: rgba(54, 60, 70, 0.82);
  border-radius: 18px;
  color: #ffffff;
}

.editor-prompt-tag {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #ffffff;
}

.editor-prompt-text {
  color: rgba(255, 255, 255, 0.84);
}

.editor-meta {
  border-top-color: rgba(255, 255, 255, 0.16);
}

.editor-toolbar {
  background: rgba(54, 60, 70, 0.82);
  border-radius: 16px;
}

.editor-stats,
.editor-stats span strong {
  color: #ffffff;
}

.editor-stats span {
  color: rgba(255, 255, 255, 0.76);
}

.editor-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.86);
  border-radius: 10px;
}

.editor-btn:hover,
.editor-btn:focus-visible {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  outline: none;
}

.editor-btn-primary {
  background: rgba(245, 248, 255, 0.92);
  color: #111827;
  border: 1px solid rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 16px 34px rgba(0, 0, 0, 0.28);
}

.editor-btn-primary:hover,
.editor-btn-primary:focus-visible {
  background: #ffffff;
  color: #05070b;
}

.editor-textarea {
  background: rgba(255, 255, 255, 0.94);
  color: #10131a;
  border-color: rgba(255, 255, 255, 0.42);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 24px 70px rgba(0, 0, 0, 0.34);
}

.editor-textarea:focus {
  border-color: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 0 0 3px rgba(255, 255, 255, 0.16), 0 24px 70px rgba(0, 0, 0, 0.34);
}

.editor-loading {
  color: rgba(255, 255, 255, 0.72);
}

.chart-container {
  margin-top: 16px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.34);
}

.chart-container svg {
  display: block;
  max-width: 100%;
  height: auto;
}

.chart-container text {
  fill: #111827;
}

.result-panel {
  background: rgba(54, 60, 70, 0.86);
  color: #ffffff;
  border-radius: 18px;
}

.rp-band {
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.rp-crit {
  background: rgba(255, 255, 255, 0.1);
}

.rp-crit-score {
  color: #ffffff;
}

.rp-crit-bar {
  background: rgba(255, 255, 255, 0.14);
}

.rp-crit-bar-fill {
  background: rgba(255, 255, 255, 0.84);
}

.rp-section h3 {
  border-bottom-color: rgba(255, 255, 255, 0.16);
}

.rp-feedback-item {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.88);
  border-left-color: rgba(255, 255, 255, 0.34);
}

.rp-feedback-item.error {
  background: rgba(239, 68, 68, 0.16);
}

.rp-feedback-item.warn {
  background: rgba(245, 158, 11, 0.16);
}

.rp-feedback-item.good {
  background: rgba(22, 163, 74, 0.18);
}

.rp-feedback-item.error .rp-fb-label,
.rp-feedback-item.warn .rp-fb-label,
.rp-feedback-item.good .rp-fb-label {
  color: #ffffff;
}

.rp-annotated {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.34);
  color: #111827;
}

.rp-suggestion,
.sample-tips {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.84);
}

.rp-suggestion strong,
.sample-tips strong {
  color: #ffffff;
}

.sample-modal-overlay {
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.sample-modal {
  background: rgba(54, 60, 70, 0.9);
  color: #ffffff;
}

.sample-head {
  background: rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.sample-tag {
  background: rgba(255, 255, 255, 0.16);
}

.sample-body {
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
}

.sample-foot {
  background: rgba(255, 255, 255, 0.08);
  border-top-color: rgba(255, 255, 255, 0.14);
}

.sample-body .tpl-heading {
  color: #111827;
  background: rgba(44, 108, 246, 0.08);
}

@media (max-width: 760px) {
  body:has(.writing-main) .app-header,
  body:has(.editor-page) .app-header {
    gap: 12px;
    max-width: 100vw;
    overflow: hidden;
    padding: 0 12px;
  }

  body:has(.writing-main) .top-nav,
  body:has(.editor-page) .top-nav {
    display: none;
  }

  body:has(.writing-main) .brand-name,
  body:has(.editor-page) .brand-name {
    font-size: 14px;
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .writing-main {
    padding: 16px 12px 56px;
  }

  .writing-main .page-head,
  .editor-left,
  .editor-toolbar,
  .result-panel {
    border-radius: 14px;
  }

  .wt-tabs,
  .editor-toolbar,
  .editor-stats,
  .editor-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .wt-tab,
  .editor-btn {
    width: 100%;
  }
}
