:root {
  --navy: #003983;
  --navy-light: #0a4a9e;
  --teal: #00727a;
  --teal-light: #009da6;
  --teal-bg: #e8f5f5;
  --white: #ffffff;
  --gray-50: #f8fafb;
  --gray-100: #f1f3f5;
  --gray-200: #e2e6ea;
  --gray-300: #ced4da;
  --gray-400: #adb5bd;
  --gray-500: #868e96;
  --gray-600: #495057;
  --gray-700: #343a40;
  --gray-800: #212529;
  --danger: #dc3545;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
  --transition: 150ms ease;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; color: var(--gray-800); background: var(--gray-50); line-height: 1.5; min-height: 100vh; }
.header { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; background: var(--navy); color: var(--white); position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-md); }
.header-left { display: flex; align-items: center; gap: 12px; }
.header-title { font-size: 18px; font-weight: 600; letter-spacing: -0.3px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; border: none; border-radius: var(--radius); font-size: 14px; font-weight: 500; cursor: pointer; transition: all var(--transition); white-space: nowrap; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--teal); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--teal-light); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }
.btn-secondary:hover:not(:disabled) { background: var(--gray-200); }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: none; border-radius: var(--radius); background: transparent; color: inherit; cursor: pointer; transition: background var(--transition); }
.btn-icon:hover { background: rgba(255,255,255,0.15); }
.btn-text { background: none; border: none; color: var(--teal); font-size: 13px; font-weight: 500; cursor: pointer; padding: 4px 0; transition: color var(--transition); }
.btn-text:hover { color: var(--navy); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { color: #a71d2a; }
.main { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 24px; max-width: 1400px; margin: 0 auto; }
.panel { background: var(--white); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200); }
.panel-title { font-size: 16px; font-weight: 600; color: var(--navy); margin-bottom: 16px; }
.input-tabs { display: flex; gap: 0; margin-bottom: 16px; border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.tab { flex: 1; padding: 8px 16px; border: none; background: var(--gray-50); font-size: 13px; font-weight: 500; color: var(--gray-500); cursor: pointer; transition: all var(--transition); }
.tab.active { background: var(--white); color: var(--navy); box-shadow: inset 0 -2px 0 var(--teal); }
.input-group { margin-bottom: 16px; }
.input { width: 100%; padding: 10px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius); font-size: 14px; color: var(--gray-800); background: var(--white); transition: border-color var(--transition); }
.input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,114,122,0.1); }
.input-sm { padding: 6px 10px; font-size: 13px; }
.textarea { resize: vertical; font-family: inherit; }
.input-group .btn { margin-top: 8px; width: 100%; }
.article-preview { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.preview-title { font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: 8px; }
.preview-text { font-size: 13px; color: var(--gray-600); line-height: 1.6; max-height: 120px; overflow: hidden; position: relative; }
.preview-text::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 40px; background: linear-gradient(transparent, var(--gray-50)); }
.settings-group { margin-bottom: 16px; }
.label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-600); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.pill-group { display: flex; gap: 0; border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.pill { flex: 1; padding: 8px 16px; border: none; background: var(--white); font-size: 13px; font-weight: 500; color: var(--gray-500); cursor: pointer; transition: all var(--transition); border-right: 1px solid var(--gray-200); }
.pill:last-child { border-right: none; }
.pill.active { background: var(--teal); color: var(--white); }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 14px; border: 1px solid var(--gray-300); border-radius: 20px; background: var(--white); font-size: 13px; color: var(--gray-600); cursor: pointer; transition: all var(--transition); }
.chip.active { border-color: var(--teal); background: var(--teal-bg); color: var(--teal); font-weight: 500; }
.chip:hover:not(.active) { border-color: var(--gray-400); }
#generateBtn { width: 100%; margin-top: 8px; padding: 12px; font-size: 15px; font-weight: 600; }
.hint { font-size: 12px; color: var(--gray-400); text-align: center; margin-top: 6px; }
.hint-inline { font-weight: 400; color: var(--gray-400); text-transform: none; letter-spacing: 0; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--gray-400); font-size: 14px; }
.loading-state { display: flex; flex-direction: column; gap: 16px; }
.skeleton-card { background: var(--gray-100); border-radius: var(--radius); height: 120px; position: relative; overflow: hidden; }
.skeleton-card::after { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent); animation: shimmer 1.5s infinite; }
@keyframes shimmer { 100% { left: 100%; } }
.comments-container { display: flex; flex-direction: column; gap: 16px; }
.comment-card { border: 1px solid var(--gray-200); border-left: 3px solid var(--teal); border-radius: var(--radius); padding: 16px; transition: box-shadow var(--transition); }
.comment-card:hover { box-shadow: var(--shadow-sm); }
.comment-angle { font-size: 11px; font-weight: 600; color: var(--teal); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.comment-text { font-size: 14px; color: var(--gray-700); line-height: 1.7; white-space: pre-line; margin-bottom: 12px; }
.comment-hashtags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.hashtag { font-size: 12px; color: var(--navy); background: var(--gray-100); padding: 2px 8px; border-radius: 4px; font-weight: 500; }
.comment-actions { display: flex; gap: 8px; }
.comment-actions .btn { padding: 6px 14px; font-size: 12px; }
#regenerateBtn { width: 100%; margin-top: 16px; }
.history-panel { max-width: 1400px; margin: 0 auto 24px; padding: 0 24px; }
.history-header { display: flex; align-items: center; gap: 12px; }
.history-chevron { transition: transform var(--transition); vertical-align: middle; }
.history-chevron.open { transform: rotate(180deg); }
.history-count { font-size: 12px; color: var(--gray-400); }
.history-body { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 16px; margin-top: 12px; box-shadow: var(--shadow-sm); }
.history-controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.history-controls .input { flex: 1; }
.history-list { display: flex; flex-direction: column; gap: 8px; max-height: 400px; overflow-y: auto; }
.history-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px; border: 1px solid var(--gray-100); border-radius: var(--radius); transition: background var(--transition); }
.history-item:hover { background: var(--gray-50); }
.history-item-content { flex: 1; min-width: 0; }
.history-item-text { font-size: 13px; color: var(--gray-700); white-space: pre-line; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.history-item-meta { font-size: 11px; color: var(--gray-400); margin-top: 4px; }
.history-item-actions { display: flex; gap: 4px; flex-shrink: 0; }
.history-empty { text-align: center; padding: 24px; color: var(--gray-400); font-size: 13px; }
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 24px; }
.modal { background: var(--white); border-radius: var(--radius-lg); width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px 0; }
.modal-header h2 { font-size: 18px; font-weight: 600; color: var(--navy); }
.modal-body { padding: 20px 24px; }
.form-group { margin-bottom: 16px; }
.form-group .label { margin-bottom: 6px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 0 24px 20px; }
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--gray-800); color: var(--white); padding: 10px 20px; border-radius: var(--radius); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-md); animation: toastIn 200ms ease, toastOut 200ms ease 2.5s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }
.hidden { display: none !important; }
@media (max-width: 768px) { .header-title { font-size: 15px; } .main { grid-template-columns: 1fr; padding: 16px; gap: 16px; } .panel { padding: 16px; } .history-panel { padding: 0 16px; } .modal { max-width: 100%; } }
