:root {
  --bg-main: #0b0f19;
  --bg-surface: #111827;
  --bg-surface-elevated: #1a2234;
  --bg-surface-alt: #1e293b;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #f59e0b;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --primary: #d97706;
  --primary-hover: #b45309;
  --primary-glow: rgba(217, 119, 6, 0.35);
  --accent: #fbbf24;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Cinzel', serif, Georgia;
  --font-mono: 'JetBrains Mono', Consolas, Monaco, monospace;
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-surface-alt: #e2e8f0;
  --border-color: rgba(15, 23, 42, 0.12);
  --border-focus: #d97706;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --primary: #d97706;
  --primary-hover: #b45309;
  --primary-glow: rgba(217, 119, 6, 0.2);
  --accent: #b45309;
  --shadow-card: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

/* Pill Sliding Theme Switcher */
.theme-switch-pill {
  position: relative;
  width: 62px;
  height: 32px;
  border-radius: 30px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  padding: 3px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.theme-switch-pill .switch-knob {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #38bdf8;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s, color 0.3s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transform: translateX(30px);
}

[data-theme="light"] .theme-switch-pill {
  background: #fef3c7;
  border-color: #fde68a;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .theme-switch-pill .switch-knob {
  transform: translateX(0px);
  background: #f59e0b;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}



* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Container */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 1.25rem 2rem;
  max-width: 1750px;
  margin: 0 auto;
  gap: 1.25rem;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-badge {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #0b0f19;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  box-shadow: 0 0 15px var(--primary-glow);
}

.brand-text h1 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.accent-text {
  color: var(--accent);
}

.subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-badge.connected .status-dot {
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.status-badge.disconnected .status-dot {
  background-color: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}

.status-badge.connecting .status-dot {
  background-color: var(--warning);
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #ffffff;
  border-color: #f59e0b;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-glow {
  box-shadow: 0 0 20px rgba(217, 119, 6, 0.25);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-surface-alt);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-icon:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.btn-text-sm {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.btn-text-sm:hover {
  color: var(--accent);
}

.btn-inline-action {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-inline-action:hover {
  text-decoration: underline;
}

.btn-icon-text {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.btn-icon-text:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Spinner Loader */
.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading .btn-text {
  display: none;
}

.loading .btn-loader {
  display: inline-block;
}

/* Fetch Card */
.fetch-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-card);
}

.fetch-card-inner {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.input-icon-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.input-icon-wrapper input {
  width: 100%;
  padding: 0.85rem 2.8rem 0.85rem 2.8rem;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  transition: var(--transition);
}

.input-icon-wrapper input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.2);
}

.input-icon-wrapper .doc-icon {
  position: absolute;
  left: 1rem;
  color: #34a853;
  font-size: 1.1rem;
  pointer-events: none;
}

.input-icon-wrapper .btn-icon {
  position: absolute;
  right: 0.5rem;
}

.fetch-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.775rem;
  color: var(--text-muted);
}

.fetch-hint i {
  color: var(--accent);
}

/* Main Workspace */
.workspace-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 1.25rem;
  flex: 1;
  min-height: 0;
}

@media (max-width: 1200px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

.panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
}

.panel-title {
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.panel-title i {
  color: var(--accent);
}

/* Form Styles */
.blog-form {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  max-height: calc(100vh - 240px);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-row {
  display: flex;
  gap: 0.75rem;
}

.flex-1 {
  flex: 1;
}

label {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.req {
  color: var(--danger);
}

.label-with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.char-count {
  font-size: 0.7rem;
  color: var(--text-dim);
}

input[type="text"],
input[type="url"],
input[type="datetime-local"],
textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  transition: var(--transition);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.15);
}

textarea {
  resize: vertical;
  min-height: 75px;
}

.slug-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.slug-prefix {
  padding: 0 0.5rem 0 0.75rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  user-select: none;
}

.slug-input-wrapper input {
  border: none;
  padding-left: 0;
  background: transparent;
}

.slug-input-wrapper input:focus {
  box-shadow: none;
}

/* Image Preview */
.image-preview-wrapper {
  position: relative;
  margin-top: 0.5rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #000;
  height: 120px;
}

.image-preview-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-remove-img {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

/* Tags Input */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  min-height: 42px;
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(251, 191, 36, 0.12);
  color: var(--accent);
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
}

.tag-badge .remove-tag {
  cursor: pointer;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.tag-badge .remove-tag:hover {
  color: var(--danger);
}

.tags-container input {
  flex: 1;
  min-width: 120px;
  border: none;
  background: transparent;
  padding: 0.2rem;
  font-size: 0.8rem;
}

.tags-container input:focus {
  outline: none;
  box-shadow: none;
}

.suggested-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.suggest-label {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.tag-pill-suggest {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.tag-pill-suggest:hover {
  background: rgba(251, 191, 36, 0.15);
  color: var(--accent);
  border-color: rgba(251, 191, 36, 0.3);
}

/* Publish Card */
.publish-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.publish-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toggle-info {
  display: flex;
  flex-direction: column;
}

.toggle-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.toggle-desc {
  font-size: 0.725rem;
  color: var(--text-muted);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-surface-alt);
  transition: .3s;
  border: 1px solid var(--border-color);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: .3s;
}

input:checked + .slider {
  background-color: var(--success);
  border-color: var(--success);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

.publish-date-group {
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-color);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Editor & Preview Workspace */
.editor-preview-panel {
  display: flex;
  flex-direction: column;
  min-height: 600px;
}

.editor-tabs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
}

.tab-buttons {
  display: flex;
  gap: 0.35rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--accent);
  border: 1px solid var(--border-color);
  font-weight: 600;
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stats-text {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.workspace-body {
  display: grid;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 240px);
}

.workspace-body.split-mode {
  grid-template-columns: 1fr 1fr;
}

.workspace-body.editor-mode {
  grid-template-columns: 1fr;
}

.workspace-body.editor-mode .pane-preview {
  display: none;
}

.workspace-body.preview-mode {
  grid-template-columns: 1fr;
}

.workspace-body.preview-mode .pane-editor {
  display: none;
}

.pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

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

.pane-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.85rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.75rem;
}

.pane-label {
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.quick-format-tools {
  display: flex;
  gap: 0.25rem;
}

.quick-format-tools button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  cursor: pointer;
  font-family: var(--font-mono);
}

.quick-format-tools button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
}

.preview-tag {
  background: rgba(217, 119, 6, 0.15);
  color: var(--accent);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.675rem;
  font-weight: 600;
}

#markdownContent {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  background: var(--bg-editor);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.65;
  padding: 1.25rem;
  resize: none;
  border-radius: 0;
  outline: none;
  tab-size: 2;
}

#markdownContent:focus {
  box-shadow: none;
}

/* Reader Simulation */
.reader-container {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-y: auto;
  background: var(--bg-preview);
}

.blog-preview-header {
  margin-bottom: 1.5rem;
}

.preview-cover-box {
  width: 100%;
  height: 220px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-color);
}

.preview-cover-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.preview-tag-pill {
  background: rgba(251, 191, 36, 0.1);
  color: var(--accent);
  border: 1px solid rgba(251, 191, 36, 0.25);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.preview-h1 {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-heading);
  margin-bottom: 0.75rem;
}

.preview-author-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.author-avatar {
  width: 34px;
  height: 34px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 0.85rem;
}

.author-details {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.preview-date {
  font-size: 0.725rem;
  color: var(--text-dim);
}

.preview-lead-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.6;
  border-left: 3px solid var(--accent);
  padding-left: 0.85rem;
  margin-bottom: 1.25rem;
}

.preview-divider {
  border: 0;
  height: 1px;
  background: var(--border-color);
  margin-bottom: 1.5rem;
}

/* Markdown Rendered Content */
.markdown-body {
  color: var(--text-article);
  font-size: 0.95rem;
  line-height: 1.8;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  font-family: var(--font-heading);
  color: var(--text-heading);
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.markdown-body h1 { font-size: 1.6rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.4rem; }
.markdown-body h2 { font-size: 1.35rem; color: var(--accent); }
.markdown-body h3 { font-size: 1.15rem; }

.markdown-body p {
  margin-bottom: 1.15rem;
}

.markdown-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.markdown-body blockquote {
  border-left: 4px solid var(--primary);
  background: rgba(217, 119, 6, 0.06);
  padding: 0.75rem 1.25rem;
  margin: 1.25rem 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-main);
  font-style: italic;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.15rem;
}

.markdown-body li {
  margin-bottom: 0.35rem;
}

.markdown-body code {
  font-family: var(--font-mono);
  background: var(--bg-surface-alt);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--accent);
}

.markdown-body pre {
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 1.25rem 0;
  overflow-x: auto;
}

.markdown-body pre code {
  background: transparent;
  padding: 0;
  font-size: 0.85rem;
  color: var(--code-text);
}


.markdown-body img {
  max-width: 100%;
  border-radius: var(--radius-md);
  margin: 1.25rem 0;
  border: 1px solid var(--border-color);
}

.markdown-body hr {
  border: none;
  height: 1px;
  background: var(--border-color);
  margin: 2rem 0;
}

.empty-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: var(--text-dim);
  text-align: center;
  padding: 2rem;
}

.placeholder-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

/* Modal Drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.drawer-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.drawer-container {
  width: 580px;
  max-width: 90vw;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7);
  transform: translateX(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-overlay.hidden .drawer-container {
  transform: translateX(100%);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.drawer-title {
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.drawer-toolbar {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
}

.drawer-toolbar input {
  flex: 1;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
}

.blogs-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.blog-card-item {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: var(--transition);
}

.blog-card-item:hover {
  border-color: rgba(251, 191, 36, 0.4);
  transform: translateY(-1px);
}

.blog-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.blog-item-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

.blog-item-status {
  font-size: 0.675rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
}

.blog-item-status.published {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.blog-item-status.draft {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.blog-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.blog-item-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 2000;
}

.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  min-width: 280px;
  animation: slideUp 0.3s ease-out;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--accent); }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden {
  display: none !important;
}

/* User Profile Badge */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}

.logout-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  transition: var(--transition);
}

.logout-icon-btn:hover {
  color: var(--danger);
}

/* Auth Overlay Modal */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 14, 23, 0.92);
  backdrop-filter: blur(16px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  background: rgba(26, 31, 46, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  padding: 2.5rem 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 40px rgba(212, 175, 55, 0.1);
  text-align: center;
  animation: fadeInModal 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInModal {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-lock-badge {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.05));
  border: 1px solid rgba(212, 175, 55, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  color: var(--accent);
  font-size: 1.5rem;
}

.auth-header h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-bottom: 0.3rem;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.auth-instructions {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 1.5rem 0 1rem;
}

.google-btn-wrapper {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
  min-height: 44px;
}

.auth-error {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  color: #f87171;
  font-size: 0.825rem;
  text-align: left;
}

.auth-footer {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border-color);
  color: var(--text-muted);
  font-size: 0.775rem;
}

/* Responsive Mobile & Tablet Rules */
@media (max-width: 900px) {
  .app-container {
    padding: 0.75rem 1rem;
    gap: 1rem;
  }

  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
  }

  .header-left {
    justify-content: space-between;
  }

  .header-right {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
  }

  .fetch-card-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .fetch-card-inner .btn-primary {
    width: 100%;
    justify-content: center;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .blog-form {
    max-height: none;
  }

  .workspace-body {
    height: auto;
    min-height: 500px;
  }

  .workspace-body.split-mode {
    grid-template-columns: 1fr;
  }

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

  #markdownContent {
    min-height: 350px;
    height: 450px;
  }

  .reader-container {
    min-height: 350px;
    padding: 1rem 1.25rem;
  }
}

@media (max-width: 600px) {
  .brand-text h1 {
    font-size: 1.15rem;
  }

  .brand-badge {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }

  .header-right {
    gap: 0.4rem;
  }

  .status-badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
  }

  .btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.825rem;
  }

  .input-icon-wrapper input {
    font-size: 0.85rem;
    padding: 0.75rem 2.2rem 0.75rem 2.4rem;
  }

  .editor-tabs-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .editor-actions {
    justify-content: space-between;
  }

  .drawer-container {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    border-radius: 0;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    width: auto;
  }

  .toast {
    min-width: 0;
    width: 100%;
  }

  .auth-card {
    padding: 1.75rem 1.25rem;
  }
}


