:root {
  color: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --accent: #059669;
  --accent-soft: #ecfdf5;
  --line: #e5e7eb;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: #f3f4f6;
}

button,
select,
textarea {
  font: inherit;
}

button:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-header {
  display: flex;
  height: 54px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.workspace {
  display: flex;
  width: 100%;
  height: calc(100% - 54px);
  overflow: hidden;
}

.pane {
  display: flex;
  min-width: 0;
  flex: 1 1 50%;
  flex-direction: column;
  overflow: hidden;
}

.editor-pane {
  border-right: 1px solid var(--line);
  background: #f9fafb;
}

.preview-pane {
  background: #f3f4f6;
}

.pane-toolbar {
  display: flex;
  min-height: 48px;
  flex: 0 0 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 4%);
}

.pane-title {
  color: #374151;
  font-size: 14px;
  font-weight: 600;
}

.brand-title {
  display: flex;
  align-items: center;
  margin: 0;
}

.brand-logo {
  display: block;
  width: 32px;
  height: 32px;
  margin-right: 10px;
}

.brand-name {
  color: #172033;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.brand-description {
  margin-left: 10px;
  color: #8a93a3;
  font-size: 13px;
  font-weight: 400;
}

.character-count {
  color: #9ca3af;
  font-size: 12px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-select,
.copy-button {
  height: 30px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.theme-select {
  padding: 0 26px 0 10px;
  border: 0;
  background: #ffffff;
  color: #4b5563;
}

.copy-button {
  padding: 0 12px;
  border: 0;
  background: var(--accent-soft);
  color: var(--accent);
  transition: background-color 150ms ease, color 150ms ease;
}

.copy-button:hover {
  filter: brightness(0.97);
}

.copy-button.is-success {
  background: var(--accent);
  color: #ffffff;
}

.copy-button.is-error {
  background: #fef2f2;
  color: #dc2626;
}

.markdown-input {
  width: 100%;
  min-height: 0;
  flex: 1;
  resize: none;
  padding: 18px;
  border: 0;
  outline: 0;
  background: #f9fafb;
  color: #1f2937;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.75;
  tab-size: 2;
}

.markdown-input::placeholder {
  color: #9ca3af;
}

.preview-scroll {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 16px;
  overscroll-behavior: contain;
}

.preview-content {
  width: min(100%, 677px);
  margin: 0 auto;
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .workspace {
    display: block;
    height: auto;
    overflow: visible;
  }

  .pane {
    height: 100vh;
  }

  .editor-pane {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 420px) {
  .site-header {
    padding: 0 10px;
  }

  .brand-description {
    display: none;
  }

  .pane-toolbar {
    padding: 8px 10px;
  }

  .preview-scroll {
    padding: 10px;
  }

  .theme-select {
    max-width: 108px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
