* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-tertiary: #1f1f1f;
  --bg-hover: #2a2a2a;
  --border-color: #262626;
  --border-hover: #404040;
  --text-primary: #fafafa;
  --text-secondary: #e5e5e5;
  --text-tertiary: #a3a3a3;
  --text-muted: #737373;
  --text-placeholder: #525252;
  --accent-primary: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: rgba(59, 130, 246, 0.1);
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.1);
  --error: #ef4444;
  --error-light: rgba(239, 68, 68, 0.1);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter",
    sans-serif;
  background: var(--bg-primary);
  color: var(--text-secondary);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}
.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 100;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.logo-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
.header-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.btn {
  padding: 0 14px;
  height: 32px;
  border-radius: 7px;
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
}
.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}
.btn-ghost {
  background: transparent;
  color: var(--text-tertiary);
}
.btn-ghost:hover {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}
.btn-icon {
  width: 32px;
  padding: 0;
  justify-content: center;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.toolbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 20px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
}
.toolbar-section {
  display: flex;
  gap: 2px;
  padding-right: 10px;
  border-right: 1px solid var(--border-color);
}
.toolbar-section:last-child {
  border-right: none;
}
.tool-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.tool-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.tool-btn:active {
  transform: scale(0.95);
  background: var(--bg-hover);
}
.tool-btn[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -34px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-primary);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 11px;
  white-space: nowrap;
  border: 1px solid var(--border-color);
  z-index: 1000;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.main-area {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}
.panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  background: var(--bg-primary);
}
.panel-header {
  padding: 10px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.panel-stats {
  display: flex;
  gap: 16px;
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.stat {
  color: var(--text-placeholder);
}
.stat-value {
  color: var(--text-tertiary);
  font-weight: 600;
  margin-right: 2px;
}
.panel-content {
  flex: 1;
  overflow: auto;
  padding: 32px;
  background: var(--bg-primary);
}
.panel-content::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.panel-content::-webkit-scrollbar-track {
  background: transparent;
}
.panel-content::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
  border: 2px solid var(--bg-primary);
}
.panel-content::-webkit-scrollbar-thumb:hover {
  background: var(--bg-hover);
}
.divider {
  width: 1px;
  background: var(--border-color);
  flex-shrink: 0;
  cursor: col-resize;
  position: relative;
  transition: background 0.2s;
}
.divider:hover {
  background: var(--accent-primary);
}
.divider::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -2px;
  right: -2px;
}
#editor {
  min-height: 100%;
  outline: none;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  caret-color: var(--accent-primary);
  max-width: 800px;
}
#editor:empty:before {
  content: "Start typing or paste your content here...\A\ATip: Paste from Word, Google Docs, or any website!";
  color: var(--text-placeholder);
  white-space: pre;
}
#editor h1,
#editor h2,
#editor h3,
#editor h4,
#editor h5,
#editor h6 {
  margin: 32px 0 16px 0;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: -0.02em;
}
#editor h1:first-child,
#editor h2:first-child,
#editor h3:first-child {
  margin-top: 0;
}
#editor h1 {
  font-size: 36px;
}
#editor h2 {
  font-size: 28px;
}
#editor h3 {
  font-size: 22px;
}
#editor h4 {
  font-size: 18px;
}
#editor h5 {
  font-size: 16px;
}
#editor h6 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
#editor p {
  margin: 16px 0;
}
#editor strong,
#editor b {
  font-weight: 600;
  color: var(--text-primary);
}
#editor em,
#editor i {
  font-style: italic;
}
#editor u {
  text-decoration: underline;
  text-decoration-color: var(--text-muted);
}
#editor s,
#editor del,
#editor strike {
  text-decoration: line-through;
  opacity: 0.6;
}
#editor code {
  background: var(--bg-tertiary);
  padding: 3px 6px;
  border-radius: 4px;
  font-family: "SF Mono", "Consolas", "Monaco", "Courier New", monospace;
  font-size: 13px;
  color: #f472b6;
  border: 1px solid var(--border-color);
}
#editor pre {
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: 8px;
  margin: 24px 0;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
#editor pre code {
  background: transparent;
  padding: 0;
  color: var(--text-tertiary);
  border: none;
  font-size: 14px;
  line-height: 1.6;
}
#editor ul,
#editor ol {
  margin: 16px 0;
  padding-left: 28px;
}
#editor li {
  margin: 8px 0;
}
#editor a {
  color: var(--accent-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
#editor a:hover {
  border-bottom-color: var(--accent-primary);
}
#editor img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 24px 0;
  border: 1px solid var(--border-color);
}
#editor blockquote {
  border-left: 3px solid var(--accent-primary);
  padding-left: 20px;
  margin: 24px 0;
  color: var(--text-tertiary);
  font-style: italic;
}
#editor hr {
  border: none;
  border-top: 2px solid var(--border-color);
  margin: 40px 0;
}
#editor table {
  border-collapse: collapse;
  width: 100%;
  margin: 24px 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}
#editor table th,
#editor table td {
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  text-align: left;
}
#editor table th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
}
#editor table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}
#editor mark {
  background: #854d0e;
  color: #fef3c7;
  padding: 2px 4px;
  border-radius: 3px;
}
#output {
  min-height: 100%;
  font-family: "SF Mono", "Consolas", "Monaco", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-tertiary);
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
  max-width: 800px;
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 48px;
}
.empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.3;
}
.empty-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-muted);
}
.empty-text {
  font-size: 13px;
  color: var(--text-placeholder);
  max-width: 280px;
  line-height: 1.5;
}
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 12px 18px;
  border-radius: 8px;
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
  backdrop-filter: blur(10px);
}
@keyframes slideUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.toast.show {
  display: flex;
}
.toast.success {
  border-color: var(--success);
  background: var(--success-light);
}
.toast.error {
  border-color: var(--error);
  background: var(--error-light);
}
.toast-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
  font-weight: 600;
}
.toast.success .toast-icon {
  background: var(--success);
  color: white;
}
.toast.error .toast-icon {
  background: var(--error);
  color: white;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.show {
  display: flex;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  max-width: 480px;
  width: 90%;
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
@keyframes modalSlideUp {
  from {
    transform: translateY(20px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}
.modal-header {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.modal-body {
  margin-bottom: 20px;
}
.modal-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.modal-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 14px;
  outline: none;
  transition: all 0.2s;
  font-family: inherit;
}
.modal-input:focus {
  border-color: var(--accent-primary);
  background: var(--bg-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.modal-input::placeholder {
  color: var(--text-placeholder);
}
.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
@media (max-width: 768px) {
  .main-area {
    flex-direction: column;
  }
  .divider {
    display: none;
  }
  .panel {
    max-height: 50vh;
  }
  .toolbar {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
  .header-actions .btn:not(.btn-primary) {
    display: none;
  }
  .panel-content {
    padding: 20px;
  }
  #editor,
  #output {
    max-width: 100%;
  }
}
