/**
 * RolePilot 网站 - 功能演示样式
 * 各功能模块的动态演示效果
 */

/* ========== 通用演示容器 ========== */
.rp-demo {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* ========== 1. 任务管理面板演示 ========== */
.rp-demo-task-list {
  width: 100%;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rp-demo-task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid var(--rp-border);
  border-left: 3px solid var(--rp-accent);
  font-size: 13px;
  color: var(--rp-text-secondary);
  transition: all 0.3s ease;
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 6px),
    calc(100% - 6px) 100%,
    0 100%
  );
}

.rp-demo-task-item.completed {
  opacity: 0.5;
  text-decoration: line-through;
}

.rp-demo-task-checkbox {
  width: 16px;
  height: 16px;
  border: 2px solid var(--rp-accent);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rp-demo-task-checkbox.checked {
  background: var(--rp-accent);
}

.rp-demo-task-checkbox.checked::after {
  content: '✓';
  color: var(--rp-bg-primary);
  font-size: 10px;
}

/* ========== 2. 灵动岛演示 ========== */
.rp-demo-island {
  width: 120px;
  height: 40px;
  background: #1a1a1a;
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  animation: rp-island-breathe 3s ease-in-out infinite;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 243, 255, 0.1);
  border: 1px solid var(--rp-border);
}

@keyframes rp-island-breathe {
  0%, 100% { width: 120px; }
  50% { width: 200px; }
}

.rp-demo-island-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rp-accent), #00a0ff);
  box-shadow: 0 0 10px var(--rp-accent);
}

.rp-demo-island-text {
  font-size: 12px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
}

/* ========== 3. 番茄钟演示 - 沙漏样式 ========== */
.rp-demo-pomodoro {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.rp-demo-pomodoro-hourglass {
  width: 80px;
  height: 120px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rp-demo-pomodoro-top {
  width: 70px;
  height: 45px;
  background: rgba(0, 243, 255, 0.1);
  border: 2px solid var(--rp-accent);
  border-radius: 8px 8px 0 0;
  clip-path: polygon(0 0, 100% 0, 85% 100%, 15% 100%);
  position: relative;
  overflow: hidden;
}

.rp-demo-pomodoro-top::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 15%;
  right: 15%;
  height: 100%;
  background: var(--rp-accent);
  opacity: 0.3;
  animation: sandFall 25s linear infinite;
}

@keyframes sandFall {
  0% { height: 100%; }
  100% { height: 0%; }
}

.rp-demo-pomodoro-middle {
  width: 20px;
  height: 10px;
  background: var(--rp-accent);
  box-shadow: 0 0 10px var(--rp-accent);
}

.rp-demo-pomodoro-bottom {
  width: 70px;
  height: 45px;
  background: rgba(0, 243, 255, 0.1);
  border: 2px solid var(--rp-accent);
  border-radius: 0 0 8px 8px;
  clip-path: polygon(15% 0, 85% 0, 100% 100%, 0 100%);
  position: relative;
  overflow: hidden;
}

.rp-demo-pomodoro-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0%;
  background: var(--rp-accent);
  opacity: 0.5;
  animation: sandFill 25s linear infinite;
}

@keyframes sandFill {
  0% { height: 0%; }
  100% { height: 100%; }
}

.rp-demo-pomodoro-time {
  font-family: var(--rp-font-mono);
  font-size: 24px;
  font-weight: 600;
  color: var(--rp-accent);
  text-shadow: 0 0 10px var(--rp-accent-glow);
}

/* ========== 4. 日历演示 ========== */
.rp-demo-calendar {
  width: 100%;
  max-width: 240px;
}

.rp-demo-calendar-header {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--rp-accent);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.rp-demo-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.rp-demo-calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--rp-text-muted);
  border-radius: 4px;
  border: 1px solid transparent;
}

.rp-demo-calendar-day.today {
  background: var(--rp-accent);
  color: var(--rp-bg-primary);
  font-weight: 600;
  box-shadow: 0 0 10px var(--rp-accent);
}

.rp-demo-calendar-day.has-task {
  position: relative;
  border-color: var(--rp-border);
}

.rp-demo-calendar-day.has-task::after {
  content: '';
  position: absolute;
  bottom: 2px;
  width: 4px;
  height: 4px;
  background: var(--rp-accent);
  border-radius: 50%;
  box-shadow: 0 0 5px var(--rp-accent);
}

/* ========== 5. Omnibox 演示 ========== */
.rp-demo-omnibox {
  width: 100%;
  max-width: 280px;
}

.rp-demo-omnibox-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid var(--rp-border);
  font-size: 14px;
  color: var(--rp-text-primary);
  clip-path: polygon(
    8px 0, 100% 0,
    100% calc(100% - 8px), calc(100% - 8px) 100%,
    0 100%, 0 8px
  );
}

.rp-demo-omnibox-typing {
  display: inline;
  border-right: 2px solid var(--rp-accent);
  animation: rp-blink-caret 0.8s step-end infinite;
}

@keyframes rp-blink-caret {
  0%, 100% { border-color: var(--rp-accent); }
  50% { border-color: transparent; }
}

/* ========== 6. 长文写作助手演示 ========== */
.rp-demo-writing {
  width: 100%;
  max-width: 260px;
}

.rp-demo-tree {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rp-demo-tree-node {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid var(--rp-border);
  font-size: 12px;
  color: var(--rp-text-secondary);
  animation: rp-fade-in-up 0.5s ease-out both;
}

.rp-demo-tree-node:nth-child(2) {
  margin-left: 20px;
  animation-delay: 0.2s;
}

.rp-demo-tree-node:nth-child(3) {
  margin-left: 20px;
  animation-delay: 0.4s;
}

.rp-demo-tree-node:nth-child(4) {
  margin-left: 40px;
  animation-delay: 0.6s;
}

.rp-demo-tree-icon {
  width: 16px;
  height: 16px;
  background: var(--rp-accent);
  opacity: 0.6;
  clip-path: polygon(4px 0, 100% 0, 100% 100%, 0 100%, 0 4px);
}

.rp-demo-writing-features {
  margin-top: 12px;
  font-size: 10px;
  color: var(--rp-text-muted);
  text-align: center;
}

@keyframes rp-fade-in-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== 7. AI 服务演示 ========== */
.rp-demo-ai-chat {
  width: 100%;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rp-demo-chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.5;
  animation: rp-bubble-in 0.4s ease-out both;
}

.rp-demo-chat-bubble.user {
  align-self: flex-end;
  background: var(--rp-accent);
  color: var(--rp-bg-primary);
  border-radius: 12px 12px 4px 12px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
}

.rp-demo-chat-bubble.ai {
  align-self: flex-start;
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid var(--rp-border);
  color: var(--rp-text-secondary);
  border-radius: 12px 12px 12px 4px;
  animation-delay: 0.5s;
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
}

@keyframes rp-bubble-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ========== 8. 行内补全演示 ========== */
.rp-demo-completion {
  width: 100%;
  max-width: 280px;
  padding: 16px;
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid var(--rp-border);
  font-size: 13px;
  line-height: 1.6;
}

.rp-demo-completion-text {
  color: var(--rp-text-primary);
}

.rp-demo-completion-ghost {
  color: var(--rp-accent);
  opacity: 0;
  animation: rp-completion-appear 2s ease-out 1s infinite;
}

@keyframes rp-completion-appear {
  0%, 20% { opacity: 0; }
  40%, 100% { opacity: 0.5; }
}

/* ========== 9. 皮肤商城演示 - 沙漏样式 ========== */
.rp-demo-skins {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.rp-demo-skin-preview {
  width: 100px;
  height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: rp-skin-rotate 6s ease-in-out infinite;
}

.rp-demo-skin-hourglass {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rp-demo-skin-top {
  width: 50px;
  height: 30px;
  border: 2px solid;
  border-radius: 6px 6px 0 0;
  clip-path: polygon(0 0, 100% 0, 80% 100%, 20% 100%);
  animation: rp-skin-color 6s ease-in-out infinite;
}

.rp-demo-skin-middle {
  width: 14px;
  height: 6px;
  animation: rp-skin-color 6s ease-in-out infinite;
}

.rp-demo-skin-bottom {
  width: 50px;
  height: 30px;
  border: 2px solid;
  border-radius: 0 0 6px 6px;
  clip-path: polygon(20% 0, 80% 0, 100% 100%, 0 100%);
  animation: rp-skin-color 6s ease-in-out infinite;
}

@keyframes rp-skin-color {
  0%, 100% {
    border-color: #00f3ff;
    background: rgba(0, 243, 255, 0.2);
  }
  33% {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.2);
  }
  66% {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.2);
  }
}

.rp-demo-skin-time {
  font-family: var(--rp-font-mono);
  font-size: 16px;
  font-weight: 600;
  animation: rp-skin-text-color 6s ease-in-out infinite;
}

@keyframes rp-skin-text-color {
  0%, 100% { color: #00f3ff; text-shadow: 0 0 10px rgba(0, 243, 255, 0.5); }
  33% { color: #ff6b6b; text-shadow: 0 0 10px rgba(255, 107, 107, 0.5); }
  66% { color: #a855f7; text-shadow: 0 0 10px rgba(168, 85, 247, 0.5); }
}

.rp-demo-skin-dots {
  display: flex;
  gap: 8px;
}

.rp-demo-skin-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rp-border);
}

.rp-demo-skin-dot.active {
  background: var(--rp-accent);
  box-shadow: 0 0 10px var(--rp-accent);
}

/* ========== 10. 任务大厅演示 ========== */
.rp-demo-hall {
  width: 100%;
  max-width: 280px;
}

.rp-demo-hall-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.rp-demo-hall-tab {
  padding: 6px 12px;
  font-size: 11px;
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid var(--rp-border);
  color: var(--rp-text-muted);
  clip-path: polygon(
    6px 0, 100% 0,
    100% calc(100% - 6px), calc(100% - 6px) 100%,
    0 100%, 0 6px
  );
}

.rp-demo-hall-tab.active {
  background: var(--rp-accent-bg);
  border-color: var(--rp-accent);
  color: var(--rp-accent);
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.rp-demo-hall-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rp-demo-hall-item {
  padding: 8px 12px;
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid var(--rp-border);
  font-size: 12px;
  color: var(--rp-text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rp-demo-hall-item-tag {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--rp-accent-bg);
  color: var(--rp-accent);
  border-radius: 4px;
}

/* ========== 11. 年度目标管理演示 ========== */
.rp-demo-yearly {
  width: 100%;
  max-width: 280px;
}

.rp-demo-yearly-card {
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid var(--rp-border);
  padding: 12px;
  clip-path: polygon(
    0 8px, 8px 0, 100% 0,
    100% calc(100% - 8px), calc(100% - 8px) 100%,
    0 100%
  );
}

.rp-demo-yearly-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.rp-demo-yearly-role {
  font-size: 10px;
  padding: 2px 8px;
  background: var(--rp-accent);
  color: var(--rp-bg-primary);
  font-weight: 600;
}

.rp-demo-yearly-title {
  font-size: 13px;
  color: var(--rp-text-primary);
}

.rp-demo-yearly-progress {
  height: 4px;
  background: rgba(0, 243, 255, 0.2);
  margin-bottom: 10px;
  overflow: hidden;
}

.rp-demo-yearly-bar {
  height: 100%;
  background: var(--rp-accent);
  box-shadow: 0 0 10px var(--rp-accent);
  animation: progressGrow 2s ease-out;
}

@keyframes progressGrow {
  from { width: 0; }
}

.rp-demo-yearly-tasks {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rp-demo-yearly-task {
  font-size: 11px;
  color: var(--rp-text-muted);
  padding-left: 8px;
}

.rp-demo-yearly-task.done {
  color: var(--rp-accent);
}

/* ========== 12. 数据复盘演示 ========== */
.rp-demo-analytics {
  width: 100%;
  max-width: 280px;
}

.rp-demo-analytics-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}

.rp-demo-analytics-tab {
  padding: 4px 12px;
  font-size: 11px;
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid var(--rp-border);
  color: var(--rp-text-muted);
}

.rp-demo-analytics-tab.active {
  background: var(--rp-accent);
  border-color: var(--rp-accent);
  color: var(--rp-bg-primary);
}

.rp-demo-analytics-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.rp-demo-analytics-stat {
  text-align: center;
}

.rp-demo-analytics-num {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--rp-accent);
  text-shadow: 0 0 10px var(--rp-accent-glow);
}

.rp-demo-analytics-label {
  font-size: 10px;
  color: var(--rp-text-muted);
}

.rp-demo-analytics-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 60px;
  padding: 0 10px;
  border-bottom: 1px solid var(--rp-border);
}

.rp-demo-analytics-bar {
  width: 20%;
  background: linear-gradient(to top, var(--rp-accent), rgba(0, 243, 255, 0.3));
  animation: barGrow 1s ease-out;
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

@keyframes barGrow {
  from {
    height: 0 !important;
  }
}
