:root {
    --primary-color: rgb(79, 70, 229);
    --secondary-color: #f3f4f6;
    --accent-color: #1D4ED8;
    --background-color: #fff;
    --text-color: #94A3B8;
    --card-color: #fff;
    --border-color: #334155;
    --prompt-color: rgba(79, 70, 229, 0.1);
    --output-color: rgba(67, 97, 238, 0.1);
    --shadow: 0 4px 20px rgba(0, 180, 216, 0.15);
    --radius: 8px;
    --primary-color-light9: rgba(79, 70, 229, 0.9);
    --primary-color-light8: rgba(79, 70, 229, 0.8);
    --primary-color-light7: rgba(79, 70, 229, 0.7);
    --primary-color-light6: rgba(79, 70, 229, 0.6);
    --primary-color-light5: rgba(79, 70, 229, 0.5);
    --primary-color-light4: rgba(79, 70, 229, 0.4);
    --primary-color-light3: rgba(79, 70, 229, 0.3);
    --primary-color-light2: rgba(79, 70, 229, 0.2);
    --primary-color-light1: rgba(79, 70, 229, 0.1);
}

body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background-color: #f9f8f6;
    line-height: 1.6;
    /* height: 100vh; */
    overflow: hidden;
}

.container {
    max-width: 100%;
}

h1, h2, h3 {
    color: #2c3e50;
}

h1 {
    text-align: left;
    margin: 0;
    padding: 10px;
    background: linear-gradient(90deg, var(--card-color), #1a1f35);
    color: #ccd6f6;
    box-shadow: var(--shadow);
}

h2 {
    font-size: 24px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-top: 40px;
    margin-bottom: 20px;
}

.timeline {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
    position: relative;
    padding-bottom: 0px;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 100%;
    /* height: 1px; */
    /* background-color: var(--primary-color); */
    top: 25px;
    left: 0;
    z-index: 1;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 10px;
    border-radius: 12px;
    transition: all 0.3s ease;
    min-height: 40px;
}

.timeline-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--primary-color-light3);
}

.timeline-item.active {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--primary-color-light3);
    background-color: var(--primary-color);
}

.timeline-dot {
    position: absolute;
    top: 50%;
    left: -10px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 15px var(--primary-color);
}

.timeline-dot::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    z-index: -1;
    animation: pulse 2s infinite;
    opacity: 0;
}

.timeline-dot.active {
    background: linear-gradient(45deg, var(--secondary-color), var(--accent-color));
    /* transform: scale(1.2); */
    box-shadow: 
        0 0 20px var(--primary-color),
        0 0 40px rgba(0, 180, 216, 0.3);
}

.timeline-dot.active::before {
    opacity: 1;
}

.timeline-label {
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    padding-top: 4px;
}

.content-area {
    margin-top: 30px;
}

.stage-container {
    display: none;
    animation: fadeIn 0.5s;
}

.stage-container.active {
    display: block;
}

.stage-description {
    /* margin-bottom: 10px; */
    padding: 15px;
    border-radius: var(--radius);
    border-left: 0px solid var(--primary-color);
}

.visualization-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    /* margin-top: 10px; */
}

.model-card {
    /* border: 1px solid var(--border-color); */
    border-radius: var(--radius);
    /* overflow: hidden; */
}

.model-header {
    background-color: var(--primary-color-light1);
    color: var(--primary-color-light8);
    padding: 10px 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.model-body {
    padding: 15px;
    background-color: var(--card-color);
}

.model-footer {
    /* padding: 10px 15px; */
    /* background-color: #f8f9fa; */
    /* border-top: 1px solid var(--border-color); */
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #666;
}

.prompt-area, .output-area {
    margin-bottom: 15px;
}

.prompt-label, .output-label {
    font-weight: bold;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.prompt-content {
    padding: 10px;
    background-color: var(--prompt-color);
    border: 1px solid rgba(0, 180, 216, 0.2);
    box-shadow: inset 0 0 10px rgba(0, 180, 216, 0.1);
    border-radius: var(--radius);
    /* border-left: 3px solid var(--primary-color); */
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 14px;
    overflow-x: auto;
}

.output-content {
    padding: 10px;
    background-color: var(--output-color);
    border: 1px solid rgba(67, 97, 238, 0.2);
    box-shadow: inset 0 0 10px rgba(67, 97, 238, 0.1);
    border-radius: var(--radius);
    /* border-left: 3px solid var(--secondary-color); */
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 14px;
    overflow-x: auto;
}

.token-prediction {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
    margin-bottom: 15px;
}

.token {
    padding: 5px 10px;
    background: rgba(17, 34, 64, 0.8);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(4px);
    border-radius: 15px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.token.selected {
    background: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

.token-prob {
    font-size: 12px;
    color: #666;
    font-weight: normal;
    transition: color 0.3s ease;
}

.token.selected .token-prob {
    color: #fff;
}

.prediction-group {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.prediction-group.active {
    opacity: 1;
    transform: translateY(0);
}

.token-prob {
    font-size: 12px;
    color: #666;
    font-weight: normal;
}

.model-internals {
    /* background-color: #f8f9fa; */
    padding: 10px;
    border-radius: var(--radius);
    margin-top: 10px;
    /* border: 1px dashed #ccc; */
}

.internals-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: #555;
}

.feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.feature-item {
    display: block;
    /* background-color: #e1f5fe; */
    /* border-radius: 15px; */
    /* padding: 5px 10px; */
    /* font-size: 14px; */
    /* border: 1px solid #b3e5fc; */
}

.processing-step {
    display: flex;
    margin: 15px 0;
    position: relative;
}

.processing-box {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    /* background-color: white; */
    position: relative;
    z-index: 1;
}

.diff-step {
    border: 2px dashed var(--primary-color-light6);
}

.processing-arrow {
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 20px;
    margin: 0 8px;
}

.processing-arrow.loop-arrow {
    font-size: 24px;
    color: var(--primary-color);
    animation: rotate 2s infinite linear;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.focus-point {
    /* background-color: #fff3cd; */
    /* border-left: 3px solid #ffc107; */
    /* padding: 10px 15px; */
    margin: 15px 0;
    /* border-radius: var(--radius); */
}

.focus-title {
    font-weight: bold;
    color: #856404;
    margin-bottom: 5px;
}

/* .template-highlight {
    background-color: #ffecb3;
    padding: 2px 4px;
    border-radius: 3px;
} */

.json-key {
    color: #e91e63;
}

.json-string {
    color: #4caf50;
}

.json-number {
    color: #2196f3;
}

.json-boolean {
    color: #ff9800;
}

.json-null {
    color: #607d8b;
}

.function-call {
    background-color: #fff8e1;
    border-radius: var(--radius);
    padding: 10px;
    margin-top: 10px;
    border: 1px solid #ffe082;
}

.tab-container {
    margin-top: 20px;
}

.tab-buttons {
    display: flex;
    /* border-bottom: 1px solid var(--border-color); */
}

.tab-button {
    padding: 8px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    opacity: 0.7;
    transition: opacity 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    opacity: 1;
}

.tab-button.active {
    opacity: 1;
    border-bottom-color: var(--primary-color);
    background-color: var(--primary-color);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

.agent-thinking {
    background-color: #f3e5f5;
    border-left: 3px solid #9c27b0;
    padding: 10px;
    margin: 10px 0;
    border-radius: var(--radius);
    font-style: italic;
}

.tool-use {
    background-color: #e8f5e9;
    border-left: 3px solid #4caf50;
    padding: 10px;
    margin: 10px 0;
    border-radius: var(--radius);
}

.tool-name {
    font-weight: bold;
    color: #2e7d32;
}

.key-diff {
    /* background-color: #e3f2fd; */
    border-radius: var(--radius);
    padding: 15px;
    margin: 20px 0;
    /* border: 1px solid #bbdefb; */
}

.key-diff-title {
    font-weight: bold;
    color: var(--primary-color-light6);
    margin-bottom: 10px;
}

.diff-list {
    margin: 0;
    padding-left: 25px;
}

.diff-item {
    margin-bottom: 8px;
}

.code-block {
    background-color: #f9f8f6;
    color: #eeffff;
    padding: 12px;
    border-radius: var(--radius);
    font-family: 'Consolas', monospace;
    overflow-x: auto;
    margin: 10px 0;
}

.note {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

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

/* 媒体查询适配移动设备 */
@media (max-width: 768px) {
    .timeline {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .timeline::after {
        height: 100%;
        width: 4px;
        top: 0;
        left: 12px;
    }

    .timeline-item {
        width: 100%;
        flex-direction: row;
        gap: 15px;
    }

    .timeline-label {
        padding-top: 0;
    }
}

/* 选项卡样式优化 */
.tab-container {
    margin: 10px 0;
    /* background: white; */
    border-radius: var(--radius);
    /* box-shadow: var(--shadow); */
    margin-top: 0;
}

.tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    /* background: #f8f9fa; */
    border-top-left-radius: var(--radius);
    border-top-right-radius: var(--radius);
    /* border-bottom: 1px solid var(--border-color); */
}

.tab-button {
    padding: 8px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    color: #666;
    border-radius: var(--radius);
    transition: all 0.3s;
}

.tab-button:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--primary-color-light3);
}

.tab-button.active {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--primary-color-light5);
}

.tab-content {
    display: none;
    padding: 10px;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .tab-buttons {
        flex-direction: column;
        gap: 5px;
    }
    
    .tab-button {
        width: 100%;
        text-align: left;
    }
}

.loading-indicator {
    text-align: center;
    padding: 2rem;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.error-message {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
    font-size: 1.2rem;
}

/* 为动态加载的内容添加淡入效果 */
.content-area > div {
    animation: fadeIn 0.3s ease-in-out;
}

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

.api-example {
    border-radius: 8px;
    padding: 20px;
}

.api-request, .api-response {
    margin-bottom: 20px;
}

.code-header {
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--text-color);
}

.code-block {
    background: #f9f8f6;
    color: #ffffff;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.4;
}

.page-layout {
  display: flex;
  gap: 2rem;
  max-width: 90%;
  margin: 0 auto;
  height: 100vh;
}

.timeline-container {
  width: 280px;
  position: sticky;
  top: 1rem;
  align-self: flex-start;
  padding-right: 1rem;
  /* border-right: 1px solid #eee; */
}

.main-content {
  flex: 1;
  min-width: 0;
  /* height: 100%; */
  overflow-y: auto;
  padding: 20px;
}

/* 自定义滚动条样式 */
.main-content::-webkit-scrollbar {
  display: none;
  width: 1px;
}

.main-content::-webkit-scrollbar-track {
  background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 2px;
}

.main-content::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

/* Firefox 滚动条样式 */
.main-content {
  scrollbar-width: thin;
  scrollbar-color: var(--card-color) transparent;
}

.timeline.vertical {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1rem 0;
}

.timeline-item::after {
  content: '';
  position: absolute;
  left: 0px;
  top: -4px;
  width: 1px;
  height: calc(100% + 1.5rem);
  background-color: #eee;
}

.timeline-dot .active {
  background-color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(var(--primary-color-rgb), 0.2);
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.5);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0.5;
    }
}

.summary-section {
    border-radius: var(--radius);
    border-left: 1px solid var(--primary-color);
    padding: 14px;
}

.generate-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.generate-btn:hover {
    background-color: var(--primary-color-light8);
}

.token {
    animation: fadeIn 0.5s ease-in-out;
}

.typing {
    border-right: 2px solid #000;
    animation: blink 1s infinite;
}

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

@keyframes blink {
    50% { border-color: transparent; }
}

.timeline-dot {
    display: none;
}

.timeline-item::after {
    display: none;
}

.token {
    background-color: var(--primary-color-light4);
    color: #262626;
    margin-top: 4px;
}

.token.selected {
    background-color: var(--primary-color);
    color: #fff;
}

.strong-text {
    color: var(--primary-color);
    margin: 0 4px;
}

pre {
    margin-top: 10px;
    margin-bottom: 10px;
}

.key-questions li {
    margin-top: 10px;
}

.model-card-7 p {
    margin-top: 10px;
    margin-bottom: 10px;
}

/* 隐藏主内容区的滚动条 */
.main-content::-webkit-scrollbar {
    display: none;
}

.key-diff {
    margin-top: 0;
}