/* ==========================================================================
   ShieldAgent AI - Global Styles & Design System
   ========================================================================== */

:root {
  /* Color Palette - Cyber / Dark Theme */
  --bg-main: #0b0f19;
  --bg-surface: rgba(22, 28, 45, 0.65);
  --bg-surface-solid: #161c2d;
  --bg-paper: #ffffff;
  
  --color-text-primary: #f8fafc;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  --color-text-dark: #1e293b;
  
  --accent-color: #8b5cf6;       /* Violet */
  --accent-hover: #7c3aed;
  --accent-glow: rgba(139, 92, 246, 0.4);
  
  --cyan-color: #06b6d4;         /* Cyan */
  --cyan-glow: rgba(6, 182, 212, 0.3);
  
  --color-success: #10b981;      /* Emerald */
  --color-warning: #f59e0b;      /* Amber */
  --color-danger: #ef4444;       /* Rose */
  --color-info: #3b82f6;         /* Blue */

  /* Border Radius & Borders */
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --border-light: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(139, 92, 246, 0.3);

  /* Shadows & Glows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  --glass-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Elements */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.12) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--color-text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Typography Customizations */
h1, h2, h3, h4, .brand-name {
  font-family: 'Outfit', 'Noto Sans TC', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   Header Component
   ========================================================================== */

.app-header {
  height: 70px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  background-color: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 26px;
  background: linear-gradient(135deg, var(--cyan-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(6, 182, 212, 0.4));
}

.brand-name {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

.accent-text {
  background: linear-gradient(90deg, var(--cyan-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==========================================================================
   Buttons & Badges
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--border-light);
  color: var(--color-text-primary);
}
.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background-color: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
.btn-danger:hover:not(:disabled) {
  background-color: var(--color-danger);
  color: #fff;
}

.btn-icon-only {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--border-light);
  color: var(--color-text-secondary);
}
.btn-icon-only:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.status-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
  margin-left: 6px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

.status-offline {
  background-color: rgba(148, 163, 184, 0.1);
  color: var(--color-text-secondary);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

/* ==========================================================================
   App Layout Stack
   ========================================================================== */

.app-container {
  flex: 1;
  display: grid;
  grid-template-columns: 460px 1fr;
  overflow: hidden;
  height: calc(100vh - 70px);
}

/* Control Panel Section */
.control-panel {
  background-color: rgba(15, 22, 38, 0.5);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  background-color: rgba(11, 15, 25, 0.5);
  padding: 6px 15px 0 15px;
  gap: 5px;
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--color-text-secondary);
  padding: 12px 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border-bottom: 3px solid transparent;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.tab-btn:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.03);
}
.tab-btn.active {
  color: var(--cyan-color);
  background-color: rgba(255, 255, 255, 0.05);
  border-bottom-color: var(--cyan-color);
  font-weight: 600;
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  position: relative;
}

.tab-view {
  display: none;
  height: 100%;
}
.tab-view.active {
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Guided Form Panel
   ========================================================================== */

#view-guide {
  padding: 25px;
}

.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Radio Tiles styling */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
}
.tile-grid.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.tile-card {
  cursor: pointer;
  position: relative;
}
.tile-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.tile-content {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}
.tile-content i {
  font-size: 18px;
  color: var(--color-text-secondary);
  transition: transform var(--transition-fast);
}
.tile-content span {
  font-size: 12px;
  font-weight: 500;
  display: block;
}

/* Hover effects */
.tile-card:hover .tile-content {
  border-color: rgba(255, 255, 255, 0.2);
  background-color: rgba(255, 255, 255, 0.05);
}
.tile-card:hover .tile-content i {
  transform: scale(1.1);
}

/* Checked styling */
.tile-card input[type="radio"]:checked + .tile-content {
  background: rgba(139, 92, 246, 0.08);
  border-color: var(--accent-color);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}
.tile-card input[type="radio"]:checked + .tile-content i {
  color: var(--accent-color);
  text-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}
.tile-card input[type="radio"]:checked + .tile-content span {
  color: #fff;
  font-weight: 600;
}

/* Checkbox item list styling */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background-color: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}
.checkbox-item:hover {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.15);
}

.checkbox-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Custom Checkbox Design */
.custom-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-text-muted);
  border-radius: 4px;
  display: inline-block;
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
  transition: all var(--transition-fast);
}

.checkbox-item input[type="checkbox"]:checked ~ .custom-checkbox {
  background-color: var(--cyan-color);
  border-color: var(--cyan-color);
}
.checkbox-item input[type="checkbox"]:checked ~ .custom-checkbox::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid #000;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.checkbox-text strong {
  font-size: 13.5px;
  color: var(--color-text-primary);
  transition: color var(--transition-fast);
}
.checkbox-desc {
  font-size: 11.5px;
  color: var(--color-text-secondary);
}

.checkbox-item input[type="checkbox"]:checked ~ .checkbox-text strong {
  color: var(--cyan-color);
}

/* ==========================================================================
   Chat View Container
   ========================================================================== */

#view-chat {
  height: 100%;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  max-width: 85%;
  display: flex;
  flex-direction: column;
  animation: messagePop var(--transition-normal) forwards;
}

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

.message-content {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.5;
  word-break: break-all;
}

/* System Messages */
.system-message {
  align-self: center;
  max-width: 90%;
  text-align: center;
}
.system-message .message-content {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border-light);
  color: var(--color-text-secondary);
  font-size: 12.5px;
  border-radius: var(--radius-sm);
}

/* User Messages */
.user-message {
  align-self: flex-end;
}
.user-message .message-content {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(6, 182, 212, 0.1));
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #fff;
  border-bottom-right-radius: 2px;
}

/* AI Assistant Messages */
.assistant-message {
  align-self: flex-start;
}
.assistant-message .message-content {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  color: var(--color-text-primary);
  border-bottom-left-radius: 2px;
}

.assistant-message .message-content p {
  margin-bottom: 8px;
}
.assistant-message .message-content p:last-child {
  margin-bottom: 0;
}
.assistant-message .message-content ul, .assistant-message .message-content ol {
  margin-left: 18px;
  margin-bottom: 8px;
}

/* Quick Suggestion Chips */
.quick-chips {
  padding: 8px 15px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  background-color: rgba(11, 15, 25, 0.2);
  border-top: 1px solid var(--border-light);
  scrollbar-width: none; /* Firefox */
}
.quick-chips::-webkit-scrollbar {
  display: none; /* Safari & Chrome */
}

.chip {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  color: var(--color-text-secondary);
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.chip:hover {
  background-color: rgba(139, 92, 246, 0.1);
  border-color: var(--accent-color);
  color: #fff;
}

/* Chat Input Bar */
.chat-input-area {
  padding: 15px;
  background-color: rgba(11, 15, 25, 0.5);
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-input-area textarea {
  flex: 1;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: #fff;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13.5px;
  resize: none;
  outline: none;
  transition: all var(--transition-fast);
}
.chat-input-area textarea:focus {
  border-color: var(--cyan-color);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
  background-color: rgba(255, 255, 255, 0.05);
}

.chat-input-area button {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

/* ==========================================================================
   Article Workspace (Right Panel)
   ========================================================================== */

.article-workspace {
  background-color: #0b0f19;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.workspace-header {
  height: 60px;
  padding: 0 25px;
  border-bottom: 1px solid var(--border-light);
  background-color: rgba(22, 28, 45, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
}

.status-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workspace-title {
  font-size: 15px;
  font-weight: 600;
}

.mode-tag {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.mode-idle {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--color-text-secondary);
}

.mode-drafting {
  background-color: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.25);
  animation: glowPulse 2s infinite ease-in-out;
}

.mode-edited {
  background-color: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 5px rgba(139, 92, 246, 0.2);
  }
  50% {
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
  }
}

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

/* Dropdown Menu styling */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 5px;
  background-color: var(--bg-surface-solid);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  min-width: 180px;
  box-shadow: var(--glass-glow);
  z-index: 10;
  padding: 6px 0;
}
.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-item {
  width: 100%;
  background: none;
  border: none;
  padding: 10px 16px;
  text-align: left;
  font-size: 13px;
  font-family: inherit;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all var(--transition-fast);
}
.dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #fff;
}

/* Preview Paper Area */
.preview-paper-container {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
}

.announcement-paper {
  background-color: var(--bg-paper);
  color: var(--color-text-dark);
  width: 100%;
  max-width: 800px;
  min-height: 500px;
  border-radius: 4px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  padding: 60px 70px;
  transition: opacity var(--transition-normal);
  position: relative;
  border-top: 5px solid var(--accent-color);
}

/* Paper Placeholder State */
.paper-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 380px;
  text-align: center;
  color: var(--color-text-muted);
}
.placeholder-icon {
  font-size: 48px;
  margin-bottom: 20px;
  opacity: 0.3;
}
.paper-placeholder h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: var(--color-text-secondary);
}
.paper-placeholder p {
  font-size: 13.5px;
  line-height: 1.6;
}

/* AI Processing overlay */
.ai-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(11, 15, 25, 0.85);
  z-index: 10;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
  animation: fadeIn var(--transition-fast) forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.loading-text {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-top: 20px;
}
.loading-subtext {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 6px;
}

/* Spinner */
.spinner-box {
  width: 50px;
  height: 50px;
  position: relative;
}
.double-bounce1, .double-bounce2 {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--cyan-color);
  opacity: 0.6;
  position: absolute;
  top: 0;
  left: 0;
  animation: bounce 2s infinite ease-in-out;
}
.double-bounce2 {
  background-color: var(--accent-color);
  animation-delay: -1.0s;
}

@keyframes bounce {
  0%, 100% { 
    transform: scale(0.0);
  } 50% { 
    transform: scale(1.0);
  }
}

/* Dynamic Article Layout inside Paper */
.article-content-wrapper {
  animation: fadeIn var(--transition-normal);
}

.article-header-edit-group {
  position: relative;
  margin-bottom: 12px;
}

/* Edit elements */
.editable-element {
  outline: none;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 4px 8px;
  margin-left: -8px;
  margin-right: -8px;
  transition: all var(--transition-fast);
}

/* Placeholder for contenteditable */
.editable-element:empty::before {
  content: attr(placeholder);
  color: #cbd5e1;
  font-style: italic;
}

.editable-element:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}
.editable-element:focus {
  background-color: #f8fafc;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

h1.editable-element {
  font-size: 26px;
  color: #0f172a;
  line-height: 1.35;
  font-weight: 700;
}
h2.editable-element {
  font-size: 15px;
  color: #475569;
  line-height: 1.5;
  font-weight: 500;
  margin-top: 6px;
}

.element-edit-tip {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--color-text-muted);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  background-color: #fff;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid #e2e8f0;
}
.article-header-edit-group:hover .element-edit-tip {
  opacity: 1;
}

.paper-divider {
  border: 0;
  height: 2px;
  background-color: #e2e8f0;
  margin: 25px 0 30px 0;
}

/* Paragraph blocks formatting */
.paragraph-block {
  position: relative;
  margin-bottom: 22px;
  padding: 8px 12px;
  margin-left: -12px;
  margin-right: -12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  transition: all var(--transition-normal);
}
.paragraph-block:hover {
  background-color: #f8fafc;
  border-color: #e2e8f0;
}

/* Paragraph Text styling */
.paragraph-text {
  font-size: 14.5px;
  line-height: 1.7;
  color: #334155;
  outline: none;
  white-space: pre-wrap;
}

.paragraph-text p {
  margin-bottom: 10px;
}
.paragraph-text p:last-child {
  margin-bottom: 0;
}
.paragraph-text ul, .paragraph-text ol {
  margin-left: 20px;
  margin-bottom: 10px;
}

/* Paragraph Floating Tool Actions */
.paragraph-actions {
  position: absolute;
  right: 12px;
  top: -16px;
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 2px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  z-index: 2;
}
.paragraph-block:hover .paragraph-actions {
  opacity: 1;
  pointer-events: auto;
}

.btn-paragraph-action {
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  border-radius: 50%;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all var(--transition-fast);
}
.btn-paragraph-action:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}
.btn-paragraph-action.btn-rewrite:hover {
  color: var(--accent-color);
  background-color: rgba(139, 92, 246, 0.08);
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   Modals
   ========================================================================== */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  justify-content: center;
  align-items: center;
  background-color: rgba(7, 10, 19, 0.8);
  backdrop-filter: blur(6px);
  animation: fadeIn var(--transition-fast) forwards;
}

.glass-card {
  background-color: var(--bg-surface-solid);
  border: 1px solid var(--border-light);
  box-shadow: var(--glass-glow);
  position: relative;
}

.modal-content {
  width: 100%;
  max-width: 520px;
  border-radius: var(--radius-lg);
  padding: 30px;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  animation: slideUp var(--transition-normal) forwards;
}

.modal-sm {
  max-width: 440px;
}

@keyframes slideUp {
  to {
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h3 {
  font-size: 18px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-close {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 24px;
  cursor: pointer;
  transition: color var(--transition-fast);
}
.btn-close:hover {
  color: #fff;
}

.modal-body {
  margin-bottom: 25px;
}

.settings-intro {
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
}

.form-input {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-family: inherit;
  color: #fff;
  outline: none;
  font-size: 14px;
  transition: all var(--transition-fast);
}
.form-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
  background-color: rgba(255, 255, 255, 0.05);
}

.input-with-icon {
  position: relative;
}
.input-with-icon i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
}
.input-with-icon input {
  padding-left: 40px;
  padding-right: 40px;
}

.btn-input-action {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
}
.btn-input-action:hover {
  color: #fff;
}

.input-help {
  display: block;
  font-size: 11.5px;
  color: var(--color-text-muted);
  margin-top: 6px;
}

.test-result-box {
  margin-top: 15px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  line-height: 1.5;
  border: 1px solid transparent;
}
.test-success {
  background-color: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--color-success);
}
.test-error {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--color-danger);
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-footer div {
  display: flex;
  gap: 10px;
}

/* Help Modal specific layout */
.markdown-body h4 {
  color: #fff;
  font-size: 15px;
  margin-bottom: 12px;
  margin-top: 18px;
}
.markdown-body h4:first-child {
  margin-top: 0;
}
.markdown-body ol, .markdown-body ul {
  margin-left: 20px;
  margin-bottom: 16px;
}
.markdown-body li {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}
.markdown-body li strong {
  color: #fff;
}

/* Original text preview (Rewrite Modal) */
.original-text-preview {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  max-height: 100px;
  overflow-y: auto;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
    overflow-y: auto;
  }
  
  .control-panel {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    height: 550px;
  }
  
  .article-workspace {
    height: 700px;
  }
  
  .preview-paper-container {
    padding: 20px;
  }
  
  .announcement-paper {
    padding: 30px 40px;
  }
}
