:root {
    /* Apple-style neutral base with Anime warmth */
    --bg-color: #fbfbfd;
    /* Apple off-white */
    --bg-warmth: #fffaf5;
    /* Subtle warm tint */
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent-color: #ffb7b2;
    /* Soft Sakura Pink */
    --accent-secondary: #a2d2ff;
    /* Soft anime sky blue */

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);

    /* Animation */
    --transition-smooth: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

body {
    background: radial-gradient(circle at 50% 0%, var(--bg-warmth), var(--bg-color));
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    background-attachment: fixed;
    background-size: cover;
    background-repeat: no-repeat;
}

/* 优化图片和媒体元素 */
img, video, canvas, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 防止文本溢出 */
p, span, div {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

/* 链接样式优化 */
a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

/* 按钮通用样式 */
button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

/* 滚动条样式优化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
}

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

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

/* Firefox 滚动条 */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.02);
}

/* Navigation */
.nav-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1000px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1rem 2rem;
    z-index: 10000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 5px;
}

/* Virtual Pet Container */
#pet-canvas-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 250px;
    z-index: 9998;
    pointer-events: none;
}

#pet-canvas-container canvas {
    pointer-events: auto;
    cursor: pointer;
    display: block;
    width: 250px;
    height: auto;
    will-change: transform, left, top;
    backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

#pet-canvas-container canvas.dragging {
    cursor: grabbing;
    transform: scale(1.05) translateZ(0);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    touch-action: none;
}

/* 桌面端拖拽时禁用Canvas事件避免闪烁 */
@media (hover: hover) and (pointer: fine) {
    #pet-canvas-container canvas.dragging {
        pointer-events: none;
    }
}

/* 移动端宠物触摸区域优化 */
#pet-canvas-container canvas:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition-smooth);
    position: relative;
}

.nav-links a:hover {
    color: var(--text-primary);
}

/* Language Switcher */
.lang-switch {
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.03);
    padding: 5px;
    border-radius: 30px;
}

.lang-btn {
    border: none;
    background: none;
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.lang-btn.active {
    background: #fff;
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Hero Section */
.hero {
    height: 60vh;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 100px 20px 40px;
    position: relative;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #1d1d1f 0%, #434344 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s var(--transition-smooth) forwards 0.2s;
}

.hero p {
    font-size: 1.5rem;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s var(--transition-smooth) forwards 0.4s;
    margin: 0 auto;
}

.scroll-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: fadeIn 1s ease forwards 2s;
}

@keyframes fadeIn {
    to {
        opacity: 0.6;
    }
}

/* Section Headers */
.section-header {
    text-align: center;
    margin: 40px 0 30px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 10px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.reveal {
    animation: fadeUp 1s var(--transition-smooth) forwards;
}

/* Floating Shapes Background */
.shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s infinite ease-in-out;
    will-change: transform;
}

.shape-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: var(--accent-color);
    animation-delay: 0s;
}

.shape-2 {
    bottom: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: var(--accent-secondary);
    animation-delay: -5s;
}

/* Content Grid Refinement */
.content-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 80px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 40px;
}

.post-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 40px;
    box-shadow: var(--glass-shadow);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.post-card:hover {
    transform: scale(1.02) translateY(-10px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.12);
    border-color: var(--accent-color);
}

.post-card h2 {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.post-date {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent-color);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.post-excerpt {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 30px;
}

/* Featured Tools Preview Area */
.tools-showcase {
    background: rgba(255, 183, 178, 0.05);
    padding: 100px 0;
    margin: 80px 0;
}

.carousel-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    overflow: hidden;
    padding: 0 60px;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    gap: 30px;
}

.tool-preview-grid {
    display: flex;
    gap: 30px;
    transition: transform 0.5s ease-in-out;
}

.tool-mini-card {
    background: white;
    border-radius: 24px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
    border: 1px solid rgba(0, 0, 0, 0.03);
    flex: 0 0 calc(50% - 15px);
    min-width: calc(50% - 15px);
}

.tool-mini-card:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 40px rgba(255, 183, 178, 0.2);
}

.tool-mini-icon {
    font-size: 2.5rem;
    background: var(--bg-warmth);
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
}

.tool-mini-info h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.tool-mini-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: var(--transition-smooth);
    z-index: 20;
}

.carousel-btn:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: 0;
}

.next-btn {
    right: 0;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.dot.active {
    background: var(--accent-color);
    transform: scale(1.2);
}

.dot:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(30px, -50px) rotate(10deg);
    }

    66% {
        transform: translate(-20px, 20px) rotate(-5deg);
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

@keyframes bounceSlow {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

.welcome-area {
    text-align: center;
    margin: -40px auto 60px;
    /* Pull up into hero slightly */
    padding: 20px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    border-radius: 60px;
    max-width: 800px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 10;
}

.welcome-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    margin: 0;
}

.cat-decoration svg {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    display: block;
}

.cat-left {
    animation: bounceSlow 4s infinite ease-in-out;
}

.cat-right {
    animation: bounceSlow 4s infinite ease-in-out 2s;
}

/* Global Form Elements */
input[type="text"],
input[type="password"],
input[type="date"],
input[type="email"],
textarea,
select {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-primary) !important;
    padding: 12px 18px !important;
    border-radius: 12px !important;
    font-size: 1rem !important;
    width: 100%;
    margin-bottom: 20px;
    transition: var(--transition-smooth);
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent-color) !important;
    background: white !important;
    box-shadow: 0 0 0 4px rgba(255, 183, 178, 0.1);
}

::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* 宠物状态面板 */
.pet-status-panel {
    position: fixed;
    left: 200px;
    bottom: 20px;
    width: 380px;
    max-height: 60vh;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    z-index: 10001;
    display: none;
    animation: panelSlideIn 0.3s ease-out;
    -webkit-overflow-scrolling: touch;
}

/* 小屏幕适配 */
@media (max-width: 768px) {
    /* 背景形状优化 - 减小尺寸提升性能 */
    .shape-1 {
        width: 300px;
        height: 300px;
    }

    .shape-2 {
        width: 350px;
        height: 350px;
    }

    /* 导航栏优化 */
    .nav-container {
        padding: 0.6rem 1rem;
        width: 95%;
        top: 10px;
        flex-wrap: nowrap;
    }
    
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.5);
        border-radius: 12px;
        transition: var(--transition-smooth);
    }
    
    .mobile-menu-btn:active {
        background: rgba(255, 255, 255, 0.8);
        transform: scale(0.95);
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 5px);
        left: 0;
        right: 0;
        background: var(--glass-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--glass-border);
        border-radius: 0 0 20px 20px;
        padding: 1.2rem;
        flex-direction: column;
        gap: 8px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        max-height: 70vh;
        overflow-y: auto;
        z-index: 10001;
    }
    
    .nav-links.active {
        display: flex;
        animation: slideDown 0.3s ease-out;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 12px 16px;
        border-radius: 12px;
        transition: var(--transition-smooth);
        font-size: 1rem;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-links a:hover,
    .nav-links a:active {
        background: rgba(0, 0, 0, 0.05);
    }
    
    .lang-switch {
        justify-content: center;
        margin-top: 8px;
        padding: 8px;
    }
    
    .lang-btn {
        padding: 8px 16px;
        min-height: 40px;
        min-width: 40px;
        font-size: 0.9rem;
    }
    
    /* 英雄区域优化 */
    .hero {
        height: 45vh;
        min-height: 320px;
        padding: 90px 20px 40px;
    }

    .hero h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero p {
        font-size: 1rem;
        line-height: 1.6;
        padding: 0 5px;
    }
    
    /* 欢迎区域优化 */
    .welcome-area {
        flex-wrap: wrap;
        margin: 0 auto 50px;
        padding: 20px 20px;
        gap: 10px;
        border-radius: 30px;
        max-width: 90%;
    }

    .welcome-text {
        font-size: 1.2rem;
        line-height: 1.4;
    }

    .cat-decoration {
        width: 50px !important;
        height: 50px !important;
    }
    
    /* 区域标题优化 */
    .section-header {
        margin: 30px 0 25px;
        padding: 0 15px;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    .section-header p {
        font-size: 0.95rem;
    }
    
    /* 轮播优化 - 改为单卡片显示 */
    .tools-showcase {
        padding: 50px 0;
        margin: 40px 0;
        max-width: 100%;
        overflow: hidden;
    }

    .carousel-container {
        padding: 0 60px;
        overflow: hidden;
        max-width: 100%;
    }

    .carousel-track {
        gap: 20px;
        padding: 0 10px;
        width: 100%;
        touch-action: pan-y;
    }
    
    .tool-mini-card {
        flex: 0 0 100%;
        min-width: calc(100% - 20px);
        max-width: 100%;
        padding: 20px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .tool-mini-icon {
        width: 55px;
        height: 55px;
        font-size: 2rem;
        flex-shrink: 0;
    }
    
    .tool-mini-info h3 {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    .tool-mini-info p {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    .carousel-btn {
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }
    
    .carousel-dots {
        margin-top: 25px;
    }
    
    .dot {
        width: 12px;
        height: 12px;
    }
    
    /* 内容网格优化 */
    .content-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 0 20px 60px;
    }
    
    .post-card {
        padding: 25px;
        border-radius: 20px;
    }
    
    .post-card h2 {
        font-size: 1.4rem;
        line-height: 1.3;
    }
    
    .post-date {
        font-size: 0.85rem;
        margin-bottom: 15px;
    }
    
    .post-excerpt {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    /* 虚拟宠物优化 */
    #pet-canvas-container {
        width: 160px;
        bottom: 10px;
        right: 10px;
    }

    #pet-canvas-container canvas {
        width: 160px;
        min-height: 160px;
        touch-action: manipulation;
    }

    .pet-status-panel {
        right: 10px;
        bottom: 180px;
        left: 10px;
        width: calc(100% - 20px);
        max-width: 340px;
        max-height: 50vh;
        font-size: 0.85rem;
        border-radius: 16px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    /* 对话框优化 */
    #pet-bubble {
        max-width: 240px;
        padding: 12px 16px;
        font-size: 14px;
        line-height: 1.4;
        border-radius: 16px;
    }
    
    /* 滚动提示优化 */
    .scroll-hint {
        font-size: 1.2rem;
        bottom: 20px;
    }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
    /* 背景形状优化 - 进一步减小尺寸 */
    .shape-1 {
        width: 250px;
        height: 250px;
        filter: blur(60px);
    }

    .shape-2 {
        width: 280px;
        height: 280px;
        filter: blur(60px);
    }

    /* 减少背景动画以提升性能 */
    .shape {
        animation-duration: 30s;
    }

    /* 导航栏进一步优化 */
    .nav-container {
        padding: 0.5rem 0.8rem;
        top: 8px;
    }
    
    .logo {
        font-size: 1rem;
    }
    
    .logo span {
        width: 16px !important;
        height: 16px !important;
    }
    
    .mobile-menu-btn {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }
    
    .nav-links {
        padding: 1rem;
        gap: 6px;
    }
    
    .nav-links a {
        padding: 10px 14px;
        font-size: 0.95rem;
        min-height: 44px;
    }
    
    .lang-switch {
        padding: 6px;
        gap: 6px;
    }
    
    .lang-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    /* 英雄区域 */
    .hero {
        height: 40vh;
        min-height: 280px;
        padding: 80px 15px 35px;
    }

    .hero h1 {
        font-size: 1.6rem;
        line-height: 1.2;
    }

    .hero p {
        font-size: 0.9rem;
        padding: 0 5px;
    }
    
    /* 欢迎区域 */
    .welcome-area {
        margin: 0 auto 30px;
        padding: 18px 15px;
        border-radius: 25px;
    }

    .welcome-text {
        font-size: 1.05rem;
    }

    .cat-decoration {
        display: none;
    }
    
    /* 区域标题 */
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .section-header p {
        font-size: 0.9rem;
    }
    
    /* 轮播 */
    .tools-showcase {
        padding: 40px 0;
        margin: 30px 0;
        max-width: 100%;
        overflow: hidden;
    }

    .carousel-container {
        padding: 0 55px;
        overflow: hidden;
        max-width: 100%;
    }

    .carousel-track {
        gap: 15px;
        padding: 0 5px;
        width: 100%;
    }

    .tool-mini-card {
        padding: 18px;
        flex: 0 0 100%;
        min-width: calc(100% - 10px);
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .tool-mini-icon {
        width: 50px;
        height: 50px;
        font-size: 1.8rem;
    }

    .tool-mini-info h3 {
        font-size: 1rem;
    }

    .tool-mini-info p {
        font-size: 0.8rem;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    /* 内容网格 */
    .content-grid {
        gap: 20px;
        padding: 0 15px 40px;
    }

    .post-card {
        padding: 20px;
        border-radius: 16px;
    }

    .post-card h2 {
        font-size: 1.25rem;
    }

    .post-excerpt {
        font-size: 0.9rem;
    }
    
    /* 虚拟宠物 */
    #pet-canvas-container {
        width: 140px;
        bottom: 8px;
        right: 8px;
    }

    #pet-canvas-container canvas {
        width: 140px;
        min-height: 140px;
        touch-action: manipulation;
    }

    .pet-status-panel {
        right: 8px;
        bottom: 160px;
        left: 8px;
        width: calc(100% - 16px);
        max-width: 300px;
        max-height: 45vh;
        font-size: 0.8rem;
        border-radius: 14px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .pet-status-panel .panel-header {
        padding: 8px 12px;
    }

    .pet-status-panel .panel-body {
        padding: 10px 12px;
    }

    .pet-status-panel .stat-label,
    .pet-status-panel .info-row,
    .pet-status-panel .action-btn {
        font-size: 0.8rem;
    }

    .pet-status-panel .action-buttons {
        gap: 6px;
    }

    .pet-status-panel .action-btn {
        padding: 8px 4px;
        font-size: 0.75rem;
        min-height: 56px;
        min-width: 56px;
    }

    .pet-status-panel .quick-actions {
        margin-top: 15px;
        padding-top: 12px;
    }

    .pet-status-panel .action-title {
        font-size: 0.75rem;
        margin-bottom: 8px;
    }
    
    /* 对话框 */
    #pet-bubble {
        max-width: 200px;
        padding: 10px 14px;
        font-size: 13px;
        border-radius: 14px;
    }
    
    /* 滚动提示 */
    .scroll-hint {
        font-size: 1rem;
        bottom: 15px;
    }
}

/* 小型平板适配 */
@media (min-width: 481px) and (max-width: 768px) {
    .content-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .carousel-track {
        gap: 20px;
    }
    
    .tool-mini-card {
        flex: 0 0 calc(50% - 10px);
        min-width: calc(50% - 10px);
    }
}

/* 横屏优化 */
@media (max-width: 768px) and (orientation: landscape) {
    /* 背景形状优化 - 横屏时调整位置 */
    .shape-1 {
        width: 350px;
        height: 350px;
        top: -5%;
    }

    .shape-2 {
        width: 400px;
        height: 400px;
        bottom: -5%;
    }

    .hero {
        height: 40vh;
        min-height: 300px;
    }

    #pet-canvas-container {
        width: 150px;
        bottom: 10px;
    }

    #pet-canvas-container canvas {
        width: 150px;
    }

    .nav-links {
        max-height: 60vh;
    }
}

/* 刘海屏和圆角屏适配 */
@supports (padding: env(safe-area-inset-top)) {
    .nav-container {
        padding-top: max(10px, env(safe-area-inset-top));
    }

    .pet-status-panel {
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .mobile-menu-btn {
        padding-bottom: max(0, env(safe-area-inset-bottom));
    }
}

/* 手机端宠物状态面板位置动态调整 */
@media (max-width: 768px) {
    @supports (padding-bottom: env(safe-area-inset-bottom)) {
        .pet-status-panel {
            bottom: max(180px, 160px + env(safe-area-inset-bottom));
            max-height: calc(100vh - 200px - env(safe-area-inset-bottom));
        }
    }
}

@media (max-width: 480px) {
    @supports (padding-bottom: env(safe-area-inset-bottom)) {
        .pet-status-panel {
            bottom: max(160px, 140px + env(safe-area-inset-bottom));
            max-height: calc(100vh - 180px - env(safe-area-inset-bottom));
        }
    }
}

/* iOS 底部安全区域 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    #pet-canvas-container {
        bottom: max(10px, env(safe-area-inset-bottom) + 10px);
    }
}

/* 减少移动端动画以提升性能 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    /* 减少背景模糊效果以提升性能 */
    .shape {
        filter: blur(40px);
    }
}

/* 低性能设备优化 */
@media (hover: none) and (pointer: coarse) and (max-width: 768px) {
    /* 减少背景模糊和动画以提升性能 */
    .shape {
        filter: blur(50px);
        opacity: 0.5;
    }

    .shape-1 {
        width: 280px;
        height: 280px;
    }

    .shape-2 {
        width: 320px;
        height: 320px;
    }
}

/* 暗黑模式适配（可选） */
@media (prefers-color-scheme: dark) {
    /* 这里可以添加暗黑模式的样式覆盖 */
    /* 暂时保持浅色主题，但为未来扩展预留 */
}

/* 高对比度模式适配 */
@media (prefers-contrast: high) {
    .nav-container,
    .post-card,
    .tool-mini-card {
        border-width: 2px;
    }
    
    .text-primary {
        color: #000;
    }
    
    .text-secondary {
        color: #333;
    }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    /* 增大触摸目标 */
    .nav-links a,
    .carousel-btn,
    .tool-mini-card,
    .tab-btn,
    .lang-btn,
    .mobile-menu-btn,
    .dot,
    .action-btn,
    .panel-close {
        min-height: 44px;
        min-width: 44px;
        position: relative;
    }
    
    /* 卡片触摸优化 */
    .tool-mini-card {
        position: relative;
    }
    
    .tool-mini-card::after {
        content: '';
        position: absolute;
        top: -10px;
        left: -10px;
        right: -10px;
        bottom: -10px;
        pointer-events: none;
    }
    
    /* 去除悬停效果，保留点击效果 */
    .tool-mini-card:hover,
    .nav-links a:hover,
    .carousel-btn:hover {
        transform: none;
    }
    
    /* 增加点击反馈 */
    .carousel-btn:active,
    .lang-btn:active,
    .tab-btn:active {
        transform: scale(0.95);
        opacity: 0.8;
    }
    
    .tool-mini-card:active {
        transform: scale(0.98);
        box-shadow: 0 10px 20px rgba(255, 183, 178, 0.15);
    }
    
    .nav-links a:active {
        background: rgba(0, 0, 0, 0.08);
    }
    
    .dot:active {
        transform: scale(1.3);
    }
    
    /* 防止双击缩放 - 仅应用于表单元素 */
    input, textarea, select {
        touch-action: manipulation;
    }
    
    /* 交互式元素保持默认行为以支持自定义触摸处理 */
    a, button {
        touch-action: auto;
    }
    
    /* 滚动容器优化 */
    .nav-links,
    .pet-status-panel,
    .chat-history {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }
}

/* 通用触摸反馈（所有设备） */
* {
    -webkit-tap-highlight-color: transparent;
}

button, a, input, textarea, select {
    outline: none;
}

button:focus-visible, a:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

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

@keyframes bubbleIn {
    from {
        opacity: 0;
        transform: translateX(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* #pet-bubble 的 pointer-events 规则已移除，允许对话框交互 */

.pet-status-panel.show {
    display: block;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.panel-tabs {
    display: flex;
    gap: 8px;
    flex: 1;
}

.tab-btn {
    padding: 8px 16px;
    background: none;
    border: none;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.tab-btn.active {
    background: linear-gradient(135deg, #FFB7B2, #A2D2FF);
    color: white;
}

.panel-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.panel-body {
    padding: 16px 20px;
}

.tab-content {
    display: none;
}

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

.chat-section-full {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-item {
    margin-bottom: 12px;
}

.stat-label {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.stat-icon {
    margin-right: 6px;
    font-size: 0.9rem;
}

.stat-bar {
    position: relative;
    height: 6px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.stat-progress {
    height: 100%;
    background: linear-gradient(90deg, #ffb7b2, #ffd700);
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
}

.stat-progress.exp-progress {
    background: linear-gradient(90deg, #a855f7, #6366f1);
}

.stat-bar.exp-bar {
    background: rgba(139, 92, 246, 0.15);
}

.stat-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.stat-value {
    position: absolute;
    right: 0;
    top: -18px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.05);
    margin: 12px 0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 4px 0;
}

.info-row strong {
    color: var(--text-primary);
}

/* 快捷操作 */
.pet-status-panel .quick-actions {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.pet-status-panel .action-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pet-status-panel .action-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.pet-status-panel .action-btn {
    padding: 12px 8px;
    border: none;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-height: 64px;
    min-width: 64px;
    touch-action: manipulation;
}

.pet-status-panel .action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pet-status-panel .action-btn:active {
    transform: translateY(0);
}

.pet-status-panel .food-btn {
    background: linear-gradient(135deg, #ffecd2, #fcb69f);
    color: #8b4513;
}

.pet-status-panel .drink-btn {
    background: linear-gradient(135deg, #a8edea, #fed6e3);
    color: #00695c;
}

.pet-status-panel .medicine-btn {
    background: linear-gradient(135deg, #d299c2, #fef9d7);
    color: #6b21a8;
}

/* 对话界面样式 */
.chat-section-full .chat-history {
    height: 250px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid var(--glass-border);
    border-radius: 15px;
    padding: 15px;
}

.chat-section-full .chat-history::-webkit-scrollbar {
    width: 6px;
}

.chat-section-full .chat-history::-webkit-scrollbar-track {
    background: transparent;
}

.chat-section-full .chat-history::-webkit-scrollbar-thumb {
    background: rgba(180, 150, 120, 0.3);
    border-radius: 3px;
}

.chat-section-full .chat-history::-webkit-scrollbar-thumb:hover {
    background: rgba(180, 150, 120, 0.5);
}

.chat-section-full .chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
}

.chat-section-full .chat-empty p {
    margin: 5px 0;
}

.chat-section-full .chat-input-area {
    display: flex;
    gap: 10px;
}

.chat-section-full .chat-input {
    flex: 1;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid var(--glass-border);
    border-radius: 20px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s;
    color: var(--text-primary);
}

.chat-section-full .chat-input:focus {
    border-color: var(--accent-color);
    background: white;
}

.chat-section-full .chat-input::placeholder {
    color: var(--text-muted);
}

.chat-section-full .chat-send-btn {
    padding: 12px 24px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.chat-section-full .chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 183, 178, 0.3);
}

.chat-section-full .chat-actions {
    text-align: right;
}

.chat-section-full .chat-clear-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 5px 10px;
    transition: all 0.3s;
}

.chat-section-full .chat-clear-btn:hover {    color: var(--accent-color);    text-decoration: underline;}/* 宠物对话框样式 */#pet-bubble {    position: fixed;    max-width: 300px;    padding: 16px 20px;    background: linear-gradient(135deg, #ffb7b2 0%, #ffdac1 100%);    color: white;    border-radius: 18px;    font-size: 16px;    font-weight: 500;    z-index: 10002;    box-shadow: 0 10px 30px rgba(0,0,0,0.2);    backdrop-filter: blur(10px);    border: 2px solid rgba(255,255,255,0.2);    word-wrap: break-word;    line-height: 1.5;    opacity: 0;    transform: translateY(20px) scale(0.9);    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);}/* 对话箭头 */#pet-bubble::after {    content: '';    position: absolute;    top: 100%;    left: 50%;    transform: translateX(-50%);    border: 12px solid transparent;    border-top-color: #ffb7b2;}/* 对话框显示状态 */#pet-bubble.show {    opacity: 1;    transform: translateY(0) scale(1);}/* 对话框隐藏状态 */#pet-bubble.hide {    opacity: 0;    transform: translateY(-20px) scale(0.9);}/* 网站底部备案信息 */.site-footer {    background: var(--glass-bg);    backdrop-filter: blur(10px);    border-top: 1px solid var(--glass-border);    padding: 24px 20px;    margin-top: 60px;    text-align: center;}.footer-content {    max-width: 800px;    margin: 0 auto;}.footer-copyright {    color: var(--text-secondary);    font-size: 0.9rem;    margin-bottom: 8px;}.footer-icp {    font-size: 0.85rem;}.footer-icp a {    color: var(--text-secondary);    text-decoration: none;    transition: color 0.3s ease;}.footer-icp a:hover {    color: var(--accent-color);}