.copy-page {
  --copy-text: #111827;
  --copy-text-2: #4b5563;
  --copy-muted: #6b7280;
  --copy-border: rgba(17, 24, 39, 0.08);
  --copy-border-strong: rgba(17, 24, 39, 0.16);
  --copy-field: #f3f4f6;
  --copy-canvas: #f5f7fb;
  --copy-card: #fff;
  --copy-cream: #fff7ed;
  min-height: 100vh;
  color: var(--copy-text);
  background: var(--copy-canvas);
  font-family: "Noto Sans SC", var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  overflow-y: scroll;
}

.copy-page .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.copy-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  height: 57px;
  overflow: visible;
  border-bottom: 1px solid var(--copy-border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
}

.copy-header__inner {
  display: flex;
  width: 100%;
  height: 56px;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
}

.copy-brand {
  display: flex;
  width: 122px;
  flex: 0 0 122px;
  align-items: center;
  gap: 10px;
  color: var(--copy-text);
  text-decoration: none;
}

.copy-brand img {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.16);
}

.copy-brand__text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1;
}

.copy-brand__text strong {
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  white-space: nowrap;
}

.copy-brand__text small {
  color: var(--copy-muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 12.5px;
  white-space: nowrap;
}

.copy-nav {
  display: flex;
  min-width: 0;
  height: 36px;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.copy-nav__item {
  display: inline-flex;
  width: 112px;
  height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--copy-text-2);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-decoration: none;
  transition: color 150ms ease, background-color 150ms ease,
    box-shadow 150ms ease, filter 150ms ease, transform 150ms ease;
  white-space: nowrap;
}

.copy-nav__item svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.copy-nav__item svg .video-nav-play {
  fill: currentColor;
  stroke: none;
}

.copy-nav__item:hover {
  color: var(--copy-text);
  background: rgba(245, 158, 11, 0.12);
}

.copy-nav__item--active,
.copy-nav__item--active:hover {
  color: #fff;
  background: linear-gradient(135deg, #ffb623 0%, #ea580c 55%, #fbbf24 100%);
  box-shadow: 0 0 60px rgba(245, 158, 11, 0.25);
}

.copy-nav__item:active {
  transform: translateY(1px);
}

.copy-account {
  display: flex;
  width: 227px;
  height: 36px;
  flex: 0 0 227px;
  align-items: center;
  padding: 0 6px 0 4px;
  border: 1px solid var(--copy-border-strong);
  border-radius: 9999px;
  background: var(--copy-cream);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
}

.copy-account button,
.copy-account a {
  border: 0;
  background: transparent;
}

.copy-account__avatar {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}

.copy-account__avatar-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #ffb623 0%, #ea580c 55%, #fbbf24 100%) !important;
}

.copy-account__avatar:hover {
  background: #ffedd5;
}

.copy-account__avatar:active {
  transform: scale(0.96);
}

.copy-account__avatar-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.copy-account__credits {
  display: inline-flex;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 8px;
  border-radius: 6px;
  color: #f59e0b;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  text-decoration: none;
  transition: background-color 150ms ease;
  white-space: nowrap;
}

.copy-account__credits span + span {
  margin-left: 2px;
}

.copy-account__credits:hover {
  background: rgba(245, 158, 11, 0.12);
}

.copy-account__dot {
  flex: 0 0 auto;
  margin: 0 2px;
  color: #9ca3af;
  font-size: 12px;
}

.copy-account__phone {
  display: inline-flex;
  min-width: 0;
  height: 34px;
  flex: 1;
  align-items: center;
  gap: 4px;
  padding: 0 2px;
  border-radius: 9999px;
  color: var(--copy-text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-align: left;
  transition: background-color 150ms ease;
}

.copy-account__phone:hover {
  background: #ffedd5;
}

.copy-account__phone span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-account__chevron {
  width: 10px;
  height: 16px;
  flex: 0 0 10px;
  fill: none;
  stroke: #9ca3af;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.copy-main {
  width: 100%;
  min-height: calc(100vh - 57px);
  padding: 40px 24px;
}

.copy-main__content {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 20px;
}

.copy-heading h1 {
  margin: 0;
  color: var(--copy-text);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 32px;
}

.copy-heading p {
  margin: 4px 0 0;
  color: var(--copy-text-2);
  font-size: 14px;
  font-weight: 400;
  line-height: 23.1px;
}

.copy-mode {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid #f3dcc0;
  border-radius: 8px;
  background: var(--copy-cream);
}

.copy-mode button {
  min-width: 132px;
  padding: 8px 24px;
  border: 0;
  border-radius: 6px;
  color: var(--copy-text-2);
  background: transparent;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  line-height: 23.1px;
  transition: color 150ms ease, background-color 150ms ease,
    box-shadow 150ms ease, filter 150ms ease, transform 150ms ease;
  white-space: nowrap;
}

.copy-mode button:hover:not(.copy-mode__active) {
  color: var(--copy-text);
  background: transparent;
}

.copy-mode .copy-mode__active {
  color: #fff;
  background: linear-gradient(135deg, #ffb623 0%, #ea580c 55%, #fbbf24 100%);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
}

.copy-mode button:active {
  transform: translateY(1px);
}

.copy-grid {
  display: grid;
  height: 521.859375px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.copy-card {
  min-width: 0;
  height: 521.859375px;
  padding: 20px;
  border: 1px solid var(--copy-border);
  border-radius: 12px;
  background: var(--copy-card);
  box-shadow: 0 6px 24px rgba(17, 24, 39, 0.08);
}

.copy-card h3 {
  margin: 0;
  color: var(--copy-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
}

.copy-library p,
.copy-result__hint {
  border: 1px dashed #e7d4bd;
  border-radius: 12px;
  color: var(--copy-muted);
  background: #fff8ef;
  font-size: 14px;
  line-height: 23.1px;
}

.copy-library p {
  height: 59px;
  margin: 16px 0 0;
  padding: 17px 20px;
}

.copy-editor,
.copy-result {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.copy-form {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  margin-top: 20px;
}

.copy-form[hidden] {
  display: none;
}

.copy-label {
  display: block;
  margin: 0 0 6px;
  color: var(--copy-muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 23.1px;
}

.copy-label span {
  color: #ef4444;
}

.copy-field {
  display: block;
  width: 100%;
  min-height: 45.09375px;
  padding: 10px 14px;
  border: 1px solid var(--copy-border-strong);
  border-radius: 8px;
  outline: 0;
  color: var(--copy-text);
  background: var(--copy-field);
  font-size: 14px;
  font-weight: 400;
  line-height: 23.1px;
  transition: border-color 150ms ease, background-color 150ms ease,
    box-shadow 150ms ease;
}

.copy-field::placeholder {
  color: #6b7280;
  opacity: 1;
}

.copy-field:focus {
  border-color: #f59e0b;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.13);
}

.copy-field--source {
  height: 144px;
  min-height: 144px;
  resize: vertical;
  line-height: 24.5px;
}

.copy-style-fieldset {
  min-width: 0;
  margin: 22px 0 0;
  padding: 0;
  border: 0;
}

.copy-style-fieldset .copy-label {
  width: 100%;
}

.copy-style-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.copy-style-options button {
  min-width: 0;
  padding: 6px 12px;
  border: 1px solid var(--copy-border-strong);
  border-radius: 12px;
  color: var(--copy-text-2);
  background: var(--copy-card);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  transition: color 150ms ease, border-color 150ms ease,
    background-color 150ms ease, box-shadow 150ms ease,
    filter 150ms ease, transform 150ms ease;
}

.copy-style-options button:hover:not(.copy-style__active) {
  color: var(--copy-text-2);
  border-color: var(--copy-border-strong);
  background: var(--copy-card);
}

.copy-style-options .copy-style__active {
  color: #fff;
  border-color: #f59e0b;
  background: linear-gradient(135deg, #ffb623 0%, #ea580c 55%, #fbbf24 100%);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
}

.copy-style-options button:active {
  transform: translateY(1px);
}

.copy-field--extra {
  flex: 0 0 45.09375px;
}

.copy-style-fieldset + .copy-label {
  margin-top: 16px;
}

.copy-submit-area {
  display: flex;
  flex-direction: column;
  margin-top: auto;
}

.copy-submit-area p {
  margin: 0 0 8px;
  color: var(--copy-muted);
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}

.copy-submit-area strong {
  margin-left: 3px;
  color: #f59e0b;
  font-weight: 600;
}

.copy-submit {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #ffb623 0%, #ea580c 55%, #fbbf24 100%);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.28);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 23.1px;
  transition: filter 150ms ease, opacity 150ms ease,
    box-shadow 150ms ease, transform 150ms ease;
}

.copy-submit:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.copy-submit:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.copy-form--create .copy-label:not(:first-child) {
  margin-top: 12px;
}

.copy-form--create .copy-style-fieldset {
  margin-top: 12px;
}

.copy-form--create .copy-style-fieldset + .copy-label {
  margin-top: 12px;
}

.copy-result__field {
  height: 369.359375px;
  min-height: 192px;
  flex: 0 0 369.359375px;
  margin-top: 20px;
  resize: vertical;
  font-family: "Courier New", Courier, "PingFang SC", "Microsoft YaHei", monospace;
  line-height: 24.5px;
}

.copy-result__hint {
  min-height: 58px;
  margin: 12px 0 0;
  padding: 16px 20px;
}

.copy-result__hint[hidden],
.copy-result__actions[hidden] {
  display: none;
}

.copy-result--filled .copy-result__field {
  height: 397.359375px;
  flex-basis: 397.359375px;
}

.copy-result__actions {
  display: flex;
  width: 100%;
  height: 32px;
  flex: 0 0 32px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.copy-result__stats {
  min-width: 0;
  margin: 0;
  color: var(--copy-muted);
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}

.copy-result__buttons {
  display: flex;
  height: 32px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.copy-result__buttons button,
.copy-result__import {
  display: inline-flex;
  height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid #ded5c9;
  border-radius: 8px;
  color: var(--copy-text-2);
  background: #fff8ef;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  text-decoration: none;
  transition: color 150ms ease, border-color 150ms ease,
    background-color 150ms ease, box-shadow 150ms ease,
    filter 150ms ease, transform 150ms ease;
  white-space: nowrap;
}

.copy-result__buttons button:hover {
  color: var(--copy-text);
  border-color: #f59e0b;
  background: #fffdf9;
}

.copy-result__import {
  min-width: 156px;
  gap: 4px;
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #ffb623 0%, #ea580c 55%, #fbbf24 100%);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.24);
  font-weight: 600;
}

.copy-result__import:hover {
  color: #fff;
  filter: brightness(1.06);
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.3);
}

.copy-result__buttons button:active,
.copy-result__import:active {
  transform: translateY(1px);
}

@media (max-width: 520px) {
  .copy-result__actions {
    height: auto;
    flex-basis: auto;
    flex-direction: column;
    align-items: stretch;
  }

  .copy-result__buttons {
    width: 100%;
    height: auto;
    flex-wrap: wrap;
  }

  .copy-result__buttons button {
    flex: 1;
  }

  .copy-result__import {
    width: 100%;
  }

  .copy-result--filled .copy-result__field {
    height: 330px;
    flex-basis: 330px;
  }
}

.copy-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 60;
  max-width: calc(100% - 32px);
  padding: 9px 14px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 8px;
  color: var(--copy-text);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 30px rgba(17, 24, 39, 0.14);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.copy-toast--visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1199px) {
  .copy-header__inner {
    gap: 12px;
    padding: 0 16px;
  }

  .copy-nav__item {
    width: auto;
    padding: 0 9px;
  }

  .copy-account {
    width: 227px;
    flex-basis: 227px;
  }

  .copy-grid {
    height: auto;
    grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  }

  .copy-card {
    height: 520px;
  }

  .copy-result {
    grid-column: 1 / -1;
    height: 440px;
  }
}

@media (max-width: 900px) {
  .copy-brand {
    width: 32px;
    flex-basis: 32px;
  }

  .copy-brand__text,
  .copy-account__credits,
  .copy-account__dot,
  .copy-account__phone,
  .copy-account__chevron {
    display: none;
  }

  .copy-account {
    width: 36px;
    flex: 0 0 36px;
    justify-content: center;
    padding: 0;
  }

  .copy-nav__item {
    gap: 3px;
    padding: 0 7px;
    font-size: 12px;
  }

  .copy-nav__item svg {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
  }

  .copy-main {
    padding: 28px 16px 40px;
  }

  .copy-grid {
    grid-template-columns: 1fr;
  }

  .copy-card,
  .copy-result {
    grid-column: auto;
    height: 520px;
  }

  .copy-library {
    height: 180px;
  }
}

@media (max-width: 640px) {
  .copy-header__inner {
    gap: 6px;
    padding: 0 8px;
  }

  .copy-nav {
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .copy-nav::-webkit-scrollbar {
    display: none;
  }

  .copy-nav__item {
    flex: 0 0 auto;
    padding: 0 7px;
    font-size: 11px;
  }

  .copy-main {
    padding: 24px 12px 36px;
  }

  .copy-heading h1 {
    font-size: 22px;
  }

  .copy-mode {
    width: 100%;
  }

  .copy-mode button {
    min-width: 0;
    flex: 1;
    padding: 0 10px;
  }

  .copy-card {
    padding: 16px;
  }

  .copy-editor {
    height: auto;
    min-height: 560px;
  }

  .copy-form {
    min-height: 500px;
  }

  .copy-style-options {
    gap: 7px;
  }

  .copy-style-options button {
    min-width: calc(33.333% - 5px);
    padding: 0 8px;
    font-size: 12px;
  }

}
