/* Java内部类动效样式 - 现代化重设计 */

/* 动效容器 - 现代卡片设计 */
.animation-container {
    margin: 30px 0;
    padding: 0;
    border-radius: 24px;
    background: #FFFFFF;
    position: relative;
    min-height: 500px;
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
}

.animation-container:hover {
    transform: translateY(-2px);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.08);
}

/* 动画头部 */
.animation-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px 30px;
    position: relative;
    overflow: hidden;
}

.animation-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.animation-title {
    color: white;
    font-size: 1.5em;
    font-weight: 700;
    margin: 0;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.animation-title::before {
    content: '🎬';
    font-size: 1.2em;
}

.animation-subtitle {
    color: rgba(255, 255, 255, 0.9);
    margin: 8px 0 0 0;
    font-size: 0.9em;
    position: relative;
    z-index: 1;
}

/* 动画内容区域 */
.animation-content {
    padding: 30px;
    background: #FFFFFF;
    min-height: 400px;
}

/* 控制面板 - 现代设计 */
.animation-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.animation-controls button {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: "Noto Sans SC", sans-serif;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.animation-controls button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.animation-controls button:hover::before {
    left: 100%;
}

.animation-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.animation-controls button:active {
    transform: translateY(0);
}

.animation-controls button:disabled {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.animation-controls button:disabled::before {
    display: none;
}

/* 步骤指示器 - 现代设计 */
.step-indicator {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 16px;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

.step-number::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: -1;
}

.step-number.active {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.step-number.completed {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: #10b981;
}

.step-number.completed::after {
    content: '✓';
    position: absolute;
    font-size: 16px;
    color: white;
    opacity: 1;
    z-index: 1;
}

/* 动效控制按钮 */
.animation-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 100;
}

.animation-controls button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    margin: 0 2px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-family: "Noto Sans SC", sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.animation-controls button:hover {
    background: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.animation-controls button:disabled {
    background: #9CA3AF;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 对象可视化样式 - 现代重设计 */
.object-box {
    border-radius: 20px;
    padding: 24px;
    margin: 16px;
    background: #FFFFFF;
    position: relative;
    display: inline-block;
    min-width: 180px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
    font-family: "Noto Sans SC", sans-serif;
    border: 2px solid transparent;
    background-clip: padding-box;
    overflow: hidden;
}

.object-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
    border-radius: 20px 20px 0 0;
}

.object-box:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 外部类样式 */
.object-box.outer-class {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.object-box.outer-class::before {
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
}

/* 内部类样式 */
.object-box.inner-class {
    border-color: #10b981;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.object-box.inner-class::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

/* 静态类样式 */
.object-box.static-class {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.object-box.static-class::before {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

/* 匿名类样式 */
.object-box.anonymous-class {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
}

.object-box.anonymous-class::before {
    background: linear-gradient(90deg, #8b5cf6, #7c3aed);
}

/* 抽象类样式 */
.object-box.abstract {
    border-color: #6b7280;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-style: dashed;
    opacity: 0.85;
}

.object-box.abstract::before {
    background: linear-gradient(90deg, #6b7280, #4b5563);
}

/* 子类样式 */
.object-box.subclass {
    border-color: #06b6d4;
    background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%);
}

.object-box.subclass::before {
    background: linear-gradient(90deg, #06b6d4, #0891b2);
}

/* 具体类样式 */
.object-box.concrete {
    border-color: #10b981;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.object-box.concrete::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

/* 参数对象样式 */
.object-box.parameter {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.object-box.parameter::before {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

/* 访问动画相关样式 */
.object-member.private {
    color: var(--warning-text-color);
    background: var(--warning-bg-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.object-member.public {
    color: var(--success-color);
    background: var(--success-bg-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.class-definition {
    margin-top: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    font-size: 12px;
    text-align: center;
}

/* 访问路径可视化 */
.access-path-visualization {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

.path-diagram {
    display: flex;
    align-items: center;
    gap: 30px;
}

.arrow-path {
    text-align: center;
}

.path-label {
    font-size: 12px;
    color: var(--text-color);
    margin-top: 5px;
}

.access-attempt, .target-member {
    background: var(--info-bg-color);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    margin: 5px 0;
}

/* 权限检查可视化 */
.permission-visualization {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.permission-check {
    max-width: 600px;
    width: 100%;
}

.check-result {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.check-result.success {
    background: var(--success-bg-color);
    border: 2px solid var(--success-color);
}

.check-icon {
    font-size: 24px;
}

.check-message {
    font-size: 18px;
    font-weight: bold;
    color: var(--success-color);
}

.permission-rules {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.permission-rules h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.permission-rules ul {
    margin: 0;
    padding-left: 20px;
}

.permission-rules li {
    margin: 10px 0;
    line-height: 1.5;
}

/* 内存可视化 */
.memory-visualization {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.memory-diagram {
    max-width: 700px;
    width: 100%;
}

.memory-block {
    border: 2px solid #333;
    border-radius: 12px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.memory-block.heap {
    border-color: var(--success-color);
    background: linear-gradient(135deg, var(--success-bg-color), #d4edda);
}

.memory-title {
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    color: var(--success-color);
    font-size: 16px;
}

.object-in-memory {
    margin: 15px 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    position: relative;
}

.memory-address {
    position: absolute;
    top: 5px;
    right: 10px;
    font-family: monospace;
    font-size: 10px;
    color: #666;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
}

.memory-object {
    font-family: monospace;
}

.memory-object strong {
    color: var(--primary-color);
}

.memory-members {
    margin-top: 10px;
    padding-left: 20px;
    font-size: 12px;
}

.memory-members div {
    margin: 5px 0;
}

/* 访问总结样式 */
.access-summary {
    margin-top: 30px;
}

.key-points {
    margin-bottom: 30px;
}

.points-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.point-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.point-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.point-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.point-text strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 8px;
}

.code-example {
    background: var(--code-bg-color);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.code-example h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.code-example pre {
    margin: 0;
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

/* 动画舞台样式 */
.access-demo-stage {
    margin: 30px 0;
    min-height: 300px;
}

/* 对象标题 - 现代设计 */
.object-title {
    font-weight: 700;
    margin-bottom: 16px;
    color: #1f2937;
    text-align: center;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* 对象成员 - 现代设计 */
.object-member {
    margin: 8px 0;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 13px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.object-member:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateX(4px);
}

/* 私有成员样式 */
.object-member.private {
    color: #dc2626;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 1px solid #fca5a5;
    position: relative;
    padding-left: 28px;
}

.object-member.private::before {
    content: '🔒';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
}

/* 公有成员样式 */
.object-member.public {
    color: #059669;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 1px solid #6ee7b7;
    position: relative;
    padding-left: 28px;
}

.object-member.public::before {
    content: '🔓';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
}

/* 类定义样式 */
.class-definition {
    margin-top: 16px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.03) 0%, rgba(0, 0, 0, 0.06) 100%);
    border-radius: 10px;
    font-size: 12px;
    text-align: center;
    border: 1px dashed rgba(0, 0, 0, 0.1);
    color: #6b7280;
}

/* 访问权限徽章 - 现代设计 */
.access-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin: 8px 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.access-badge.full {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.access-badge.limited {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.access-badge::before {
    content: '✅';
    font-size: 10px;
}

/* 高亮效果 - 现代设计 */
.highlight {
    animation: modernHighlight 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

@keyframes modernHighlight {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* 脉冲动画 */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* 淡入动画 */
.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 滑入动画 */
.slide-in-left {
    animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 弹性缩放动画 */
.bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 连接箭头 - 现代设计 */
.arrow {
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    position: relative;
    display: inline-block;
    vertical-align: middle;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.arrow::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid #8b5cf6;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.arrow.dependency {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.arrow.dependency::after {
    border-left-color: #dc2626;
}

.arrow.access {
    background: linear-gradient(90deg, #10b981, #059669);
}

.arrow.access::after {
    border-left-color: #059669;
}

.arrow.direct {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.arrow.direct::after {
    border-left-color: #d97706;
}

/* 代码高亮 */
.code-highlight {
    background: #ffeb3b !important;
    color: #000 !important;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.3s;
}

/* 连接箭头 */
.arrow-container {
    position: relative;
    display: inline-block;
    margin: 0 10px;
}

.arrow {
    width: 60px;
    height: 2px;
    background: #333;
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

.arrow::after {
    content: '';
    position: absolute;
    right: -8px;
    top: -4px;
    width: 0;
    height: 0;
    border-left: 10px solid #333;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

.arrow.dependency {
    background: #ff4444;
}

.arrow.dependency::after {
    border-left-color: #ff4444;
}

.arrow.access {
    background: #28a745;
}

.arrow.access::after {
    border-left-color: #28a745;
}

/* 渐入动画 */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.5s ease-in forwards;
}

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

/* 滑入动画 */
.slide-in-left {
    transform: translateX(-100px);
    opacity: 0;
    animation: slideInLeft 0.5s ease-out forwards;
}

@keyframes slideInLeft {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-right {
    transform: translateX(100px);
    opacity: 0;
    animation: slideInRight 0.5s ease-out forwards;
}

@keyframes slideInRight {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 打字机效果 */
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    animation: typing 2s steps(40, end);
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

/* 对比布局 */
.comparison-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 20px 0;
}

.comparison-column {
    flex: 1;
    padding: 15px;
    margin: 0 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
}

.comparison-column.member {
    border-color: #007bff;
    background: #e3f2fd;
}

.comparison-column.static {
    border-color: #ffc107;
    background: #fff3cd;
}

.comparison-title {
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid;
}

.comparison-column.member .comparison-title {
    border-color: #007bff;
    color: #007bff;
}

.comparison-column.static .comparison-title {
    border-color: #ffc107;
    color: #ffc107;
}

/* 步骤指示器 */
.step-indicator {
    text-align: center;
    margin: 15px 0;
    font-size: 14px;
    color: #666;
}

.step-number {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 50%;
    background: #007bff;
    color: white;
    margin: 0 5px;
    font-weight: bold;
}

.step-number.active {
    background: #28a745;
    transform: scale(1.2);
}

.step-number.completed {
    background: #6c757d;
}

/* 权限标识 */
.permission-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    margin: 2px;
}

.permission-badge.allowed {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.permission-badge.denied {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 悬浮提示 */
.tooltip {
    position: absolute;
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip.show {
    opacity: 1;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

/* 内存布局图 */
.memory-layout {
    border: 2px solid #333;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    background: #f5f5f5;
    font-family: monospace;
}

.memory-block {
    border: 1px solid #666;
    background: white;
    padding: 10px;
    margin: 5px 0;
    border-radius: 4px;
    position: relative;
}

.memory-block.heap {
    background: #e8f5e8;
    border-color: #28a745;
}

.memory-block.stack {
    background: #e3f2fd;
    border-color: #007bff;
}

.memory-address {
    position: absolute;
    right: 10px;
    top: 5px;
    font-size: 10px;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .comparison-container {
        flex-direction: column;
    }

    .comparison-column {
        margin: 10px 0;
    }

    .object-box {
        min-width: 120px;
        margin: 5px;
    }

    .arrow {
        width: 40px;
    }

    .animation-controls {
        position: static;
        text-align: center;
        margin-bottom: 10px;
    }
}

/* 新增样式：动画演示专用 */

/* 演示标题样式 */
.animation-container h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.3em;
    text-align: center;
    font-weight: 600;
}

/* 动画舞台 */
.animation-stage, .this-demo-stage, .anonymous-demo-stage {
    margin: 30px 0;
    min-height: 200px;
}

/* 对象可视化区域 */
.object-visualization, .objects-visualization, .template-visualization {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    flex-wrap: wrap;
    gap: 20px;
}

/* 代码展示区域 */
.code-display, .code-demo-area, .code-highlight-large {
    margin: 20px 0;
    text-align: center;
}

.code-display pre, .code-highlight-large pre {
    background: var(--code-bg-color);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: inline-block;
    text-align: left;
}

/* 关系箭头 */
.relationship-arrow {
    text-align: center;
    margin: 20px 0;
}

.arrow-label {
    font-size: 12px;
    color: var(--text-color);
    margin-top: 5px;
}

.dependency-note, .direct-note {
    text-align: center;
    font-size: 14px;
    color: var(--text-color);
    margin: 10px 0;
    font-weight: 500;
}

/* 访问权限徽章 */
.access-badge {
    background: var(--success-bg-color);
    color: var(--success-color);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    margin: 5px 0;
    display: inline-block;
}

.access-badge.full {
    background: var(--success-bg-color);
    color: var(--success-color);
}

.access-badge.limited {
    background: #FEF3C7;
    color: #92400E;
}

/* 代码片段 */
.code-snippet {
    margin: 10px 0;
    padding: 10px;
    background: var(--code-bg-color);
    border-radius: 8px;
    font-family: monospace;
    font-size: 13px;
    text-align: center;
}

.code-snippet.highlight {
    border: 2px solid var(--primary-color);
    background: #FFF7ED;
    color: var(--primary-color);
    font-weight: bold;
}

/* 无需对象提示 */
.no-object-required {
    text-align: center;
    padding: 20px;
    border: 2px dashed #E5E7EB;
    border-radius: 12px;
    background: #F9FAFB;
}

.no-object-icon {
    font-size: 24px;
    margin-bottom: 10px;
}

/* 对比表格 */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.comparison-table th {
    background: var(--primary-color);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.comparison-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table tr:nth-child(even) {
    background: #F9FAFB;
}

/* this引用样式 */
.this-reference {
    background: var(--info-bg-color);
    color: var(--info-color);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: bold;
    margin-top: 8px;
    text-align: center;
}

/* this高亮样式 */
.this-highlight {
    background: #FEF3C7;
    color: #92400E;
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.this-highlight:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

/* 交互说明 */
.hover-instructions {
    background: #F0F9FF;
    border: 1px solid var(--info-color);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    color: var(--info-color);
    text-align: center;
}

/* 总结网格 */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.summary-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.summary-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.summary-item strong {
    display: block;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: 16px;
}

/* 匿名内部类特殊样式 */
.template-note {
    margin-top: 15px;
    text-align: center;
}

.cannot-create {
    color: var(--warning-text-color);
    background: var(--warning-bg-color);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    margin: 5px 0;
    display: inline-block;
}

.must-inherit {
    color: var(--info-color);
    background: var(--info-bg-color);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    margin: 5px 0;
    display: inline-block;
}

/* 传统流程样式 */
.traditional-process {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.process-step {
    text-align: center;
}

.process-arrow {
    font-size: 24px;
    color: var(--primary-color);
    font-weight: bold;
}

.can-create {
    background: var(--success-bg-color);
    color: var(--success-color);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    margin: 5px 0;
    display: inline-block;
}

/* 匿名内部类流程 */
.anonymous-process {
    text-align: center;
}

.process-arrow-magic {
    font-size: 20px;
    color: var(--primary-color);
    margin: 20px 0;
    font-weight: bold;
}

.magic-features {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    flex-wrap: wrap;
    gap: 15px;
}

.feature-item {
    background: linear-gradient(135deg, var(--info-bg-color), var(--success-bg-color));
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 运行时类型信息 */
.runtime-type {
    background: #F3F4F6;
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px;
}

.type-info, .type-name {
    font-size: 12px;
    color: var(--text-color);
    margin: 5px 0;
}

.type-name {
    font-family: monospace;
    color: var(--primary-color);
}

/* 优势网格 */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.benefit-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.benefit-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.benefit-text strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 5px;
}

/* 使用场景 */
.usage-scenarios {
    background: var(--info-bg-color);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.usage-scenarios h4 {
    color: var(--info-color);
    margin-bottom: 15px;
}

.usage-scenarios ul {
    margin: 0;
    padding-left: 20px;
}

.usage-scenarios li {
    margin: 8px 0;
}

/* 动画总结 */
.animation-summary {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-top: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.animation-summary h3, .animation-summary h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.animation-summary ul {
    margin: 10px 0;
    padding-left: 20px;
}

.animation-summary li {
    margin: 8px 0;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .animation-container {
        padding: 20px;
        min-height: 300px;
    }

    .magic-features {
        flex-direction: column;
        align-items: center;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .traditional-process {
        gap: 15px;
    }

    .object-visualization, .objects-visualization {
        flex-direction: column;
    }
}

/* 暗色主题适配 */
@media (prefers-color-scheme: dark) {
    .animation-container {
        background: linear-gradient(135deg, #2d2d2d, #1f1f1f);
        border-color: #555;
    }

    .comparison-table {
        background: #2d2d2d;
    }

    .comparison-table th {
        background: var(--primary-color);
    }

    .comparison-table tr:nth-child(even) {
        background: #3d3d3d;
    }

    .summary-item, .benefit-item {
        background: #2d2d2d;
        border-color: #555;
        color: #fff;
    }

    .runtime-type {
        background: #3d3d3d;
    }

    .usage-scenarios {
        background: #1e3a5f;
    }
}