/* 全局样式重置 */
:root {
    /* 主题色 */
    --accent-color: #ff9800;
    --accent-hover: #f57c00;
    --accent-light: rgba(255, 152, 0, 0.1);
    --accent-shadow: rgba(255, 152, 0, 0.3);
    --accent-shadow-strong: rgba(255, 152, 0, 0.4);
    
    /* 成功/分享色 */
    --success-color: #4caf50;
    --danger-color: #f44336;
    
    /* 背景色 */
    --bg-dark: #333;
    --bg-darker: #2d2d2d;
    --bg-card: #3a3a3a;
    --bg-input: #2a2a2a;
    
    /* 文字色 */
    --text-light: #fff;
    --text-muted: #888;
    --text-subtle: #666;
    
    /* 边框 */
    --border-color: #555;
    --border-light: #e0e0e0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #333;
    color: #fff;
    padding: 0 20px;
    height: 60px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.brand-name {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
}

.navbar-nav {
    display: flex;
    gap: 30px;
}

.nav-item {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    padding: 8px 0;
    position: relative;
    transition: color 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-item:hover {
    color: var(--accent-color);
    transform: translateY(-2px);
}

.nav-item.active {
    color: var(--accent-color);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-color);
    border-radius: 1px;
    animation: pulse 2s infinite;
}

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

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 导航栏徽章样式 */
.nav-badge {
    display: none; /* 默认隐藏，有数量时显示 */
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background-color: #4caf50;
    color: white;
    font-size: 11px;
    font-weight: bold;
    border-radius: 9px;
    margin-left: 6px;
    align-items: center;
    justify-content: center;
    line-height: 18px;
    text-align: center;
}

.nav-badge.show {
    display: inline-flex;
}

.navbar-user {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--accent-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 2px solid transparent;
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
    border-color: #fff;
}

/* 主内容区域 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    min-height: calc(100vh - 120px);
}

/* 控制面板部分 */
.controls-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.view-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.view-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #e0e0e0;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    color: #666;
}

.view-btn:hover {
    background-color: #f5f5f5;
    border-color: #bdbdbd;
}

.view-btn.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

.more-actions {
    position: relative;
}

.more-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #e0e0e0;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    color: #666;
}

.more-btn:hover {
    background-color: #f5f5f5;
    border-color: #bdbdbd;
}

/* 项目网格 */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    justify-items: center;
}

/* 项目容器布局 */
.project-container {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    width: 100%;
}

/* 左侧创建动画区 */
.create-animation-section {
    width: 30%;
    background: var(--accent-color);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.create-animation-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 152, 0, 0.4);
}

.view-controls-mini {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 40px;
}

.view-icon {
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
}

.create-animation-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    color: white;
    transition: all 0.3s ease;
    margin-left: auto;
    margin-right: 0;
    margin-top: auto;
    margin-bottom: 0;
    align-self: flex-end;
    width: fit-content;
    font-size: 16px;
}

.create-animation-button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.plus-icon-small {
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
}

.create-animation-text {
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
}

/* 右侧已完成动画区 */
.completed-animation-section {
    width: 30%;
    background: #333;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.project-preview-dark {
    position: relative;
    height: 180px;
    background: #444;
    overflow: hidden;
}

.project-overlay-dark {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.7) 100%);
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 16px;
}

.status-badge-dark {
    background: #4caf50;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.project-info-dark {
    padding: 20px;
    background: #3a3a3a;
}

.project-title-container-dark {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.project-title-input-dark {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #555;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    background: #2a2a2a;
}

.project-title-input-dark:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-shadow);
}

.title-edit-btn-dark {
    padding: 10px;
    background: #2a2a2a;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.title-edit-btn-dark:hover {
    background: #333;
    border-color: var(--accent-color);
}

.edit-icon-dark {
    width: 18px;
    height: 18px;
}

.project-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.project-actions.primary-dark {
    margin-bottom: 16px;
}

.project-actions.secondary-dark {
    margin-bottom: 0;
}

.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.action-button.primary-btn-dark {
    background: var(--accent-color);
    color: white;
    flex: 1;
    height: 44px;
    font-size: 16px;
}

.action-button.primary-btn-dark:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--accent-shadow-strong);
}

.action-button.secondary-btn-dark {
    background: #2a2a2a;
    border: 1px solid #555;
    height: 40px;
    flex: 1;
}

.action-button.secondary-btn-dark:hover {
    background: #333;
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

.action-button.share.secondary-btn-dark {
    color: #4caf50;
}

.action-button.share.secondary-btn-dark:hover {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
}

.action-button.cloud.secondary-btn-dark {
    color: #4caf50;
}

.action-button.cloud.secondary-btn-dark:hover {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
}

.action-button.delete.secondary-btn-dark {
    color: var(--accent-color);
}

.action-button.delete.secondary-btn-dark:hover {
    border-color: var(--accent-color);
    background: var(--accent-light);
}

.action-icon-dark {
    width: 18px;
    height: 18px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .project-container {
        flex-direction: column;
    }
    
    .create-animation-section,
    .completed-animation-section {
        width: 100%;
    }
    
    .create-animation-section {
        min-height: 200px;
    }
}

/* 页脚样式 */
.footer {
    background-color: #333;
    color: #fff;
    padding: 30px 0;
    margin-top: auto;
    border-top: 1px solid #444;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.3s;
}

.footer-logo:hover {
    transform: scale(1.05);
}

.footer-brand-name {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
}

.footer-links {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
    position: relative;
    padding: 5px 0;
}

.footer-link:hover {
    color: var(--accent-color);
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent-color);
    transition: width 0.3s;
}

.footer-link:hover::after {
    width: 100%;
}

.footer-copyright {
    text-align: center;
    line-height: 1.6;
}

.footer-copyright p {
    margin: 0;
    font-size: 14px;
    color: #999;
}

.icp-info {
    font-size: 12px !important;
    margin-top: 5px !important;
}

/* 响应式设计 - 平板设备 (768px - 1024px) */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .header-content {
        padding: 0 20px;
    }
    
    .main-content {
        padding: 20px;
    }
}

/* 响应式设计 - 手机设备 (最大宽度 768px) */
@media (max-width: 768px) {
    .header-content {
        padding: 0 15px;
    }
    
    .nav-items {
        gap: 15px;
    }
    
    .nav-item {
        font-size: 14px;
    }
    
    .main-content {
        padding: 20px 15px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .project-card,
    .create-project-card {
        max-width: 100%;
    }
    
    .control-panel {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .view-controls {
        justify-content: flex-start;
    }
    
    .footer-links {
        gap: 15px;
    }
    
    .footer-link {
        font-size: 13px;
    }
}

/* 响应式设计 - 小屏手机 (最大宽度 480px) */
@media (max-width: 480px) {
    .header-content {
        padding: 0 10px;
    }
    
    .nav-items {
        gap: 10px;
    }
    
    .nav-item {
        font-size: 12px;
    }
    
    .nav-icon {
        width: 14px;
        height: 14px;
    }
    
    .main-content {
        padding: 15px 10px;
    }
    
    .control-panel {
        margin-bottom: 15px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .create-project-card {
        padding: 20px;
    }
    
    .create-project {
        font-size: 14px;
        padding: 12px 20px;
    }
    
    .project-card {
        padding: 12px;
    }
    
    .project-preview {
        height: 140px;
    }
    
    .project-title {
        font-size: 16px;
    }
    
    .project-meta {
        font-size: 12px;
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }
    
    .project-actions {
        gap: 8px;
    }
    
    .action-button {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .footer-content {
        padding: 0 10px;
    }
    
    .footer-copyright p {
        font-size: 13px;
    }
    
    .icp-info {
        font-size: 11px !important;
    }
}

/* 动画和交互效果 */

/* 波纹效果 */
.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* 导航项悬停效果 */
.nav-item:hover .nav-text {
    color: var(--accent-color);
}

.nav-item:hover .nav-icon {
    color: var(--accent-color);
}

/* 项目卡片动画 */
.project-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

/* 导航栏滚动效果 */
.header-scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    background-color: rgba(33, 33, 33, 0.95);
}

/* 创建项目按钮动画 */
.create-project {
    transition: transform 0.3s ease;
}

.create-project:hover {
    transform: scale(1.05);
}

/* 视图切换样式 */
.projects-grid.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.projects-grid.list-view {
    grid-template-columns: 1fr;
}

.projects-grid.list-view .project-card {
    display: flex;
    flex-direction: row;
    padding: 15px;
    gap: 15px;
}

.projects-grid.list-view .project-preview {
    width: 200px;
    height: 120px;
    flex-shrink: 0;
}

.projects-grid.list-view .project-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.projects-grid.list-view .project-actions {
    align-self: flex-start;
}

/* 视图按钮激活状态 */
.view-btn.active {
    color: var(--accent-color);
    background-color: var(--accent-light);
}

/* 平滑过渡效果 */
.header,
.nav-item,
.action-button,
.create-project,
.project-card,
.footer-link {
    transition: all 0.3s ease;
}

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

.project-card {
    animation: fadeIn 0.5s ease-out;
}

/* 交错动画延迟 */
.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }
.project-card:nth-child(7) { animation-delay: 0.7s; }
.project-card:nth-child(8) { animation-delay: 0.8s; }
.project-card:nth-child(9) { animation-delay: 0.9s; }
.project-card:nth-child(10) { animation-delay: 1.0s; }

/* 空项目提示 */
.empty-projects-tip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #2d2d2d, #1e1e1e);
    border-radius: 12px;
    color: #888;
    text-align: center;
    min-width: 300px;
}

.empty-projects-tip p:first-child {
    font-size: 18px;
    color: #aaa;
    margin-bottom: 10px;
}

.empty-projects-tip p:last-child {
    font-size: 14px;
    color: #666;
}

/* 项目元数据 */
.project-meta {
    padding: 8px 0;
    font-size: 12px;
    color: #888;
}

.update-time {
    display: inline-block;
}

/* 帧数量徽章 */
.frame-count-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* 项目容器网格布局 */
.project-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* 项目卡片悬停效果 */
.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.project-card .project-preview-dark {
    position: relative;
    cursor: pointer;
}

/* 编辑按钮样式 */
.action-button.edit {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.action-button.edit:hover {
    background: linear-gradient(135deg, #ffa726, #ff9800);
}

/* 项目列表布局 */
.projects-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    flex: 1;
}

.projects-list .project-card {
    flex: 0 0 280px;
    min-width: 280px;
}

/* 项目容器布局优化 */
.project-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px 0;
}

.create-animation-section {
    flex: 0 0 280px;
}

/* 项目卡片样式 */
.project-card {
    background: #2d2d2d;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    border-color: rgba(74, 158, 255, 0.3);
}

.project-card .project-thumbnail {
    position: relative;
    width: 100%;
    height: 160px;
    background: #1a1a1a;
    overflow: hidden;
}

.project-card .project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-card .project-thumbnail .no-thumbnail {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    font-size: 14px;
}

.project-card .local-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--accent-color);
    color: #000;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

.project-card .project-info {
    padding: 12px;
}

.project-card .project-name {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-card .project-meta {
    display: flex;
    gap: 12px;
    color: #888;
    font-size: 12px;
}

/* 空项目状态 */
.empty-projects {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: #2d2d2d;
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    min-width: 280px;
}

.empty-projects .empty-text {
    color: #4a9eff;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.empty-projects .empty-hint {
    color: #888;
    font-size: 13px;
}

/* 加载占位符 */
.loading-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #888;
    font-size: 14px;
}

/* 项目卡片名称行 */
.project-card .project-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.project-card .project-name-row .project-name {
    margin-bottom: 0;
    flex: 1;
}

.project-card .edit-name-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    font-size: 14px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.project-card .edit-name-btn:hover {
    opacity: 1;
}

/* 项目卡片操作按钮 */
.project-card .project-actions {
    padding: 12px;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-card .action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.project-card .action-btn.primary {
    background: var(--accent-color);
    color: #000;
    width: 100%;
}

.project-card .action-btn.primary:hover {
    background: #ffb74d;
    transform: translateY(-1px);
}

.project-card .action-btn-group {
    display: flex;
    gap: 8px;
}

.project-card .action-btn-group .action-btn {
    flex: 1;
    background: #4caf50;
    color: #fff;
    padding: 8px 12px;
    font-size: 12px;
}

.project-card .action-btn-group .action-btn:hover {
    filter: brightness(1.1);
}

.project-card .action-btn-group .action-btn.danger {
    background: #f44336;
}

.project-card .action-btn-group .action-btn.danger:hover {
    background: #e53935;
}

.project-card .action-btn .btn-icon {
    font-size: 14px;
}