/* =====================================================
   组件样式 (Components)
   
   导航栏、页脚、按钮、卡片、时间轴、模态框、加载器
   所有可复用 UI 组件集中管理
   ===================================================== */

/* ===== 导航栏 ===== */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    width: auto;
    border-radius: var(--radius-lg);
    z-index: var(--z-navbar);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--orange-peel);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-logo:hover {
    text-decoration: none;
}

.logo-icon {
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

/* Logo 文字始终显示完整名称 */

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: var(--color-text-primary);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--orange-peel);
    background: rgba(255, 107, 53, 0.1);
}

/* 聊天导航项 - 呼吸发光小圆点 */
.nav-link-chat {
    position: relative;
}

.nav-link-chat::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 2px;
    width: 7px;
    height: 7px;
    background: var(--orange-peel);
    border-radius: 50%;
    animation: chat-live-pulse 2s ease-in-out infinite;
    pointer-events: none;
}

.nav-link-chat:hover::after {
    background: var(--orange-juice);
    animation: chat-live-pulse 1s ease-in-out infinite;
}

@keyframes chat-live-pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.5);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 5px rgba(255, 107, 53, 0);
    }
}

/* 导航栏滚动状态 — 毛玻璃半透明 */
.navbar.scrolled {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

/* 汉堡菜单 */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--orange-peel);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* ===== 交互规范 ===== */

/* 触摸目标最小 44x44px */
.touch-target,
.juice-button,
.nav-link,
.icon-button,
[role="button"] {
    min-height: 44px;
    min-width: 44px;
}

/* 可点击元素 */
.clickable,
.fruit-card,
.section-card,
.juice-button,
a,
button {
    cursor: pointer;
}

/* 图标按钮 */
.icon-button {
    padding: 10px;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    transition: background var(--duration-fast) ease;
}

.icon-button:hover {
    background: var(--glow-subtle);
}

/* ===== 果汁按钮 ===== */
.juice-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--orange-peel), var(--orange-flesh));
    color: white;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-brand);
    transition: all var(--duration-normal) ease;
    position: relative;
    overflow: hidden;
}

.juice-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-brand-lg);
}

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

.juice-button[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.juice-button.secondary {
    background: white;
    color: var(--orange-peel);
    border: 2px solid var(--color-border);
}

.juice-button.secondary:hover {
    background: var(--sunshine);
    border-color: var(--color-border-hover);
}

.juice-button.ghost {
    background: transparent;
    color: var(--orange-peel);
    box-shadow: none;
}

.juice-button.ghost:hover {
    background: var(--glow-subtle);
}

/* ===== 果实卡片 ===== */
.fruit-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    border: 2px solid var(--color-border);
    box-shadow: var(--shadow-md);
    transition: all var(--duration-normal) cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.fruit-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, var(--glow-subtle) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, var(--glow-subtle) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--duration-normal) ease;
    pointer-events: none;
    z-index: 0;
}

.fruit-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow-lg), 0 0 30px var(--glow-subtle);
    z-index: var(--z-card-hover);
}

.fruit-card:hover::before {
    opacity: 1;
}

.fruit-card > * {
    position: relative;
    z-index: 1;
}

.fruit-card.orange-peel {
    border: 3px solid var(--orange-peel);
    border-image: linear-gradient(135deg, var(--orange-peel), var(--orange-flesh), var(--orange-pulp)) 1;
}

/* ===== 导览卡片（首页） ===== */
.guide-card {
    background: linear-gradient(135deg, var(--sunshine-warm) 0%, var(--orange-membrane) 100%);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl) var(--spacing-xl);
    text-align: center;
    border: 2px solid var(--color-border);
    box-shadow: var(--shadow-md);
    transition: all var(--duration-normal) cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.guide-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, var(--glow-effect) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all var(--duration-slow) ease;
    pointer-events: none;
}

.guide-card:hover {
    transform: translateY(-6px);
    border-color: var(--orange-flesh);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.guide-card:hover::after {
    width: 300px;
    height: 300px;
}

.guide-card-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-lg);
    background: linear-gradient(135deg, var(--orange-peel), var(--orange-flesh));
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-brand);
}

.guide-card-icon .lucide {
    width: 40px;
    height: 40px;
}

.guide-card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

.guide-card-subtitle {
    font-size: 1rem;
    color: var(--orange-peel);
    margin-bottom: var(--spacing-md);
    font-weight: 500;
}

.guide-card-desc {
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-lg);
}

.guide-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--orange-peel);
    font-weight: 600;
    text-decoration: none;
    transition: gap var(--duration-fast) ease;
}

.guide-card-link:hover {
    gap: 10px;
}

/* ===== 品种卡片（关于页） ===== */
.variety-card {
    background: linear-gradient(135deg, var(--sunshine-warm) 0%, var(--orange-membrane) 100%);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    text-align: center;
    border: 2px solid var(--color-border);
    transition: all var(--duration-normal) ease;
}

.variety-card:hover {
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow-md);
}

.variety-card-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--spacing-md);
    background: white;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.variety-card-icon .lucide {
    width: 28px;
    height: 28px;
    color: var(--orange-peel);
}

.variety-card-title {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-xs);
}

.variety-card-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

/* ===== 新鲜度/口味评级 ===== */
.freshness-rating {
    display: inline-flex;
    gap: 4px;
}

.freshness-rating .orange-icon {
    width: 20px;
    height: 20px;
    color: var(--orange-flesh);
    opacity: 0.3;
    transition: opacity var(--duration-fast) ease;
}

.freshness-rating .orange-icon.active {
    opacity: 1;
    color: var(--orange-peel);
}

.taste-rating {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.taste-rating-label {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.taste-rating-stars {
    display: flex;
    gap: 2px;
}

.taste-rating-stars .star {
    width: 16px;
    height: 16px;
    color: var(--orange-pulp);
}

.taste-rating-stars .star.filled {
    color: var(--orange-peel);
}

/* ===== 成长时间轴 ===== */
.growth-timeline {
    position: relative;
    padding-left: 60px;
}

.growth-timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(
        to bottom,
        var(--leaf-green) 0%,
        var(--orange-flesh) 50%,
        var(--orange-peel) 100%
    );
    border-radius: 2px;
}

.growth-stage {
    position: relative;
    margin-bottom: var(--spacing-2xl);
}

.growth-stage:last-child {
    margin-bottom: 0;
}

.growth-stage-icon {
    position: absolute;
    left: -52px;
    top: 0;
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid;
    box-shadow: var(--shadow-md);
}

.growth-stage.seed .growth-stage-icon {
    border-color: var(--stem-brown);
}

.growth-stage.sprout .growth-stage-icon {
    border-color: var(--leaf-green);
}

.growth-stage.fruit .growth-stage-icon {
    border-color: var(--orange-peel);
}

.growth-stage-icon img,
.growth-stage-icon svg {
    width: 24px;
    height: 24px;
}

.growth-stage-content {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.growth-stage-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

.growth-stage-text {
    color: var(--color-text-secondary);
    line-height: 1.7;
}

/* ===== 果篮按钮（拓展阅读） ===== */
.basket-button {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--color-bg-card);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all var(--duration-normal) ease;
}

.basket-button:hover {
    background: linear-gradient(135deg, var(--orange-peel), var(--orange-flesh));
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-brand);
}

.basket-button-icon {
    width: 40px;
    height: 40px;
    background: var(--glow-subtle);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--duration-fast) ease;
}

.basket-button:hover .basket-button-icon {
    background: rgba(255, 255, 255, 0.2);
}

.basket-button-icon .lucide {
    width: 20px;
    height: 20px;
    color: var(--orange-peel);
    transition: color var(--duration-fast) ease;
}

.basket-button:hover .basket-button-icon .lucide {
    color: white;
}

.basket-button-content {
    flex: 1;
}

.basket-button-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    transition: color var(--duration-fast) ease;
}

.basket-button:hover .basket-button-label {
    color: rgba(255, 255, 255, 0.8);
}

.basket-button-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-primary);
    transition: color var(--duration-fast) ease;
}

.basket-button:hover .basket-button-text {
    color: white;
}

.basket-button-arrow {
    color: var(--color-text-muted);
    transition: all var(--duration-fast) ease;
}

.basket-button:hover .basket-button-arrow {
    color: white;
    transform: translateX(4px);
}

/* ===== 联系方式保护区域 ===== */
.contact-protected {
    min-height: 280px;
    position: relative;
}

.turnstile-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl);
    background: linear-gradient(135deg, var(--sunshine-warm) 0%, var(--orange-membrane) 100%);
    border-radius: var(--radius-xl);
    border: 2px solid var(--color-border);
}

.turnstile-hint {
    margin-top: var(--spacing-md);
    color: var(--color-text-muted);
    font-size: 0.9rem;
    text-align: center;
}

.turnstile-hint .lucide {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
}

/* ===== 头像 ===== */
.avatar-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.avatar-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--orange-peel);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.3);
    transition: all 0.3s ease;
}

.avatar-image:hover {
    box-shadow: 0 15px 40px rgba(255, 107, 53, 0.4);
    border-color: var(--orange-flesh);
}

/* ===== 页脚 ===== */
.footer {
    background: var(--surface-dark);
    color: var(--text-on-dark);
    text-align: center;
    padding: 40px 20px;
    margin-top: auto;
}

.footer-content p {
    color: var(--text-on-dark-muted);
}

.footer a {
    color: var(--text-on-dark-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: var(--orange-peel);
}

.footer-icp {
    margin-top: 8px;
    font-size: var(--text-sm);
    opacity: 0.7;
}

/* ===== 图片放大模态框 ===== */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-modal.show {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease;
    cursor: grab;
    user-select: none;
}

.modal-image:active {
    cursor: grabbing;
}

.modal-caption {
    color: white;
    text-align: center;
    margin-top: 15px;
    font-size: 16px;
    font-weight: 500;
    max-width: 80%;
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    z-index: 10001;
    position: relative;
}

.modal-close {
    position: absolute;
    top: -50px;
    right: -10px;
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.8);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    z-index: 10001;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* ===== 品牌化加载动画 ===== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--surface-primary, #FEFCFA);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease-elastic, ease), visibility 0.3s ease;
}

.page-loader.active {
    opacity: 1;
    visibility: visible;
}

.loader-content {
    text-align: center;
}

.loader-orange {
    font-size: 48px;
    display: inline-block;
    animation: orange-bounce-load 1s ease-in-out infinite;
    margin-bottom: 16px;
}

@keyframes orange-bounce-load {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    30% {
        transform: translateY(-24px) scale(1.1);
    }
    50% {
        transform: translateY(0) scale(0.95);
    }
    70% {
        transform: translateY(-8px) scale(1.02);
    }
}

.loader-text {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* ===== 加载状态 ===== */
.loading-orange {
    animation: orange-spin 1s linear infinite;
}

@keyframes orange-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--orange-membrane) 25%,
        var(--orange-pulp) 50%,
        var(--orange-membrane) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== Hero 橙子容器 ===== */
.hero-orange {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 深色模式已移除 */

/* ===== 响应式组件调整 ===== */

/* 平板及以上 */
@media (min-width: 768px) {
    .guide-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .variety-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 桌面端 */
@media (min-width: 1024px) {
    .fruit-card {
        padding: var(--spacing-2xl);
    }
}

/* 移动端简化 hover */
@media (max-width: 767px) {
    .fruit-card:hover,
    .guide-card:hover {
        transform: translateY(-2px);
    }
    
    .guide-card:hover::after {
        width: 150px;
        height: 150px;
    }
}

/* --bp-wide: 1920px */
@media (min-width: 1920px) {
    .nav-container {
        max-width: 1400px;
    }
}

/* --bp-desktop: 1440px */
@media (max-width: 1440px) {
    .nav-menu {
        gap: 24px;
    }
}

/* --bp-laptop: 1024px */
@media (max-width: 1024px) {
    .nav-container {
        height: 60px;
    }
    
    .nav-menu {
        gap: 16px;
    }
    
    .nav-link {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .nav-logo {
        font-size: 1.05rem;
    }
    
    .logo-icon {
        font-size: 1.3rem;
    }
}

/* --bp-tablet: 768px */
@media (max-width: 768px) {
    .navbar {
        top: 10px;
        left: 10px;
        right: 10px;
        border-radius: var(--radius-md);
    }
    
    .nav-container {
        height: 56px;
    }
    
    /* 移动端 Logo 缩小字号，保持完整显示 */
    .nav-logo {
        font-size: 1rem;
    }
    
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 76px;
        flex-direction: column;
        background-color: white;
        width: calc(100% - 20px);
        margin: 0 10px;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-lg);
        padding: 20px 0;
        border-radius: var(--radius-md);
        gap: 8px;
    }
    
    .nav-menu.active {
        left: 10px;
    }
    
    .nav-link {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .avatar-image {
        width: 150px;
        height: 150px;
    }
}

/* --bp-mobile: 480px */
@media (max-width: 480px) {
    .container,
    .container--narrow,
    .container--default,
    .container--wide {
        padding-inline: 16px;
    }
    
    .section,
    .section--compact,
    .section--loose,
    .section--page-header {
        padding-inline: 16px;
    }
    
    .navbar {
        top: 8px;
        left: 8px;
        right: 8px;
    }
    
    .nav-container {
        padding: 0 12px;
        height: 52px;
    }
    
    .nav-logo {
        font-size: 0.95rem;
        gap: 6px;
    }
    
    .logo-icon {
        font-size: 1.2rem;
    }
    
    .footer {
        padding: 24px 16px;
    }
}
