/* Know-weave 知织 - 自定义样式 */

:root {
    /* iPhone 15 Pro 尺寸 */
    --iphone-width: 393px;
    --iphone-height: 852px;
    --iphone-radius: 55px;
    --notch-width: 126px;
    --notch-height: 30px;
    
    /* 主色调 - 智能蓝 */
    --primary-color: #4A90E2;
    --primary-light: #6BA3E8;
    --primary-dark: #357ABD;
    
    /* 辅助色 - 活力橙 */
    --secondary-color: #F39C12;
    --secondary-light: #F5B041;
    --secondary-dark: #D68910;
    
    /* 中性色 */
    --text-primary: #1A1A1A;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --background: #FFFFFF;
    --background-secondary: #F8F9FA;
    --border: #E5E5E5;
    
    /* 知识点色板（8色彩虹系） */
    --node-red: #FF6B6B;
    --node-orange: #FFA07A;
    --node-yellow: #FFD93D;
    --node-green: #6BCF7F;
    --node-cyan: #4ECDC4;
    --node-blue: #4A90E2;
    --node-purple: #A67FE8;
    --node-pink: #FF85B3;
    
    /* 状态色 */
    --success: #28A745;
    --warning: #FFC107;
    --error: #DC3545;
    --info: #17A2B8;
}

/* 全局字体 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 界面容器 */
.screen-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.screen-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    text-align: center;
}

.screen-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-align: center;
}

/* iPhone 外框 */
.iphone-frame {
    width: var(--iphone-width);
    height: var(--iphone-height);
    background: #000;
    border-radius: var(--iphone-radius);
    padding: 12px;
    box-shadow: 
        0 0 0 3px #1a1a1a,
        0 20px 50px rgba(0, 0, 0, 0.35);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.iphone-frame:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 0 0 3px #1a1a1a,
        0 24px 60px rgba(0, 0, 0, 0.4);
}

/* Dynamic Island（刘海） */
.iphone-frame::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: var(--notch-width);
    height: var(--notch-height);
    background: #000;
    border-radius: 20px;
    z-index: 100;
    box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.1);
}

/* iframe 样式 */
.iphone-frame iframe {
    width: 100%;
    height: 100%;
    border-radius: 48px;
    background: #fff;
    border: none;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .iphone-frame {
        transform: scale(0.75);
        transform-origin: top center;
        margin-bottom: -100px;
    }
    
    .iphone-frame:hover {
        transform: scale(0.77) translateY(-4px);
    }
}

/* 加载动画 */
.loader {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 波纹动画 */
@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.ripple-effect {
    animation: ripple 1.5s infinite;
}

/* 知识点节点进入动画 */
@keyframes nodeAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.knowledge-node {
    animation: nodeAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-in;
}

/* 滑入动画 */
@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-up {
    animation: slideInUp 0.4s ease-out;
}

/* 按钮点击效果 */
.button-press {
    transition: transform 0.1s, opacity 0.1s;
    cursor: pointer;
}

.button-press:active {
    transform: scale(0.95);
    opacity: 0.8;
}

/* 毛玻璃效果 */
.glass-effect {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-effect-dark {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* iOS 风格阴影 */
.shadow-ios-sm {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.shadow-ios {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.shadow-ios-md {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
}

.shadow-ios-lg {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.shadow-ios-xl {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 脉冲动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse-animation {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 弹跳动画 */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.bounce-animation {
    animation: bounce 2s infinite;
}
