/* AI Content Optimizer — Public CSS */

/* ── 基础结构 ────────────────────────────────────────────────────────────── */
.aico-summary {
  margin: 0 0 1.8em;
  border-radius: 12px;
  overflow: hidden;
  font-size: 0.95rem;
  line-height: 1.75;
  border: 1px solid #e2e2f0;
  box-shadow: 0 2px 10px rgba(108, 99, 255, 0.07);
}

.aico-summary-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.92rem;
  background: #eeeffe;
  color: #3d3a6e;
  border-bottom: 1px solid #dddcf5;
}

.aico-title {
  flex: 1;
  letter-spacing: 0.01em;
}

.aico-icon {
  font-size: 1.05em;
  width: 1.1em;
  text-align: center;
  flex-shrink: 0;
  color: #6c63ff;
}

/* Provider 徽章 —— 右侧实心紫色小标签 */
.aico-badge {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.72em;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: #6c63ff;
  color: #fff;
  flex-shrink: 0;
}

.aico-summary-body {
  padding: 14px 18px 16px;
  background: #fff;
  color: #2c2c3e;
}

.aico-summary-body p {
  margin: 0;
}

.aico-meta {
  font-size: 0.78em;
  color: #9996bb;
  margin-top: 10px !important;
}

/* ── 样式 1：卡片（默认，对齐图片效果）────────────────────────────────── */
.aico-style-card {
  /* 继承基础结构样式，无需额外覆盖 */
}

/* ── 样式 2：极简 ────────────────────────────────────────────────────────── */
.aico-style-minimal {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.aico-style-minimal .aico-summary-header {
  background: transparent;
  border-bottom: 2px solid #6c63ff;
  padding-left: 0;
  color: #6c63ff;
}

.aico-style-minimal .aico-icon {
  color: #6c63ff;
}

.aico-style-minimal .aico-summary-body {
  background: transparent;
  color: inherit;
  padding-left: 0;
  padding-right: 0;
}

/* ── 样式 3：渐变 ────────────────────────────────────────────────────────── */
.aico-style-gradient {
  border: 1px solid #c4b5fd;
  box-shadow: 0 2px 12px rgba(139, 92, 246, 0.12);
}

.aico-style-gradient .aico-summary-header {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  color: #4c1d95;
  border-bottom: 1px solid #c4b5fd;
}

.aico-style-gradient .aico-icon {
  color: #7c3aed;
}

.aico-style-gradient .aico-summary-body {
  background: linear-gradient(180deg, #faf8ff 0%, #f5f3ff 100%);
  color: #3b0764;
}

.aico-style-gradient .aico-badge {
  background: #7c3aed;
}

/* ── 样式 4：边框 ────────────────────────────────────────────────────────── */
.aico-style-border {
  border: 1px solid #e5e7eb;
  border-left: 4px solid #6c63ff;
  border-radius: 0 12px 12px 0;
  box-shadow: none;
}

.aico-style-border .aico-summary-header {
  background: #f9f9ff;
  color: #3d3a6e;
  border-bottom: 1px solid #ebebf5;
}

.aico-style-border .aico-summary-body {
  background: #fff;
  color: #374151;
}

/* ── 响应式 ──────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .aico-summary-header { padding: 9px 14px; }
  .aico-summary-body   { padding: 12px 14px 14px; }
}

/* ── 暗色模式 ────────────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  .aico-summary {
    border-color: #2d2b4e;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  }

  .aico-style-card .aico-summary-header,
  .aico-style-border .aico-summary-header {
    background: #1e1b3a;
    color: #c4b5fd;
    border-bottom-color: #2d2b4e;
  }

  .aico-style-card .aico-summary-body,
  .aico-style-border .aico-summary-body {
    background: #13111f;
    color: #e2e0f5;
  }

  .aico-style-gradient .aico-summary-header {
    background: linear-gradient(135deg, #2e1065, #1e1b4b);
    color: #c4b5fd;
    border-bottom-color: #4c1d95;
  }

  .aico-style-gradient .aico-summary-body {
    background: #1a1730;
    color: #ddd6fe;
  }

  .aico-style-minimal .aico-summary-header { background: transparent; }
  .aico-style-minimal .aico-summary-body   { background: transparent; color: inherit; }

  .aico-meta { color: #6b67a8; }
}

/* ── 打字机光标 ─────────────────────────────────────────────────────────── */
.aico-cursor {
  display: inline-block;
  width: 2px;
  color: currentColor;
  opacity: 1;
  animation: aico-blink 0.7s step-end infinite;
  margin-left: 1px;
  vertical-align: baseline;
}

.aico-cursor-done {
  animation: aico-cursor-fade 0.6s ease forwards;
}

@keyframes aico-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes aico-cursor-fade {
  to { opacity: 0; width: 0; margin: 0; }
}

.aico-summary {
  margin: 0 0 1.8em;
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.95rem;
  line-height: 1.7;
}

.aico-summary-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.9rem;
}

.aico-summary-body {
  padding: 12px 18px 16px;
}

.aico-summary-body p {
  margin: 0;
}

.aico-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.aico-badge {
  display: inline-block;
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75em;
  font-weight: 500;
  background: rgba(255,255,255,0.25);
}

.aico-meta {
  font-size: 0.8em;
  opacity: 0.65;
  margin-top: 8px !important;
}

/* ── 样式 1：卡片（默认）─────────────────────────────────────────────────── */
.aico-style-card {
  border: 1px solid #e8e8f0;
  box-shadow: 0 2px 12px rgba(108,99,255,0.08);
}

.aico-style-card .aico-summary-header {
  background: linear-gradient(135deg, #6c63ff 0%, #8b5cf6 100%);
  color: #fff;
}

.aico-style-card .aico-summary-body {
  background: #fafafe;
  color: #2c2c3e;
}

/* ── 样式 2：极简 ────────────────────────────────────────────────────────── */
.aico-style-minimal {
  border: none;
  background: transparent;
}

.aico-style-minimal .aico-summary-header {
  background: transparent;
  color: #6c63ff;
  padding-left: 0;
  border-bottom: 2px solid #6c63ff;
}

.aico-style-minimal .aico-summary-body {
  background: transparent;
  color: inherit;
  padding-left: 0;
  padding-right: 0;
}

/* ── 样式 3：渐变 ────────────────────────────────────────────────────────── */
.aico-style-gradient {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border: 1px solid #c4b5fd;
}

.aico-style-gradient .aico-summary-header {
  background: transparent;
  color: #5b21b6;
  border-bottom: 1px solid #c4b5fd;
}

.aico-style-gradient .aico-summary-body {
  background: transparent;
  color: #3b0764;
}

/* ── 样式 4：边框 ────────────────────────────────────────────────────────── */
.aico-style-border {
  border-left: 4px solid #6c63ff;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

.aico-style-border .aico-summary-header {
  background: transparent;
  color: #6c63ff;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
}

.aico-style-border .aico-summary-body {
  background: transparent;
  color: #374151;
}

/* ── 响应式 ──────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .aico-summary-header,
  .aico-summary-body {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* ── 暗色模式适配 ────────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  .aico-style-card .aico-summary-body {
    background: #1a1a2e;
    color: #e2e8f0;
  }

  .aico-style-card {
    border-color: #2d2d50;
  }

  .aico-style-gradient {
    background: linear-gradient(135deg, #1e1b4b, #2e1065);
    border-color: #4c1d95;
  }

  .aico-style-gradient .aico-summary-header { color: #c4b5fd; }
  .aico-style-gradient .aico-summary-body   { color: #ddd6fe; }

  .aico-style-border {
    background: #111827;
    border-color: #6c63ff;
  }

  .aico-style-border .aico-summary-body { color: #d1d5db; }

  .aico-style-minimal .aico-summary-body { color: inherit; }
}

/* ── 打字机光标 ─────────────────────────────────────────────────────────── */
.aico-cursor {
  display: inline-block;
  width: 2px;
  color: currentColor;
  opacity: 1;
  animation: aico-blink 0.7s step-end infinite;
  margin-left: 1px;
  vertical-align: baseline;
}

.aico-cursor-done {
  animation: aico-cursor-fade 0.6s ease forwards;
}

@keyframes aico-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes aico-cursor-fade {
  to { opacity: 0; width: 0; margin: 0; }
}
