
/* ordinary_kid_loves_tech/frontend/css/style.css */
:root {
    --primary-color: #9ccc65;
    --primary-dark: #7cb342;
    --secondary-color: #8bc34a;
    --secondary-dark: #689f38;
    --bg-light: #f9fafb;
    --text-dark: #1f2937;
    --text-light: #6b7280;
}

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    color: var(--text-dark);
    overflow-x: hidden;
    position: relative;
}

/* 粒子背景效果 */
#particles-js {
    pointer-events: none;
    opacity: 0.6;
}

/* 导航栏样式 */
nav {
    transition: all 0.3s ease;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
    padding: 0.5rem;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: white;
    transform: translateY(-2px);
}

.nav-link.active {
    font-weight: 700;
    color: white;
    border-bottom: 2px solid white;
}

.logo {
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.1) rotate(5deg);
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(156, 204, 101, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(156, 204, 101, 0.25);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color);
    cursor: pointer;
    text-decoration: none;
}

.btn-secondary:hover {
    background: rgba(156, 204, 101, 0.1);
    transform: translateY(-2px);
}

.btn-sm-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(156, 204, 101, 0.2);
}

.btn-sm-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(156, 204, 101, 0.25);
}

/* 特色卡片样式 */
.feature-card {
    background: white;
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.icon-box {
    background: rgba(156, 204, 101, 0.1);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

/* 博客卡片样式 */
.blog-card {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.blog-img {
    overflow: hidden;
}

.blog-img img {
    transition: all 0.5s ease;
}

.blog-card:hover .blog-img img {
    transform: scale(1.05);
}

/* 工具卡片样式 */
.tool-card {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* 表单样式 */
.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(156, 204, 101, 0.2);
}

/* 代码高亮区域样式 */
.code-tabs {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tabs {
    background: white;
}

.tab-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    color: var(--text-light);
}

.tab-btn.active {
    color: var(--primary-color);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.tab-content {
    display: none;
    margin: 0;
    padding: 0;
}

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

.tab-content code {
    padding: 0 !important;
    background: transparent !important;
}

/* 返回顶部按钮样式 */
#back-to-top {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#back-to-top:hover {
    transform: translateY(-5px);
}

#back-to-top.visible {
    opacity: 1;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease forwards;
}

/* 响应式设计 - 中等屏幕 */
@media (max-width: 1024px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* 响应式设计 - 小屏幕 */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .blog-card, .feature-card, .tool-card {
        margin-bottom: 1.5rem;
    }
    
    h1 {
        font-size: 2rem !important;
    }
    
    h2 {
        font-size: 1.75rem !important;
    }
    
    h3 {
        font-size: 1.25rem !important;
    }
    
    .py-16 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    .mb-12 {
        margin-bottom: 2rem;
    }
}

/* 响应式设计 - 超小屏幕 */
@media (max-width: 480px) {
    .btn-primary, .btn-secondary {
        width: 100%;
        margin-bottom: 0.75rem;
        justify-content: center;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 30%;
    }
}

/* 微交互动画 */
.feature-card .icon-box {
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.feature-card:hover .icon-box {
    transform: scale(1.1) rotate(5deg);
    background-color: rgba(156, 204, 101, 0.2);
}

.blog-card .text-green-600 {
    transition: all 0.3s ease;
}

.blog-card:hover .text-green-600 {
    padding-left: 5px;
}

/* 表单提交按钮动效 */
button[type="submit"] {
    position: relative;
    overflow: hidden;
}

button[type="submit"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: all 0.5s ease;
}

button[type="submit"]:active::after {
    transform: translate(-50%, -50%) scale(3);
    opacity: 1;
    transition: all 0s;
}

/* 夜间模式切换按钮 */
.theme-switch {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 1000;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.theme-switch:hover {
    transform: rotate(30deg);
}

/* 社交按钮样式 */
.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: var(--secondary-color);
}

/* 工具导航按钮 */
.tool-nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--text-light);
}

.tool-nav-btn:hover {
    background-color: rgba(156, 204, 101, 0.1);
    transform: translateY(-1px);
}

.tool-nav-btn.active {
    background-color: var(--primary-color);
    color: white;
}

/* AI问答工具样式 */
.ai-chat-container {
    height: 500px;
    display: flex;
    flex-direction: column;
}

.ai-chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 0.5rem;
}

.ai-message {
    margin-bottom: 1rem;
    max-width: 80%;
}

.ai-message-user {
    background-color: var(--primary-color);
    color: white;
    border-radius: 1rem 1rem 0 1rem;
    padding: 0.75rem 1rem;
    margin-left: auto;
}

.ai-message-bot {
    background-color: #e9e9e9;
    color: var(--text-dark);
    border-radius: 1rem 1rem 1rem 0;
    padding: 0.75rem 1rem;
}

.ai-chat-input {
    display: flex;
    margin-top: 1rem;
}

.ai-chat-input input {
    flex-grow: 1;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem 0 0 0.375rem;
}

.ai-chat-input button {
    border-radius: 0 0.375rem 0.375rem 0;
}

/* 文件上传组件样式 */
.file-upload-area {
    border: 2px dashed var(--primary-color);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.file-upload-area:hover {
    background-color: rgba(156, 204, 101, 0.05);
}

.file-upload-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* 产品套餐样式 */
.pricing-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2rem 0;
}

.pricing-table th, .pricing-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.pricing-table tr:hover {
    background-color: rgba(156, 204, 101, 0.05);
}

.pricing-feature-yes {
    color: var(--primary-color);
}

.pricing-feature-no {
    color: #d1d5db;
}

/* 浏览器兼容性处理 */
@supports not (backdrop-filter: blur(10px)) {
    .navbar {
        background-color: rgba(156, 204, 101, 0.95);
    }
}

/* 打印媒体查询 */
@media print {
    nav, #back-to-top, .theme-switch, footer {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    .container {
        width: 100% !important;
        max-width: 100% !important;
    }
}
