/* Product Management Core Concepts - Styles */

/* 字体和基础样式 */
body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: #FDFBF6;
    color: #3C3633;
}

/* 导航样式 */
.nav-link {
    transition: color 0.3s ease, border-bottom-color 0.3s ease;
    border-bottom: 2px solid transparent;
}

.nav-link:hover, 
.nav-link.active {
    color: #AD8B73;
    border-bottom-color: #AD8B73;
}

/* 移动端汉堡菜单 */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 4px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background-color: #7A6F64;
    margin: 3px 0;
    transition: 0.3s;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 50;
}

.mobile-nav.active {
    display: block;
}

/* 响应式导航 */
@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
}

/* 标题样式 */
.section-title {
    color: #7A6F64;
}

/* 卡片样式 */
.card {
    background-color: #FFF;
    border: 1px solid #E5E1DA;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.05);
}

/* 按钮样式 */
.btn-primary {
    background-color: #AD8B73;
    color: #FFF;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background-color: #93745f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(173, 139, 115, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(173, 139, 115, 0.3);
}

.btn-secondary {
    background-color: #E5E1DA;
    color: #7A6F64;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #d4cfc6;
    transform: translateY(-1px);
}

.btn-secondary.active {
    background-color: #AD8B73;
    color: #FFF;
}

/* 故事地图样式 */
.story-map-activity { 
    background-color: #F0EBE3;
    transition: all 0.3s ease;
}

.story-map-activity:hover {
    background-color: #e8e2d9;
    transform: scale(1.02);
}

.story-map-step { 
    background-color: #e8e2d9;
    transition: all 0.3s ease;
}

.story-map-step:hover {
    background-color: #ddd4c9;
}

.story-map-story { 
    background-color: #ffffff; 
    border-left: 4px solid #AD8B73;
    transition: all 0.3s ease;
}

.story-map-story:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateX(4px);
}

/* 发布切片样式 */
.release-slice {
    border-top: 2px dashed #AD8B73;
    transition: opacity 0.5s ease;
}

/* 加载动画 */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #AD8B73;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

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

/* 改进的加载动画 */
.loading-dots {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.loading-dots div {
    position: absolute;
    top: 33px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #AD8B73;
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.loading-dots div:nth-child(1) {
    left: 8px;
    animation: loading-dots1 0.6s infinite;
}

.loading-dots div:nth-child(2) {
    left: 8px;
    animation: loading-dots2 0.6s infinite;
}

.loading-dots div:nth-child(3) {
    left: 32px;
    animation: loading-dots2 0.6s infinite;
}

.loading-dots div:nth-child(4) {
    left: 56px;
    animation: loading-dots3 0.6s infinite;
}

@keyframes loading-dots1 {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

@keyframes loading-dots3 {
    0% { transform: scale(1); }
    100% { transform: scale(0); }
}

@keyframes loading-dots2 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(24px, 0); }
}

/* 内容动画 */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

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

.slide-in {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .story-map-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .story-map-container .grid {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        min-width: auto;
    }
    
    .btn-primary, .btn-secondary {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 16px;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .text-4xl {
        font-size: 2rem;
    }
    
    .text-3xl {
        font-size: 1.5rem;
    }
    
    .text-2xl {
        font-size: 1.25rem;
    }
}

/* 可访问性改进 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 焦点样式 */
.btn-primary:focus,
.btn-secondary:focus,
.nav-link:focus {
    outline: 2px solid #AD8B73;
    outline-offset: 2px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn-primary {
        border: 2px solid #000;
    }
}

/* 可访问性和焦点样式 */
.focus-visible {
    outline: 2px solid #7A6F64;
    outline-offset: 2px;
    border-radius: 4px;
}

/* 跳过链接 */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #7A6F64;
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .nav-link {
        border: 1px solid currentColor;
    }
    
    .story-map-story,
    .backlog-item {
        border: 2px solid currentColor;
    }
}

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 键盘导航增强 */
button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #7A6F64;
    outline-offset: 2px;
}

/* 故事卡片焦点状态 */
.story-map-story:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    outline: 2px solid #7A6F64;
    outline-offset: 2px;
}

/* 移动菜单焦点陷阱 */
.mobile-nav.active {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}