/* ═══════════════════════════════════
   Chat History Rail
   ═══════════════════════════════════ */
.chat-history-rail {
  position: fixed;
  top: var(--ae-header-h);
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s var(--ae-ease);
}
.right-collapsed .chat-history-rail {
  pointer-events: auto;
  opacity: 1;
}
.chat-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}
.chat-history-item {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  height: 28px;
  border-radius: 8px 0 0 8px;
  overflow: hidden;
  white-space: nowrap;
  transition: all .25s var(--ae-ease);
  padding: 0 8px 0 0;
}
.chat-history-dot {
  width: 12px;
  height: 2.5px;
  border-radius: 1.5px;
  background: var(--ae-text-3);
  flex-shrink: 0;
  transition: all .2s;
}
.chat-history-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ae-text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 0;
  opacity: 0;
  transition: max-width .3s var(--ae-ease), opacity .2s .05s, padding .3s;
}
.chat-history-item:hover {
  background: var(--ae-glass-bg-active);
  padding: 0 10px 0 14px;
}
.chat-history-item:hover .chat-history-title {
  max-width: 240px;
  opacity: 1;
  padding-right: 10px;
}
.chat-history-item:hover .chat-history-dot {
  background: var(--ae-text-2);
}
.chat-history-item.active .chat-history-dot {
  background: var(--ae-accent);
  width: 14px;
}
.chat-history-item.active:hover {
  background: var(--ae-accent-soft);
}
.chat-history-item.active .chat-history-title {
  color: var(--ae-accent);
}

/* ═══════════════════════════════════
   Right Panel Fullscreen
   ═══════════════════════════════════ */
.app-shell.right-fullscreen {
  grid-template-columns: 0px 0px 0px 0px 1fr !important;
}
.app-shell.right-fullscreen .header-brand,
.app-shell.right-fullscreen .header-center,
.app-shell.right-fullscreen .app-sidebar,
.app-shell.right-fullscreen .handle-left,
.app-shell.right-fullscreen .handle-right,
.app-shell.right-fullscreen .app-main {
  display: none !important;
}
.app-shell.right-fullscreen .header-right-zone {
  grid-column: 1 / -1;
}
.app-shell.right-fullscreen .app-right {
  grid-column: 1 / -1;
  grid-row: 2;
  opacity: 1 !important;
  pointer-events: auto !important;
}
.app-shell.right-fullscreen .chat-history-rail {
  display: none !important;
}

/* ═══════════════════════════════════
   AIGC Rewriter Panel
   ═══════════════════════════════════ */
.aigc-rewriter {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Editor area */
.aigc-editor {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 16px;
}

.aigc-para {
  position: relative;
  padding: 12px 0 12px 20px;
  border-left: 2px solid var(--ae-accent);
  margin-bottom: 24px;
  font-size: 15px;
  line-height: 1.9;
  color: var(--ae-text-1);
  transition: opacity .3s;
}
.aigc-para:last-child {
  margin-bottom: 0;
}

/* Changed character highlight */
.aigc-changed {
  color: var(--ae-accent);
  text-decoration: underline;
  text-decoration-color: rgba(66,133,244,.3);
  text-underline-offset: 3px;
}

/* Processing state */
.aigc-para.processing {
  border-left-color: var(--ae-text-3);
}
.aigc-para.processing .aigc-para-text {
  display: none;
}
.aigc-para.done .aigc-loading {
  display: none;
}
.aigc-para.waiting {
  border-left-color: var(--ae-glass-border);
  opacity: .4;
}
.aigc-para.waiting .aigc-para-text {
  display: none;
}
.aigc-para.waiting .aigc-loading {
  display: none;
}

/* Loading indicator */
.aigc-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ae-text-3);
  font-size: 14px;
}
.aigc-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--ae-glass-border);
  border-top-color: var(--ae-accent);
  border-radius: 50%;
  animation: aigcSpin 1s linear infinite;
  flex-shrink: 0;
}
@keyframes aigcSpin {
  to { transform: rotate(360deg); }
}

/* Bottom toolbar */
.aigc-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 12px 20px;
  border-top: 1px solid var(--ae-glass-border);
  gap: 12px;
  background: var(--ae-sidebar-bg);
}
.aigc-toolbar-label {
  font-size: 13px;
  color: var(--ae-text-2);
  font-weight: 500;
  flex-shrink: 0;
}
.aigc-strength-slider {
  width: 140px;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--ae-glass-bg-active);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.aigc-strength-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ae-accent);
  border: 2px solid var(--ae-bg-base);
  box-shadow: 0 0 0 2px var(--ae-accent);
  cursor: pointer;
}
.aigc-strength-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ae-accent);
  border: 2px solid var(--ae-bg-base);
  box-shadow: 0 0 0 2px var(--ae-accent);
  cursor: pointer;
}
.aigc-points {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #FFAD1F;
  flex-shrink: 0;
}
.aigc-points svg {
  width: 14px;
  height: 14px;
}
.aigc-toolbar-spacer {
  flex: 1;
}
.aigc-toolbar-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ae-text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all .15s;
  flex-shrink: 0;
}
.aigc-toolbar-btn:hover {
  background: var(--ae-glass-bg-hover);
  color: var(--ae-text-1);
}

/* Done checkmark */
.aigc-para.done .aigc-check {
  display: inline-flex;
}
.aigc-check {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ae-green);
  color: #fff;
  font-size: 9px;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: -9px;
  top: 14px;
}

/* ═══════════════════════════════════
   AIGC Detection Panel
   ═══════════════════════════════════ */
.aigc-detect-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.aigc-detect-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 16px;
}

/* Summary card — flat solid */
.aigc-summary {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  border-radius: 14px;
  margin-bottom: 24px;
  background: var(--ae-glass-bg-active);
  flex-wrap: wrap;
}
.aigc-score-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.aigc-score-ring.high { background: rgba(239,68,68,.15); }
.aigc-score-ring.mid { background: rgba(255,173,31,.15); }
.aigc-score-ring.low { background: rgba(0,186,124,.15); }
.aigc-score-num {
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  color: var(--ae-text-1);
}
.aigc-score-label {
  font-size: 9px;
  font-weight: 600;
  margin-top: 2px;
}
.aigc-score-ring.high .aigc-score-label { color: #EF4444; }
.aigc-score-ring.mid .aigc-score-label { color: var(--ae-yellow); }
.aigc-score-ring.low .aigc-score-label { color: var(--ae-green); }
.aigc-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  flex: 1;
}
.aigc-stat {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 12px;
  color: var(--ae-text-3);
}
.aigc-stat-val {
  font-weight: 700;
  color: var(--ae-text-1);
}
.aigc-stat-val.green { color: var(--ae-green); }
.aigc-stat-val.red { color: #EF4444; }

/* Section title */
.aigc-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ae-text-2);
  margin-bottom: 12px;
}
.aigc-section-title i {
  font-size: 12px;
  color: var(--ae-text-3);
}

/* Paragraph result card — flat solid no border */
.aigc-detect-card {
  background: var(--ae-glass-bg);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 10px;
  transition: background .15s;
}
.aigc-detect-card:hover {
  background: var(--ae-glass-bg-hover);
}
.aigc-detect-card:last-child {
  margin-bottom: 0;
}

/* Card header row */
.aigc-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.aigc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.aigc-badge.ai {
  background: rgba(239,68,68,.15);
  color: #EF4444;
}
.aigc-badge.human {
  background: rgba(0,186,124,.15);
  color: var(--ae-green);
}
.aigc-badge i {
  font-size: 10px;
}
.aigc-card-metrics {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}
.aigc-metric {
  font-size: 11px;
  color: var(--ae-text-3);
}
.aigc-metric-val {
  font-weight: 600;
  color: var(--ae-text-2);
}
.aigc-model-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(0,186,124,.12);
  color: var(--ae-green);
  margin-left: auto;
  flex-shrink: 0;
}
.aigc-model-tag i {
  font-size: 9px;
}

/* Card text */
.aigc-card-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--ae-text-1);
}

/* Processing state */
.aigc-detect-card.processing {
  opacity: .5;
}
.aigc-detect-card.processing .aigc-card-header,
.aigc-detect-card.processing .aigc-card-text {
  display: none;
}
.aigc-detect-card.waiting {
  opacity: .25;
}
.aigc-detect-card.waiting .aigc-card-header,
.aigc-detect-card.waiting .aigc-card-text {
  display: none;
}

/* ═══════════════════════════════════
   GEO Ranking Panel
   ═══════════════════════════════════ */
.geo-rank-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.geo-rank-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Header */
.geo-rank-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.geo-rank-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ae-text-1);
}
.geo-rank-title i {
  font-size: 14px;
  color: var(--ae-text-3);
}
.geo-rank-history {
  font-size: 12px;
  color: var(--ae-text-3);
  cursor: pointer;
  transition: color .15s;
  background: none;
  border: none;
  font-family: inherit;
}
.geo-rank-history:hover {
  color: var(--ae-text-1);
}

/* Stats row */
.geo-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.geo-stat-card {
  background: var(--ae-glass-bg);
  border-radius: 10px;
  padding: 14px 12px;
  text-align: center;
}
.geo-stat-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--ae-accent);
  line-height: 1.2;
}
.geo-stat-num.green { color: var(--ae-green); }
.geo-stat-num.yellow { color: var(--ae-yellow); }
.geo-stat-label {
  font-size: 11px;
  color: var(--ae-text-3);
  margin-top: 4px;
}

/* Filter row */
.geo-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.geo-filter-select {
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--ae-glass-bg);
  color: var(--ae-text-2);
  font-size: 12px;
  font-family: inherit;
  border: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%239aa0a6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.geo-filter-time {
  margin-left: auto;
  font-size: 11px;
  color: var(--ae-text-3);
}
.geo-export-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--ae-glass-bg);
  color: var(--ae-text-2);
  font-size: 12px;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all .15s;
}
.geo-export-btn:hover {
  background: var(--ae-glass-bg-hover);
  color: var(--ae-text-1);
}

/* Result rows */
.geo-result-row {
  display: grid;
  grid-template-columns: 28px 1fr 2fr 1fr 80px;
  gap: 10px;
  align-items: center;
  padding: 14px 12px;
  border-radius: 10px;
  margin-bottom: 6px;
  background: var(--ae-glass-bg);
  transition: background .15s;
}
.geo-result-row:hover {
  background: var(--ae-glass-bg-hover);
}
.geo-result-row.header {
  background: transparent;
  padding: 8px 12px;
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ae-text-3);
  text-transform: none;
}
.geo-result-row.header:hover {
  background: transparent;
}

/* Platform cell */
.geo-platform {
  display: flex;
  align-items: center;
  gap: 8px;
}
.geo-platform-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--ae-glass-bg-active);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--ae-text-2);
  flex-shrink: 0;
}
.geo-platform-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ae-text-1);
}

/* Question cell */
.geo-question {
  font-size: 12px;
  color: var(--ae-text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Keyword cell */
.geo-keyword {
  font-size: 13px;
  font-weight: 600;
  color: var(--ae-text-1);
}

/* Status cell */
.geo-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.geo-status-text {
  color: var(--ae-accent);
  font-weight: 500;
}
.geo-status-text.done {
  color: var(--ae-green);
}
.geo-status-text.not-found {
  color: var(--ae-text-3);
}

/* Progress bar */
.geo-progress {
  width: 50px;
  height: 4px;
  border-radius: 2px;
  background: var(--ae-glass-bg-active);
  overflow: hidden;
}
.geo-progress-bar {
  height: 100%;
  border-radius: 2px;
  background: var(--ae-accent);
  transition: width .3s ease;
}

/* Result badge */
.geo-rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}
.geo-rank-badge.recommended {
  background: rgba(0,186,124,.12);
  color: var(--ae-green);
}
.geo-rank-badge.mentioned {
  background: var(--ae-accent-soft);
  color: var(--ae-accent);
}
.geo-rank-badge.absent {
  background: var(--ae-glass-bg-active);
  color: var(--ae-text-3);
}

/* Expand row */
.geo-expand-toggle {
  cursor: pointer;
  color: var(--ae-text-3);
  font-size: 11px;
  transition: transform .2s;
}
.geo-expand-toggle.open {
  transform: rotate(90deg);
}

/* ═══════════════════════════════════
   GEO Rank Panel
   ═══════════════════════════════════ */
.geo-rank-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.geo-rank-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 16px;
}

/* Summary stat cards */
.geo-summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.geo-stat-card {
  background: var(--ae-glass-bg);
  border-radius: 10px;
  padding: 14px 12px;
  text-align: center;
}
.geo-stat-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--ae-accent);
  line-height: 1.2;
}
.geo-stat-num.green { color: var(--ae-green); }
.geo-stat-num.yellow { color: var(--ae-yellow); }
.geo-stat-label {
  font-size: 11px;
  color: var(--ae-text-3);
  margin-top: 4px;
}

/* Filter row */
.geo-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.geo-filter-tag {
  padding: 5px 12px;
  border-radius: 8px;
  background: var(--ae-glass-bg);
  color: var(--ae-text-2);
  font-size: 11px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.geo-filter-tag:hover {
  background: var(--ae-glass-bg-hover);
  color: var(--ae-text-1);
}
.geo-filter-tag.active {
  background: var(--ae-accent-soft);
  color: var(--ae-accent);
}
.geo-filter-time {
  margin-left: auto;
  font-size: 10px;
  color: var(--ae-text-3);
}

/* Platform row cards */
.geo-row {
  background: var(--ae-glass-bg);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 8px;
  transition: background .15s;
}
.geo-row:hover {
  background: var(--ae-glass-bg-hover);
}
.geo-row-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.geo-row-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--ae-glass-bg-active);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--ae-text-2);
  flex-shrink: 0;
  font-weight: 700;
}
.geo-row-platform {
  font-size: 13px;
  font-weight: 600;
  color: var(--ae-text-1);
}
.geo-row-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.geo-row-status-text {
  color: var(--ae-text-3);
}
.geo-row-status-text.done {
  color: var(--ae-green);
}
.geo-row-status-pct {
  font-weight: 700;
  color: var(--ae-accent);
  min-width: 32px;
  text-align: right;
}

/* Progress bar */
.geo-progress {
  width: 60px;
  height: 4px;
  border-radius: 2px;
  background: var(--ae-glass-bg-active);
  overflow: hidden;
  flex-shrink: 0;
}
.geo-progress-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--ae-accent);
  transition: width .6s ease;
}

/* Detail metrics */
.geo-row-details {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.geo-row-metric {
  font-size: 11px;
  color: var(--ae-text-3);
}
.geo-row-metric-val {
  font-weight: 600;
  color: var(--ae-text-2);
}
.geo-row-metric-val.yes {
  color: var(--ae-green);
}
.geo-row-metric-val.no {
  color: var(--ae-text-3);
}
.geo-row-keyword {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--ae-accent-soft);
  color: var(--ae-accent);
  font-size: 11px;
  font-weight: 600;
}

/* Section title */
.geo-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ae-text-2);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.geo-section-title i {
  font-size: 12px;
  color: var(--ae-text-3);
}

/* Processing animation */
.geo-row.processing {
  opacity: .5;
}
.geo-row.processing .geo-row-details {
  display: none;
}
.geo-row.waiting {
  opacity: .25;
}
.geo-row.waiting .geo-row-details,
.geo-row.waiting .geo-row-top .geo-row-status {
  display: none;
}